Token-related callback parameters

Once you submit a token generation or a token revoke request to the /v2/customer/card/tokenize endpoint, the payment platform returns a callback with the request execution result. The following table lists the parameters included in the callback.

For more general information about callbacks, see What callbacks in Rocketpay look like.

Table 1. Callback objects and parameters related to creating or revoking a token
Parameter Description tree

project_id
string

The unique identifier of your project.

Example: 123.

10

customer
object

The object with the customer data.

20

id
string

The unique identifier of the customer in your project.

Example: customer_123

20-120

request
object

The object with the request data. 30

id
integer

Unique identifier of the request.

Example: 3718000054

30-130

action
string

Type of the request. The following options are available:

  • tokenize—token creation request
  • token_revoke—token revoke request
  • parameter is missing—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.

Example: tokenize

30-230

status
string

The request status. Possible values:

  • success—request successfully completed
  • error—error(s) encountered when processing request. The error details are passed in the errors array.

Example: success

30-330

errors
array

Array of error messages. 30-430

ErrorItem
object

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

code
string

Error code.

Example: 10309

30-4-1-130-4-1

message
string

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

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

token
string

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

The date and time the token was generated.

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

50

token_status
string

Token status.

Example: active

60

signature
string

Callback signature 70

Figure: Example of the data from a callback with the token and some related information

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