Split a payment between balance accounts
POST {{baseUrl}}/sessions
Creates a payment session for Web Drop-in and Web Components integrations. The response contains encrypted payment session data. The front end then uses the session data to make any required server-side calls for the payment flow. You get the payment outcome asynchronously, in an AUTHORISATION webhook.
Request Body
{"amount"=>{"value"=>40000, "currency"=>"USD"}, "reference"=>"{{$guid}}", "merchantAccount"=>"{{YOUR_MERCHANT_ACCOUNT}}", "returnUrl"=>"https://your-company.com/...", "splits"=>[{"amount"=>{"value"=>39200}, "type"=>"BalanceAccount", "account"=>"BA00000000000000000000001", "reference"=>"Your reference for the sale amount", "description"=>"Your description for the sale amount"}, {"amount"=>{"value"=>400}, "type"=>"Commission", "reference"=>"Your reference for the commission", "description"=>"Your description for the commission"}, {"amount"=>{"value"=>400}, "account"=>"BA00000000000000000000001", "reference"=>"Your reference for the fees", "description"=>"Your description for the fees", "type"=>"PaymentFee"}]}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string | ||
Accept | string | ||
Idempotency-Key | null | A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). |
RESPONSES
status: Created
{"amount":{"currency":"USD","value":40000},"expiresAt":"2023-06-26T11:01:55+02:00","id":"CSFCBC80570618EF2C","merchantAccount":"YOUR_MERCHANT_ACCOUNT","reference":"YOUR_ORDER_NUMBER","returnUrl":"https://your-company.com/...","shopperLocale":"en-US","splits":[{"account":"BA00000000000000000000001","amount":{"value":39200},"description":"Your description for the sale amount","reference":"Your reference for the sale amount","type":"BalanceAccount"},{"amount":{"value":400},"description":"Your description for the commission","reference":"Your reference for the commission","type":"Commission"},{"amount":{"value":400},"account":"BA00000000000000000000001","description":"Your description for the fees","reference":"Your reference for the fees","type":"PaymentFee"}],"mode":"embedded","sessionData":"Ab02b4c0!BQABAgCjTErwAztqXSFTiZtxZMjRLYkoGbPkmvCvDX1"}