Brick API Documentation
Send Money

Quick Start for Disbursement API

Before you start:

  1. Review Prepare Yourself to Use API before starting the integration.
  2. You can test the API using Try Brick API with Postman.

Create Your First Disbursement

For this quick start, use the regular disbursement method. Brick supports two disbursement methods: Regular and BI-FAST.

1. Generate a public access token - API reference

Public access token is the authentication token used in further API calls for Send Money and Receive Money APIs. This public access token is generated using the API credential Client ID and Client Secret that you get from the preparation section.

📘 Limitation of public access token

This API gives you a public access token that is only valid to be used 1 time and only for the next 5 minutes. If expired, you need to generate new public access token.

2. Verify the recipient account - API reference

Verify the recipient account before creating a disbursement. This helps prevent failures caused by invalid bank codes, invalid account numbers, or mismatched account holder details.

📘 List Bank Account Destination

If you need to check which payout destinations are covered by Brick, see Disbursement Coverage. Brick currently verifies bank account destinations, not Ewallet destinations.

3. Create the disbursement - Regular API reference

Use this endpoint to send money to the recipient account. Generate a new public access token as described in step 1, then use the new token for the disbursement API call.

You need to provide payment and recipient details. The example below shows the basic request structure:

Code
curl --request POST \ --url https://sandbox.onebrick.io/v2/payments/gs/disbursements \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'publicAccessToken: Bearer {{publicAccessToken}}' \ --data ' { "referenceId": "test-disbursement-1", "description": "test-disbursement-1", "amount": 10000, "disbursementMethod": { "type": "bank_transfer", "bankShortCode": "MANDIRI", "bankAccountNo": "12345678", "bankAccountHolderName": "PROD ONLY" } } '

If the request is valid, the response will show the disbursement status as processing.

JSONCode
{ "status": 200, "data": { "message": "We have received your request and are processing it, please check your callback URL for transaction status", "id": "asdasd123123asdasdasd", "type": "disbursement", "attributes": { "referenceId": "test-disbursement-1", "description": "test-disbursement-1", "amount": "10000", "status": "processing", "createdAt": "2022-07-21T13:49:39.752+07:00", "disbursementMethod": { "type": "bank_transfer", "bankAccountNo": "12345678", "bankShortCode": "BCA", "bankAccountHolderName": "PROD ONLY" } } }, "metaData": { "source": "API", "entity": "Payment" }, "error": null }

Disbursement processing depends on the destination bank. Brick will send the updated status to the callback URL you configured.

4. Receive the callback status

Disbursement usually takes a few seconds to reach the recipient bank account. After Brick receives bank confirmation that the transfer has completed, Brick sends the updated status to your callback URL:

JSONCode
{ "data": { "id": "asdasd123123asdasdasd", "type": "disbursement", "attributes": { "referenceId": "test-disbursement-1", "description": "test-disbursement-1", "amount": "10000", "status": "completed", "createdAt": "2022-07-21T13:49:39.752+07:00", "disbursementMethod": { "type": "bank_transfer", "bankAccountNo": "12345678", "bankShortCode": "BCA", "bankAccountHolderName": "PROD ONLY", "bankName" : "Bank Central Asia" } } } }
JSONCode
{ "data": { "id": "9cb8ba6c8aa644ff9a433ace9", "type": "disbursement", "attributes": { "referenceId": "ps-123456", "description": "Good Luck", "amount": "10000", "status": "failed", "settlementStatus": null, "createdAt": "2025-02-12T16:25:11.000+07:00", "errorCode": "5000100", "errorReason": "General Error", "errorDetail": { "code": "general_error", "message": "General Error", "action": "Please try again later or contact support if the issue persists.", "reason": "A general error occurred while processing the request. This may be due to a temporary issue on our end." }, "disbursementMethod": { "type": "bank_transfer", "bankAccountNo": "010800041187", "bankShortCode": "BCA", "bankAccountHolderName": "Bambang Subambang", "bankName": "BCA" } } } }

You can handle the behavior later for status completed or also check how to handling errors case.

5. Going live to production

After you complete development and are ready to move to production, review the Production Checklist.

Last modified on