{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/demandware/json-schema/demandware-login-request-schema.json",
  "title": "LoginRequest",
  "description": "Supports multiple custom parameters to invoke hooks in B2C Commerce API. Multiple custom parameters can be added. Use the `c_` prefix to distinguish custom query parameters from standard query parameters, for example: c_captcha=true\nIf there is a validation error, a 400 Bad_Request with the details of the error is thrown.",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/demandware-auth-v1-openapi.yml#/components/schemas/LoginRequest",
  "type": "object",
  "required": [
    "redirect_uri",
    "channel_id"
  ],
  "additionalProperties": {
    "title": "Additional Property Support",
    "description": "This type supports additional properties passed along with the defined properties of this API.\nTo indicate that the properties were defined and expected to be handled as additional properties, they are expected to be prefixed with a `c_`.\nThe type will reject any property that does not fit this pattern, only allowing additional properties beginning with the known prefix."
  },
  "properties": {
    "client_id": {
      "description": "SLAS client ID. Required when the grant type is `authorization_code_pkce`.",
      "type": "string",
      "maxLength": 40
    },
    "response_type": {
      "description": "Must be `code`. Indicates that the client wants an authorization code (when the grant type is `authorization_code`).",
      "allOf": [
        {
          "$ref": "#/$defs/ResponseType"
        }
      ]
    },
    "redirect_uri": {
      "description": "The URI to which the server redirects the browser after the user grants the authorization. The URI must be registered with the SLAS client. A variety of URI formats and wildcards for host are supported, but app links like airbnb:// or fb:// are not. Examples of supported URIs: \n\nExamples of supported URIs:\n  - `http://localhost:3000/callback`\n  - `https://example.com/callback`\n  - `com.example.app:redirect_uri_path`\n  - ` *.subdomain.topleveldomain.com`\n",
      "maxLength": 256,
      "type": "string"
    },
    "state": {
      "description": "Value to be sent by the client to determine the state between the authorization request and the server response. Optional, but strongly recommended.",
      "type": "string",
      "maxLength": 512
    },
    "scope": {
      "description": "Scopes to limit an application's access to a user's account.",
      "type": "string",
      "maxLength": 256
    },
    "usid": {
      "description": "The unique shopper ID.",
      "type": "string",
      "maxLength": 128
    },
    "channel_id": {
      "description": "The channel that the request is for. For a B2C Commerce request, this is angalous to the site ID.",
      "type": "string",
      "maxLength": 100
    },
    "code_challenge": {
      "description": "PKCE code verifier. Created by the client calling the `login` endpoint.\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_challenge` is optional when using a private client id for the token request.",
      "type": "string",
      "minLength": 43,
      "maxLength": 128
    }
  },
  "$defs": {
    "ResponseType": {
      "type": "string",
      "description": "Response Type",
      "enum": [
        "code"
      ]
    }
  }
}