import { BaseClient, ClientConfig, Response } from "@commerce-apps/core"; import type { CommonParameters } from "@commerce-apps/core"; import type { OperationOptions } from "retry"; import type { RequestInit } from "node-fetch"; import type { CompositeParameters, CustomRequestBody, QueryParameters, RequireParametersUnlessAllAreOptional } from "../../types"; import type { Basket, FailOrderRequest, LocaleCode, OmsCancelOrderRequest, OmsMetaData, OmsReturnOrderRequest, Order, OrderLookupRequest, OrderPaymentInstrumentRequest, PaymentMethodResult, RequestOrderAccessCodeRequest, Taxes } from '../models/index'; export type CancelOmsOrderSfdcDwDntEnum = '0' | '1'; export type CreateOrderSfdcDwDntEnum = '0' | '1'; export type CreatePaymentInstrumentForOrderSfdcDwDntEnum = '0' | '1'; export type FailOrderOperationSfdcDwDntEnum = '0' | '1'; export type GetOmsMetaDataSfdcDwDntEnum = '0' | '1'; export type GetOmsMetaDataPersonalizedEnum = 'none'; export type GetOrderExpandEnum = 'oms' | 'oms_shipments'; export type GetOrderSfdcDwDntEnum = '0' | '1'; export type GetOrderPersonalizedEnum = 'none'; export type GetPaymentMethodsForOrderSfdcDwDntEnum = '0' | '1'; export type GetPaymentMethodsForOrderPersonalizedEnum = 'none'; export type GetTaxesFromOrderPersonalizedEnum = 'none'; export type GuestOrderLookupExpandEnum = 'oms' | 'oms_shipments'; export type GuestOrderLookupSfdcDwDntEnum = '0' | '1'; export type RemovePaymentInstrumentFromOrderSfdcDwDntEnum = '0' | '1'; export type RequestOrderAccessCodeOperationExpandEnum = 'oms'; export type RequestOrderAccessCodeOperationSfdcDwDntEnum = '0' | '1'; export type ReturnOmsOrderSfdcDwDntEnum = '0' | '1'; export type UpdatePaymentInstrumentForOrderSfdcDwDntEnum = '0' | '1'; /** * [Shopper Orders](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-orders:Summary) * ================================== * * *[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/shopper-orders/shopper-orders-oas-v1-public.yaml) # API Overview The Shopper Orders API enables you to: - Create orders based on baskets prepared using the Shopper Baskets API. - Add a customer's payment instrument to an order. You can choose to supply the full payment information or supply only a customer payment instrument ID and amount. If the customer payment instrument ID is set, all the other properties (except amount) are ignored and the payment data is resolved from the stored customer payment information. **Note:** The API doesn’t allow the storage of credit card numbers. The endpoint provides the storage of masked credit card numbers only. To update the payment status, use the Orders API. Responses from this API are not cached because order data is transactional and unique to each shopper. For additional guidance when working with baskets, see [Build Baskets and Place Orders](https://developer.salesforce.com/docs/commerce/commerce-api/guide/work-with-baskets-orders.html). ## Authentication & Authorization The client requesting order information must have access to the Orders resource. The Shopper Orders API requires a shopper access token from the Shopper Login and API Access Service (SLAS). For details on how to request a shopper access token from SLAS, see the guest user flows for [public clients](https://developer.salesforce.com/docs/commerce/commerce-api/guide/slas-public-client.html#guest-user) and [private clients](https://developer.salesforce.com/docs/commerce/commerce-api/guide/slas-private-client.html#guest-user) in the SLAS guides. You must include `sfcc.shopper-baskets-orders` or `sfcc.shopper-baskets-orders.rw` in the client ID used to generate the SLAS token. For a full list of permissions, see the [Authorization Scopes Catalog.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/auth-z-scope-catalog.html) ## Customization ### Custom Properties This API supports custom properties (prefixed with `c_`). For details, see [Custom Properties.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/custom-properties.html) ### Hooks For details on working with hooks, see [Extensibility with Hooks.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/extensibility_via_hooks.html) ## Response Details ### Personalization Responses from this API are not personalized via the Shopper Context API. ### Caching Responses from this API are not cached. Order data is transactional and unique to each shopper. ### Timeouts Shopper API requests must respond within 10 seconds, including any hook execution. If a response exceeds this threshold, an HTTP 504 status code is returned. For details, see [Timeouts and Limits.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/timeouts-limits.html) ### Error Handling Error responses follow the [RFC 7807](https://datatracker.ietf.org/doc/html/rfc7807) problem detail format. To trace errors, include a `correlation-id` header in your request — the response returns it as `x-correlation-id`. For details, see [HTTP Status Codes and Errors.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/error-response-codes.html) ## Use Cases ### Create an Order from a Basket Place an order by providing a basket ID. The basket must have a valid shipping address, shipping method, billing address, and payment instrument. ```sh curl "https://{shortCode}.api.commercecloud.salesforce.com/checkout/shopper-orders/v1/organizations/{organizationId}/orders?siteId=RefArch" \ -X POST \ -H "Authorization: Bearer {access_token}" \ -H "Content-Type: application/json" \ -d '{ "basketId": "{basketId}" }' ``` ## Related APIs - [Orders (Admin)](https://developer.salesforce.com/docs/commerce/commerce-api/references/orders?meta=Summary) — Update order status, payment status, and shipping addresses. - [Shopper Baskets](https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-baskets-v2?meta=Summary) — Build and manage baskets before placing an order.*
* * For instructions on how to retrieve access token for admin APIs: https://developer.salesforce.com/docs/commerce/commerce-api/guide/authorization-for-admin-apis.html

* Example with admin auth * * ```typescript * import { ShopperOrders, ClientConfig } from "commerce-sdk"; * // or * const { ShopperOrders, ClientConfig } = require("commerce-sdk"); * * const clientConfig: ClientConfig = { * parameters: { * clientId: "XXXXXX", * organizationId: "XXXX", * shortCode: "XXX", * siteId: "XX" * } * }; * * token = { access_token: 'INSERT_ACCESS_TOKEN_HERE' }; * * clientConfig.headers['authorization'] = `Bearer ${token.access_token}`; * const shopperOrdersClient = new ShopperOrders(clientConfig); * ``` * * * API Version: 1.4.4
* Last Updated:
*
* */ export declare class ShopperOrders extends BaseClient { constructor(config: ClientConfig); /** * Cancels an order that is integrated with Order Management (OMS). The cancellation always applies to the entire order; partial cancellations are not supported. * * If you would like to get a raw Response object use the other cancelOmsOrder function. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.orderNo - The order number of the order to be modified. * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param options.body - The data to send as the request body. * * @returns A promise of type Order. */ cancelOmsOrder(options: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; orderNo: string; siteId: string; locale?: LocaleCode; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; body: OmsCancelOrderRequest & CustomRequestBody; }>): Promise; /** * Cancels an order that is integrated with Order Management (OMS). The cancellation always applies to the entire order; partial cancellations are not supported. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.orderNo - The order number of the order to be modified. * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param options.body - The data to send as the request body. * @param rawResponse - Set to true to return entire Response object instead of DTO. * * @returns A promise of type Response if rawResponse is true, a promise of type Order otherwise. */ cancelOmsOrder(options: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; orderNo: string; siteId: string; locale?: LocaleCode; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; body: OmsCancelOrderRequest & CustomRequestBody; }>, rawResponse?: T): Promise; /** * Submits an order based on a prepared basket. The only considered value from the request body is basketId. * * If you would like to get a raw Response object use the other createOrder function. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param options.body - The data to send as the request body. * * @returns A promise of type Order. */ createOrder(options: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; siteId: string; locale?: LocaleCode; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; body: Basket & CustomRequestBody; }>): Promise; /** * Submits an order based on a prepared basket. The only considered value from the request body is basketId. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param options.body - The data to send as the request body. * @param rawResponse - Set to true to return entire Response object instead of DTO. * * @returns A promise of type Response if rawResponse is true, a promise of type Order otherwise. */ createOrder(options: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; siteId: string; locale?: LocaleCode; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; body: Basket & CustomRequestBody; }>, rawResponse?: T): Promise; /** * Adds a payment instrument to an order. Details: The payment instrument is added with the provided details. The payment method must be applicable for the order see GET /baskets/{basketId}/payment-methods, if the payment method is 'CREDIT_CARD' a paymentCard must be specified in the request. * * If you would like to get a raw Response object use the other createPaymentInstrumentForOrder function. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.orderNo - The order number of the order to be modified. * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param options.body - The data to send as the request body. * * @returns A promise of type Order. */ createPaymentInstrumentForOrder(options: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; orderNo: string; siteId: string; locale?: LocaleCode; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; body: OrderPaymentInstrumentRequest & CustomRequestBody; }>): Promise; /** * Adds a payment instrument to an order. Details: The payment instrument is added with the provided details. The payment method must be applicable for the order see GET /baskets/{basketId}/payment-methods, if the payment method is 'CREDIT_CARD' a paymentCard must be specified in the request. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.orderNo - The order number of the order to be modified. * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param options.body - The data to send as the request body. * @param rawResponse - Set to true to return entire Response object instead of DTO. * * @returns A promise of type Response if rawResponse is true, a promise of type Order otherwise. */ createPaymentInstrumentForOrder(options: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; orderNo: string; siteId: string; locale?: LocaleCode; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; body: OrderPaymentInstrumentRequest & CustomRequestBody; }>, rawResponse?: T): Promise; /** * Fails an unplaced order and optionally reopens the basket when indicated. Creates a HistoryEntry in the failed Order with provided reasonCode. * * If you would like to get a raw Response object use the other failOrder function. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.orderNo - The order number of the order to be modified. * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified. * @param options.parameters.reopenBasket - Set to true to reopen basket from the order. A basket can only be reopened if no other basket for the customer exists at the moment of the call to fail Order, since a customer is limited to 1 storefront basket at a time. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param options.body - The data to send as the request body. * * @returns A promise of type void. */ failOrder(options: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; orderNo: string; siteId: string; locale?: LocaleCode; reopenBasket?: boolean; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; body: FailOrderRequest & CustomRequestBody; }>): Promise; /** * Fails an unplaced order and optionally reopens the basket when indicated. Creates a HistoryEntry in the failed Order with provided reasonCode. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.orderNo - The order number of the order to be modified. * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified. * @param options.parameters.reopenBasket - Set to true to reopen basket from the order. A basket can only be reopened if no other basket for the customer exists at the moment of the call to fail Order, since a customer is limited to 1 storefront basket at a time. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param options.body - The data to send as the request body. * @param rawResponse - Set to true to return entire Response object instead of DTO. * * @returns A promise of type Response if rawResponse is true, a promise of type void otherwise. */ failOrder(options: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; orderNo: string; siteId: string; locale?: LocaleCode; reopenBasket?: boolean; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; body: FailOrderRequest & CustomRequestBody; }>, rawResponse?: T): Promise; /** * Retrieves configuration data from Order Management (OMS) required by the storefront to render cancel and return experiences. The response contains the reason codes configured in OMS for cancelling an order and for returning order items. Each reason code carries a `default` flag. When the caller omits a reason, the cancel and return endpoints (`cancelOmsOrder`, `returnOmsOrder`) apply the reason marked as `default` for that flow. * * If you would like to get a raw Response object use the other getOmsMetaData function. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.parameters.personalized - Controls whether personalization is applied to the response. Set to `none` to opt out of personalized response handling so the response is safe to cache at the CDN layer. When set to `none`, the server skips applying personalization to the response. Setting `personalized=none` is necessary but not sufficient for CDN caching: a response is only cached when the endpoint is also cacheable in the [server-side web-tier cache](https://developer.salesforce.com/docs/commerce/commerce-api/guide/server-side-web-tier-caching.html), subject to its TTLs and invalidation. A call that is uncacheable in the web tier is not cached at the CDN either. See [CDN caching](https://developer.salesforce.com/docs/commerce/commerce-api/guide/cdn-caching.html). * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * * @returns A promise of type OmsMetaData. */ getOmsMetaData(options?: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; siteId: string; personalized?: GetOmsMetaDataPersonalizedEnum; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; }>): Promise; /** * Retrieves configuration data from Order Management (OMS) required by the storefront to render cancel and return experiences. The response contains the reason codes configured in OMS for cancelling an order and for returning order items. Each reason code carries a `default` flag. When the caller omits a reason, the cancel and return endpoints (`cancelOmsOrder`, `returnOmsOrder`) apply the reason marked as `default` for that flow. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.parameters.personalized - Controls whether personalization is applied to the response. Set to `none` to opt out of personalized response handling so the response is safe to cache at the CDN layer. When set to `none`, the server skips applying personalization to the response. Setting `personalized=none` is necessary but not sufficient for CDN caching: a response is only cached when the endpoint is also cacheable in the [server-side web-tier cache](https://developer.salesforce.com/docs/commerce/commerce-api/guide/server-side-web-tier-caching.html), subject to its TTLs and invalidation. A call that is uncacheable in the web tier is not cached at the CDN either. See [CDN caching](https://developer.salesforce.com/docs/commerce/commerce-api/guide/cdn-caching.html). * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param rawResponse - Set to true to return entire Response object instead of DTO. * * @returns A promise of type Response if rawResponse is true, a promise of type OmsMetaData otherwise. */ getOmsMetaData(options?: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; siteId: string; personalized?: GetOmsMetaDataPersonalizedEnum; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; }>, rawResponse?: T): Promise; /** * Gets information for an order. * * If you would like to get a raw Response object use the other getOrder function. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.orderNo - The order number of the order to be modified. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified. * @param options.parameters.expand - When you select 'oms' expand, data is loaded from Order Management (OMS), if available. When OMS data is available, the expand parameter has the following behavior: "expand=oms": order and related order entities (product & shipping items, delivery groups and price adjustments) are returned. "expand=oms_shipments": order and fulfillment (shipment) data is returned. "expand=oms,oms_shipments": order, related order entities and fulfillment (shipment) data are returned. If your instance is not integrated with OMS or the order data is not available, the `expand=oms` command is disregarded. * @param options.parameters.personalized - Controls whether personalization is applied to the response. Set to `none` to opt out of personalized response handling so the response is safe to cache at the CDN layer. When set to `none`, the server skips applying personalization to the response. Setting `personalized=none` is necessary but not sufficient for CDN caching: a response is only cached when the endpoint is also cacheable in the [server-side web-tier cache](https://developer.salesforce.com/docs/commerce/commerce-api/guide/server-side-web-tier-caching.html), subject to its TTLs and invalidation. A call that is uncacheable in the web tier is not cached at the CDN either. See [CDN caching](https://developer.salesforce.com/docs/commerce/commerce-api/guide/cdn-caching.html). * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * * @returns A promise of type Order. */ getOrder(options?: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ orderNo: string; organizationId: string; siteId: string; locale?: LocaleCode; expand?: Array; personalized?: GetOrderPersonalizedEnum; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; }>): Promise; /** * Gets information for an order. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.orderNo - The order number of the order to be modified. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified. * @param options.parameters.expand - When you select 'oms' expand, data is loaded from Order Management (OMS), if available. When OMS data is available, the expand parameter has the following behavior: "expand=oms": order and related order entities (product & shipping items, delivery groups and price adjustments) are returned. "expand=oms_shipments": order and fulfillment (shipment) data is returned. "expand=oms,oms_shipments": order, related order entities and fulfillment (shipment) data are returned. If your instance is not integrated with OMS or the order data is not available, the `expand=oms` command is disregarded. * @param options.parameters.personalized - Controls whether personalization is applied to the response. Set to `none` to opt out of personalized response handling so the response is safe to cache at the CDN layer. When set to `none`, the server skips applying personalization to the response. Setting `personalized=none` is necessary but not sufficient for CDN caching: a response is only cached when the endpoint is also cacheable in the [server-side web-tier cache](https://developer.salesforce.com/docs/commerce/commerce-api/guide/server-side-web-tier-caching.html), subject to its TTLs and invalidation. A call that is uncacheable in the web tier is not cached at the CDN either. See [CDN caching](https://developer.salesforce.com/docs/commerce/commerce-api/guide/cdn-caching.html). * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param rawResponse - Set to true to return entire Response object instead of DTO. * * @returns A promise of type Response if rawResponse is true, a promise of type Order otherwise. */ getOrder(options?: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ orderNo: string; organizationId: string; siteId: string; locale?: LocaleCode; expand?: Array; personalized?: GetOrderPersonalizedEnum; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; }>, rawResponse?: T): Promise; /** * Gets the applicable payment methods for an existing order considering the open payment amount only. * * If you would like to get a raw Response object use the other getPaymentMethodsForOrder function. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.orderNo - The order number of the order to be modified. * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified. * @param options.parameters.personalized - Controls whether personalization is applied to the response. Set to `none` to opt out of personalized response handling so the response is safe to cache at the CDN layer. When set to `none`, the server skips applying personalization to the response. Setting `personalized=none` is necessary but not sufficient for CDN caching: a response is only cached when the endpoint is also cacheable in the [server-side web-tier cache](https://developer.salesforce.com/docs/commerce/commerce-api/guide/server-side-web-tier-caching.html), subject to its TTLs and invalidation. A call that is uncacheable in the web tier is not cached at the CDN either. See [CDN caching](https://developer.salesforce.com/docs/commerce/commerce-api/guide/cdn-caching.html). * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * * @returns A promise of type PaymentMethodResult. */ getPaymentMethodsForOrder(options?: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; orderNo: string; siteId: string; locale?: LocaleCode; personalized?: GetPaymentMethodsForOrderPersonalizedEnum; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; }>): Promise; /** * Gets the applicable payment methods for an existing order considering the open payment amount only. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.orderNo - The order number of the order to be modified. * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified. * @param options.parameters.personalized - Controls whether personalization is applied to the response. Set to `none` to opt out of personalized response handling so the response is safe to cache at the CDN layer. When set to `none`, the server skips applying personalization to the response. Setting `personalized=none` is necessary but not sufficient for CDN caching: a response is only cached when the endpoint is also cacheable in the [server-side web-tier cache](https://developer.salesforce.com/docs/commerce/commerce-api/guide/server-side-web-tier-caching.html), subject to its TTLs and invalidation. A call that is uncacheable in the web tier is not cached at the CDN either. See [CDN caching](https://developer.salesforce.com/docs/commerce/commerce-api/guide/cdn-caching.html). * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param rawResponse - Set to true to return entire Response object instead of DTO. * * @returns A promise of type Response if rawResponse is true, a promise of type PaymentMethodResult otherwise. */ getPaymentMethodsForOrder(options?: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; orderNo: string; siteId: string; locale?: LocaleCode; personalized?: GetPaymentMethodsForOrderPersonalizedEnum; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; }>, rawResponse?: T): Promise; /** * This method gives you the external taxation data of the order transferred from the basket during order creation. This endpoint can be called only if external taxation was used. See POST /baskets for more information. * * If you would like to get a raw Response object use the other getTaxesFromOrder function. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.orderNo - The order number of the order to be modified. * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.parameters.personalized - Controls whether personalization is applied to the response. Set to `none` to opt out of personalized response handling so the response is safe to cache at the CDN layer. When set to `none`, the server skips applying personalization to the response. Setting `personalized=none` is necessary but not sufficient for CDN caching: a response is only cached when the endpoint is also cacheable in the [server-side web-tier cache](https://developer.salesforce.com/docs/commerce/commerce-api/guide/server-side-web-tier-caching.html), subject to its TTLs and invalidation. A call that is uncacheable in the web tier is not cached at the CDN either. See [CDN caching](https://developer.salesforce.com/docs/commerce/commerce-api/guide/cdn-caching.html). * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * * @returns A promise of type Taxes. */ getTaxesFromOrder(options?: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; orderNo: string; siteId: string; personalized?: GetTaxesFromOrderPersonalizedEnum; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; }>): Promise; /** * This method gives you the external taxation data of the order transferred from the basket during order creation. This endpoint can be called only if external taxation was used. See POST /baskets for more information. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.orderNo - The order number of the order to be modified. * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.parameters.personalized - Controls whether personalization is applied to the response. Set to `none` to opt out of personalized response handling so the response is safe to cache at the CDN layer. When set to `none`, the server skips applying personalization to the response. Setting `personalized=none` is necessary but not sufficient for CDN caching: a response is only cached when the endpoint is also cacheable in the [server-side web-tier cache](https://developer.salesforce.com/docs/commerce/commerce-api/guide/server-side-web-tier-caching.html), subject to its TTLs and invalidation. A call that is uncacheable in the web tier is not cached at the CDN either. See [CDN caching](https://developer.salesforce.com/docs/commerce/commerce-api/guide/cdn-caching.html). * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param rawResponse - Set to true to return entire Response object instead of DTO. * * @returns A promise of type Response if rawResponse is true, a promise of type Taxes otherwise. */ getTaxesFromOrder(options?: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; orderNo: string; siteId: string; personalized?: GetTaxesFromOrderPersonalizedEnum; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; }>, rawResponse?: T): Promise; /** * Retrieve order details using non-token identifiers or an authenticated shopper session. The endpoint distinguishes between two levels of access: - Full access: Granted using shopper authentication, an OrderViewCode, or a time-limited access code. The OrderViewCode and access code are both passed in the `orderViewCode` request-body field; the server distinguishes them by format. Returns the complete order graph. - Partial access: Granted using a billing PostalCode paired with email or phone information. Filters sensitive data and Personally Identifiable Information (PII). * * If you would like to get a raw Response object use the other guestOrderLookup function. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.orderNo - The order number of the order to be modified. * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified. * @param options.parameters.expand - When you select 'oms' expand, data is loaded from Order Management (OMS), if available. When OMS data is available, the expand parameter has the following behavior: "expand=oms": order and related order entities (product & shipping items, delivery groups and price adjustments) are returned. "expand=oms_shipments": order and fulfillment (shipment) data is returned. "expand=oms,oms_shipments": order, related order entities and fulfillment (shipment) data are returned. If your instance is not integrated with OMS or the order data is not available, the `expand=oms` command is disregarded. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param options.body - The data to send as the request body. * * @returns A promise of type Order. */ guestOrderLookup(options: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; orderNo: string; siteId: string; locale?: LocaleCode; expand?: Array; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; body: OrderLookupRequest & CustomRequestBody; }>): Promise; /** * Retrieve order details using non-token identifiers or an authenticated shopper session. The endpoint distinguishes between two levels of access: - Full access: Granted using shopper authentication, an OrderViewCode, or a time-limited access code. The OrderViewCode and access code are both passed in the `orderViewCode` request-body field; the server distinguishes them by format. Returns the complete order graph. - Partial access: Granted using a billing PostalCode paired with email or phone information. Filters sensitive data and Personally Identifiable Information (PII). * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.orderNo - The order number of the order to be modified. * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified. * @param options.parameters.expand - When you select 'oms' expand, data is loaded from Order Management (OMS), if available. When OMS data is available, the expand parameter has the following behavior: "expand=oms": order and related order entities (product & shipping items, delivery groups and price adjustments) are returned. "expand=oms_shipments": order and fulfillment (shipment) data is returned. "expand=oms,oms_shipments": order, related order entities and fulfillment (shipment) data are returned. If your instance is not integrated with OMS or the order data is not available, the `expand=oms` command is disregarded. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param options.body - The data to send as the request body. * @param rawResponse - Set to true to return entire Response object instead of DTO. * * @returns A promise of type Response if rawResponse is true, a promise of type Order otherwise. */ guestOrderLookup(options: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; orderNo: string; siteId: string; locale?: LocaleCode; expand?: Array; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; body: OrderLookupRequest & CustomRequestBody; }>, rawResponse?: T): Promise; /** * Removes a payment instrument of an order. * * If you would like to get a raw Response object use the other removePaymentInstrumentFromOrder function. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.paymentInstrumentId - * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.orderNo - The order number of the order to be modified. * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * * @returns A promise of type Order. */ removePaymentInstrumentFromOrder(options?: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ paymentInstrumentId: string; organizationId: string; orderNo: string; siteId: string; locale?: LocaleCode; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; }>): Promise; /** * Removes a payment instrument of an order. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.paymentInstrumentId - * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.orderNo - The order number of the order to be modified. * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param rawResponse - Set to true to return entire Response object instead of DTO. * * @returns A promise of type Response if rawResponse is true, a promise of type Order otherwise. */ removePaymentInstrumentFromOrder(options?: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ paymentInstrumentId: string; organizationId: string; orderNo: string; siteId: string; locale?: LocaleCode; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; }>, rawResponse?: T): Promise; /** * Generates a time-limited access code and delivers it via email to the address associated with the order. The shopper can then use this code with the lookup, cancel, and return endpoints to access the order without the original session. The generated code is valid for 15 minutes. Too many incorrect access attempts invalidate the code early, but the 15-minute cooldown remains — a new code cannot be generated until the original validity period has elapsed, even if the code was invalidated early. The endpoint always returns 202 — whether the order and email combination is valid, and whether a new code was generated. This uniform response prevents enumeration of valid orders and avoids revealing cooldown state to callers. * * If you would like to get a raw Response object use the other requestOrderAccessCode function. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.orderNo - The order number of the order to be modified. * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified. * @param options.parameters.expand - When you specify `expand=oms`, the integrated Order Management System (OMS) is included during the email validation. If your instance isn't integrated with OMS or the order data isn't available, B2C Commerce ignores the `expand=oms` parameter. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param options.body - The data to send as the request body. * * @returns A promise of type void. */ requestOrderAccessCode(options: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; orderNo: string; siteId: string; locale?: LocaleCode; expand?: Array; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; body: RequestOrderAccessCodeRequest & CustomRequestBody; }>): Promise; /** * Generates a time-limited access code and delivers it via email to the address associated with the order. The shopper can then use this code with the lookup, cancel, and return endpoints to access the order without the original session. The generated code is valid for 15 minutes. Too many incorrect access attempts invalidate the code early, but the 15-minute cooldown remains — a new code cannot be generated until the original validity period has elapsed, even if the code was invalidated early. The endpoint always returns 202 — whether the order and email combination is valid, and whether a new code was generated. This uniform response prevents enumeration of valid orders and avoids revealing cooldown state to callers. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.orderNo - The order number of the order to be modified. * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified. * @param options.parameters.expand - When you specify `expand=oms`, the integrated Order Management System (OMS) is included during the email validation. If your instance isn't integrated with OMS or the order data isn't available, B2C Commerce ignores the `expand=oms` parameter. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param options.body - The data to send as the request body. * @param rawResponse - Set to true to return entire Response object instead of DTO. * * @returns A promise of type Response if rawResponse is true, a promise of type void otherwise. */ requestOrderAccessCode(options: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; orderNo: string; siteId: string; locale?: LocaleCode; expand?: Array; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; body: RequestOrderAccessCodeRequest & CustomRequestBody; }>, rawResponse?: T): Promise; /** * Initiates the return of one or more items of an order that is integrated with Order Management (OMS). * * If you would like to get a raw Response object use the other returnOmsOrder function. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.orderNo - The order number of the order to be modified. * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param options.body - The data to send as the request body. * * @returns A promise of type Order. */ returnOmsOrder(options: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; orderNo: string; siteId: string; locale?: LocaleCode; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; body: OmsReturnOrderRequest & CustomRequestBody; }>): Promise; /** * Initiates the return of one or more items of an order that is integrated with Order Management (OMS). * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.orderNo - The order number of the order to be modified. * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param options.body - The data to send as the request body. * @param rawResponse - Set to true to return entire Response object instead of DTO. * * @returns A promise of type Response if rawResponse is true, a promise of type Order otherwise. */ returnOmsOrder(options: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ organizationId: string; orderNo: string; siteId: string; locale?: LocaleCode; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; body: OmsReturnOrderRequest & CustomRequestBody; }>, rawResponse?: T): Promise; /** * Updates a payment instrument of an order. Details: The payment instrument is updated with the provided details. The payment method must be applicable for the order see GET /baskets/{basketId}/payment-methods, if the payment method is 'CREDIT_CARD' a paymentCard must be specified in the request. * * If you would like to get a raw Response object use the other updatePaymentInstrumentForOrder function. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.paymentInstrumentId - * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.orderNo - The order number of the order to be modified. * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param options.body - The data to send as the request body. * * @returns A promise of type Order. */ updatePaymentInstrumentForOrder(options: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ paymentInstrumentId: string; organizationId: string; orderNo: string; siteId: string; locale?: LocaleCode; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; body: OrderPaymentInstrumentRequest & CustomRequestBody; }>): Promise; /** * Updates a payment instrument of an order. Details: The payment instrument is updated with the provided details. The payment method must be applicable for the order see GET /baskets/{basketId}/payment-methods, if the payment method is 'CREDIT_CARD' a paymentCard must be specified in the request. * * @param options - An object containing the options for this method. * @param options.parameters - An object containing the parameters for this method. * @param options.parameters.paymentInstrumentId - * @param options.parameters.organizationId - An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id). * @param options.parameters.orderNo - The order number of the order to be modified. * @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites. * @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified. * @param options.retrySettings - Retry options for the `node-retry` package * @param options.fetchOptions - Fetch options for the `make-fetch-happen` package * @param options.headers - An object literal of key value pairs of the headers to be sent with this request. * @param options.body - The data to send as the request body. * @param rawResponse - Set to true to return entire Response object instead of DTO. * * @returns A promise of type Response if rawResponse is true, a promise of type Order otherwise. */ updatePaymentInstrumentForOrder(options: RequireParametersUnlessAllAreOptional<{ parameters?: CompositeParameters<{ paymentInstrumentId: string; organizationId: string; orderNo: string; siteId: string; locale?: LocaleCode; } & QueryParameters, CommonParameters>; retrySettings?: OperationOptions; fetchOptions?: RequestInit; headers?: { [key: string]: string; }; body: OrderPaymentInstrumentRequest & CustomRequestBody; }>, rawResponse?: T): Promise; }