Class ShopperOrders<ConfigParameters>

Shopper Orders

Finish the shopper checkout experience resulting in an order.

Simple example:

  import { ShopperOrders } from "commerce-sdk-isomorphic";

const clientConfig = {
parameters: {
clientId: "XXXXXX",
organizationId: "XXXX",
shortCode: "XXX",
siteId: "XX"
}
};
const shopperOrdersClient = new ShopperOrders(clientConfig);
API Version: 0.3.5
Last Updated:

Type Parameters

Hierarchy

  • ShopperOrders

Constructors

Methods

  • 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.

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: Basket$1;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "locale"]: (Omit<{
                  locale?: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  locale?: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<Order$1>

    A promise of type Order.

  • Submits an order based on a prepared basket. The only considered value from the request body is basketId.

    Type Parameters

    • T extends boolean

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: Basket$1;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "locale"]: (Omit<{
                  locale?: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  locale?: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : Order$1>

    A promise of type Response if rawResponse is true, a promise of type Order otherwise.

  • 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.

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: OrderPaymentInstrumentRequest$0;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "locale" | "orderNo"]: (Omit<{
                  locale?: string;
                  orderNo: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  locale?: string;
                  orderNo: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<Order$1>

    A promise of type Order.

  • 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.

    Type Parameters

    • T extends boolean

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: OrderPaymentInstrumentRequest$0;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "locale" | "orderNo"]: (Omit<{
                  locale?: string;
                  orderNo: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  locale?: string;
                  orderNo: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : Order$1>

    A promise of type Response if rawResponse is true, a promise of type Order otherwise.

  • Gets information for an order.

    If you would like to get a raw Response object use the other getOrder function.

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "locale" | "orderNo"]: (Omit<{
                  locale?: string;
                  orderNo: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  locale?: string;
                  orderNo: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<Order$1>

    A promise of type Order.

  • Gets information for an order.

    Type Parameters

    • T extends boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "locale" | "orderNo"]: (Omit<{
                  locale?: string;
                  orderNo: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  locale?: string;
                  orderNo: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : Order$1>

    A promise of type Response if rawResponse is true, a promise of type Order otherwise.

  • 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.

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "locale" | "orderNo"]: (Omit<{
                  locale?: string;
                  orderNo: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  locale?: string;
                  orderNo: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<PaymentMethodResult$0>

    A promise of type PaymentMethodResult.

  • Gets the applicable payment methods for an existing order considering the open payment amount only.

    Type Parameters

    • T extends boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "locale" | "orderNo"]: (Omit<{
                  locale?: string;
                  orderNo: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  locale?: string;
                  orderNo: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : PaymentMethodResult$0>

    A promise of type Response if rawResponse is true, a promise of type PaymentMethodResult otherwise.

  • 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.

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "orderNo"]: (Omit<{
                  orderNo: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  orderNo: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<Taxes$0>

    A promise of type Taxes.

  • 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.

    Type Parameters

    • T extends boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "orderNo"]: (Omit<{
                  orderNo: string;
                  organizationId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  orderNo: string;
                  organizationId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : Taxes$0>

    A promise of type Response if rawResponse is true, a promise of type Taxes otherwise.

  • Removes a payment instrument of an order.

    If you would like to get a raw Response object use the other removePaymentInstrumentFromOrder function.

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "locale" | "paymentInstrumentId" | "orderNo"]: (Omit<{
                  locale?: string;
                  orderNo: string;
                  organizationId: string;
                  paymentInstrumentId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  locale?: string;
                  orderNo: string;
                  organizationId: string;
                  paymentInstrumentId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<Order$1>

    A promise of type Order.

  • Removes a payment instrument of an order.

    Type Parameters

    • T extends boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "locale" | "paymentInstrumentId" | "orderNo"]: (Omit<{
                  locale?: string;
                  orderNo: string;
                  organizationId: string;
                  paymentInstrumentId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  locale?: string;
                  orderNo: string;
                  organizationId: string;
                  paymentInstrumentId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : Order$1>

    A promise of type Response if rawResponse is true, a promise of type Order otherwise.

  • 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.

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: OrderPaymentInstrumentRequest$0;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "locale" | "paymentInstrumentId" | "orderNo"]: (Omit<{
                  locale?: string;
                  orderNo: string;
                  organizationId: string;
                  paymentInstrumentId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  locale?: string;
                  orderNo: string;
                  organizationId: string;
                  paymentInstrumentId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<Order$1>

    A promise of type Order.

  • 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.

    Type Parameters

    • T extends boolean

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{
          body: OrderPaymentInstrumentRequest$0;
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "locale" | "paymentInstrumentId" | "orderNo"]: (Omit<{
                  locale?: string;
                  orderNo: string;
                  organizationId: string;
                  paymentInstrumentId: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  locale?: string;
                  orderNo: string;
                  organizationId: string;
                  paymentInstrumentId: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : Order$1>

    A promise of type Response if rawResponse is true, a promise of type Order otherwise.

Properties

clientConfig: ClientConfig<ConfigParameters> & {
    baseUri: string;
}
defaultBaseUri: "https://{shortCode}.api.commercecloud.salesforce.com/checkout/shopper-orders/{version}" = "https://{shortCode}.api.commercecloud.salesforce.com/checkout/shopper-orders/{version}"