Query

This service can be called to obtain data from the payment or refund. In the case of payment with schedule, the queries will return the data from both transactions.

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 directly to the acquirer / authorizer, this reversal will not necessarily be reflected in the Carat Portal transaction query service.

Query by NIT#

Call details#

  • Resource: /v2/transactions/{nit}
  • HTTP Method: GET
  • Request format: there are no request parameters
  • 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#

Payment query#

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/1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqr' \
--header 'Content-Type: application/json' \
--header 'merchant_id: **********' \
--header 'merchant_key: **********'

Response in case of request found:

{
"code": "0",
"message": "OK. Transaction successful.",
"payment": {
"authorizer_code": "000",
"authorizer_message": "Transacao Aprov.",
"status": "CON",
"nit": "1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqr",
"order_id": "1660141068187",
"customer_receipt": "====CUPOM COMPRADOR====",
"merchant_receipt": "====CUPOM ESTABELECIMENTO====",
"authorizer_id": "2",
"acquirer_id": "229",
"acquirer_name": "Bin",
"authorizer_date": "10/08/2022T11:17",
"authorization_number": "105668",
"merchant_usn": "12050620649",
"esitef_usn": "220810105359590",
"sitef_usn": "105668",
"host_usn": "999105668 ",
"amount": "10000",
"payment_type": "C",
"issuer": "2",
"authorizer_merchant_id": "000000000000005",
"terminal_id": "ES000024",
"payment_date": "10/08/2022T11:17",
"installments": 10
}
}

Response in case of request not found:

{
"code": "82",
"message": "Your transaction was not found on our system. Please, return to the site and try again.
Please, contact the website administrator if this problem occurs again."
}

Refund query#

When requesting the refund service a new transaction will be created with a different NIT from the original payment transaction. If successful the payment transaction will have its status changed to EST (reversed) and the refund transaction will have CON status (confirmed). Each of these operations can be queried by their respective NITs.

Payment transaction NIT

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/d0eed50e34b37fd230389d618bf7bb023c02050ff9447d93d5b943e2f38117dd' \
--header 'Content-Type: application/json' \
--header 'merchant_id: **********' \
--header 'merchant_key: **********'

Response:

{
"code": "0",
"message": "OK. Transaction successful.",
"payment": {
"authorizer_code": "000",
"authorizer_message": "Transacao Aprov.",
"status": "EST",
"nit": "d0eed50e34b37fd230389d618bf7bb023c02050ff9447d93d5b943e2f38117dd",
"order_id": "1665683321507",
"customer_receipt": "====CUPOM COMPRADOR====",
"merchant_receipt": "====CUPOM ESTABELECIMENTO====",
"authorizer_id": "2",
"acquirer_id": "229",
"acquirer_name": "Bin",
"authorizer_date": "13/10/2022T14:48",
"authorization_number": "130083",
"merchant_usn": "12050620649",
"esitef_usn": "221013109642120",
"sitef_usn": "130083",
"host_usn": "999130083 ",
"amount": "9977",
"payment_type": "C",
"issuer": "2",
"authorizer_merchant_id": "000000000000005",
"terminal_id": "ES000001",
"payment_date": "13/10/2022T14:48",
"installments": 10
}
}

Response in case of request not found:

{
"code": "82",
"message": "Your transaction was not found on our system. Please, return to the site and try again.
Please, contact the website administrator if this problem occurs again."
}

Refund transaction NIT

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}}/api/v2/transactions/1c1caed9c650b29832d79d4a714b5d7526573ffefc726226b073fe0235006275' \
--header 'Content-Type: application/json' \
--header 'merchant_id: **********' \
--header 'merchant_key: **********'

Response:

{
"code": "0",
"message": "OK. Transaction successful.",
"cancellation": {
"authorizer_code": "000",
"status": "CON",
"nit": "1c1caed9c650b29832d79d4a714b5d7526573ffefc726226b073fe0235006275",
"order_id": "1665683321507",
"customer_receipt": "====CUPOM COMPRADOR====",
"merchant_receipt": "====CUPOM ESTABELECIMENTO====",
"authorizer_id": "2",
"acquirer_id": "229",
"acquirer_name": "Bin",
"authorizer_date": "13/10/2022T14:49",
"authorization_number": "130083",
"merchant_usn": "12050620649",
"esitef_usn": "221013109642141",
"sitef_usn": "130084",
"host_usn": "999130084 ",
"amount": "9977",
"payment_type": "C",
"issuer": "2",
"terminal_id": "ES000001",
"esitef_date": "13/10/2022T14:49",
"is_host_cancel": "false"
}
}

Response in case of request not found:

{
"code": "82",
"message": "Your transaction was not found on our system. Please, return to the site and try again.
Please, contact the website administrator if this problem occurs again."
}

Query by order_id#

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#

Payment query#

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=1663088515049&page=0&limit=7' \
--header 'Content-Type: application/json' \
--header 'merchant_id: **********' \
--header 'merchant_key: **********'

Response in case of request found:

{
"code": "0",
"message": "OK. Transaction successful.",
"transactions": [
{
"payment": {
"authorizer_code": "000",
"authorizer_message": "Transacao Aprov.",
"status": "EST",
"nit": "b916345da34b17d6e4d81f58cbdbf67100227d253aaa26c3a04de4c1734a024e",
"order_id": "1663088515049",
"customer_receipt":"====CUPOM COMPRADOR====",
"merchant_receipt": "====CUPOM ESTABELECIMENTO====",
"authorizer_id": "2",
"acquirer_id": "229",
"acquirer_name": "Bin",
"authorizer_date": "13/09/2022T14:01",
"authorization_number": "135983",
"merchant_usn": "12050620649",
"esitef_usn": "220913107453280",
"sitef_usn": "135983",
"host_usn": "999135983 ",
"amount": "9977",
"payment_type": "C",
"issuer": "2",
"authorizer_merchant_id": "000000000000005",
"terminal_id": "ES000042",
"payment_date": "13/09/2022T14:01",
"installments": 10
}
},
{
"cancellation": {
"authorizer_code": "000",
"status": "CON",
"nit": "eac07d8d1fe9b64166f5c4a5fbc2a8d4fe9047be2b9d41581f891a04bb2759b9",
"order_id": "1663088515049",
"customer_receipt": "====CUPOM COMPRADOR====",
"merchant_receipt": "====CUPOM ESTABELECIMENTO====",
"authorizer_id": "2",
"acquirer_id": "229",
"acquirer_name": "Bin",
"authorizer_date": "13/09/2022T14:02",
"authorization_number": "135983",
"merchant_usn": "12050620649",
"esitef_usn": "220913107453291",
"sitef_usn": "135984",
"host_usn": "999135984 ",
"amount": "9977",
"payment_type": "C",
"issuer": "2",
"terminal_id": "ES000042",
"esitef_date": "13/09/2022T14:02",
"is_host_cancel": "false"
}
}
],
"current_page": "0",
"total_pages": "1",
"count": "2"
}

Response in case of request not found:

{
"code": "82",
"message": "Your transaction was not found on our system. Please, return to the site and try again.
Please, contact the website administrator if this problem occurs again."
}

Refund query#

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=1663088515049&page=0&limit=7' \
--header 'Content-Type: application/json' \
--header 'merchant_id: **********' \
--header 'merchant_key: **********'

Response:

{
"code": "0",
"message": "OK. Transaction successful.",
"transactions": [
{
"payment": {
"authorizer_code": "000",
"authorizer_message": "Transacao Aprov.",
"status": "EST",
"nit": "b916345da34b17d6e4d81f58cbdbf67100227d253aaa26c3a04de4c1734a024e",
"order_id": "1663088515049",
"customer_receipt": "====CUPOM COMPRADOR====",
"merchant_receipt": "====CUPOM ESTABELECIMENTO====",
"authorizer_id": "2",
"acquirer_id": "229",
"acquirer_name": "Bin",
"authorizer_date": "13/09/2022T14:01",
"authorization_number": "135983",
"merchant_usn": "12050620649",
"esitef_usn": "220913107453280",
"sitef_usn": "135983",
"host_usn": "999135983 ",
"amount": "9977",
"payment_type": "C",
"issuer": "2",
"authorizer_merchant_id": "000000000000005",
"terminal_id": "ES000042",
"payment_date": "13/09/2022T14:01",
"installments": 10
}
},
{
"cancellation": {
"authorizer_code": "000",
"status": "CON",
"nit": "eac07d8d1fe9b64166f5c4a5fbc2a8d4fe9047be2b9d41581f891a04bb2759b9",
"order_id": "1663088515049",
"customer_receipt": "====CUPOM COMPRADOR====",
"merchant_receipt": "====CUPOM ESTABELECIMENTO====",
"authorizer_id": "2",
"acquirer_id": "229",
"acquirer_name": "Bin",
"authorizer_date": "13/09/2022T14:02",
"authorization_number": "135983",
"merchant_usn": "12050620649",
"esitef_usn": "220913107453291",
"sitef_usn": "135984",
"host_usn": "999135984 ",
"amount": "9977",
"payment_type": "C",
"issuer": "2",
"terminal_id": "ES000042",
"esitef_date": "13/09/2022T14:02",
"is_host_cancel": "false"
}
}
],
"current_page": "0",
"total_pages": "1",
"count": "2"
}

Response in case of request not found:

{
"code": "82",
"message": "Your transaction was not found on our system. Please, return to the site and try again.
Please, contact the website administrator if this problem occurs again."
}

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 records page.< 4 N
total_pagesTotal pages number.< 4 N
countTotal register count.< 4
payment
statusStatus of the payment transaction on Carat Portal. Learn more.= 3 AN
nitPayment transaction identifier on Carat.= 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).< 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
is_host_cancelThis field will return the value true in case of refund via host.< 5 T/F
customer_receiptCustomer's receipt.< 4000 AN
merchant_receiptMerchant's receipt.< 4000 AN
payment_typePayment type from the selected authorizer: B = boleto, C = credit, D = debit, P = Private Label credit card, T = bank transfer, G = gift card, O = other payment methods, W = Boleto NR via Web Service= 1 AN
cancellation
statusStatus of the payment transaction on Carat Portal. Learn more.= 3 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).< 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
is_host_cancelThis field will return the value true in case of cancel via host.< 5 T/F
esitef_dateRefund authorization date on Carat Portal in DD/MM/YYYY'T'HH:mm format. Example: 13/07/2017T16:03= 16 D
customer_receiptCustomer's receipt.< 4000 AN
merchant_receiptMerchant's receipt.< 4000 AN
payment_typePayment type from the selected authorizer: B = boleto, C = credit, D = debit, P = Private Label credit card, T = bank transfer, G = gift card, O = other payment methods, W = Boleto NR via Web Service= 1 AN