Skip to main content
The authentication endpoints let you obtain access tokens and refresh user token claims. Call these endpoints before making any other API calls — every other endpoint requires a valid token in the Authorization header.

POST /api/auth/login

Authenticate with your organization credentials to receive a JWT access token. Use this token in the Authorization: Bearer header for all subsequent requests.
This endpoint is rate limited to 10 requests per minute per ClientId. Cache and reuse your token until it expires rather than authenticating on every request.

Request body

string
required
Your organization code. You can find this in the Nymble Commerce dashboard under Settings → API Access.Example: "org_12345"
string
required
Your API client ID. Generated when you create an API access credential.Example: "sdaf43tfsdg45dg"
string
required
Your API client secret. Treat this like a password — never expose it in client-side code or commit it to source control.Example: "QsFdas%4F1asr23tgb675%3"

Example request

Response fields

string
The access token to include in the Authorization: Bearer header of all subsequent requests.Example: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
string
The token type identifier. Always "api-key". Pass the AccessToken value using the Bearer scheme in your Authorization header regardless of this field.
integer
The token lifetime in seconds. Tokens are valid for 86400 seconds (24 hours) by default. Request a new token before this window elapses.

Example response

Error responses


POST /api/auth/access

Enriches an existing access token with organization-specific claims for a given user. Pass the organization and user identifiers in the request body; the API returns the commerce context — customer number, price tier, and currency — that Nymble Commerce will use to scope data correctly for that user.
This endpoint requires a valid access token in the Authorization header. Obtain one via POST /api/auth/login before calling this endpoint.

Authentication

Request body

string
required
The internal Nymble Commerce organization ID to enrich the token for. This scopes the returned claims to the correct organization.Example: "6d24ab9faf9e034e881fcd97"
string
required
The Nymble Commerce user ID of the user to retrieve commerce context for.Example: "kp_abc123def456"

Example request

cURL

Response fields

string | null
The customer account number linked to this user in the specified organization. null if the user has no customer association.Example: "C-10042"
string | null
The pricing tier assigned to this user’s customer account. Used to apply the correct price list on product queries.Example: "Wholesale"
string | null
The ISO 4217 currency code for this user’s organization context.Example: "USD"

Example response

Error responses