Applies to both merchants in Indonesia and Philippines
Here are the steps on how to cancel PayLater charge and simulate:
Things to remember below:
- Perform a cancel for a Paylater charge by Charge ID. This endpoint will only work for charges created via the /paylater/charge
endpoint.
- A cancellation of a Paylater transaction will make the payments URL inaccessible to the end customer in real time. Xendit does not send callbacks when for the cancellation endpoint
- KREDIVO is a unique case where the payments URL will still be accessible to end customers post calling the cancellation API. If the customer were to attempt a payment, the credit will automatically be refunded and they will be redirected to the failure_redirect_url
.
1. Create Cancel PayLater charge using this endpoint:
POST
https://api.xendit.co/paylater/charges/:id/cancel
2. In the path parameters, it is required to put the ID.
- ID is the unique identifier for charge request transaction (returned as id
in the PayLater Charge request with prefix plc_)
3. You will get this response parameters afterwards:
{
"id": "plc_dba5c626-10c4-4571-a13e-d1c271b13ccb",
"business_id": "6023480283321d40fff8cb84",
"reference_id": "order_id_234",
"customer_id": "a81da455-c742-4c2c-84f4-c63c7ea383ff",
"plan_id": "plp_5ed871e4-48e7-43ae-8fff-c14eb1ddd154",
"currency": "PHP",
"amount": 50,
"channel_code": "PH_BILLEASE",
"checkout_method": "ONE_TIME_PAYMENT",
"status": "CANCELLED",
"actions": {
"mobile_web_checkout_url": "https://paylater-mock-connector-dev.xendit.co/checkout?charge_id=dba5c626-10c4-4571-a13e-d1c271b13ccb&connector_reference_id=872a9271-72d6-426e-ad72-da994d6103c1&business_id=6023480283321d40fff8cb84",
"desktop_web_checkout_url": "https://paylater-mock-connector-dev.xendit.co/checkout?charge_id=dba5c626-10c4-4571-a13e-d1c271b13ccb&connector_reference_id=872a9271-72d6-426e-ad72-da994d6103c1&business_id=6023480283321d40fff8cb84",
"mobile_deeplink_checkout_url": "https://paylater-mock-connector-dev.xendit.co/checkout?charge_id=dba5c626-10c4-4571-a13e-d1c271b13ccb&connector_reference_id=872a9271-72d6-426e-ad72-da994d6103c1&business_id=6023480283321d40fff8cb84"
},
"expires_at": "2023-04-06T10:57:11.197Z",
"success_redirect_url": "https://google.com",
"failure_redirect_url": "https://twitter.com",
"callback_url": "https://testpaylater.free.beeceptor.com",
"created": "2023-04-04T10:57:11.201Z",
"updated": "2023-04-04T10:57:30.457Z",
"order_items": [
{
"type": "DIGITAL_PRODUCT",
"reference_id": "SKU_1323",
"name": "Potion ebooks",
"net_unit_amount": 50,
"quantity": 1,
"url": "https://www.zngmyhome.com/ebooks",
"category": "Classes",
"subcategory": null,
"description": null,
"metadata": null
}
],
"voided_at": null,
"payment_method_id": null,
"metadata": null
}