Account Unlinking

There are 2 types of unlinking that direct debit supports: direct unlinking and unlinking with confirmation. Here are the steps to test your Direct Debit integration

INFO

Only KrungThai Bank (KTB) that required for unlinking with confirmation. The other payment channels are using direct unlinking.

Direct Unlinking

Positive Scenarios

Follow this 1 simple step to unlink.

Unlink Bank Account

Send a DELETE to `/linked-account-tokens/:id/` with non-KTB linked account token id as path param and success_redirect_url and failure_redirect_url as query params.

This should return a successful unlinked account token response.

{
  "id": "lat-aa620619-124f-41db-995b-66a52abe036a",
  "is_deleted": true
}

Negative Scenarios

There are couple of negative scenarios you will need to handle.

Linked account token not found

Send a DELETE to `/linked_account_tokens/:id` with an inactive or invalid linked account token id as path param and success_redirect_url and failure_redirect_url as query params.

This should return an error: 404 DATA_NOT_FOUND_ERROR.

Unlinking with Confirmation

Positive Scenarios

1. Initiate Unlink Bank Account

Send a DELETE to `/linked_account_tokens/:id` with KTB linked account token id as path param and success_redirect_url and failure_redirect_url as query params.

This should return an authorizer_url and the status is not deleted yet. Use authorizer_url for next step.

{
  "id": "lat-aa620619-124f-41db-995b-66a52abe036a",
  "is_deleted": false,
  "authorizer_url": "https://link-web.xendit.co/oauth/lat-aa620619-124f-41db-995b-66a52abe036a/confirm_unlink"
}

2. Authorize Unlinking

Use authorizer_url from the previous step and redirect the users to the URL to authorize the unlinking.

Upon successful authorization, user will be redirected back to success_redirect_url.

Negative Scenarios

Invalid success_redirect_url and failure_redirect_url on KTB

Send a DELETE to `/linked_account_tokens/:id` with KTB linked account token id as path param without success_redirect_url and failure_redirect_url as query params.

This should return an error: 400 API_VALIDATION_ERROR.

User didn't authorize unlinking

To simulate an user didn't authorize their bank account, create a new initiate unlinking request and put the wrong OTP during the unlinking.

Upon failed authorization, user will be redirected back to failure_redirect_url.

Linked account token not found

Send a DELETE to `/linked_account_tokens/:id` with an inactive or invalid linked account token id as path param and success_redirect_url and failure_redirect_url as query params.

This should return an error: 404 DATA_NOT_FOUND_ERROR.

Need more assistance? Feel free to reach out to our Customer Success or your Indonesia or Philippines Xendit Sales for further assistance.

Last Updated on 2023-05-22