Customer Top Up

This section will explain how merchants can initiate customer top up using SNAP specification.

ServiceCodeMethodURLDescription
38POST/v1.0/emoney/topupAPI Customer Top Up

Request

Header

The following table is a header of request parameter:

Field NameAttrib.DatatypeDescription
Content-TypeMStringRepresent media type of request e.g “application/json”
AuthorizationMBearer token obtained from Access Token API in the format Bearer <AccessToken>
X-TIMESTAMPMString(25)Client's current local time in “yyyy-MM-ddTHH:mm:ssTZD” format
X-SIGNATUREMSee General API Symmetric Signature
X-PARTNER-IDMSee Credential Exchange
X-EXTERNAL-IDMString(max 36), NumericUnique request reference number from partner. Must be unique.
CHANNEL-IDMSee Credential Exchange

Body

The following table is a body of request parameter:

Field NameAttrib.DatatypeDescription
partnerReferenceNoMString(64)Transaction identifier on service consumer system
Uniqueness checking will be done within 2 (two) months only. If the same partnerReferenceNo reused after 2 months, we will treat it as new request.
customerNumberMString(20)Customer account number
customerNameMString(100)Customer account name
amount.valueMString(16,2)Net amount of the transaction.
If it’s IDR, then the value includes 2 decimal digits.
e.g. IDR 10.000, will be placed with 10000.00
amount.currencyMString(3)Currency (should always be IDR)
notesMString(100)Remark/transaction description. Unique is encouraged.
Support alpha numeric format, space, and underscore (_).
additionalInfo.beneficiaryEmailOString(50)Beneficiary email
additionalInfo.beneficiaryProviderMString(40)Beneficiary provider, see Emoney Providers

Response

Header

The following table is a header of response parameter:

Field NameAttrib.DatatypeDescription
X-TIMESTAMPMString(25)“yyyy-MM-ddTHH:mm:ssTZD” format

Body

The following table is a body of response parameter:

Field NameAttrib.DatatypeDescription
responseCodeMString(7)Response code
responseMessageMString(150)Response description
referenceNoCString(64)Transaction identifier on service provider system. Must be filled upon successful transaction
partnerReferenceNoMString(64)Transaction identifier on service consumer system
customerNumberOString(32)Customer account number

Sample

Request

The following section is a sample of request parameter:

curl --location --request POST 'https://merchants.midtrans.com/v1.0/emoney-topup \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIxMmUzODE4Mi00YjIxLTQ0YWMtOTVkNi1mMjFhMjEwZmIxZTAiLCJjbGllbnRJZCI6IjY2ODA1MmUzNGYxOTRhYThiZTc5ZTE1YTIxZTRmYzJmIiwibmJmIjoxNjYzODQwNTU5LCJleHAiOjE2NjM4NDE0NTksImlhdCI6MTY2Mzg0MDU1OX0.fEr0vIbB2kY8alZ-SROl3ftAFbfRd0uU-lGq9XuFi8M' \
--header 'X-TIMESTAMP: 2022-03-04T08:02:09+07:00' \
--header 'X-SIGNATURE: yqmBXZ3yV6NPG1LtwXMm3quXzJMRX5Ms+r9ebc5xWIZGSKbZL3Oy871GHb7WQUucLa5nxN/HcnZYoNHc+KkWTQ==' \
--header 'X-PARTNER-ID: 668052e34f194aa8be79e15a21e4fc2f' \
--header 'X-EXTERNAL-ID: 91919644194391346361915387229113' \
--header 'CHANNEL-ID: 95221' \
--data-raw '{
   "partnerReferenceNo": "61945219227478976148442931867349",
   "customerNumber": "6281773628883",
   "customerName": "John Doe",
   "amount": { "value": "100000.00", "currency": "IDR” },
   "notes": "Payout April 17",
   "additionalInfo": {
       "beneficiaryEmail": "[email protected]",
       "beneficiaryProvider": "gopay"
   }
}'

Response

The following section is a sample of response parameter:

Content-Type : application/json
x-timestamp  : 2022-03-04T08:02:09+07:00
-------------------------------------------------------------------------------
{
   "responseCode": "2023800",
   "responseMessage": "Request In Progress",
   "referenceNo": "558rFI9lxMdQlOkm65",
   "partnerReferenceNo": "61945219227478976148442931867349",
   "customerNumber": "6281773628883"
}
Content-Type : application/json
x-timestamp  : 2022-03-04T08:02:09+07:00
-------------------------------------------------------------------------------
{"responseCode": "4003800", "responseMessage": "Bad Request. Beneficiary Account not found"}

Migration

Request

The following table is a comparison of request parameter:

Payouts non-SNAP-based (current)Payouts SNAP-basedDescription
partnerReferenceNoTransaction identifier on service consumer system
amountamount.value

Net amount of the transaction.

If it’s IDR then value includes 2 decimal digits.
e.g. IDR 10.000, will be placed with 10000.00

amount.currencyCurrency (should always be IDR)
beneficiary_accountcustomerNumberCustomer account number
beneficiary_namecustomerNameCustomer account name
notesnotes

Remark/transaction description

Previously remark could have been maximum 100 characters, under Open API it is restricted to maximum 50 characters.

beneficiary_bankadditionalInfo.beneficiaryProviderProvider name used by the beneficiary
beneficiary_emailadditionalInfo.beneficiaryEmailBeneficiary email

Response

The following table is a comparison of response parameter:

Payouts non-SNAP-based (current)Payouts SNAP-basedDescription
statusPayout status
responseCodeResponse code
responseMessageResponse description
reference_noreferenceNoTransaction identifier on service provider system. Must be filled upon successful transaction
partnerReferenceNoTransaction identifier on service consumer system
customerNumberCustomer account number

Response Codes

Payouts SNAP-basedResponse Message
2023800Successful
4003800Bad Request
4003801Invalid Field Format
4013800Unauthorized
4013801Invalid Token (B2B)
4013803Token Not Found
4033801Feature Not Allowed
4033802Exceeds Transaction Amount Limit
4033803Suspected Fraud
4033806Feature Not Allowed At This Time.
4033809Dormant Account
4033814Insufficient Funds
4033815Transaction Not Permitted.
4033818Inactive Card/Account/Customer
4043808Invalid Merchant
4043811Invalid Customer. Not found
4043812Invalid Bill/Virtual Account Not Found
4043813Invalid Amount
4093800Conflict
4093801Duplicate partnerReferenceNo
4223802Merchant Not Allowed
5003801Internal Server Error
5003802External Server Error
5043800Payment Provider Timeout

Notes:

If you receive a 5xx error during a top-up request, please wait 10 minutes and perform a status inquiry before initiating a new request. This ensures the original transaction was not already processed.