Handling Invalid/Expired Tokens

There are scenarios where merchants need to re-initiate authorization. There are two ways on how the merchant is notified of invalid tokens:

  1. During direct debit. If the response has the failure reason: INVALID_PAYMENT_METHOD_ERROR
  2. Via callback. Merchant may provide Xendit an endpoint for Xendit to send a POST request notifying the merchant that this specific account has been determined to be expiring or has become invalid. The callback parameters are specified below:

Expiring Payment Method

Sends a callback object when a certain access token tied to a payment method is determined to be expiring.

Expiring Payment Method - Callback Object

NameDescription
eventpayment_method.expiry.expiring
timestampTimestamp of the event
idID for particular authorization (payment method)
customer_idXendit-generated customer ID
expiration_timestampTimestamp when the token will expire

>Expiring Payment Method - Sample Callback Object

{
    "event": "payment_method.expiry.expiring",
    "timestamp": "2020-03-27T05:45:06+0800",
    "id": "lat-aa620619-124f-41db-995b-66a52abe036a",
    "customer_id": "cus-239c16f4-866d-43e8-9341-7badafbc019f",
    "expiration_timestamp": "2020-03-29T05:45:06+0800"
}

Invalid/Expired Payment Method

Sends a callback object when a certain access token tied to a payment method is determined to be invalid.

Invalid/Expired Payment Method - Callback Object

NameDescription
eventpayment_method.expiry.expired
timestampTimestamp of the event

Invalid/Expired Payment Method - Sample Callback Object

{
    "event": "payment_method.expiry.expired",
    "timestamp": "2020-03-27T05:45:06+0800",
    "id": "pmthd-c30d4800-afe4-4e58-ad5f-cc006d169139",
    "customer_id": "cus-239c16f4-866d-43e8-9341-7badafbc019f"
}

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-20