DiscountsAPI
The API for interacting with discounts.
Anchor to orderstatusapiOrderStatusApi
The API object provided to this and other customer-account.order-status
extension targets.
- Anchor to discountAllocationsdiscountAllocationsReadonlySignalLike<CartDiscountAllocation[]>required
Discounts that have been applied to the entire cart.
- Anchor to discountCodesdiscountCodesReadonlySignalLike<CartDiscountCode[]>required
A list of discount codes applied to the purchase.
Docs_OrderStatus_DiscountsApi
- discountAllocations
Discounts that have been applied to the entire cart.
ReadonlySignalLike<CartDiscountAllocation[]>
- discountCodes
A list of discount codes applied to the purchase.
ReadonlySignalLike<CartDiscountCode[]>
export interface Docs_OrderStatus_DiscountsApi
extends Pick<OrderStatusApi<any>, 'discountAllocations' | 'discountCodes'> {}
ReadonlySignalLike
Represents a read-only value managed on the main thread that an extension can subscribe to. Example: Checkout uses this to manage the state of an object and communicate state changes to extensions running in a sandboxed web worker. This interface is compatible with Preact's ReadonlySignal: https://github.com/preactjs/signals/blob/a023a132a81bd4ba4a0bebb8cbbeffbd8c8bbafc/packages/core/src/index.ts#L700-L709
- subscribe
(fn: (value: T) => void) => () => void
- value
T
export interface ReadonlySignalLike<T> {
readonly value: T;
subscribe(fn: (value: T) => void): () => void;
}
CartDiscountCode
- code
The code for the discount
string
export interface CartDiscountCode {
/**
* The code for the discount
*/
code: string;
}