POST
/
v1
/
pay
/
withdrawals
/
intent
curl --request POST \
  --url https://api.onsi.com/v1/pay/withdrawals/intent \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '{
  "memberId": "mem_<id>",
  "amount": {
    "amount": 1050,
    "currency": "GBP"
  }
}'
{
  "withdrawalIntentId": "wi_<id>",
  "netAmount": {
    "currency": "GBP",
    "amount": 950
  },
  "fee": {
    "currency": "GBP",
    "amount": 50
  },
  "accountDetails": {
    "accountHolder": "John Smith",
    "sortCode": "123456",
    "accountNumber": "12345678"
  },
  "bankAccount": {
    "lastFour": "5678"
  }
}

Create a withdrawal intent given an intended withdrawal amount, and the member who will receive the funds.

We will process the request, calculate the fee (dependant on the member’s tier) and return:

  • netAmount - a Money object representing the amount that will be transferred to the member
  • fee - a Money object representing the fee that will be charged
  • accountDetails - An object containing the bank account details the netAmount will be transferred to

Please see the On Demand Pay documentation for more information on the lifecycle of a withdrawal intent.

Relevant Error Codes

The endpoint-specific error codes to pay attention to are:

Authorizations

X-API-KEY
string
header
required

Headers

x-idempotency-key
string

Unique key to ensure idempotency of the request

Body

application/json
Body
memberId
string
required

The unique identifier for a Member, prefixed with mem_

Example:

"mem_<id>"

amount
object
required

A monetary value with currency.

Response

201 - application/json
201
withdrawalIntentId
string
required

The unique identifier for a PayWithdrawalIntent, prefixed with wi_

Example:

"wi_<id>"

netAmount
object
required

A monetary value with currency.

Example:
{ "currency": "GBP", "amount": 950 }
fee
object
required

A monetary value with currency.

Example:
{ "currency": "GBP", "amount": 50 }
accountDetails
object
required
Example:
{
  "accountHolder": "John Smith",
  "sortCode": "123456",
  "accountNumber": "12345678"
}
bankAccount
object
requireddeprecated

Deprecated in favour of bankAccount