Xsolla-logo

Create token

post/merchants/{merchant_id}/token

You can create a token with arbitrary user parameters. You send these parameters when obtaining the token and receive them back after a successful payment. A token can only contain parameters either described in this document or predefined by you.

If any parameter is sent in the wrong format or has the wrong type, no token will be issued. You will receive a 422 HTTP code with the error description in the JSON body. In extended_message you will receive an information what exact parameters have been sent incorrectly.

Note

This API method can't be used under high load. When the number of requests is high, rate limits may apply. Contact your Account Manager to find out the rate limits for this API method.
SecuritybasicAuth
Request
path Parameters
merchant_id
required
integer

Merchant ID.

Request Body schema: application/json
Any of:
object

User details.

object

Custom project settings.

object

Object containing purchase details.

object

You can pass additional parameters in the token in the custom_parameters object to configure anti-fraud filters. The recommended parameters are shown in the drop-down list. See Pay Station documentation.

Responses
200

Created.

422

Unprocessable Entity.

Request samples
application/json
{
  • "purchase": {
    },
  • "settings": {
    },
  • "user": {
    }
}
Response samples
application/json
{
  • "token": "eop57k1boA7nnYPtewZ6KEXJyJADEwRT"
}