Transaction creation service

Consuming the transaction creation service is mandatory in both the payment and scheduling flows. As a result of this operation, the merchant will obtain a NIT (payment) which will be necessary for the next steps of the flow, as the utilization of transaction query service.

The NIT have a time limit for their utilization. This deadline is configured on Carat Portal, and if it's exceeded, the transaction will be altered from status NOV (new) to EXP (expired), which blocks further operations with this transaction, making it necessary to consume the transaction creation service again.

Call details#

  • Resource: /v1/transactions
  • 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

Examples#

Below are some examples of the transaction creation service call using the cURL tool.

Creating a payment with automatic confirmation#

Request:

To use this example, don't forget to define the variable {{url}} with the value
sandbox.ecomm-bin.fiserv.com.br

curl
--request POST "https://{{url}}/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":"1000"
}
--verbose

Response:

{
"code": "0",
"message": "OK. Transaction successful.",
"payment": {
"status": "NOV",
"nit": "1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqr",
"order_id": "12042142155",
"merchant_usn": "12042142155",
"amount": "1000"
}
}

Creating a payment with late confirmation#

Request:

To use this example, don't forget to define the variable {{url}} with the value
sandbox.ecomm-bin.fiserv.com.br

curl
--request POST "https://{{url}}/e-sitef/api/v1/transactions"
--header "Content-Type: application/json"
--header "merchant_id: xxxxxxxx"
--header “merchant_key: xxxxxxxxxxx”
--data-binary
{
"merchant_usn":"12050620649",
"order_id":"12050620649",
"installments":"1",
"installment_type":"4",
"authorizer_id":"2",
"amount":"1000",
"additional_data":{
"postpone_confirmation":"true"
}
}
--verbose

Response:

{
"code": "0",
"message": "OK. Transaction successful.",
"payment": {
"status": "NOV",
"nit": "1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqr",
"order_id": "12050620649",
"merchant_usn": "12050620649",
"amount": "1000"
}
}

Creating a payment with fraud analysis#

Request:

To use this example, don't forget to define the variable {{url}} with the value
sandbox.ecomm-bin.fiserv.com.br

curl
--request POST "https://{{url}}/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":"1000",
"additional_data":{
"payer":{
"name":"Comprador",
"surname":"credito AF",
"email":"compradorteste@live.com",
"city":"Rio de Janeiro",
"state":"RJ",
"address_street_name":"Rua Jupiter",
"address_street_number":"174",
"address_zip_code":"21241140",
"born_date":"1991-01-02T08:30:00",
"address_street_complement":"AP 201",
"address_country":"BRA"
},
"shipment":{
"method":"LOW_COST",
"name":"Sr Comprador Teste",
"phones":[
{
"number":"21114740",
"ddd":"16",
"ddi":"55"
}
],
"receiver_address":{
"complement":"AP 201",
"city":"Rio de Janeiro",
"state":"RJ",
"country":"BRA",
"zip_code":"21241140",
"street_number":"174",
"street_name":"Rua Jupiter"
}
},
"connections":[
{
"from":"RAO",
"to":"SAO",
"flight_date":"2020-01-02T20:15:00"
}
],
"gift":"false",
"browser":{
"email":"compradorteste@live.com",
"agent":"Chrome",
"cookies_accepted":"false",
"host_name":"Teste",
"ip_address":"200.190.150.350"
},
"items":[
{
"title":"ItemTeste",
"quantity":"1",
"id":"1487337308522",
"risk":"HIGH",
"hedge":{
"time":"NORMAL",
"host":"OFF",
"nonSensical":"OFF",
"obscenities":"OFF",
"phone":"OFF",
"velocity":"HIGH"
},
"passenger":{
"name":"Comprador accept",
"email":"compradorteste@live.com",
"rating":"ADULT",
"phone":{
"number":"999994444",
"ddd":"11",
"ddi":"55"
},
"legal_document":"1234567890",
"customer_class":"Gold"
},
"unit_price":"1000",
"category_id":"other",
"gift_category":"OFF"
}
],
"extra_param":{
"acquirer_params":[
{
"key":"95",
"value":"parametros adicionais"
}
]
},
"anti_fraud":"enabled_before_auth",
"anti_fraud_institution":"AUTHORIZER",
"anti_fraud_criteria":"ALWAYS",
"finger_print_id":"074c1ee676ed4998ab66491013c565e2",
"returns_accepted":"true",
"journey_type":"OUTWARD"
}
}
--verbose

Response:

{
"code": "0",
"message": "OK. Transaction successful.",
"payment": {
"status": "NOV",
"nit": "1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqr",
"order_id": "12042142155",
"merchant_usn": "12042142155",
"amount": "1000"
}
}

Response codes

See reference on API codes - response codes

Request parameters#

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

ParameterDescriptionFormatMandatory
merchant_usnUnique sequential number for each order, created by the merchant. The USN will be used during the whole communication with the merchant to help identifying the order. As it is a possible access key on the merchant's side, even though it's optional to Carat Portal, it's strongly recommended that the field is formatted and sent by the merchant's application.< 12 NNO
order_idOrder code defined by the merchant. It's advised that it is different for each order so that it becomes easier to track it.
< 40 ANNO
installmentsNumber of installments. Send 1 for spot sales.< 2 NYES
installment_typeInstallment financing type:
Value 3 = installments with interest.
Value 4 = installments without interest (use this value also on spot sales).
Value 6 = installments with interest (IATA).
Value 7 = installments without interest (IATA).
The IATA financing types are only used by companies that work with air transportation.
< 2 NYES
authorizer_idCode of the authorizer on Carat Portal. Learn more.

In operations with tokenized card, if the authorizer code is not informed, the authorizer code used in the card storage will be used.
< 3 NNO
amountTotal price of the purchase (in cents). Example: 1,00 = 100 or 1.100,00 = 110000 – send the value without the comma and the dots.< 12 NYES
soft_descriptorAdditional text that will be presented alongside the name of the establishment in the credit card invoice. Learn more< 25 ANNO
additional_dataElement for sending additional data.
postpone_confirmationThis field must be sent with value true if a payment with late confirmation is desired.< 5 T/FNO
customer_emailFor REST transactions, send the customer receipt to the informed e-mail.< 50 ANNO
additional_data.payerElement for sending data related to the payer.
identification_numberIdentification document number of the customer (CPF/RG).< 20 ANNO
store_identificationIdentification of the customer for card storage. This identification must be unique for each of the merchant's users. But attention, this uniqueness assurance is of total responsibility of the merchant, API Portal won't do any validations.< 20 ANYES for scheduling
additional_data.merchantElement for sending data related to the merchant.
emailMerchant's e-mail address.< 1024 ANNO
additional_data.extra_param.prefixesElement for sending SiTef prefixes, like CICLOS, CPLANO and VLRADD. If the prefix that was sent is not supported by card, API Portal will invalidate the transaction, preventing that a false impression of the use of a functionality is given.

Example:
{ "key" : "value" } -> { "CICLO" : "01" }
keyPrefix name.< 1024 ANNO
valuePrefix value.< 1024 ANNO

Dynamic MCC Fields#

Request Parameters#

Can be used for Payment and Pre-Authorization REST Transaction creation service#

Additionally to the fields of the REST Transaction Creation Service, the fields below are used specifically in dynamic MCC transactions integrated to the bin routing:

Element for sending additional data. Element for sending data related to a subacquirer's merchant.
ParameterDescriptionFormatMandatory
soft_descriptorPersonalized phrase that will be printed on the bearer's invoice. For information regarding the dynamic MCC, it is equivalent to the name of the submerchant.< 25 ANYES
additional_data
mccSubmerchant's MCC.= 4 NYES
subacquirer_merchant_idSubmerchant's code. Deprecated field!!! Use additional_data.subacquirer_merchant.id instead.< 15 NNO
additional_data.subacquirer_merchant
idSubmerchant's code.< 15 NYES
phone_numberSubmerchant's phone number.< 14 ANNO
addressSubmerchant's address.< 48 ANNO
citySubmerchant's city.< 13 ANNO
stateSubmerchant's state, in two-digit acronym format (e.g.: SP).= 2 AYES
countrySubmerchant's country. Follow the standard ISO 3166-1 alpha-2 (e.g.: BR).= 2 AYES
zip_codeSubmerchant's zip code.< 9 ANYES
identification_numberSubmerchant's CNPJ.< 18 NYES
payment_facilitator_idFacilitator's code.< 11 NYES

Example#

Request:

To use this example, don't forget to define the variable {{url}} with the value
sandbox.ecomm-bin.fiserv.com.br

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": "19035815234",
"order_id": "1616438400044",
"installments": "1",
"installment_type": "4",
"authorizer_id": "2",
"amount": "1300",
"soft_descriptor": "L012121",
"additional_data": {
"mcc": "1111",
"subacquirer_merchant": {
"id": "12345",
"address": "Avenida Paulista, 2000",
"city": "São Paulo",
"state": "SP",
"country": "BR",
"zip_code": "01107001",
"identification_number": "53455823000178",
"payment_facilitator_id": "654321",
"phone_number": "+55 11 99999-9999"
}
}
}

Response:

{
"code": "0",
"message": "OK. Transaction successful.",
"payment": {
"status": "NOV",
"nit": "6215a32a557f5dc4627b540f517e40abd6a8411cf89a2e073913aa25d7c95590",
"order_id": "1616438400044",
"merchant_usn": "19035815234",
"amount": "1300"
}
}

Response parameters#

In case of success, the HTTP response code will be 201. Any other code must be interpreted as an error. The table below describes de response parameters of the transaction creation service:

ParameterDescriptionFormat
codeCarat Portal response code. Any code different from 0 means failure. Learn more.< 4 N
messageCarat Portal response message.< 500 AN
payment
statusStatus of the payment transaction on Carat Portal. Learn more.= 3 AN
nitPayment transaction identifier on Carat Portal.= 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
schedule
sidSchedule transaction identifier on Carat Portal.= 64 AN
amountAmount of the scheduled payments specified by the merchant (in cents) on the creation of the transaction.< 12 N
statusStatus of the schedule on Carat Portal. Learn more.= 3 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