Skip to main content

token

token

Use this method to generate a public token to access Smart Glocal's JavaScript library and to work with the widgets.

The token is valid for 24 hours. It can only be used for a single operation.

Endpoint

api/v1/token

Request parameters

NameMandatoryTypeDescription
tokenize_widget-objectData required by the tokenization widget
acquiring_widget-objectData required by the payment form widget
fps_no_account_widget-objectData required by the payment form for money transfers
Request examples

Get a token for the tokenization widget.

curl -X POST \
http://demo.smart-glocal.com/api/v1/token \
-H 'content-type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"tokenize_widget": {
"access": true,
"locale": "en"
}
}'

Response parameters

NameMandatoryTypeDescription
status+stringStatus. Options: error, ok
public_token-stringPublic token
error-objectError description
Successful response example
{
"status": "ok",
"public_token": "e065c2f1328e74156a883c00e210a4b1b1451782bbfdd18ae8d05715e05d8548"
}
Unsuccessful response example
{
"status": "error",
"error": {
"description": "error description",
"code": "error code"
}
}