Skip to main content
POST
Browser Session

Overview

Browser Session is the authentication endpoint that serves as the starting point for all Cart API integrations. It exchanges your Application ID for an access token that authenticates subsequent API calls.

Authentication

string
required
Your Application ID provided by Firmly

Request Body (Optional)

string
An expired access token (valid up to 1 week after expiration) to renew

Response

boolean
Indicates whether or not a new device was created for this session
string
The JWT access token to use in x-firmly-authorization header for all API calls
number
Number of seconds until the token expires (typically 3600)
number
Unix timestamp when the token expires
string
Unique identifier for this device session

Code Examples

Token Renewal

You can renew an expired token up to 1 week after expiration:

Using the Access Token

After obtaining the access token, include it in all API requests:

Error Responses

Invalid or missing Application ID
Expired token cannot be renewed (older than 1 week)

Best Practices

  1. Token Refresh: Implement automatic token refresh before expiration. The authorization token represents the user’s device. It should be stored with the user; not with the backend
  2. Error Handling: Handle token expiration gracefully with retry logic

Implementation Example

Next Steps

After authentication, you can: