UNPKG

ordercloud-javascript-sdk

Version:

The offical Javascript SDK for the Ordercloud ecommerce API

454 lines (453 loc) 35.7 kB
import { Order } from '../models/Order'; import { Address } from '../models/Address'; import { BundleItems } from '../models/BundleItems'; import { LineItem } from '../models/LineItem'; import { OrderWorksheet } from '../models/OrderWorksheet'; import { ListPage } from '../models/ListPage'; import { Searchable } from '../models/Searchable'; import { Sortable } from '../models/Sortable'; import { Filters } from '../models/Filters'; import { EligiblePromotion } from '../models/EligiblePromotion'; import { User } from '../models/User'; import { Payment } from '../models/Payment'; import { PaymentTransaction } from '../models/PaymentTransaction'; import { OrderPromotion } from '../models/OrderPromotion'; import { RefreshPromosResponse } from '../models/RefreshPromosResponse'; import { OrderShipMethodSelection } from '../models/OrderShipMethodSelection'; import { PartialDeep } from '../models/PartialDeep'; import { RequiredDeep } from '../models/RequiredDeep'; import { RequestOptions } from '../models/RequestOptions'; declare class Cart { private impersonating; /** * @ignore * not part of public api, don't include in generated docs */ constructor(); /** * Retrieve a cart If the ID of the Order returned is null, the cart has not yet been interacted with. Once an item is added, the Order.ID will be populated. * Check out the {@link https://ordercloud.io/api-reference/orders-and-fulfillment/cart/get|api docs} for more info * * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ Get<TOrder extends Order>(requestOptions?: RequestOptions): Promise<RequiredDeep<TOrder>>; /** * Create or update a cart If an object with the same ID already exists, it will be overwritten.<br/></br>The recommended way to initiate a new cart is to add a line item. If there is a specific reason an order needs to exist prior to adding a line item, this method can be used to initiate a new cart. * Check out the {@link https://ordercloud.io/api-reference/orders-and-fulfillment/cart/save|api docs} for more info * * @param order * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ Save<TOrder extends Order>(order: Order, requestOptions?: RequestOptions): Promise<RequiredDeep<TOrder>>; /** * Delete a cart Empties the cart. Any promotions, payments or other items associated with the cart will also be removed. * Check out the {@link https://ordercloud.io/api-reference/orders-and-fulfillment/cart/delete|api docs} for more info * * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ Delete(requestOptions?: RequestOptions): Promise<void>; /** * Partially update a cart * Check out the {@link https://ordercloud.io/api-reference/orders-and-fulfillment/cart/patch|api docs} for more info * * @param order * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ Patch<TOrder extends Order>(order: PartialDeep<Order>, requestOptions?: RequestOptions): Promise<RequiredDeep<TOrder>>; /** * Set an active cart * Check out the {@link https://ordercloud.io/api-reference/orders-and-fulfillment/cart/set-active-cart|api docs} for more info * * @param orderID ID of the order. * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ SetActiveCart(orderID: string, requestOptions?: RequestOptions): Promise<void>; /** * Auto-apply promotions to the cart Apply up to 100 eligible promotions where AutoApply=true. * Check out the {@link https://ordercloud.io/api-reference/orders-and-fulfillment/cart/apply-promotions|api docs} for more info * * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ ApplyPromotions<TOrder extends Order>(requestOptions?: RequestOptions): Promise<RequiredDeep<TOrder>>; /** * Set a billing address Use only when the address is not to be saved/reused.<br/></br>To use a saved address (i.e. from the Addresses resource), PATCH the order's BillingAddressID property instead. * Check out the {@link https://ordercloud.io/api-reference/orders-and-fulfillment/cart/set-billing-address|api docs} for more info * * @param address Required fields: Street1, City, Country * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ SetBillingAddress<TOrder extends Order>(address: Address, requestOptions?: RequestOptions): Promise<RequiredDeep<TOrder>>; /** * Partially update a cart billing address Not allowed on carts where BillingAddressID has been set. In that case, use the Addresses resource to update the saved address. * Check out the {@link https://ordercloud.io/api-reference/orders-and-fulfillment/cart/patch-billing-address|api docs} for more info * * @param address * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ PatchBillingAddress<TOrder extends Order>(address: PartialDeep<Address>, requestOptions?: RequestOptions): Promise<RequiredDeep<TOrder>>; /** * Create a cart bundle item Adds bundle line items to the cart * Check out the {@link https://ordercloud.io/api-reference/orders-and-fulfillment/cart/create-bundle-item|api docs} for more info * * @param bundleID ID of the bundle. * @param bundleItems * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ CreateBundleItem<TLineItem extends LineItem>(bundleID: string, bundleItems: BundleItems, requestOptions?: RequestOptions): Promise<RequiredDeep<TLineItem>>; /** * Delete a cart bundle item * Check out the {@link https://ordercloud.io/api-reference/orders-and-fulfillment/cart/delete-bundle-item|api docs} for more info * * @param bundleID ID of the bundle. * @param bundleItemID ID of the bundle item. * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ DeleteBundleItem(bundleID: string, bundleItemID: string, requestOptions?: RequestOptions): Promise<void>; /** * Calculate the cart * Check out the {@link https://ordercloud.io/api-reference/orders-and-fulfillment/cart/calculate|api docs} for more info * * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ Calculate<TOrderWorksheet extends OrderWorksheet>(requestOptions?: RequestOptions): Promise<RequiredDeep<TOrderWorksheet>>; /** * List eligible promotions for the cart * Check out the {@link https://ordercloud.io/api-reference/orders-and-fulfillment/cart/list-eligible-promotions|api docs} for more info * * @param listOptions.search Word or phrase to search for. * @param listOptions.searchOn Comma-delimited list of fields to search on. * @param listOptions.sortBy Comma-delimited list of fields to sort by. * @param listOptions.page Page of results to return. When paginating through many items (> page 30), we recommend the "Last ID" method, as outlined in the Advanced Querying documentation. * @param listOptions.pageSize Number of results to return per page. * @param listOptions.filters An object or dictionary representing key/value pairs to apply as filters. Valid keys are top-level properties of the returned model or 'xp.???' * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ ListEligiblePromotions<TEligiblePromotion extends EligiblePromotion>(listOptions?: { search?: string; searchOn?: Searchable<'Cart.ListEligiblePromotions'>; sortBy?: Sortable<'Cart.ListEligiblePromotions'>; page?: number; pageSize?: number; filters?: Filters; }, requestOptions?: RequestOptions): Promise<RequiredDeep<ListPage<TEligiblePromotion>>>; /** * Estimate shipping cost * Check out the {@link https://ordercloud.io/api-reference/orders-and-fulfillment/cart/estimate-shipping|api docs} for more info * * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ EstimateShipping<TOrderWorksheet extends OrderWorksheet>(requestOptions?: RequestOptions): Promise<RequiredDeep<TOrderWorksheet>>; /** * Partially update a cart from user Only FirstName, LastName, and Email can be updated.<br/></br>Primarily used to facilitate guest checkout scenarios. * Check out the {@link https://ordercloud.io/api-reference/orders-and-fulfillment/cart/patch-from-user|api docs} for more info * * @param user * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ PatchFromUser<TOrder extends Order>(user: PartialDeep<User>, requestOptions?: RequestOptions): Promise<RequiredDeep<TOrder>>; /** * List cart line items * Check out the {@link https://ordercloud.io/api-reference/orders-and-fulfillment/cart/list-line-items|api docs} for more info * * @param listOptions.search Word or phrase to search for. * @param listOptions.searchOn Comma-delimited list of fields to search on. * @param listOptions.sortBy Comma-delimited list of fields to sort by. * @param listOptions.page Page of results to return. When paginating through many items (> page 30), we recommend the "Last ID" method, as outlined in the Advanced Querying documentation. * @param listOptions.pageSize Number of results to return per page. * @param listOptions.filters An object or dictionary representing key/value pairs to apply as filters. Valid keys are top-level properties of the returned model or 'xp.???' * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ ListLineItems<TLineItem extends LineItem>(listOptions?: { search?: string; searchOn?: Searchable<'Cart.ListLineItems'>; sortBy?: Sortable<'Cart.ListLineItems'>; page?: number; pageSize?: number; filters?: Filters; }, requestOptions?: RequestOptions): Promise<RequiredDeep<ListPage<TLineItem>>>; /** * Create a cart line item Adds a line item to the cart * Check out the {@link https://ordercloud.io/api-reference/orders-and-fulfillment/cart/create-line-item|api docs} for more info * * @param lineItem Required fields: ProductID * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ CreateLineItem<TLineItem extends LineItem>(lineItem: LineItem, requestOptions?: RequestOptions): Promise<RequiredDeep<TLineItem>>; /** * Retrieve a cart line item * Check out the {@link https://ordercloud.io/api-reference/orders-and-fulfillment/cart/get-line-item|api docs} for more info * * @param lineItemID ID of the line item. * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ GetLineItem<TLineItem extends LineItem>(lineItemID: string, requestOptions?: RequestOptions): Promise<RequiredDeep<TLineItem>>; /** * Create or update a cart line item * Check out the {@link https://ordercloud.io/api-reference/orders-and-fulfillment/cart/save-line-item|api docs} for more info * * @param lineItemID ID of the line item. * @param lineItem Required fields: ProductID * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ SaveLineItem<TLineItem extends LineItem>(lineItemID: string, lineItem: LineItem, requestOptions?: RequestOptions): Promise<RequiredDeep<TLineItem>>; /** * Delete a cart line item * Check out the {@link https://ordercloud.io/api-reference/orders-and-fulfillment/cart/delete-line-item|api docs} for more info * * @param lineItemID ID of the line item. * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ DeleteLineItem(lineItemID: string, requestOptions?: RequestOptions): Promise<void>; /** * Partially update a cart line item * Check out the {@link https://ordercloud.io/api-reference/orders-and-fulfillment/cart/patch-line-item|api docs} for more info * * @param lineItemID ID of the line item. * @param lineItem * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ PatchLineItem<TLineItem extends LineItem>(lineItemID: string, lineItem: PartialDeep<LineItem>, requestOptions?: RequestOptions): Promise<RequiredDeep<TLineItem>>; /** * List cart payments * Check out the {@link https://ordercloud.io/api-reference/orders-and-fulfillment/cart/list-payments|api docs} for more info * * @param listOptions.search Word or phrase to search for. * @param listOptions.searchOn Comma-delimited list of fields to search on. * @param listOptions.sortBy Comma-delimited list of fields to sort by. * @param listOptions.page Page of results to return. When paginating through many items (> page 30), we recommend the "Last ID" method, as outlined in the Advanced Querying documentation. * @param listOptions.pageSize Number of results to return per page. * @param listOptions.filters An object or dictionary representing key/value pairs to apply as filters. Valid keys are top-level properties of the returned model or 'xp.???' * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ ListPayments<TPayment extends Payment>(listOptions?: { search?: string; searchOn?: Searchable<'Cart.ListPayments'>; sortBy?: Sortable<'Cart.ListPayments'>; page?: number; pageSize?: number; filters?: Filters; }, requestOptions?: RequestOptions): Promise<RequiredDeep<ListPage<TPayment>>>; /** * Create a cart payment * Check out the {@link https://ordercloud.io/api-reference/orders-and-fulfillment/cart/create-payment|api docs} for more info * * @param payment * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ CreatePayment<TPayment extends Payment>(payment: Payment, requestOptions?: RequestOptions): Promise<RequiredDeep<TPayment>>; /** * Retrieve a cart payment * Check out the {@link https://ordercloud.io/api-reference/orders-and-fulfillment/cart/get-payment|api docs} for more info * * @param paymentID ID of the payment. * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ GetPayment<TPayment extends Payment>(paymentID: string, requestOptions?: RequestOptions): Promise<RequiredDeep<TPayment>>; /** * Delete a cart payment * Check out the {@link https://ordercloud.io/api-reference/orders-and-fulfillment/cart/delete-payment|api docs} for more info * * @param paymentID ID of the payment. * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ DeletePayment(paymentID: string, requestOptions?: RequestOptions): Promise<void>; /** * Partially update a cart payment * Check out the {@link https://ordercloud.io/api-reference/orders-and-fulfillment/cart/patch-payment|api docs} for more info * * @param paymentID ID of the payment. * @param payment * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ PatchPayment<TPayment extends Payment>(paymentID: string, payment: PartialDeep<Payment>, requestOptions?: RequestOptions): Promise<RequiredDeep<TPayment>>; /** * Create a cart payment transaction * Check out the {@link https://ordercloud.io/api-reference/orders-and-fulfillment/cart/create-payment-transaction|api docs} for more info * * @param paymentID ID of the payment. * @param paymentTransaction Required fields: Type, DateExecuted * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ CreatePaymentTransaction<TPayment extends Payment>(paymentID: string, paymentTransaction: PaymentTransaction, requestOptions?: RequestOptions): Promise<RequiredDeep<TPayment>>; /** * Delete a cart payment transaction * Check out the {@link https://ordercloud.io/api-reference/orders-and-fulfillment/cart/delete-payment-transaction|api docs} for more info * * @param paymentID ID of the payment. * @param transactionID ID of the transaction. * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ DeletePaymentTransaction(paymentID: string, transactionID: string, requestOptions?: RequestOptions): Promise<void>; /** * List cart promotions * Check out the {@link https://ordercloud.io/api-reference/orders-and-fulfillment/cart/list-promotions|api docs} for more info * * @param listOptions.search Word or phrase to search for. * @param listOptions.searchOn Comma-delimited list of fields to search on. * @param listOptions.sortBy Comma-delimited list of fields to sort by. * @param listOptions.page Page of results to return. When paginating through many items (> page 30), we recommend the "Last ID" method, as outlined in the Advanced Querying documentation. * @param listOptions.pageSize Number of results to return per page. * @param listOptions.filters An object or dictionary representing key/value pairs to apply as filters. Valid keys are top-level properties of the returned model or 'xp.???' * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ ListPromotions<TOrderPromotion extends OrderPromotion>(listOptions?: { search?: string; searchOn?: Searchable<'Cart.ListPromotions'>; sortBy?: Sortable<'Cart.ListPromotions'>; page?: number; pageSize?: number; filters?: Filters; }, requestOptions?: RequestOptions): Promise<RequiredDeep<ListPage<TOrderPromotion>>>; /** * Add a promotion * Check out the {@link https://ordercloud.io/api-reference/orders-and-fulfillment/cart/add-promotion|api docs} for more info * * @param promoCode Promo code of the order promotion. * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ AddPromotion<TOrderPromotion extends OrderPromotion>(promoCode: string, requestOptions?: RequestOptions): Promise<RequiredDeep<TOrderPromotion>>; /** * Delete a cart promotion * Check out the {@link https://ordercloud.io/api-reference/orders-and-fulfillment/cart/delete-promotion|api docs} for more info * * @param promoCode Promo code of the cart. * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ DeletePromotion(promoCode: string, requestOptions?: RequestOptions): Promise<void>; /** * Refresh promotions on the cart Re-calculates promotion discounts, removes promotions that are no longer valid, and adds eligible promotions where AutoApply=true (up to limit of 100) * Check out the {@link https://ordercloud.io/api-reference/orders-and-fulfillment/cart/refresh-promotions|api docs} for more info * * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ RefreshPromotions<TRefreshPromosResponse extends RefreshPromosResponse>(requestOptions?: RequestOptions): Promise<RequiredDeep<TRefreshPromosResponse>>; /** * Select a ship method * Check out the {@link https://ordercloud.io/api-reference/orders-and-fulfillment/cart/select-ship-methods|api docs} for more info * * @param orderShipMethodSelection * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ SelectShipMethods<TOrderWorksheet extends OrderWorksheet>(orderShipMethodSelection: OrderShipMethodSelection, requestOptions?: RequestOptions): Promise<RequiredDeep<TOrderWorksheet>>; /** * Set a shipping address Use only when the address is not to be saved/reused. To use a saved address (i.e. from the Addresses resource), PATCH the order's ShippingAddressID property instead. The address used will be populated on the ShippingAddress property of each LineItem. * Check out the {@link https://ordercloud.io/api-reference/orders-and-fulfillment/cart/set-shipping-address|api docs} for more info * * @param address Required fields: Street1, City, Country * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ SetShippingAddress<TOrder extends Order>(address: Address, requestOptions?: RequestOptions): Promise<RequiredDeep<TOrder>>; /** * Partially update a cart shipping address Not allowed on carts where ShippingAddressID has been set. In that case, use the Addresses resource to update the saved address. * Check out the {@link https://ordercloud.io/api-reference/orders-and-fulfillment/cart/patch-shipping-address|api docs} for more info * * @param address * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ PatchShippingAddress<TOrder extends Order>(address: PartialDeep<Address>, requestOptions?: RequestOptions): Promise<RequiredDeep<TOrder>>; /** * Submit the cart * Check out the {@link https://ordercloud.io/api-reference/orders-and-fulfillment/cart/submit|api docs} for more info * * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ Submit<TOrder extends Order>(requestOptions?: RequestOptions): Promise<RequiredDeep<TOrder>>; /** * Validate the cart in it's current state * Check out the {@link https://ordercloud.io/api-reference/orders-and-fulfillment/cart/validate|api docs} for more info * * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ Validate(requestOptions?: RequestOptions): Promise<void>; /** * Retrieve a cart order worksheet * Check out the {@link https://ordercloud.io/api-reference/orders-and-fulfillment/cart/get-order-worksheet|api docs} for more info * * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ GetOrderWorksheet<TOrderWorksheet extends OrderWorksheet>(requestOptions?: RequestOptions): Promise<RequiredDeep<TOrderWorksheet>>; /** * @description * enables impersonation by calling the subsequent method with the stored impersonation token * * @example * Cart.As().List() // lists Cart using the impersonated users' token */ As(): this; } declare const _default: Cart; export default _default;