Transaction History List

This section will explain how merchants can inquiry transaction history list using SNAP specification.

ServiceCodeMethodURLDescription
12POST/{version}/transaction-history-listAPI Transaction History Detail

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
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
fromDateTimeMString(25)Starting time range
Default:
NOW (DESC)
or NOW - 3 months (ASC)
toDateTimeMString(25)Ending time range
Default:
NOW - 3 months (DESC)
or NOW (ASC)

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
detailDataOArray
[].dateTimeMString(25)Transaction date : ISO 8601 (without millis). e.g “yyyy-MM-ddTHH:mm:ssZ”
[].amount.valueMString(16,2)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.currencyMString(3)Currency (should always be IDR)
[].statusMString(32)Transaction Status
INIT, SUCCESS, CLOSED, CANCELLED

INIT: queued/approved
SUCCESS: completed/processed/non-payout
CLOSED: failed
[].typeMString(32)Transaction type. Will always be SEND_MONEY
[].additionalInfo.referenceNoOStringUnique reference_no of a payout (only if payout is present)
[].additionalInfo.beneficiaryNameOStringName of the beneficiary (only if payout is present)
[].additionalInfo.beneficiaryAccountOStringAccount number of the beneficiary (only if payout is present)
[].additionalInfo.accountMStringName of beneficiary bank/channel used
[].additionalInfo.transactionStatusMStringCurrent status of the Transaction. Value is either credit or debit
[].additionalInfo.transactionTypeMStringTransaction Type, one of account_validation_fee, payout_fee, payout, refund, topup, topup_reversal, manual, or balance_transfer

Sample

Request

The following section is a sample of request parameter:

curl --location --request POST 'https://merchants.midtrans.com/v1.0/transaction-history-list' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIxMmUzODE4Mi00YjIxLTQ0YWMtOTVkNi1mMjFhMjEwZmIxZTAiLCJjbGllbnRJZCI6IjY2ODA1MmUzNGYxOTRhYThiZTc5ZTE1YTIxZTRmYzJmIiwibmJmIjoxNjYzODQwNTU5LCJleHAiOjE2NjM4NDE0NTksImlhdCI6MTY2Mzg0MDU1OX0.fEr0vIbB2kY8alZ-SROl3ftAFbfRd0uU-lGq9XuFi8M' \
--header 'Content-Type: application/json' \
--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 '{
   "fromDateTime": "2019-07-03T12:08:56+07:00",
   "toDateTime": "2019-07-03T12:08:56+07:00"
}'

Response

The following section is a sample of response parameter:

Content-Type : application/json
x-timestamp  : 2022-03-04T08:02:09+07:00
-------------------------------------------------------------------------------
{
   "responseCode": "2001200",
   "responseMessage": "Success",
   "detailData": [
      {
         "dateTime": "2019-07-03T12:08:56+07:00",
         "amount": {
            "value": "12345678.00",
            "currency": "IDR"
         },
         "status": "SUCCESS",
         "type": "SEND_MONEY",
         "additionalInfo": {
            "referenceNo": "kUxaHUDZEtAvOvJifE",
            "beneficiaryName": "John Doe",
            "beneficiaryAccount": "123456",
            "account": "bca",
            "transactionStatus": "credit",
            "transactionType": "Payout"
         }
      }
   ]
Content-Type : application/json
x-timestamp  : 2022-03-04T08:02:09+07:00
-------------------------------------------------------------------------------
{"responseCode": "4011200", "responseMessage": "Unauthorized. Client"}

Migration

Request

The following table is a comparison of request parameter:

Payouts non-SNAP-based (current)Payouts SNAP-basedDescription
GET /api/v1/statementsPOST /{version}/transaction-history-list
from_datefromDateTimeStarting time range
Default:
NOW (DESC)
or NOW - 3 months (ASC)
to_datetoDateTimeEnding time range
Default:
NOW - 3 months (DESC)
or NOW (ASC)

Response

The following table is a comparison of response parameter:

Payouts non-SNAP-based (current)Payouts SNAP-basedDescription
responseCodeResponse code
responseMessageResponse description
[].created_atdetailData[].dateTimeTransaction date : ISO 8601 (without millis). e.g “yyyy-MM-ddTHH:mm:ssZ”
[].amountdetailData[].amount.valueNet 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
detailData[].amount.currencyCurrency (should always be IDR)
detailData[].statusTransaction Status
INIT, SUCCESS, CLOSED, CANCELLED

INIT: queued/approved
SUCCESS: completed/processed/non-payout
CLOSED: failed
detailData[].typeTransaction type. Will always be SEND_MONEY
[].reference_nodetailData[].additionalInfo.referenceNoUnique reference_no of a payout (only if payout is present)
[].beneficiary_namedetailData[].additionalInfo.beneficiaryNameName of the beneficiary (only if payout is present)
[].beneficiary_accountdetailData[].additionalInfo.beneficiaryAccountAccount number of the beneficiary (only if payout is present)
[].accountdetailData[].additionalInfo.accountName of beneficiary bank/channel used
[].statusadditionalInfo.transactionStatusCurrent status of the Transaction. Value is either credit or debit
[].typeadditionalInfo.transactionTypeTransaction Type, one of account_validation_fee, payout_fee, payout, refund, topup, topup_reversal, manual, or `balance_transfer

Response Codes

Payouts non-SNAP-based (current)Payout SNAP-basedDescription
2001200Successful
4001201Invalid Field Format [fieldName]
4001202Missing Mandatory Field [fieldName]
4011200Unauthorized
4011201Invalid Token (B2B)
5001200Internal Server Error