listbee 0.3.0 → 0.5.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 +113 -15
- package/dist/cjs/index.d.ts +3 -3
- package/dist/cjs/index.js +4 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/resources/listings.js +13 -1
- package/dist/cjs/resources/listings.js.map +1 -1
- package/dist/cjs/resources/orders.d.ts +34 -2
- package/dist/cjs/resources/orders.js +48 -1
- package/dist/cjs/resources/orders.js.map +1 -1
- package/dist/cjs/types/index.d.ts +3 -3
- package/dist/cjs/types/index.js +4 -1
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/cjs/types/listing.d.ts +17 -7
- package/dist/cjs/types/order.d.ts +36 -3
- package/dist/cjs/types/shared.d.ts +75 -4
- package/dist/cjs/types/shared.js +29 -5
- package/dist/cjs/types/shared.js.map +1 -1
- package/dist/esm/index.d.ts +3 -3
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/resources/listings.js +13 -1
- package/dist/esm/resources/listings.js.map +1 -1
- package/dist/esm/resources/orders.d.ts +34 -2
- package/dist/esm/resources/orders.js +48 -1
- package/dist/esm/resources/orders.js.map +1 -1
- package/dist/esm/types/index.d.ts +3 -3
- package/dist/esm/types/index.js +1 -1
- package/dist/esm/types/index.js.map +1 -1
- package/dist/esm/types/listing.d.ts +17 -7
- package/dist/esm/types/order.d.ts +36 -3
- package/dist/esm/types/shared.d.ts +75 -4
- package/dist/esm/types/shared.js +28 -4
- package/dist/esm/types/shared.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,12 +19,23 @@ import { ListBee } from 'listbee';
|
|
|
19
19
|
|
|
20
20
|
const client = new ListBee({ apiKey: 'lb_...' });
|
|
21
21
|
|
|
22
|
+
// Managed fulfillment — ListBee delivers a file automatically
|
|
22
23
|
const listing = await client.listings.create({
|
|
23
24
|
name: 'SEO Playbook',
|
|
24
25
|
price: 2900,
|
|
25
26
|
content: 'https://example.com/seo-playbook.pdf',
|
|
26
27
|
});
|
|
27
28
|
console.log(listing.url); // https://buy.listbee.so/r7kq2xy9
|
|
29
|
+
|
|
30
|
+
// External fulfillment — you handle delivery via webhooks
|
|
31
|
+
const report = await client.listings.create({
|
|
32
|
+
name: 'Custom SEO Report',
|
|
33
|
+
price: 4900,
|
|
34
|
+
fulfillment: 'external',
|
|
35
|
+
checkout_schema: [
|
|
36
|
+
{ type: 'text', key: 'website_url', label: 'Your website URL', required: true },
|
|
37
|
+
],
|
|
38
|
+
});
|
|
28
39
|
```
|
|
29
40
|
|
|
30
41
|
Using an environment variable instead:
|
|
@@ -76,13 +87,24 @@ import { ListBee } from 'listbee';
|
|
|
76
87
|
|
|
77
88
|
const client = new ListBee({ apiKey: 'lb_...' });
|
|
78
89
|
|
|
79
|
-
// Create —
|
|
90
|
+
// Create — managed fulfillment (ListBee delivers the file)
|
|
80
91
|
const listing = await client.listings.create({
|
|
81
92
|
name: 'SEO Playbook',
|
|
82
93
|
price: 2900, // $29.00 in cents
|
|
83
94
|
content: 'https://example.com/seo-playbook.pdf', // file URL, redirect URL, or plain text
|
|
84
95
|
});
|
|
85
96
|
|
|
97
|
+
// Create — external fulfillment (you deliver via webhooks)
|
|
98
|
+
const report = await client.listings.create({
|
|
99
|
+
name: 'Custom SEO Report',
|
|
100
|
+
price: 4900,
|
|
101
|
+
fulfillment: 'external',
|
|
102
|
+
checkout_schema: [
|
|
103
|
+
{ type: 'text', key: 'website_url', label: 'Your website URL', required: true },
|
|
104
|
+
{ type: 'select', key: 'priority', label: 'Priority', required: false, options: ['standard', 'rush'] },
|
|
105
|
+
],
|
|
106
|
+
});
|
|
107
|
+
|
|
86
108
|
// Create — all optional params
|
|
87
109
|
const listing = await client.listings.create({
|
|
88
110
|
name: 'SEO Playbook 2026',
|
|
@@ -143,7 +165,7 @@ for (const order of page.data) {
|
|
|
143
165
|
|
|
144
166
|
// Filter by status, listing, date range
|
|
145
167
|
const page = await client.orders.list({
|
|
146
|
-
status: '
|
|
168
|
+
status: 'paid',
|
|
147
169
|
listing: 'seo-playbook',
|
|
148
170
|
created_after: new Date('2026-03-01'),
|
|
149
171
|
created_before: '2026-03-31T23:59:59Z', // Date objects or ISO strings
|
|
@@ -152,6 +174,33 @@ const page = await client.orders.list({
|
|
|
152
174
|
// Get by ID
|
|
153
175
|
const order = await client.orders.get('ord_9xM4kP7nR2qT5wY1');
|
|
154
176
|
console.log(order.listing_id, order.amount);
|
|
177
|
+
console.log(order.status); // "pending" | "paid" | "fulfilled" | "canceled" | "failed"
|
|
178
|
+
console.log(order.fulfillment_status); // "pending" | "shipped" | "fulfilled" | null
|
|
179
|
+
console.log(order.checkout_data); // custom checkout field values
|
|
180
|
+
console.log(order.shipping_address); // ShippingAddress | null
|
|
181
|
+
console.log(order.paid_at); // ISO 8601 timestamp
|
|
182
|
+
|
|
183
|
+
// Fulfill an order — push content to the buyer (external fulfillment)
|
|
184
|
+
const fulfilled = await client.orders.fulfill('ord_9xM4kP7nR2qT5wY1', {
|
|
185
|
+
content: 'Your custom report is ready.',
|
|
186
|
+
content_type: 'text',
|
|
187
|
+
});
|
|
188
|
+
console.log(fulfilled.status); // "fulfilled"
|
|
189
|
+
console.log(fulfilled.fulfillment_status); // "fulfilled"
|
|
190
|
+
|
|
191
|
+
// Fulfill with a URL
|
|
192
|
+
await client.orders.fulfill('ord_9xM4kP7nR2qT5wY1', {
|
|
193
|
+
content_url: 'https://example.com/report.pdf',
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
// Ship an order — add tracking info
|
|
197
|
+
const shipped = await client.orders.ship('ord_9xM4kP7nR2qT5wY1', {
|
|
198
|
+
carrier: 'UPS',
|
|
199
|
+
tracking_code: '1Z999AA10123456784',
|
|
200
|
+
seller_note: 'Ships within 2 business days',
|
|
201
|
+
});
|
|
202
|
+
console.log(shipped.fulfillment_status); // "shipped"
|
|
203
|
+
console.log(shipped.carrier); // "UPS"
|
|
155
204
|
```
|
|
156
205
|
|
|
157
206
|
### Webhooks
|
|
@@ -166,8 +215,9 @@ const webhook = await client.webhooks.create({
|
|
|
166
215
|
name: 'Production endpoint',
|
|
167
216
|
url: 'https://example.com/webhooks/listbee',
|
|
168
217
|
events: [
|
|
169
|
-
WebhookEventType.
|
|
170
|
-
WebhookEventType.
|
|
218
|
+
WebhookEventType.ORDER_PAID,
|
|
219
|
+
WebhookEventType.ORDER_FULFILLED,
|
|
220
|
+
WebhookEventType.ORDER_SHIPPED,
|
|
171
221
|
],
|
|
172
222
|
});
|
|
173
223
|
console.log(webhook.id); // wh_3mK8nP2qR5tW7xY1
|
|
@@ -191,7 +241,7 @@ await client.webhooks.update('wh_3mK8nP2qR5tW7xY1', { enabled: false });
|
|
|
191
241
|
// Update — change URL and events
|
|
192
242
|
await client.webhooks.update('wh_3mK8nP2qR5tW7xY1', {
|
|
193
243
|
url: 'https://example.com/webhooks/v2',
|
|
194
|
-
events: [WebhookEventType.
|
|
244
|
+
events: [WebhookEventType.ORDER_PAID],
|
|
195
245
|
});
|
|
196
246
|
|
|
197
247
|
// List delivery events
|
|
@@ -326,6 +376,37 @@ console.log(connect.url); // redirect seller here
|
|
|
326
376
|
await client.stripe.disconnect();
|
|
327
377
|
```
|
|
328
378
|
|
|
379
|
+
## Fulfillment modes
|
|
380
|
+
|
|
381
|
+
ListBee supports two fulfillment modes:
|
|
382
|
+
|
|
383
|
+
- **Managed** — ListBee delivers digital content automatically (files, URLs, text). Set `content` when creating a listing.
|
|
384
|
+
- **External** — ListBee fires `order.paid` webhook, your app handles delivery. Use `orders.fulfill()` to push content back, or `orders.ship()` for physical goods.
|
|
385
|
+
|
|
386
|
+
```typescript
|
|
387
|
+
import { ListBee, FulfillmentMode } from 'listbee';
|
|
388
|
+
|
|
389
|
+
const client = new ListBee({ apiKey: 'lb_...' });
|
|
390
|
+
|
|
391
|
+
// Check fulfillment mode
|
|
392
|
+
const listing = await client.listings.get('my-listing');
|
|
393
|
+
if (listing.fulfillment === FulfillmentMode.EXTERNAL) {
|
|
394
|
+
// Handle delivery yourself
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
// Fulfill externally — push generated content
|
|
398
|
+
await client.orders.fulfill('ord_...', {
|
|
399
|
+
content: 'Your AI-generated report...',
|
|
400
|
+
content_type: 'text',
|
|
401
|
+
});
|
|
402
|
+
|
|
403
|
+
// Or ship physical goods
|
|
404
|
+
await client.orders.ship('ord_...', {
|
|
405
|
+
carrier: 'FedEx',
|
|
406
|
+
tracking_code: '7489274892',
|
|
407
|
+
});
|
|
408
|
+
```
|
|
409
|
+
|
|
329
410
|
## Readiness system
|
|
330
411
|
|
|
331
412
|
Every listing and account includes a `readiness` field that tells you whether it can currently accept payments.
|
|
@@ -484,13 +565,25 @@ import {
|
|
|
484
565
|
type DomainResponse,
|
|
485
566
|
type WebhookEventResponse,
|
|
486
567
|
type WebhookTestResponse,
|
|
568
|
+
type CheckoutField,
|
|
569
|
+
type ShippingAddress,
|
|
570
|
+
|
|
571
|
+
// Param types
|
|
572
|
+
type FulfillOrderParams,
|
|
573
|
+
type ShipOrderParams,
|
|
487
574
|
|
|
488
575
|
// Enums (runtime values)
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
576
|
+
DeliverableType, // "file" | "url" | "text"
|
|
577
|
+
FulfillmentMode, // "managed" | "external"
|
|
578
|
+
CheckoutFieldType, // "address" | "text" | "select" | "date"
|
|
579
|
+
OrderStatus, // "pending" | "paid" | "fulfilled" | "canceled" | "failed"
|
|
580
|
+
FulfillmentStatus, // "pending" | "shipped" | "fulfilled"
|
|
581
|
+
WebhookEventType, // "order.paid" | "order.fulfilled" | "order.shipped" | ...
|
|
582
|
+
ActionCode, // "set_stripe_key" | "connect_stripe" | "configure_webhook" | ...
|
|
583
|
+
ActionKind, // "api" | "human"
|
|
584
|
+
|
|
585
|
+
// Deprecated (use DeliverableType)
|
|
586
|
+
ContentType,
|
|
494
587
|
|
|
495
588
|
// Errors
|
|
496
589
|
ListBeeError,
|
|
@@ -509,20 +602,25 @@ import {
|
|
|
509
602
|
Enums are `as const` objects — use them to avoid magic strings:
|
|
510
603
|
|
|
511
604
|
```typescript
|
|
512
|
-
import {
|
|
605
|
+
import { DeliverableType, WebhookEventType, FulfillmentMode } from 'listbee';
|
|
513
606
|
|
|
514
|
-
// Check
|
|
515
|
-
if (listing.
|
|
607
|
+
// Check deliverable type
|
|
608
|
+
if (listing.deliverable_type === DeliverableType.FILE) {
|
|
516
609
|
console.log('Delivers a file');
|
|
517
610
|
}
|
|
518
611
|
|
|
612
|
+
// Check fulfillment mode
|
|
613
|
+
if (listing.fulfillment === FulfillmentMode.EXTERNAL) {
|
|
614
|
+
console.log('External fulfillment — handle delivery yourself');
|
|
615
|
+
}
|
|
616
|
+
|
|
519
617
|
// Subscribe to specific events
|
|
520
618
|
const webhook = await client.webhooks.create({
|
|
521
619
|
name: 'Orders only',
|
|
522
620
|
url: 'https://example.com/hooks',
|
|
523
621
|
events: [
|
|
524
|
-
WebhookEventType.
|
|
525
|
-
WebhookEventType.
|
|
622
|
+
WebhookEventType.ORDER_PAID,
|
|
623
|
+
WebhookEventType.ORDER_FULFILLED,
|
|
526
624
|
],
|
|
527
625
|
});
|
|
528
626
|
```
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -14,12 +14,12 @@ export { SignupResource } from './resources/signup';
|
|
|
14
14
|
export { StripeResource } from './resources/stripe';
|
|
15
15
|
export { StoresResource } from './resources/stores';
|
|
16
16
|
export { WebhooksResource } from './resources/webhooks';
|
|
17
|
-
export { ContentType, OrderStatus, WebhookEventType, ActionKind, ActionCode } from './types/shared';
|
|
18
|
-
export type { AccountReadiness, ListingReadiness, ReadinessAction, ListResponse, } from './types/shared';
|
|
17
|
+
export { ContentType, DeliverableType, FulfillmentMode, CheckoutFieldType, OrderStatus, WebhookEventType, ActionKind, ActionCode } from './types/shared';
|
|
18
|
+
export type { AccountReadiness, DeliverableResponse, ListingReadiness, ReadinessAction, ListResponse, CheckoutField, ShippingAddress, } from './types/shared';
|
|
19
19
|
export type { AccountResponse, UpdateAccountParams, AccountStats } from './types/account';
|
|
20
20
|
export type { BlurMode, CreateListingParams, FaqItem, ListingResponse, ListingStatus, Review, UpdateListingParams, } from './types/listing';
|
|
21
21
|
export type { ApiKeyResponse } from './types/api-key';
|
|
22
|
-
export type { OrderResponse, ListOrdersParams } from './types/order';
|
|
22
|
+
export type { OrderResponse, ListOrdersParams, FulfillOrderParams, ShipOrderParams } from './types/order';
|
|
23
23
|
export type { SignupResponse, VerifyResponse } from './types/signup';
|
|
24
24
|
export type { StripeConnectSessionResponse } from './types/stripe';
|
|
25
25
|
export type { WebhookResponse, CreateWebhookParams, UpdateWebhookParams, WebhookEventResponse, ListWebhookEventsParams, WebhookTestResponse, } from './types/webhook';
|
package/dist/cjs/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* ListBee TypeScript SDK — public exports.
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ActionCode = exports.ActionKind = exports.WebhookEventType = exports.OrderStatus = exports.ContentType = exports.WebhooksResource = exports.StoresResource = exports.StripeResource = exports.SignupResource = exports.OrdersResource = exports.ApiKeysResource = exports.ListingsResource = exports.AccountResource = exports.WebhookVerificationError = exports.ValidationError = exports.RateLimitError = exports.NotFoundError = exports.ListBeeError = exports.InternalServerError = exports.ConflictError = exports.AuthenticationError = exports.APITimeoutError = exports.APIStatusError = exports.APIConnectionError = exports.CursorPage = exports.ListBee = void 0;
|
|
6
|
+
exports.ActionCode = exports.ActionKind = exports.WebhookEventType = exports.OrderStatus = exports.CheckoutFieldType = exports.FulfillmentMode = exports.DeliverableType = exports.ContentType = exports.WebhooksResource = exports.StoresResource = exports.StripeResource = exports.SignupResource = exports.OrdersResource = exports.ApiKeysResource = exports.ListingsResource = exports.AccountResource = exports.WebhookVerificationError = exports.ValidationError = exports.RateLimitError = exports.NotFoundError = exports.ListBeeError = exports.InternalServerError = exports.ConflictError = exports.AuthenticationError = exports.APITimeoutError = exports.APIStatusError = exports.APIConnectionError = exports.CursorPage = exports.ListBee = void 0;
|
|
7
7
|
// Client
|
|
8
8
|
var client_1 = require("./client");
|
|
9
9
|
Object.defineProperty(exports, "ListBee", { enumerable: true, get: function () { return client_1.ListBee; } });
|
|
@@ -42,6 +42,9 @@ Object.defineProperty(exports, "WebhooksResource", { enumerable: true, get: func
|
|
|
42
42
|
// Enums (runtime values)
|
|
43
43
|
var shared_1 = require("./types/shared");
|
|
44
44
|
Object.defineProperty(exports, "ContentType", { enumerable: true, get: function () { return shared_1.ContentType; } });
|
|
45
|
+
Object.defineProperty(exports, "DeliverableType", { enumerable: true, get: function () { return shared_1.DeliverableType; } });
|
|
46
|
+
Object.defineProperty(exports, "FulfillmentMode", { enumerable: true, get: function () { return shared_1.FulfillmentMode; } });
|
|
47
|
+
Object.defineProperty(exports, "CheckoutFieldType", { enumerable: true, get: function () { return shared_1.CheckoutFieldType; } });
|
|
45
48
|
Object.defineProperty(exports, "OrderStatus", { enumerable: true, get: function () { return shared_1.OrderStatus; } });
|
|
46
49
|
Object.defineProperty(exports, "WebhookEventType", { enumerable: true, get: function () { return shared_1.WebhookEventType; } });
|
|
47
50
|
Object.defineProperty(exports, "ActionKind", { enumerable: true, get: function () { return shared_1.ActionKind; } });
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,SAAS;AACT,mCAAmC;AAA1B,iGAAA,OAAO,OAAA;AAEhB,6CAA2C;AAAlC,yGAAA,UAAU,OAAA;AAGnB,SAAS;AACT,mCAYkB;AAXhB,4GAAA,kBAAkB,OAAA;AAClB,wGAAA,cAAc,OAAA;AACd,yGAAA,eAAe,OAAA;AACf,6GAAA,mBAAmB,OAAA;AACnB,uGAAA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c,OAAA;AACvB,6CAAoD;AAA3C,wGAAA,cAAc,OAAA;AACvB,6CAAoD;AAA3C,wGAAA,cAAc,OAAA;AACvB,iDAAwD;AAA/C,4GAAA,gBAAgB,OAAA;AAEzB,yBAAyB;AACzB,yCAAyJ;AAAhJ,qGAAA,WAAW,OAAA;AAAE,yGAAA,eAAe,OAAA;AAAE,yGAAA,eAAe,OAAA;AAAE,2GAAA,iBAAiB,OAAA;AAAE,qGAAA,WAAW,OAAA;AAAE,0GAAA,gBAAgB,OAAA;AAAE,oGAAA,UAAU,OAAA;AAAE,oGAAA,UAAU,OAAA"}
|
|
@@ -22,7 +22,11 @@ class ListingsResource {
|
|
|
22
22
|
*/
|
|
23
23
|
async create(params) {
|
|
24
24
|
const { name, price, content, timeoutMs, cover_blur, ...rest } = params;
|
|
25
|
-
const body = { name, price
|
|
25
|
+
const body = { name, price };
|
|
26
|
+
// content is optional (omit for external fulfillment)
|
|
27
|
+
if (content !== undefined) {
|
|
28
|
+
body['content'] = content;
|
|
29
|
+
}
|
|
26
30
|
const optionalFields = [
|
|
27
31
|
'description',
|
|
28
32
|
'tagline',
|
|
@@ -37,6 +41,8 @@ class ListingsResource {
|
|
|
37
41
|
'reviews',
|
|
38
42
|
'faqs',
|
|
39
43
|
'store_id',
|
|
44
|
+
'fulfillment',
|
|
45
|
+
'checkout_schema',
|
|
40
46
|
];
|
|
41
47
|
for (const field of optionalFields) {
|
|
42
48
|
if (rest[field] !== undefined) {
|
|
@@ -112,12 +118,18 @@ class ListingsResource {
|
|
|
112
118
|
'rating_count',
|
|
113
119
|
'reviews',
|
|
114
120
|
'faqs',
|
|
121
|
+
'fulfillment',
|
|
122
|
+
'checkout_schema',
|
|
115
123
|
];
|
|
116
124
|
for (const field of fields) {
|
|
117
125
|
if (params[field] !== undefined) {
|
|
118
126
|
body[field] = params[field];
|
|
119
127
|
}
|
|
120
128
|
}
|
|
129
|
+
// checkout_schema can be explicitly set to null to clear it
|
|
130
|
+
if ('checkout_schema' in params && params.checkout_schema === null) {
|
|
131
|
+
body['checkout_schema'] = null;
|
|
132
|
+
}
|
|
121
133
|
// UTM fields — include when explicitly provided (even null)
|
|
122
134
|
if ('utm_source' in params)
|
|
123
135
|
body['utm_source'] = params.utm_source;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listings.js","sourceRoot":"","sources":["../../../src/resources/listings.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAGH,4CAAyD;AAGzD,8CAA8C;AAC9C,MAAa,gBAAgB;IAC3B,YAA6B,OAAmB;QAAnB,YAAO,GAAP,OAAO,CAAY;IAAG,CAAC;IAEpD;;;;;;;;;OASG;IACH,KAAK,CAAC,MAAM,CAAC,MAA2B;QACtC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACxE,MAAM,IAAI,GAA4B,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"listings.js","sourceRoot":"","sources":["../../../src/resources/listings.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAGH,4CAAyD;AAGzD,8CAA8C;AAC9C,MAAa,gBAAgB;IAC3B,YAA6B,OAAmB;QAAnB,YAAO,GAAP,OAAO,CAAY;IAAG,CAAC;IAEpD;;;;;;;;;OASG;IACH,KAAK,CAAC,MAAM,CAAC,MAA2B;QACtC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACxE,MAAM,IAAI,GAA4B,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;QAEtD,sDAAsD;QACtD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,IAAI,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC;QAC5B,CAAC;QAED,MAAM,cAAc,GAAG;YACrB,aAAa;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
4
5
|
import type { BaseClient, CursorPage } from '../base-client';
|
|
5
|
-
import type { OrderResponse, ListOrdersParams } from '../types/order';
|
|
6
|
+
import type { OrderResponse, ListOrdersParams, FulfillOrderParams, ShipOrderParams } from '../types/order';
|
|
6
7
|
export declare class OrdersResource {
|
|
7
8
|
private readonly _client;
|
|
8
9
|
constructor(_client: BaseClient);
|
|
10
|
+
/**
|
|
11
|
+
* Retrieve an order by ID.
|
|
12
|
+
*
|
|
13
|
+
* @param orderId - The order ID (e.g. "ord_9xM4kP7nR2qT5wY1").
|
|
14
|
+
* @returns The OrderResponse.
|
|
15
|
+
*/
|
|
9
16
|
get(orderId: string): Promise<OrderResponse>;
|
|
17
|
+
/**
|
|
18
|
+
* Return a paginated list of orders.
|
|
19
|
+
*
|
|
20
|
+
* @param params - Filter and pagination parameters.
|
|
21
|
+
* @returns A CursorPage of OrderResponse objects.
|
|
22
|
+
*/
|
|
10
23
|
list(params?: ListOrdersParams): Promise<CursorPage<OrderResponse>>;
|
|
24
|
+
/**
|
|
25
|
+
* Fulfill an order — attach a deliverable and transition to FULFILLED.
|
|
26
|
+
*
|
|
27
|
+
* For external fulfillment listings, this allows your app to push
|
|
28
|
+
* generated content back to ListBee for delivery.
|
|
29
|
+
*
|
|
30
|
+
* @param orderId - The order ID (e.g. "ord_9xM4kP7nR2qT5wY1").
|
|
31
|
+
* @param params - Fulfillment parameters including the required deliverable ID.
|
|
32
|
+
* @returns The updated OrderResponse.
|
|
33
|
+
*/
|
|
34
|
+
fulfill(orderId: string, params: FulfillOrderParams): Promise<OrderResponse>;
|
|
35
|
+
/**
|
|
36
|
+
* Mark an order as shipped with tracking information.
|
|
37
|
+
*
|
|
38
|
+
* @param orderId - The order ID (e.g. "ord_9xM4kP7nR2qT5wY1").
|
|
39
|
+
* @param params - Shipping parameters (carrier, tracking_code, seller_note).
|
|
40
|
+
* @returns The updated OrderResponse.
|
|
41
|
+
*/
|
|
42
|
+
ship(orderId: string, params: ShipOrderParams): Promise<OrderResponse>;
|
|
11
43
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Orders resource — GET /v1/orders/{id}, GET /v1/orders
|
|
3
|
+
* Orders resource — GET /v1/orders/{id}, GET /v1/orders,
|
|
4
|
+
* POST /v1/orders/{id}/fulfill, POST /v1/orders/{id}/ship.
|
|
4
5
|
*/
|
|
5
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
7
|
exports.OrdersResource = void 0;
|
|
@@ -8,10 +9,22 @@ class OrdersResource {
|
|
|
8
9
|
constructor(_client) {
|
|
9
10
|
this._client = _client;
|
|
10
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Retrieve an order by ID.
|
|
14
|
+
*
|
|
15
|
+
* @param orderId - The order ID (e.g. "ord_9xM4kP7nR2qT5wY1").
|
|
16
|
+
* @returns The OrderResponse.
|
|
17
|
+
*/
|
|
11
18
|
async get(orderId) {
|
|
12
19
|
const response = await this._client.get(`/v1/orders/${orderId}`);
|
|
13
20
|
return (await response.json());
|
|
14
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Return a paginated list of orders.
|
|
24
|
+
*
|
|
25
|
+
* @param params - Filter and pagination parameters.
|
|
26
|
+
* @returns A CursorPage of OrderResponse objects.
|
|
27
|
+
*/
|
|
15
28
|
async list(params = {}) {
|
|
16
29
|
var _a;
|
|
17
30
|
const queryParams = {
|
|
@@ -31,6 +44,40 @@ class OrdersResource {
|
|
|
31
44
|
queryParams['cursor'] = params.cursor;
|
|
32
45
|
return this._client.getPage('/v1/orders', queryParams, (item) => item);
|
|
33
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Fulfill an order — attach a deliverable and transition to FULFILLED.
|
|
49
|
+
*
|
|
50
|
+
* For external fulfillment listings, this allows your app to push
|
|
51
|
+
* generated content back to ListBee for delivery.
|
|
52
|
+
*
|
|
53
|
+
* @param orderId - The order ID (e.g. "ord_9xM4kP7nR2qT5wY1").
|
|
54
|
+
* @param params - Fulfillment parameters including the required deliverable ID.
|
|
55
|
+
* @returns The updated OrderResponse.
|
|
56
|
+
*/
|
|
57
|
+
async fulfill(orderId, params) {
|
|
58
|
+
const body = {
|
|
59
|
+
deliverable: params.deliverable,
|
|
60
|
+
};
|
|
61
|
+
const response = await this._client.post(`/v1/orders/${orderId}/fulfill`, body);
|
|
62
|
+
return (await response.json());
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Mark an order as shipped with tracking information.
|
|
66
|
+
*
|
|
67
|
+
* @param orderId - The order ID (e.g. "ord_9xM4kP7nR2qT5wY1").
|
|
68
|
+
* @param params - Shipping parameters (carrier, tracking_code, seller_note).
|
|
69
|
+
* @returns The updated OrderResponse.
|
|
70
|
+
*/
|
|
71
|
+
async ship(orderId, params) {
|
|
72
|
+
const body = {
|
|
73
|
+
carrier: params.carrier,
|
|
74
|
+
tracking_code: params.tracking_code,
|
|
75
|
+
};
|
|
76
|
+
if (params.seller_note !== undefined)
|
|
77
|
+
body['seller_note'] = params.seller_note;
|
|
78
|
+
const response = await this._client.post(`/v1/orders/${orderId}/ship`, body);
|
|
79
|
+
return (await response.json());
|
|
80
|
+
}
|
|
34
81
|
}
|
|
35
82
|
exports.OrdersResource = OrdersResource;
|
|
36
83
|
//# sourceMappingURL=orders.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orders.js","sourceRoot":"","sources":["../../../src/resources/orders.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"orders.js","sourceRoot":"","sources":["../../../src/resources/orders.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,MAAa,cAAc;IACzB,YAA6B,OAAmB;QAAnB,YAAO,GAAP,OAAO,CAAY;IAAG,CAAC;IAEpD;;;;;OAKG;IACH,KAAK,CAAC,GAAG,CAAC,OAAe;QACvB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,OAAO,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I,GAA4B;YACpC,WAAW,EAAE,MAAM,CAAC,WAAW;SAChC,CAAC;QAEF,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,OAAO,UAAU,EAAE,IAAI,CAAC,CAAC;QAChF,OAAO,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAkB,CAAC;IAClD,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,IAAI,CAAC,OAAe,EAAE,MAAuB;QACjD,MAAM,IAAI,GAA4B;YACpC,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,aAAa,EAAE,MAAM,CAAC,aAAa;SACpC,CAAC;QACF,IAAI,MAAM,CAAC,WAAW,KAAK,SAAS;YAAE,IAAI,CAAC,aAAa,CAAC,GAAG,MAAM,CAAC,WAAW,CAAC;QAE/E,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,OAAO,OAAO,EAAE,IAAI,CAAC,CAAC;QAC7E,OAAO,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAkB,CAAC;IAClD,CAAC;CACF;AAzED,wCAyEC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export type { AccountReadiness, ListingReadiness, ReadinessAction, ListResponse } from './shared';
|
|
2
|
-
export { ContentType, OrderStatus, WebhookEventType, ActionKind, ActionCode } from './shared';
|
|
1
|
+
export type { AccountReadiness, DeliverableResponse, ListingReadiness, ReadinessAction, ListResponse, CheckoutField, ShippingAddress } from './shared';
|
|
2
|
+
export { ContentType, DeliverableType, FulfillmentMode, CheckoutFieldType, OrderStatus, WebhookEventType, ActionKind, ActionCode } from './shared';
|
|
3
3
|
export type { AccountResponse, UpdateAccountParams, AccountStats } from './account';
|
|
4
4
|
export type { BlurMode, CreateListingParams, FaqItem, ListingResponse, ListingStatus, Review, UpdateListingParams, } from './listing';
|
|
5
5
|
export type { ApiKeyResponse } from './api-key';
|
|
6
|
-
export type { OrderResponse, ListOrdersParams } from './order';
|
|
6
|
+
export type { OrderResponse, ListOrdersParams, FulfillOrderParams, ShipOrderParams } from './order';
|
|
7
7
|
export type { SignupResponse, VerifyResponse } from './signup';
|
|
8
8
|
export type { StripeConnectSessionResponse } from './stripe';
|
|
9
9
|
export type { WebhookResponse, CreateWebhookParams, UpdateWebhookParams, WebhookEventResponse, ListWebhookEventsParams, WebhookTestResponse, } from './webhook';
|
package/dist/cjs/types/index.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ActionCode = exports.ActionKind = exports.WebhookEventType = exports.OrderStatus = exports.ContentType = void 0;
|
|
3
|
+
exports.ActionCode = exports.ActionKind = exports.WebhookEventType = exports.OrderStatus = exports.CheckoutFieldType = exports.FulfillmentMode = exports.DeliverableType = exports.ContentType = void 0;
|
|
4
4
|
var shared_1 = require("./shared");
|
|
5
5
|
Object.defineProperty(exports, "ContentType", { enumerable: true, get: function () { return shared_1.ContentType; } });
|
|
6
|
+
Object.defineProperty(exports, "DeliverableType", { enumerable: true, get: function () { return shared_1.DeliverableType; } });
|
|
7
|
+
Object.defineProperty(exports, "FulfillmentMode", { enumerable: true, get: function () { return shared_1.FulfillmentMode; } });
|
|
8
|
+
Object.defineProperty(exports, "CheckoutFieldType", { enumerable: true, get: function () { return shared_1.CheckoutFieldType; } });
|
|
6
9
|
Object.defineProperty(exports, "OrderStatus", { enumerable: true, get: function () { return shared_1.OrderStatus; } });
|
|
7
10
|
Object.defineProperty(exports, "WebhookEventType", { enumerable: true, get: function () { return shared_1.WebhookEventType; } });
|
|
8
11
|
Object.defineProperty(exports, "ActionKind", { enumerable: true, get: function () { return shared_1.ActionKind; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;AACA,mCAAmJ;AAA1I,qGAAA,WAAW,OAAA;AAAE,yGAAA,eAAe,OAAA;AAAE,yGAAA,eAAe,OAAA;AAAE,2GAAA,iBAAiB,OAAA;AAAE,qGAAA,WAAW,OAAA;AAAE,0GAAA,gBAAgB,OAAA;AAAE,oGAAA,UAAU,OAAA;AAAE,oGAAA,UAAU,OAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Listing response types.
|
|
3
3
|
*/
|
|
4
|
-
import type { ListingReadiness } from './shared';
|
|
4
|
+
import type { CheckoutField, DeliverableResponse, FulfillmentMode, ListingReadiness } from './shared';
|
|
5
5
|
/** A single buyer review card displayed on the listing product page. */
|
|
6
6
|
export interface Review {
|
|
7
7
|
/** Reviewer display name. */
|
|
@@ -42,10 +42,12 @@ export interface ListingResponse {
|
|
|
42
42
|
cta: string | null;
|
|
43
43
|
/** Price in the smallest currency unit (e.g. 2900 = $29.00). */
|
|
44
44
|
price: number;
|
|
45
|
-
/**
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
|
|
45
|
+
/** Deliverable associated with this listing, or null for external fulfillment. */
|
|
46
|
+
deliverable: DeliverableResponse | null;
|
|
47
|
+
/** Fulfillment mode — "managed" (ListBee delivers) or "external" (you deliver). */
|
|
48
|
+
fulfillment: FulfillmentMode;
|
|
49
|
+
/** Checkout schema — custom fields collected at checkout (max 10). */
|
|
50
|
+
checkout_schema: CheckoutField[] | null;
|
|
49
51
|
/** true if a cover image exists (uploaded or auto-generated). */
|
|
50
52
|
has_cover: boolean;
|
|
51
53
|
/** Strikethrough price in smallest currency unit. */
|
|
@@ -94,8 +96,12 @@ export interface CreateListingParams {
|
|
|
94
96
|
name: string;
|
|
95
97
|
/** Price in the smallest currency unit (e.g. 2900 = $29.00). */
|
|
96
98
|
price: number;
|
|
97
|
-
/** File URL, redirect URL, or plain text to deliver after purchase. */
|
|
98
|
-
content
|
|
99
|
+
/** File URL, redirect URL, or plain text to deliver after purchase. Omit for external fulfillment. */
|
|
100
|
+
content?: string;
|
|
101
|
+
/** Fulfillment mode — "managed" or "external". Inferred from content when omitted. */
|
|
102
|
+
fulfillment?: FulfillmentMode;
|
|
103
|
+
/** Checkout schema — custom fields collected at checkout (max 10). */
|
|
104
|
+
checkout_schema?: CheckoutField[];
|
|
99
105
|
/** Store to create this listing in. Required when account has multiple stores. */
|
|
100
106
|
store_id?: string;
|
|
101
107
|
/** Longer product description, plain text. */
|
|
@@ -142,6 +148,10 @@ export interface UpdateListingParams {
|
|
|
142
148
|
name?: string;
|
|
143
149
|
/** Price in the smallest currency unit (e.g. 2900 = $29.00). */
|
|
144
150
|
price?: number;
|
|
151
|
+
/** Fulfillment mode — "managed" or "external". */
|
|
152
|
+
fulfillment?: FulfillmentMode;
|
|
153
|
+
/** Checkout schema — custom fields collected at checkout (max 10). */
|
|
154
|
+
checkout_schema?: CheckoutField[] | null;
|
|
145
155
|
/** Longer product description, plain text. */
|
|
146
156
|
description?: string;
|
|
147
157
|
/** Short line shown below the product name. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Order response types.
|
|
3
3
|
*/
|
|
4
|
-
import type { OrderStatus } from './shared';
|
|
4
|
+
import type { DeliverableResponse, OrderStatus, ShippingAddress } from './shared';
|
|
5
5
|
/** Full order object returned by the ListBee API. */
|
|
6
6
|
export interface OrderResponse {
|
|
7
7
|
/** Object type discriminator. Always "order". */
|
|
@@ -16,12 +16,28 @@ export interface OrderResponse {
|
|
|
16
16
|
amount: number;
|
|
17
17
|
/** Three-letter ISO 4217 currency code, uppercase. */
|
|
18
18
|
currency: string;
|
|
19
|
-
/** Stripe Checkout Session ID. */
|
|
20
|
-
stripe_session_id: string;
|
|
21
19
|
/** Stripe PaymentIntent ID. */
|
|
22
20
|
stripe_payment_intent_id: string;
|
|
23
21
|
/** Order status. */
|
|
24
22
|
status: OrderStatus;
|
|
23
|
+
/** Custom checkout data collected from the buyer. */
|
|
24
|
+
checkout_data: Record<string, unknown> | null;
|
|
25
|
+
/** Shipping address collected at checkout. */
|
|
26
|
+
shipping_address: ShippingAddress | null;
|
|
27
|
+
/** Deliverable associated with this order (managed fulfillment only). */
|
|
28
|
+
deliverable: DeliverableResponse | null;
|
|
29
|
+
/** Shipping carrier name (e.g. "UPS", "FedEx"). */
|
|
30
|
+
carrier: string | null;
|
|
31
|
+
/** Shipping tracking code. */
|
|
32
|
+
tracking_code: string | null;
|
|
33
|
+
/** Seller note for the buyer. */
|
|
34
|
+
seller_note: string | null;
|
|
35
|
+
/** ISO 8601 timestamp of when payment was confirmed. */
|
|
36
|
+
paid_at: string | null;
|
|
37
|
+
/** ISO 8601 timestamp of when the order was fulfilled. */
|
|
38
|
+
fulfilled_at: string | null;
|
|
39
|
+
/** ISO 8601 timestamp of when the order was shipped. */
|
|
40
|
+
shipped_at: string | null;
|
|
25
41
|
/** ISO 8601 timestamp of when the order was created. */
|
|
26
42
|
created_at: string;
|
|
27
43
|
}
|
|
@@ -40,3 +56,20 @@ export interface ListOrdersParams {
|
|
|
40
56
|
/** Pagination cursor from a previous response. */
|
|
41
57
|
cursor?: string;
|
|
42
58
|
}
|
|
59
|
+
/** Parameters for fulfilling an order. */
|
|
60
|
+
export interface FulfillOrderParams {
|
|
61
|
+
/**
|
|
62
|
+
* ID of the deliverable to attach to this order.
|
|
63
|
+
* Auto-detected from the listing's deliverable. Required for external listings.
|
|
64
|
+
*/
|
|
65
|
+
deliverable: string;
|
|
66
|
+
}
|
|
67
|
+
/** Parameters for shipping an order. */
|
|
68
|
+
export interface ShipOrderParams {
|
|
69
|
+
/** Shipping carrier name (e.g. "UPS", "FedEx"). */
|
|
70
|
+
carrier: string;
|
|
71
|
+
/** Shipping tracking code. */
|
|
72
|
+
tracking_code: string;
|
|
73
|
+
/** Optional note for the buyer. */
|
|
74
|
+
seller_note?: string;
|
|
75
|
+
}
|