token/info
token/info
Operations with bank cards are often carried out with tokenized values. For payouts and payments through widgets, a public token is created. A token can also be created for recurring payments/payouts.
Use this method to learn the hidden card number and show the user from which card the funds will be debited, or to check the token expiration date.
Endpoint
api/v1/token/info
Request parameters
| Name | Mandatory | Type | Description | 
|---|---|---|---|
| type | + | string | Request type. Options: card, public_token, recurrent_token | 
| card | - (mandatory for type = card) | object | Bank card details | 
| public_token | - (mandatory for type = public_token) | object | Public token details | 
| recurrent_token | - (mandatory for type = recurrent_token) | object | Recurring payment token details | 
Request examples
- Card information via token
 - Public token
 - Token for recurring payments or payouts
 
Send tokenized bank card details to get the hidden card number and payment system.
curl -X POST \
  https://demo.smart-glocal.com/api/v1/token/info \
  -H 'Content-Type: application/json' \
  -H 'X-PARTNER-PROJECT: your_project_name' \
  -H 'X-PARTNER-SIGN: signature' \
  -d '{
    "type": "card",
    "card": {
      "type": "encrypted_card",
      "encrypted_card": {
        "number_hash": "card_number_hash (token)"
      }
    }
  }'
Send a public token to get information about it.
curl -X POST \
  https://demo.smart-glocal.com/api/v1/token/info \
  -H 'Content-Type: application/json' \
  -H 'X-PARTNER-PROJECT: your_project_name' \
  -H 'X-PARTNER-SIGN: signature' \
  -d '{
    "type": "public_token",
    "public_token": {
      "token": "your_token"
    }
  }'
Send a token for recurring payments/payouts to get information about it.
curl -X POST \
  https://demo.smart-glocal.com/api/v1/token/info \
  -H 'Content-Type: application/json' \
  -H 'X-PARTNER-PROJECT: your_project_name' \
  -H 'X-PARTNER-SIGN: signature' \
  -d '{
    "type": "recurrent_token",
    "recurrent_token": {
      "token": "your_token"
    }
  }'
Response parameters
| Name | Mandatory | Type | Description | 
|---|---|---|---|
| status | + | string | Status. Options: error, ok | 
| info | - | object | Depending on the request type (type): - card token information - public token information - information on the token for recurring payments  | 
| error | - | object | Error description | 
Successful response examples
- Card information via token
 - Public token
 - Token for recurring payments or payouts
 
{
  "status": "ok",
  "info": {
    "number_hash": "card_number_hash",
    "brand": "visa",
    "last4": "4242",
    "type": "card"
  }
}
{
  "status": "ok",
  "info": {
    "token": "your_token",
    "created_at": "2021-03-17T14:10:56+03:00",
    "finished_at": "2021-03-18T14:10:56+03:00",
    "is_active": true,
    "type": "public_token"
  }
}
{
  "status": "ok",
  "info": {
    "token": "your_token",
    "created_at": "2021-03-17T14:19:05+03:00",
    "finished_at": "2021-04-17T14:19:05+03:00",
    "is_active": true,
    "type": "recurrent_token"
  }
}
Unsuccessful response example
{
  "status": "error",
  "error": {
    "description": "error description",
    "code": "error code"
  }
}