Skip to content

Commit 9bb29df

Browse files
committed
Add examples for checkout data APIs
Add 17 new code examples with action-oriented titles and POS-style descriptions for checkout data APIs that previously had none or fewer than two examples. New examples (2 each): - Addresses API: read shipping/billing address - Buyer Identity API: display customer info, B2B purchasing company - Checkout Token API: access token, display support reference - Cost API: order cost summary, free shipping progress - Discounts API: display codes, apply/remove codes - Gift Cards API: display applied cards, apply a card - Note API: display note, add/update note Additional examples (1 each for APIs that had only 1): - Cart Lines API: display cart line item details - Customer Privacy API: display consent banner - Order API: display first-time buyer offer Also updates 10 existing example titles to use action-oriented imperative verbs consistent with admin and POS surface conventions. Made-with: Cursor
1 parent 15edd22 commit 9bb29df

28 files changed

Lines changed: 721 additions & 9 deletions

packages/ui-extensions/docs/surfaces/checkout/reference/apis/address.doc.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type {ReferenceEntityTemplateSchema} from '@shopify/generate-docs';
22

33
import {
44
getLinksByTag,
5+
getExample,
56
STANDARD_API_PROPERTIES_DESCRIPTION,
67
CHECKOUT_API_PROPERTIES_DESCRIPTION,
78
REQUIRES_PROTECTED_CUSTOMER_DATA_LEVEL_2,
@@ -45,6 +46,11 @@ const data: ReferenceEntityTemplateSchema = {
4546
type: 'UseApplyShippingAddressChangeGeneratedType',
4647
},
4748
],
49+
defaultExample: getExample('address/shipping-address', ['jsx']),
50+
examples: {
51+
description: '',
52+
examples: [getExample('address/billing-address', ['jsx'])],
53+
},
4854
related: getLinksByTag('apis'),
4955
};
5056

packages/ui-extensions/docs/surfaces/checkout/reference/apis/buyer-identity.doc.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type {ReferenceEntityTemplateSchema} from '@shopify/generate-docs';
33
import {
44
STANDARD_API_PROPERTIES_DESCRIPTION,
55
REQUIRES_PROTECTED_CUSTOMER_DATA_LEVEL_2,
6+
getExample,
67
getLinksByTag,
78
} from '../helper.docs';
89

@@ -45,6 +46,11 @@ const data: ReferenceEntityTemplateSchema = {
4546
type: 'UsePurchasingCompanyGeneratedType',
4647
},
4748
],
49+
defaultExample: getExample('buyer-identity/customer-info', ['jsx']),
50+
examples: {
51+
description: '',
52+
examples: [getExample('buyer-identity/purchasing-company', ['jsx'])],
53+
},
4854
related: getLinksByTag('apis'),
4955
};
5056

packages/ui-extensions/docs/surfaces/checkout/reference/apis/cart-lines.doc.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ const data: ReferenceEntityTemplateSchema = {
5757
},
5858
],
5959
defaultExample: getExample('cart-line-item/default', ['jsx']),
60+
examples: {
61+
description: '',
62+
examples: [getExample('cart-lines/summary', ['jsx'])],
63+
},
6064
related: getLinksByTag('apis'),
6165
};
6266

packages/ui-extensions/docs/surfaces/checkout/reference/apis/checkout-token.doc.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type {ReferenceEntityTemplateSchema} from '@shopify/generate-docs';
22

33
import {
44
getLinksByTag,
5+
getExample,
56
STANDARD_API_PROPERTIES_DESCRIPTION,
67
} from '../helper.docs';
78

@@ -24,6 +25,11 @@ const data: ReferenceEntityTemplateSchema = {
2425
type: 'UseCheckoutTokenGeneratedType',
2526
},
2627
],
28+
defaultExample: getExample('checkout-token/default', ['jsx']),
29+
examples: {
30+
description: '',
31+
examples: [getExample('checkout-token/support-message', ['jsx'])],
32+
},
2733
related: getLinksByTag('apis'),
2834
};
2935

packages/ui-extensions/docs/surfaces/checkout/reference/apis/cost.doc.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type {ReferenceEntityTemplateSchema} from '@shopify/generate-docs';
22

33
import {
44
getLinksByTag,
5+
getExample,
56
STANDARD_API_PROPERTIES_DESCRIPTION,
67
} from '../helper.docs';
78

@@ -43,6 +44,11 @@ const data: ReferenceEntityTemplateSchema = {
4344
type: 'UseTotalAmountGeneratedType',
4445
},
4546
],
47+
defaultExample: getExample('cost/order-summary', ['jsx']),
48+
examples: {
49+
description: '',
50+
examples: [getExample('cost/free-shipping-goal', ['jsx'])],
51+
},
4652
related: getLinksByTag('apis'),
4753
};
4854

packages/ui-extensions/docs/surfaces/checkout/reference/apis/customer-privacy.doc.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ const data: ReferenceEntityTemplateSchema = {
3232
},
3333
],
3434
defaultExample: getExample('customer-privacy/default', ['jsx']),
35+
examples: {
36+
description: '',
37+
examples: [getExample('customer-privacy/consent-banner', ['jsx'])],
38+
},
3539
related: getLinksByTag('apis'),
3640
};
3741

packages/ui-extensions/docs/surfaces/checkout/reference/apis/discounts.doc.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type {ReferenceEntityTemplateSchema} from '@shopify/generate-docs';
22

33
import {
44
CHECKOUT_API_PROPERTIES_DESCRIPTION,
5+
getExample,
56
getLinksByTag,
67
STANDARD_API_PROPERTIES_DESCRIPTION,
78
} from '../helper.docs';
@@ -41,6 +42,11 @@ const data: ReferenceEntityTemplateSchema = {
4142
type: 'UseDiscountCodesGeneratedType',
4243
},
4344
],
45+
defaultExample: getExample('discounts/discount-codes', ['jsx']),
46+
examples: {
47+
description: '',
48+
examples: [getExample('discounts/apply-discount', ['jsx'])],
49+
},
4450
related: getLinksByTag('apis'),
4551
};
4652

packages/ui-extensions/docs/surfaces/checkout/reference/apis/gift-cards.doc.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type {ReferenceEntityTemplateSchema} from '@shopify/generate-docs';
22

33
import {
44
CHECKOUT_API_PROPERTIES_DESCRIPTION,
5+
getExample,
56
getLinksByTag,
67
STANDARD_API_PROPERTIES_DESCRIPTION,
78
} from '../helper.docs';
@@ -35,6 +36,11 @@ const data: ReferenceEntityTemplateSchema = {
3536
type: 'UseApplyGiftCardChangeGeneratedType',
3637
},
3738
],
39+
defaultExample: getExample('gift-cards/applied-gift-cards', ['jsx']),
40+
examples: {
41+
description: '',
42+
examples: [getExample('gift-cards/apply-gift-card', ['jsx'])],
43+
},
3844
related: getLinksByTag('apis'),
3945
};
4046

packages/ui-extensions/docs/surfaces/checkout/reference/apis/note.doc.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type {ReferenceEntityTemplateSchema} from '@shopify/generate-docs';
22

33
import {
44
CHECKOUT_API_PROPERTIES_DESCRIPTION,
5+
getExample,
56
getLinksByTag,
67
STANDARD_API_PROPERTIES_DESCRIPTION,
78
} from '../helper.docs';
@@ -36,6 +37,11 @@ const data: ReferenceEntityTemplateSchema = {
3637
type: 'UseApplyNoteChangeGeneratedType',
3738
},
3839
],
40+
defaultExample: getExample('note/display-note', ['jsx']),
41+
examples: {
42+
description: '',
43+
examples: [getExample('note/update-note', ['jsx'])],
44+
},
3945
related: getLinksByTag('apis'),
4046
};
4147

packages/ui-extensions/docs/surfaces/checkout/reference/apis/order.doc.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ const data: ReferenceEntityTemplateSchema = {
2424
subCategory: 'Checkout APIs',
2525
type: 'API',
2626
defaultExample: getExample('order-confirmation/default', ['jsx']),
27+
examples: {
28+
description: '',
29+
examples: [getExample('order-confirmation/first-order', ['jsx'])],
30+
},
2731
definitions: [
2832
{
2933
title: 'OrderConfirmationApi',

0 commit comments

Comments
 (0)