Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ShopperOrders<ConfigParameters>

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.4.8
Last Updated:

Type parameters

Hierarchy

  • ShopperOrders

Index

Constructors

constructor

Properties

clientConfig

clientConfig: ClientConfig<ConfigParameters> & { baseUri: string }

Static Readonly defaultBaseUri

defaultBaseUri: "https://{shortCode}.api.commercecloud.salesforce.com/checkout/shopper-orders/{version}" = "https://{shortCode}.api.commercecloud.salesforce.com/checkout/shopper-orders/{version}"

Static Readonly paramKeys

paramKeys: { createOrder: ["organizationId", "siteId", "locale"]; createOrderRequired: ["organizationId", "siteId"]; createPaymentInstrumentForOrder: ["organizationId", "orderNo", "siteId", "locale"]; createPaymentInstrumentForOrderRequired: ["organizationId", "orderNo", "siteId"]; getOrder: ["organizationId", "orderNo", "siteId", "locale"]; getOrderRequired: ["organizationId", "orderNo", "siteId"]; getPaymentMethodsForOrder: ["organizationId", "orderNo", "siteId", "locale"]; getPaymentMethodsForOrderRequired: ["organizationId", "orderNo", "siteId"]; getTaxesFromOrder: ["organizationId", "orderNo", "siteId"]; getTaxesFromOrderRequired: ["organizationId", "orderNo", "siteId"]; guestOrderLookup: ["organizationId", "orderNo", "siteId", "locale"]; guestOrderLookupRequired: ["organizationId", "orderNo", "siteId"]; removePaymentInstrumentFromOrder: ["organizationId", "orderNo", "paymentInstrumentId", "siteId", "locale"]; removePaymentInstrumentFromOrderRequired: ["organizationId", "orderNo", "paymentInstrumentId", "siteId"]; updatePaymentInstrumentForOrder: ["organizationId", "orderNo", "paymentInstrumentId", "siteId", "locale"]; updatePaymentInstrumentForOrderRequired: ["organizationId", "orderNo", "paymentInstrumentId", "siteId"] } = {createOrder: ['organizationId','siteId','locale',],createOrderRequired: ['organizationId','siteId',],getOrder: ['organizationId','orderNo','siteId','locale',],getOrderRequired: ['organizationId','orderNo','siteId',],guestOrderLookup: ['organizationId','orderNo','siteId','locale',],guestOrderLookupRequired: ['organizationId','orderNo','siteId',],createPaymentInstrumentForOrder: ['organizationId','orderNo','siteId','locale',],createPaymentInstrumentForOrderRequired: ['organizationId','orderNo','siteId',],removePaymentInstrumentFromOrder: ['organizationId','orderNo','paymentInstrumentId','siteId','locale',],removePaymentInstrumentFromOrderRequired: ['organizationId','orderNo','paymentInstrumentId','siteId',],updatePaymentInstrumentForOrder: ['organizationId','orderNo','paymentInstrumentId','siteId','locale',],updatePaymentInstrumentForOrderRequired: ['organizationId','orderNo','paymentInstrumentId','siteId',],getPaymentMethodsForOrder: ['organizationId','orderNo','siteId','locale',],getPaymentMethodsForOrderRequired: ['organizationId','orderNo','siteId',],getTaxesFromOrder: ['organizationId','orderNo','siteId',],getTaxesFromOrderRequired: ['organizationId','orderNo','siteId',],} as const

Type declaration

  • createOrder: ["organizationId", "siteId", "locale"]
  • createOrderRequired: ["organizationId", "siteId"]
  • createPaymentInstrumentForOrder: ["organizationId", "orderNo", "siteId", "locale"]
  • createPaymentInstrumentForOrderRequired: ["organizationId", "orderNo", "siteId"]
  • getOrder: ["organizationId", "orderNo", "siteId", "locale"]
  • getOrderRequired: ["organizationId", "orderNo", "siteId"]
  • getPaymentMethodsForOrder: ["organizationId", "orderNo", "siteId", "locale"]
  • getPaymentMethodsForOrderRequired: ["organizationId", "orderNo", "siteId"]
  • getTaxesFromOrder: ["organizationId", "orderNo", "siteId"]
  • getTaxesFromOrderRequired: ["organizationId", "orderNo", "siteId"]
  • guestOrderLookup: ["organizationId", "orderNo", "siteId", "locale"]
  • guestOrderLookupRequired: ["organizationId", "orderNo", "siteId"]
  • removePaymentInstrumentFromOrder: ["organizationId", "orderNo", "paymentInstrumentId", "siteId", "locale"]
  • removePaymentInstrumentFromOrderRequired: ["organizationId", "orderNo", "paymentInstrumentId", "siteId"]
  • updatePaymentInstrumentForOrder: ["organizationId", "orderNo", "paymentInstrumentId", "siteId", "locale"]
  • updatePaymentInstrumentForOrderRequired: ["organizationId", "orderNo", "paymentInstrumentId", "siteId"]

Methods

createOrder

  • 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

    Returns Promise<Order>

    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: boolean

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{ body: Basket; headers?: undefined | {}; parameters?: CompositeParameters<{ locale?: undefined | string; organizationId: string; siteId: string } & {}, ConfigParameters> }>

      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>

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

createPaymentInstrumentForOrder

  • 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

    Returns Promise<Order>

    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: boolean

    Parameters

    Returns Promise<T extends true ? Response : Order>

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

getOrder

  • 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?: undefined | {}; parameters?: CompositeParameters<{ locale?: undefined | string; orderNo: string; organizationId: string; siteId: string } & {}, ConfigParameters> }>

      An object containing the options for this method.

    Returns Promise<Order>

    A promise of type Order.

  • Gets information for an order.

    Type parameters

    • T: boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ locale?: undefined | string; orderNo: string; organizationId: string; siteId: string } & {}, ConfigParameters> }>

      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>

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

getPaymentMethodsForOrder

  • 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?: undefined | {}; parameters?: CompositeParameters<{ locale?: undefined | string; orderNo: string; organizationId: string; siteId: string } & {}, ConfigParameters> }>

      An object containing the options for this method.

    Returns Promise<PaymentMethodResult>

    A promise of type PaymentMethodResult.

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

    Type parameters

    • T: boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ locale?: undefined | string; orderNo: string; organizationId: string; siteId: string } & {}, ConfigParameters> }>

      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>

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

getTaxesFromOrder

  • 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

    Returns Promise<Taxes>

    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: boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ orderNo: string; organizationId: string; siteId: string } & {}, ConfigParameters> }>

      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>

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

guestOrderLookup

  • Use this endpoint to lookup a guest order.

    Important*: This endpoint uses the ShopperTokenTsob security scheme. Always check the Security section of the endpoint documentation, which is hidden by default.

    The API uses the orderViewCode generated during the order creation and the email of the order customer to lookup a guest order. If email is not provided on the order, the field can be left blank in the lookup request. Note*: In the no email on order scenario, the custom implementation must include an additional verification of an order attribute. For example, a postal code or mobile number.

    This API can also be used for looking up an order for a registered customer. In addition to the verification steps used for guest order lookup, the API also verifies that the customer ID of the order matches with the customer ID supplied in the ShopperTokenTsob.

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

    Parameters

    Returns Promise<Order>

    A promise of type Order.

  • Use this endpoint to lookup a guest order.

    Important*: This endpoint uses the ShopperTokenTsob security scheme. Always check the Security section of the endpoint documentation, which is hidden by default.

    The API uses the orderViewCode generated during the order creation and the email of the order customer to lookup a guest order. If email is not provided on the order, the field can be left blank in the lookup request. Note*: In the no email on order scenario, the custom implementation must include an additional verification of an order attribute. For example, a postal code or mobile number.

    This API can also be used for looking up an order for a registered customer. In addition to the verification steps used for guest order lookup, the API also verifies that the customer ID of the order matches with the customer ID supplied in the ShopperTokenTsob.

    Type parameters

    • T: boolean

    Parameters

    • options: RequireParametersUnlessAllAreOptional<{ body: OrderLookupRequest; headers?: undefined | {}; parameters?: CompositeParameters<{ locale?: undefined | string; orderNo: string; organizationId: string; siteId: string } & {}, ConfigParameters> }>

      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>

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

removePaymentInstrumentFromOrder

  • removePaymentInstrumentFromOrder(options?: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ locale?: undefined | string; orderNo: string; organizationId: string; paymentInstrumentId: string; siteId: string } & {}, ConfigParameters> }>): Promise<Order>
  • removePaymentInstrumentFromOrder<T>(options?: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ locale?: undefined | string; orderNo: string; organizationId: string; paymentInstrumentId: string; siteId: string } & {}, ConfigParameters> }>, rawResponse?: T): Promise<T extends true ? Response : Order>
  • 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?: undefined | {}; parameters?: CompositeParameters<{ locale?: undefined | string; orderNo: string; organizationId: string; paymentInstrumentId: string; siteId: string } & {}, ConfigParameters> }>

      An object containing the options for this method.

    Returns Promise<Order>

    A promise of type Order.

  • Removes a payment instrument of an order.

    Type parameters

    • T: boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ locale?: undefined | string; orderNo: string; organizationId: string; paymentInstrumentId: string; siteId: string } & {}, ConfigParameters> }>

      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>

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

updatePaymentInstrumentForOrder

  • 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

    Returns Promise<Order>

    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: boolean

    Parameters

    Returns Promise<T extends true ? Response : Order>

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

Generated using TypeDoc