Checkout SettingsAPI
The API for interacting with the checkout settings.
Anchor to orderstatusapiOrderStatusApi
The API object provided to this and other customer-account.order-status
extension targets.
- Anchor to checkoutSettingscheckoutSettingsStatefulRemoteSubscribable<>required
Settings applied to the buyer's checkout.
Docs_OrderStatus_CheckoutSettingsApi
- checkoutSettings
Settings applied to the buyer's checkout.
StatefulRemoteSubscribable<CheckoutSettings>
export interface Docs_OrderStatus_CheckoutSettingsApi
extends Pick<OrderStatusApi<any>, 'checkoutSettings'> {}
CheckoutSettings
Settings describing the behavior of the buyer's checkout.
- orderSubmission
The type of order that will be created once the buyer completes checkout.
'DRAFT_ORDER' | 'ORDER'
- paymentTermsTemplate
Represents the merchant configured payment terms.
PaymentTermsTemplate
- shippingAddress
Settings describing the behavior of the shipping address.
ShippingAddressSettings
export interface CheckoutSettings {
/**
* The type of order that will be created once the buyer completes checkout.
*/
orderSubmission: 'DRAFT_ORDER' | 'ORDER';
/**
* Represents the merchant configured payment terms.
*/
paymentTermsTemplate?: PaymentTermsTemplate;
/**
* Settings describing the behavior of the shipping address.
*/
shippingAddress: ShippingAddressSettings;
}
PaymentTermsTemplate
Represents the payment terms template object.
- dueDate
The due date for net payment terms as a ISO 8601 formatted string `YYYY-MM-DDTHH:mm:ss.sssZ`.
string
- dueInDays
The number of days between the issued date and due date if using net payment terms.
number
- id
A globally-unique ID.
string
- name
The name of the payment terms translated to the buyer's current language. See [localization.language](/docs/api/checkout-ui-extensions/apis/standardapi#properties-propertydetail-localization).
string
export interface PaymentTermsTemplate {
/**
* A globally-unique ID.
* @example 'gid://shopify/PaymentTermsTemplate/1'
*/
id: string;
/**
* The name of the payment terms translated to the buyer's current language. See [localization.language](/docs/api/checkout-ui-extensions/apis/standardapi#properties-propertydetail-localization).
*/
name: string;
/**
* The due date for net payment terms as a ISO 8601 formatted string `YYYY-MM-DDTHH:mm:ss.sssZ`.
*/
dueDate?: string;
/**
* The number of days between the issued date and due date if using net payment terms.
*/
dueInDays?: number;
}
ShippingAddressSettings
Settings describing the behavior of the shipping address.
- isEditable
Describes whether the buyer can ship to any address during checkout.
boolean
export interface ShippingAddressSettings {
/**
* Describes whether the buyer can ship to any address during checkout.
*/
isEditable: boolean;
}
Anchor to useAttributesuse Attributes()
Returns the applied to the checkout.
UseAttributesGeneratedType
Returns the proposed `attributes` applied to the checkout.
Attribute[] | undefined
export function useAttributes<
Target extends RenderOrderStatusExtensionTarget = RenderOrderStatusExtensionTarget,
>(): Attribute[] | undefined {
const api = useApi<Target>();
const extensionTarget = api.extension.target;
if (!('attributes' in api)) {
throw new ExtensionHasNoFieldError('attributes', extensionTarget);
}
return useSubscription(api.attributes);
}
Attribute
- key
The key for the attribute.
string
- value
The value for the attribute.
string
export interface Attribute {
/**
* The key for the attribute.
*/
key: string;
/**
* The value for the attribute.
*/
value: string;
}