POST/oauth2/token

Create an access token

Canonical OAuth 2.0 client credentials token endpoint.

Send tenant_id, grant_type, and space-separated scope permissions as an application/x-www-form-urlencoded body. Modern tokens include all assigned stores and programs for the requested API families; omit resource. Legacy ecom and loyalty_programs requests require one resource ID. Authenticate the API client with HTTP Basic (recommended) or client_id and client_secret in the body.

MCP clients use the authorization_code (PKCE) and refresh_token grants as form posts.

Request body (required)

application/x-www-form-urlencoded
client_idoptional

Client ID when using client_secret_post. Omit when using HTTP Basic.

client_secretoptional

Client secret when using client_secret_post. Omit when using HTTP Basic.

grant_typerequired
Allowed values"client_credentials"
resourceoptional

One assigned eCom store or loyalty program ID for legacy ecom or loyalty_programs. Omit for modern permissions.

scoperequired

Space-separated granted permissions, including Core scopes, ecom:read, ecom:write, loyalty_programs:read and demand_planning. Legacy ecom and loyalty_programs must be requested alone with resource.

Example"ecom:read ecom:write loyalty_programs:read"
tenant_idrequired

SnowBee tenant ID

Example"019c1234-5678-7abc-8def-123456789012"
application/json
client_idoptional

Client ID when using client_secret_post. Omit when using HTTP Basic.

client_secretoptional

Client secret when using client_secret_post. Omit when using HTTP Basic.

grant_typerequired
Allowed values"client_credentials"
resourceoptional

One assigned eCom store or loyalty program ID for legacy ecom or loyalty_programs. Omit for modern permissions.

scoperequired

Space-separated granted permissions, including Core scopes, ecom:read, ecom:write, loyalty_programs:read and demand_planning. Legacy ecom and loyalty_programs must be requested alone with resource.

Example"ecom:read ecom:write loyalty_programs:read"
tenant_idrequired

SnowBee tenant ID

Example"019c1234-5678-7abc-8def-123456789012"

Responses

200Response
application/json
access_tokenrequired

JWT access token to use for API requests

Example"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
expires_inrequired

Token expiration time in seconds

  • Format: int32
Example3600
scoperequired

Scope granted to the access token

Example"ecom"
token_typerequired
Allowed values"deleted"
400Invalid OAuth token request

Invalid OAuth token request

application/json
errorrequired

OAuth 2.0 error code

Example"invalid_request"
error_descriptionrequired

Human-readable error description

Example"The tenant_id parameter is required"
resolutionrequired

Suggested next action

Example"Add tenant_id to the form-encoded request and retry"
401Client authentication failed

Client authentication failed

application/json
errorrequired

OAuth 2.0 error code

Example"invalid_request"
error_descriptionrequired

Human-readable error description

Example"The tenant_id parameter is required"
resolutionrequired

Suggested next action

Example"Add tenant_id to the form-encoded request and retry"