orb-billing 4.32.0 → 4.47.1
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/CHANGELOG.md +184 -0
- package/LICENSE +1 -1
- package/README.md +12 -3
- package/core.d.ts +4 -5
- package/core.d.ts.map +1 -1
- package/core.js +16 -11
- package/core.js.map +1 -1
- package/core.mjs +16 -11
- package/core.mjs.map +1 -1
- package/error.d.ts +30 -36
- package/error.d.ts.map +1 -1
- package/error.js +24 -43
- package/error.js.map +1 -1
- package/error.mjs +24 -43
- package/error.mjs.map +1 -1
- package/index.d.mts +43 -109
- package/index.d.ts +43 -109
- package/index.d.ts.map +1 -1
- package/index.js +71 -33
- package/index.js.map +1 -1
- package/index.mjs +43 -32
- package/index.mjs.map +1 -1
- package/package.json +2 -2
- package/resources/alerts.d.ts +58 -19
- package/resources/alerts.d.ts.map +1 -1
- package/resources/alerts.js +19 -37
- package/resources/alerts.js.map +1 -1
- package/resources/alerts.mjs +19 -14
- package/resources/alerts.mjs.map +1 -1
- package/resources/coupons/coupons.d.ts +3 -7
- package/resources/coupons/coupons.d.ts.map +1 -1
- package/resources/coupons/coupons.js +3 -5
- package/resources/coupons/coupons.js.map +1 -1
- package/resources/coupons/coupons.mjs +3 -5
- package/resources/coupons/coupons.mjs.map +1 -1
- package/resources/coupons/index.d.ts +2 -2
- package/resources/coupons/index.d.ts.map +1 -1
- package/resources/coupons/index.js.map +1 -1
- package/resources/coupons/index.mjs.map +1 -1
- package/resources/coupons/subscriptions.d.ts +1 -2
- package/resources/coupons/subscriptions.d.ts.map +1 -1
- package/resources/coupons/subscriptions.js +0 -2
- package/resources/coupons/subscriptions.js.map +1 -1
- package/resources/coupons/subscriptions.mjs +0 -2
- package/resources/coupons/subscriptions.mjs.map +1 -1
- package/resources/credit-notes.d.ts +29 -4
- package/resources/credit-notes.d.ts.map +1 -1
- package/resources/credit-notes.js +8 -27
- package/resources/credit-notes.js.map +1 -1
- package/resources/credit-notes.mjs +8 -4
- package/resources/credit-notes.mjs.map +1 -1
- package/resources/customers/balance-transactions.d.ts +1 -6
- package/resources/customers/balance-transactions.d.ts.map +1 -1
- package/resources/customers/balance-transactions.js +1 -27
- package/resources/customers/balance-transactions.js.map +1 -1
- package/resources/customers/balance-transactions.mjs +1 -4
- package/resources/customers/balance-transactions.mjs.map +1 -1
- package/resources/customers/costs.d.ts +1 -5
- package/resources/customers/costs.d.ts.map +1 -1
- package/resources/customers/costs.js +0 -2
- package/resources/customers/costs.js.map +1 -1
- package/resources/customers/costs.mjs +0 -2
- package/resources/customers/costs.mjs.map +1 -1
- package/resources/customers/credits/credits.d.ts +15 -31
- package/resources/customers/credits/credits.d.ts.map +1 -1
- package/resources/customers/credits/credits.js +10 -11
- package/resources/customers/credits/credits.js.map +1 -1
- package/resources/customers/credits/credits.mjs +10 -11
- package/resources/customers/credits/credits.mjs.map +1 -1
- package/resources/customers/credits/index.d.ts +3 -3
- package/resources/customers/credits/index.d.ts.map +1 -1
- package/resources/customers/credits/index.js.map +1 -1
- package/resources/customers/credits/index.mjs.map +1 -1
- package/resources/customers/credits/ledger.d.ts +15 -23
- package/resources/customers/credits/ledger.d.ts.map +1 -1
- package/resources/customers/credits/ledger.js +12 -36
- package/resources/customers/credits/ledger.js.map +1 -1
- package/resources/customers/credits/ledger.mjs +12 -13
- package/resources/customers/credits/ledger.mjs.map +1 -1
- package/resources/customers/credits/top-ups.d.ts +1 -11
- package/resources/customers/credits/top-ups.d.ts.map +1 -1
- package/resources/customers/credits/top-ups.js +2 -28
- package/resources/customers/credits/top-ups.js.map +1 -1
- package/resources/customers/credits/top-ups.mjs +2 -5
- package/resources/customers/credits/top-ups.mjs.map +1 -1
- package/resources/customers/customers.d.ts +9 -29
- package/resources/customers/customers.d.ts.map +1 -1
- package/resources/customers/customers.js +25 -18
- package/resources/customers/customers.js.map +1 -1
- package/resources/customers/customers.mjs +25 -18
- package/resources/customers/customers.mjs.map +1 -1
- package/resources/customers/index.d.ts +4 -4
- package/resources/customers/index.d.ts.map +1 -1
- package/resources/customers/index.js.map +1 -1
- package/resources/customers/index.mjs.map +1 -1
- package/resources/dimensional-price-groups/dimensional-price-groups.d.ts +90 -0
- package/resources/dimensional-price-groups/dimensional-price-groups.d.ts.map +1 -0
- package/resources/dimensional-price-groups/dimensional-price-groups.js +73 -0
- package/resources/dimensional-price-groups/dimensional-price-groups.js.map +1 -0
- package/resources/dimensional-price-groups/dimensional-price-groups.mjs +45 -0
- package/resources/dimensional-price-groups/dimensional-price-groups.mjs.map +1 -0
- package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.ts +10 -0
- package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.ts.map +1 -0
- package/resources/dimensional-price-groups/external-dimensional-price-group-id.js +15 -0
- package/resources/dimensional-price-groups/external-dimensional-price-group-id.js.map +1 -0
- package/resources/dimensional-price-groups/external-dimensional-price-group-id.mjs +11 -0
- package/resources/dimensional-price-groups/external-dimensional-price-group-id.mjs.map +1 -0
- package/resources/dimensional-price-groups/index.d.ts +3 -0
- package/resources/dimensional-price-groups/index.d.ts.map +1 -0
- package/resources/dimensional-price-groups/index.js +9 -0
- package/resources/dimensional-price-groups/index.js.map +1 -0
- package/resources/dimensional-price-groups/index.mjs +4 -0
- package/resources/dimensional-price-groups/index.mjs.map +1 -0
- package/resources/events/backfills.d.ts +5 -11
- package/resources/events/backfills.d.ts.map +1 -1
- package/resources/events/backfills.js +5 -29
- package/resources/events/backfills.js.map +1 -1
- package/resources/events/backfills.mjs +5 -6
- package/resources/events/backfills.mjs.map +1 -1
- package/resources/events/events.d.ts +7 -22
- package/resources/events/events.d.ts.map +1 -1
- package/resources/events/events.js +7 -7
- package/resources/events/events.js.map +1 -1
- package/resources/events/events.mjs +7 -7
- package/resources/events/events.mjs.map +1 -1
- package/resources/events/index.d.ts +3 -3
- package/resources/events/index.d.ts.map +1 -1
- package/resources/events/index.js.map +1 -1
- package/resources/events/index.mjs.map +1 -1
- package/resources/events/volume.d.ts +9 -12
- package/resources/events/volume.d.ts.map +1 -1
- package/resources/events/volume.js +16 -7
- package/resources/events/volume.js.map +1 -1
- package/resources/events/volume.mjs +16 -7
- package/resources/events/volume.mjs.map +1 -1
- package/resources/index.d.ts +14 -13
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +10 -7
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +8 -7
- package/resources/index.mjs.map +1 -1
- package/resources/invoice-line-items.d.ts +1 -3
- package/resources/invoice-line-items.d.ts.map +1 -1
- package/resources/invoice-line-items.js +0 -2
- package/resources/invoice-line-items.js.map +1 -1
- package/resources/invoice-line-items.mjs +0 -2
- package/resources/invoice-line-items.mjs.map +1 -1
- package/resources/invoices.d.ts +81 -18
- package/resources/invoices.d.ts.map +1 -1
- package/resources/invoices.js +22 -35
- package/resources/invoices.js.map +1 -1
- package/resources/invoices.mjs +22 -12
- package/resources/invoices.mjs.map +1 -1
- package/resources/items.d.ts +2 -8
- package/resources/items.d.ts.map +1 -1
- package/resources/items.js +5 -31
- package/resources/items.js.map +1 -1
- package/resources/items.mjs +5 -8
- package/resources/items.mjs.map +1 -1
- package/resources/metrics.d.ts +2 -8
- package/resources/metrics.d.ts.map +1 -1
- package/resources/metrics.js +7 -31
- package/resources/metrics.js.map +1 -1
- package/resources/metrics.mjs +7 -8
- package/resources/metrics.mjs.map +1 -1
- package/resources/plans/external-plan-id.d.ts +2 -4
- package/resources/plans/external-plan-id.d.ts.map +1 -1
- package/resources/plans/external-plan-id.js +7 -7
- package/resources/plans/external-plan-id.js.map +1 -1
- package/resources/plans/external-plan-id.mjs +7 -7
- package/resources/plans/external-plan-id.mjs.map +1 -1
- package/resources/plans/index.d.ts +2 -2
- package/resources/plans/index.d.ts.map +1 -1
- package/resources/plans/index.js.map +1 -1
- package/resources/plans/index.mjs +1 -1
- package/resources/plans/index.mjs.map +1 -1
- package/resources/plans/plans.d.ts +332 -11
- package/resources/plans/plans.d.ts.map +1 -1
- package/resources/plans/plans.js +10 -9
- package/resources/plans/plans.js.map +1 -1
- package/resources/plans/plans.mjs +10 -9
- package/resources/plans/plans.mjs.map +1 -1
- package/resources/prices/external-price-id.d.ts +2 -4
- package/resources/prices/external-price-id.d.ts.map +1 -1
- package/resources/prices/external-price-id.js +6 -7
- package/resources/prices/external-price-id.js.map +1 -1
- package/resources/prices/external-price-id.mjs +6 -7
- package/resources/prices/external-price-id.mjs.map +1 -1
- package/resources/prices/index.d.ts +2 -2
- package/resources/prices/index.d.ts.map +1 -1
- package/resources/prices/index.js +3 -3
- package/resources/prices/index.js.map +1 -1
- package/resources/prices/index.mjs +1 -1
- package/resources/prices/index.mjs.map +1 -1
- package/resources/prices/prices.d.ts +340 -15
- package/resources/prices/prices.d.ts.map +1 -1
- package/resources/prices/prices.js +9 -9
- package/resources/prices/prices.js.map +1 -1
- package/resources/prices/prices.mjs +9 -9
- package/resources/prices/prices.mjs.map +1 -1
- package/resources/subscriptions.d.ts +7636 -200
- package/resources/subscriptions.d.ts.map +1 -1
- package/resources/subscriptions.js +348 -47
- package/resources/subscriptions.js.map +1 -1
- package/resources/subscriptions.mjs +348 -24
- package/resources/subscriptions.mjs.map +1 -1
- package/resources/top-level.d.ts +1 -2
- package/resources/top-level.d.ts.map +1 -1
- package/resources/top-level.js +0 -2
- package/resources/top-level.js.map +1 -1
- package/resources/top-level.mjs +0 -2
- package/resources/top-level.mjs.map +1 -1
- package/src/core.ts +23 -19
- package/src/error.ts +82 -125
- package/src/index.ts +334 -130
- package/src/resources/alerts.ts +117 -24
- package/src/resources/coupons/coupons.ts +13 -8
- package/src/resources/coupons/index.ts +2 -2
- package/src/resources/coupons/subscriptions.ts +2 -3
- package/src/resources/credit-notes.ts +45 -5
- package/src/resources/customers/balance-transactions.ts +10 -7
- package/src/resources/customers/costs.ts +7 -6
- package/src/resources/customers/credits/credits.ts +82 -32
- package/src/resources/customers/credits/index.ts +20 -20
- package/src/resources/customers/credits/ledger.ts +30 -24
- package/src/resources/customers/credits/top-ups.ts +16 -12
- package/src/resources/customers/customers.ts +70 -46
- package/src/resources/customers/index.ts +17 -17
- package/src/resources/dimensional-price-groups/dimensional-price-groups.ts +146 -0
- package/src/resources/dimensional-price-groups/external-dimensional-price-group-id.ts +20 -0
- package/src/resources/dimensional-price-groups/index.ts +10 -0
- package/src/resources/events/backfills.ts +17 -12
- package/src/resources/events/events.ts +42 -23
- package/src/resources/events/index.ts +15 -15
- package/src/resources/events/volume.ts +11 -22
- package/src/resources/index.ts +113 -67
- package/src/resources/invoice-line-items.ts +5 -4
- package/src/resources/invoices.ts +111 -34
- package/src/resources/items.ts +11 -17
- package/src/resources/metrics.ts +11 -17
- package/src/resources/plans/external-plan-id.ts +3 -14
- package/src/resources/plans/index.ts +9 -2
- package/src/resources/plans/plans.ts +425 -19
- package/src/resources/prices/external-price-id.ts +3 -14
- package/src/resources/prices/index.ts +8 -8
- package/src/resources/prices/prices.ts +471 -24
- package/src/resources/subscriptions.ts +9238 -440
- package/src/resources/top-level.ts +2 -3
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/src/resources/index.ts
CHANGED
|
@@ -2,95 +2,141 @@
|
|
|
2
2
|
|
|
3
3
|
export * from './shared';
|
|
4
4
|
export {
|
|
5
|
-
Alert,
|
|
6
|
-
AlertUpdateParams,
|
|
7
|
-
AlertListParams,
|
|
8
|
-
AlertCreateForCustomerParams,
|
|
9
|
-
AlertCreateForExternalCustomerParams,
|
|
10
|
-
AlertCreateForSubscriptionParams,
|
|
11
5
|
AlertsPage,
|
|
12
6
|
Alerts,
|
|
7
|
+
type Alert,
|
|
8
|
+
type AlertUpdateParams,
|
|
9
|
+
type AlertListParams,
|
|
10
|
+
type AlertCreateForCustomerParams,
|
|
11
|
+
type AlertCreateForExternalCustomerParams,
|
|
12
|
+
type AlertCreateForSubscriptionParams,
|
|
13
|
+
type AlertDisableParams,
|
|
14
|
+
type AlertEnableParams,
|
|
13
15
|
} from './alerts';
|
|
14
16
|
export {
|
|
15
|
-
BillableMetric,
|
|
16
|
-
MetricCreateParams,
|
|
17
|
-
MetricUpdateParams,
|
|
18
|
-
MetricListParams,
|
|
19
17
|
BillableMetricsPage,
|
|
20
18
|
Metrics,
|
|
19
|
+
type BillableMetric,
|
|
20
|
+
type MetricCreateParams,
|
|
21
|
+
type MetricUpdateParams,
|
|
22
|
+
type MetricListParams,
|
|
21
23
|
} from './metrics';
|
|
22
|
-
export { Coupon, CouponCreateParams, CouponListParams, CouponsPage, Coupons } from './coupons/coupons';
|
|
23
|
-
export { CreditNote, CreditNoteListParams, CreditNotesPage, CreditNotes } from './credit-notes';
|
|
24
24
|
export {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
CouponsPage,
|
|
26
|
+
Coupons,
|
|
27
|
+
type Coupon,
|
|
28
|
+
type CouponCreateParams,
|
|
29
|
+
type CouponListParams,
|
|
30
|
+
} from './coupons/coupons';
|
|
31
|
+
export {
|
|
32
|
+
CreditNotesPage,
|
|
33
|
+
CreditNotes,
|
|
34
|
+
type CreditNote,
|
|
35
|
+
type CreditNoteCreateParams,
|
|
36
|
+
type CreditNoteListParams,
|
|
37
|
+
} from './credit-notes';
|
|
38
|
+
export {
|
|
30
39
|
CustomersPage,
|
|
31
40
|
Customers,
|
|
41
|
+
type Customer,
|
|
42
|
+
type CustomerCreateParams,
|
|
43
|
+
type CustomerUpdateParams,
|
|
44
|
+
type CustomerListParams,
|
|
45
|
+
type CustomerUpdateByExternalIDParams,
|
|
32
46
|
} from './customers/customers';
|
|
33
47
|
export {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
PriceEvaluateParams,
|
|
41
|
-
PricesPage,
|
|
42
|
-
Prices,
|
|
43
|
-
} from './prices/prices';
|
|
48
|
+
DimensionalPriceGroupsPage,
|
|
49
|
+
DimensionalPriceGroups,
|
|
50
|
+
type DimensionalPriceGroup,
|
|
51
|
+
type DimensionalPriceGroupCreateParams,
|
|
52
|
+
type DimensionalPriceGroupListParams,
|
|
53
|
+
} from './dimensional-price-groups/dimensional-price-groups';
|
|
44
54
|
export {
|
|
45
|
-
EventUpdateResponse,
|
|
46
|
-
EventDeprecateResponse,
|
|
47
|
-
EventIngestResponse,
|
|
48
|
-
EventSearchResponse,
|
|
49
|
-
EventUpdateParams,
|
|
50
|
-
EventIngestParams,
|
|
51
|
-
EventSearchParams,
|
|
52
55
|
Events,
|
|
56
|
+
type EventUpdateResponse,
|
|
57
|
+
type EventDeprecateResponse,
|
|
58
|
+
type EventIngestResponse,
|
|
59
|
+
type EventSearchResponse,
|
|
60
|
+
type EventUpdateParams,
|
|
61
|
+
type EventIngestParams,
|
|
62
|
+
type EventSearchParams,
|
|
53
63
|
} from './events/events';
|
|
54
64
|
export {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
InvoiceFetchUpcomingParams,
|
|
61
|
-
InvoiceIssueParams,
|
|
62
|
-
InvoiceMarkPaidParams,
|
|
65
|
+
InvoiceLineItems,
|
|
66
|
+
type InvoiceLineItemCreateResponse,
|
|
67
|
+
type InvoiceLineItemCreateParams,
|
|
68
|
+
} from './invoice-line-items';
|
|
69
|
+
export {
|
|
63
70
|
InvoicesPage,
|
|
64
71
|
Invoices,
|
|
72
|
+
type Invoice,
|
|
73
|
+
type InvoiceFetchUpcomingResponse,
|
|
74
|
+
type InvoiceCreateParams,
|
|
75
|
+
type InvoiceUpdateParams,
|
|
76
|
+
type InvoiceListParams,
|
|
77
|
+
type InvoiceFetchUpcomingParams,
|
|
78
|
+
type InvoiceIssueParams,
|
|
79
|
+
type InvoiceMarkPaidParams,
|
|
65
80
|
} from './invoices';
|
|
66
81
|
export {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
82
|
+
ItemsPage,
|
|
83
|
+
Items,
|
|
84
|
+
type Item,
|
|
85
|
+
type ItemCreateParams,
|
|
86
|
+
type ItemUpdateParams,
|
|
87
|
+
type ItemListParams,
|
|
88
|
+
} from './items';
|
|
89
|
+
export {
|
|
90
|
+
PlansPage,
|
|
91
|
+
Plans,
|
|
92
|
+
type Plan,
|
|
93
|
+
type PlanCreateParams,
|
|
94
|
+
type PlanUpdateParams,
|
|
95
|
+
type PlanListParams,
|
|
96
|
+
} from './plans/plans';
|
|
97
|
+
export {
|
|
98
|
+
PricesPage,
|
|
99
|
+
Prices,
|
|
100
|
+
type EvaluatePriceGroup,
|
|
101
|
+
type Price,
|
|
102
|
+
type PriceEvaluateResponse,
|
|
103
|
+
type PriceCreateParams,
|
|
104
|
+
type PriceUpdateParams,
|
|
105
|
+
type PriceListParams,
|
|
106
|
+
type PriceEvaluateParams,
|
|
107
|
+
} from './prices/prices';
|
|
73
108
|
export {
|
|
74
|
-
Subscription,
|
|
75
|
-
SubscriptionUsage,
|
|
76
|
-
Subscriptions,
|
|
77
|
-
SubscriptionFetchCostsResponse,
|
|
78
|
-
SubscriptionFetchScheduleResponse,
|
|
79
|
-
SubscriptionCreateParams,
|
|
80
|
-
SubscriptionUpdateParams,
|
|
81
|
-
SubscriptionListParams,
|
|
82
|
-
SubscriptionCancelParams,
|
|
83
|
-
SubscriptionFetchCostsParams,
|
|
84
|
-
SubscriptionFetchScheduleParams,
|
|
85
|
-
SubscriptionFetchUsageParams,
|
|
86
|
-
SubscriptionPriceIntervalsParams,
|
|
87
|
-
SubscriptionSchedulePlanChangeParams,
|
|
88
|
-
SubscriptionTriggerPhaseParams,
|
|
89
|
-
SubscriptionUnscheduleFixedFeeQuantityUpdatesParams,
|
|
90
|
-
SubscriptionUpdateFixedFeeQuantityParams,
|
|
91
|
-
SubscriptionUpdateTrialParams,
|
|
92
109
|
SubscriptionsPage,
|
|
93
110
|
SubscriptionFetchScheduleResponsesPage,
|
|
111
|
+
Subscriptions,
|
|
112
|
+
type Subscription,
|
|
113
|
+
type SubscriptionUsage,
|
|
114
|
+
type SubscriptionCreateResponse,
|
|
115
|
+
type SubscriptionCancelResponse,
|
|
116
|
+
type SubscriptionFetchCostsResponse,
|
|
117
|
+
type SubscriptionFetchScheduleResponse,
|
|
118
|
+
type SubscriptionPriceIntervalsResponse,
|
|
119
|
+
type SubscriptionSchedulePlanChangeResponse,
|
|
120
|
+
type SubscriptionTriggerPhaseResponse,
|
|
121
|
+
type SubscriptionUnscheduleCancellationResponse,
|
|
122
|
+
type SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse,
|
|
123
|
+
type SubscriptionUnschedulePendingPlanChangesResponse,
|
|
124
|
+
type SubscriptionUpdateFixedFeeQuantityResponse,
|
|
125
|
+
type SubscriptionUpdateTrialResponse,
|
|
126
|
+
type SubscriptionCreateParams,
|
|
127
|
+
type SubscriptionUpdateParams,
|
|
128
|
+
type SubscriptionListParams,
|
|
129
|
+
type SubscriptionCancelParams,
|
|
130
|
+
type SubscriptionFetchCostsParams,
|
|
131
|
+
type SubscriptionFetchScheduleParams,
|
|
132
|
+
type SubscriptionFetchUsageParams,
|
|
133
|
+
type SubscriptionPriceIntervalsParams,
|
|
134
|
+
type SubscriptionSchedulePlanChangeParams,
|
|
135
|
+
type SubscriptionTriggerPhaseParams,
|
|
136
|
+
type SubscriptionUnscheduleFixedFeeQuantityUpdatesParams,
|
|
137
|
+
type SubscriptionUpdateFixedFeeQuantityParams,
|
|
138
|
+
type SubscriptionUpdateTrialParams,
|
|
94
139
|
} from './subscriptions';
|
|
95
|
-
export {
|
|
140
|
+
export { TopLevel, type TopLevelPingResponse } from './top-level';
|
|
141
|
+
|
|
96
142
|
export { Webhooks } from './webhooks';
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../resource';
|
|
4
4
|
import * as Core from '../core';
|
|
5
|
-
import * as InvoiceLineItemsAPI from './invoice-line-items';
|
|
6
5
|
import * as Shared from './shared';
|
|
7
6
|
import * as PricesAPI from './prices/prices';
|
|
8
7
|
|
|
@@ -496,7 +495,9 @@ export interface InvoiceLineItemCreateParams {
|
|
|
496
495
|
start_date: string;
|
|
497
496
|
}
|
|
498
497
|
|
|
499
|
-
export namespace InvoiceLineItems {
|
|
500
|
-
export
|
|
501
|
-
|
|
498
|
+
export declare namespace InvoiceLineItems {
|
|
499
|
+
export {
|
|
500
|
+
type InvoiceLineItemCreateResponse as InvoiceLineItemCreateResponse,
|
|
501
|
+
type InvoiceLineItemCreateParams as InvoiceLineItemCreateParams,
|
|
502
|
+
};
|
|
502
503
|
}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import { APIResource } from '../resource';
|
|
4
4
|
import { isRequestOptions } from '../core';
|
|
5
5
|
import * as Core from '../core';
|
|
6
|
-
import * as InvoicesAPI from './invoices';
|
|
7
6
|
import * as Shared from './shared';
|
|
8
7
|
import * as PricesAPI from './prices/prices';
|
|
9
8
|
import { Page, type PageParams } from '../pagination';
|
|
@@ -25,18 +24,9 @@ export class Invoices extends APIResource {
|
|
|
25
24
|
*/
|
|
26
25
|
update(
|
|
27
26
|
invoiceId: string,
|
|
28
|
-
body
|
|
29
|
-
options?: Core.RequestOptions,
|
|
30
|
-
): Core.APIPromise<Invoice>;
|
|
31
|
-
update(invoiceId: string, options?: Core.RequestOptions): Core.APIPromise<Invoice>;
|
|
32
|
-
update(
|
|
33
|
-
invoiceId: string,
|
|
34
|
-
body: InvoiceUpdateParams | Core.RequestOptions = {},
|
|
27
|
+
body: InvoiceUpdateParams,
|
|
35
28
|
options?: Core.RequestOptions,
|
|
36
29
|
): Core.APIPromise<Invoice> {
|
|
37
|
-
if (isRequestOptions(body)) {
|
|
38
|
-
return this.update(invoiceId, {}, body);
|
|
39
|
-
}
|
|
40
30
|
return this._client.put(`/invoices/${invoiceId}`, { body, ...options });
|
|
41
31
|
}
|
|
42
32
|
|
|
@@ -81,17 +71,9 @@ export class Invoices extends APIResource {
|
|
|
81
71
|
* subscription.
|
|
82
72
|
*/
|
|
83
73
|
fetchUpcoming(
|
|
84
|
-
query
|
|
85
|
-
options?: Core.RequestOptions,
|
|
86
|
-
): Core.APIPromise<InvoiceFetchUpcomingResponse>;
|
|
87
|
-
fetchUpcoming(options?: Core.RequestOptions): Core.APIPromise<InvoiceFetchUpcomingResponse>;
|
|
88
|
-
fetchUpcoming(
|
|
89
|
-
query: InvoiceFetchUpcomingParams | Core.RequestOptions = {},
|
|
74
|
+
query: InvoiceFetchUpcomingParams,
|
|
90
75
|
options?: Core.RequestOptions,
|
|
91
76
|
): Core.APIPromise<InvoiceFetchUpcomingResponse> {
|
|
92
|
-
if (isRequestOptions(query)) {
|
|
93
|
-
return this.fetchUpcoming({}, query);
|
|
94
|
-
}
|
|
95
77
|
return this._client.get('/invoices/upcoming', { query, ...options });
|
|
96
78
|
}
|
|
97
79
|
|
|
@@ -132,6 +114,14 @@ export class Invoices extends APIResource {
|
|
|
132
114
|
return this._client.post(`/invoices/${invoiceId}/mark_paid`, { body, ...options });
|
|
133
115
|
}
|
|
134
116
|
|
|
117
|
+
/**
|
|
118
|
+
* This endpoint collects payment for an invoice using the customer's default
|
|
119
|
+
* payment method. This action can only be taken on invoices with status "issued".
|
|
120
|
+
*/
|
|
121
|
+
pay(invoiceId: string, options?: Core.RequestOptions): Core.APIPromise<Invoice> {
|
|
122
|
+
return this._client.post(`/invoices/${invoiceId}/pay`, options);
|
|
123
|
+
}
|
|
124
|
+
|
|
135
125
|
/**
|
|
136
126
|
* This endpoint allows an invoice's status to be set the `void` status. This can
|
|
137
127
|
* only be done to invoices that are in the `issued` status.
|
|
@@ -301,7 +291,7 @@ export interface Invoice {
|
|
|
301
291
|
* list is provided, the first discount in the list will be returned. If the list
|
|
302
292
|
* is empty, `None` will be returned.
|
|
303
293
|
*/
|
|
304
|
-
discount: unknown
|
|
294
|
+
discount: unknown;
|
|
305
295
|
|
|
306
296
|
discounts: Array<Shared.InvoiceLevelDiscount>;
|
|
307
297
|
|
|
@@ -386,6 +376,11 @@ export interface Invoice {
|
|
|
386
376
|
*/
|
|
387
377
|
paid_at: string | null;
|
|
388
378
|
|
|
379
|
+
/**
|
|
380
|
+
* A list of payment attempts associated with the invoice
|
|
381
|
+
*/
|
|
382
|
+
payment_attempts: Array<Invoice.PaymentAttempt>;
|
|
383
|
+
|
|
389
384
|
/**
|
|
390
385
|
* If payment was attempted on this invoice but failed, this will be the time of
|
|
391
386
|
* the most recent attempt.
|
|
@@ -1310,6 +1305,38 @@ export namespace Invoice {
|
|
|
1310
1305
|
minimum_amount: string;
|
|
1311
1306
|
}
|
|
1312
1307
|
|
|
1308
|
+
export interface PaymentAttempt {
|
|
1309
|
+
/**
|
|
1310
|
+
* The ID of the payment attempt.
|
|
1311
|
+
*/
|
|
1312
|
+
id: string;
|
|
1313
|
+
|
|
1314
|
+
/**
|
|
1315
|
+
* The amount of the payment attempt.
|
|
1316
|
+
*/
|
|
1317
|
+
amount: string;
|
|
1318
|
+
|
|
1319
|
+
/**
|
|
1320
|
+
* The time at which the payment attempt was created.
|
|
1321
|
+
*/
|
|
1322
|
+
created_at: string;
|
|
1323
|
+
|
|
1324
|
+
/**
|
|
1325
|
+
* The payment provider that attempted to collect the payment.
|
|
1326
|
+
*/
|
|
1327
|
+
payment_provider: 'stripe' | null;
|
|
1328
|
+
|
|
1329
|
+
/**
|
|
1330
|
+
* The ID of the payment attempt in the payment provider.
|
|
1331
|
+
*/
|
|
1332
|
+
payment_provider_id: string | null;
|
|
1333
|
+
|
|
1334
|
+
/**
|
|
1335
|
+
* Whether the payment attempt succeeded.
|
|
1336
|
+
*/
|
|
1337
|
+
succeeded: boolean;
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1313
1340
|
export interface ShippingAddress {
|
|
1314
1341
|
city: string | null;
|
|
1315
1342
|
|
|
@@ -1475,7 +1502,7 @@ export interface InvoiceFetchUpcomingResponse {
|
|
|
1475
1502
|
* list is provided, the first discount in the list will be returned. If the list
|
|
1476
1503
|
* is empty, `None` will be returned.
|
|
1477
1504
|
*/
|
|
1478
|
-
discount: unknown
|
|
1505
|
+
discount: unknown;
|
|
1479
1506
|
|
|
1480
1507
|
discounts: Array<Shared.InvoiceLevelDiscount>;
|
|
1481
1508
|
|
|
@@ -1555,6 +1582,11 @@ export interface InvoiceFetchUpcomingResponse {
|
|
|
1555
1582
|
*/
|
|
1556
1583
|
paid_at: string | null;
|
|
1557
1584
|
|
|
1585
|
+
/**
|
|
1586
|
+
* A list of payment attempts associated with the invoice
|
|
1587
|
+
*/
|
|
1588
|
+
payment_attempts: Array<InvoiceFetchUpcomingResponse.PaymentAttempt>;
|
|
1589
|
+
|
|
1558
1590
|
/**
|
|
1559
1591
|
* If payment was attempted on this invoice but failed, this will be the time of
|
|
1560
1592
|
* the most recent attempt.
|
|
@@ -2484,6 +2516,38 @@ export namespace InvoiceFetchUpcomingResponse {
|
|
|
2484
2516
|
minimum_amount: string;
|
|
2485
2517
|
}
|
|
2486
2518
|
|
|
2519
|
+
export interface PaymentAttempt {
|
|
2520
|
+
/**
|
|
2521
|
+
* The ID of the payment attempt.
|
|
2522
|
+
*/
|
|
2523
|
+
id: string;
|
|
2524
|
+
|
|
2525
|
+
/**
|
|
2526
|
+
* The amount of the payment attempt.
|
|
2527
|
+
*/
|
|
2528
|
+
amount: string;
|
|
2529
|
+
|
|
2530
|
+
/**
|
|
2531
|
+
* The time at which the payment attempt was created.
|
|
2532
|
+
*/
|
|
2533
|
+
created_at: string;
|
|
2534
|
+
|
|
2535
|
+
/**
|
|
2536
|
+
* The payment provider that attempted to collect the payment.
|
|
2537
|
+
*/
|
|
2538
|
+
payment_provider: 'stripe' | null;
|
|
2539
|
+
|
|
2540
|
+
/**
|
|
2541
|
+
* The ID of the payment attempt in the payment provider.
|
|
2542
|
+
*/
|
|
2543
|
+
payment_provider_id: string | null;
|
|
2544
|
+
|
|
2545
|
+
/**
|
|
2546
|
+
* Whether the payment attempt succeeded.
|
|
2547
|
+
*/
|
|
2548
|
+
succeeded: boolean;
|
|
2549
|
+
}
|
|
2550
|
+
|
|
2487
2551
|
export interface ShippingAddress {
|
|
2488
2552
|
city: string | null;
|
|
2489
2553
|
|
|
@@ -2623,6 +2687,12 @@ export interface InvoiceListParams extends PageParams {
|
|
|
2623
2687
|
|
|
2624
2688
|
due_date?: string | null;
|
|
2625
2689
|
|
|
2690
|
+
/**
|
|
2691
|
+
* Filters invoices by their due dates within a specific time range in the past.
|
|
2692
|
+
* Specify the range as a number followed by 'd' (days) or 'm' (months). For
|
|
2693
|
+
* example, '7d' filters invoices due in the last 7 days, and '2m' filters those
|
|
2694
|
+
* due in the last 2 months.
|
|
2695
|
+
*/
|
|
2626
2696
|
due_date_window?: string | null;
|
|
2627
2697
|
|
|
2628
2698
|
'due_date[gt]'?: string | null;
|
|
@@ -2647,13 +2717,16 @@ export interface InvoiceListParams extends PageParams {
|
|
|
2647
2717
|
}
|
|
2648
2718
|
|
|
2649
2719
|
export interface InvoiceFetchUpcomingParams {
|
|
2650
|
-
subscription_id
|
|
2720
|
+
subscription_id: string;
|
|
2651
2721
|
}
|
|
2652
2722
|
|
|
2653
2723
|
export interface InvoiceIssueParams {
|
|
2654
2724
|
/**
|
|
2655
2725
|
* If true, the invoice will be issued synchronously. If false, the invoice will be
|
|
2656
|
-
* issued asynchronously.
|
|
2726
|
+
* issued asynchronously. The synchronous option is only available for invoices
|
|
2727
|
+
* containin no usage fees. If the invoice is configured to sync to an external
|
|
2728
|
+
* provider, a successful response from this endpoint guarantees the invoice is
|
|
2729
|
+
* present in the provider.
|
|
2657
2730
|
*/
|
|
2658
2731
|
synchronous?: boolean;
|
|
2659
2732
|
}
|
|
@@ -2675,14 +2748,18 @@ export interface InvoiceMarkPaidParams {
|
|
|
2675
2748
|
notes?: string | null;
|
|
2676
2749
|
}
|
|
2677
2750
|
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
export
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2751
|
+
Invoices.InvoicesPage = InvoicesPage;
|
|
2752
|
+
|
|
2753
|
+
export declare namespace Invoices {
|
|
2754
|
+
export {
|
|
2755
|
+
type Invoice as Invoice,
|
|
2756
|
+
type InvoiceFetchUpcomingResponse as InvoiceFetchUpcomingResponse,
|
|
2757
|
+
InvoicesPage as InvoicesPage,
|
|
2758
|
+
type InvoiceCreateParams as InvoiceCreateParams,
|
|
2759
|
+
type InvoiceUpdateParams as InvoiceUpdateParams,
|
|
2760
|
+
type InvoiceListParams as InvoiceListParams,
|
|
2761
|
+
type InvoiceFetchUpcomingParams as InvoiceFetchUpcomingParams,
|
|
2762
|
+
type InvoiceIssueParams as InvoiceIssueParams,
|
|
2763
|
+
type InvoiceMarkPaidParams as InvoiceMarkPaidParams,
|
|
2764
|
+
};
|
|
2688
2765
|
}
|
package/src/resources/items.ts
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import { APIResource } from '../resource';
|
|
4
4
|
import { isRequestOptions } from '../core';
|
|
5
5
|
import * as Core from '../core';
|
|
6
|
-
import * as ItemsAPI from './items';
|
|
7
6
|
import { Page, type PageParams } from '../pagination';
|
|
8
7
|
|
|
9
8
|
export class Items extends APIResource {
|
|
@@ -17,16 +16,7 @@ export class Items extends APIResource {
|
|
|
17
16
|
/**
|
|
18
17
|
* This endpoint can be used to update properties on the Item.
|
|
19
18
|
*/
|
|
20
|
-
update(itemId: string, body
|
|
21
|
-
update(itemId: string, options?: Core.RequestOptions): Core.APIPromise<Item>;
|
|
22
|
-
update(
|
|
23
|
-
itemId: string,
|
|
24
|
-
body: ItemUpdateParams | Core.RequestOptions = {},
|
|
25
|
-
options?: Core.RequestOptions,
|
|
26
|
-
): Core.APIPromise<Item> {
|
|
27
|
-
if (isRequestOptions(body)) {
|
|
28
|
-
return this.update(itemId, {}, body);
|
|
29
|
-
}
|
|
19
|
+
update(itemId: string, body: ItemUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Item> {
|
|
30
20
|
return this._client.put(`/items/${itemId}`, { body, ...options });
|
|
31
21
|
}
|
|
32
22
|
|
|
@@ -116,10 +106,14 @@ export namespace ItemUpdateParams {
|
|
|
116
106
|
|
|
117
107
|
export interface ItemListParams extends PageParams {}
|
|
118
108
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
export
|
|
123
|
-
|
|
124
|
-
|
|
109
|
+
Items.ItemsPage = ItemsPage;
|
|
110
|
+
|
|
111
|
+
export declare namespace Items {
|
|
112
|
+
export {
|
|
113
|
+
type Item as Item,
|
|
114
|
+
ItemsPage as ItemsPage,
|
|
115
|
+
type ItemCreateParams as ItemCreateParams,
|
|
116
|
+
type ItemUpdateParams as ItemUpdateParams,
|
|
117
|
+
type ItemListParams as ItemListParams,
|
|
118
|
+
};
|
|
125
119
|
}
|
package/src/resources/metrics.ts
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import { APIResource } from '../resource';
|
|
4
4
|
import { isRequestOptions } from '../core';
|
|
5
5
|
import * as Core from '../core';
|
|
6
|
-
import * as MetricsAPI from './metrics';
|
|
7
6
|
import * as ItemsAPI from './items';
|
|
8
7
|
import { Page, type PageParams } from '../pagination';
|
|
9
8
|
|
|
@@ -25,18 +24,9 @@ export class Metrics extends APIResource {
|
|
|
25
24
|
*/
|
|
26
25
|
update(
|
|
27
26
|
metricId: string,
|
|
28
|
-
body
|
|
29
|
-
options?: Core.RequestOptions,
|
|
30
|
-
): Core.APIPromise<BillableMetric>;
|
|
31
|
-
update(metricId: string, options?: Core.RequestOptions): Core.APIPromise<BillableMetric>;
|
|
32
|
-
update(
|
|
33
|
-
metricId: string,
|
|
34
|
-
body: MetricUpdateParams | Core.RequestOptions = {},
|
|
27
|
+
body: MetricUpdateParams,
|
|
35
28
|
options?: Core.RequestOptions,
|
|
36
29
|
): Core.APIPromise<BillableMetric> {
|
|
37
|
-
if (isRequestOptions(body)) {
|
|
38
|
-
return this.update(metricId, {}, body);
|
|
39
|
-
}
|
|
40
30
|
return this._client.put(`/metrics/${metricId}`, { body, ...options });
|
|
41
31
|
}
|
|
42
32
|
|
|
@@ -149,10 +139,14 @@ export interface MetricListParams extends PageParams {
|
|
|
149
139
|
'created_at[lte]'?: string | null;
|
|
150
140
|
}
|
|
151
141
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
export
|
|
156
|
-
|
|
157
|
-
|
|
142
|
+
Metrics.BillableMetricsPage = BillableMetricsPage;
|
|
143
|
+
|
|
144
|
+
export declare namespace Metrics {
|
|
145
|
+
export {
|
|
146
|
+
type BillableMetric as BillableMetric,
|
|
147
|
+
BillableMetricsPage as BillableMetricsPage,
|
|
148
|
+
type MetricCreateParams as MetricCreateParams,
|
|
149
|
+
type MetricUpdateParams as MetricUpdateParams,
|
|
150
|
+
type MetricListParams as MetricListParams,
|
|
151
|
+
};
|
|
158
152
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../resource';
|
|
4
|
-
import { isRequestOptions } from '../../core';
|
|
5
4
|
import * as Core from '../../core';
|
|
6
|
-
import * as ExternalPlanIDAPI from './external-plan-id';
|
|
7
5
|
import * as PlansAPI from './plans';
|
|
8
6
|
|
|
9
7
|
export class ExternalPlanID extends APIResource {
|
|
@@ -15,18 +13,9 @@ export class ExternalPlanID extends APIResource {
|
|
|
15
13
|
*/
|
|
16
14
|
update(
|
|
17
15
|
otherExternalPlanId: string,
|
|
18
|
-
body
|
|
19
|
-
options?: Core.RequestOptions,
|
|
20
|
-
): Core.APIPromise<PlansAPI.Plan>;
|
|
21
|
-
update(otherExternalPlanId: string, options?: Core.RequestOptions): Core.APIPromise<PlansAPI.Plan>;
|
|
22
|
-
update(
|
|
23
|
-
otherExternalPlanId: string,
|
|
24
|
-
body: ExternalPlanIDUpdateParams | Core.RequestOptions = {},
|
|
16
|
+
body: ExternalPlanIDUpdateParams,
|
|
25
17
|
options?: Core.RequestOptions,
|
|
26
18
|
): Core.APIPromise<PlansAPI.Plan> {
|
|
27
|
-
if (isRequestOptions(body)) {
|
|
28
|
-
return this.update(otherExternalPlanId, {}, body);
|
|
29
|
-
}
|
|
30
19
|
return this._client.put(`/plans/external_plan_id/${otherExternalPlanId}`, { body, ...options });
|
|
31
20
|
}
|
|
32
21
|
|
|
@@ -69,6 +58,6 @@ export interface ExternalPlanIDUpdateParams {
|
|
|
69
58
|
metadata?: Record<string, string | null> | null;
|
|
70
59
|
}
|
|
71
60
|
|
|
72
|
-
export namespace ExternalPlanID {
|
|
73
|
-
export
|
|
61
|
+
export declare namespace ExternalPlanID {
|
|
62
|
+
export { type ExternalPlanIDUpdateParams as ExternalPlanIDUpdateParams };
|
|
74
63
|
}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
3
|
+
export { ExternalPlanID, type ExternalPlanIDUpdateParams } from './external-plan-id';
|
|
4
|
+
export {
|
|
5
|
+
PlansPage,
|
|
6
|
+
Plans,
|
|
7
|
+
type Plan,
|
|
8
|
+
type PlanCreateParams,
|
|
9
|
+
type PlanUpdateParams,
|
|
10
|
+
type PlanListParams,
|
|
11
|
+
} from './plans';
|