/** * This file was auto-generated by openapi-typescript and ts-morph. * Do not make direct changes to the file. */ export interface paths { readonly "/storefront/api-token": { readonly parameters: { readonly query?: never; readonly header: { /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body. */ readonly Accept: components["parameters"]["Accept"]; }; readonly path?: never; readonly cookie?: never; }; /** * Create a Token * @description Creates a Storefront API token. * * **Required Scopes** * * `Manage` `Storefront API Tokens` */ readonly post: operations["createToken"]; /** * Revoke a Token * @description Revoke access for a Storefront API token. Only revoke compromised tokens under emergency situations. Let uncompromised short-lived tokens expire naturally, as you do not need to revoke these. */ readonly delete: operations["revokeToken"]; }; readonly "/storefront/api-token-customer-impersonation": { readonly parameters: { readonly query?: never; readonly header: { /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body. */ readonly Accept: components["parameters"]["Accept"]; }; readonly path?: never; readonly cookie?: never; }; /** * Create a Token * @description Returns a Storefront API token that allows your application to impersonate customers when making GraphQL `POST` requests. For more information on how to use the returned token, see [customer impersonation tokens](/docs/rest-authentication/tokens/customer-impersonation-token#create-a-token). * * **Required Scopes** * * `Manage` `Storefront API Customer Impersonation Tokens` */ readonly post: operations["createTokenWithCustomerImpersonation"]; }; } export type webhooks = Record; export interface components { schemas: { readonly TokenPostImpersonation: { /** * @description Unix timestamp (UTC time) defining when the token should expire. Supports seconds, but does not support milliseconds, microseconds, or nanoseconds. * @example 1885635176 */ readonly expires_at: number; } & (components["schemas"]["Channels"] | components["schemas"]["Channel"]); readonly TokenPostSimple: { /** @description List of allowed domains for Cross-Origin Request Sharing. Currently accepts a maximum of two domains per created token. */ readonly allowed_cors_origins?: readonly string[]; }; readonly Token_Full: { readonly data?: components["schemas"]["Token_Base"]; /** @description Response metadata. */ readonly meta?: { readonly [key: string]: unknown; }; }; readonly Token_Base: { /** @description JWT Token for accessing the Storefront API */ readonly token?: string; }; /** channel_id */ readonly Channel: { /** * @description Channel ID that is valid for the requested token. Use this field to enter a channel ID. Do not use this field if you have more than one channel. We support this field for backwards compatibility, but `channel_ids` is preferred. You can not use both `channel_id` and `channel_ids` in your request. * @example 1 */ readonly channel_id: number; }; /** channel_ids */ readonly Channels: { /** * @description A list of channel IDs that are valid for the requested token. Use this field if you have more than one channel ID. You can not use both `channel_id` and `channel_ids` in your request. * @example [ * 667251, * 1 * ] */ readonly channel_ids: readonly number[]; }; readonly ErrorResponse: components["schemas"]["BaseError"] & { readonly errors?: components["schemas"]["DetailedErrors"]; }; /** @description Error payload for the BigCommerce API. * */ readonly BaseError: { /** @description The HTTP status code. * */ readonly status?: number; /** @description The error title describing the particular error. * */ readonly title?: string; readonly type?: string; }; readonly DetailedErrors: { readonly [key: string]: string; }; }; responses: { readonly TokenResponse: { headers: { readonly [name: string]: unknown; }; content: { readonly "application/json": components["schemas"]["Token_Full"]; }; }; }; parameters: { /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body. */ readonly Accept: string; /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the request body. */ readonly ContentType: string; }; requestBodies: never; headers: never; pathItems: never; } export type $defs = Record; export interface operations { readonly createToken: { readonly parameters: { readonly query?: never; readonly header?: { /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body. */ readonly Accept?: components["parameters"]["Accept"]; /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the request body. */ readonly "Content-Type"?: components["parameters"]["ContentType"]; }; readonly path?: never; readonly cookie?: never; }; readonly requestBody?: { readonly content: { /** @example { * "allowed_cors_origins": [ * "https://www.yourstorefront.com" * ], * "channel_id": 1, * "expires_at": 1885635176 * } */ readonly "application/json": components["schemas"]["TokenPostSimple"] & components["schemas"]["TokenPostImpersonation"]; }; }; readonly responses: { readonly 200: { headers: { readonly [name: string]: unknown; }; content: { readonly "application/json": components["schemas"]["Token_Full"]; }; }; /** @description Unauthorized - the v3 Auth client ID or token in the request are not a valid combination for this store. */ readonly 401: { headers: { readonly [name: string]: unknown; }; content?: never; }; /** @description Missing scope - the v3 Auth token is valid but does not have proper permissions to access this endpoint. */ readonly 403: { headers: { readonly [name: string]: unknown; }; content?: never; }; /** @description Invalid JSON request body - missing or invalid data. */ readonly 422: { headers: { readonly [name: string]: unknown; }; content?: never; }; }; }; readonly revokeToken: { readonly parameters: { readonly query?: never; readonly header: { /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body. */ readonly Accept?: components["parameters"]["Accept"]; /** @description An existing JWT token that you want to revoke. */ readonly "Sf-Api-Token": string; }; readonly path?: never; readonly cookie?: never; }; readonly requestBody?: never; readonly responses: { /** @description A storefront API token revocation has been scheduled. */ readonly 200: { headers: { readonly [name: string]: unknown; }; content?: never; }; /** @description Unauthorized - the v3 Auth client ID or token in the request are not a valid combination for this store. */ readonly 401: { headers: { readonly [name: string]: unknown; }; content?: never; }; /** @description Missing scope - the v3 Auth token is valid but does not have proper permissions to access this endpoint. */ readonly 403: { headers: { readonly [name: string]: unknown; }; content?: never; }; /** @description Invalid JWT Token provided or missing JWT token header */ readonly 422: { headers: { readonly [name: string]: unknown; }; content?: never; }; }; }; readonly createTokenWithCustomerImpersonation: { readonly parameters: { readonly query?: never; readonly header?: { /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body. */ readonly Accept?: components["parameters"]["Accept"]; /** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the request body. */ readonly "Content-Type"?: components["parameters"]["ContentType"]; }; readonly path?: never; readonly cookie?: never; }; readonly requestBody?: { readonly content: { readonly "application/json": components["schemas"]["TokenPostImpersonation"]; }; }; readonly responses: { readonly 200: { headers: { readonly [name: string]: unknown; }; content: { readonly "application/json": components["schemas"]["Token_Full"]; }; }; /** @description Unauthorized - the v3 Auth client ID or token in the request are not a valid combination for this store. */ readonly 401: { headers: { readonly [name: string]: unknown; }; content?: never; }; /** @description Missing scope - the v3 Auth token is valid but does not have proper permissions to access this endpoint. */ readonly 403: { headers: { readonly [name: string]: unknown; }; content?: never; }; /** @description Invalid JSON request body - missing or invalid data */ readonly 422: { headers: { readonly [name: string]: unknown; }; content?: never; }; }; }; }