Activation and Deactivation of Card Token

Call Details#

  • Resource: /v1/cards/{card.token}
  • HTTP Method: PUT
  • Request Format: JSON
  • Response Format: JSON
  • Header Parameters:
ParameterDescriptionFormatRequired
merchant_idMerchant code on Carat. The production and certification codes will be different.< 15 ANYES
merchant_keyMerchant authentication key on Carat. The production and certification keys will be different.< 80 ANYES
tokenToken obtained from the token creation service Learn more.. If Authorization is not sent, this field becomes mandatory.= 66 ANCOND.
AuthorizationThe 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 ANCOND.
Content-TypeMust be sent with the value application/json.= 15 ANYES

Flow#

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
esitef-homologacao.softwareexpress.com.br

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"
}
}

Response codes

See reference on API codes - response codes

Deactivation of the card token with token authentication#

Request:

To use this example, remember to set the variable {{url}} with the value
esitef-homologacao.softwareexpress.com.br

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"
}
}

Response codes

See reference on API codes - response codes

Request Parameters#

The table below describes the request parameters for the card token activation and deactivation service:

ParameterDescriptionFormatRequired
card.tokenIdentification of the stored card. This token is used in place of the customer's card for transactions with Carat.= 88 ANYES
card
statusCard status. ATV (Active) and INA (Inactive).< 3 ANYES

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:

ParameterDescriptionFormat
codeCarat response code. Any code different from 0(zero) means failure. Learn more.< 4 N
messageCarat response message.< 500 AN
store
statusStorage transaction status on Carat. Learn more.= 3 AN
nsuaUnique sequential number of the storage transaction on Carat.= 15 AN
nitaStored item identification on Carat.= 64 AN
customer_idCustomer identification for card storage.< 20 AN
authorizer_idAuthorizer code used for storage.< 3 N
card
tokenIdentification of the stored card. This token is used in place of the customer's card for transactions with Carat.= 88 AN
suffixLast 4 digits of the customer's card.= 4 AN
binFirst 6 digits of the customer's card.= 6 AN
statusCard status. ATV (Active) and INA (Inactive).< 3 AN