Token management

Query your available tokens, disable / re-enable or delete them following this guide.

Once a token is created you can use the Smartpay API to retrieve your token(s), disable, re-enable or delete tokens.

Retrieve your token(s)

You can retrieve a list of all of your tokens or retrieve a specific token via the Smartpay API.

We will only return the list of all active and disabled tokens. We do not return the tokens that have been deleted.

List all your tokens

To list all your tokens, send a request to the list all tokens endpoint.

curl --request GET \
     --url 'https://api.smartpay.co/v1/tokens?maxResults=20' \
     --header 'Authorization: Basic sk_test_abcdef12345678' \
     --header 'accept: application/json'

Retrieve a single token

To retrieve a specific token, send a request to the retrieve a token endpoint.

curl --request GET \
     --url 'https://api.smartpay.co/v1/tokens/paytok_test_zAo001ZRfyjz1F4rMyYPnL' \
     --header 'Authorization: Basic sk_test_abcdef12345678' \
     --header 'accept: application/json'

Disabling a token

Disable a token

You can temporarily disable a token by call the disable a token API endpoint. This operation will update the status of the token to disabled and you won't be able to use it to create orders. This can be reversed by enabling a token.

curl --request PUT \
     --url 'https://api.smartpay.co/v1/tokens/paytok_test_zAo001ZRfyjz1F4rMyYPnL/disable \
     --header 'Authorization: Basic sk_test_abcdef12345678' \
     --header 'accept: application/json'

Delete a token

To permanently disable a token, call the delete a token API endpoint. After deleting a token you won't be able to use it to create orders.

This operation is final, Smartpay will not be able to re-activate your token.

curl --request DELETE \
     --url 'https://api.smartpay.co/v1/tokens/paytok_test_zAo001ZRfyjz1F4rMyYPnL \
     --header 'Authorization: Basic sk_test_abcdef12345678' \
     --header 'accept: application/json'

Enable a token

To activate a disabled token, call the enable a token API endpoint. After enabling the token, you can resume using it to charge the consumer.

curl --request PUT \
     --url 'https://api.smartpay.co/v1/tokens/paytok_test_zAo001ZRfyjz1F4rMyYPnL/enable \
     --header 'Authorization: Basic sk_test_abcdef12345678' \
     --header 'accept: application/json'