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.
@@ -46,21 +46,91 @@ export interface ListResponse<T> {
46
46
  has_more: boolean;
47
47
  cursor: string | null;
48
48
  }
49
- /** Content type auto-detected from the content value at creation. */
49
+ /** Deliverable object returned as part of a listing or order. */
50
+ export interface DeliverableResponse {
51
+ /** Object type discriminator. Always "deliverable". */
52
+ object: 'deliverable';
53
+ /** Deliverable type — auto-detected from the content at creation. */
54
+ type: 'file' | 'url' | 'text';
55
+ /** true if the deliverable content has been successfully fetched and stored. */
56
+ has_content: boolean;
57
+ }
58
+ /** Deliverable type — auto-detected from the content value at creation. */
59
+ export declare const DeliverableType: {
60
+ readonly FILE: "file";
61
+ readonly URL: "url";
62
+ readonly TEXT: "text";
63
+ };
64
+ export type DeliverableType = (typeof DeliverableType)[keyof typeof DeliverableType];
65
+ /**
66
+ * Content type — auto-detected from the content value at creation.
67
+ * @deprecated Use `DeliverableType` instead.
68
+ */
50
69
  export declare const ContentType: {
51
70
  readonly FILE: "file";
52
71
  readonly URL: "url";
53
72
  readonly TEXT: "text";
54
73
  };
55
- export type ContentType = (typeof ContentType)[keyof typeof ContentType];
74
+ /**
75
+ * @deprecated Use `DeliverableType` instead.
76
+ */
77
+ export type ContentType = DeliverableType;
78
+ /** Fulfillment mode for a listing. */
79
+ export declare const FulfillmentMode: {
80
+ readonly MANAGED: "managed";
81
+ readonly EXTERNAL: "external";
82
+ };
83
+ export type FulfillmentMode = (typeof FulfillmentMode)[keyof typeof FulfillmentMode];
84
+ /** Checkout field type for buyer-facing forms. */
85
+ export declare const CheckoutFieldType: {
86
+ readonly ADDRESS: "address";
87
+ readonly TEXT: "text";
88
+ readonly SELECT: "select";
89
+ readonly DATE: "date";
90
+ };
91
+ export type CheckoutFieldType = (typeof CheckoutFieldType)[keyof typeof CheckoutFieldType];
92
+ /** A single checkout field definition for the listing checkout form. */
93
+ export interface CheckoutField {
94
+ /** Field type. */
95
+ type: CheckoutFieldType;
96
+ /** Unique machine-readable field key. */
97
+ key: string;
98
+ /** Human-readable label shown to the buyer. */
99
+ label: string;
100
+ /** Whether the buyer must fill this field. */
101
+ required: boolean;
102
+ /** Available options (only for "select" type). */
103
+ options?: string[];
104
+ }
105
+ /** Shipping address collected at checkout. */
106
+ export interface ShippingAddress {
107
+ /** Street address line 1. */
108
+ line1: string;
109
+ /** Street address line 2. */
110
+ line2: string | null;
111
+ /** City name. */
112
+ city: string;
113
+ /** State, province, or region. */
114
+ state: string | null;
115
+ /** Postal or ZIP code. */
116
+ postal_code: string;
117
+ /** Two-letter ISO 3166-1 alpha-2 country code. */
118
+ country: string;
119
+ }
56
120
  /** Order status. */
57
121
  export declare const OrderStatus: {
58
- readonly COMPLETED: "completed";
122
+ readonly PENDING: "pending";
123
+ readonly PAID: "paid";
124
+ readonly FULFILLED: "fulfilled";
125
+ readonly CANCELED: "canceled";
126
+ readonly FAILED: "failed";
59
127
  };
60
128
  export type OrderStatus = (typeof OrderStatus)[keyof typeof OrderStatus];
61
129
  /** Webhook event type. */
62
130
  export declare const WebhookEventType: {
63
- readonly ORDER_COMPLETED: "order.completed";
131
+ readonly ORDER_PAID: "order.paid";
132
+ readonly ORDER_FULFILLED: "order.fulfilled";
133
+ readonly ORDER_SHIPPED: "order.shipped";
64
134
  readonly ORDER_REFUNDED: "order.refunded";
65
135
  readonly ORDER_DISPUTED: "order.disputed";
66
136
  readonly ORDER_DISPUTE_CLOSED: "order.dispute_closed";
@@ -83,5 +153,6 @@ export declare const ActionCode: {
83
153
  readonly CONNECT_STRIPE: "connect_stripe";
84
154
  readonly ENABLE_CHARGES: "enable_charges";
85
155
  readonly UPDATE_BILLING: "update_billing";
156
+ readonly CONFIGURE_WEBHOOK: "configure_webhook";
86
157
  };
87
158
  export type ActionCode = (typeof ActionCode)[keyof typeof ActionCode];
@@ -3,20 +3,43 @@
3
3
  * Shared types used across multiple resources.
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ActionCode = exports.ActionKind = exports.WebhookEventType = exports.OrderStatus = exports.ContentType = void 0;
7
- /** Content type — auto-detected from the content value at creation. */
8
- exports.ContentType = {
6
+ exports.ActionCode = exports.ActionKind = exports.WebhookEventType = exports.OrderStatus = exports.CheckoutFieldType = exports.FulfillmentMode = exports.ContentType = exports.DeliverableType = void 0;
7
+ /** Deliverable type — auto-detected from the content value at creation. */
8
+ exports.DeliverableType = {
9
9
  FILE: 'file',
10
10
  URL: 'url',
11
11
  TEXT: 'text',
12
12
  };
13
+ /**
14
+ * Content type — auto-detected from the content value at creation.
15
+ * @deprecated Use `DeliverableType` instead.
16
+ */
17
+ exports.ContentType = exports.DeliverableType;
18
+ /** Fulfillment mode for a listing. */
19
+ exports.FulfillmentMode = {
20
+ MANAGED: 'managed',
21
+ EXTERNAL: 'external',
22
+ };
23
+ /** Checkout field type for buyer-facing forms. */
24
+ exports.CheckoutFieldType = {
25
+ ADDRESS: 'address',
26
+ TEXT: 'text',
27
+ SELECT: 'select',
28
+ DATE: 'date',
29
+ };
13
30
  /** Order status. */
14
31
  exports.OrderStatus = {
15
- COMPLETED: 'completed',
32
+ PENDING: 'pending',
33
+ PAID: 'paid',
34
+ FULFILLED: 'fulfilled',
35
+ CANCELED: 'canceled',
36
+ FAILED: 'failed',
16
37
  };
17
38
  /** Webhook event type. */
18
39
  exports.WebhookEventType = {
19
- ORDER_COMPLETED: 'order.completed',
40
+ ORDER_PAID: 'order.paid',
41
+ ORDER_FULFILLED: 'order.fulfilled',
42
+ ORDER_SHIPPED: 'order.shipped',
20
43
  ORDER_REFUNDED: 'order.refunded',
21
44
  ORDER_DISPUTED: 'order.disputed',
22
45
  ORDER_DISPUTE_CLOSED: 'order.dispute_closed',
@@ -37,5 +60,6 @@ exports.ActionCode = {
37
60
  CONNECT_STRIPE: 'connect_stripe',
38
61
  ENABLE_CHARGES: 'enable_charges',
39
62
  UPDATE_BILLING: 'update_billing',
63
+ CONFIGURE_WEBHOOK: 'configure_webhook',
40
64
  };
41
65
  //# sourceMappingURL=shared.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/types/shared.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAmDH,uEAAuE;AAC1D,QAAA,WAAW,GAAG;IACzB,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;CACJ,CAAC;AAGX,oBAAoB;AACP,QAAA,WAAW,GAAG;IACzB,SAAS,EAAE,WAAW;CACd,CAAC;AAGX,0BAA0B;AACb,QAAA,gBAAgB,GAAG;IAC9B,eAAe,EAAE,iBAAiB;IAClC,cAAc,EAAE,gBAAgB;IAChC,cAAc,EAAE,gBAAgB;IAChC,oBAAoB,EAAE,sBAAsB;IAC5C,eAAe,EAAE,iBAAiB;IAClC,eAAe,EAAE,iBAAiB;IAClC,cAAc,EAAE,gBAAgB;IAChC,eAAe,EAAE,iBAAiB;IAClC,eAAe,EAAE,iBAAiB;CAC1B,CAAC;AAGX,6BAA6B;AAChB,QAAA,UAAU,GAAG;IACxB,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,OAAO;CACN,CAAC;AAGX,6BAA6B;AAChB,QAAA,UAAU,GAAG;IACxB,cAAc,EAAE,gBAAgB;IAChC,cAAc,EAAE,gBAAgB;IAChC,cAAc,EAAE,gBAAgB;IAChC,cAAc,EAAE,gBAAgB;CACxB,CAAC"}
1
+ {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/types/shared.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AA6DH,2EAA2E;AAC9D,QAAA,eAAe,GAAG;IAC7B,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;CACJ,CAAC;AAGX;;;GAGG;AACU,QAAA,WAAW,GAAG,uBAAe,CAAC;AAM3C,sCAAsC;AACzB,QAAA,eAAe,GAAG;IAC7B,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;CACZ,CAAC;AAGX,kDAAkD;AACrC,QAAA,iBAAiB,GAAG;IAC/B,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;CACJ,CAAC;AAiCX,oBAAoB;AACP,QAAA,WAAW,GAAG;IACzB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,QAAQ;CACR,CAAC;AAGX,0BAA0B;AACb,QAAA,gBAAgB,GAAG;IAC9B,UAAU,EAAE,YAAY;IACxB,eAAe,EAAE,iBAAiB;IAClC,aAAa,EAAE,eAAe;IAC9B,cAAc,EAAE,gBAAgB;IAChC,cAAc,EAAE,gBAAgB;IAChC,oBAAoB,EAAE,sBAAsB;IAC5C,eAAe,EAAE,iBAAiB;IAClC,eAAe,EAAE,iBAAiB;IAClC,cAAc,EAAE,gBAAgB;IAChC,eAAe,EAAE,iBAAiB;IAClC,eAAe,EAAE,iBAAiB;CAC1B,CAAC;AAGX,6BAA6B;AAChB,QAAA,UAAU,GAAG;IACxB,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,OAAO;CACN,CAAC;AAGX,6BAA6B;AAChB,QAAA,UAAU,GAAG;IACxB,cAAc,EAAE,gBAAgB;IAChC,cAAc,EAAE,gBAAgB;IAChC,cAAc,EAAE,gBAAgB;IAChC,cAAc,EAAE,gBAAgB;IAChC,iBAAiB,EAAE,mBAAmB;CAC9B,CAAC"}
@@ -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/esm/index.js CHANGED
@@ -16,5 +16,5 @@ export { StripeResource } from './resources/stripe';
16
16
  export { StoresResource } from './resources/stores';
17
17
  export { WebhooksResource } from './resources/webhooks';
18
18
  // Enums (runtime values)
19
- export { ContentType, OrderStatus, WebhookEventType, ActionKind, ActionCode } from './types/shared';
19
+ export { ContentType, DeliverableType, FulfillmentMode, CheckoutFieldType, OrderStatus, WebhookEventType, ActionKind, ActionCode } from './types/shared';
20
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,SAAS;AACT,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,SAAS;AACT,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,aAAa,EACb,cAAc,EAC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AE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,yBAAyB;AACzB,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,eAAe,EAAE,iBAAiB,EAAE,WAAW,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC"}
@@ -19,7 +19,11 @@ export class ListingsResource {
19
19
  */
20
20
  async create(params) {
21
21
  const { name, price, content, timeoutMs, cover_blur, ...rest } = params;
22
- const body = { name, price, content };
22
+ const body = { name, price };
23
+ // content is optional (omit for external fulfillment)
24
+ if (content !== undefined) {
25
+ body['content'] = content;
26
+ }
23
27
  const optionalFields = [
24
28
  'description',
25
29
  'tagline',
@@ -34,6 +38,8 @@ export class ListingsResource {
34
38
  'reviews',
35
39
  'faqs',
36
40
  'store_id',
41
+ 'fulfillment',
42
+ 'checkout_schema',
37
43
  ];
38
44
  for (const field of optionalFields) {
39
45
  if (rest[field] !== undefined) {
@@ -108,12 +114,18 @@ export class ListingsResource {
108
114
  'rating_count',
109
115
  'reviews',
110
116
  'faqs',
117
+ 'fulfillment',
118
+ 'checkout_schema',
111
119
  ];
112
120
  for (const field of fields) {
113
121
  if (params[field] !== undefined) {
114
122
  body[field] = params[field];
115
123
  }
116
124
  }
125
+ // checkout_schema can be explicitly set to null to clear it
126
+ if ('checkout_schema' in params && params.checkout_schema === null) {
127
+ body['checkout_schema'] = null;
128
+ }
117
129
  // UTM fields — include when explicitly provided (even null)
118
130
  if ('utm_source' in params)
119
131
  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,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAGzD,8CAA8C;AAC9C,MAAM,OAA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,CAAC,gBAAgB,IAAI,SAAS,CAAC,CAAC;QACxE,OAAO,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAoB,CAAC;IACpD,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,MAAM,CAAC,IAAY;QACvB,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,gBAAgB,IAAI,EAAE,CAAC,CAAC;IACpD,CAAC;CACF"}
@@ -1,11 +1,43 @@
1
1
  /**
2
- * Orders resource — GET /v1/orders/{id}, GET /v1/orders.
2
+ * Orders resource — GET /v1/orders/{id}, GET /v1/orders,
3
+ * POST /v1/orders/{id}/fulfill, POST /v1/orders/{id}/ship.
3
4
  */
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,14 +1,27 @@
1
1
  /**
2
- * Orders resource — GET /v1/orders/{id}, GET /v1/orders.
2
+ * Orders resource — GET /v1/orders/{id}, GET /v1/orders,
3
+ * POST /v1/orders/{id}/fulfill, POST /v1/orders/{id}/ship.
3
4
  */
4
5
  export class OrdersResource {
5
6
  constructor(_client) {
6
7
  this._client = _client;
7
8
  }
9
+ /**
10
+ * Retrieve an order by ID.
11
+ *
12
+ * @param orderId - The order ID (e.g. "ord_9xM4kP7nR2qT5wY1").
13
+ * @returns The OrderResponse.
14
+ */
8
15
  async get(orderId) {
9
16
  const response = await this._client.get(`/v1/orders/${orderId}`);
10
17
  return (await response.json());
11
18
  }
19
+ /**
20
+ * Return a paginated list of orders.
21
+ *
22
+ * @param params - Filter and pagination parameters.
23
+ * @returns A CursorPage of OrderResponse objects.
24
+ */
12
25
  async list(params = {}) {
13
26
  const queryParams = {
14
27
  limit: params.limit ?? 20,
@@ -27,5 +40,39 @@ export class OrdersResource {
27
40
  queryParams['cursor'] = params.cursor;
28
41
  return this._client.getPage('/v1/orders', queryParams, (item) => item);
29
42
  }
43
+ /**
44
+ * Fulfill an order — attach a deliverable and transition to FULFILLED.
45
+ *
46
+ * For external fulfillment listings, this allows your app to push
47
+ * generated content back to ListBee for delivery.
48
+ *
49
+ * @param orderId - The order ID (e.g. "ord_9xM4kP7nR2qT5wY1").
50
+ * @param params - Fulfillment parameters including the required deliverable ID.
51
+ * @returns The updated OrderResponse.
52
+ */
53
+ async fulfill(orderId, params) {
54
+ const body = {
55
+ deliverable: params.deliverable,
56
+ };
57
+ const response = await this._client.post(`/v1/orders/${orderId}/fulfill`, body);
58
+ return (await response.json());
59
+ }
60
+ /**
61
+ * Mark an order as shipped with tracking information.
62
+ *
63
+ * @param orderId - The order ID (e.g. "ord_9xM4kP7nR2qT5wY1").
64
+ * @param params - Shipping parameters (carrier, tracking_code, seller_note).
65
+ * @returns The updated OrderResponse.
66
+ */
67
+ async ship(orderId, params) {
68
+ const body = {
69
+ carrier: params.carrier,
70
+ tracking_code: params.tracking_code,
71
+ };
72
+ if (params.seller_note !== undefined)
73
+ body['seller_note'] = params.seller_note;
74
+ const response = await this._client.post(`/v1/orders/${orderId}/ship`, body);
75
+ return (await response.json());
76
+ }
30
77
  }
31
78
  //# sourceMappingURL=orders.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"orders.js","sourceRoot":"","sources":["../../../src/resources/orders.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,MAAM,OAAO,cAAc;IACzB,YAA6B,OAAmB;QAAnB,YAAO,GAAP,OAAO,CAAY;IAAG,CAAC;IAEpD,KAAK,CAAC,GAAG,CAAC,OAAe;QACvB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,OAAO,EAAE,CAAC,CAAC;QACjE,OAAO,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAkB,CAAC;IAClD,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,SAA2B,EAAE;QACtC,MAAM,WAAW,GAA8C;YAC7D,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,EAAE;SAC1B,CAAC;QACF,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS;YAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC;QACvE,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS;YAAE,WAAW,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC;QAC1E,IAAI,MAAM,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;YACvC,WAAW,CAAC,eAAe,CAAC,GAAG,MAAM,CAAC,aAAa,YAAY,IAAI,CAAC,CAAC,CAAC,MAAM,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Aa,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"}
@@ -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';
@@ -1,2 +1,2 @@
1
- export { ContentType, OrderStatus, WebhookEventType, ActionKind, ActionCode } from './shared';
1
+ export { ContentType, DeliverableType, FulfillmentMode, CheckoutFieldType, OrderStatus, WebhookEventType, ActionKind, ActionCode } from './shared';
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,eAAe,EAAE,iBAAiB,EAAE,WAAW,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC"}
@@ -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
- /** Auto-detected from the content value at creation. */
46
- content_type: string;
47
- /** true if content was successfully fetched and stored. */
48
- has_content: boolean;
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: string;
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
+ }
@@ -46,21 +46,91 @@ export interface ListResponse<T> {
46
46
  has_more: boolean;
47
47
  cursor: string | null;
48
48
  }
49
- /** Content type auto-detected from the content value at creation. */
49
+ /** Deliverable object returned as part of a listing or order. */
50
+ export interface DeliverableResponse {
51
+ /** Object type discriminator. Always "deliverable". */
52
+ object: 'deliverable';
53
+ /** Deliverable type — auto-detected from the content at creation. */
54
+ type: 'file' | 'url' | 'text';
55
+ /** true if the deliverable content has been successfully fetched and stored. */
56
+ has_content: boolean;
57
+ }
58
+ /** Deliverable type — auto-detected from the content value at creation. */
59
+ export declare const DeliverableType: {
60
+ readonly FILE: "file";
61
+ readonly URL: "url";
62
+ readonly TEXT: "text";
63
+ };
64
+ export type DeliverableType = (typeof DeliverableType)[keyof typeof DeliverableType];
65
+ /**
66
+ * Content type — auto-detected from the content value at creation.
67
+ * @deprecated Use `DeliverableType` instead.
68
+ */
50
69
  export declare const ContentType: {
51
70
  readonly FILE: "file";
52
71
  readonly URL: "url";
53
72
  readonly TEXT: "text";
54
73
  };
55
- export type ContentType = (typeof ContentType)[keyof typeof ContentType];
74
+ /**
75
+ * @deprecated Use `DeliverableType` instead.
76
+ */
77
+ export type ContentType = DeliverableType;
78
+ /** Fulfillment mode for a listing. */
79
+ export declare const FulfillmentMode: {
80
+ readonly MANAGED: "managed";
81
+ readonly EXTERNAL: "external";
82
+ };
83
+ export type FulfillmentMode = (typeof FulfillmentMode)[keyof typeof FulfillmentMode];
84
+ /** Checkout field type for buyer-facing forms. */
85
+ export declare const CheckoutFieldType: {
86
+ readonly ADDRESS: "address";
87
+ readonly TEXT: "text";
88
+ readonly SELECT: "select";
89
+ readonly DATE: "date";
90
+ };
91
+ export type CheckoutFieldType = (typeof CheckoutFieldType)[keyof typeof CheckoutFieldType];
92
+ /** A single checkout field definition for the listing checkout form. */
93
+ export interface CheckoutField {
94
+ /** Field type. */
95
+ type: CheckoutFieldType;
96
+ /** Unique machine-readable field key. */
97
+ key: string;
98
+ /** Human-readable label shown to the buyer. */
99
+ label: string;
100
+ /** Whether the buyer must fill this field. */
101
+ required: boolean;
102
+ /** Available options (only for "select" type). */
103
+ options?: string[];
104
+ }
105
+ /** Shipping address collected at checkout. */
106
+ export interface ShippingAddress {
107
+ /** Street address line 1. */
108
+ line1: string;
109
+ /** Street address line 2. */
110
+ line2: string | null;
111
+ /** City name. */
112
+ city: string;
113
+ /** State, province, or region. */
114
+ state: string | null;
115
+ /** Postal or ZIP code. */
116
+ postal_code: string;
117
+ /** Two-letter ISO 3166-1 alpha-2 country code. */
118
+ country: string;
119
+ }
56
120
  /** Order status. */
57
121
  export declare const OrderStatus: {
58
- readonly COMPLETED: "completed";
122
+ readonly PENDING: "pending";
123
+ readonly PAID: "paid";
124
+ readonly FULFILLED: "fulfilled";
125
+ readonly CANCELED: "canceled";
126
+ readonly FAILED: "failed";
59
127
  };
60
128
  export type OrderStatus = (typeof OrderStatus)[keyof typeof OrderStatus];
61
129
  /** Webhook event type. */
62
130
  export declare const WebhookEventType: {
63
- readonly ORDER_COMPLETED: "order.completed";
131
+ readonly ORDER_PAID: "order.paid";
132
+ readonly ORDER_FULFILLED: "order.fulfilled";
133
+ readonly ORDER_SHIPPED: "order.shipped";
64
134
  readonly ORDER_REFUNDED: "order.refunded";
65
135
  readonly ORDER_DISPUTED: "order.disputed";
66
136
  readonly ORDER_DISPUTE_CLOSED: "order.dispute_closed";
@@ -83,5 +153,6 @@ export declare const ActionCode: {
83
153
  readonly CONNECT_STRIPE: "connect_stripe";
84
154
  readonly ENABLE_CHARGES: "enable_charges";
85
155
  readonly UPDATE_BILLING: "update_billing";
156
+ readonly CONFIGURE_WEBHOOK: "configure_webhook";
86
157
  };
87
158
  export type ActionCode = (typeof ActionCode)[keyof typeof ActionCode];