Card Holder API Tokens APIs
Create Cardholder Token
Create a bearer token for a specific card.
A Cardholder Token can only interact with one card.
When using a Cardholder Bearer Token, API calls should be made directly from your front-end (browser or app).
| Verb | POST |
| URL | https://api.s.unit.sh/cards/:cardId/cardholder/token |
| Required Scope | cards-write |
| Data Type | cardholderToken |
| Timeout (Seconds) | 5 |
curl -X POST 'https://api.s.unit.sh/cards/123/cardholder/token'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
--data-raw '{
"data": {
"type": "cardholderToken",
"attributes": {
"scope": "cards"
}
}
}'
Attributes
cards cards-sensitive cards-write cards-sensitive-write) scopes are allowed.scope includes a scope which requires two-factor authentication. Received as a response from Create Cardholder Token Verification.scope includes a scope which requires two-factor authentication. 6 digit code sent to the card holder through the desired channel.86400 (24 hours). Default value is also 24 hours.Response
Response is a JSON:API document.
201 Created
{
"data": {
"type": "cardholderBearerToken",
"attributes": {
"token": "v2.public.eyJyb2xlIjoiY3VzdG9tZX...",
"expiresIn": 86400
}
}
}
Create Cardholder Token Verification
When creating a cardholder token that contains a scope which requires two-factor authentication (see Scopes), it is required to first create a verification challenge that will be sent to the customer.
The challenge is a six digit code and is valid for 10 minutes after its creation.
The phone number that is used for the verification process is the one defined on the card. An alternative phone number (authorized user / business contact) can be provided for Business Customers via the phone attribute (see below).
In Sandbox, Unit will not send a text message, in order to avoid breaching the electronic communications consent requirements. In order to create a cardholder token that has access to scopes that require two factor authentication, please use the passcode 000001
The rate limit for verifying a customer is 5 attempts per 10 minutes.
| Verb | POST |
| URL | https://api.s.unit.sh/cards/:cardId/cardholder/token/verification |
| Data Type | cardholderTokenVerification |
| Timeout (Seconds) | 5 |
Attributes
sms or call.Default is English.
See Localization Options bellow for the support languages and their 2-letter code.
curl -X POST 'https://api.s.unit.sh/cards/123/cardholder/token/verification'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
--data-raw '{
"data": {
"type": "cardholderTokenVerification",
"attributes": {
"channel": "sms"
}
}
}'
201 Created
Localization Options
English-en, Afrikaans-af, Arabic-ar, Catalan-ca, Chinese-zh, Chinese (Mandarin)-zh-CN, Chinese
(Cantonese)-zh-HK, Croatian-hr, Czech-cs, Danish-da, Dutch-nl, English (British)-en-GB, Estonian-et,
Finnish-fi, French-fr, German-de, Greek-el, Hebrew-he, Hindi-hi, Hungarian-hu, Indonesian-id,
Italian-it, Japanese-ja, Kannada-kn, Korean-ko, Malay-ms, Marathi-mr, Norwegian-nb, Polish-pl,
Portuguese - Brazil-pt-BR, Portuguese-pt, Romanian-ro, Russian-ru, Slovak-sk, Spanish-es, Swedish-sv,
Tagalog-tl, Telegu-te, Thai-th, Turkish-tr, Vietnamese-vi
{
"data": {
"type": "cardholderTokenVerification",
"attributes": {
"verificationToken": "i8FWKLBjXEg3TdeK93G3K9PKLzhbT6CRhn/VKkTsm...."
}
}
}