Skip to main content
POST
https://api-staging.withbenji.com
/
verify
/
token
/
create
Create a token to initialize the SDK
curl --request POST \
  --url https://api-staging.withbenji.com/verify/token/create \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "display_name": "<string>",
  "mode": 123,
  "partnership_id": "<string>",
  "user_external_id": "<string>",
  "custom_attributes": {
    "actions": [
      {
        "mode": 123,
        "amount": 123,
        "allows_editing": true
      }
    ]
  }
}
'
{
    "code": "ok",
    "data": {
        "token": "0c371a1c-aa81-11ef-b28c-0a58a9feac02"
    }
}
The Bearer token to be used on this API is your partner access token.
display_name
string
required
The partnership display name you wish to be shown in the Benji Connect flow UI Note: If this is not passed, the name configured on the Benji platform will be used.
mode
number
required
The connection mode for the SDK (Connect = 1, Transfer = 3, and Redeem = 4)
partnership_id
string
The unique identifier of the partnership on the Benji Platform.
user_external_id
string
A unique identifier associated with the user connecting their loyalty reward program, when set flow skips the initial user authorization with the partner and continues to authorize the user with the related merchant/partner.
custom_attributes
object
Custom attributes for the connection flow

Example Requests

{
    "mode": 1,
    "display_name": "Reward Cookies",
    "partner_id": 3,
    "partnership_id": 49,
    "merchant_id": 48
}
{
    "mode": 1,
    "display_name": "Reward Cookies",
    "partner_id": 3,
    "partnership_id": 49,
    "merchant_id": 48,
    "user_external_id": "1234"
}
{
    "mode": 3,
    "display_name": "Reward Cookies",
    "partner_id": 3,
    "partnership_id": 49,
    "merchant_id": 48,
    "custom_attributes": {
        "actions": [
            {
                "mode": 3,
                "amount": 1000,
                "allows_editing": true
            }
        ]
    }
}

Return values

token
string
required
The created token token to use when initializing the Benji Connect SDK
{
    "code": "ok",
    "data": {
        "token": "0c371a1c-aa81-11ef-b28c-0a58a9feac02"
    }
}