Skip to main content

token/info

token/info

Operations with bank cards are often carried out with tokenized values. For payments and payments through widgets, a public token is created. For recurrent payments, a recurrent token is created.

For any payment token you can get information:

  • about the bank card for which that token was created: the hidden card number and payment system,
  • about the token itself: the type of token, time of creation, expiration date, active or inactive at the moment of inquiry.

This method can be used, for example, 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

NameMandatoryTypeDescription
type+stringRequest type. Options: card, public_token, recurrent_token
card- (mandatory for
type = card)
CardPaymentMethodBank card details
public_token- (mandatory for
type = public_token)
PublicTokenToken details
recurrent_token- (mandatory for
type = recurrent_token)
RecurrentTokenRecurrent token details

Response parameters

NameMandatoryTypeDescription
status+stringStatus. Options: error, ok
info-CardTokenInfo/PublicTokenInfo/RecurrentTokenInfoInformation on the token depending on the request type (type)
error-ErrorError

Request for card information

You send tokenized bank card details and receive the hidden card number and payment system.

    curl --location --request POST 'https://demo.smart-glocal.com/api/v1/token/info' \
--header 'X-PARTNER-PROJECT: partner-project' \
--header 'X-PARTNER-SIGN: key' \
--header 'Content-Type: application/json' \
--data-raw '{
"type": "card",
"card": {
"type": "encrypted_card",
"encrypted_card": {
"number_hash": "card_number_hash (token)"
}
}
}'

Request for public token information

You send a public token and receive information on it.

    curl --location --request POST 'https://demo.smart-glocal.com/api/v1/token/info' \
--header 'X-PARTNER-PROJECT: partner-project' \
--header 'X-PARTNER-SIGN: key' \
--header 'Content-Type: application/json' \
--data-raw '{
"type": "public_token",
"public_token": {
"token": "your_token"
}
}'

Request for recurring token information

You send a recurring token and receive information on it.

    curl --location --request POST 'https://demo.smart-glocal.com/api/v1/token/info' \
--header 'X-PARTNER-PROJECT: partner-project' \
--header 'X-PARTNER-SIGN: key' \
--header 'Content-Type: application/json' \
--data-raw '{
"type": "recurrent_token",
"recurrent_token": {
"token": "your_token"
}
}'

Unsuccessful response example

{
"status": "error",
"error": {
"description": "error description",
"code": "error code"
}
}