Pre-Authorization Creation

Brazil

The Pre-Authorization transaction flow is started by consuming the beginTransaction operation, which will generate an Carat Portal record of a transaction with status = NOV, and return the nit parameter to the application, which will identify this transaction.

A nit has a usage time set in Carat Portal. If this timeout exceeds the transaction, it will go beyond status NOV to the status EXP. In this case it will no longer be allowed to use the same nit, being necessary to consume the beginTransaction operation again to generate another valid nit.

Risk Analysis

For transactions with risk analysis built-in, the same fields available on payment transactions should apply.

Call details

  • Resource: /v1/transactions
  • HTTP Method: POST
  • Request format: JSON
  • Response format: JSON
  • Header parameters:
ParameterDescriptionFormatMandatory
Content-TypeFixed value "application/json"= 15 AYes
merchant_idCarat Portal store's ID. Production and certification IDs are different.≤ 15 AYes
merchant_keyStore authentication key in Carat Portal. Production and certification keys are different.< 80 AYes

Examples

Below there are some examples of calling the pre-authorization creation service using the cURL tool.

Pre-Authorization

Request:

To use this example, don't forget to define the variable {{url}} to the value

curl
--request POST "https://{{url}}/e-sitef/api/v1/transactions"
--header "Content-Type: application/json"
--header "merchant_id: xxxxxxxxxxxxxxx"
--header "merchant_key: xxxxxxxxxxx"
--data-binary
{
   "order_id":"orderID",
    "merchant_usn":"20190101",
    "amount":"100",
    "transaction_type":"preauthorization"
}
--verbose

Response:

{
  "code": "0",
  "message": "OK. Transaction successful.",
  "pre_authorization": {
    "status": "NOV",
    "nit": "1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqr",
    "order_id": "orderID",
    "merchant_usn": "20190101",
    "amount": "100"
  }
}

Request Parameter

Format field caption:

A = alphanumeric

N = numeric

N A = not applied

Response Parameters

ParameterDescriptionFormat
codeCarat Portal response code. Any code other than ‘0’ means failure. For more information, see Responde Codes.< 4 N
messageCarat Portal's response message.< 500 A
amountTransaction's amount defined by the store (in cents) at transaction creation.< 12 N
merchant_usnUnique sequential number sent by store transaction creation.< 12 N
nitPre-authorization transaction ID in Carat Portal.= 64 A
order_idOrder code sent by store at transaction creation.< AN
statusPre-authorization transaction status in Carat Portal.= 3 A

Did this page help you?