x-api-key header authentication for machine-to-machine (M2M) integrations where a pre-issued API key is passed directly in every request. Choose the method that matches your integration architecture — both grant access to the same API surface, scoped to your organization.
Login Token Authentication
Use login token authentication when your application authenticates on behalf of a user or customer session. Your server exchanges yourOrgCode, ClientId, and ClientSecret for a short-lived access token, then passes that token in the x-api-key header on all subsequent requests.
Endpoint
Request body
string
required
Your organization code. This identifies which Nymble Commerce tenant you are authenticating against. Example:
org_52a3021e813.string
required
Your client ID. Issued when your API credentials are provisioned. Acts as the username component of your credential pair.
string
required
Your client secret. Issued alongside your
ClientId. Treat this as a password — never expose it in client-side code or public repositories.Response fields
string
A signed access token. Pass this value in the
x-api-key header of every subsequent API request. The token encodes your organization context and role claims so you don’t need to pass them separately.string
The token scheme. Always returns
"api-key".integer
The token’s lifetime in seconds. Typically
86400 (24 hours). Cache the token and reuse it until it approaches expiry rather than requesting a new one on every call.Example request
Example response
Using the token
Pass theAccessToken value in the x-api-key header on every subsequent request:
The
/api/auth/login endpoint is rate-limited to 10 requests per minute per ClientId. If you exceed this limit, you’ll receive a 429 Too Many Requests response. Cache your token and reuse it for its full ExpiresIn duration to stay well within this limit.API Key Authentication
For server-to-server integrations, automated pipelines, and backend services, use a pre-issued API key instead of the credential login flow. Pass your API key directly in thex-api-key request header.
- ERP and accounting system integrations
- Scheduled data sync jobs
- Webhook processors and event-driven pipelines
- Internal tooling that runs with elevated or admin-level access
Contact your Nymble Commerce account administrator to obtain or rotate your organization’s API key. API keys carry the same organizational scope as a login token but are not tied to an individual user session.
Token claims
When you authenticate viaPOST /api/auth/login, the returned AccessToken encodes your organization context. The Nymble Commerce API reads these claims on every request, so you don’t need to pass organization context explicitly in most endpoints.
Key claims carried in the token:
These claims are populated when your API credentials are provisioned and enriched at login time.
Authorization roles
Every Nymble Commerce user or integration is assigned a role that determines which API endpoints and resources are accessible. Roles are configured during account provisioning.Roles are set when your account is provisioned. To add, change, or remove roles for a user or integration credential, contact Nymble Commerce support.