POST
/
v1
/
businesses
/
{businessId}
/
auth-token
curl --request POST \
  --url https://sandbox.layerfi.com/v1/businesses/{businessId}/auth-token \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "session_duration": "3600"
}'
{
  "access_token": "eyJraWQiOiJaM1BNWbkhFakeAccessTokenKMGExb0ppUm5sRStlbytI6ImFjY2VzcyIsInNjb3BlIjoiaHR0cHM6XC9cLN5-TG3ktXvNe5B9hU9rQgZQ",
  "expires_in": "12345",
  "token_type": "Bearer"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Content-Type
string

Content-Type must be set to application/json

Path Parameters

businessId
string
required

The UUID of the business to create a business-scoped auth token for

Body

application/json
session_duration
integer

Length, in seconds, this token will be valid. Default is (3600) 1 hour. Maximum is 24 hours (86400).

Example:

"3600"

Response

200
application/json
access_token
string

The business-scoped access token for the Layer API

Example:

"eyJraWQiOiJaM1BNWbkhFakeAccessTokenKMGExb0ppUm5sRStlbytI6ImFjY2VzcyIsInNjb3BlIjoiaHR0cHM6XC9cLN5-TG3ktXvNe5B9hU9rQgZQ"

expires_in
integer

Number of seconds until the access token expires

Example:

"12345"

token_type
string

Type of the access token, currently always Bearer.

Example:

"Bearer"