For AI agents: visit https://docs.midtrans.com/llms.txt for an index of all pages formatted in Markdown and endpoints in OpenAPI. Append .md to any documentation page URL to get its markdown version.
Initiating cancel for GoPay and GoPay Tokenization (non Pre-Auth) transaction
This section will describe how a merchant can initiate cancel for GoPay and GoPay Tokenization (non-Pre Auth) transactions.
Path
/{version}/debit/cancel
HTTP Method
POST
Version
v1.0
SNAP Service Code
57
Request Header
Field Name
Field Type
Mandatory
Field Description
Content-type
String
M
Media type of the resource, i.e. application/json
X-TIMESTAMP
String
M
Client’s current local time in ISO-8601 format
X-SIGNATURE
String
M
Created using symmetric signature HMAC_SHA512 algorithm
Authorization
String
M
Represents access_token of a request; string starts with keyword “Bearer ” followed by access_token. Can get this token from Access Token B2B API response.
X-PARTNER-ID
String
M
Unique identifier for caller
X-EXTERNAL-ID
String
M
Alphanumeric string. We suggest merchant to use UUID format. The value should be unique. In case of timeout, merchant can do:
Use this value in get status API to get status transaction or
Retry this request with the same X-EXTERNAL-ID and request body to avoid creating duplicate transaction
CHANNEL-ID
String
M
Mandatory field from Bank Indonesia that can take any value with correct format 5 digits numeric string
Transaction identifier on service provider system. For e.g: GopayOrderId
Note: either originalExternalId or OriginalReferenceNo need to be passed. If both fields have value, we will use originalReferenceNo as the main identifier.
originalExternalId
String (36)
C
If merchant got a timeout when calling charge API (POST /v1.0/debit/payment-host-to-host), merchant can pass the value of X-EXTERNAL-ID in the charge API request header as originalExternalId.
Note: Either originalExternalId or OriginalReferenceNo need to be passed in cancel request.
originalPartnerReferenceNo
String (64)
M
Transaction identifier on service consumer system. For e.g: MerchantOrderId
Additional information if merchant’s need to pass.
{
"responseCode":"2007700",
"responseMessage":"Request has been processed successfully",
"originalPartnerReferenceNo":"2020102900000000000001",
"originalReferenceNo":"2020102977770000000009",
"originalExternalId":"30443786930722726463280097920912",
"cancelTime":"2020-10-20T17:56:57",
"transactionDate":"2020-10-20 17:56:57",
"additionalInfo":{
"deviceId":"12345679237",
"channel":"mobilephone"
}
Initiating cancel for GoPay Tokenization (Pre Auth) transaction
This section will describe how a merchant can release/cancel authorized transactions for GoPay Tokenization (Pre-Auth) transactions.
Path
/v1.0/auth/void
HTTP Method
POST
Version
v1.0
SNAP Service Code
67
Request Header
Field Name
Field Type
Mandatory
Field Description
Content-type
String
M
Media type of the resource, i.e. application/json
X-TIMESTAMP
String
M
Client’s current local time in ISO-8601 format
X-SIGNATURE
String
M
Created using symmetric signature HMAC_SHA512 algorithm
Authorization
String
M
Represents access_token of a request; string starts with keyword “Bearer ” followed by access_token. Can get this token from Access Token B2B API response.
X-PARTNER-ID
String
M
Unique identifier for caller (client_id)
X-EXTERNAL-ID
String
M
Alphanumeric string. We suggest merchant to use UUID format. The value should be unique. In case of timeout, merchant can do:
Use this value in get status API to get status transaction or
Retry this request with the same X-EXTERNAL-ID and request body to avoid creating duplicate transaction
CHANNEL-ID
String
M
Mandatory field from Bank Indonesia that can take any value with correct format 5 digits numeric string