Token-related callback parameters

Once you pass a token generation or token revoke request to the /v2/customer/card/tokenize endpoint, the payment platform returns a callback with the request execution result. The following table shows the parameters included in the callback. For more information about callbacks, see Callbacks in Gate.

Table 1. Callback objects and parameters related to token creation or revocation
Parameter Description tree

project_id
string, required

The unique identifier of your project.

Example: 42.

10

customer
object, required

The object with the customer data 20

id
string, required

The unique identifier of the customer in your project. 20-120

request
object, required

The object with the request data 30

id
integer, required

Unique identifier of the request

Example: 3718000054

30-130

action
string, optional

Type of the request. The following options are available:
  • tokenize—token creation request
  • token_revoke—token revoke request
  • parameter is missing from callback—token is expired and deactivated. The platform initiates a callback with missing action automatically, immediately after the token expires. Such callback is not issued in response to a request.
30-230

status
string, required

The request status. The following options are available:
  • success—request successfully completed
  • error—error(s) encountered when processing request. The error details are passed in the errors array.
30-330

errors
array, optional

Array of error messages. 30-430

ErrorItem
object, required

The object with information about a single error. 30-4-130-4

code
string, optional

Error code.

Example: 10309.

30-4-1-130-4-1

message
string, optional

A message that explains the error cause.

Example: Attempt to make a COF purchase without registered recurrent payments.

30-4-1-230-4-1

field
string, optional

The parameter in which the error occurred if it was defined 30-4-1-330-4-1

token
string, optional

Token of the customer bank card. The token is generated automatically when a successful payment is performed if the appropriate option is enabled. 40

token_created_at
string, optional

The date and time the token was generated.

Example: 2017-07-21T03:31:24+0000

50

token_status
string, optional

Token status.

Example: active

60

signature
string, required

Callback signature 70

Figure: Callback after token generation

{
"project_id": 12,
"customer": {
    "id": "cust_123"
    },
"request": {
    "id": "3c7f53fdbb5b8c96f9707457d75f",
    "action": "tokenize",
    "status": "success"
    },
"token": "2f0e75befacca30623354f9ffb0f44a80bee52982c39727b85039ef6f64309a1",
"token_created_at": "2017-11-28 13:30:57",
"token_status": "active",
"signature": "\/gmTHcy5wvrFD4ISuWEiV8+nOa3aqnLnyJ\/AupOYkl9S5eLJZ"
}