This document will cover the basics of how to receive a payment using the Acqio Mais API.
You will need a computer with windows 7+ connected to the internet, the Acqio Mais software installed, and a pinpad properly connected and configured.
To start a transaction, run Acqio Mais then submit a POST request to http://localhost:12030/api/transaction/start with a payload similar to the examples below:
{
"installment":3,
"cardApplication":"CREDITO",
"value":0.03,
"tenantPlanMode":"DISABLED",
"qrApplication":"NENHUM"
}
{
"installment":1,
"cardApplication":"DEBITO",
"value":0.03,
"tenantPlanMode":"DISABLED",
"qrApplication":"NENHUM"
}
The application will return the status 1 (PROCESSING) with the transaction id. All the communication betweeen the pinpad and the acquirer host is carried out by Acqio Mais. An Example of the API’s response should look similar to the example below:
{
"id":89,
"status":1,
"actions":[
"/transaction/status",
"/transaction/abort"
],
"message":"ACQIO MAIS"
}
If there’s a transaction in course, the API’s response should look similar to the example below:
{
"status":-1,
"actions":[
"/transaction/status",
"/transaction/abort"
],
"message":"JÁ EXISTE UMA TRANSAÇÃO SENDO PROCESSADA"
}
If the pinpad is not configured or it is disconnected, the API’s response should look similar to the example below:
{
"id":1,
"status":1,
"actions":[
"/transaction/status",
"/transaction/abort"
],
"message":"NÃO FOI POSSIVEL SE COMUNICAR COM O PINPAD.[COMXX]"
}
If the transaction is of type Pix (PIX_DEBITO), the system will return status code 2 (WAITING CHARGE), indicating that the transaction is waiting for payment. The pixCopyPaste field will be provided, containing the Pix code in TLV (Tag Length Value) format.
The pixCopyPaste field is used to facilitate the Pix transaction payment. It contains a code that can be copied and pasted into the payer’s bank or financial institution app. This code automatically directs the user to the payment screen, filling in the necessary information to complete the transaction without requiring the payer to manually input the recipient’s details or the transaction amount. Furthermore, the QR Code will be displayed on the pinpad screen:
{
"id": 1,
"status": 2,
"actions": [
"/transaction/status",
"/transaction/abort"
],
"message": "ACQIO MAIS",
"pixCopyPaste": "00020101021226910014br.gov.bcb.pix2569api.developer.btgpactual.com/v1/p/v2/2fad9a02d67948fa9bd9cb579946ca5f5204000053039865802BR5923ACQIO ADQUIRENCIA IP SA6009Sao Paulo61080457190062070503***6304426A"
}
The application consuming the API should make a GET request in loop to http://localhost:12030/api/transaction/status to keep track of the transaction flow until it gets a response with status 2 (WAITING CHARGE). The API response to this request should look similar to the examples below:
Transaction with status 1 (PROCESSING).
{
"id":3,
"status":1,
"actions":[
"/transaction/abort"
],
"message":"APROX, INSIRA OU PASSE O CARTAO",
"installmentInfo":null,
"cardInfo":null,
"clearDataResponseDTO":null
}
{
"id":3,
"status":1,
"actions":[
"/transaction/abort"
],
"message":"SELECIONADO: Credito Nubank ",
"installmentInfo":null,
"cardInfo":null,
"clearDataResponseDTO":null
}
Transaction with status 2 (WAITING CHARGE).
{
"id":1,
"status":2,
"actions":[
"/transaction/charge/{installment}",
"/transaction/abort"
],
"message":"SELECIONADO: Credito Nubank ",
"installmentInfo":[
{
"cardBrand":"Mastercard",
"cardApplication":"CREDITO",
"installment":1,
"installmentValue":0.03,
"total":0.03
},
{
"cardBrand":"Mastercard",
"cardApplication":"CREDITO",
"installment":2,
"installmentValue":0.02,
"total":0.04
},
{
"cardBrand":"Mastercard",
"cardApplication":"CREDITO",
"installment":3,
"installmentValue":0.01,
"total":0.03
}
],
"cardInfo":{
"requireSignature":false,
"holderName":"SILVA/PEDRO A B",
"bin":"123456"
}
}
Pix transaction status (PIX_DEBITO), code 2 (WAITING CHARGE):
{
"id": 1,
"status": 2,
"actions": [
"/transaction/abort"
],
"message": "Use Seu Smartphone Para Ler O Qr Code"
}
When the API returns status 2 (WAITING CHARGE), send a GET request to http://localhost:12030/api/transaction/charge/{installment}, where the {installment} parameter should be replaced by the number of installments in this transaction (the same number informed in the installment field when a request was sent to http://localhost:12030/api/transaction/start)
Request example to http://localhost:12030/api/transaction/start.
{
"installment": 3,
"cardApplication": "CREDITO",
"value": 0.03,
"tenantPlanMode": "DISABLED",
"qrApplication": "NENHUM"
}
Therefore, the request must be sent to http://localhost:12030/api/transaction/charge/3.
After sending a request to http://localhost:12030/api/transaction/charge/{installment}, the API will return status 3 (PROCESSING_CHARGE). The API response to this request should look like the example below:
{
"id":2,
"status":3,
"actions":[
"/transaction/abort"
],
"message":"SELECIONADO: Credito Nubank "
}
After getting a status 3 (PROCESSING_CHARGE), the password must be typed on the pinpad.
If a request is sent to http://localhost:12030/api/transaction/status, the API will return the following message:
{
"id":2,
"status":3,
"actions":[
"/transaction/abort"
],
"message":"SOLICITE A SENHA "
}
If the transaction is of type Pix (PIX_DEBITO), the API will return status 3, indicating that the QR Code payment is being processed:
Note: For Pix transactions (PIX_DEBITO), the installment will always be “1”. Example http://localhost:12030/api/transaction/charge/1.
{
"id": 28,
"status": 3,
"actions": [
"/transaction/abort"
],
"message": "Use Seu Smartphone Para Ler O Qr Code"
}
If the payment is not completed within 5 minutes, a timeout will occur, and the transaction will be automatically canceled:
{
"id": 28,
"status": -1,
"actions": [
"/transaction/abort"
],
"message": "TEMPO EXCEDIDO"
}
The transaction will be processed and the API may return a successful or unsuccesful response. Keep track of the transaction status until the API return the status 0 (SUCCESS). That means the transaction was completed successfully and the transaction flow has finished. The API status should look similar to the examples below:
{
"id":3,
"status":3,
"actions":[
"/transaction/abort"
],
"message":" PROCESSANDO ",
"installmentInfo":null,
"cardInfo":null,
"clearDataResponseDTO":null
}
{
"id":3,
"status":3,
"actions":[
"/transaction/abort"
],
"message":" APROVADA ",
"installmentInfo":null,
"cardInfo":null,
"clearDataResponseDTO":null
}
{
"id":3,
"status":0,
"actions":[
"/transaction/abort"
],
"message":"RETIRE O CARTAO ",
"installmentInfo":null,
"cardInfo":null,
"clearDataResponseDTO":null
}
Response for the transaction if it is Pix (PIX_DEBITO):
{
"id": 6,
"status": 0,
"actions": [
"/transaction/abort"
],
"message": " Aprovada"
}
At some point after starting a transaction, the application may cancel the current operation by sending a GET request to http://localhost:12030/api/transaction/abort. This will abort the current operation and make the API return to it’s idle state. An example of the API’s response should look similar to the example below:
Note: In this case status 0(SUCCESS) means that the abort request was successful
{
"id":88,
"status":0,
"actions":[
],
"message":""
}
While calling http://localhost:12030/api/transaction/status, the Acqio Mais application may respond with a status 0 (SUCCESS). This means the transaction was completed successfully and the application can now make a GET request to http://localhost:12030/api/transaction/receipt/{id} to get the merchant and customer receipt. The id is the one the application received when it started the transaction. The receipt is a string with a line feed character at the end of each line. The API response should look similar to the example below:
Note: If no id is provided the Acqio Mais API will return the receipt of the last successful transaction.
{
"transactionId": 8,
"status": 0,
"paymentStatus": "SUCCESS",
"nsu": "300830164937",
"cardHiddenPan": "417402******2022",
"authorizationCode": "..",
"cardProductName": "VISA ELECTRON",
"merchant": "VISAELECTRON\r\nVIA ESTAB.\r\nACQIO PAGAMENTOS FILIAL 3\r\nCNPJ 00000000000000\r\nRUA UM DOIS TRES, 00\r\n22222222220\r\nVISA DEBITO\r\n************2022\r\nR$1,00\r\nDEBITO\r\n30/08/24 16:48 \r\nAUTO:543487\r\nCV:300830164937\r\nEC:000000000000000\r\nTI:00000000\r\nAC:0F000B0002BEC0AB\r\nAID:A0000000000000\r\nTX:00000000\r\nSN:000000000\r\nTAXA-ZERO:NAO\r\n",
"client": "...",
"merchantHtml": "...",
"clientHtml": "..."
"cardApplication": "DEBITO",
"cardHolderName": "PAYWAVE/VISA"
}
{
"transactionId": 6,
"status": 0,
"paymentStatus": "SUCCESS",
"nsu": "31425706-37f3-4b32-96a5-14d4dc6b4ebf",
"cardHiddenPan": "",
"authorizationCode": "",
"cardProductName": "PIX",
"merchant": "PIX\r\nVIA ESTAB.\r\nACQIO PAGAMENTOS FILIAL 3\r\nCNPJ 00000000000000\r\nRUA UM DOIS TRES, 00\r\n2222222222\r\nPIX\r\n************\r\nR$1,00\r\nPIX\r\n30/08/24 16:35 \r\nTRANSACAO AUTORIZADA COM CELULAR\r\nCV:31425706-37f3-4b32-96a5-14d4dc6b4ebf\r\nTX:00000000\r\nSN:00000000\r\nTAXA-ZERO:NAO\r\n",
"client": "...",
"merchantHtml": "...",
"clientHtml": "...",
"cardApplication": "DEBITO",
"cardHolderName": ""
}
Note: The last transaction receipt may be a reversal receipt.
{
"transactionId":89,
"status":0,
"paymentStatus":"CANCELED",
"cardApplication":"CREDITO",
"cardHiddenPan":"410863******3263",
"authorizationCode":"372568",
"cardProductName":"VISA",
"nsu":"000314030029",
"nsuOriginal":"000314030030",
"merchant":"VISA\nVIA ESTAB.\nNOME ESTABELECIMENTO\nCNPJ 00.000.000/0001-00\nAV DA ALEGRIA 100\n11 99999-9999 \nCREDITO\n************1234\nVALOR CANCELADO\nR$0,03\nESTORNO CREDITO A VISTA\n08/10/19 12:07 AUTO:123456\nAUTORIZADA MEDIANTE SENHA\nCV:072575917805\nEC:T5NON91IT0RAQ55\nTI:00000000\nAC:JR85E1BLASMR3JKC\nAID:5NON91IT0RAQ56\nTX:61406035\nSN:AA0000123\nCV ORIG:072575917804\n",
"client":"VISA\nVIA CLIENTE\nNOME ESTABELECIMENTO\nCNPJ 00.000.000/0001-00\nAV DA ALEGRIA 100\n11 99999-9999\n CREDITO\n************1234\nVALOR CANCELADO\nR$0,03\nESTORNO CREDITO A VISTA\n08/10/19 12:07 AUTO:123456\nCV:072575917805 \nEC:T5NON91IT0RAQ55\nTI:00000000\nAC:JR85E1BLASMR3JKC\nAID:5NON91IT0RAQ56\nTX:61406035\nSN:AA0000123\nCV ORIG:072575917 804\n",
"merchantHtml":"...",
"clientHtml":"..."
}
Note: If the id provided is incorret or could not be found in the database, the application will recieve a response similar to the example below:
{
"transactionId":-1,
"status":-2,
"merchant":"",
"client":""
}
Note: If no id is provided the Acqio Mais API will return the receipt of the last successful.
This operation can only be performed on the same day the transaction ocurred. Trying to revert an operation on the next day or after will fail. To revert a transaction, the application should make GET request to http://localhost:12030/api/transaction/revert/{id}, where the id is the one the application received when it started the transaction. The reversal response should look similar to the examples below:
Note: For Pix (PIX_DEBITO) transactions, the payment cannot be reversed.
{
"id":89,
"status":1,
"actions":[
"/transaction/status",
"/transaction/abort"
],
"message":"INICIANDO CANCELAMENTO"
}
{
"id":89,
"status":1,
"actions":[
"/transaction/status",
"/transaction/abort"
],
"message":"INSIRA OU PASSE O CARTAO"
}
{
"id":89,
"status":1,
"actions":[
"/transaction/status",
"/transaction/abort"
],
"message":"DEBITO SELECIONADO"
}
{
"id":89,
"status":1,
"actions":[
"/transaction/status",
"/transaction/abort"
],
"message":"PROCESSANDO..."
}
{
"id":89,
"status":1,
"actions":[
"/transaction/status",
"/transaction/abort"
],
"message":"CANCELAMENTO APROVADO"
}
{
"id":89,
"status":0,
"actions":[
"/transaction/status",
"/transaction/abort"
],
"message":"RETIRE O CARTAO"
}
Note: The following response may be caused by a desconfigured or desconnected pinpad.
{
"id": -1,
"status": -1,
"actions": [
"/transaction/status",
"/transaction/abort"
], "message": "Não foi possivel se comunicar com o Pinpad.[COMXX]" }
CODIGO | DESCRIÇÃO |
---|---|
-2 | NOT FOUND |
-1 | INACTIVE |
0 | SUCCESS |
1 | PROCESSING |
2 | WAITING CHARGE |
3 | PROCESSING CHARGE |
4 | PROCESSING CLEAR DATA |
The Acqio Mais API provides an endpoint to simulate installments. To consume it, make a POST request to http://localhost:12030/tenant/plan with the value as payload. The request should look similar to the example below:
{
"value":100.00
}
The API will calculate the installments according to the tenant’s plan and respond with a JSON that should look similar to the example below:
{
"tenantName":"YATTA SUSHI",
"installmentInfoList":[
{
"cardBrand":"Visa",
"cardApplication":"DEBITO",
"installment":1,
"installmentValue":100.00,
"total":100.00
},
{
"cardBrand":"Visa",
"cardApplication":"CREDITO",
"installment":1,
"installmentValue":100.00,
"total":100.00
},
{
"cardBrand":"Visa",
"cardApplication":"CREDITO",
"installment":2,
"installmentValue":50.00,
"total":100.00
},
{
"cardBrand":"Visa",
"cardApplication":"CREDITO",
"installment":3,
"installmentValue":33.34,
"total":100.02
},
{
"cardBrand":"Visa",
"cardApplication":"CREDITO",
"installment":4,
"installmentValue":26.50,
"total":106.00
},
{
"cardBrand":"Visa",
"cardApplication":"CREDITO",
"installment":5,
"installmentValue":21.60,
"total":108.00
},
{
"cardBrand":"Visa",
"cardApplication":"CREDITO",
"installment":6,
"installmentValue":18.33,
"total":109.98
},
{
"cardBrand":"Visa",
"cardApplication":"CREDITO",
"installment":7,
"installmentValue":16.00,
"total":112.00
},
{
"cardBrand":"Visa",
"cardApplication":"CREDITO",
"installment":8,
"installmentValue":14.25,
"total":114.00
},
{
"cardBrand":"Visa",
"cardApplication":"CREDITO",
"installment":9,
"installmentValue":12.88,
"total":115.92
},
{
"cardBrand":"Visa",
"cardApplication":"CREDITO",
"installment":10,
"installmentValue":11.80,
"total":118.00
},
{
"cardBrand":"Visa",
"cardApplication":"CREDITO",
"installment":11,
"installmentValue":10.90,
"total":119.90
},
{
"cardBrand":"Visa",
"cardApplication":"CREDITO",
"installment":12,
"installmentValue":10.16,
"total":121.92
},
{
"cardBrand":"Mastercard",
"cardApplication":"DEBITO",
"installment":1,
"installmentValue":100.00,
"total":100.00
},
{
"cardBrand":"Mastercard",
"cardApplication":"CREDITO",
"installment":1,
"installmentValue":100.00,
"total":100.00
},
{
"cardBrand":"Mastercard",
"cardApplication":"CREDITO",
"installment":2,
"installmentValue":50.00,
"total":100.00
},
{
"cardBrand":"Mastercard",
"cardApplication":"CREDITO",
"installment":3,
"installmentValue":33.34,
"total":100.02
},
{
"cardBrand":"Mastercard",
"cardApplication":"CREDITO",
"installment":4,
"installmentValue":26.50,
"total":106.00
},
{
"cardBrand":"Mastercard",
"cardApplication":"CREDITO",
"installment":5,
"installmentValue":21.60,
"total":108.00
},
{
"cardBrand":"Mastercard",
"cardApplication":"CREDITO",
"installment":6,
"installmentValue":18.33,
"total":109.98
},
{
"cardBrand":"Mastercard",
"cardApplication":"CREDITO",
"installment":7,
"installmentValue":16.00,
"total":112.00
},
{
"cardBrand":"Mastercard",
"cardApplication":"CREDITO",
"installment":8,
"installmentValue":14.25,
"total":114.00
},
{
"cardBrand":"Mastercard",
"cardApplication":"CREDITO",
"installment":9,
"installmentValue":12.88,
"total":115.92
},
{
"cardBrand":"Mastercard",
"cardApplication":"CREDITO",
"installment":10,
"installmentValue":11.80,
"total":118.00
},
{
"cardBrand":"Mastercard",
"cardApplication":"CREDITO",
"installment":11,
"installmentValue":10.90,
"total":119.90
},
{
"cardBrand":"Mastercard",
"cardApplication":"CREDITO",
"installment":12,
"installmentValue":10.16,
"total":121.92
},
{
"cardBrand":"Hipercard",
"cardApplication":"CREDITO",
"installment":1,
"installmentValue":100.00,
"total":100.00
},
{
"cardBrand":"Hipercard",
"cardApplication":"CREDITO",
"installment":2,
"installmentValue":50.00,
"total":100.00
},
{
"cardBrand":"Hipercard",
"cardApplication":"CREDITO",
"installment":3,
"installmentValue":33.34,
"total":100.02
},
{
"cardBrand":"Hipercard",
"cardApplication":"CREDITO",
"installment":4,
"installmentValue":26.50,
"total":106.00
},
{
"cardBrand":"Hipercard",
"cardApplication":"CREDITO",
"installment":5,
"installmentValue":21.60,
"total":108.00
},
{
"cardBrand":"Hipercard",
"cardApplication":"CREDITO",
"installment":6,
"installmentValue":18.33,
"total":109.98
},
{
"cardBrand":"Hipercard",
"cardApplication":"CREDITO",
"installment":7,
"installmentValue":16.00,
"total":112.00
},
{
"cardBrand":"Hipercard",
"cardApplication":"CREDITO",
"installment":8,
"installmentValue":14.25,
"total":114.00
},
{
"cardBrand":"Hipercard",
"cardApplication":"CREDITO",
"installment":9,
"installmentValue":12.88,
"total":115.92
},
{
"cardBrand":"Hipercard",
"cardApplication":"CREDITO",
"installment":10,
"installmentValue":11.80,
"total":118.00
},
{
"cardBrand":"Hipercard",
"cardApplication":"CREDITO",
"installment":11,
"installmentValue":10.90,
"total":119.90
},
{
"cardBrand":"Hipercard",
"cardApplication":"CREDITO",
"installment":12,
"installmentValue":10.16,
"total":121.92
},
{
"cardBrand":"EloCredit",
"cardApplication":"DEBITO",
"installment":1,
"installmentValue":100.00,
"total":100.00
},
{
"cardBrand":"EloCredit",
"cardApplication":"CREDITO",
"installment":1,
"installmentValue":100.00,
"total":100.00
},
{
"cardBrand":"EloCredit",
"cardApplication":"CREDITO",
"installment":2,
"installmentValue":50.00,
"total":100.00
},
{
"cardBrand":"EloCredit",
"cardApplication":"CREDITO",
"installment":3,
"installmentValue":33.34,
"total":100.02
},
{
"cardBrand":"EloCredit",
"cardApplication":"CREDITO",
"installment":4,
"installmentValue":26.50,
"total":106.00
},
{
"cardBrand":"EloCredit",
"cardApplication":"CREDITO",
"installment":5,
"installmentValue":21.60,
"total":108.00
},
{
"cardBrand":"EloCredit",
"cardApplication":"CREDITO",
"installment":6,
"installmentValue":18.33,
"total":109.98
},
{
"cardBrand":"EloCredit",
"cardApplication":"CREDITO",
"installment":7,
"installmentValue":16.00,
"total":112.00
},
{
"cardBrand":"EloCredit",
"cardApplication":"CREDITO",
"installment":8,
"installmentValue":14.25,
"total":114.00
},
{
"cardBrand":"EloCredit",
"cardApplication":"CREDITO",
"installment":9,
"installmentValue":12.88,
"total":115.92
},
{
"cardBrand":"EloCredit",
"cardApplication":"CREDITO",
"installment":10,
"installmentValue":11.80,
"total":118.00
},
{
"cardBrand":"EloCredit",
"cardApplication":"CREDITO",
"installment":11,
"installmentValue":10.90,
"total":119.90
},
{
"cardBrand":"EloCredit",
"cardApplication":"CREDITO",
"installment":12,
"installmentValue":10.16,
"total":121.92
},
{
"cardBrand":"Hiper",
"cardApplication":"CREDITO",
"installment":1,
"installmentValue":100.00,
"total":100.00
},
{
"cardBrand":"Hiper",
"cardApplication":"CREDITO",
"installment":2,
"installmentValue":50.00,
"total":100.00
},
{
"cardBrand":"Hiper",
"cardApplication":"CREDITO",
"installment":3,
"installmentValue":33.34,
"total":100.02
},
{
"cardBrand":"Hiper",
"cardApplication":"CREDITO",
"installment":4,
"installmentValue":26.50,
"total":106.00
},
{
"cardBrand":"Hiper",
"cardApplication":"CREDITO",
"installment":5,
"installmentValue":21.60,
"total":108.00
},
{
"cardBrand":"Hiper",
"cardApplication":"CREDITO",
"installment":6,
"installmentValue":18.33,
"total":109.98
},
{
"cardBrand":"Hiper",
"cardApplication":"CREDITO",
"installment":7,
"installmentValue":16.00,
"total":112.00
},
{
"cardBrand":"Hiper",
"cardApplication":"CREDITO",
"installment":8,
"installmentValue":14.25,
"total":114.00
},
{
"cardBrand":"Hiper",
"cardApplication":"CREDITO",
"installment":9,
"installmentValue":12.88,
"total":115.92
},
{
"cardBrand":"Hiper",
"cardApplication":"CREDITO",
"installment":10,
"installmentValue":11.80,
"total":118.00
},
{
"cardBrand":"Hiper",
"cardApplication":"CREDITO",
"installment":11,
"installmentValue":10.90,
"total":119.90
},
{
"cardBrand":"Hiper",
"cardApplication":"CREDITO",
"installment":12,
"installmentValue":10.16,
"total":121.92
},
{
"cardBrand":"CabalCredit",
"cardApplication":"CREDITO",
"installment":1,
"installmentValue":100.00,
"total":100.00
},
{
"cardBrand":"CabalCredit",
"cardApplication":"CREDITO",
"installment":2,
"installmentValue":50.00,
"total":100.00
},
{
"cardBrand":"CabalCredit",
"cardApplication":"CREDITO",
"installment":3,
"installmentValue":33.34,
"total":100.02
},
{
"cardBrand":"CabalCredit",
"cardApplication":"CREDITO",
"installment":4,
"installmentValue":26.50,
"total":106.00
},
{
"cardBrand":"CabalCredit",
"cardApplication":"CREDITO",
"installment":5,
"installmentValue":21.60,
"total":108.00
},
{
"cardBrand":"CabalCredit",
"cardApplication":"CREDITO",
"installment":6,
"installmentValue":18.33,
"total":109.98
},
{
"cardBrand":"CabalCredit",
"cardApplication":"CREDITO",
"installment":7,
"installmentValue":16.00,
"total":112.00
},
{
"cardBrand":"CabalCredit",
"cardApplication":"CREDITO",
"installment":8,
"installmentValue":14.25,
"total":114.00
},
{
"cardBrand":"CabalCredit",
"cardApplication":"CREDITO",
"installment":9,
"installmentValue":12.88,
"total":115.92
},
{
"cardBrand":"CabalCredit",
"cardApplication":"CREDITO",
"installment":10,
"installmentValue":11.80,
"total":118.00
},
{
"cardBrand":"CabalCredit",
"cardApplication":"CREDITO",
"installment":11,
"installmentValue":10.90,
"total":119.90
},
{
"cardBrand":"CabalCredit",
"cardApplication":"CREDITO",
"installment":12,
"installmentValue":10.16,
"total":121.92
},
{
"cardBrand":"VisaElectron",
"cardApplication":"DEBITO",
"installment":1,
"installmentValue":100.00,
"total":100.00
},
{
"cardBrand":"Maestro",
"cardApplication":"DEBITO",
"installment":1,
"installmentValue":100.00,
"total":100.00
},
{
"cardBrand":"EloDebit",
"cardApplication":"DEBITO",
"installment":1,
"installmentValue":100.00,
"total":100.00
},
{
"cardBrand":"CabalDebit",
"cardApplication":"DEBITO",
"installment":1,
"installmentValue":100.00,
"total":100.00
}
]
}
You can get all transactions by submitting a GET request to http://localhost:12030/api/transaction/receipt/all.
{
"content":[
{
"transactionId":1,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":2,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":3,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":4,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":5,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":6,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":7,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":8,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":9,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":10,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
}
],
"pageable":{
"sort":{
"sorted":true,
"unsorted":false,
"empty":false
},
"offset":0,
"pageSize":10,
"pageNumber":0,
"paged":true,
"unpaged":false
},
"last":false,
"totalPages":2,
"totalElements":16,
"size":10,
"number":0,
"sort":{
"sorted":true,
"unsorted":false,
"empty":false
},
"numberOfElements":10,
"first":true,
"empty":false
}
All transactions are divided by pages. A GET request to http://localhost:12030/api/transaction/receipt/all will fetch the first page with ten transactions by default. You can access other pages by submitting a GET request to http://localhost:12030/api/transaction/receipt/all?page=1 where the number after page= is the page you want to access. However, there are three things you must be aware of: the first one is the page numbering (the first page is the page zero, the second page is page one, the third page is the page two, and so on), the second thing is which page you want to fetch (by the end of the response, there is a field named totalPages which says how many pages you can access. If you enter a number greater than or equal to totalPages, no transactions will be brought) and the last thing is in case you don’t enter any number (the first page will be fetched - page zero).
Example of submitting a request to http://localhost:12030/api/transaction/receipt/all?page=1 (fetching page two).
{
"content":[
{
"transactionId":11,
"paymentStatus":"SUCCESS",
"nsu":"000049465298",
"cardHiddenPan":"523421******1836",
"authorizationCode":"445286",
"cardProductName":"MASTERCARD",
"cardApplication":"CREDITO"
},
{
"transactionId":12,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":13,
"paymentStatus":"CANCELED",
"nsu":"000049465605",
"nsuOriginal":"000049465298",
"cardHiddenPan":"523421******1836",
"authorizationCode":"445286",
"cardProductName":"MASTERCARD",
"cardApplication":"CREDITO"
},
{
"transactionId":14,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":15,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":16,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
}
],
"pageable":{
"sort":{
"sorted":true,
"unsorted":false,
"empty":false
},
"offset":10,
"pageSize":10,
"pageNumber":1,
"paged":true,
"unpaged":false
},
"last":true,
"totalPages":2,
"totalElements":16,
"size":10,
"number":1,
"sort":{
"sorted":true,
"unsorted":false,
"empty":false
},
"numberOfElements":6,
"first":false,
"empty":false
}
Example of submitting a request to http://localhost:12030/api/transaction/receipt/all?page=3 (trying to access a page which its number is greater than or equal to totalPages value).
{
"content":[
],
"pageable":{
"sort":{
"unsorted":false,
"sorted":true,
"empty":false
},
"offset":30,
"pageSize":10,
"pageNumber":3,
"paged":true,
"unpaged":false
},
"last":true,
"totalPages":2,
"totalElements":16,
"size":10,
"number":3,
"sort":{
"unsorted":false,
"sorted":true,
"empty":false
},
"numberOfElements":0,
"first":false,
"empty":true
}
Example of submitting a request to http://localhost:12030/api/transaction/receipt/all?page= (not entering a number).
{
"content":[
{
"transactionId":1,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":2,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":3,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":4,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":5,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":6,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":7,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":8,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":9,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":10,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
}
],
"pageable":{
"sort":{
"unsorted":false,
"sorted":true,
"empty":false
},
"offset":0,
"pageSize":10,
"pageNumber":0,
"paged":true,
"unpaged":false
},
"last":false,
"totalPages":2,
"totalElements":16,
"size":10,
"number":0,
"sort":{
"unsorted":false,
"sorted":true,
"empty":false
},
"numberOfElements":10,
"first":true,
"empty":false
}
You can also choose how many transactions you want per page. Just submit a GET request to http://localhost:12030/api/transaction/receipt/all?size=8 where the number after size= is the amount of transactions per page. The default number is ten.
Example of submitting a request to http://localhost:12030/api/transaction/receipt/all?size=8 (requesting eight transactions per page).
{
"content":[
{
"transactionId":1,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":2,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":3,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":4,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":5,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":6,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":7,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":8,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
}
],
"pageable":{
"sort":{
"sorted":true,
"unsorted":false,
"empty":false
},
"offset":0,
"pageSize":8,
"pageNumber":0,
"paged":true,
"unpaged":false
},
"last":false,
"totalPages":2,
"totalElements":16,
"size":8,
"number":0,
"sort":{
"sorted":true,
"unsorted":false,
"empty":false
},
"numberOfElements":8,
"first":true,
"empty":false
}
Example of submitting a request to http://localhost:12030/api/transaction/receipt/all?size= (not entering a number).
{
"content":[
{
"transactionId":1,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":2,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":3,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":4,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":5,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":6,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":7,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":8,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":9,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":10,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
}
],
"pageable":{
"sort":{
"unsorted":false,
"sorted":true,
"empty":false
},
"offset":0,
"pageSize":10,
"pageNumber":0,
"paged":true,
"unpaged":false
},
"last":false,
"totalPages":2,
"totalElements":16,
"size":10,
"number":0,
"sort":{
"unsorted":false,
"sorted":true,
"empty":false
},
"numberOfElements":10,
"first":true,
"empty":false
}
You can put page and size in the same request. Just add the symbol & between both of them (it doesn’t matter which one comes first).
Example of submitting a request to http://localhost:12030/api/transaction/receipt/all?size=8&page=0.
{
"content":[
{
"transactionId":1,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":2,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":3,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":4,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":5,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":6,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":7,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
},
{
"transactionId":8,
"paymentStatus":"FAILED",
"cardApplication":"CREDITO"
}
],
"pageable":{
"sort":{
"sorted":true,
"unsorted":false,
"empty":false
},
"offset":0,
"pageSize":8,
"pageNumber":0,
"paged":true,
"unpaged":false
},
"last":false,
"totalPages":2,
"totalElements":16,
"size":8,
"number":0,
"sort":{
"sorted":true,
"unsorted":false,
"empty":false
},
"numberOfElements":8,
"first":true,
"empty":false
}
If you want to check only the successful transactions, submit a GET request to http://localhost:12030/api/transaction/receipt/success (you can apply the page and size filter the same way it was explained previously).
Example of submitting a request to http://localhost:12030/api/transaction/receipt/success.
{
"content":[
{
"transactionId":11,
"paymentStatus":"SUCCESS",
"nsu":"000049465298",
"cardHiddenPan":"523421******1836",
"authorizationCode":"445286",
"cardProductName":"MASTERCARD",
"cardApplication":"CREDITO"
}
],
"pageable":{
"sort":{
"unsorted":false,
"sorted":true,
"empty":false
},
"offset":0,
"pageSize":10,
"pageNumber":0,
"paged":true,
"unpaged":false
},
"last":true,
"totalPages":1,
"totalElements":1,
"size":10,
"number":0,
"sort":{
"unsorted":false,
"sorted":true,
"empty":false
},
"numberOfElements":1,
"first":true,
"empty":false
}
If you want to check only the canceled transactions, submit a GET request to http://localhost:12030/api/transaction/receipt/canceled (you can apply the page and size filter the same way it was explained previously).
Example of submitting a request to http://localhost:12030/api/transaction/receipt/canceled.
{
"content":[
{
"transactionId":13,
"paymentStatus":"CANCELED",
"nsu":"000049465605",
"nsuOriginal":"000049465298",
"cardHiddenPan":"523421******1836",
"authorizationCode":"445286",
"cardProductName":"MASTERCARD",
"cardApplication":"CREDITO"
}
],
"pageable":{
"sort":{
"unsorted":false,
"sorted":true,
"empty":false
},
"offset":0,
"pageSize":10,
"pageNumber":0,
"paged":true,
"unpaged":false
},
"last":true,
"totalPages":1,
"totalElements":1,
"size":10,
"number":0,
"sort":{
"unsorted":false,
"sorted":true,
"empty":false
},
"numberOfElements":1,
"first":true,
"empty":false
}
By the end of each response, you will see some information about the response. Some of them are explained below:
The clear data requesting flow works apart from the transaction flow. Therefore, it’s only possible to ask the user for data when there is no transaction going on and it’s only possible to start a transaction when no clear data is being requested. If you attempt to request any data during a transaction, or start a transaction while data is being requested, the API will return a message saying that there’s a request being processed.
{
"status":1,
"actions":[
],
"message":"JÁ EXISTE UMA REQUISIÇÃO SENDO PROCESSADA"
}
Send a POST request to http://localhost:12030/requestClearData/start to ask for the user’s data. You have to specify on
the request body:
Example of a request to http://localhost:12030/requestClearData/start.
{
"messageType":"SOLICITAR_DOCUMENTO_CPF",
"minSize":11,
"maxSize":11,
"timeOut":30
}
There are predefined words to set in messageType (it’s not possible to set any kind of text). The predefined words are indicated below:
The API response will return the following message after you’ve sent a requisition to http://localhost:12030/requestClearData/start:
{
"status":4,
"actions":[
"/requestClearData/getData",
"/requestClearData/end"
],
"message":"DIGITE O CPF"
}
Send a GET request to http://localhost:12030/requestClearData/getData to check what the user has entered on the pinpad. You may get different responses from the API depending on the moment you’ve sent this request:
Response of a GET request to http://localhost:12030/requestClearData/getData while the user is entering data on the pinpad.
{
"status":4,
"actions":[
"/requestClearData/getData",
"/requestClearData/end"
],
"message":"DIGITE O CPF"
}
Response of a GET request to http://localhost:12030/requestClearData/getData after the user has entered the data on the pinpad.
{
"status":4,
"actions":[
"/requestClearData/request",
"/requestClearData/end"
],
"message":"OK",
"clearDataResponseDTO":{
"data":"12345678901",
"responseCode":0
}
}
Response of a GET request to http://localhost:12030/requestClearData/getData after the requisition time is up.
{
"status":4,
"actions":[
"/requestClearData/request",
"/requestClearData/end"
],
"message":"Esgotado o tempo máximo estipulado para a operação.",
"clearDataResponseDTO":{
"data":"",
"responseCode":12
}
}
Response of a GET request to http://localhost:12030/requestClearData/getData after the user preesed the canceling button on the pinpad*.
{
"status":4,
"actions":[
"/requestClearData/request",
"/requestClearData/end"
],
"message":"Operação cancelada pelo operador.",
"clearDataResponseDTO":{
"data":"",
"responseCode":13
}
}
Send a POST request to http://localhost:12030/requestClearData/request to ask the user for more data. You have to specify the same fields as you would when sending a request to http://localhost:12030/requestClearData/start.
Example of a request to http://localhost:12030/requestClearData/request.
{
"messageType":"SOLICITAR_DOCUMENTO_CPF",
"minSize":11,
"maxSize":11,
"timeOut":30
}
Keep in mind: a requisition is sent to http://localhost:12030/requestClearData/start only in the beginning of the flow, when no other requisition was sent. If you need more than one data from the user, then send a requisition to http://localhost:12030/requestClearData/request for each new data. If you try to send a request to http://localhost:12030/requestClearData/start again, the API response will contain a message saying that there’s a requisition being processed already.
{
"status":4,
"actions":[
],
"message":"JÁ EXISTE UMA REQUISIÇÃO SENDO PROCESSADA"
}
Send a GET request to http://localhost:12030/requestClearData/end to end the flow. The API will return the following message:
{
"status":-1,
"actions":[
],
"message":"ACQIO MAIS "
}