{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/salesforce-commerce-cloud/json-schema/salesforce-commerce-cloud-token-response-schema.json",
  "title": "TokenResponse",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/salesforce-commerce-cloud-auth-api-openapi.yml#/components/schemas/TokenResponse",
  "required": [
    "access_token",
    "customer_id",
    "enc_user_id",
    "expires_in",
    "id_token",
    "idp_access_token",
    "refresh_token",
    "refresh_token_expires_in",
    "token_type",
    "usid"
  ],
  "type": "object",
  "properties": {
    "access_token": {
      "type": "string",
      "description": "Short term shopper JWT that can be used to access Shopper APIs. Valid for 30 minutes.\n\nA trusted agent shopper JWT is valid for 15 min."
    },
    "id_token": {
      "type": "string",
      "description": "User ID token. Valid for 30 minutes."
    },
    "refresh_token": {
      "type": "string",
      "description": "Long term refresh token that can be used to refresh an access token. Valid for 30 days. \n\nThe refresh_token will not be returned for trusted agents JWTs. A JWT for trusted agents expires after 15 minutes and is not refreshable. When expired, then app must restart the authorization flow and make another request to the /trusted-agent/authorize endpoint."
    },
    "expires_in": {
      "type": "integer",
      "description": "Remaining access token expiry time, in seconds."
    },
    "refresh_token_expires_in": {
      "type": "number",
      "description": "Remaining refresh token expiry time, in seconds."
    },
    "token_type": {
      "$ref": "#/$defs/TokenType"
    },
    "usid": {
      "type": "string",
      "description": "The unique shopper ID. Returned when using the `client_credentials` grant type."
    },
    "customer_id": {
      "type": "string",
      "description": "Customer's ID"
    },
    "enc_user_id": {
      "type": "string",
      "description": "MD5 Hashed B2C Commerce user ID in uppercase."
    },
    "idp_access_token": {
      "maxLength": 8192,
      "type": "string",
      "description": "This is the access token that is returned from the IDP. The IDP access token is returned to be able to make calls into the IDP outside of SLAS."
    },
    "idp_refresh_token": {
      "maxLength": 128,
      "type": "string",
      "description": "This is the refresh token that is returned from the IDP. The IDP refresh token is returned to be able to make calls into the IDP outside of SLAS."
    },
    "dnt": {
      "maxLength": 5,
      "type": "string",
      "description": "Do not track"
    }
  },
  "$defs": {
    "TokenType": {
      "type": "string",
      "description": "Token Type",
      "enum": [
        "Bearer"
      ]
    }
  }
}