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 e-SiTef. The production and certification codes will be different. | < 15 AN | YES |
merchant_key | Merchant authentication key on e-SiTef. The production and certification keys will be different. | < 80 AN | YES |
Examples
Below is an example of the payment confirmation service call using the cURL tool.
Request:
curl
--request PUT "https://esitef-homologacao.softwareexpress.com.br/e-sitef/api/v1/payments/1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqr?confirm=true"
--header "merchant_id: xxxxxxxxxxx"
--header "merchant_key: xxxxxxxxxxx"
--verbose
Response:
{
"code":"0",
"message":"OK. Transaction successful.",
"payment":{
"status":"CON"
}
}
Request parameters
The 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 parameters
If 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 | e-SiTef response code. Any code different from 0 means failure. Learn more. | < 4 N |
message | e-SiTef response message. | < 500 AN |
| payment | ||
status | Status of the payment transaction on e-SiTef. Learn more. | = 3 AN |
host_usn | Host USN. | < 15 AN |
payment_date | Payment authorization date on e-SiTef in DD/MM/YYYY'T'HH:mm format. Example: 13/07/2017T16:03 | = 16 D |