Payment

Brazil

API interface that allows the online store to process sales requisitions.

Call Details

  • Resource: /v2/payments
  • HTTP Method: POST
  • Request format: JSON
  • Response format: JSON
  • Header parameters:
ParameterDescriptionFormatMandatory
merchant_idMerchant code on Carat Portal. The production and certification codes will be different.< 15 ANYES
merchant_keyMerchant authentication key on Carat Portal. The production and certification keys will be different.< 80 ANYES
Content-TypeIt must be sent with the value application/json.= 15 ANYES
idempotency_keyIt's like a random code (identifier), with up to 80 characters, created by the integrator that will use the Carat API.< 80 NYES

Examples

Request:

curl --location --request POST 'https://{{url}}/e-sitef/api/v2/payments/' \
--header 'Content-Type: application/json' \
--header 'merchant_id: ************' \
--header 'merchant_key: ************' \
--header 'idempotency_key: ************' \
--data-raw '{
    "merchant_usn": "12050620649",
    "order_id": "121314",
    "installments": "10",
    "installment_type": "4",
    "authorizer_id": "2",
    "amount": "10000",
    "card": {
        "expiry_date": "1222",
        "security_code": "123",
        "number": "5555555555555555"
    }
}'
--verbose

Response:

{
    "code": "0",
    "message": "OK. Transaction successful.",
    "payment": {
        "authorizer_code": "000",
        "authorizer_message": "Transacao Aprov.",
        "status": "CON",
        "nit": "1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqr",
        "order_id": "121314",
        "customer_receipt": "====CUPOM COMPRADOR====",
        "merchant_receipt": "====CUPOM ESTABELECIMENTO====",
        "authorizer_id": "2",
        "acquirer_id": "229",
        "acquirer_name": "Bin",
        "authorizer_date": "14/07/2022T11:54",
        "authorization_number": "145778",
        "merchant_usn": "12050620649",
        "esitef_usn": "220714103502410",
        "sitef_usn": "145778",
        "host_usn": "999145778   ",
        "amount": "10000",
        "payment_type": "C",
        "issuer": "2",
        "authorizer_merchant_id": "000000000000005",
        "terminal_id": "ES000032",
        "payment_date": "14/07/2022T11:54",
        "standin_details": "000001",
        "cvv_result_code": "M"
    }
}

Payment using the same idempotency_key with different order_id

Request:

curl --location --request POST 'https://{{url}}/e-sitef/api/v2/payments/' \
--header 'Content-Type: application/json' \
--header 'merchant_id: **********' \
--header 'merchant_key: **********' \
--header 'idempotency_key: ************' \
--data-raw '{
    "merchant_usn": "12050620649",
    "order_id": "1657833175201",
    "installments": "10",
    "installment_type": "4",
    "authorizer_id": "2",
    "amount": "10000",
    "card": {
        "expiry_date": "1222",
        "security_code": "123",
        "number": "5555555555555555"
    }
}'

Resposta:

{
  "code": "1270",
  "message": "Idempotent transaction body does not match the original",
  "payment": {
    "status": "INV",
    "nit": "6ffad47ea1446d76160f1241f0fdca39342521df4f3f577920d9c855047fb9a2",
    "order_id": "1657833175201",
    "merchant_usn": "12050620649",
    "esitef_usn": "230912025329730",
    "amount": "10000"
  }
}

Performing pre-authorization if the idempotency key is the same as that of a payment transaction

Request:

curl --location --request POST 'https://{{url}}/e-sitef/api/v2/preauthorizations/' \
--header 'Content-Type: application/json' \
--header 'merchant_id: **********' \
--header 'merchant_key: **********' \
--header 'idempotency_key: ************' \
--data-raw '{
    "merchant_usn": "12050620649",
    "order_id": "1657833175201",
    "installments": "10",
    "installment_type": "4",
    "authorizer_id": "2",
    "amount": "11000",
    "card": {
        "expiry_date": "1222",
        "security_code": "123",
        "number": "5555555555555555"
    }
}'

Response :

{
  "code": "1272",
  "message": "Idempotent transaction is not of the same type",
  "payment": {
    "status": "INV",
    "nit": "d081e89daa1a0e446b92ead4ed2325f860d4e1280aa4b407f32957ce17f62ee3",
    "order_id": "1657833175201",
    "merchant_usn": "12050620649",
    "esitef_usn": "230912025329774",
    "amount": "2220"
  }
}

Request parameters

The table below describes the request parameters of the transaction creation service:

Response parameters

If successful, the HTTP response code will be 201. Any other code must be interpreted as an error. The table below describes the response parameters of the payment effectuation service:

ParameterDescriptionFormat
codeCarat Portal response code. Any code different from 0 means failure. Learn more.< 4 N
messageCarat Portal response message.< 500 AN
payment
authorizer_codeAuthorizer response code.< 10 AN
authorizer_messageAuthorizer response message.< 500 AN
statusStatus of the payment transaction on Carat Portal. Learn more.= 3 AN
nitIdentifier of the payment transaction on Carat.= 64 AN
order_idOrder code sent by the merchant on the creation of the transaction.< 40 AN
merchant_usnUnique sequential number sent by the merchant on the creation of the transaction.< 12 N
amountTotal price of the purchase specified by the merchant (in cents) on the creation of the transaction.< 12 N
sitef_usnUnique sequential number of the payment transaction on SiTef.= 6 N
esitef_usnUnique sequential number of the payment transaction on Carat Portal.= 15 N
customer_receiptCustomer's receipt.< 4000 AN
merchant_receiptMerchant's receipt.< 4000 AN
authorizer_idCode of the authorizer used on the transaction.< 4 N
acquirer_idCode of the acquirer used on the transaction.< 4 N
acquirer_nameName of the acquirer used on the transaction.< 100 AN
authorizer_datePayment authorization date returned by the authorizer in DD/MM/YYYY'T'HH:mm format. Example: 13/07/2017T16:03= 16 D
authorization_numberAuthorization number.< 6 AN
host_usnHost USN.< 15 AN
tidID of the transaction on the acquirer. This field is only returned on transactions with acquirers that are external to SiTef.< 40 AN
eciEletronic Commerce Indicator (security level indicator of the payment transaction).< 3 AN
payment_datePayment authorization date on Carat Portal in DD/MM/YYYY'T'HH:mm format. Example: 13/07/2017T16:03= 16 D
issuerIssuer code returned by the authorizer.< 5 AN
authorizer_merchant_idAffiliation code of the merchant on the authorizer.< 100 AN
xidXID field returned on 3DS authentications or certain acquirers.< 40 AN
cavvCardholder Authentication Verification Value - Codes that refers to card holder authentication result data.< 40 NNO
recurrency_tidFirst transaction's id (TID) on the card brand. Returned only if it is a recurrent payment. < 16 AN
terminal_idTerminal code used in the transaction< 8 AN
payment_typePayment type from the selected authorizer: B = boleto, C = credit, D = debit, P = Private Label credit card, T = bank transfer, G = gift card, O = other payment methods, W = Boleto NR via Web Service= 1 AN
standin_detailsThis field provides additional information to identify whether a transaction was performed by the Stand-in on behalf of the issuer. Learn more.< 6 AN
cvv_result_codeCVV result code (present only in Mastercard and Visa transactions).
Values:
M = Valid (match)
N = Invalid (not matching)
P = Not processed (issuer temporarily unavailable)
U = not verified
S = CVV2 must be on card
= 1 N
payment.analysis
statusStatus of the payment transaction on Carat Portal. Learn more.= 3 AN
codeCarat Portal response code. Any code different from 0 means failure. Learn more.< 4 N
messageCarat Portal response message.< 500 AN

Did this page help you?