Skip to content

Commit 961b01a

Browse files
rennyGclaude
andcommitted
Update JSDoc from latest checkout-web review changes
Re-apply full checkout-web diff with review feedback. Includes {API_VERSION} placeholder URLs, updated descriptions, and Shopify Function link fixes. All fully qualified URLs preserved. Preserves 2026-01-specific deprecated types with appropriate JSDoc. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f2b7d5c commit 961b01a

5 files changed

Lines changed: 151 additions & 149 deletions

File tree

packages/ui-extensions/src/surfaces/checkout/api/checkout/checkout.ts

Lines changed: 48 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ export interface CartLineAddChange {
211211
attributes?: Attribute[];
212212

213213
/**
214-
* The identifier of the [selling plan](/docs/apps/build/purchase-options/subscriptions) to associate with this line item, such as a subscription or pre-order plan.
214+
* The identifier of the [selling plan](https://shopify.dev/docs/apps/build/purchase-options/subscriptions) to associate with this line item, such as a subscription or pre-order plan.
215215
*/
216216
sellingPlanId?: SellingPlan['id'];
217217

@@ -274,7 +274,7 @@ export interface CartLineUpdateChange {
274274
attributes?: Attribute[];
275275

276276
/**
277-
* The [selling plan](/docs/apps/build/purchase-options/subscriptions) to associate with this line item. Pass `null` to remove the item from its current selling plan.
277+
* The [selling plan](https://shopify.dev/docs/apps/build/purchase-options/subscriptions) to associate with this line item. Pass `null` to remove the item from its current selling plan.
278278
*/
279279
sellingPlanId?: SellingPlan['id'] | null;
280280

@@ -412,13 +412,13 @@ export interface GiftCardChangeResultSuccess {
412412
*/
413413
export interface GiftCardChangeResultError {
414414
/**
415-
* Indicates that the gift card change couldn't be applied. Check the `message` property for details.
415+
* Indicates that the gift card change couldnt be applied. Check the `message` property for details.
416416
*/
417-
type: 'error';
417+
type: error;
418418

419419
/**
420420
* A message that explains the error. This message is useful for debugging.
421-
* It isn't localized and shouldn't be displayed to the buyer.
421+
* It isnt localized and shouldnt be displayed to the buyer.
422422
*/
423423
message: string;
424424
}
@@ -432,7 +432,7 @@ export interface MetafieldRemoveChange {
432432
/**
433433
* The type of the `MetafieldRemoveChange` API.
434434
*/
435-
type: 'removeMetafield';
435+
type: removeMetafield;
436436

437437
/**
438438
* The name of the metafield to remove.
@@ -445,12 +445,12 @@ export interface MetafieldRemoveChange {
445445
namespace: string;
446446
}
447447

448-
/** Removes a cart [metafield](/docs/apps/build/custom-data/metafields). Pass this to `applyMetafieldChange()` to delete a metafield by key and namespace. */
448+
/** Removes a cart [metafield](https://shopify.dev/docs/apps/build/custom-data/metafields). Pass this to `applyMetafieldChange()` to delete a metafield by key and namespace. */
449449
export interface MetafieldRemoveCartChange {
450450
/**
451451
* Identifies this as a cart metafield removal. Set this when creating a change to delete an existing metafield by key and namespace.
452452
*/
453-
type: 'removeCartMetafield';
453+
type: removeCartMetafield;
454454

455455
/**
456456
* The name of the metafield to remove.
@@ -474,7 +474,7 @@ export interface MetafieldUpdateChange {
474474
/**
475475
* The type of the `MetafieldUpdateChange` API.
476476
*/
477-
type: 'updateMetafield';
477+
type: updateMetafield;
478478

479479
/** The name of the metafield to update. */
480480
key: string;
@@ -488,11 +488,11 @@ export interface MetafieldUpdateChange {
488488
/**
489489
* The metafield’s information type.
490490
*/
491-
valueType: 'integer' | 'string' | 'json_string';
491+
valueType: integer | string | json_string;
492492
}
493493

494494
/**
495-
* Creates or updates a cart [metafield](/docs/apps/build/custom-data/metafields). Pass this to `applyMetafieldChange()` to set a metafield value. If a metafield with the provided key and namespace doesn’t already exist, then it gets created.
495+
* Creates or updates a cart [metafield](https://shopify.dev/docs/apps/build/custom-data/metafields). Pass this to `applyMetafieldChange()` to set a metafield value. If a metafield with the provided key and namespace doesn’t already exist, then it gets created.
496496
*/
497497
export interface MetafieldUpdateCartChange {
498498
/**
@@ -515,7 +515,7 @@ export interface MetafieldUpdateCartChange {
515515

516516
/**
517517
* The metafield’s information type.
518-
* See the [metafield types documentation](/docs/apps/build/custom-data/metafields/list-of-data-types) for a list of supported types.
518+
* See the [metafield types documentation](https://shopify.dev/docs/apps/build/custom-data/metafields/list-of-data-types) for a list of supported types.
519519
*/
520520
type: string;
521521
};
@@ -524,8 +524,10 @@ export interface MetafieldUpdateCartChange {
524524
/**
525525
* The input for `applyMetafieldChange()`. Use the `type` property to specify the operation.
526526
*
527-
* - `MetafieldRemoveCartChange` (`type: 'removeCartMetafield'`): Removes an existing cart [metafield](/docs/apps/build/custom-data/metafields).
528-
* - `MetafieldUpdateCartChange` (`type: 'updateCartMetafield'`): Creates or updates a cart metafield.
527+
* - `MetafieldRemoveCartChange` (`type: ‘removeCartMetafield’`): Removes an existing cart [metafield](https://shopify.dev/docs/apps/build/custom-data/metafields).
528+
* - `MetafieldUpdateCartChange` (`type: ‘updateCartMetafield’`): Creates or updates a cart metafield.
529+
* - `MetafieldRemoveChange` (`type: ‘removeMetafield’`) - Deprecated. Use `MetafieldRemoveCartChange` instead.
530+
* - `MetafieldUpdateChange` (`type: ‘updateMetafield’`) - Deprecated. Use `MetafieldUpdateCartChange` instead.
529531
*/
530532
export type MetafieldChange =
531533
| MetafieldRemoveChange
@@ -534,27 +536,27 @@ export type MetafieldChange =
534536
| MetafieldUpdateCartChange;
535537

536538
/**
537-
* The result of a successful metafield change. The `type` property is `'success'`.
539+
* The result of a successful metafield change. The `type` property is `success`.
538540
*/
539541
export interface MetafieldChangeResultSuccess {
540542
/**
541543
* Indicates that the metafield change was applied successfully.
542544
*/
543-
type: 'success';
545+
type: success;
544546
}
545547

546548
/**
547549
* The result of a failed metafield change. Check the `message` property for details about what went wrong.
548550
*/
549551
export interface MetafieldChangeResultError {
550552
/**
551-
* Indicates that the metafield change couldn't be applied. Check the `message` property for details.
553+
* Indicates that the metafield change couldnt be applied. Check the `message` property for details.
552554
*/
553-
type: 'error';
555+
type: error;
554556

555557
/**
556558
* A message that explains the error. This message is useful for debugging.
557-
* It isn't localized and shouldn't be displayed to the buyer.
559+
* It isnt localized and shouldnt be displayed to the buyer.
558560
*/
559561
message: string;
560562
}
@@ -567,35 +569,35 @@ export type MetafieldChangeResult =
567569
| MetafieldChangeResultError;
568570

569571
/**
570-
* Updates the buyer's shipping address on the checkout. Pass this to `applyShippingAddressChange()` to modify specific address fields without replacing the entire address.
572+
* Updates the buyers shipping address on the checkout. Pass this to `applyShippingAddressChange()` to modify specific address fields without replacing the entire address.
571573
*/
572574
export interface ShippingAddressUpdateChange {
573575
/**
574576
* Identifies this as a shipping address update. This is the only supported change type for `applyShippingAddressChange()`.
575577
*/
576-
type: 'updateShippingAddress';
578+
type: updateShippingAddress;
577579

578580
/**
579581
* Fields to update in the shipping address. You only need to provide
580-
* values for the fields you want to update. Any fields you don't list
582+
* values for the fields you want to update. Any fields you dont list
581583
* keep their current values.
582584
*/
583585
address: Partial<ShippingAddress>;
584586
}
585587

586588
/**
587-
* The input for `applyShippingAddressChange()`. Currently only supports `ShippingAddressUpdateChange` (with `type: 'updateShippingAddress'`).
589+
* The input for `applyShippingAddressChange()`. Currently only supports `ShippingAddressUpdateChange` (with `type: updateShippingAddress`).
588590
*/
589591
export type ShippingAddressChange = ShippingAddressUpdateChange;
590592

591593
/**
592-
* The result of a successful shipping address change. The `type` property is `'success'` and `errors` is `null`.
594+
* The result of a successful shipping address change. The `type` property is `success` and `errors` is `null`.
593595
*/
594596
export interface ShippingAddressChangeResultSuccess {
595597
/**
596598
* Indicates that the shipping address change was applied successfully.
597599
*/
598-
type: 'success';
600+
type: success;
599601

600602
/**
601603
* Always `null` for a successful address change. Present so that you can
@@ -609,13 +611,13 @@ export interface ShippingAddressChangeResultSuccess {
609611
*/
610612
export interface ShippingAddressChangeFieldError {
611613
/**
612-
* The `MailingAddress` field that caused the error, such as `'countryCode'` or `'zip'`. The value is `undefined` if the error isn't specific to a single field.
614+
* The `MailingAddress` field that caused the error, such as `countryCode` or `zip`. The value is `undefined` if the error isnt specific to a single field.
613615
*/
614616
field?: keyof MailingAddress;
615617

616618
/**
617619
* A message that explains the error. This message is useful for debugging.
618-
* It isn't localized and shouldn't be displayed to the buyer.
620+
* It isnt localized and shouldnt be displayed to the buyer.
619621
*/
620622
message: string;
621623
}
@@ -625,9 +627,9 @@ export interface ShippingAddressChangeFieldError {
625627
*/
626628
export interface ShippingAddressChangeResultError {
627629
/**
628-
* Indicates that the shipping address change couldn't be applied. Check the `errors` array for field-level details.
630+
* Indicates that the shipping address change couldnt be applied. Check the `errors` array for field-level details.
629631
*/
630-
type: 'error';
632+
type: error;
631633

632634
/**
633635
* The list of field-level errors that prevented the address change. Each entry identifies which address field failed and why.
@@ -648,61 +650,61 @@ export type ShippingAddressChangeResult =
648650
export interface CheckoutApi {
649651
/**
650652
* Updates or removes an attribute on the cart and checkout. On success, the
651-
* [`attributes`](/docs/api/checkout-ui-extensions/apis/attributes#standardapi-propertydetail-attributes) property updates to reflect the change.
653+
* [`attributes`](https://shopify.dev/docs/api/checkout-ui-extensions/{API_VERSION}/apis/attributes#standardapi-propertydetail-attributes) property updates to reflect the change.
652654
*
653-
* > Note: This method returns an error if the [cart instruction](/docs/api/checkout-ui-extensions/apis/cart-instructions#standardapi-propertydetail-instructions) `attributes.canUpdateAttributes` is false, or the buyer is using an accelerated checkout method, such as Apple Pay or Google Pay.
655+
* > Note: This method returns an error if the [cart instruction](https://shopify.dev/docs/api/checkout-ui-extensions/{API_VERSION}/apis/cart-instructions#standardapi-propertydetail-instructions) `attributes.canUpdateAttributes` is false, or the buyer is using an accelerated checkout method, such as Apple Pay or Google Pay.
654656
*
655657
* @deprecated Use cart metafields instead.
656658
*/
657659
applyAttributeChange(change: AttributeChange): Promise<AttributeChangeResult>;
658660

659661
/**
660-
* Adds, removes, or updates line items in the cart. The returned promise resolves when the change has been applied by the server, and the [`lines`](/docs/api/checkout-ui-extensions/apis/cart-lines#standardapi-propertydetail-lines) property updates with the new state.
662+
* Adds, removes, or updates line items in the cart. The returned promise resolves when the change has been applied by the server, and the [`lines`](https://shopify.dev/docs/api/checkout-ui-extensions/{API_VERSION}/apis/cart-lines#standardapi-propertydetail-lines) property updates with the new state.
661663
*
662-
* > Note: This method returns an error if the [cart instruction](/docs/api/checkout-ui-extensions/apis/cart-instructions#standardapi-propertydetail-instructions) `lines.canAddCartLine` is false, or the buyer is using an accelerated checkout method, such as Apple Pay or Google Pay.
664+
* > Note: This method returns an error if the [cart instruction](https://shopify.dev/docs/api/checkout-ui-extensions/{API_VERSION}/apis/cart-instructions#standardapi-propertydetail-instructions) `lines.canAddCartLine` is false, or the buyer is using an accelerated checkout method, such as Apple Pay or Google Pay.
663665
*/
664666
applyCartLinesChange(change: CartLineChange): Promise<CartLineChangeResult>;
665667

666668
/**
667-
* Adds or removes a discount code on the checkout. The returned promise resolves when the change has been applied by the server, and the [`discountCodes`](/docs/api/checkout-ui-extensions/apis/discounts#standardapi-propertydetail-discountcodes) property updates with the new state.
669+
* Adds or removes a discount code on the checkout. The returned promise resolves when the change has been applied by the server, and the [`discountCodes`](https://shopify.dev/docs/api/checkout-ui-extensions/{API_VERSION}/apis/discounts#standardapi-propertydetail-discountcodes) property updates with the new state.
668670
*
669671
* > Caution:
670-
* > See [security considerations](/docs/api/checkout-ui-extensions/configuration#network-access) if your extension retrieves discount codes through a network call.
672+
* > See [security considerations](https://shopify.dev/docs/api/checkout-ui-extensions/{API_VERSION}/configuration#network-access) if your extension retrieves discount codes through a network call.
671673
*
672-
* > Note: This method returns an error if the [cart instruction](/docs/api/checkout-ui-extensions/apis/cart-instructions#standardapi-propertydetail-instructions) `discounts.canUpdateDiscountCodes` is false, or the buyer is using an accelerated checkout method, such as Apple Pay or Google Pay.
674+
* > Note: This method returns an error if the [cart instruction](https://shopify.dev/docs/api/checkout-ui-extensions/{API_VERSION}/apis/cart-instructions#standardapi-propertydetail-instructions) `discounts.canUpdateDiscountCodes` is false, or the buyer is using an accelerated checkout method, such as Apple Pay or Google Pay.
673675
*/
674676
applyDiscountCodeChange(
675677
change: DiscountCodeChange,
676678
): Promise<DiscountCodeChangeResult>;
677679

678680
/**
679-
* Adds or removes a gift card from the checkout. The returned promise resolves when the change has been applied by the server, and the [`appliedGiftCards`](/docs/api/checkout-ui-extensions/apis/gift-cards#standardapi-propertydetail-appliedgiftcards) property updates with the new state.
681+
* Adds or removes a gift card from the checkout. The returned promise resolves when the change has been applied by the server, and the [`appliedGiftCards`](https://shopify.dev/docs/api/checkout-ui-extensions/{API_VERSION}/apis/gift-cards#standardapi-propertydetail-appliedgiftcards) property updates with the new state.
680682
*
681683
* > Caution:
682-
* > See [security considerations](/docs/api/checkout-ui-extensions/configuration#network-access) if your extension retrieves gift card codes through a network call.
684+
* > See [security considerations](https://shopify.dev/docs/api/checkout-ui-extensions/{API_VERSION}/configuration#network-access) if your extension retrieves gift card codes through a network call.
683685
*
684686
* > Note: This method returns an error if the buyer is using an accelerated checkout method, such as Apple Pay or Google Pay.
685687
*/
686688
applyGiftCardChange(change: GiftCardChange): Promise<GiftCardChangeResult>;
687689

688690
/**
689691
* Creates, updates, or removes a cart metafield on the checkout. On success, the
690-
* [`metafields`](/docs/api/checkout-ui-extensions/apis/metafields#standardapi-propertydetail-metafields) property updates to reflect the change.
692+
* [`metafields`](https://shopify.dev/docs/api/checkout-ui-extensions/{API_VERSION}/apis/metafields#standardapi-propertydetail-metafields) property updates to reflect the change.
691693
*
692-
* Cart metafields are copied to order metafields at order creation time if there’s a matching order metafield definition with the [`cart to order copyable`](/docs/apps/build/metafields/use-metafield-capabilities#cart-to-order-copyable) capability enabled.
694+
* Cart metafields are copied to order metafields at order creation time if there’s a matching order metafield definition with the [`cart to order copyable`](https://shopify.dev/docs/apps/build/metafields/use-metafield-capabilities#cart-to-order-copyable) capability enabled.
693695
*
694696
* > Caution: `MetafieldRemoveChange` and `MetafieldUpdateChange` are deprecated. Use cart metafields with `MetafieldRemoveCartChange` and `MetafieldUpdateCartChange` instead. If `MetafieldUpdateChange` writes a metafield with the same namespace and key as a cart metafield that’s configured to copy, the cart metafield won’t be copied.
695697
*
696-
* > Note: This method returns an error if the [cart instruction](/docs/api/checkout-ui-extensions/apis/cart-instructions#standardapi-propertydetail-instructions) `metafields.canSetCartMetafields` is false, or the buyer is using an accelerated checkout method, such as Apple Pay or Google Pay.
698+
* > Note: This method returns an error if the [cart instruction](https://shopify.dev/docs/api/checkout-ui-extensions/{API_VERSION}/apis/cart-instructions#standardapi-propertydetail-instructions) `metafields.canSetCartMetafields` is false, or the buyer is using an accelerated checkout method, such as Apple Pay or Google Pay.
697699
*/
698700
applyMetafieldChange(change: MetafieldChange): Promise<MetafieldChangeResult>;
699701

700702
/**
701-
* Sets or removes the buyer's note on the checkout. On success, the
702-
* [`note`](/docs/api/checkout-ui-extensions/apis/note#standardapi-propertydetail-note)
703+
* Sets or removes the buyers note on the checkout. On success, the
704+
* [`note`](https://shopify.dev/docs/api/checkout-ui-extensions/{API_VERSION}/apis/note#standardapi-propertydetail-note)
703705
* property updates to reflect the change.
704706
*
705-
* > Note: This method returns an error if the [cart instruction](/docs/api/checkout-ui-extensions/apis/cart-instructions#standardapi-propertydetail-instructions) `notes.canUpdateNote` is false, or the buyer is using an accelerated checkout method, such as Apple Pay or Google Pay.
707+
* > Note: This method returns an error if the [cart instruction](https://shopify.dev/docs/api/checkout-ui-extensions/{API_VERSION}/apis/cart-instructions#standardapi-propertydetail-instructions) `notes.canUpdateNote` is false, or the buyer is using an accelerated checkout method, such as Apple Pay or Google Pay.
706708
*/
707709
applyNoteChange(change: NoteChange): Promise<NoteChangeResult>;
708710

@@ -716,9 +718,9 @@ export interface CheckoutApi {
716718
* are merged into the existing address without prompting the buyer. On success,
717719
* the `shippingAddress` property updates to reflect the change.
718720
*
719-
* > Note: This method returns an error if the [cart instruction](/docs/api/checkout-ui-extensions/apis/cart-instructions#standardapi-propertydetail-instructions) `delivery.canSelectCustomAddress` is false, or the buyer is using an accelerated checkout method, such as Apple Pay or Google Pay.
721+
* > Note: This method returns an error if the [cart instruction](https://shopify.dev/docs/api/checkout-ui-extensions/{API_VERSION}/apis/cart-instructions#standardapi-propertydetail-instructions) `delivery.canSelectCustomAddress` is false, or the buyer is using an accelerated checkout method, such as Apple Pay or Google Pay.
720722
*
721-
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
723+
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
722724
*/
723725
applyShippingAddressChange?(
724726
change: ShippingAddressChange,

packages/ui-extensions/src/surfaces/checkout/api/order-confirmation/order-confirmation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export interface OrderConfirmation {
44
order: {
55
/**
66
* A globally unique identifier for the order. This becomes the
7-
* [`Order`](/docs/api/admin-graphql/latest/objects/Order) object ID in the
7+
* [`Order`](https://shopify.dev/docs/api/admin-graphql/latest/objects/Order) object ID in the
88
* GraphQL Admin API after the order is created.
99
*
1010
* @example 'gid://shopify/Order/123'

0 commit comments

Comments
 (0)