Pre-Authorization Creation
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:
| Parameter | Description | Format | Mandatory |
|---|---|---|---|
Content-Type | Fixed value "application/json" | = 15 A | Yes |
merchant_id | Carat Portal store's ID. Production and certification IDs are different. | ≤ 15 A | Yes |
merchant_key | Store authentication key in Carat Portal. Production and certification keys are different. | < 80 A | Yes |
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"
}
--verboseResponse:
{
"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
| Parameter | Description | Format |
|---|---|---|
code | Carat Portal response code. Any code other than ‘0’ means failure. For more information, see Responde Codes. | < 4 N |
message | Carat Portal's response message. | < 500 A |
amount | Transaction's amount defined by the store (in cents) at transaction creation. | < 12 N |
merchant_usn | Unique sequential number sent by store transaction creation. | < 12 N |
nit | Pre-authorization transaction ID in Carat Portal. | = 64 A |
order_id | Order code sent by store at transaction creation. | < AN |
status | Pre-authorization transaction status in Carat Portal. | = 3 A |
Updated 6 days ago