logo
English
English
API ReferenceSign In

6. Handling Invalid/Expired Tokens

Last updated 06/11/2020

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 (before the expiry happens)

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

<strong>Expiring Payment Method - Callback Object</strong>
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
<strong>Expiring Payment Method </strong>- <strong>Sample Callback Object</strong>
json
{ "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 (after the expiry happened)

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

<strong>Invalid/Expired Payment Method - Callback Object</strong>
NameDescription
eventpayment_method.expiry.expired
timestampTimestamp of the event
<strong>Invalid/Expired Payment Method - Sample Callback Object</strong>
json
{ "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" }
Was this page helpful?
Yes No