Activation and Deactivation of Card Token
Brazil
import ApiDoc from '../../../../../src/components/api-doc/ApiDoc';
import ResponseCodes from './codigos-de-resposta.md';
Call Details
- Resource:
/v1/cards/{card.token}
- HTTP Method:
PUT
- Request Format:
JSON
- Response Format:
JSON
- Header Parameters:
Parameter | Description | Format | Required |
---|---|---|---|
merchant_id | Merchant code on Carat. The production and certification codes will be different. | < 15 AN | YES |
merchant_key | Merchant authentication key on Carat. The production and certification keys will be different. | < 80 AN | YES |
token | Token obtained from the token creation service Learn more.. If Authorization is not sent, this field becomes mandatory. | = 66 AN | COND. |
Authorization | The authentication signature of the merchant must be sent in Bearer {signature} format. Example: Bearer JHVGytfdgauygdauiw78264284527852897hagdg . If token is not sent, this field becomes mandatory. | < 2000 AN | COND. |
Content-Type | Must be sent with the value application/json . | = 15 AN | YES |
Flow
sequenceDiagram
STORE->>CARAT: 1. PUT /v1/cards/{card.token}
CARAT-->>STORE: 2. nita, status
Examples
Below are some examples of calling the card token activation and deactivation service using the cURL tool.
Activation of the card token with token authentication
Request:
To use this example, remember to set the variable {{url}}
with the value
curl
--request PUT "https://{{url}}/e-sitef/api/v1/cards/{card.token}"
--header "Content-Type: application/json"
--header "merchant_id: xxxxxxxxxxx"
--header "merchant_key: xxxxxxxxxxx"
--header 'token: XXXXX'
--data-binary
{
"card":{
"status":"ATV"
}
}
--verbose
Activation of the card token with signature authentication
curl
--request PUT "https://{{url}}/e-sitef/api/v1/cards/{card.token}"
--header "Content-Type: application/json"
--header "merchant_id: xxxxxxxxxxx"
--header "merchant_key: xxxxxxxxxxx"
--header 'Authorization: Bearer XXXXX'
--data-binary
{
"card":{
"status":"ATV"
}
}
--verbose
Response:
{
"code":"0",
"message":"OK. Transaction successful.",
"card":{
"token":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==",
"suffix":"5555",
"bin": "544444",
"status": "ATV"
},
"store":{
"status":"CON",
"nsua":"18051600000560A",
"nita":"xxxxxxxxxxxxxxxxxxx",
"customer_id":"11122211122",
"authorizer_id":"2"
}
}
Deactivation of the card token with token authentication
Request:
To use this example, remember to set the variable {{url}}
with the value
curl
--request PUT "https://{{url}}/e-sitef/api/v1/cards/{card.token}"
--header "Content-Type: application/json"
--header "merchant_id: xxxxxxxxxxx"
--header "merchant_key: xxxxxxxxxxx"
--header 'token: XXXXX'
--data-binary
{
"card":{
"status":"INA"
}
}
--verbose
Deactivation of the card token with signature authentication
curl
--request PUT "https://{{url}}/e-sitef/api/v1/cards/{card.token}"
--header "Content-Type: application/json"
--header "merchant_id: xxxxxxxxxxx"
--header "merchant_key: xxxxxxxxxxx"
--header 'Authorization: Bearer XXXXX'
--data-binary
{
"card":{
"status":"INA"
}
}
--verbose
Response:
{
"code":"0",
"message":"OK. Transaction successful.",
"card":{
"token":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==",
"suffix":"5555",
"bin": "544444",
"status": "INA"
},
"store":{
"status":"CON",
"nsua":"18051600000560A",
"nita":"xxxxxxxxxxxxxxxxxxx",
"customer_id":"11122211122",
"authorizer_id":"2"
}
}
Request Parameters
The table below describes the request parameters for the card token activation and deactivation service:
Parameter | Description | Format | Required |
---|---|---|---|
card.token | Identification of the stored card. This token is used in place of the customer's card for transactions with Carat. | = 88 AN | YES |
card | |||
status | Card status. ATV (Active) and INA (Inactive). | < 3 AN | YES |
Response Parameters
In case of success, the HTTP response code will be 200
. Any other code should be interpreted as an error. The table below describes the response parameters for the card token activation and deactivation service:
Parameter | Description | Format |
---|---|---|
code | Carat response code. Any code different from 0 (zero) means failure. Learn more. | < 4 N |
message | Carat response message. | < 500 AN |
store | ||
status | Storage transaction status on Carat. Learn more. | = 3 AN |
nsua | Unique sequential number of the storage transaction on Carat. | = 15 AN |
nita | Stored item identification on Carat. | = 64 AN |
customer_id | Customer identification for card storage. | < 20 AN |
authorizer_id | Authorizer code used for storage. | < 3 N |
card | ||
token | Identification of the stored card. This token is used in place of the customer's card for transactions with Carat. | = 88 AN |
suffix | Last 4 digits of the customer's card. | = 4 AN |
bin | First 6 digits of the customer's card. | = 6 AN |
status | Card status. ATV (Active) and INA (Inactive). | < 3 AN |
Updated 14 days ago