import { Order } from '../models/Order'; import { OrderWorksheet } from '../models/OrderWorksheet'; import { User } from '../models/User'; import { ListPage } from '../models/ListPage'; import { Searchable } from '../models/Searchable'; import { Sortable } from '../models/Sortable'; import { Filters } from '../models/Filters'; import { LineItem } from '../models/LineItem'; import { Payment } from '../models/Payment'; import { PaymentTransaction } from '../models/PaymentTransaction'; import { OrderPromotion } from '../models/OrderPromotion'; 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(); /** * Get a single 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(requestOptions?: RequestOptions): Promise>; /** * Create or update a cart. If an object with the same ID already exists, it will be overwritten.

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. It can also be used for updates. * 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(order: Order, requestOptions?: RequestOptions): Promise>; /** * 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; /** * 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(order: PartialDeep, requestOptions?: RequestOptions): Promise>; /** * 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; /** * Estimate a shipping. * 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(requestOptions?: RequestOptions): Promise>; /** * Partially update a cart from user. * 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(user: User, requestOptions?: RequestOptions): Promise>; /** * Get a list of 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. Default: 1. 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. Default: 20, max: 100. * @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(listOptions?: { search?: string; searchOn?: Searchable<'Cart.ListLineItems'>; sortBy?: Sortable<'Cart.ListLineItems'>; page?: number; pageSize?: number; filters?: Filters; }, requestOptions?: RequestOptions): Promise>>; /** * Create a new 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(lineItem: LineItem, requestOptions?: RequestOptions): Promise>; /** * Get a single 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(lineItemID: string, requestOptions?: RequestOptions): Promise>; /** * 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(lineItemID: string, lineItem: LineItem, requestOptions?: RequestOptions): Promise>; /** * 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; /** * 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(lineItemID: string, lineItem: LineItem, requestOptions?: RequestOptions): Promise>; /** * Get a list of 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. Default: 1. 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. Default: 20, max: 100. * @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(listOptions?: { search?: string; searchOn?: Searchable<'Cart.ListPayments'>; sortBy?: Sortable<'Cart.ListPayments'>; page?: number; pageSize?: number; filters?: Filters; }, requestOptions?: RequestOptions): Promise>>; /** * Create a new 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(payment: Payment, requestOptions?: RequestOptions): Promise>; /** * Get a single 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(paymentID: string, requestOptions?: RequestOptions): Promise>; /** * 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; /** * 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(paymentID: string, payment: Payment, requestOptions?: RequestOptions): Promise>; /** * Create a new 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(paymentID: string, paymentTransaction: PaymentTransaction, requestOptions?: RequestOptions): Promise>; /** * 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; /** * Get a list of 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. Default: 1. 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. Default: 20, max: 100. * @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(listOptions?: { search?: string; searchOn?: Searchable<'Cart.ListPromotions'>; sortBy?: Sortable<'Cart.ListPromotions'>; page?: number; pageSize?: number; filters?: Filters; }, requestOptions?: RequestOptions): Promise>>; /** * 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(promoCode: string, requestOptions?: RequestOptions): Promise>; /** * 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; /** * Select a ship methods. * 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(orderShipMethodSelection: OrderShipMethodSelection, requestOptions?: RequestOptions): Promise>; /** * Submit a cart submit. * 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(requestOptions?: RequestOptions): Promise>; /** * Validate a cart validate. * 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; /** * Get a single 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(requestOptions?: RequestOptions): Promise>; /** * @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;