Skip to content

Retrieve the Braintree token

Request

Issues a Braintree client token for the current blaize session. This holds the user's userId if the user has an authenticated session. This token can be used to request a payment once.

Security
CookieBlaizeSession or JwtQuery or JwtHeaderXBlaizeJwt or JwtHeaderXZephrJwt or JwtBearer or JwtCookie
Query
allowUnauthenticatedboolean

If tokens can be generated for unauthenticated user sessions - defaults to false.

Headers
cookiestring

The session cookie.

Example:`blaize_session=...` (string)
cURL
curl -i -X GET \
  'https://demo-site/blaize/payment/braintree/token?allowUnauthenticated=true' \
  -H 'cookie: `blaize_session=...` (string)' \
  -b '`blaize_session=...` (string)'

Responses

OK

Headers
any
Bodyapplication/json
tokenstring
Example:"eyJ2ZXmsaW5nQW...(lots more random-looking characters)...dyZWmVubW8iOiJvZmYifQ=="
Response
{ "token": "eyJ2ZXmsaW5nQW...(lots more random-looking characters)...dyZWmVubW8iOiJvZmYifQ==" }