English
API ReferenceSign In

Payment Scenarios

Last updated 09/20/2021

Payment Scenarios

Xendit supports multiple payment scenarios in the Test environment that allows you to simulate how various successes and failures would occur and how you can handle them in Production. Refer to the list of supported scenarios below for testing.

When you trigger a POST to /direct_debits/, change the amount parameter in your request body to simulate the following scenarios:

  • 11000 - “503 CHANNEL AVAILABLE” : channel is experiencing downtime
  • 11001 - “MAX_AMOUNT_LIMIT_ERROR” : transaction exceeds the channel’s allowed daily limit
  • 11002 - “INSUFFICIENT_BALANCE” : end-customer’s balance is insufficient for the transaction
  • 11003 - “OTP_DELIVERY_ERROR” : channel failed to send an OTP to the end-customer
  • 11004 - “ACCOUNT_ACCESS_BLOCKED” : channel has blocked access to the account
  • 12003 - to simulate a payment where in OTP is not required (for channel BA_BDO)

The failure codes above will be returned in a payment failure webhook.

OTP Scenarios

When you trigger a POST to /direct_debits/{direct_debit_id}/validate_otp , change the otp_code parameter in your request body to simulate the following scenarios:

  • “222000” - successful payment using a correct OTP
  • “222001” - “400 EXPIRED_OTP_ERROR” : expired OTP
  • “222002” - “400 MAX_OTP_ATTEMPTS_ERROR” : end-customer reaches the channel’s limit on OTP attempts
  • “222003” - “400 INVALID_OTP_ERROR” : incorrect OTP
  • “222004” - successful payment using a correct OTP (for channel BA_BDO)
  • “{{Any code not specified above}}” - “400 INVALID_OTP_ERROR” : incorrect OTP

When testing in production, trigger a POST to /direct_debits/{direct_debit_id}/resend_otp should you need to request a new OTP.

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