Query by order_id

This service can be called to obtain data from the payment or cancel. It's essential to use this operation for handling communication errors to verify the current status of the transaction, which may have been processed or not received by Carat Portal.

Note:

The Carat Portal transaction query service DO NOT makes a transaction status check in acquirer / authorizer. This service only returns the transaction status in Carat Portal database.

Example: If a payment transaction is confirmed in Carat Portal, but is reversed via telephone directly to the acquirer / authorizer, this reversal will not necessarily be reflected in the Carat Portal transaction query service.

Call details#

  • Resource: /v2/transactions/?order_id={order_id}
  • HTTP Method: GET
  • Request format: query string
  • Response format: JSON
  • Header parameters:
ParameterDescriptionFormatMandatory
merchant_idMerchant code on Carat Portal. The production and certification codes will be different.< 15 ANYES
merchant_keyMerchant authentication key on Carat Portal. The production and certification keys will be different.< 80 ANYES
Content-TypeIt must be sent with the value application/json.= 15 ANYES

Examples#

Request:

To use this example, don't forget to define the variable {{url}} with the value
esitef-homologacao.softwareexpress.com.br

curl --location --request GET 'https://{{url}}/e-sitef/api/v2/transactions?order_id=123456' \
--header 'Content-Type: application/json' \
--header 'merchant_id: *********' \
--header 'merchant_key: *********'

Success response with one order:

{
"code": "0",
"message": "OK",
"transactions": [
{
"code": "0",
"message": "OK. Transaction successful.",
"payment": {
"authorizer_code": "000",
"authorizer_message": "Transacao Aprov.",
"status": "CON",
"nit": "8bea6787a4121c65dc84a6ae02330a790c7c1a2730d76fe98b81bca1a2639adc",
"order_id": "1659445331723",
"customer_receipt": ".....S.O.F.T.W.A.R.E.E.X.P.R.E.S.S.... \nSI Rede 5 \nMU Codigo transacao: 200 \nLA Codigo operacao: 3000 \nDO Valor: 33,00 \n.....S...I...M...U...L...A...D...O.... \nSI NSU SiTef: 25437 \nMU 02/08/22 10:02 \nLA ID PDV: ES000022 \nDO Estab.: 000000000000005 \n.....S...I...M...U...L...A...D...O.... \nSI Host: 999025437 \nMU Transacao Simulada Aprovada \nLA SALDO DISP. 0,02 \n (SiTef) \n",
"merchant_receipt": ".....S.O.F.T.W.A.R.E.E.X.P.R.E.S.S.... \nSI Rede 5 \nMU Codigo transacao: 200 \nLA Codigo operacao: 3000 \nDO Valor: 33,00 \n.....S...I...M...U...L...A...D...O.... \nSI NSU SiTef: 25437 \nMU 02/08/22 10:02 \nLA ID PDV: ES000022 \nDO Estab.: 000000000000005 \n.....S...I...M...U...L...A...D...O.... \nSI Host: 999025437 \nMU Transacao Simulada Aprovada \n (SiTef) \n",
"authorizer_id": "2",
"acquirer_id": "229",
"acquirer_name": "Bin",
"authorizer_date": "02/08/2022T10:02",
"authorization_number": "025437",
"merchant_usn": "12050620649",
"esitef_usn": "220802104855470",
"sitef_usn": "025437",
"host_usn": "999025437 ",
"amount": "3300",
"payment_type": "C",
"issuer": "2",
"authorizer_merchant_id": "000000000000005",
"terminal_id": "ES000022",
"payment_date": "02/08/2022T10:02",
"installments": 10
}
}
],
"current_page": "0",
"total_pages": "1",
"count": "1"
}

Success response with two or more orders:

{
"code": "0",
"message": "OK",
"transactions": [
{
"payment": {
"authorizer_code": "000",
"authorizer_message": "Transacao Aprov.",
"status": "CON",
"nit": "8bea6787a4121c65dc84a6ae02330a790c7c1a2730d76fe98b81bca1a2639adc",
"order_id": "29121009973",
"customer_receipt": "====CUPOM COMPRADOR====",
"merchant_receipt": "====CUPOM ESTABELECIMENTO====",
"authorizer_id": "2",
"acquirer_id": "229",
"acquirer_name": "Bin",
"authorizer_date": "02/08/2022T10:02",
"authorization_number": "025437",
"merchant_usn": "29121009973",
"esitef_usn": "220802104855470",
"sitef_usn": "025437",
"host_usn": "999025437 ",
"amount": "3300",
"payment_type": "C",
"issuer": "2",
"authorizer_merchant_id": "000000000000005",
"terminal_id": "ES000022",
"payment_date": "02/08/2022T10:02",
"installments": 10
}
},
{
"payment": {
"authorizer_message": "anti-fraude=INV-Client service communication failure",
"status": "INV",
"nit": "1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqr",
"order_id": "29121009973",
"authorizer_id": "2",
"acquirer_id": "229",
"acquirer_name": "Bin",
"merchant_usn": "29121009973",
"esitef_usn": "220729104657020",
"amount": "1000",
"payment_type": "C",
"analysis": {
"status": "INV",
"code": "0",
"message": "Client service communication failure"
},
"installments": 1
}
}
],
"current_page": "0",
"total_pages": "1",
"count": "2"
}

Response for order not found:

{
"code": "1032",
"message": "Result not found"
}

Response parameters#

In case of success, the HTTP response code will be 200. Any other code must be interpreted as an error. The table below describes de response parameters of the transaction creation service:

ParameterDescriptionFormat
codeCarat Portal response code. Any code different from 0 means failure. Learn more.< 4 N
messageCarat Portal response message.< 500 AN
current_pageCurrent search page< 2 N
total_pagesTotal number of pages< 2 N
countPage count< 2 N
transactions[].payment
statusStatus of the payment transaction on Carat Portal. Learn more.= 3 AN
nitPayment transaction identifier on Carat Portal.= 64 AN
order_idOrder code sent by the merchant on the creation of the transaction.< 40 AN
merchant_usnUnique sequential number sent by the merchant on the creation of the transaction.< 12 N
amountTotal price of the purchase specified by the merchant (in cents) on the creation of the transaction.< 12 N
sitef_usnUnique sequential number of the payment transaction on SiTef.= 6 N
esitef_usnUnique sequential number of the payment transaction on Carat Portal.= 15 N
customer_receiptCustomer's receipt.< 4000 AN
merchant_receiptMerchant's receipt.< 4000 AN
authorizer_idCode of the authorizer used on the transaction.< 4 N
acquirer_idCode of the acquirer used on the transaction.< 4 N
acquirer_nameName of the acquirer used on the transaction.< 100 AN
authorizer_datePayment authorization date returned by the authorizer in DD/MM/YYYY'T'HH:mm format. Example: 13/07/2017T16:03= 16 D
authorization_numberAuthorization number.< 6 AN
host_usnHost USN.< 15 AN
tidID of the transaction on the acquirer. This field is only returned on transactions with acquirers that are external to SiTef.< 40 AN
eciEletronic Commerce Indicator (security level indicator of the payment transaction via Cielo e-Commerce).< 3 AN
payment_datePayment authorization date on Carat Portal in DD/MM/YYYY'T'HH:mm format. Example: 13/07/2017T16:03= 16 D
issuerIssuer code returned by the authorizer.< 5 AN
authorizer_merchant_idAffiliation code of the merchant on the authorizer.< 100 AN
terminal_idTerminal code used in the transaction< 8 AN
authorizer_codeAuthorizer response code.< 10 AN
authorizer_messageAuthorizer response message.< 500 AN
installmentsNumber of installments to be used on the scheduled payments.< 2 N