Creating Payouts via API

Create Payout

Use the Create Payouts API to send funds from your account balance to your designated recipient bank or e-wallet account.

We have prefilled the below request with a sample API key. You should use your secret key which can be generated on your Dashboard. Once your call hits our servers, we return a response. Assuming the inputs are all valid, we will return a payout with an “ACCEPTED” status. This means that we have received the payout. If you get errors, please refer to our Errors section to understand why.

{
  "reference_id": "test-transaction-010121",
  "channel_code": "ID_MANDIRI",
  "channel_properties" : {
    "account_holder_name": "Testing",
    "account_number”: "1231231231231"
  },
  "amount": 10000,
  "description": "Test Txn 001",
  "currency": "IDR"
}

The payout status can be tracked using a callback. When the payout has been successfully succeeded or failed, you’ll receive a callback.

{
  "id": "disb-b4de62fb-e6b4-4260-8346-96a162e18e15",
  "amount": 10000,
  "channel_code": "ID_MANDIRI",
  "currency": "IDR",
  "description": "Test Txn 001",
  "reference_id": "test-transaction-010121",
  "status": "ACCEPTED",
  "created": "2022-01-20TO3:45:23.637Z",
  "updated": "2022-01-20T03:45:23.637Z",
  "estimated_arrivaltime": "2022-01-20T04:00:23.635Z",
  "business_id': "61075d264db00a40a9680753",
  "channel_properties": {
    "account_number": "1231231231231",
    "account_holder_name": "Testing"
  }
}

If the payout fails for any reason, the bank will refund the money and we will refund this to your account. If the payout cannot be completed, the status of the disbursement will be “FAILED”. The “failure_code” property indicates why.

Cancel Payout

Use the Cancel Payouts API to cancel transactions that have not been processed by Xendit’s partners.

We have prefilled the below request with a sample API key. Similar to creating a payout, you should use your generated secret key from the Dashboard to initiate a cancellation request. Payouts to banks and e-wallets can only be cancelled if the status is ACCEPTED. It is recommended to refer to the Get Payout APIs to know if a payout is still cancellable or not. Upon request of cancellation, we will return a response with a “CANCELLED” status. This means that we have received the cancellation request and funds should be expected back to your available balance within 5 minutes.

MethodURL
POSThttps://api.xendit.co/v2/payouts/disb-faa0d8c5-b4fc-4fc4-8809-5981cae2c4cf/cancel
{
  "id": "disb-faaOd8c5-b4fc-4fc4-8809-5981cae2c4cf",
  "amount": 50000,
  "channel_code": "ID_CHANNEL",
  "currency": "IDR",
  "description": "E2E OTC",
  "reference_id": "E2E-OTC",
  "status": "CANCELLED",
  "created": "2022-01-16T12:11:22.233Z",
  "updated": "2022-01-16T12:21:31.373Z",
  "estimated_arrival_time": "2022-01-16T12:26:22.155Z",
  "business_id": "61075d264db00a40a9680753",
  "channel_properties": {
    "payout_code": "9687530162381009082189137",
    "recipient_given_names": "Park Jimin",
    "recipient_surname": "Park Jimin",
    "expires_at": "2022-01-23T12:11:22.156Z"
  }
}

If the cancellation fails for any reason, we will be sending back the corresponding reason for failure and funds and fees will remain in your pending balance until it reaches its final status from the partner (Succeeded or Failed). The common reasons may be due to invalid request of a payout that does not exist, or the payout is already being processed by the partner.

Last Updated on 2023-06-30