Skip to content

Commit

Permalink
Merge pull request #1381 from Shopify/rd/add-new-checkout-apis
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-drexler authored Sep 25, 2023
2 parents 852ac55 + 6518a70 commit 1ec848b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export type {
OrderStatusLocalization,
OrderStatusPurchasingCompany,
OrderStatusBuyerIdentity,
CheckoutToken,
} from './api/order-status/order-status';
export type {
Attribute,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,14 @@ export interface OrderStatusApi<Target extends ExtensionTarget> {
*/
sessionToken: SessionToken;

/**
* id that represents the checkout used to create the order.
*
* Matches the `token` field in the [WebPixel checkout payload](https://shopify.dev/docs/api/pixels/customer-events#checkout)
* and the `checkout_token` field in the [Admin REST API Order resource](https://shopify.dev/docs/api/admin-rest/unstable/resources/order#resource-object).
*/
checkoutToken: StatefulRemoteSubscribable<CheckoutToken | undefined>;

/**
* The settings matching the settings definition written in the
* [`shopify.ui.extension.toml`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration) file.
Expand All @@ -348,15 +356,19 @@ export interface OrderStatusApi<Target extends ExtensionTarget> {
settings: StatefulRemoteSubscribable<ExtensionSettings>;

/**
* The proposed buyer shipping address. During the information step, the address
* updates when the field is committed (on change) rather than every keystroke.
* An address value is only present if delivery is required. Otherwise, the
* subscribable value is undefined.
* The buyer shipping address used for the order.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
*/
shippingAddress?: StatefulRemoteSubscribable<MailingAddress | undefined>;

/**
* The buyer billing address used for the order.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
*/
billingAddress?: StatefulRemoteSubscribable<MailingAddress | undefined>;

/** Shop where the purchase took place. */
shop: Shop;

Expand Down Expand Up @@ -927,6 +939,8 @@ export interface Customer {
storeCreditAccounts: StoreCreditAccount[];
}

export type CheckoutToken = string;

/**
* Settings describing the behavior of the buyer's checkout.
*/
Expand Down

0 comments on commit 1ec848b

Please sign in to comment.