Quick start
This guide shows the process of performing a spot sale payment, using e-SiTef's REST web service interface.
What you'll need
- Active account on e-SiTef's homologation environment (obtained with our support team)
- A tool capable of performing HTTP calls, such as Postman, REST Client or cURL
Creating the transaction
HTTP method: POST
URL: https://esitef-homologacao.softwareexpress.com.br/e-sitef/api/v1/transactions
Headers:
- Content-Type: application/json
- merchant_id: {your merchant id}
- merchant_key: {your merchant key}
Request:
{
"merchant_usn":"12042142155",
"order_id":"12042142155",
"installments":"1",
"installment_type":"4",
"authorizer_id":"2",
"amount":"1"
}
curl
--request POST "https://esitef-homologacao.softwareexpress.com.br/e-sitef/api/v1/transactions"
--header "Content-Type: application/json"
--header "merchant_id: xxxxxxxx"
--header "merchant_key: xxxxxxxxxxx"
--data-binary
{
"merchant_usn":"12042142155",
"order_id":"12042142155",
"installments":"1",
"installment_type":"4",
"authorizer_id":"2",
"amount":"1"
}
--verbose
Response:
{
"code": "0",
"message": "OK. Transaction successful.",
"payment": {
"status": "NOV",
"nit": "<nit>",
"order_id": "12042142155",
"merchant_usn": "12042142155",
"amount": "1"
}
}
Learn more about this service.
Paying
HTTP method: POST
URL: https://esitef-homologacao.softwareexpress.com.br/e-sitef/api/v1/payments/<nit>
Replace the field <nit> in the URL above with the NIT obtained in the transaction creation step.
Headers:
- Content-Type: application/json
- merchant_id: {your merchant id}
- merchant_key: {your merchant key}
Request:
{
"card":{
"number":"5555555555555555",
"expiry_date":"1222",
"security_code":"601"
}
}
curl
--request POST "https://esitef-homologacao.softwareexpress.com.br/e-sitef/api/v1/payments/<nit>"
--header "Content-Type: application/json"
--header "merchant_id: xxxxxxxx"
--header "merchant_key: xxxxxxxxxxx"
--data-binary
{
"card":{
"number":"5555555555555555",
"expiry_date":"1222",
"security_code":"601"
}
}
--verbose
Response:
{
"code": "0",
"message": "OK. Transaction successful.",
"payment": {
"authorizer_code": "000",
"authorizer_message": "Transacao OK",
"status": "CON",
"nit": "<nit>",
"order_id": "12042142155",
"customer_receipt": "====CUPOM COMPRADOR====",
"merchant_receipt": "====CUPOM ESTABELECIMENTO====",
"authorizer_id": "2",
"acquirer_id": "1005",
"acquirer_name": "Redecard",
"authorizer_date": "13/04/2018T10:56",
"authorization_number": "132324",
"merchant_usn": "12042142155",
"esitef_usn": "180413005038220",
"sitef_usn": "132324",
"host_usn": "999132324 ",
"amount": "1",
"payment_type": "C",
"issuer": "2",
"authorizer_merchant_id": "000000000000005",
"payment_date": "13/04/2018T10:56"
}
}
Learn more about this service.
Checking the payment status
HTTP method: GET
URL: https://esitef-homologacao.softwareexpress.com.br/e-sitef/api/v1/transactions/<nit>
Replace the field <nit> in the URL above with the NIT obtained in the transaction creation step.
Headers:
- Content-Type: application/json
- merchant_id: {your merchant id}
- merchant_key: {your merchant key}
curl
--request GET "https://esitef-homologacao.softwareexpress.com.br/e-sitef/api/v1/transactions/<nit>"
--header "merchant_id: xxxxxxxxxxxxxxx"
--header "merchant_key: xxxxxxxxxxx"
--verbose
Response:
{
"code": "0",
"message": "OK. Transaction successful.",
"payment": {
"authorizer_code": "000",
"authorizer_message": "Transacao OK",
"status": "CON",
"nit": "<nit>",
"order_id": "12042142155",
"customer_receipt": "====CUPOM COMPRADOR====",
"merchant_receipt": "====CUPOM ESTABELECIMENTO====",
"authorizer_id": "2",
"acquirer_id": "1005",
"acquirer_name": "Redecard",
"authorizer_date": "13/04/2018T10:56",
"authorization_number": "132324",
"merchant_usn": "12042142155",
"esitef_usn": "180413005038220",
"sitef_usn": "132324",
"host_usn": "999132324 ",
"amount": "1",
"payment_type": "C",
"issuer": "2",
"authorizer_merchant_id": "000000000000005",
"payment_date": "13/04/2018T10:56"
}
}