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) and/or a SID (schedule) which will be necessary for the next steps of the flow, as the utilization of transaction query service.
The NIT and the SID 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:
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 |
Content-Type | It must be sent with the value application/json . | = 15 AN | YES |
#
ExamplesBelow are some examples of the transaction creation service call using the cURL tool.
#
Creating a payment with automatic confirmationRequest:
To use this example, don't forget to define the variable {{url}}
with the value
esitef-homologacao.softwareexpress.com.br
Response:
#
Creating a payment with late confirmationRequest:
To use this example, don't forget to define the variable {{url}}
with the value
esitef-homologacao.softwareexpress.com.br
Response:
#
Creating a payment with scheduleRequest:
To use this example, don't forget to define the variable {{url}}
with the value
esitef-homologacao.softwareexpress.com.br
Response:
#
Creating a schedule without paymentRequest:
To use this example, don't forget to define the variable {{url}}
with the value
esitef-homologacao.softwareexpress.com.br
Response:
#
Creating a payment with Cielo e-Commerce fraud analysisRequest:
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
#
Creating a payment with risk analysis (using Konduto antifraud)For further information, please refer to our specific Konduto section.
Request:
To use this example, don't forget to define the variable {{url}}
with the value
esitef-homologacao.softwareexpress.com.br
Response:
#
Request parametersThe table below describes the request parameters of the transaction creation service:
Parameter | Description | Format | Mandatory |
---|---|---|---|
merchant_usn | Unique 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 N | NO |
order_id | Order code defined by the merchant. It's advised that it is different for each order so that it becomes easier to track it. If the merchant's integration with the acquirers (Cielo, Rede, etc) is with Carat Portal and SiTef, the order_id field that has a maximum length of 40 characters, will be reduced to 12 characters, due to a restriction on SiTef. This reduction will be done maintaining the characters from left to right (example: if the inserted order ID is 12345678901234567890 on Carat Portal, on SiTef it will be only 123456789012). | < 40 AN | NO |
installments | Number of installments. Send 1 for spot sales. | < 2 N | YES |
installment_type | Installment 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 N | YES |
authorizer_id | Code 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 N | NO |
amount | Total 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 N | YES |
soft_descriptor | Additional text that will be presented alongside the name of the establishment in the credit card invoice. Learn more | < 30 AN | NO |
authorizer_authentication | This field must be sent with value true if a payment with authentication is desired. This functionality is only available to Cielo e-Commerce and e.Rede REST. | < 5 T/F | NO |
encrypted_card | This field must be sent with value true if the card number to be sent in the step of the flow uses SiTef's encryption.The option to send the encrypted card will only be possible with a SiTef routing and it's necessary to pre-configure the SiTef used by the merchant accordingly. | < 5 T/F | NO |
iata | This element contains specific fields for IATA transactions. | ||
departure_tax | Departure tax in cents. | < 12 N | YES only for installment_type = 6 or 7 |
first_installment | Amount of the first installment on IATA transactions in cents. This functionality is available only for GetNet acquirer. | < 12 N | NO |
schedule Sending the schedule element implies on using the schedule functionality. None of its fields are mandatory if making a simple payment only is desired. | |||
amount | Amount in cents of the recurrent payments. If this field is not sent, the payment amount will be used. | < 12 N | YES |
initial_date | Execution date of the first scheduled payment. This date must have at least two days ahead of the current day and the days 29, 30 and 31 are never allowed. The date format to be followed is: DD/MM/YYYY Example: 20/04/2021 | = 10 D | YES |
number_of_times | Number of scheduled payments to be executed. If this field is not sent, the schedule will be active infinitely. | < 3 N | NO |
interval | Interval in months between each scheduled payment. If this field is not sent, the value 1 will be used (monthly executions). | < 2 N | NO |
do_payment_now | Send this field with the value false if a schedule without immediate payment is desired.If this field is absent or any value other than false , a schedule with immediate payment will be created. | < 5 T/F | NO |
installments | Number of installments of each scheduled payment. If this field is not sent, the value 1 will be used. | <2 N | NO |
installment_type | Installment financing type of the scheduled payments: Value 3 = installments with interest.Value 4 = installments without interest (use this value also on spot sales).If this field is not sent, the value 4 will be used. | < 2 N | NO |
soft_descriptor | Additional text that will be presented alongside the name of the establishment in the credit card invoice. Learn more | < 30 AN | NO |
show_times_invoice | For finite time schedules, send this field with value true if you want to add at the end of the soft_descriptor field the current times/number of times (e.g. Subscription 3/12). | < 5 T/F | NO |
additional_data | Element for sending additional data. | ||
postpone_confirmation | This field must be sent with value true if a payment with late confirmation is desired. | < 5 T/F | NO |
financing_plan | Financing Plan code used for Via Certa Financiadora routed payments, only in case of installments plan with interest. | < 4 N | COND. |
ecomm_pos_ref | This field will send and identification that will appear in the PDV field of the SiTef Web report for e-commerce transactions. | < 8 AF | NO |
additional_data.payer | Element for sending data related to the payer. | ||
customer_email | If informed, it must be an e-mail to send the receipt to the consumer, when a transaction is effectuated via REST. | < 50 AN | NO |
identification_number | Identification document number of the customer (CPF/RG). | < 20 AN | NO |
store_identification | Identification 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 AN | YES for scheduling |
additional_data.merchant | Element for sending data related to the merchant. | ||
email | Merchant's e-mail address. | < 1024 AN | NO |
additional_data.extra_param.prefixes | Element 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" } | ||
key | Prefix name. | < 1024 AN | NO |
value | Prefix value. | < 1024 AN | NO |
The table below describes the additional parameters that must be sent on a payment with fraud analysis (for the time being only available for Cielo e-Commerce):
Parameter | Description | Format | Mandatory |
---|---|---|---|
additional_data | |||
anti_fraud_institution | This field is used when there is no contract with an anti-fraud analysis institution and an anti-fraud analysis done by an authorizer is desired, in that case the value 'AUTHORIZER'must be input. If you have a contract with a anti-fraud analysis institution such as: Konduto, CyberSource and ClearSale, this field should not be used. | = 10 AN | COND. |
anti_fraud | Enables the fraud analysis service. Allowed values:enabled_before_auth – fraud analysis will be done BEFORE the payment authorization. If the analysis is rejected, the payment won't be initiated.enabled_after_auth – fraud analysis will be done AFTER the payment authorization. If the analysis is rejected, the payment will be cancelled. | < 19 AN | YES para análise de fraude |
anti_fraud_criteria | Criteria for fraud analysis execution. Allowed values:ON_SUCCESS – only perform the analysis if the transaction had succeeded.ALWAYS – always perform the analysis. | < 10 AN | NO |
finger_print_id | Identifier used to cross information obtained by the internet user's Browser with the data sent for analysis. This same value must be passed in the SESSIONID variable of the DeviceFingerPrint script. Further details can be found on http://apidocs.braspag.com.br/#CriandoumavendacomAnalisedeFraude. | < 50 AN | NO |
gift | Boolean that indicates whether the order is a gift or not. | < 5 T/F | NO |
returns_accepted | Boolean that defines whether returns are accepted for this order. | < 5 T/F | NO |
journey_type | Type of the trip. Allowed values:ROUND_TRIP – round trip.OUTWARD – outward.RETURN – return. | < 10 AN | NO |
additional_data.payer | |||
name | Name of the customer. Note: the concatenation of name and surname must not surpass 255 characters. | < 200 AN | NO |
surname | Surname of the customer. Note: the concatenation of name and surname must not surpass 255 characters. | < 200 AN | NO |
email | E-mail of the customer. | < 255 AN | NO |
born_date | Birthdate of the costumer, in YYYY-MM-DDTHH:MM:SS format. E.G.: 1991-01-02T08:30:00. | = 19 AN | NO |
adress_street_name | Address street name of the customer. | < 255 AN | NO |
adress_street_number | Address street number of the customer. | < 15 AN | NO |
adress_street_complement | Address complement of the customer. | < 50 AN | NO |
adress_zip_code | Zip code of the customer. E.G.: 21241140. | < 9 AN | NO |
city | City of the customer. | < 50 AN | NO |
state | State of the customer. E.G.: SP. | = 2 AN | NO |
address_country | Country of the customer, following ISO 3166-1. Ex.: BRA. | < 35 AN | NO |
additional_data.shipment.receiver_address | |||
street_name | Shipment address street name. | < 255 AN | NO |
street_number | Shipment address street number. | < 15 AN | NO |
complement | Shipment address complement. | < 50 AN | NO |
zip_code | Shipment zip code. E.G.: 21241-140. | < 9 AN | NO |
city | Shipment city. | < 50 AN | NO |
state | Shipment state. | = 2 AN | NO |
country | Shipment country, following ISO 3166-1. E.G.: BRA | = 3 AN | NO |
additional_data.browser | |||
cookies_accepted | Boolean to identify whether the customer's browser accepts cookies. Send true if positive. | < 5 T/F | NO |
email | Email registered in the customer's browser. | < 100 AN | NO |
host_name | Host name where the customer was before entering the store's website. | < 60 AN | NO |
ip_address | Customer's IP address. It is strongly recommended sending this field. | < 15 AN | NO |
agent | Name of the browser used by the customer. E.G.: Chrome. | < 40 AN | NO |
additional_data.items[] | |||
gift_category | Field that will evaluate the billing and delivery addresses for different cities, states or countries. Allowed values:OFF – Ignores fraud analysis for divergent addresses.YES – In case of divergence between billing and delivery addresses, mark with small risk.NO – In case of divergence between billing and delivery addresses, mark with high risk. | < 3 AN | NO |
risk | Product risk level. Allowed values:LOW – The product has a history of few chargebacks.NORMAL – The product has a history of chargebacks considered normal.HIGH – The product has a history of chargebacks above average. | < 6 AN | NO |
title | Product name. | < 255 AN | NO |
quantity | Quantity of the product to be acquired. | < 15 N | NO |
id | Product identifier. | < 255 AN | NO |
unit_price | Unit price of the product. | < 15 N | NO |
category_id | Product type. Allowed values: art , baby , coupon , donation , computing , camera , video_game , television , car_electronic , electronic , automotive , entertainment , fashion , game , home , musical , phone , service , learning , ticket , travel , virtual_good , physical , other , adult_content , gift_certificate , handling , shipping , shipping_and_handling ou subscription . | < 21 AN | NO |
additional_data.items[].hedge | |||
time | Level of importance of client order day time. Allowed values:LOW – Low importance in the time of day when the purchase was made, for the fraud analysis.NORMAL – Normal importance in the time of day when the purchase was made, for the fraud analysis.HIGH – High importance in the time of day when the purchase was made, for the fraud analysis.OFF – Purchase time does not affect fraud analysis. | < 6 AN | NO |
host | Level of importance of email and IP addresses of clients at scoring risk. Allowed values:LOW – Low importance of e-mail and IP address in fraud analysis.NORMAL – Normal importance of e-mail and IP address in fraud analysis.HIGH – High importance of e-mail and IP address in fraud analysis.OFF – E-mail and IP address do not affect fraud analysis. | < 6 AN | NO |
non_sensical | Level of testing performed on buyer data with meaningless received orders. Allowed values:LOW – Low importance of the verification made on the buyer's order, in fraud analysis.NORMAL – Normal importance of the verification made on the buyer's order, in fraud analysis.HIGH – High importance of the verification made on the buyer's order, in fraud analysis.OFF – Verification of buyer's order does not affect fraud analysis. | < 6 AN | NO |
obscenities | Level of obscenity of received orders. Allowed values:LOW – Low importance of obscenity verification of buyer's order, in fraud analysis.NORMAL – Normal importance of obscenity verification of buyer's order, in fraud analysis.HIGH – High importance of obscenity verification of buyer's order, in fraud analysis.OFF – Obscenity verification of buyer's order does not affect fraud analysis. | < 6 AN | NO |
phone | Level of tests performed with telephone numbers. Allowed values:LOW – Low importance on tests performed with telephone numbers.NORMAL – Normal importance on tests performed with telephone numbers.HIGH – High importance on tests performed with telephone numbers.OFF – Phone number tests do not affect fraud analysis. | < 6 AN | NO |
velocity | Level of importance of customer purchase frequency. Allowed values:LOW – Low importance in the number of purchases made by the client in the last 15 minutes.NORMAL – Normal importance in the number of purchases made by the client in the last 15 minutes.HIGH – High importance in the number of purchases made by the client in the last 15 minutes.OFF – The frequency of purchases made by the client does not affect the fraud analysis. | < 6 AN | NO |
additional_data.items[].passenger | |||
email | Passenger email. | < 255 AN | NO |
legal_document | Id of the passenger to whom the ticket was issued. | < 32 AN | NO |
name | Passenger name. | < 120 AN | NO |
rating | Passenger classification. Allowed values:ADULT – Adult passenger.CHILD – Child passenger.INFANT – Infant passenger.YOUTH – Teenage passenger.STUDENT – Student passenger.SENIOR_CITIZEN – Elderly passenger.MILITARY – Military passenger. | < 14 AN | NO |
customer_class | Classification of the Airline. Values such as Gold or Platinum can be used. | < 32 AN | NO |
additional_data.items[].passenger.phone | |||
ddi | Passenger phone IDD. | < 3 N | NO |
ddd | Passenger phone DDD. | < 3 N | NO |
number | Passenger phone number. | < 9 N | NO |
additional_data.extra_param.acquirer_params[] | |||
key | Id of the additional information to be sent. For further details about this field, For more details about sending this field please contact Cielo. | < 1024 N | NO |
value | Value of additional information to be sent. | < 1024 AN | NO |
additional_data.shipment | |||
name | Delivery recipient name. | < 255 AN | NO |
method | Type of product delivery service. Allowed values:SAME_DAY – Delivery on the same day.ONE_DAY – Delivery overnight or on the next day.TWO_DAY – Delivery in two days.THREE_DAY – Delivery in three days.LOW_COST – Low cost delivery service.PICKUP – Product to be picked up in the store.OTHER – Other method.NONE – No delivery service, as it is a service or subscription. | < 9 AN | NO |
additional_data.shipment.phones[] | |||
ddi | Addressee phone IDD. | < 3 N | NO |
ddd | Addressee phone DDD. | < 3 N | NO |
number | Addressee phone number. | < 9 N | NO |
additional_data.connections[] | |||
flight_date | Date, hour and minute of flight departure in the YYYY-MM-DDTHH:MM:SS format. E.G.: 1991-01-02T08:30:00. | = 19 AN | NO |
from | Airport code of the starting point of the trip. E.G.: CGH. | = 3 AN | NO |
to | Airport code of the ending point of the trip. Ex.: GYN. | = 3 AN | NO |
#
Response parametersIn 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:
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 |
nit | Payment transaction identifier on Carat Portal. | = 64 AN |
order_id | Order code sent by the merchant on the creation of the transaction. | < 40 AN |
merchant_usn | Unique sequential number sent by the merchant on the creation of the transaction. | < 12 N |
amount | Total price of the purchase specified by the merchant (in cents) on the creation of the transaction. | < 12 N |
schedule | ||
sid | Schedule transaction identifier on Carat Portal. | = 64 AN |
amount | Amount of the scheduled payments specified by the merchant (in cents) on the creation of the transaction. | < 12 N |
status | Status of the schedule on Carat Portal. Learn more. | = 3 AN |
order_id | Order code sent by the merchant on the creation of the transaction. | < 40 AN |
merchant_usn | Unique sequential number sent by the merchant on the creation of the transaction. | < 12 N |