Cancel API

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 MethodPOST
Versionv1.0
SNAP Service Code57

Request Header

Field NameField TypeMandatoryField Description
Content-typeStringMMedia type of the resource, i.e. application/json
X-TIMESTAMPStringMClient’s current local time in ISO-8601 format
X-SIGNATUREStringMCreated using symmetric signature HMAC_SHA512 algorithm
AuthorizationStringMRepresents 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-IDStringMUnique identifier for caller
X-EXTERNAL-IDStringMAlphanumeric string. We suggest merchant to use UUID format. The value should be unique.
In case of timeout, merchant can do:
  1. Use this value in get status API to get status transaction or
  2. Retry this request with the same X-EXTERNAL-ID and request body to avoid creating duplicate transaction
CHANNEL-IDStringMMandatory field from Bank Indonesia that can take any value with correct format 5 digits numeric string
Content-type:application/json
X-TIMESTAMP:2024-03-19T14:30:00+07:00
X-SIGNATURE: da1fa417c72d6b91c257e01e54fac824
Authorization: Bearer gp9HjjEj813Y9JGoqwOeOPWbnt4CupvIJbU1Mmu4a11MNDZ7Sg5u9a
X-PARTNER-ID: BMRI
X-EXTERNAL-ID:12345678901234567890
CHANNEL-ID:12345

Request Body

Field NameField TypeMandatoryField Description
originalReferenceNoString(64)CTransaction 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.

originalExternalIdString (36)CIf 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.

originalPartnerReferenceNoString (64)MTransaction identifier on service consumer system. For e.g: MerchantOrderId
{
   "originalReferenceNo" : "gopay-order-id",
   "originalExternalId" : "some-external-id",
   "originalPartnerReferenceNo":"merchant-order-id"
}

Response Header

Field NameField TypeMandatoryField Description
Content-typeStringMMedia type of the resource, i.e. application/json
X-TIMESTAMPStringMClient’s current local time in ISO-8601 format
Content-type: application/json
X-TIMESTAMP: 2024-03-19T14:30:00+07:00

Response Body

Field NameField TypeMandatoryField Description
responseCodeString (7)MResponse code
responseMessageString (150)MResponse description
originalReferenceNoString (256)MTransaction identifier on service provider system. For e.g: GopayOrderId
cancelTimeString (25)CCancel time. ISO-8601. Will be sent only if transaction cancellation is successful
{
   "responseCode":"20057000",
   "responseMessage":"Request has been processed successfully",
   "originalReferenceNo": "2020102977770000000009",
   "cancelTime":"2024-09-03T03:52:14Z"
}

List of Response code

Response CodeHTTP Status CodeResponse Message
2005700200Success
4005702400Invalid Mandatory Field
4015700401Unauthorized.
4015701401Invalid Token (B2B)
4035715403Transaction Not Permitted.[reason].
5005701500Internal Server Error
5045700504Timeout

Initiating cancel for GoPay QRIS transaction

This section will describe how a merchant can initiate cancel for GoPay QRIS transactions.

Path/{version}/qr/qr-mpm-cancel
HTTP MethodPOST
Versionv1.0
SNAP Service Code77

Request Header

Field NameField TypeMandatoryField Description
Content-typeStringMMedia type of the resource, i.e. application/json
X-TIMESTAMPStringMClient’s current local time in ISO-8601 format
X-SIGNATUREStringMCreated using symmetric signature HMAC_SHA512 algorithm
AuthorizationStringMRepresents access_token of a request; string starts with keyword “Bearer ” followed by access_token. Can get this token from b2b response.
X-PARTNER-IDStringMUnique identifier for caller
X-EXTERNAL-IDStringMAlphanumeric string. We suggest merchant to use UUID format. The value should be unique.
In case of timeout, merchant can do:
  1. Use this value in get status API to get status transaction or
  2. Retry this request with the same X-EXTERNAL-ID and request body to avoid creating duplicate transaction
CHANNEL-IDStringMMandatory field from Bank Indonesia that can take any value with correct format 5 digits numeric string
Content-type:application/json
X-TIMESTAMP:2024-03-19T14:30:00+07:00
X-SIGNATURE:da1fa417c72d6b91c257e01e54fac824
Authorization:Bearer gp9HjjEj813Y9JGoqwOeOPWbnt4CupvIJbU1Mmu4a11MNDZ7Sg5u9a
X-PARTNER-ID:BMRI
X-EXTERNAL-ID:12345678901234567890
CHANNEL-ID:12345

Request Body

Field NameField TypeMandatoryField Description
originalPartnerReferenceNoString(64)OTransaction identifier on service consumer system. For e.g: MerchantOrderId
originalReferenceNoString(64)OTransaction identifier on service provider system. For e.g: GopayOrderId

Note: either originalExternalId or OriginalReferenceNo need to be filled

If both fields have value, will use originalReferenceNo as the main identifier.

originalExternalIdString(36)OOriginal External-ID on header message
merchantIdString(64)MMerchant identifier that is unique per each merchant
subMerchantIdString(32)OSub merchant ID
externalStoreIdString(64)OExternals store ID
reasonString(256)MReason for cancellation
amountObjectOAmount object
amount.valueString (ISO 4217) (16,2)ONet amount of the cancel. If it's IDR then the value includes 2 decimal digits.

e.g. IDR 10.000,- will be placed with 10000.00

amount.currencyString (2)OCurrency.
additionalInfoObjectOAdditional information if merchant’s need to pass.
{
   "originalPartnerReferenceNo":"2020102900000000000001",
   "originalReferenceNo":"2020102977770000000009",
   "originalExternalId":"30443786930722726463280097920912",
   "merchantId":"00007100010926",
   "subMerchantId":"310928924949487",
   "externalStoreId":"124928924949487",
   "reason":"cancel reason",
   "amount":{
      "value":"10000.00",
      "currency":"IDR"
   },
   "additionalInfo":{
      "deviceId":"12345679237",
      "channel":"mobilephone"
   }
}

Response Header

Field NameField TypeMandatoryField Description
Content-typeStringMMedia type of the resource, i.e. application/json
X-TIMESTAMPStringMClient’s current local time in ISO-8601 format
Content-type:application/json
X-TIMESTAMP:2024-03-19T14:30:00+07:00

Response Body

Field NameField TypeMandatoryField Description
responseCodeString (7)MResponse code
responseMessageString(150)MResponse description
originalPartnerReferenceNoString(64)OOriginal transaction identifier on merchant
originalReferenceNoString(64)COriginal transaction identifier on GoPay
originalExternalIdString(32)OOriginal customer reference number
cancelTimeString(25)CCancel time. ISO 8601
transactionDateyyyyMMddHHmmssOTransaction Date
additionalInfoObjectOAdditional 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 MethodPOST
Versionv1.0
SNAP Service Code67

Request Header

Field NameField TypeMandatoryField Description
Content-typeStringMMedia type of the resource, i.e. application/json
X-TIMESTAMPStringMClient’s current local time in ISO-8601 format
X-SIGNATUREStringMCreated using symmetric signature HMAC_SHA512 algorithm
AuthorizationStringMRepresents 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-IDStringMUnique identifier for caller (client_id)
X-EXTERNAL-IDStringMAlphanumeric string. We suggest merchant to use UUID format. The value should be unique.
In case of timeout, merchant can do:
  1. Use this value in get status API to get status transaction or
  2. Retry this request with the same X-EXTERNAL-ID and request body to avoid creating duplicate transaction
CHANNEL-IDStringMMandatory field from Bank Indonesia that can take any value with correct format 5 digits numeric string
Content-type:application/json
X-TIMESTAMP:2024-03-19T14:30:00+07:00
X-SIGNATURE: da1fa417c72d6b91c257e01e54fac824
Authorization: Bearer gp9HjjEj813Y9JGoqwOeOPWbnt4CupvIJbU1Mmu4a11MNDZ7Sg5u9a
X-PARTNER-ID: BMRI
X-EXTERNAL-ID:12345678901234567890
CHANNEL-ID:12345

Request Body

Field NameField TypeMandatoryField Description
originalReferenceNoString(64)CTransaction identifier on service provider system. For e.g: GopayOrderId

Note: either originalExternalId or OriginalReferenceNo need to be filled

If both fields have value, will use originalReferenceNo as the main identifier.

originalPartnerReferenceNoString (64)MMerchant order-id
merchantIdString(64)MMerchant ID
partnerVoidNoString (64)MVoid identifier generated by the partner
reasonString (256)OVoid reason
additionalInfo
additionalInfo.originalExternalIdString (36)CIf merchant got a timeout from the auth endpoint, merchant can use this field using the X-EXTERNAL-ID value in the direct debit request header.

Note: either originalExternalId or OriginalReferenceNo need to be filled

{
   "originalReferenceNo":"2020102900000000000001",
   "originalPartnerReferenceNo":"123123123123",
   "partnerVoidNo":"asdv-asdasdv-addasd-1231ewqqw-aaaa",
   "merchantId":"merch00001"
   "title":"aTitle",
   "additionalData":{
          "originalExternalId":"aId",
}
}

Response Header

Field NameField TypeMandatoryField Description
Content-typeStringMMedia type of the resource, i.e. application/json
X-TIMESTAMPStringMClient’s current local time in ISO-8601 format
Content-type: application/json
X-TIMESTAMP: 2024-03-19T14:30:00+07:00

Response Body

Field NameField TypeMandatoryField Description
responseCodeString (7)MError code to specify the error returned.
responseMessageString (150)MDebug message to provide more information.
originalReferenceNoString (256)OTransaction identifier on service provider system. For e.g: GopayOrderId
originalPartnerReferenceNoString (32)OTransaction identifier on service consumer system
voidNoString (64)CPJSP's void identifier. Used to trace the capture when there's any issue occurred.
partnerVoidNoString (64)MVoid identifier generated by the partner
voidAmountObjectO
voidAmount.valueString (16,2)OTransaction amount that will be paid using this payment method If it's IDR then value includes 2 decimal digits.

e.g. IDR 10.000,- will be placed with 10000.00

voidAmount.currencyStringOCurrency. For e.g: IDR
voidTimeStringCVoid time. Must be filled upon successful transaction. Format void time: (ISO 8601) YYYY-MM-DDThh:mm:ss
{
   "responseCode":"20054000",
   "responseMessage":"Request has been processed successfully",
    "originalReferenceNo":"2020102900000000000001",
   "originalPartnerReferenceNo":"123123123123",
   "voidNo":"asdv-asdasdv-addasd-1231ewqqw-aaaa",
    "partnerVoidNo":"asdv-asdasdv-addasd-1231ewqqw-aaaa",
   "voidAmount":{
  	"value":"12345678.00",
  	"currency":"IDR"
   },
   "voidTime": "2009-07-03T12:08:56+07:00"
}
{
   "responseCode":"4006701",
   "responseMessage":"There is some issue with the transaction request"
}

List of Response code

Response CodeHTTP Status CodeResponse Message
2006700200Success
4006702400Invalid Mandatory Field {Field Name}
4016700401Unauthorized. Auth token required
4016701401Invalid Token (B2B)
4036515403Transaction Not Permitted.[reason].
5006701500Internal Server Error
5046700504Timeout

Initiating cancel for bank transfer (virtual account) transaction

This section will describe how a merchant can cancel bank transfer (virtual account) transactions.

Path/{version}/transfer-va/delete-va
HTTP MethodPOST
Versionv1.0
SNAP service code31

Request Header

Field NameField TypeMandatoryField Description
Content-TypeStringMRepresent media type of request e.g “application/json”
X-TIMESTAMPString(25)MClient's current local time in “yyyy-MM-ddTHH:mm:ssZ” format
AuthorizationStringMBearer token obtained from Access Token API in the format Bearer AccessToken
X-SIGNATUREStringMCreated using symmetric signature HMAC_SHA512 algorithm
X-PARTNER-IDStringMUnique identifier for partner
CHANNEL-IDStringMMandatory field from Bank Indonesia that can take any value with correct format 5 digits numeric string
X-EXTERNAL-IDStringMAlphanumeric string. We suggest merchant to use UUID format. The value should be unique.
In case of timeout, merchant can do:
  1. Use this value in get status API to get status transaction or
  2. Retry this request with the same X-EXTERNAL-ID and request body to avoid creating duplicate transaction
X-TIMESTAMP 2022-03-04T08:02:09+07:00
X-SIGNATURE yqmBXZ3yV6NPG1LtwXMm3quXzJMRX5Ms+r9ebc5xWIZGSKbZL3Oy871GHb7WQUucLa5nxN/HcnZYoNHc+KkWTQ==
X-PARTNER-ID 668052e34f194aa8be79e15a21e4fc2f
X-EXTERNAL-ID 91919644194391346361915387229113
CHANNEL-ID 95221
Authorization Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIxMmUzODE4Mi00YjIxLTQ0YWMtOTVkNi1mMjFhMjEwZmIxZTAiLCJjbGllbnRJZCI6IjY2ODA1MmUzNGYxOTRhYThiZTc5ZTE1YTIxZTRmYzJmIiwibmJmIjoxNjYzODQwNTU5LCJleHAiOjE2NjM4NDE0NTksImlhdCI6MTY2Mzg0MDU1OX0.fEr0vIbB2kY8alZ-SROl3ftAFbfRd0uU-lGq9XuFi8M
Content-Type application/json

Request Body

Field NameField TypeMandatoryField Description
partnerServiceIdMString(8)Derivative of X- PARTNER- ID, similar to company code, 8 digit left padding space.
customerNoMString(20)Unique number (up to 20 digits).
virtualAccountNoMString(28)partnerServiceId + customerNo (up to 20 digits).
trxIdMString(64)Transaction ID in Partner system
additionalInfoOObject
additionalInfo.merchantIdMStringMerchant ID
{
  "partnerServiceId":"  088899",
  "customerNo":"12345678901234567890",
  "virtualAccountNo":"  08889912345678901234567890",
  "trxId":"91919644194391346361915387229113",
  "additionalInfo": {
    "merchant_id": "G12345463"
  }
}

Response Header

Field NameField TypeMandatoryField Description
Content-TypeStringMMedia type of the resource, i.e application/json
X-TIMESTAMPStringMClient's current local time in ISO-8601
Content-type:application/json
X-TIMESTAMP:2024-03-19T14:30:00+07:00

Response Body

Field NameField TypeMandatoryField Description
responseCodeStringMResponse code
responseMessageStringMResponse description
virtualAccountData.partnerServiceIdStringMDerivative of X- PARTNER- ID, similar to company code, 8 digit left padding space.
virtualAccountData.customerNoStringMUnique number (up to 20 digits).
virtualAccountData.virtualAccountNoStringMpartnerServiceId (8 digit left padding 0) + customerNo (up to 20 digits).
virtualAccountData.trxIdStringMTransaction ID in Partner system
additionalInfoObjectO
{
   "responseCode": "2003100",
   "responseMessage": "Success",
   "virtualAccountData":{
     "partnerServiceId":"  088899",
     "customerNo":"12345678901234567890",
     "virtualAccountNo":"  08889912345678901234567890",
     "trxId":"91919644194391346361915387229113",
     "additionalInfo":{} 
    }
}