Direct debit enables you to accept payments seamlessly by:
- Linking your customer’s bank accounts safely, supporting repeat and subsequent purchases
- Pulling funds directly from your customer’s bank account, completing payments on the same platform
- Settling funds instantly, allowing better visibility and immediate access to your funds.
Here's the simple direct debit API flows:
Some keywords that will help you in the following steps
- Customer ID
- LAT: Linked Account Token, the ID will have “lat-” as the prefix
- LA: Linked Account ID will have “la-” as the prefix
- PM: The ID will have “pm-” as the prefix
- Direct Debit Payment ID: the id would have “ddpy-”
- Send request to POST https://api.xendit.co/customers
- Use version 2020-05-19
- Body request (as the example below)
- Then, you will get the response as below
Step 2. Initiated Linked Account Token
- Send request to POST https://api.xendit.co/linked_account_tokens/auth
- Retrieve the customer ID from the previous request
- Body request (as the example below)
- Then, you will get the response as below
Step 3. Validate OTP for Linked Account Token
- Send request to POST https://api.xendit.co/linked_account_tokens/lat-a26ad044-d698-4e20-85fc-7d93fa267f93/validate_otp
- Open the Binding - Validate OTP for Linked Account Token request
- Add the LAT from step 2 into the endpoint
- Set the OTP Code as “333000”
Step 4. GET Bank Account Token
- Send request to POST https://api.xendit.co/linked_account_tokens/{linked_account_token_id}/accounts
- Enter the Linked Account Token (LAT) ID from the initiate LAT response
- Put the ID in the endpoint, like below
- The request should be GET
Example of body request:
Example of response:
- Using this endpoint: https://api.xendit.co/payment_methods
- Provide the Customer ID from step 1 as “customer_id”
- Add the LA ID from step 4 in the “id” under “properties”
- Make sure the type is “debit_card”
Example of body request:
Example of response:
Step 6a. Create Payment (One Time Payment) if without OTP
Note: Maximum amount that can be charged without OTP is 999,999
- Using this endpoint: https://api.xendit.co/direct_debits
- Use the payment_method_id from step 5
- Use currency as IDR
- Set the callback URL
Example of body request:
Example of response:
Step 6b. Create Payment (One Time Payment) with OTP
Note: Minimum amount that can be charged with OTP is 1,000,000
- Using this endpoint: https://api.xendit.co/direct_debits
- Use the payment_method_id from step 5
- Use currency as IDR
- Set the callback URL
- Set enable OTP as true
Example of body request:
Example of response:
- Using this endpoint: https://api.xendit.co/direct_debits/ddpy-16bc8826-fbd9-4ce4-a2fb-e48117dada0f/validate_otp/
- Add the DDPY into the endpoint of the request
- Set the OTP to be “222000”, please also take a look at this other OTP codes
- Completed means your payment is successful and please kindly check your Xendit dashboard
Example of body request and response:
(Optional) Step 8. Recurring Payment
- Set the OTP to be “222000”, please also take a look at this other OTP codes
- Completed means your payment is successful and please kindly check your Xendit dashboard
Example of body request:
If you need any assistance during this simulation, please do not be hesitate to contact us via live chat or email: help@xendit.co