commerce-kit 0.39.2 → 0.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -0
- package/dist/api-types.d.ts +596 -29
- package/dist/browser.js +3 -3
- package/dist/browser.js.map +1 -1
- package/dist/feedback-toolbar.js +3 -3
- package/dist/feedback-toolbar.js.map +1 -1
- package/dist/index.d.ts +27 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -71,6 +71,35 @@ const { data, meta } = await commerce.orderBrowse({
|
|
|
71
71
|
const order = await commerce.orderGet({ id: 'order_789' });
|
|
72
72
|
```
|
|
73
73
|
|
|
74
|
+
## Events
|
|
75
|
+
|
|
76
|
+
An event is a product flagged as an event (with a date, location, and capacity) plus a single
|
|
77
|
+
non-shippable ticket variant. Requires the store's **Events tool** to be enabled.
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
// List events (with live ticketsSold counts)
|
|
81
|
+
const { data, total } = await commerce.eventBrowse({ limit: 10, offset: 0 });
|
|
82
|
+
|
|
83
|
+
// Get one event by id or slug
|
|
84
|
+
const { event } = await commerce.eventGet({ idOrSlug: 'summer-fest' });
|
|
85
|
+
|
|
86
|
+
// Create an event (ticket price is a decimal string)
|
|
87
|
+
const { event } = await commerce.eventCreate({
|
|
88
|
+
name: 'Summer Fest',
|
|
89
|
+
price: '29.99',
|
|
90
|
+
startsAt: '2026-07-01T18:00:00Z',
|
|
91
|
+
location: 'Berlin',
|
|
92
|
+
capacity: 500,
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
// Update event metadata (partial; send null to clear a field).
|
|
96
|
+
// Does not change the ticket price/variants — use the products API for those.
|
|
97
|
+
await commerce.eventUpdate({ idOrSlug: 'summer-fest' }, { capacity: 600, status: 'published' });
|
|
98
|
+
|
|
99
|
+
// Attendee rollup (buyers and ticket quantities, from paid orders)
|
|
100
|
+
const { attendees, totalTickets } = await commerce.eventAttendeesBrowse({ idOrSlug: 'summer-fest' });
|
|
101
|
+
```
|
|
102
|
+
|
|
74
103
|
## Raw API Requests
|
|
75
104
|
|
|
76
105
|
For endpoints not yet implemented in the SDK, use the `request()` method:
|