Payment Transaction Consultation Service

Query the payment transaction using the Omnichannel API. This one service must be called following a request from the Service Payment to check approval status or return status of this payment request.

As the transaction capture occurs at the POS in person, the service Transaction Status query must be called by Automation until the return of the status field is status=PPC (Payment Pending confirmation) or status=ERR (Error Making Payment). If the status of transaction is PPC, this service will return the response data from the payment.

Payment Transaction Inquiry can also be called in cases of communication error to check the current transaction status, which may whether or not it was received by the Omnichannel API.

Attention: The transaction query in the Omnichannel API DOES NOT query the status of the transaction at the acquirer / authorizer. This service returns the status of the transaction in the Omnichannel API database.
Example: If a payment transaction is confirmed on the Omnichannel API, but is reversed via telephone directly at the acquirer/authorizer, this reversal will not necessarily be reflected in the Omnichannel API transaction query service.

Call details#

  • Resource: /v1/sales/{sale_id}/payments/{nit}

  • HTTP Method: GET

  • URL Parameter:

ParameterDescriptionTypeSizeRequired
nitPayment transaction identifier in Omnichannel API, value returned from POSTAN64YES
sale_idIdentifier of the sale in the Omnichannel API, value returned from POST
  • Header parameters:
ParameterDescriptionTypeSizeRequired
client_idClient IDANN/AYES
site_idStore IdentificationANN/AYES
AuthorizationBearer access_token valueANN/AYES

Response parameters#

If successful, the HTTP response code will be 200. Any other code should be interpreted as an error.

  • Header parameters:
ParameterDescriptionTypeSizeRequired
Content-Typeapplication/json; charset=utf-8AN16YES
  • Body: JSON
ParameterDescriptionTypeSizeRequired
codePayment Gateway response code. Any code other than ‘0’ means failure.

In case of failure, consider that the transaction status will remain as Pending.
N< 4YES
messageOptional response message that serves as diagnostic support for the developer (always in English)AN< 500YES
status  payment request status

If POS has not yet started capturing the transaction, status is “1 – Aguardando POS”

If POS has already started capturing the transaction, status is = “2 – Transação já iniciada (pagamento em andamento)”

If the Omnichannel API has already received the transaction response (approved or denied, status = “3 – Transação processada”

If the transaction capture was aborted at the POS, status = “4 – Transação cancelada”

Only when status = 3 (Transaction processed) will the payment data be returned in the payment data set .
ANYES
paymentObject containing payment data (see specification below)ObjectConditional

Mandatory if the payment was successful and the status field is equal to 3-(Transaction processed)
Payment object
ParameterDescriptionTypeSizeRequired
statusStatus of the payment transaction in the Omnichannel API. For more information, see the Shared Tables section.AN=3YES
nitPayment transaction identifier in the Omnichannel API.

This field will only be displayed in Payment in multiple calls
NA=64
authorizer_codeAuthorizer response code.AN< 10YES
authorizer_messageAuthorizer response message.AN< 500NO
order_idOrder code sent by the store when creating the transaction.AN< 20YES 
merchant_usnUnique sequential number sent by the store when creating the transaction.N< 12YES
amountPurchase value specified by the store (in cents) when creating the transaction.N< 12YES
payment_methodPayment Method previously informed or selected during the transaction capture flow.N3YES
gateway_usnUnique sequential number of the payment transaction at the Payment Gateway. N= 6YES (TODO: CONFIRM IF POS BIN IS RETURNING)
printList of objects containing transaction receipts. See the Complex Parameters section for more details.ListYES
authorizer_idCode of the authorizer used in the transaction.N< 4NO
acquirer_idAcquirer code used in the transaction.N< 4NO
acquirer_nameName of the acquirer used in the transaction.AN< 100NO
authorizer_datePayment effective date returned by the authorizer in the format DD-MM-AAAATHH:mm. Example: 13-07-2017T16:03D= 16YES
authorization_codeAuthorization Code.AN< 6YES
txidpixExtended Authorization Code, present only in PIX transactions.AN< 99CONDITIONAL Mandatory if payment_method is equal to 3=(PIX)
host_usnNSU of the authorizer.AN< 15NO
payment_datePayment effective date in the format DD-MM-AAAATHH:mm. Example: 13-07-2017T16:03D=16TODO: CONFIRM IF WE RECEIVED FROM BIN.
issuerFlag code returned by the authorizer.AN< 5TODO: CONFIRM IF WE RECEIVED FROM BIN.
authorizer_merchant_idRetailer's affiliation code with the authorizer.

Identifier of the Host/acquirer in the Payment Gateway.
AN< 100TODO: CONFIRM IF WE RECEIVED IT FROM BIN.
terminal_merchant_idCompany data configured on the terminal that processed the transactionTODO: CONFIRM IF WE RECEIVED IT FROM BIN.
terminal_idIdentification of the terminal that processed the transactionTODO: CONFIRM IF WE RECEIVED IT FROM BIN.
cardObject containing card data (see specification below).ObjectNO
endtoendpixEndtoend code sent in pix transactionsAN>50CONDITIONAL Mandatory if payment_method is equal to 3=(PIX)
invoice_dataObject with invoice fields for automation to issue with competent bodies or entities (see specification below)ObjectYES
Card object (inside payment)
ParameterDescriptionTypeSizeRequired
masked_panCard pan, first 4 digits and last digitsto be definedNO
expiry_dateCard expiration date in MMAA format.to be definedNO
entry_mode Card entry mode (values ​​to be defined)to be definedNO
invoice_data object (within payment)
ParameterDescriptionTypeSizeRequired
host_cnpjCNPJ of the debit/credit card accrediting network. Used for NFC-eString0 or 14SIM
sat_host_idDebit/credit card accreditor network code for SATString0 or 3YES
nfce_issuer_idDebit/credit card flag confirms values ​​defined by the NFC-e specification:

·01 - VISA
·02 - Mastercard
·03 - American Express
·04 - Sorocred
·99 - Others
String0 or 2YES

Example#

Request and Response

GET /v1/sales/SALE001/payments/10 HTTP/1.1
Host: server.example.com
client_id: CLIENTID00000
site_id: SITEID000000000
Authorization: Bearer accessTokenExample456
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
{
"code":"number",
"message":"string",
"status":string,
"payment" : {
"status":"number",
"authorizer_code":"string",
"authorizer_message":"string",
"order_id":"number",
"payment_method":"number",
"merchant_usn":"number",
"amount":"number",
"gateway_usn ":"number",
"authorizer_id":"number",
"acquirer_id":"number",
"acquirer_name": "string",
"authorizer_date":"date",
"authorization_code":"number",
"host_usn":"string",
"payment_date": "date",
"issuer":"string",
"authorizer_merchant_id":"string",
"terminal_merchant_id":"string",
"terminal_id": "date",
"endtoendpix": "ABC",
"card" : {
"masked_pan":"string",
"expyre_date" : "date",
"entry_mode": "string",
},
"invoice_data":{
"sat_host_id":"string"
},
"print": [
{
"type": "string",
"data": [
{
"info": "string",
"format": "string"
}
]
}
]
}
}