Skip to content

Commit f165f8d

Browse files
authored
🤖 Merge PR DefinitelyTyped#72123 [shopify-buy]: update types for v3.0 SDK by @Gomah
1 parent 96220a9 commit f165f8d

File tree

2 files changed

+61
-1
lines changed

2 files changed

+61
-1
lines changed

types/shopify-buy/index.d.ts

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,23 +878,71 @@ declare namespace ShopifyBuy {
878878
appliedGiftCards: AppliedGiftCard[];
879879
availableShippingRates?: AvailableShippingRates;
880880
buyerIdentity: CheckoutBuyerIdentity;
881+
/**
882+
* @deprecated
883+
* Not supported. Defaults to `null`.
884+
*
885+
* The Cart API does not maintain the state of a completed Cart that became an order.
886+
*/
881887
completedAt?: DateTime;
882888
createdAt: DateTime;
883889
currencyCode: CurrencyCode;
884890
customAttributes: Attribute[];
885891
email?: string;
886892
lineItemsSubtotalPrice: MoneyV2;
887893
note?: string;
894+
/**
895+
* @deprecated
896+
* Not supported. Defaults to `null`.
897+
*
898+
* To retrieve customer orders, please use either the [Customer Account API](https://shopify.dev/docs/api/customer) or the legacy [Customer API](https://shopify.dev/docs/api/storefront/2025-01/objects/customer).
899+
*/
888900
order?: Order;
901+
/**
902+
* @deprecated
903+
* Not supported. Defaults to `null`.
904+
*
905+
* To retrieve customer orders, please use either the [Customer Account API](https://shopify.dev/docs/api/customer) or the legacy [Customer API](https://shopify.dev/docs/api/storefront/2025-01/objects/customer).
906+
*/
889907
orderStatusUrl?: URL;
890908
paymentDue: MoneyV2;
909+
/**
910+
* @deprecated
911+
* Not supported. Defaults to `false`.
912+
*
913+
* The [Cart API](https://shopify.dev/docs/api/storefront/2025-01/objects/cart) returns only carts that are considered ready. Simply bypass or remove any existing code depending on this field.
914+
*/
891915
ready: boolean;
916+
/**
917+
* @deprecated
918+
* Not supported. Defaults to `false`.
919+
*
920+
* The [Cart API](https://shopify.dev/docs/api/storefront/2025-01/objects/cart) does not contain shipping information, this is currently handled in the Checkout flow. Remove any existing code depending on these fields.
921+
*/
892922
requiresShipping: boolean;
893923
shippingAddress?: MailingAddress;
894924
shippingDiscountAllocations: DiscountAllocation[];
925+
/**
926+
* @deprecated
927+
* Not supported. Defaults to `null`.
928+
*
929+
* The [Cart API](https://shopify.dev/docs/api/storefront/2025-01/objects/cart) does not contain shipping information, this is currently handled in the Checkout flow. Remove any existing code depending on these fields.
930+
*/
895931
shippingLine?: ShippingRate;
896932
subtotalPrice: MoneyV2;
933+
/**
934+
* @deprecated
935+
* Not supported. Defaults to `false`.
936+
*
937+
* The [Cart API](https://shopify.dev/docs/api/storefront/2025-01/objects/cart) does not have Tax aware as this is currently handled in the Checkout flow. Remove any existing code depending on this field.
938+
*/
897939
taxExempt: boolean;
940+
/**
941+
* @deprecated
942+
* Not supported. Defaults to `false`.
943+
*
944+
* The [Cart API](https://shopify.dev/docs/api/storefront/2025-01/objects/cart) does not have Tax aware as this is currently handled in the Checkout flow. Remove any existing code depending on this field.
945+
*/
898946
taxesIncluded: boolean;
899947
totalDuties?: MoneyV2;
900948
totalPrice: MoneyV2;
@@ -1544,6 +1592,11 @@ declare namespace ShopifyBuy {
15441592

15451593
/**
15461594
* Creates a checkout.
1595+
*
1596+
* @remarks
1597+
* There are limitations with checkout localization:
1598+
* - Does not create localized checkouts when passing `presentmentCurrencyCode`
1599+
* - Does not localize an *empty* checkout created with `buyerIdentity.countryCode` (must create with lineItems)
15471600
*/
15481601
create(input?: {
15491602
email?: string;
@@ -1555,6 +1608,9 @@ declare namespace ShopifyBuy {
15551608

15561609
/**
15571610
* Replaces the value of checkout's custom attributes and/or note with values defined in the input
1611+
*
1612+
* @remarks
1613+
* It does not update a checkout to support `allowPartialAddresses`
15581614
*/
15591615
updateAttributes(
15601616
checkoutId: ID,
@@ -1577,6 +1633,10 @@ declare namespace ShopifyBuy {
15771633

15781634
/**
15791635
* Applies a discount to an existing checkout using a discount code.
1636+
*
1637+
* @remarks
1638+
* - It does not apply an order-level fixed amount discount to an empty checkout
1639+
* - It does not apply an order-level percentage discount to an empty checkout
15801640
*/
15811641
addDiscount(checkoutId: ID, discountCode: string): Promise<Checkout>;
15821642

types/shopify-buy/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"name": "@types/shopify-buy",
4-
"version": "2.17.9999",
4+
"version": "3.0.9999",
55
"projects": [
66
"https://github.com/Shopify/js-buy-sdk#readme"
77
],

0 commit comments

Comments
 (0)