Payment confirmation service
After creating and authorizing a payment pending confirmation, the merchant must call the confirmation service to confirm or undo the payment using the same NIT obtained on the first step of the flow.
#
Call details- Resource:
/v1/payments/{nit}
- HTTP Method:
PUT
- Request format:
query string
- Response format:
JSON
- Header parameters:
Parameter | Description | Format | Mandatory |
---|---|---|---|
merchant_id | Merchant code on Carat Portal. The production and certification codes will be different. | < 15 AN | YES |
merchant_key | Merchant authentication key on Carat Portal. The production and certification keys will be different. | < 80 AN | YES |
#
ExamplesBelow is an example of the payment confirmation service call using the cURL tool.
Request:
To use this example, don't forget to define the variable {{url}}
with the value
esitef-homologacao.softwareexpress.com.br
Response:
Response codes
See reference on API codes - response codes
#
Request parametersThe table below describes the request parameters of the payment confirmation service:
Parameter | Description | Format | Mandatory |
---|---|---|---|
confirm | This field must be sent with the value true if you want to confirm the transaction, or false , if you want to undo it. | < 5 T/F | YES |
amount | Amount to be captured. It must be less than or equal to the authorized amount. Partial confirmations are only supported by non-SiTef routings. If this field is not sent, the total transaction amount is used. | < 12 N | NO |
#
Response parametersIf successful, the HTTP response code will be 200
. Any other code must be interpreted as an error. The table below describes the response parameters of the payment confirmation service:
Parameter | Description | Format |
---|---|---|
code | Carat Portal response code. Any code different from 0 means failure. Learn more. | < 4 N |
message | Carat Portal response message. | < 500 AN |
payment | ||
status | Status of the payment transaction on Carat Portal. Learn more. | = 3 AN |
host_usn | Host USN. | < 15 AN |
payment_date | Payment authorization date on Carat Portal in DD/MM/YYYY'T'HH:mm format. Example: 13/07/2017T16:03 | = 16 D |