{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/salesforce-commerce-cloud/json-schema/salesforce-commerce-cloud-trusted-agent-token-request-schema.json",
  "title": "TrustedAgentTokenRequest",
  "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/TrustedAgentTokenRequest",
  "required": [
    "channel_id",
    "client_id",
    "code_verifier",
    "grant_type",
    "idp_origin",
    "login_id"
  ],
  "type": "object",
  "properties": {
    "agent_id": {
      "maxLength": 40,
      "type": "string",
      "description": "The ID of the merchant. If passed in, the `agent_id` will be validated using the SUB claim in the response from Account Manager.\n\nThis is an optional parameter unless the request is for a Trusted Agent on Behalf then `agent_id` is required."
    },
    "client_id": {
      "maxLength": 40,
      "type": "string",
      "description": "The SLAS public client ID or SLAS private client ID for use with trusted-system requests.\n\nThe `client_id` is not needed if a using a SLAS private `client_id` and the `_sfdc_client_auth` header."
    },
    "channel_id": {
      "maxLength": 100,
      "type": "string",
      "description": "The channel (B2C Commerce site) that the user is associated with."
    },
    "code_verifier": {
      "type": "string",
      "description": "PKCE code verifier. Created by the caller.\n\nThe `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash.\n\nThe `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters.\n\nThe `code_verifier` is not needed if a using a SLAS private `client_id` and the `_sfdc_client_auth` header."
    },
    "grant_type": {
      "type": "string",
      "description": "Grant Type",
      "enum": [
        "authorization_code",
        "refresh_token",
        "client_credentials",
        "authorization_code_pkce",
        "session_bridge"
      ]
    },
    "login_id": {
      "maxLength": 128,
      "type": "string",
      "description": "The ID is the shopper for trusted agent access.\n\nFor TAOB Guest the `login_id` must be set to `Guest`."
    },
    "idp_origin": {
      "maxLength": 16,
      "type": "string",
      "description": "The IDP that the user is associated with. \n\nFor TAOB Guest the `idp_origin` parameter should be `slas`. If set to any other IDP origin a 400 Bad Request will be returned."
    },
    "usid": {
      "type": "string",
      "description": "The shopper's unique identifier, if known. If not provided, a new USID is generated."
    },
    "dnt": {
      "type": "string",
      "description": "This is an optional parameter to set `Do Not Track` for the session. \n\nSLAS is making this available, but will not be used by B2C Commerce until after the 24.4 release.\n\nValues are:\n  * `false`\n  * `true`\n\n  If not added the `dnt` value will default to `true`\n\n  Note: The default value for `dnt` is set to `true` for all TAOB flows. This is opposite from other SLAS token requests."
    },
    "state": {
      "type": "string",
      "description": "This is an optional parameter to set state for the trusted agent session. \n\nIf the `state` parameter is used it will be validated and a 400 Bad Request will be returned if missing or invalid.\n\nFor TAOB Guest you must pass the `state` parameter to transfer the state from the TAOB Guest authorization call to the token call. \nThe `state` parameter value is returned with the authorization code in the response url from the TAOB guest authorization call, \nfor example: `.../taob/callback?code=HETXpvg5LKBNIHjDTWkRrf2MLVU&state=taob.gst.7bc7fb7f-e646-44fd-bc73-dfd5c3c9019b`.\n\nYou would use `taob.gst.7bc7fb7f-e646-44fd-bc73-dfd5c3c9019b` for the `state` value in the TAOB request."
    }
  }
}