Cancel Order API
The Cancel Order API allows merchants to cancel an unpaid checkout order before the checkout URL expires. Once cancelled, the checkout session becomes invalid and the customer will no longer be able to complete the payment.
This API helps merchants manage order changes and maintain accurate order status in their systems.
Overview
Use Case :
Merchants may need to cancel a checkout order when:
The customer changes their order
The merchant needs to update inventory
The merchant wants to invalidate an existing checkout link
The merchant does not want to wait for the checkout URL to expire
Supported Payment Channels
Bank Transfer
✅
(exclude BTN, BNC, BPD, OCBC)
QRIS
✅
-
Convenience Store
✅
-
Cards
❌
-
eWallet
❌
-
Direct Debit
❌
-
Paylater
❌
-
Karu Kredit Indonesia
❌
-
Digital Banking
❌
-
Transactions that are already paid or expired cannot be cancelled.
Activation
This feature is not enabled by default.
Merchants must request activation from the DOKU Team.
How to Use
API Endpoint
HTTP Method
POST
API Endpoint (Sandbox)
https://api-sandbox.doku.com/checkout/v3/cancellations
API Endpoint (Production)
https://api.doku.com/checkout/v3/cancellations
Request Header
Here is the sample of request header to cancel the order
client-id
Client ID retrieved from DOKU Back Office
request-id
Unique random string (max 128 characters) generated from merchant side to protect duplicate request
request-timestamp
Timestamp request on UTC time in ISO8601 UTC+0 format. It means to proceed transaction on UTC+7 (WIB), merchant need to subtract time with 7. Ex: to proceed transaction on September 22th 2020 at 08:51:00 WIB, the timestamp should be 2020-09-22T01:51:00Z
signature
Security parameter that needs to be generated on merchant Backend and placed to the header request to ensure that the request is coming from valid merchant. Please refer to this section to generate the signature
Here is the sample of request body to cancel the order :
order.invoice_number
string
Mandatory
Using the invoice number that used to generate the URL
payment.original_request_id
string
Mandatory
Using the original request id that used to generate the URL
note
string
Mandatory
Send the note for sync the data
Monitor the Order
Cancelled orders will appear in the Checkout Order Report with the status: CANCELLED

Last updated