Skip to main content
POST
/
v1
/
session
JavaScript
import Benny from '@bennyapi/sdk';

const client = new Benny({
  subdomain: 'My-Subdomain',
  apiKey: process.env['BENNY_API_KEY'], // This is the default and can be omitted
});

const response = await client.sessions.createToken({ externalUserId: 'externalUserId' });

console.log(response.token);
{
  "token": "<string>",
  "expiresAt": "2023-11-07T05:31:56Z"
}

Authorizations

api-key
string
header
required

API key authentication for public endpoints

Body

application/json
externalUserId
string
required

Your organization's representation of the customer ID.

orderId
string

Your organization's representation of the order ID.

Response

Session token created successfully.

token
string
required

The session token.

expiresAt
string<date-time>
required

The UTC time at which the token expires.