bigrequest
Version:
A typesafe, servelerless-friendly Node.js HTTP request client for the BigCommerce API
1,205 lines (1,202 loc) • 2.98 MB
text/typescript
import * as openapi_fetch from 'openapi-fetch';
import * as openapi_typescript_helpers from 'openapi-typescript-helpers';
/**
* This file was auto-generated by openapi-typescript.
* Do not make direct changes to the file.
*/
interface paths$V {
"/marketing/abandoned-cart-emails": {
/**
* Get all abandoned cart email templates
* @description An array of abandoned cart emails pertaining to a store.
*/
get: operations$V["getAbandonedCartEmailTemplates"];
/**
* Create abandoned cart email template
* @description Create an Abandoned Cart Email template.
*/
post: operations$V["createAbandonedCartEmailTemplate"];
parameters: {
header: {
Accept: components$V["parameters"]["Accept"];
};
};
};
"/marketing/abandoned-cart-emails/{id}": {
/**
* Get an email template
* @description Get a single Abandoned Cart Email template.
*/
get: operations$V["getAbandonedCartEmailTemplate"];
/**
* Update an email template
* @description Update an email template.
*/
put: operations$V["updateAbandonedCartEmailTemplate"];
/**
* Delete email template
* @description Delete Abandoned Cart Email template.
*/
delete: operations$V["deleteAbandonedCartEmailTemplate"];
parameters: {
header: {
Accept: components$V["parameters"]["Accept"];
};
path: {
/** @description ID of the Abandoned Cart Email template. */
id: number;
};
};
};
"/marketing/abandoned-cart-emails/default": {
/**
* Get default email template
* @description Return default Abandoned Cart Email template.
*/
get: operations$V["getDefaultAbandonedCartEmailTemplate"];
parameters: {
header: {
Accept: components$V["parameters"]["Accept"];
};
};
};
"/marketing/abandoned-cart-emails/settings": {
/**
* Get email template settings
* @description Read Abandoned Cart Email Template settings.
*/
get: operations$V["getAbandonedCartEmailTemplateSettings"];
/**
* Update email template settings
* @description Update Abandoned Cart Email template settings.
*/
put: operations$V["updateAbandonedCartEmailTemplateSettings"];
parameters: {
header: {
Accept: components$V["parameters"]["Accept"];
};
};
};
}
interface components$V {
schemas: {
/** SaveError */
SaveError: {
status?: number;
title?: string;
type?: string;
errors?: string[];
};
/** BaseError */
BaseError: {
status?: string;
type?: string;
};
/** AbandonedCartEmailModel */
AbandonedCartEmailModel: {
notify_at_minutes?: components$V["schemas"]["NotifyAtMinutes"];
coupon_code?: components$V["schemas"]["CouponCode"];
template?: components$V["schemas"]["Template"];
};
/** AbandonedCartSettings */
AbandonedCartSettings: {
/** @description Boolean value that specifies the inheritance state. */
use_global: boolean;
};
AbandondedCartEmailPayload: {
is_active?: boolean;
coupon_code?: components$V["schemas"]["CouponCode"];
notify_at_minutes?: components$V["schemas"]["NotifyAtMinutes"];
template?: components$V["schemas"]["Template"];
};
/** Template */
Template: {
/** @example 'Complete your purchase at {{ store.name }}' */
subject: string;
/** @example 'Complete your purchase <a href="{{ notification.checkout_link }}">{{notification.checkout.link}}' */
body: string;
translations: components$V["schemas"]["TranslationDefinition"][];
};
/** TranslationDefinition */
TranslationDefinition: {
/**
* @description Locale code for this language, such as 'en', 'en-us', 'fr-ca'.
* @example en
*/
locale: string;
/** @description Language keys for the template. User-defined. Should match any language keys used in the template. */
keys: {
[key: string]: string;
};
};
/**
* NotifyAtMinutes
* @description Describes when this email will be sent, in minutes. Only supports certain intervals described in the enum.
* @example 60
* @enum {integer}
*/
NotifyAtMinutes: 60 | 120 | 180 | 240 | 300 | 360 | 420 | 480 | 540 | 600 | 660 | 720 | 780 | 840 | 900 | 960 | 1020 | 1080 | 1140 | 1200 | 1260 | 1320 | 1380 | 1440 | 2880 | 4320 | 5760 | 7200 | 8640 | 10080 | 11520 | 12960 | 14400;
/**
* Coupon Code Field
* @example FF11-22X4
*/
CouponCode: string;
/** AbandondedCartEmail */
AbandondedCartEmail: {
/** @example 1 */
id?: number;
notify_at_minutes?: components$V["schemas"]["NotifyAtMinutes"];
coupon_code?: components$V["schemas"]["CouponCode"];
template?: components$V["schemas"]["Template"];
is_active?: boolean;
sent_num?: number;
};
/**
* Response meta
* @description Response metadata.
*/
metaCollection_open: {
[key: string]: unknown;
};
};
responses: never;
parameters: {
/** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body. */
Accept: string;
/** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the request body. */
ContentType: string;
/** @description Channel ID to use for channel-level data. */
ChannelIdOptional?: number;
/** @description Channel ID to use for channel-specific settings. */
ChannelIdRequired: number;
};
requestBodies: never;
headers: never;
pathItems: never;
}
interface operations$V {
/**
* Get all abandoned cart email templates
* @description An array of abandoned cart emails pertaining to a store.
*/
getAbandonedCartEmailTemplates: {
parameters: {
query?: {
channel_id?: components$V["parameters"]["ChannelIdOptional"];
};
header: {
Accept: components$V["parameters"]["Accept"];
};
};
responses: {
/** @description OK */
200: {
content: {
"application/json": {
data?: components$V["schemas"]["AbandondedCartEmail"][];
meta?: components$V["schemas"]["metaCollection_open"];
};
};
};
};
};
/**
* Create abandoned cart email template
* @description Create an Abandoned Cart Email template.
*/
createAbandonedCartEmailTemplate: {
parameters: {
query?: {
channel_id?: components$V["parameters"]["ChannelIdOptional"];
};
header: {
Accept: components$V["parameters"]["Accept"];
"Content-Type": components$V["parameters"]["ContentType"];
};
};
requestBody?: {
content: {
"application/json": components$V["schemas"]["AbandondedCartEmailPayload"];
};
};
responses: {
/** @description OK */
200: {
content: {
"application/json": {
data?: components$V["schemas"]["AbandondedCartEmail"];
meta?: components$V["schemas"]["metaCollection_open"];
};
};
};
/** @description Unprocessable Entity */
422: {
content: {
"application/json": components$V["schemas"]["SaveError"];
};
};
};
};
/**
* Get an email template
* @description Get a single Abandoned Cart Email template.
*/
getAbandonedCartEmailTemplate: {
parameters: {
header: {
Accept: components$V["parameters"]["Accept"];
};
path: {
/** @description ID of the Abandoned Cart Email template. */
id: number;
};
};
responses: {
/** @description OK */
200: {
content: {
"application/json": {
data?: components$V["schemas"]["AbandondedCartEmail"];
meta?: components$V["schemas"]["metaCollection_open"];
};
};
};
};
};
/**
* Update an email template
* @description Update an email template.
*/
updateAbandonedCartEmailTemplate: {
parameters: {
header: {
Accept: components$V["parameters"]["Accept"];
"Content-Type": components$V["parameters"]["ContentType"];
};
path: {
/** @description ID of the Abandoned Cart Email template. */
id: number;
};
};
requestBody?: {
content: {
"application/json": components$V["schemas"]["AbandondedCartEmailPayload"];
};
};
responses: {
/** @description OK */
200: {
content: {
"application/json": {
data?: components$V["schemas"]["AbandondedCartEmail"];
meta?: components$V["schemas"]["metaCollection_open"];
};
};
};
/** @description Unprocessable Entity */
422: {
content: {
"application/json": components$V["schemas"]["SaveError"];
};
};
};
};
/**
* Delete email template
* @description Delete Abandoned Cart Email template.
*/
deleteAbandonedCartEmailTemplate: {
parameters: {
header: {
Accept: components$V["parameters"]["Accept"];
};
path: {
/** @description ID of the Abandoned Cart Email template. */
id: number;
};
};
responses: {
/** @description No Content */
204: {
content: never;
};
};
};
/**
* Get default email template
* @description Return default Abandoned Cart Email template.
*/
getDefaultAbandonedCartEmailTemplate: {
parameters: {
header: {
Accept: components$V["parameters"]["Accept"];
};
};
responses: {
/** @description OK */
200: {
content: {
"application/json": {
subject: string;
body: string;
translations: {
locale: string;
keys: {
hello_phrase?: string;
};
}[];
};
};
};
};
};
/**
* Get email template settings
* @description Read Abandoned Cart Email Template settings.
*/
getAbandonedCartEmailTemplateSettings: {
parameters: {
query: {
channel_id: components$V["parameters"]["ChannelIdRequired"];
};
header: {
Accept: components$V["parameters"]["Accept"];
};
};
responses: {
/** @description OK */
200: {
content: {
"application/json": components$V["schemas"]["AbandonedCartSettings"];
};
};
};
};
/**
* Update email template settings
* @description Update Abandoned Cart Email template settings.
*/
updateAbandonedCartEmailTemplateSettings: {
parameters: {
query?: {
channel_id?: components$V["parameters"]["ChannelIdOptional"];
};
header: {
Accept: components$V["parameters"]["Accept"];
"Content-Type": components$V["parameters"]["ContentType"];
};
};
requestBody?: {
content: {
"application/json": components$V["schemas"]["AbandonedCartSettings"];
};
};
responses: {
/** @description OK */
200: {
content: {
"application/json": components$V["schemas"]["AbandonedCartSettings"];
};
};
};
};
}
/**
* This file was auto-generated by openapi-typescript.
* Do not make direct changes to the file.
*/
interface paths$U {
"/abandoned-carts/settings": {
/**
* Get global abandoned cart settings
* @description Return the global abandoned cart settings of a store.
*/
get: operations$U["getGlobalAbandonedCartSettings"];
/**
* Update global abandoned cart settings
* @description Update the global abandoned cart settings of a store.
*/
put: operations$U["updateGlobalAbandonedCartSettings"];
};
"/abandoned-carts/settings/channels/{channel_id}": {
/**
* Get channel abandoned cart settings
* @description Return the per-channel overrides for the abandoned cart settings of a store.
*/
get: operations$U["getChannelAbandonedCartSettings"];
/**
* Update channel abandoned cart settings
* @description Updates the per-channel overrides for the abandoned cart settings of a store.
*
* #### OAuth Scopes
* | UI Name | Permission | Parameter |
* |----------------------------------------------|------------|-----------------------------------------------|
* | Information & Settings | modify | `store_v2_information` |
*/
put: operations$U["updateChannelAbandonedCartSettings"];
};
"/abandoned-carts/{token}": {
/**
* Get an abandoned cart
* @description Return the `cart_id` corresponding to the abandoned cart `{token}` passed in.
*
* **Usage Notes**:
* * `{token}` is the token in the query string of the abandoned cart link found in abandoned cart email notifications to shoppers
*/
get: operations$U["getAbandonedCarts"];
parameters: {
header: {
Accept: components$U["parameters"]["Accept"];
};
path: {
/**
* @description Unique cart `UUID`.
*
* Unique cart `UUID` token that is generated for abandoned cart emails.
*/
token: string;
};
};
};
}
interface components$U {
schemas: {
/**
* Response meta
* @description Response metadata
*/
metaEmpty_Full: {
[key: string]: unknown;
};
/** error_Full */
error_Full: {
/**
* Format: int32
* @description The HTTP status code
*/
status?: number;
/** @description The error title describing the particular error */
title?: string;
type?: string;
};
/** errorDetailed_Full */
errorDetailed_Full: {
/** DetailedErrors */
errors?: {
[key: string]: string;
};
};
/** abandonedCartInfo_Full */
abandonedCartInfo_Full: {
/** @description The `cart_id` of the abandoned cart. Can be used to display the abandoned cart to the customer using storefront cart or server-to-server cart APIs */
cart_id?: string;
};
/** @description Represents all settings related to the abandoned cart functionality of a store */
AbandonedCartSettings: {
/** @description Indicates whether or not abandoned cart notification is on */
enable_notification?: boolean;
/** @description Indicates whether or not a customer should continue to receive abandoned cart emails until their cart is recovered */
email_customer_until_cart_is_recovered?: boolean;
/** @description Indicates whether or not a customer should receive abandoned cart emails based on their consent. By default customers will not receive emails */
marketing_emails_require_customer_consent?: boolean;
/** @description Indicates whether or not a merchant should receive a notification email when a cart is converted into an order */
email_merchant_when_cart_is_converted?: boolean;
/** @description Indicates whether or not a merchant should receive a notification email when a cart is abandoned */
email_merchant_when_cart_is_abandoned?: boolean;
/**
* Format: email
* @description The email address for receiving merchant notifications
*/
merchant_email_address?: string;
/**
* @description Indicates whether to send an email for every abandoned cart, or to send a digest email after X number of abandoned carts
* @enum {string}
*/
merchant_abandoned_cart_email_frequency_type?: "digest" | "individual";
/**
* Format: int32
* @description The number of abandoned carts to accumulate before a digest email is sent to a merchant
*/
merchant_abandoned_cart_digest_email_frequency?: number;
};
/** @description Represents all settings overrides related to the abandoned cart functionality of a store for a channel */
ChannelAbandonedCartSettings: {
/** @description Indicates whether or not abandoned cart notification is on. If it is null, it means there is no override for the specified channel. */
enable_notification?: boolean | null;
/** @description Indicates whether or not a customer should continue to receive abandoned cart emails until their cart is recovered. If it is null, it means there is no override for the specified channel. */
email_customer_until_cart_is_recovered?: boolean | null;
/** @description Indicates whether or not a customer should receive abandoned cart emails based on their consent. If it is null, it means there is no override for the specified channel. By default customers will not receive emails. */
marketing_emails_require_customer_consent?: boolean | null;
/** @description Indicates whether or not a merchant should receive a notification email when a cart is converted into an order. If it is null, it means there is no override for the specified channel. */
email_merchant_when_cart_is_converted?: boolean | null;
/** @description Indicates whether or not a merchant should receive a notification email when a cart is abandoned. If it is null, it means there is no override for the specified channel. */
email_merchant_when_cart_is_abandoned?: boolean | null;
/**
* Format: email
* @description The email address for receiving merchant notifications. If it is null, it means there is no override for the specified channel.
*/
merchant_email_address?: string | null;
/**
* @description Indicates whether to send an email for every abandoned cart or to send a digest email after X number of abandoned carts. If it is null, it means there is no override for the specified channel.
* @enum {string|null}
*/
merchant_abandoned_cart_email_frequency_type?: "digest" | "individual" | null;
/**
* Format: int32
* @description The number of abandoned carts to accumulate before a digest email is sent to a merchant. If it is null, it means there is no override for the specified channel.
*/
merchant_abandoned_cart_digest_email_frequency?: number | null;
};
ChannelAbandonedCartSettingsRequest: components$U["schemas"]["ChannelAbandonedCartSettings"];
/** @description The response object of abandoned cart settings overrides for a channel */
ChannelAbandonedCartSettingsResponse: {
data?: components$U["schemas"]["ChannelAbandonedCartSettings"];
meta?: components$U["schemas"]["metaEmpty_Full"];
};
GlobalAbandonedCartSettingsRequest: components$U["schemas"]["AbandonedCartSettings"];
/** @description The response object of abandoned cart settings at the global level */
GlobalAbandonedCartSettingsResponse: {
data?: components$U["schemas"]["AbandonedCartSettings"];
meta?: components$U["schemas"]["metaEmpty_Full"];
};
/** @description The response object containing details of an error */
ErrorResponse: {
/** Format: int32 */
status?: number;
title?: string;
type?: string;
instance?: string;
errors?: {
[key: string]: unknown;
};
};
};
responses: {
/** @description If something happens during the request that causes it to fail, a 502 response will be returned. A new request should be made; however, it could fail. */
"502_GatewayError": {
content: {
"application/json": components$U["schemas"]["error_Full"];
};
};
/** @description If this occurs, you should retry the request. Typically retrying the request several times will result in a successful request; However, if you are unable to successfully make a request, please check the BigCommerce system status [here](https://status.bigcommerce.com/). A service is likely down and the request will need to be made again when it is back up (in several hours usually) */
"504_GatewayTimeout": {
content: {
"application/json": components$U["schemas"]["errorDetailed_Full"];
};
};
/**
* @description Malformed request syntax. Typically need to fix the JSON
* Body to resend successfully.
*/
"400_BadRequest": {
content: {
"application/json": components$U["schemas"]["error_Full"];
};
};
/** @description If the requested account resource is not found for the franchise, return a 404 Not Found. */
"404_NotFound": {
content: {
"application/json": components$U["schemas"]["error_Full"];
};
};
/** @description This occurs when missing or unacceptable data is passed for one or more fields. Please correct the values for the fields listed in the errors object. */
"422_UnprocessableEntity": {
content: {
"application/json": components$U["schemas"]["errorDetailed_Full"];
};
};
/** @description If this occurs, you should retry the request. If you are unable to successfully make a request, please check the BigCommerce system status [here](https://status.bigcommerce.com/). A service is likely down and the request will need to be made again when it is back up (in several hours usually) */
"503_ServiceUnavailable": {
content: {
"application/json": components$U["schemas"]["error_Full"];
};
};
/** @description Returned on `GET` requests to `/abandoned_carts`. */
abandonedCart_Resp: {
content: {
"application/json": {
data?: components$U["schemas"]["abandonedCartInfo_Full"];
meta?: components$U["schemas"]["metaEmpty_Full"];
};
};
};
};
parameters: {
/** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body. */
Accept: string;
/** @description The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the request body. */
ContentType: string;
};
requestBodies: never;
headers: never;
pathItems: never;
}
interface operations$U {
/**
* Get global abandoned cart settings
* @description Return the global abandoned cart settings of a store.
*/
getGlobalAbandonedCartSettings: {
parameters: {
query?: {
/** @description How many pages to return */
pagination?: number;
};
};
responses: {
/** @description OK */
200: {
content: {
"application/json": components$U["schemas"]["GlobalAbandonedCartSettingsResponse"];
};
};
/** @description Unauthorized */
401: {
content: {
"application/json": components$U["schemas"]["ErrorResponse"];
};
};
};
};
/**
* Update global abandoned cart settings
* @description Update the global abandoned cart settings of a store.
*/
updateGlobalAbandonedCartSettings: {
parameters: {
header: {
"Content-Type": components$U["parameters"]["ContentType"];
Accept: components$U["parameters"]["Accept"];
};
};
requestBody: {
content: {
"application/json": components$U["schemas"]["GlobalAbandonedCartSettingsRequest"];
};
};
responses: {
/** @description OK */
200: {
content: {
"application/json": components$U["schemas"]["GlobalAbandonedCartSettingsResponse"];
};
};
/** @description Unauthorized */
401: {
content: {
"application/json": components$U["schemas"]["ErrorResponse"];
};
};
/** @description Unprocessable entity */
422: {
content: {
"application/json": components$U["schemas"]["ErrorResponse"];
};
};
};
};
/**
* Get channel abandoned cart settings
* @description Return the per-channel overrides for the abandoned cart settings of a store.
*/
getChannelAbandonedCartSettings: {
parameters: {
path: {
/** @description The channel ID of the settings overrides */
channel_id: number;
};
};
responses: {
/** @description OK */
200: {
content: {
"application/json": components$U["schemas"]["ChannelAbandonedCartSettingsResponse"];
};
};
/** @description Unauthorized */
401: {
content: {
"application/json": components$U["schemas"]["ErrorResponse"];
};
};
};
};
/**
* Update channel abandoned cart settings
* @description Updates the per-channel overrides for the abandoned cart settings of a store.
*
* #### OAuth Scopes
* | UI Name | Permission | Parameter |
* |----------------------------------------------|------------|-----------------------------------------------|
* | Information & Settings | modify | `store_v2_information` |
*/
updateChannelAbandonedCartSettings: {
parameters: {
header: {
"Content-Type": components$U["parameters"]["ContentType"];
Accept: components$U["parameters"]["Accept"];
};
path: {
/** @description The channel ID of the settings overrides */
channel_id: number;
};
};
requestBody: {
content: {
"application/json": components$U["schemas"]["ChannelAbandonedCartSettingsRequest"];
};
};
responses: {
/** @description OK */
200: {
content: {
"application/json": components$U["schemas"]["ChannelAbandonedCartSettingsResponse"];
};
};
/** @description Unauthorized */
401: {
content: {
"application/json": components$U["schemas"]["ErrorResponse"];
};
};
/** @description Unprocessable entity */
422: {
content: {
"application/json": components$U["schemas"]["ErrorResponse"];
};
};
};
};
/**
* Get an abandoned cart
* @description Return the `cart_id` corresponding to the abandoned cart `{token}` passed in.
*
* **Usage Notes**:
* * `{token}` is the token in the query string of the abandoned cart link found in abandoned cart email notifications to shoppers
*/
getAbandonedCarts: {
parameters: {
header: {
Accept: components$U["parameters"]["Accept"];
};
path: {
/**
* @description Unique cart `UUID`.
*
* Unique cart `UUID` token that is generated for abandoned cart emails.
*/
token: string;
};
};
responses: {
200: components$U["responses"]["abandonedCart_Resp"];
400: components$U["responses"]["400_BadRequest"];
404: components$U["responses"]["404_NotFound"];
422: components$U["responses"]["422_UnprocessableEntity"];
502: components$U["responses"]["502_GatewayError"];
503: components$U["responses"]["503_ServiceUnavailable"];
504: components$U["responses"]["504_GatewayTimeout"];
default: {
content: never;
};
};
};
}
/**
* This file was auto-generated by openapi-typescript.
* Do not make direct changes to the file.
*/
/** OneOf type helpers */
type Without$4<T, U> = {
[P in Exclude<keyof T, keyof U>]?: never;
};
type XOR$4<T, U> = (T | U) extends object ? (Without$4<T, U> & U) | (Without$4<U, T> & T) : T | U;
type OneOf$4<T extends any[]> = T extends [infer Only] ? Only : T extends [infer A, infer B, ...infer Rest] ? OneOf$4<[XOR$4<A, B>, ...Rest]> : never;
interface paths$T {
"/carts": {
/**
* Create a Cart
* @description Creates a **Cart**.
*
* **Required Fields**
*
* |Field|Details|
* |-|-|
* |`line_item`|Specifies a line item.|
* |`custom_items`|Specifies a custom item. Only required if adding a custom item to the cart.|
* |`gift_certificates`|Specifies a gift certificate. Only required if adding a gift certificate to the cart.|
*
* **Usage Notes**
*
* * A **cart** `id` (UUID) is returned in the response.
* * A **cart** `id` is the same as a **checkout** `id`.
* * A cart can be created by adding an existing **catalog item** or a **custom item**.
* * Carts are valid for **30 days** from the **last modification** (this includes creating the cart or editing the cart).
* * If a product has modifiers, use the `option_selections` array to describe the **modifier** selection(s).
* * The format and data type of a cart’s `option_value` are defined by the `value_data` object of a product’s [variant option value](/docs/rest-catalog/product-variant-options/values), [modifier value](/docs/rest-catalog/product-modifiers/values), or a combination of both.
* * Redirect URLs can only be generated from carts that were created using the **REST Management API**.
* * To get cart `redirect_urls` in the response, append the following query parameter to the request URL: `include=redirect_urls`. Redirect URLs point to either a shared checkout domain or a channel-specific domain, depending on the storefront configuration.
* * To restore a cart that was created by a shopper or through a Storefront API, first recreate the cart using the **REST Management API**.
* * To get cart `promotions` in the response, append the following query parameter to the request URL: `include=promotions.banners`.
*/
post: operations$T["createCart"];
parameters: {
header: {
Accept: components$T["parameters"]["Accept"];
};
};
};
"/carts/{cartId}/items": {
/**
* Add Cart Line Items
* @description Adds line item to the *Cart*.
*
* **Usage Notes**
*
* To add a custom item use `custom_items`.
*
* By default, overriding a product's list_price makes it ineligible for V3 product-level promotions. In **Store Settings** under **Promotions and Coupons** in the control panel, you can change this behavior to allow promotions on overridden prices.
*
* If a product has modifiers, omit the `variant_id` and instead use the `option_selections` array to describe both the **variant** and the **modifier** selections.
*
* To prevent lost updates due to concurrent requests overriding changes made by others, it is recommended to enable optimistic concurrency control by including the `version` field in the request payload. If the provided version does not match the version on the server, a conflict error will be returned, which the client can handle accordingly.
*/
post: operations$T["addCartLineItems"];
parameters: {
header: {
Accept: components$T["parameters"]["Accept"];
"Content-Type": components$T["parameters"]["ContentType"];
};
path: {
cartId: components$T["parameters"]["cartId"];
};
};
};
"/carts/{cartId}/redirect_urls": {
/**
* Create Cart Redirect URL
* @description Creates a **Cart** redirect URL for redirecting a shopper to an already created cart using the `cartId`.
*
* **Usage Notes**
*
* * To use redirect URLs, first create the cart using the REST Management API or GraphQL Storefront API.
* * Redirect URLs can also be created with **Create a Cart** requests by appending `include=redirect_urls`.
* * A **Carts** redirect URL is valid for 30 days and may only be used once.
* * Redirect URLs point to either a shared checkout domain or a channel-specific domain, depending on the storefront configuration.
* * Once a redirect URL has been visited, it will be invalidated and cannot be used again.
* * If your application requires URLs to be visited more than once, consider generating a fresh one each time you need to restore a cart, and redirecting to the URL from your own application.
* * To restore a cart that was created on the storefront, either by a shopper or a Storefront API, first recreate the cart using the **REST Management API**.
* * When redirecting the shopper, you can add a set of `query_params` to the URL. The `query_params` feature allows passing additional information to the redirect URL.
*/
post: operations$T["createCartRedirectURL"];
parameters: {
header: {
Accept: components$T["parameters"]["Accept"];
"Content-Type": components$T["parameters"]["ContentType"];
};
path: {
cartId: components$T["parameters"]["cartId"];
};
};
};
"/carts/{cartId}/items/{itemId}": {
/**
* Update Cart Line Item
* @description Updates an existing, single line item in the *Cart*.
*
* **Notes**
*
* Currently, only updating `list_price` and `quantity` are supported. By default, overriding a product's list_price makes it ineligible for V3 product-level promotions. In **Store Settings** under **Promotions and Coupons** in the control panel, you can change this behavior to allow promotions on overridden prices.
*
* If the product has modifiers, omit the `variant_id` and instead use the `option_selections` array to describe both the **variant** and the **modifier** selections.
*
* If a variant needs to be changed or updated, the product will need to be removed and re-added to the cart with the correct variants using the **Add Cart Line Items** endpoint.
*
* `custom_items` cannot be updated via the API at this time. To update your cart, add a new updated custom item and delete the outdated one. If your cart contains only one line item, perform the add operation before the delete operation.
*
* Deleting all line items from the cart will invalidate the cart.
*
* To prevent lost updates due to concurrent requests overriding changes made by others, it is recommended to enable optimistic concurrency control by including the `version` field in the request payload. If the provided version does not match the version on the server, a conflict error will be returned, which the client can handle accordingly.
*/
put: operations$T["updateCartLineItem"];
/**
* Delete Cart Line Item
* @description Deletes a *Cart* line item.
*
* **Notes**
*
* Removing the last `line_item` in the *Cart* deletes the *Cart*.
*
* To prevent lost updates due to concurrent requests overriding changes made by others, it is recommended to enable optimistic concurrency control by including the `version` field in the request payload. If the provided version does not match the version on the server, a conflict error will be returned, which the client can handle accordingly.
*/
delete: operations$T["deleteCartLineItem"];
parameters: {
header: {
Accept: components$T["parameters"]["Accept"];
};
path: {
cartId: components$T["parameters"]["cartId"];
itemId: string;
};
};
};
"/carts/{cartId}": {
/**
* Get a Cart
* @description Returns a storeʼs *Cart*.
*/
get: operations$T["getCart"];
/**
* Update Customer ID
* @description Updates a *Cartʼs* `customer_id`.
*
* **Notes**
*
* Changing the *Cart* `customer_id` will remove any promotions or shipping calculations on the *Cart*. These are tied to the customer depending on cart conditions and any customer groups.
*
* To prevent lost updates due to concurrent requests overriding changes made by others, it is recommended to enable optimistic concurrency control by including the `version` field in the request payload. If the provided version does not match the version on the server, a conflict error will be returned, which the client can handle accordingly.
*/
put: operations$T["updateCart"];
/**
* Delete a Cart
* @description Deletes a *Cart*. Once a *Cart* has been deleted it can’t be recovered.
*/
delete: operations$T["deleteCart"];
parameters: {
header: {
Accept: components$T["parameters"]["Accept"];
};
path: {
cartId: components$T["parameters"]["cartId"];
};
};
};
"/carts/settings": {
/**
* Get Global Cart Settings
* @description Returns the global cart settings of a store.
*
* ### OAuth scopes
*
* | UI Name | Permission | Parameter |
* |:--------|:-----------|:----------|
* |Information & Settings | modify | `store_v2_information`|
* |Information & Settings | read-only| `store_v2_information`|
*/
get: operations$T["getGlobalCartSettings"];
/**
* Update Global Cart Settings
* @description Update the global cart settings of a store.
* *Authentication*
* ### OAuth scopes
*
* | UI Name | Permission | Parameter |
* |:--------|:-----------|:----------|
* |Information & Settings | modify | `store_v2_information`|
* |Information & Settings | read-only| `store_v2_information`|
*/
put: operations$T["updateGlobalCartSettings"];
parameters: {
header: {
Accept: components$T["parameters"]["Accept"];
};
};
};
"/carts/settings/channels/{channel_id}": {
/**
* Get Channel Cart Settings
* @description Returns the per-channel overrides for the cart settings of a store.
*
* ### OAuth scopes
*
* | UI Name | Permission | Parameter |
* |:--------|:-----------|:----------|
* |Information & Settings | modify | `store_v2_information`|
* |Information & Settings | read-only| `store_v2_information`|
*/
get: operations$T["getChannelCartSettings"];
/**
* Update Channel Cart Settings
* @description Update the per-channel overrides for the cart settings of a store.
*
* ### OAuth scopes
*
* | UI Name | Permission | Parameter |
* |:--------|:-----------|:----------|
* |Information & Settings | modify | `store_v2_information`|
* |Information & Settings | read-only| `store_v2_information`|
*/
put: operations$T["updateChannelCartSettings"];
parameters: {
header: {
Accept: components$T["parameters"]["Accept"];
};
path: {
/**
* @description The channel ID of the settings overrides.
*
* ### OAuth scopes
*
* | UI Name | Permission | Parameter |
* |:--------|:-----------|:----------|
* |Information & Settings | modify | `store_v2_information`|
* |Information & Settings | read-only| `store_v2_information`|
*/
channel_id: number;
};
};
};
"/carts/{cart_id}/metafields": {
/**
* Get Cart Metafields
* @description Get a cart's metafields.
*/
get: operations$T["getCartMetafields"];
/**
* Create a Cart Metafield
* @description Create a cart `Metafield`.
*
* If you create an order from a Cart, you can continue referencing the Cart Metafields even if you delete the original Cart. Use the `cart_id` field on the Order to construct the Cart Metafield endpoint.
*/
post: operations$T["createCartMetafield"];
parameters: {
header: {
Accept: components$T["parameters"]["Accept"];
};
path: {
cart_id: components$T["parameters"]["cart_id"];
};
};
};
"/carts/{cart_id}/metafields/{metafield_id}": {
/**
* Get a Cart Metafield
* @description Gets a cart metafield.
*/
get: operations$T["getCartMetafield"];
/**
* Update a Cart Metafield
* @description Update a `Metafield`, by `cart_id`.
*/
put: operations$T["updateCartMetafield"];
/**
* Delete a Metafield
* @description Deletes a `Metafield`.
*/
delete: operations$T["deleteCartMetafield"];
parameters: {
header: {
Accept: components$T["parameters"]["Accept"];
};
path: {
cart_id: components$T["parameters"]["cart_id"];
/** @description The unique ID of the subject `Metafield`. */
metafield_id: number;
};
};
};
"/carts/metafields": {
/**
* Get All Cart Metafields
* @description Get all cart metafields.
*/
get: operations$T["getCartsMetafields"];
/**
* Update multiple Metafields
* @description Create multiple metafields.
*/
put: operations$T["updateCartsMetafields"];
/**
* Create multiple Metafields
* @description Create multiple metafields.
*/
post: operations$T["createCartsMetafields"];
/**
* Delete multiple Metafields
* @description Delete all cart metafields.
*/
delete: operations$T["deleteCartsMetafields"];
};
}
interface components$T {
schemas: {
/** Cart Update Request */
CartUpdateRequest: {
/** Line Item Request Data */
line_item?: {
quantity: number;
product_id: number;
/** @description The variant ID. Required if the product has variants. */
variant_id: number;
list_price?: number;
option_selections?: {
option_id?: number;
option_value?: string;
}[];
};
/** Line Item Gift Certificate Request Data */
gift_certificate?: {
/** @description Given name for the gift certificate line item. */
name: string;
/**
* @description The theme of the gift certificate.
* @enum {string}
*/
theme: "Birthday" | "Boy" | "Celebration" | "Christmas" | "General" | "Girl";
amount: number;
quantity: number;
/** Contact Entity */
sender: {
name?: string;
email?: string;
};
/** Contact Entity */
recipient: {
name?: string;
email?: string;
};
/** @description Message shown to recipient, as provided by sender. */
message?: string;
};
};
/** Cart Create Post Data */
CartCreatePostData: {
customer_id?: number;
line_items?: (components$T["schemas"]["cart_PostVariant"] | components$T["schemas"]["cart_PostModifier"])[];
custom_items?: components$T["schemas"]["cart_PostCustomItem"];
gift_certificates?: ({
/** @description Given name for the gift certificate line item. */
name: string;
/**
* @description The theme of the gift certificate.
* @enum {string}
*/
theme: "Birthday" | "Boy" | "Celebration" | "Christmas" | "General" | "Girl";
amount: number;
quantity: number;
/** Contact Entity */
sender: {
name?: string;
email?: string;
};
/** Contact Entity */
recipient: {
name?: string;
email?: string;
};
/** @description Message shown to recipient, as provided by sender. */
message?: string;
})[];
/** @description The Channel ID. If no channel is specified, defaults to 1. */
channel_id?: number;
currency?: {
/**
* Format: ISO-4217
* @description The [transactional currency](/docs/rest-management/currencies#definitions) code for the cart, formatted as an [ISO-4217](https://www.iso.org/iso-4217-currency-codes.html) string. This code is required when multi-currency is enabled. Passing a non-transactional display currency will result in a `400` error.
* @example usd
*/
code?: string;
};
/**
* Format: ISO-639
* @description The locale of the cart. Accepts strings of format `xx` or `xx-YY`. Uses the