orb-billing 1.21.0 → 1.23.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/CHANGELOG.md +32 -0
- package/LICENSE +201 -0
- package/README.md +196 -192
- package/_shims/MultipartBody.d.ts +9 -0
- package/_shims/MultipartBody.d.ts.map +1 -0
- package/_shims/MultipartBody.js +16 -0
- package/_shims/MultipartBody.js.map +1 -0
- package/_shims/MultipartBody.mjs +12 -0
- package/_shims/MultipartBody.mjs.map +1 -0
- package/_shims/README.md +46 -0
- package/_shims/auto/runtime-bun.d.ts +5 -0
- package/_shims/auto/runtime-bun.d.ts.map +1 -0
- package/_shims/auto/runtime-bun.js +21 -0
- package/_shims/auto/runtime-bun.js.map +1 -0
- package/_shims/auto/runtime-bun.mjs +2 -0
- package/_shims/auto/runtime-bun.mjs.map +1 -0
- package/_shims/auto/runtime-node.d.ts +5 -0
- package/_shims/auto/runtime-node.d.ts.map +1 -0
- package/_shims/auto/runtime-node.js +21 -0
- package/_shims/auto/runtime-node.js.map +1 -0
- package/_shims/auto/runtime-node.mjs +2 -0
- package/_shims/auto/runtime-node.mjs.map +1 -0
- package/_shims/auto/runtime.d.ts +5 -0
- package/_shims/auto/runtime.d.ts.map +1 -0
- package/_shims/auto/runtime.js +21 -0
- package/_shims/auto/runtime.js.map +1 -0
- package/_shims/auto/runtime.mjs +2 -0
- package/_shims/auto/runtime.mjs.map +1 -0
- package/_shims/auto/types-node.d.ts +5 -0
- package/_shims/auto/types-node.d.ts.map +1 -0
- package/_shims/auto/types-node.js +21 -0
- package/_shims/auto/types-node.js.map +1 -0
- package/_shims/auto/types-node.mjs +2 -0
- package/_shims/auto/types-node.mjs.map +1 -0
- package/_shims/auto/types.d.ts +101 -0
- package/_shims/auto/types.js +3 -0
- package/_shims/auto/types.mjs +3 -0
- package/_shims/bun-runtime.d.ts +6 -0
- package/_shims/bun-runtime.d.ts.map +1 -0
- package/_shims/bun-runtime.js +14 -0
- package/_shims/bun-runtime.js.map +1 -0
- package/_shims/bun-runtime.mjs +10 -0
- package/_shims/bun-runtime.mjs.map +1 -0
- package/_shims/index.d.ts +81 -0
- package/_shims/index.js +13 -0
- package/_shims/index.mjs +7 -0
- package/_shims/manual-types.d.ts +12 -0
- package/_shims/manual-types.js +3 -0
- package/_shims/manual-types.mjs +3 -0
- package/_shims/node-runtime.d.ts +3 -0
- package/_shims/node-runtime.d.ts.map +1 -0
- package/_shims/node-runtime.js +90 -0
- package/_shims/node-runtime.js.map +1 -0
- package/_shims/node-runtime.mjs +56 -0
- package/_shims/node-runtime.mjs.map +1 -0
- package/_shims/node-types.d.ts +42 -0
- package/_shims/node-types.js +3 -0
- package/_shims/node-types.mjs +3 -0
- package/_shims/registry.d.ts +37 -0
- package/_shims/registry.d.ts.map +1 -0
- package/_shims/registry.js +41 -0
- package/_shims/registry.js.map +1 -0
- package/_shims/registry.mjs +37 -0
- package/_shims/registry.mjs.map +1 -0
- package/_shims/web-runtime.d.ts +5 -0
- package/_shims/web-runtime.d.ts.map +1 -0
- package/_shims/web-runtime.js +78 -0
- package/_shims/web-runtime.js.map +1 -0
- package/_shims/web-runtime.mjs +71 -0
- package/_shims/web-runtime.mjs.map +1 -0
- package/_shims/web-types.d.ts +83 -0
- package/_shims/web-types.js +3 -0
- package/_shims/web-types.mjs +3 -0
- package/core.d.ts +239 -0
- package/core.d.ts.map +1 -0
- package/core.js +830 -0
- package/core.js.map +1 -0
- package/core.mjs +799 -0
- package/core.mjs.map +1 -0
- package/error.d.ts +131 -0
- package/error.d.ts.map +1 -0
- package/error.js +298 -0
- package/error.js.map +1 -0
- package/error.mjs +271 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +210 -0
- package/index.d.ts +210 -0
- package/index.d.ts.map +1 -0
- package/index.js +153 -0
- package/index.js.map +1 -0
- package/index.mjs +125 -0
- package/index.mjs.map +1 -0
- package/package.json +90 -27
- package/pagination.d.ts +31 -0
- package/pagination.d.ts.map +1 -0
- package/pagination.js +34 -0
- package/pagination.js.map +1 -0
- package/pagination.mjs +30 -0
- package/pagination.mjs.map +1 -0
- package/resource.d.ts +12 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +17 -0
- package/resource.js.map +1 -0
- package/resource.mjs +13 -0
- package/resource.mjs.map +1 -0
- package/resources/coupons/coupons.d.ts +114 -0
- package/resources/coupons/coupons.d.ts.map +1 -0
- package/resources/coupons/coupons.js +76 -0
- package/resources/coupons/coupons.js.map +1 -0
- package/resources/coupons/coupons.mjs +48 -0
- package/resources/coupons/coupons.mjs.map +1 -0
- package/resources/coupons/index.d.ts +3 -0
- package/resources/coupons/index.d.ts.map +1 -0
- package/resources/coupons/index.js +10 -0
- package/resources/coupons/index.js.map +1 -0
- package/resources/coupons/index.mjs +4 -0
- package/resources/coupons/index.mjs.map +1 -0
- package/resources/coupons/subscriptions.d.ts +23 -0
- package/resources/coupons/subscriptions.d.ts.map +1 -0
- package/resources/coupons/subscriptions.js +20 -0
- package/resources/coupons/subscriptions.js.map +1 -0
- package/resources/coupons/subscriptions.mjs +16 -0
- package/resources/coupons/subscriptions.mjs.map +1 -0
- package/resources/credit-notes.d.ts +136 -0
- package/resources/credit-notes.d.ts.map +1 -0
- package/resources/credit-notes.js +54 -0
- package/resources/credit-notes.js.map +1 -0
- package/resources/credit-notes.mjs +26 -0
- package/resources/credit-notes.mjs.map +1 -0
- package/resources/customers/balance-transactions.d.ts +159 -0
- package/resources/customers/balance-transactions.d.ts.map +1 -0
- package/resources/customers/balance-transactions.js +54 -0
- package/resources/customers/balance-transactions.js.map +1 -0
- package/resources/customers/balance-transactions.mjs +26 -0
- package/resources/customers/balance-transactions.mjs.map +1 -0
- package/resources/customers/costs.d.ts +915 -0
- package/resources/customers/costs.d.ts.map +1 -0
- package/resources/customers/costs.js +24 -0
- package/resources/customers/costs.js.map +1 -0
- package/resources/customers/costs.mjs +20 -0
- package/resources/customers/costs.mjs.map +1 -0
- package/resources/customers/credits/credits.d.ts +58 -0
- package/resources/customers/credits/credits.d.ts.map +1 -0
- package/resources/customers/credits/credits.js +68 -0
- package/resources/customers/credits/credits.js.map +1 -0
- package/resources/customers/credits/credits.mjs +39 -0
- package/resources/customers/credits/credits.mjs.map +1 -0
- package/resources/customers/credits/index.d.ts +3 -0
- package/resources/customers/credits/index.d.ts.map +1 -0
- package/resources/customers/credits/index.js +13 -0
- package/resources/customers/credits/index.js.map +1 -0
- package/resources/customers/credits/index.mjs +4 -0
- package/resources/customers/credits/index.mjs.map +1 -0
- package/resources/customers/credits/ledger.d.ts +1537 -0
- package/resources/customers/credits/ledger.d.ts.map +1 -0
- package/resources/customers/credits/ledger.js +291 -0
- package/resources/customers/credits/ledger.js.map +1 -0
- package/resources/customers/credits/ledger.mjs +262 -0
- package/resources/customers/credits/ledger.mjs.map +1 -0
- package/resources/customers/customers.d.ts +524 -0
- package/resources/customers/customers.d.ts.map +1 -0
- package/resources/customers/customers.js +135 -0
- package/resources/customers/customers.js.map +1 -0
- package/resources/customers/customers.mjs +107 -0
- package/resources/customers/customers.mjs.map +1 -0
- package/resources/customers/index.d.ts +6 -0
- package/resources/customers/index.d.ts.map +1 -0
- package/resources/customers/index.js +19 -0
- package/resources/customers/index.js.map +1 -0
- package/resources/customers/index.mjs +7 -0
- package/resources/customers/index.mjs.map +1 -0
- package/resources/customers/usage.d.ts +306 -0
- package/resources/customers/usage.d.ts.map +1 -0
- package/resources/customers/usage.js +223 -0
- package/resources/customers/usage.js.map +1 -0
- package/resources/customers/usage.mjs +219 -0
- package/resources/customers/usage.mjs.map +1 -0
- package/resources/events/backfills.d.ts +250 -0
- package/resources/events/backfills.d.ts.map +1 -0
- package/resources/events/backfills.js +104 -0
- package/resources/events/backfills.js.map +1 -0
- package/resources/events/backfills.mjs +76 -0
- package/resources/events/backfills.mjs.map +1 -0
- package/resources/events/events.d.ts +547 -0
- package/resources/events/events.d.ts.map +1 -0
- package/resources/events/events.js +354 -0
- package/resources/events/events.js.map +1 -0
- package/resources/events/events.mjs +327 -0
- package/resources/events/events.mjs.map +1 -0
- package/resources/events/index.d.ts +3 -0
- package/resources/events/index.d.ts.map +1 -0
- package/resources/events/index.js +10 -0
- package/resources/events/index.js.map +1 -0
- package/resources/events/index.mjs +4 -0
- package/resources/events/index.mjs.map +1 -0
- package/resources/index.d.ts +13 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +39 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +14 -0
- package/resources/index.mjs.map +1 -0
- package/resources/invoice-line-items.d.ts +434 -0
- package/resources/invoice-line-items.d.ts.map +1 -0
- package/resources/invoice-line-items.js +18 -0
- package/resources/invoice-line-items.js.map +1 -0
- package/resources/invoice-line-items.mjs +14 -0
- package/resources/invoice-line-items.mjs.map +1 -0
- package/resources/invoices.d.ts +1541 -0
- package/resources/invoices.d.ts.map +1 -0
- package/resources/invoices.js +96 -0
- package/resources/invoices.js.map +1 -0
- package/resources/invoices.mjs +68 -0
- package/resources/invoices.mjs.map +1 -0
- package/resources/items.d.ts +61 -0
- package/resources/items.d.ts.map +1 -0
- package/resources/items.js +53 -0
- package/resources/items.js.map +1 -0
- package/resources/items.mjs +25 -0
- package/resources/items.mjs.map +1 -0
- package/resources/metrics.d.ts +176 -0
- package/resources/metrics.d.ts.map +1 -0
- package/resources/metrics.js +63 -0
- package/resources/metrics.js.map +1 -0
- package/resources/metrics.mjs +35 -0
- package/resources/metrics.mjs.map +1 -0
- package/resources/plans/external-plan-id.d.ts +50 -0
- package/resources/plans/external-plan-id.d.ts.map +1 -0
- package/resources/plans/external-plan-id.js +35 -0
- package/resources/plans/external-plan-id.js.map +1 -0
- package/resources/plans/external-plan-id.mjs +31 -0
- package/resources/plans/external-plan-id.mjs.map +1 -0
- package/resources/plans/index.d.ts +3 -0
- package/resources/plans/index.d.ts.map +1 -0
- package/resources/plans/index.js +10 -0
- package/resources/plans/index.js.map +1 -0
- package/resources/plans/index.mjs +4 -0
- package/resources/plans/index.mjs.map +1 -0
- package/resources/plans/plans.d.ts +256 -0
- package/resources/plans/plans.d.ts.map +1 -0
- package/resources/plans/plans.js +87 -0
- package/resources/plans/plans.js.map +1 -0
- package/resources/plans/plans.mjs +59 -0
- package/resources/plans/plans.mjs.map +1 -0
- package/resources/prices/external-price-id.d.ts +12 -0
- package/resources/prices/external-price-id.d.ts.map +1 -0
- package/resources/prices/external-price-id.js +17 -0
- package/resources/prices/external-price-id.js.map +1 -0
- package/resources/prices/external-price-id.mjs +13 -0
- package/resources/prices/external-price-id.mjs.map +1 -0
- package/resources/prices/index.d.ts +3 -0
- package/resources/prices/index.d.ts.map +1 -0
- package/resources/prices/index.js +10 -0
- package/resources/prices/index.js.map +1 -0
- package/resources/prices/index.mjs +4 -0
- package/resources/prices/index.mjs.map +1 -0
- package/resources/prices/prices.d.ts +1872 -0
- package/resources/prices/prices.d.ts.map +1 -0
- package/resources/prices/prices.js +74 -0
- package/resources/prices/prices.js.map +1 -0
- package/resources/prices/prices.mjs +46 -0
- package/resources/prices/prices.mjs.map +1 -0
- package/resources/subscriptions.d.ts +3752 -0
- package/resources/subscriptions.d.ts.map +1 -0
- package/resources/subscriptions.js +254 -0
- package/resources/subscriptions.js.map +1 -0
- package/resources/subscriptions.mjs +225 -0
- package/resources/subscriptions.mjs.map +1 -0
- package/resources/top-level.d.ts +21 -0
- package/resources/top-level.d.ts.map +1 -0
- package/resources/top-level.js +22 -0
- package/resources/top-level.js.map +1 -0
- package/resources/top-level.mjs +18 -0
- package/resources/top-level.mjs.map +1 -0
- package/shims/node.d.ts +29 -0
- package/shims/node.d.ts.map +1 -0
- package/shims/node.js +31 -0
- package/shims/node.js.map +1 -0
- package/shims/node.mjs +5 -0
- package/shims/node.mjs.map +1 -0
- package/shims/web.d.ts +26 -0
- package/shims/web.d.ts.map +1 -0
- package/shims/web.js +31 -0
- package/shims/web.js.map +1 -0
- package/shims/web.mjs +5 -0
- package/shims/web.mjs.map +1 -0
- package/src/_shims/MultipartBody.ts +9 -0
- package/src/_shims/README.md +46 -0
- package/src/_shims/auto/runtime-bun.ts +4 -0
- package/src/_shims/auto/runtime-node.ts +4 -0
- package/src/_shims/auto/runtime.ts +4 -0
- package/src/_shims/auto/types-node.ts +4 -0
- package/src/_shims/auto/types.d.ts +101 -0
- package/src/_shims/auto/types.js +3 -0
- package/src/_shims/auto/types.mjs +3 -0
- package/src/_shims/bun-runtime.ts +14 -0
- package/src/_shims/index.d.ts +81 -0
- package/src/_shims/index.js +13 -0
- package/src/_shims/index.mjs +7 -0
- package/src/_shims/manual-types.d.ts +12 -0
- package/src/_shims/manual-types.js +3 -0
- package/src/_shims/manual-types.mjs +3 -0
- package/src/_shims/node-runtime.ts +83 -0
- package/src/_shims/node-types.d.ts +42 -0
- package/src/_shims/node-types.js +3 -0
- package/src/_shims/node-types.mjs +3 -0
- package/src/_shims/registry.ts +67 -0
- package/src/_shims/web-runtime.ts +103 -0
- package/src/_shims/web-types.d.ts +83 -0
- package/src/_shims/web-types.js +3 -0
- package/src/_shims/web-types.mjs +3 -0
- package/src/core.ts +1099 -0
- package/src/error.ts +469 -0
- package/src/index.ts +305 -0
- package/src/pagination.ts +63 -0
- package/src/resource.ts +24 -0
- package/src/resources/coupons/coupons.ts +150 -0
- package/src/resources/coupons/index.ts +4 -0
- package/src/resources/coupons/subscriptions.ts +45 -0
- package/src/resources/credit-notes.ts +184 -0
- package/src/resources/customers/balance-transactions.ts +222 -0
- package/src/resources/customers/costs.ts +991 -0
- package/src/resources/customers/credits/credits.ts +113 -0
- package/src/resources/customers/credits/index.ts +24 -0
- package/src/resources/customers/credits/ledger.ts +2254 -0
- package/src/resources/customers/customers.ts +734 -0
- package/src/resources/customers/index.ts +42 -0
- package/src/resources/customers/usage.ts +350 -0
- package/src/resources/events/backfills.ts +324 -0
- package/src/resources/events/events.ts +635 -0
- package/src/resources/events/index.ts +23 -0
- package/src/resources/index.ts +72 -0
- package/src/resources/invoice-line-items.ts +502 -0
- package/src/resources/invoices.ts +1906 -0
- package/src/resources/items.ts +106 -0
- package/src/resources/metrics.ts +264 -0
- package/src/resources/plans/external-plan-id.ts +73 -0
- package/src/resources/plans/index.ts +4 -0
- package/src/resources/plans/plans.ts +350 -0
- package/src/resources/prices/external-price-id.ts +16 -0
- package/src/resources/prices/index.ts +4 -0
- package/src/resources/prices/prices.ts +2466 -0
- package/src/resources/subscriptions.ts +4590 -0
- package/src/resources/top-level.ts +27 -0
- package/src/shims/node.ts +50 -0
- package/src/shims/web.ts +50 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +246 -0
- package/src/version.ts +1 -0
- package/uploads.d.ts +75 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +162 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +149 -0
- package/uploads.mjs.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
- package/LICENSE.md +0 -21
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -20
- package/dist/internal/utils/contenttype.d.ts +0 -1
- package/dist/internal/utils/contenttype.js +0 -33
- package/dist/internal/utils/headers.d.ts +0 -4
- package/dist/internal/utils/headers.js +0 -92
- package/dist/internal/utils/index.d.ts +0 -8
- package/dist/internal/utils/index.js +0 -27
- package/dist/internal/utils/pathparams.d.ts +0 -2
- package/dist/internal/utils/pathparams.js +0 -53
- package/dist/internal/utils/queryparams.d.ts +0 -2
- package/dist/internal/utils/queryparams.js +0 -178
- package/dist/internal/utils/requestbody.d.ts +0 -2
- package/dist/internal/utils/requestbody.js +0 -318
- package/dist/internal/utils/retries.d.ts +0 -20
- package/dist/internal/utils/retries.js +0 -250
- package/dist/internal/utils/security.d.ts +0 -5
- package/dist/internal/utils/security.js +0 -188
- package/dist/internal/utils/utils.d.ts +0 -37
- package/dist/internal/utils/utils.js +0 -370
- package/dist/sdk/availability.d.ts +0 -18
- package/dist/sdk/availability.js +0 -186
- package/dist/sdk/coupon.d.ts +0 -62
- package/dist/sdk/coupon.js +0 -629
- package/dist/sdk/credit.d.ts +0 -348
- package/dist/sdk/credit.js +0 -1020
- package/dist/sdk/creditnote.d.ts +0 -29
- package/dist/sdk/creditnote.js +0 -293
- package/dist/sdk/customer.d.ts +0 -529
- package/dist/sdk/customer.js +0 -1882
- package/dist/sdk/event.d.ts +0 -353
- package/dist/sdk/event.js +0 -1314
- package/dist/sdk/index.d.ts +0 -1
- package/dist/sdk/index.js +0 -20
- package/dist/sdk/invoice.d.ts +0 -89
- package/dist/sdk/invoice.js +0 -945
- package/dist/sdk/item.d.ts +0 -27
- package/dist/sdk/item.js +0 -291
- package/dist/sdk/metric.d.ts +0 -39
- package/dist/sdk/metric.js +0 -418
- package/dist/sdk/models/errors/fivehundrederror.d.ts +0 -11
- package/dist/sdk/models/errors/fivehundrederror.js +0 -88
- package/dist/sdk/models/errors/fourhundredandoneerror.d.ts +0 -11
- package/dist/sdk/models/errors/fourhundredandoneerror.js +0 -88
- package/dist/sdk/models/errors/fourhundredandtwentynineerror.d.ts +0 -11
- package/dist/sdk/models/errors/fourhundredandtwentynineerror.js +0 -88
- package/dist/sdk/models/errors/index.d.ts +0 -4
- package/dist/sdk/models/errors/index.js +0 -23
- package/dist/sdk/models/errors/sdkerror.d.ts +0 -7
- package/dist/sdk/models/errors/sdkerror.js +0 -40
- package/dist/sdk/models/operations/addeditpriceintervals.d.ts +0 -25
- package/dist/sdk/models/operations/addeditpriceintervals.js +0 -95
- package/dist/sdk/models/operations/amendevent.d.ts +0 -25
- package/dist/sdk/models/operations/amendevent.js +0 -95
- package/dist/sdk/models/operations/amendusage.d.ts +0 -27
- package/dist/sdk/models/operations/amendusage.js +0 -103
- package/dist/sdk/models/operations/amendusageexternalcustomerid.d.ts +0 -27
- package/dist/sdk/models/operations/amendusageexternalcustomerid.js +0 -103
- package/dist/sdk/models/operations/archivecoupon.d.ts +0 -24
- package/dist/sdk/models/operations/archivecoupon.js +0 -91
- package/dist/sdk/models/operations/cancelsubscription.d.ts +0 -25
- package/dist/sdk/models/operations/cancelsubscription.js +0 -95
- package/dist/sdk/models/operations/closebackfill.d.ts +0 -24
- package/dist/sdk/models/operations/closebackfill.js +0 -91
- package/dist/sdk/models/operations/createbackfill.d.ts +0 -21
- package/dist/sdk/models/operations/createbackfill.js +0 -79
- package/dist/sdk/models/operations/createcoupon.d.ts +0 -21
- package/dist/sdk/models/operations/createcoupon.js +0 -79
- package/dist/sdk/models/operations/createcustomer.d.ts +0 -21
- package/dist/sdk/models/operations/createcustomer.js +0 -79
- package/dist/sdk/models/operations/createcustomerbalancetransaction.d.ts +0 -25
- package/dist/sdk/models/operations/createcustomerbalancetransaction.js +0 -95
- package/dist/sdk/models/operations/createinvoice.d.ts +0 -21
- package/dist/sdk/models/operations/createinvoice.js +0 -79
- package/dist/sdk/models/operations/createinvoicelineitem.d.ts +0 -21
- package/dist/sdk/models/operations/createinvoicelineitem.js +0 -79
- package/dist/sdk/models/operations/createledgerentry.d.ts +0 -24
- package/dist/sdk/models/operations/createledgerentry.js +0 -71
- package/dist/sdk/models/operations/createledgerentryexternalid.d.ts +0 -24
- package/dist/sdk/models/operations/createledgerentryexternalid.js +0 -71
- package/dist/sdk/models/operations/createmetric.d.ts +0 -21
- package/dist/sdk/models/operations/createmetric.js +0 -79
- package/dist/sdk/models/operations/createplan.d.ts +0 -21
- package/dist/sdk/models/operations/createplan.js +0 -79
- package/dist/sdk/models/operations/createprice.d.ts +0 -20
- package/dist/sdk/models/operations/createprice.js +0 -55
- package/dist/sdk/models/operations/createsubscription.d.ts +0 -21
- package/dist/sdk/models/operations/createsubscription.js +0 -79
- package/dist/sdk/models/operations/deletecustomer.d.ts +0 -24
- package/dist/sdk/models/operations/deletecustomer.js +0 -91
- package/dist/sdk/models/operations/deprecateevent.d.ts +0 -24
- package/dist/sdk/models/operations/deprecateevent.js +0 -91
- package/dist/sdk/models/operations/fetchbackfill.d.ts +0 -24
- package/dist/sdk/models/operations/fetchbackfill.js +0 -91
- package/dist/sdk/models/operations/fetchcoupon.d.ts +0 -24
- package/dist/sdk/models/operations/fetchcoupon.js +0 -91
- package/dist/sdk/models/operations/fetchcreditnote.d.ts +0 -24
- package/dist/sdk/models/operations/fetchcreditnote.js +0 -91
- package/dist/sdk/models/operations/fetchcustomer.d.ts +0 -24
- package/dist/sdk/models/operations/fetchcustomer.js +0 -91
- package/dist/sdk/models/operations/fetchcustomercosts.d.ts +0 -38
- package/dist/sdk/models/operations/fetchcustomercosts.js +0 -115
- package/dist/sdk/models/operations/fetchcustomercostsexternalid.d.ts +0 -38
- package/dist/sdk/models/operations/fetchcustomercostsexternalid.js +0 -115
- package/dist/sdk/models/operations/fetchcustomercredits.d.ts +0 -26
- package/dist/sdk/models/operations/fetchcustomercredits.js +0 -99
- package/dist/sdk/models/operations/fetchcustomercreditsexternalid.d.ts +0 -26
- package/dist/sdk/models/operations/fetchcustomercreditsexternalid.js +0 -99
- package/dist/sdk/models/operations/fetchcustomercreditsledger.d.ts +0 -47
- package/dist/sdk/models/operations/fetchcustomercreditsledger.js +0 -146
- package/dist/sdk/models/operations/fetchcustomercreditsledgerexternalid.d.ts +0 -47
- package/dist/sdk/models/operations/fetchcustomercreditsledgerexternalid.js +0 -146
- package/dist/sdk/models/operations/fetchcustomerexternalid.d.ts +0 -24
- package/dist/sdk/models/operations/fetchcustomerexternalid.js +0 -91
- package/dist/sdk/models/operations/fetchinvoice.d.ts +0 -24
- package/dist/sdk/models/operations/fetchinvoice.js +0 -91
- package/dist/sdk/models/operations/fetchitem.d.ts +0 -24
- package/dist/sdk/models/operations/fetchitem.js +0 -91
- package/dist/sdk/models/operations/fetchmetric.d.ts +0 -24
- package/dist/sdk/models/operations/fetchmetric.js +0 -91
- package/dist/sdk/models/operations/fetchplan.d.ts +0 -24
- package/dist/sdk/models/operations/fetchplan.js +0 -91
- package/dist/sdk/models/operations/fetchplanexternalid.d.ts +0 -24
- package/dist/sdk/models/operations/fetchplanexternalid.js +0 -91
- package/dist/sdk/models/operations/fetchprice.d.ts +0 -23
- package/dist/sdk/models/operations/fetchprice.js +0 -67
- package/dist/sdk/models/operations/fetchpriceexternalid.d.ts +0 -23
- package/dist/sdk/models/operations/fetchpriceexternalid.js +0 -67
- package/dist/sdk/models/operations/fetchsubscription.d.ts +0 -24
- package/dist/sdk/models/operations/fetchsubscription.js +0 -91
- package/dist/sdk/models/operations/fetchsubscriptioncosts.d.ts +0 -38
- package/dist/sdk/models/operations/fetchsubscriptioncosts.js +0 -115
- package/dist/sdk/models/operations/fetchsubscriptionschedule.d.ts +0 -30
- package/dist/sdk/models/operations/fetchsubscriptionschedule.js +0 -115
- package/dist/sdk/models/operations/fetchsubscriptionusage.d.ts +0 -54
- package/dist/sdk/models/operations/fetchsubscriptionusage.js +0 -130
- package/dist/sdk/models/operations/fetchupcominginvoice.d.ts +0 -24
- package/dist/sdk/models/operations/fetchupcominginvoice.js +0 -91
- package/dist/sdk/models/operations/index.d.ts +0 -73
- package/dist/sdk/models/operations/index.js +0 -92
- package/dist/sdk/models/operations/ingest.d.ts +0 -26
- package/dist/sdk/models/operations/ingest.js +0 -99
- package/dist/sdk/models/operations/issueinvoice.d.ts +0 -24
- package/dist/sdk/models/operations/issueinvoice.js +0 -91
- package/dist/sdk/models/operations/listbackfills.d.ts +0 -25
- package/dist/sdk/models/operations/listbackfills.js +0 -95
- package/dist/sdk/models/operations/listbalancetransactions.d.ts +0 -30
- package/dist/sdk/models/operations/listbalancetransactions.js +0 -115
- package/dist/sdk/models/operations/listcoupons.d.ts +0 -27
- package/dist/sdk/models/operations/listcoupons.js +0 -103
- package/dist/sdk/models/operations/listcouponsubscriptions.d.ts +0 -26
- package/dist/sdk/models/operations/listcouponsubscriptions.js +0 -99
- package/dist/sdk/models/operations/listcreditnotes.d.ts +0 -25
- package/dist/sdk/models/operations/listcreditnotes.js +0 -95
- package/dist/sdk/models/operations/listcustomers.d.ts +0 -29
- package/dist/sdk/models/operations/listcustomers.js +0 -111
- package/dist/sdk/models/operations/listinvoices.d.ts +0 -62
- package/dist/sdk/models/operations/listinvoices.js +0 -189
- package/dist/sdk/models/operations/listitems.d.ts +0 -25
- package/dist/sdk/models/operations/listitems.js +0 -95
- package/dist/sdk/models/operations/listmetrics.d.ts +0 -29
- package/dist/sdk/models/operations/listmetrics.js +0 -111
- package/dist/sdk/models/operations/listplans.d.ts +0 -41
- package/dist/sdk/models/operations/listplans.js +0 -124
- package/dist/sdk/models/operations/listprices.d.ts +0 -25
- package/dist/sdk/models/operations/listprices.js +0 -95
- package/dist/sdk/models/operations/listsubscriptions.d.ts +0 -37
- package/dist/sdk/models/operations/listsubscriptions.js +0 -129
- package/dist/sdk/models/operations/markinvoiceaspaid.d.ts +0 -25
- package/dist/sdk/models/operations/markinvoiceaspaid.js +0 -95
- package/dist/sdk/models/operations/ping.d.ts +0 -21
- package/dist/sdk/models/operations/ping.js +0 -79
- package/dist/sdk/models/operations/revertbackfill.d.ts +0 -24
- package/dist/sdk/models/operations/revertbackfill.js +0 -91
- package/dist/sdk/models/operations/scheduleplanchange.d.ts +0 -25
- package/dist/sdk/models/operations/scheduleplanchange.js +0 -95
- package/dist/sdk/models/operations/searchevents.d.ts +0 -30
- package/dist/sdk/models/operations/searchevents.js +0 -115
- package/dist/sdk/models/operations/triggerphase.d.ts +0 -25
- package/dist/sdk/models/operations/triggerphase.js +0 -95
- package/dist/sdk/models/operations/unschedulecancellation.d.ts +0 -24
- package/dist/sdk/models/operations/unschedulecancellation.js +0 -91
- package/dist/sdk/models/operations/unschedulefixedfeequantity.d.ts +0 -25
- package/dist/sdk/models/operations/unschedulefixedfeequantity.js +0 -95
- package/dist/sdk/models/operations/unscheduleplanchange.d.ts +0 -24
- package/dist/sdk/models/operations/unscheduleplanchange.js +0 -91
- package/dist/sdk/models/operations/updatecustomer.d.ts +0 -25
- package/dist/sdk/models/operations/updatecustomer.js +0 -95
- package/dist/sdk/models/operations/updatecustomerexternalid.d.ts +0 -25
- package/dist/sdk/models/operations/updatecustomerexternalid.js +0 -95
- package/dist/sdk/models/operations/updatefixedfeequantity.d.ts +0 -25
- package/dist/sdk/models/operations/updatefixedfeequantity.js +0 -95
- package/dist/sdk/models/operations/updateplan.d.ts +0 -25
- package/dist/sdk/models/operations/updateplan.js +0 -95
- package/dist/sdk/models/operations/updateplanexternal.d.ts +0 -25
- package/dist/sdk/models/operations/updateplanexternal.js +0 -95
- package/dist/sdk/models/operations/voidinvoice.d.ts +0 -24
- package/dist/sdk/models/operations/voidinvoice.js +0 -91
- package/dist/sdk/models/shared/accountingprovider.d.ts +0 -9
- package/dist/sdk/models/shared/accountingprovider.js +0 -55
- package/dist/sdk/models/shared/accountingproviderconfig.d.ts +0 -5
- package/dist/sdk/models/shared/accountingproviderconfig.js +0 -50
- package/dist/sdk/models/shared/accountingsyncconfiguration.d.ts +0 -6
- package/dist/sdk/models/shared/accountingsyncconfiguration.js +0 -52
- package/dist/sdk/models/shared/addeditpriceintervalparams.d.ts +0 -13
- package/dist/sdk/models/shared/addeditpriceintervalparams.js +0 -54
- package/dist/sdk/models/shared/addpriceintervalparams.d.ts +0 -40
- package/dist/sdk/models/shared/addpriceintervalparams.js +0 -87
- package/dist/sdk/models/shared/address.d.ts +0 -9
- package/dist/sdk/models/shared/address.js +0 -70
- package/dist/sdk/models/shared/addressinput.d.ts +0 -9
- package/dist/sdk/models/shared/addressinput.js +0 -70
- package/dist/sdk/models/shared/aggregatedcost.d.ts +0 -15
- package/dist/sdk/models/shared/aggregatedcost.js +0 -75
- package/dist/sdk/models/shared/amendedevent.d.ts +0 -28
- package/dist/sdk/models/shared/amendedevent.js +0 -81
- package/dist/sdk/models/shared/amendedusage.d.ts +0 -11
- package/dist/sdk/models/shared/amendedusage.js +0 -50
- package/dist/sdk/models/shared/amendeventresult.d.ts +0 -7
- package/dist/sdk/models/shared/amendeventresult.js +0 -45
- package/dist/sdk/models/shared/autocollection.d.ts +0 -15
- package/dist/sdk/models/shared/autocollection.js +0 -63
- package/dist/sdk/models/shared/backfill.d.ts +0 -27
- package/dist/sdk/models/shared/backfill.js +0 -104
- package/dist/sdk/models/shared/backfills.d.ts +0 -7
- package/dist/sdk/models/shared/backfills.js +0 -54
- package/dist/sdk/models/shared/backfillstatus.d.ts +0 -9
- package/dist/sdk/models/shared/backfillstatus.js +0 -16
- package/dist/sdk/models/shared/billablemetric.d.ts +0 -27
- package/dist/sdk/models/shared/billablemetric.js +0 -84
- package/dist/sdk/models/shared/billablemetrics.d.ts +0 -7
- package/dist/sdk/models/shared/billablemetrics.js +0 -54
- package/dist/sdk/models/shared/billingcyclealignment.d.ts +0 -8
- package/dist/sdk/models/shared/billingcyclealignment.js +0 -15
- package/dist/sdk/models/shared/cancelsubscriptionparams.d.ts +0 -19
- package/dist/sdk/models/shared/cancelsubscriptionparams.js +0 -63
- package/dist/sdk/models/shared/changeoption.d.ts +0 -5
- package/dist/sdk/models/shared/changeoption.js +0 -12
- package/dist/sdk/models/shared/coupon.d.ts +0 -40
- package/dist/sdk/models/shared/coupon.js +0 -98
- package/dist/sdk/models/shared/couponredemption.d.ts +0 -6
- package/dist/sdk/models/shared/couponredemption.js +0 -63
- package/dist/sdk/models/shared/coupons.d.ts +0 -7
- package/dist/sdk/models/shared/coupons.js +0 -54
- package/dist/sdk/models/shared/createinvoicelineitemparams.d.ts +0 -28
- package/dist/sdk/models/shared/createinvoicelineitemparams.js +0 -81
- package/dist/sdk/models/shared/createoneoffinvoiceparams.d.ts +0 -33
- package/dist/sdk/models/shared/createoneoffinvoiceparams.js +0 -86
- package/dist/sdk/models/shared/creditledgerentries.d.ts +0 -6
- package/dist/sdk/models/shared/creditledgerentries.js +0 -52
- package/dist/sdk/models/shared/creditnote.d.ts +0 -83
- package/dist/sdk/models/shared/creditnote.js +0 -171
- package/dist/sdk/models/shared/creditnotelineitem.d.ts +0 -40
- package/dist/sdk/models/shared/creditnotelineitem.js +0 -100
- package/dist/sdk/models/shared/creditnoteminified.d.ts +0 -7
- package/dist/sdk/models/shared/creditnoteminified.js +0 -45
- package/dist/sdk/models/shared/creditnotes.d.ts +0 -7
- package/dist/sdk/models/shared/creditnotes.js +0 -54
- package/dist/sdk/models/shared/creditnotesublineitem.d.ts +0 -6
- package/dist/sdk/models/shared/creditnotesublineitem.js +0 -55
- package/dist/sdk/models/shared/creditnotesummary.d.ts +0 -12
- package/dist/sdk/models/shared/creditnotesummary.js +0 -74
- package/dist/sdk/models/shared/customer.d.ts +0 -76
- package/dist/sdk/models/shared/customer.js +0 -182
- package/dist/sdk/models/shared/customerbalancetransaction.d.ts +0 -42
- package/dist/sdk/models/shared/customerbalancetransaction.js +0 -109
- package/dist/sdk/models/shared/customerbalancetransactions.d.ts +0 -7
- package/dist/sdk/models/shared/customerbalancetransactions.js +0 -54
- package/dist/sdk/models/shared/customercosts.d.ts +0 -5
- package/dist/sdk/models/shared/customercosts.js +0 -47
- package/dist/sdk/models/shared/customercreditbalance.d.ts +0 -7
- package/dist/sdk/models/shared/customercreditbalance.js +0 -64
- package/dist/sdk/models/shared/customercreditbalances.d.ts +0 -7
- package/dist/sdk/models/shared/customercreditbalances.js +0 -54
- package/dist/sdk/models/shared/customerminified.d.ts +0 -5
- package/dist/sdk/models/shared/customerminified.js +0 -50
- package/dist/sdk/models/shared/customers.d.ts +0 -7
- package/dist/sdk/models/shared/customers.js +0 -54
- package/dist/sdk/models/shared/customertaxid.d.ts +0 -6
- package/dist/sdk/models/shared/customertaxid.js +0 -55
- package/dist/sdk/models/shared/debug.d.ts +0 -8
- package/dist/sdk/models/shared/debug.js +0 -53
- package/dist/sdk/models/shared/deletecustomerresponse.d.ts +0 -3
- package/dist/sdk/models/shared/deletecustomerresponse.js +0 -30
- package/dist/sdk/models/shared/deprecatedeventresult.d.ts +0 -7
- package/dist/sdk/models/shared/deprecatedeventresult.js +0 -45
- package/dist/sdk/models/shared/discount.d.ts +0 -33
- package/dist/sdk/models/shared/discount.js +0 -80
- package/dist/sdk/models/shared/editcustomer.d.ts +0 -72
- package/dist/sdk/models/shared/editcustomer.js +0 -151
- package/dist/sdk/models/shared/editplan.d.ts +0 -10
- package/dist/sdk/models/shared/editplan.js +0 -59
- package/dist/sdk/models/shared/editpriceintervalparams.d.ts +0 -20
- package/dist/sdk/models/shared/editpriceintervalparams.js +0 -62
- package/dist/sdk/models/shared/event.d.ts +0 -39
- package/dist/sdk/models/shared/event.js +0 -93
- package/dist/sdk/models/shared/events.d.ts +0 -7
- package/dist/sdk/models/shared/events.js +0 -54
- package/dist/sdk/models/shared/eventsearchcriteria.d.ts +0 -11
- package/dist/sdk/models/shared/eventsearchcriteria.js +0 -50
- package/dist/sdk/models/shared/fixedfeequantitychange.d.ts +0 -25
- package/dist/sdk/models/shared/fixedfeequantitychange.js +0 -75
- package/dist/sdk/models/shared/fixedfeequantityscheduleentry.d.ts +0 -7
- package/dist/sdk/models/shared/fixedfeequantityscheduleentry.js +0 -68
- package/dist/sdk/models/shared/fixedfeequantitytransition.d.ts +0 -6
- package/dist/sdk/models/shared/fixedfeequantitytransition.js +0 -59
- package/dist/sdk/models/shared/index.d.ts +0 -109
- package/dist/sdk/models/shared/index.js +0 -128
- package/dist/sdk/models/shared/ingestevent.d.ts +0 -32
- package/dist/sdk/models/shared/ingestevent.js +0 -86
- package/dist/sdk/models/shared/ingestionresponse.d.ts +0 -13
- package/dist/sdk/models/shared/ingestionresponse.js +0 -54
- package/dist/sdk/models/shared/ingestrequestbody.d.ts +0 -5
- package/dist/sdk/models/shared/ingestrequestbody.js +0 -47
- package/dist/sdk/models/shared/invoice.d.ts +0 -138
- package/dist/sdk/models/shared/invoice.js +0 -329
- package/dist/sdk/models/shared/invoicelineitem.d.ts +0 -49
- package/dist/sdk/models/shared/invoicelineitem.js +0 -134
- package/dist/sdk/models/shared/invoicelineitemparams.d.ts +0 -26
- package/dist/sdk/models/shared/invoicelineitemparams.js +0 -90
- package/dist/sdk/models/shared/invoiceminified.d.ts +0 -7
- package/dist/sdk/models/shared/invoiceminified.js +0 -45
- package/dist/sdk/models/shared/invoices.d.ts +0 -7
- package/dist/sdk/models/shared/invoices.js +0 -54
- package/dist/sdk/models/shared/item.d.ts +0 -14
- package/dist/sdk/models/shared/item.js +0 -72
- package/dist/sdk/models/shared/itemexternalconnection.d.ts +0 -5
- package/dist/sdk/models/shared/itemexternalconnection.js +0 -50
- package/dist/sdk/models/shared/items.d.ts +0 -7
- package/dist/sdk/models/shared/items.js +0 -54
- package/dist/sdk/models/shared/markaspaidrequestparams.d.ts +0 -16
- package/dist/sdk/models/shared/markaspaidrequestparams.js +0 -61
- package/dist/sdk/models/shared/maximum.d.ts +0 -11
- package/dist/sdk/models/shared/maximum.js +0 -50
- package/dist/sdk/models/shared/maximuminterval.d.ts +0 -23
- package/dist/sdk/models/shared/maximuminterval.js +0 -73
- package/dist/sdk/models/shared/minimum.d.ts +0 -11
- package/dist/sdk/models/shared/minimum.js +0 -50
- package/dist/sdk/models/shared/minimuminterval.d.ts +0 -23
- package/dist/sdk/models/shared/minimuminterval.js +0 -73
- package/dist/sdk/models/shared/newaccountingsyncconfiguration.d.ts +0 -6
- package/dist/sdk/models/shared/newaccountingsyncconfiguration.js +0 -52
- package/dist/sdk/models/shared/newbackfill.d.ts +0 -27
- package/dist/sdk/models/shared/newbackfill.js +0 -82
- package/dist/sdk/models/shared/newbillablemetric.d.ts +0 -28
- package/dist/sdk/models/shared/newbillablemetric.js +0 -77
- package/dist/sdk/models/shared/newcoupon.d.ts +0 -18
- package/dist/sdk/models/shared/newcoupon.js +0 -69
- package/dist/sdk/models/shared/newcustomer.d.ts +0 -68
- package/dist/sdk/models/shared/newcustomer.js +0 -152
- package/dist/sdk/models/shared/newcustomerbalancetransaction.d.ts +0 -13
- package/dist/sdk/models/shared/newcustomerbalancetransaction.js +0 -60
- package/dist/sdk/models/shared/newplan.d.ts +0 -26
- package/dist/sdk/models/shared/newplan.js +0 -93
- package/dist/sdk/models/shared/newreportingconfiguration.d.ts +0 -4
- package/dist/sdk/models/shared/newreportingconfiguration.js +0 -45
- package/dist/sdk/models/shared/newsubscription.d.ts +0 -54
- package/dist/sdk/models/shared/newsubscription.js +0 -187
- package/dist/sdk/models/shared/paginationmetadata.d.ts +0 -5
- package/dist/sdk/models/shared/paginationmetadata.js +0 -50
- package/dist/sdk/models/shared/perpricecost.d.ts +0 -224
- package/dist/sdk/models/shared/perpricecost.js +0 -67
- package/dist/sdk/models/shared/phaseoverride.d.ts +0 -17
- package/dist/sdk/models/shared/phaseoverride.js +0 -62
- package/dist/sdk/models/shared/pingresponse.d.ts +0 -4
- package/dist/sdk/models/shared/pingresponse.js +0 -45
- package/dist/sdk/models/shared/plan.d.ts +0 -66
- package/dist/sdk/models/shared/plan.js +0 -188
- package/dist/sdk/models/shared/planminified.d.ts +0 -9
- package/dist/sdk/models/shared/planminified.js +0 -55
- package/dist/sdk/models/shared/planphase.d.ts +0 -28
- package/dist/sdk/models/shared/planphase.js +0 -106
- package/dist/sdk/models/shared/plans.d.ts +0 -7
- package/dist/sdk/models/shared/plans.js +0 -54
- package/dist/sdk/models/shared/pricegroup.d.ts +0 -17
- package/dist/sdk/models/shared/pricegroup.js +0 -65
- package/dist/sdk/models/shared/priceinterval.d.ts +0 -239
- package/dist/sdk/models/shared/priceinterval.js +0 -104
- package/dist/sdk/models/shared/priceintervalfixedfeequantitytransitionparams.d.ts +0 -11
- package/dist/sdk/models/shared/priceintervalfixedfeequantitytransitionparams.js +0 -54
- package/dist/sdk/models/shared/prices.d.ts +0 -6
- package/dist/sdk/models/shared/prices.js +0 -52
- package/dist/sdk/models/shared/product.d.ts +0 -6
- package/dist/sdk/models/shared/product.js +0 -59
- package/dist/sdk/models/shared/reportingconfiguration.d.ts +0 -4
- package/dist/sdk/models/shared/reportingconfiguration.js +0 -45
- package/dist/sdk/models/shared/security.d.ts +0 -4
- package/dist/sdk/models/shared/security.js +0 -45
- package/dist/sdk/models/shared/subscription.d.ts +0 -128
- package/dist/sdk/models/shared/subscription.js +0 -226
- package/dist/sdk/models/shared/subscriptioncosts.d.ts +0 -5
- package/dist/sdk/models/shared/subscriptioncosts.js +0 -47
- package/dist/sdk/models/shared/subscriptionminified.d.ts +0 -4
- package/dist/sdk/models/shared/subscriptionminified.js +0 -45
- package/dist/sdk/models/shared/subscriptionplanchange.d.ts +0 -59
- package/dist/sdk/models/shared/subscriptionplanchange.js +0 -126
- package/dist/sdk/models/shared/subscriptions.d.ts +0 -7
- package/dist/sdk/models/shared/subscriptions.js +0 -54
- package/dist/sdk/models/shared/subscriptionscheduleitem.d.ts +0 -7
- package/dist/sdk/models/shared/subscriptionscheduleitem.js +0 -65
- package/dist/sdk/models/shared/subscriptionscheduleitems.d.ts +0 -7
- package/dist/sdk/models/shared/subscriptionscheduleitems.js +0 -54
- package/dist/sdk/models/shared/subscriptiontrialinfo.d.ts +0 -4
- package/dist/sdk/models/shared/subscriptiontrialinfo.js +0 -49
- package/dist/sdk/models/shared/taxamount.d.ts +0 -15
- package/dist/sdk/models/shared/taxamount.js +0 -55
- package/dist/sdk/models/shared/trialconfig.d.ts +0 -8
- package/dist/sdk/models/shared/trialconfig.js +0 -54
- package/dist/sdk/models/shared/triggersubscriptionphaseparams.d.ts +0 -8
- package/dist/sdk/models/shared/triggersubscriptionphaseparams.js +0 -51
- package/dist/sdk/models/shared/unschedulefixedfeequantitychangeparams.d.ts +0 -7
- package/dist/sdk/models/shared/unschedulefixedfeequantitychangeparams.js +0 -45
- package/dist/sdk/models/shared/upcominginvoice.d.ts +0 -130
- package/dist/sdk/models/shared/upcominginvoice.js +0 -321
- package/dist/sdk/models/shared/updateevent.d.ts +0 -28
- package/dist/sdk/models/shared/updateevent.js +0 -81
- package/dist/sdk/models/shared/validationerror.d.ts +0 -11
- package/dist/sdk/models/shared/validationerror.js +0 -50
- package/dist/sdk/plan.d.ts +0 -90
- package/dist/sdk/plan.js +0 -764
- package/dist/sdk/price.d.ts +0 -246
- package/dist/sdk/price.js +0 -715
- package/dist/sdk/priceinterval.d.ts +0 -66
- package/dist/sdk/priceinterval.js +0 -263
- package/dist/sdk/sdk.d.ts +0 -389
- package/dist/sdk/sdk.js +0 -93
- package/dist/sdk/subscription.d.ts +0 -769
- package/dist/sdk/subscription.js +0 -2116
- package/dist/sdk/types/index.d.ts +0 -1
- package/dist/sdk/types/index.js +0 -20
- package/dist/sdk/types/rfcdate.d.ts +0 -9
- package/dist/sdk/types/rfcdate.js +0 -59
- package/docs/models/errors/fivehundrederror.md +0 -12
- package/docs/models/errors/fivehundrederrorheaders.md +0 -7
- package/docs/models/errors/fourhundredandoneerror.md +0 -12
- package/docs/models/errors/fourhundredandoneerrorheaders.md +0 -7
- package/docs/models/errors/fourhundredandtwentynineerror.md +0 -12
- package/docs/models/errors/fourhundredandtwentynineerrorheaders.md +0 -7
- package/docs/models/operations/addeditpriceintervalsrequest.md +0 -9
- package/docs/models/operations/addeditpriceintervalsresponse.md +0 -11
- package/docs/models/operations/amendeventrequest.md +0 -9
- package/docs/models/operations/amendeventresponse.md +0 -11
- package/docs/models/operations/amendusageexternalcustomeridrequest.md +0 -11
- package/docs/models/operations/amendusageexternalcustomeridresponse.md +0 -11
- package/docs/models/operations/amendusagerequest.md +0 -11
- package/docs/models/operations/amendusageresponse.md +0 -11
- package/docs/models/operations/archivecouponrequest.md +0 -8
- package/docs/models/operations/archivecouponresponse.md +0 -11
- package/docs/models/operations/cancelsubscriptionrequest.md +0 -9
- package/docs/models/operations/cancelsubscriptionresponse.md +0 -11
- package/docs/models/operations/closebackfillrequest.md +0 -8
- package/docs/models/operations/closebackfillresponse.md +0 -11
- package/docs/models/operations/createbackfillresponse.md +0 -11
- package/docs/models/operations/createcouponresponse.md +0 -11
- package/docs/models/operations/createcustomerbalancetransactionrequest.md +0 -9
- package/docs/models/operations/createcustomerbalancetransactionresponse.md +0 -11
- package/docs/models/operations/createcustomerresponse.md +0 -11
- package/docs/models/operations/createinvoicelineitemresponse.md +0 -11
- package/docs/models/operations/createinvoiceresponse.md +0 -11
- package/docs/models/operations/createledgerentryexternalidrequest.md +0 -9
- package/docs/models/operations/createledgerentryexternalidresponse.md +0 -11
- package/docs/models/operations/createledgerentryrequest.md +0 -9
- package/docs/models/operations/createledgerentryresponse.md +0 -11
- package/docs/models/operations/createmetricresponse.md +0 -11
- package/docs/models/operations/createplanresponse.md +0 -11
- package/docs/models/operations/createpriceresponse.md +0 -11
- package/docs/models/operations/createsubscriptionresponse.md +0 -11
- package/docs/models/operations/deletecustomerrequest.md +0 -8
- package/docs/models/operations/deletecustomerresponse.md +0 -11
- package/docs/models/operations/deprecateeventrequest.md +0 -8
- package/docs/models/operations/deprecateeventresponse.md +0 -11
- package/docs/models/operations/fetchbackfillrequest.md +0 -8
- package/docs/models/operations/fetchbackfillresponse.md +0 -11
- package/docs/models/operations/fetchcouponrequest.md +0 -8
- package/docs/models/operations/fetchcouponresponse.md +0 -11
- package/docs/models/operations/fetchcreditnoterequest.md +0 -8
- package/docs/models/operations/fetchcreditnoteresponse.md +0 -11
- package/docs/models/operations/fetchcustomercostsexternalidrequest.md +0 -12
- package/docs/models/operations/fetchcustomercostsexternalidresponse.md +0 -11
- package/docs/models/operations/fetchcustomercostsexternalidviewmodeviewmode.md +0 -11
- package/docs/models/operations/fetchcustomercostsrequest.md +0 -12
- package/docs/models/operations/fetchcustomercostsresponse.md +0 -11
- package/docs/models/operations/fetchcustomercostsviewmodeviewmode.md +0 -11
- package/docs/models/operations/fetchcustomercreditsexternalidrequest.md +0 -10
- package/docs/models/operations/fetchcustomercreditsexternalidresponse.md +0 -11
- package/docs/models/operations/fetchcustomercreditsledgerentrystatusentrystatus.md +0 -9
- package/docs/models/operations/fetchcustomercreditsledgerentrytypeentrytype.md +0 -14
- package/docs/models/operations/fetchcustomercreditsledgerexternalidentrystatusentrystatus.md +0 -9
- package/docs/models/operations/fetchcustomercreditsledgerexternalidentrytypeentrytype.md +0 -14
- package/docs/models/operations/fetchcustomercreditsledgerexternalidrequest.md +0 -18
- package/docs/models/operations/fetchcustomercreditsledgerexternalidresponse.md +0 -11
- package/docs/models/operations/fetchcustomercreditsledgerrequest.md +0 -18
- package/docs/models/operations/fetchcustomercreditsledgerresponse.md +0 -11
- package/docs/models/operations/fetchcustomercreditsrequest.md +0 -10
- package/docs/models/operations/fetchcustomercreditsresponse.md +0 -11
- package/docs/models/operations/fetchcustomerexternalidrequest.md +0 -8
- package/docs/models/operations/fetchcustomerexternalidresponse.md +0 -11
- package/docs/models/operations/fetchcustomerrequest.md +0 -8
- package/docs/models/operations/fetchcustomerresponse.md +0 -11
- package/docs/models/operations/fetchinvoicerequest.md +0 -8
- package/docs/models/operations/fetchinvoiceresponse.md +0 -11
- package/docs/models/operations/fetchitemrequest.md +0 -8
- package/docs/models/operations/fetchitemresponse.md +0 -11
- package/docs/models/operations/fetchmetricrequest.md +0 -8
- package/docs/models/operations/fetchmetricresponse.md +0 -11
- package/docs/models/operations/fetchplanexternalidrequest.md +0 -8
- package/docs/models/operations/fetchplanexternalidresponse.md +0 -11
- package/docs/models/operations/fetchplanrequest.md +0 -8
- package/docs/models/operations/fetchplanresponse.md +0 -11
- package/docs/models/operations/fetchpriceexternalidrequest.md +0 -8
- package/docs/models/operations/fetchpriceexternalidresponse.md +0 -11
- package/docs/models/operations/fetchpricerequest.md +0 -8
- package/docs/models/operations/fetchpriceresponse.md +0 -11
- package/docs/models/operations/fetchsubscriptioncostsrequest.md +0 -12
- package/docs/models/operations/fetchsubscriptioncostsresponse.md +0 -11
- package/docs/models/operations/fetchsubscriptioncostsviewmodeviewmode.md +0 -11
- package/docs/models/operations/fetchsubscriptionrequest.md +0 -8
- package/docs/models/operations/fetchsubscriptionresponse.md +0 -11
- package/docs/models/operations/fetchsubscriptionschedulerequest.md +0 -14
- package/docs/models/operations/fetchsubscriptionscheduleresponse.md +0 -11
- package/docs/models/operations/fetchsubscriptionusagegranularitygranularity.md +0 -10
- package/docs/models/operations/fetchsubscriptionusagerequest.md +0 -20
- package/docs/models/operations/fetchsubscriptionusageresponse.md +0 -11
- package/docs/models/operations/fetchsubscriptionusageviewmodeviewmode.md +0 -11
- package/docs/models/operations/fetchupcominginvoicerequest.md +0 -8
- package/docs/models/operations/fetchupcominginvoiceresponse.md +0 -11
- package/docs/models/operations/ingestrequest.md +0 -10
- package/docs/models/operations/ingestresponse.md +0 -11
- package/docs/models/operations/issueinvoicerequest.md +0 -8
- package/docs/models/operations/issueinvoiceresponse.md +0 -11
- package/docs/models/operations/listbackfillsrequest.md +0 -9
- package/docs/models/operations/listbackfillsresponse.md +0 -11
- package/docs/models/operations/listbalancetransactionsrequest.md +0 -14
- package/docs/models/operations/listbalancetransactionsresponse.md +0 -11
- package/docs/models/operations/listcouponsrequest.md +0 -11
- package/docs/models/operations/listcouponsresponse.md +0 -11
- package/docs/models/operations/listcouponsubscriptionsrequest.md +0 -10
- package/docs/models/operations/listcouponsubscriptionsresponse.md +0 -11
- package/docs/models/operations/listcreditnotesrequest.md +0 -9
- package/docs/models/operations/listcreditnotesresponse.md +0 -11
- package/docs/models/operations/listcustomersrequest.md +0 -13
- package/docs/models/operations/listcustomersresponse.md +0 -11
- package/docs/models/operations/listinvoicesdatetypedatetype.md +0 -9
- package/docs/models/operations/listinvoicesrequest.md +0 -27
- package/docs/models/operations/listinvoicesresponse.md +0 -11
- package/docs/models/operations/listinvoicesstatus.md +0 -12
- package/docs/models/operations/listinvoicesstatusstatus.md +0 -12
- package/docs/models/operations/listitemsrequest.md +0 -9
- package/docs/models/operations/listitemsresponse.md +0 -11
- package/docs/models/operations/listmetricsrequest.md +0 -13
- package/docs/models/operations/listmetricsresponse.md +0 -11
- package/docs/models/operations/listplansrequest.md +0 -14
- package/docs/models/operations/listplansresponse.md +0 -11
- package/docs/models/operations/listplansstatusstatus.md +0 -12
- package/docs/models/operations/listpricesrequest.md +0 -9
- package/docs/models/operations/listpricesresponse.md +0 -11
- package/docs/models/operations/listsubscriptionsrequest.md +0 -16
- package/docs/models/operations/listsubscriptionsresponse.md +0 -11
- package/docs/models/operations/listsubscriptionsstatusstatus.md +0 -10
- package/docs/models/operations/markinvoiceaspaidrequest.md +0 -9
- package/docs/models/operations/markinvoiceaspaidresponse.md +0 -11
- package/docs/models/operations/pingresponse.md +0 -11
- package/docs/models/operations/revertbackfillrequest.md +0 -8
- package/docs/models/operations/revertbackfillresponse.md +0 -11
- package/docs/models/operations/scheduleplanchangerequest.md +0 -9
- package/docs/models/operations/scheduleplanchangeresponse.md +0 -11
- package/docs/models/operations/searcheventsrequest.md +0 -14
- package/docs/models/operations/searcheventsresponse.md +0 -11
- package/docs/models/operations/triggerphaserequest.md +0 -9
- package/docs/models/operations/triggerphaseresponse.md +0 -11
- package/docs/models/operations/unschedulecancellationrequest.md +0 -8
- package/docs/models/operations/unschedulecancellationresponse.md +0 -11
- package/docs/models/operations/unschedulefixedfeequantityrequest.md +0 -9
- package/docs/models/operations/unschedulefixedfeequantityresponse.md +0 -11
- package/docs/models/operations/unscheduleplanchangerequest.md +0 -8
- package/docs/models/operations/unscheduleplanchangeresponse.md +0 -11
- package/docs/models/operations/updatecustomerexternalidrequest.md +0 -9
- package/docs/models/operations/updatecustomerexternalidresponse.md +0 -11
- package/docs/models/operations/updatecustomerrequest.md +0 -9
- package/docs/models/operations/updatecustomerresponse.md +0 -11
- package/docs/models/operations/updatefixedfeequantityrequest.md +0 -9
- package/docs/models/operations/updatefixedfeequantityresponse.md +0 -11
- package/docs/models/operations/updateplanexternalrequest.md +0 -9
- package/docs/models/operations/updateplanexternalresponse.md +0 -11
- package/docs/models/operations/updateplanrequest.md +0 -9
- package/docs/models/operations/updateplanresponse.md +0 -11
- package/docs/models/operations/voidinvoicerequest.md +0 -8
- package/docs/models/operations/voidinvoiceresponse.md +0 -11
- package/docs/models/shared/accountingprovider.md +0 -9
- package/docs/models/shared/accountingproviderconfig.md +0 -9
- package/docs/models/shared/accountingproviderprovidertype.md +0 -9
- package/docs/models/shared/accountingsyncconfiguration.md +0 -9
- package/docs/models/shared/addeditpriceintervalparams.md +0 -9
- package/docs/models/shared/addpriceintervalparams.md +0 -16
- package/docs/models/shared/address.md +0 -13
- package/docs/models/shared/addressinput.md +0 -13
- package/docs/models/shared/aggregatedcost.md +0 -12
- package/docs/models/shared/amendedevent.md +0 -12
- package/docs/models/shared/amendedeventproperties.md +0 -9
- package/docs/models/shared/amendedusage.md +0 -9
- package/docs/models/shared/amendeventresult.md +0 -8
- package/docs/models/shared/autocollection.md +0 -10
- package/docs/models/shared/backfill.md +0 -17
- package/docs/models/shared/backfills.md +0 -9
- package/docs/models/shared/backfillstatus.md +0 -13
- package/docs/models/shared/billablemetric.md +0 -16
- package/docs/models/shared/billablemetrics.md +0 -9
- package/docs/models/shared/billablemetricstatus.md +0 -10
- package/docs/models/shared/billingcyclealignment.md +0 -12
- package/docs/models/shared/cancelsubscriptionparams.md +0 -9
- package/docs/models/shared/cancelsubscriptionparamscanceloption.md +0 -12
- package/docs/models/shared/changeoption.md +0 -10
- package/docs/models/shared/coupon.md +0 -21
- package/docs/models/shared/coupondiscount.md +0 -7
- package/docs/models/shared/couponredemption.md +0 -10
- package/docs/models/shared/coupons.md +0 -9
- package/docs/models/shared/createinvoicelineitemparams.md +0 -13
- package/docs/models/shared/createoneoffinvoiceparams.md +0 -15
- package/docs/models/shared/creditledgerentries.md +0 -9
- package/docs/models/shared/creditnote.md +0 -26
- package/docs/models/shared/creditnotediscounts.md +0 -7
- package/docs/models/shared/creditnotelineitem.md +0 -15
- package/docs/models/shared/creditnotelineitemdiscounts.md +0 -7
- package/docs/models/shared/creditnotelineitemtaxamounts.md +0 -7
- package/docs/models/shared/creditnotemaximumamountadjustment.md +0 -9
- package/docs/models/shared/creditnoteminified.md +0 -8
- package/docs/models/shared/creditnotereason.md +0 -11
- package/docs/models/shared/creditnotes.md +0 -9
- package/docs/models/shared/creditnotesublineitem.md +0 -10
- package/docs/models/shared/creditnotesummary.md +0 -13
- package/docs/models/shared/creditnotetype.md +0 -9
- package/docs/models/shared/customer.md +0 -42
- package/docs/models/shared/customerbalancetransaction.md +0 -17
- package/docs/models/shared/customerbalancetransactionaction.md +0 -10
- package/docs/models/shared/customerbalancetransactions.md +0 -9
- package/docs/models/shared/customerbalancetransactiontype.md +0 -9
- package/docs/models/shared/customercosts.md +0 -8
- package/docs/models/shared/customercreditbalance.md +0 -11
- package/docs/models/shared/customercreditbalances.md +0 -9
- package/docs/models/shared/customerminified.md +0 -9
- package/docs/models/shared/customerpaymentprovider.md +0 -14
- package/docs/models/shared/customers.md +0 -9
- package/docs/models/shared/customertaxid.md +0 -10
- package/docs/models/shared/debug.md +0 -11
- package/docs/models/shared/deletecustomerresponse.md +0 -7
- package/docs/models/shared/deprecatedeventresult.md +0 -8
- package/docs/models/shared/discount.md +0 -15
- package/docs/models/shared/discountdiscounttype.md +0 -11
- package/docs/models/shared/editcustomer.md +0 -22
- package/docs/models/shared/editcustomermetadata.md +0 -9
- package/docs/models/shared/editcustomerpaymentprovider.md +0 -16
- package/docs/models/shared/editplan.md +0 -9
- package/docs/models/shared/editplanmetadata.md +0 -7
- package/docs/models/shared/editpriceintervalparams.md +0 -11
- package/docs/models/shared/event.md +0 -17
- package/docs/models/shared/eventproperties.md +0 -9
- package/docs/models/shared/events.md +0 -9
- package/docs/models/shared/eventsearchcriteria.md +0 -9
- package/docs/models/shared/fixedfeequantitychange.md +0 -11
- package/docs/models/shared/fixedfeequantitychangechangeoption.md +0 -12
- package/docs/models/shared/fixedfeequantityscheduleentry.md +0 -11
- package/docs/models/shared/fixedfeequantitytransition.md +0 -10
- package/docs/models/shared/ingestevent.md +0 -13
- package/docs/models/shared/ingesteventproperties.md +0 -9
- package/docs/models/shared/ingestionresponse.md +0 -9
- package/docs/models/shared/ingestrequestbody.md +0 -8
- package/docs/models/shared/invoice.md +0 -51
- package/docs/models/shared/invoicelineitem.md +0 -23
- package/docs/models/shared/invoicelineitemparams.md +0 -14
- package/docs/models/shared/invoicelineitemparamsmodeltype.md +0 -8
- package/docs/models/shared/invoicemetadata.md +0 -7
- package/docs/models/shared/invoiceminified.md +0 -8
- package/docs/models/shared/invoices.md +0 -9
- package/docs/models/shared/invoicestatus.md +0 -12
- package/docs/models/shared/item.md +0 -14
- package/docs/models/shared/itemexternalconnection.md +0 -9
- package/docs/models/shared/items.md +0 -9
- package/docs/models/shared/markaspaidrequestparams.md +0 -10
- package/docs/models/shared/maximum.md +0 -9
- package/docs/models/shared/maximuminterval.md +0 -12
- package/docs/models/shared/minimum.md +0 -9
- package/docs/models/shared/minimuminterval.md +0 -12
- package/docs/models/shared/newaccountingsyncconfiguration.md +0 -9
- package/docs/models/shared/newbackfill.md +0 -13
- package/docs/models/shared/newbillablemetric.md +0 -12
- package/docs/models/shared/newbillablemetricmetadata.md +0 -9
- package/docs/models/shared/newcoupon.md +0 -11
- package/docs/models/shared/newcoupondiscount.md +0 -7
- package/docs/models/shared/newcustomer.md +0 -23
- package/docs/models/shared/newcustomerbalancetransaction.md +0 -10
- package/docs/models/shared/newcustomerbalancetransactiontype.md +0 -9
- package/docs/models/shared/newcustomermetadata.md +0 -9
- package/docs/models/shared/newcustomerpaymentprovider.md +0 -14
- package/docs/models/shared/newplan.md +0 -14
- package/docs/models/shared/newplanmetadata.md +0 -7
- package/docs/models/shared/newplanprices.md +0 -7
- package/docs/models/shared/newreportingconfiguration.md +0 -8
- package/docs/models/shared/newsubscription.md +0 -31
- package/docs/models/shared/newsubscriptionexternalmarketplace.md +0 -10
- package/docs/models/shared/newsubscriptionmetadata.md +0 -7
- package/docs/models/shared/paginationmetadata.md +0 -9
- package/docs/models/shared/perpricecost.md +0 -12
- package/docs/models/shared/phaseoverride.md +0 -11
- package/docs/models/shared/pingresponse.md +0 -8
- package/docs/models/shared/plan.md +0 -33
- package/docs/models/shared/planmetadata.md +0 -7
- package/docs/models/shared/planminified.md +0 -10
- package/docs/models/shared/planphase.md +0 -18
- package/docs/models/shared/planphasedurationunit.md +0 -11
- package/docs/models/shared/plans.md +0 -9
- package/docs/models/shared/planstatus.md +0 -10
- package/docs/models/shared/pricegroup.md +0 -12
- package/docs/models/shared/priceinterval.md +0 -18
- package/docs/models/shared/priceintervalfixedfeequantitytransitionparams.md +0 -9
- package/docs/models/shared/prices.md +0 -9
- package/docs/models/shared/product.md +0 -10
- package/docs/models/shared/reportingconfiguration.md +0 -8
- package/docs/models/shared/security.md +0 -8
- package/docs/models/shared/subscription.md +0 -44
- package/docs/models/shared/subscriptioncosts.md +0 -8
- package/docs/models/shared/subscriptionmetadata.md +0 -9
- package/docs/models/shared/subscriptionminified.md +0 -8
- package/docs/models/shared/subscriptionplanchange.md +0 -23
- package/docs/models/shared/subscriptions.md +0 -9
- package/docs/models/shared/subscriptionscheduleitem.md +0 -10
- package/docs/models/shared/subscriptionscheduleitems.md +0 -9
- package/docs/models/shared/subscriptionstatus.md +0 -10
- package/docs/models/shared/subscriptiontrialinfo.md +0 -8
- package/docs/models/shared/taxamount.md +0 -10
- package/docs/models/shared/trialconfig.md +0 -9
- package/docs/models/shared/trialconfigtrialperiodunit.md +0 -8
- package/docs/models/shared/triggersubscriptionphaseparams.md +0 -8
- package/docs/models/shared/unschedulefixedfeequantitychangeparams.md +0 -8
- package/docs/models/shared/upcominginvoice.md +0 -46
- package/docs/models/shared/upcominginvoicemetadata.md +0 -7
- package/docs/models/shared/upcominginvoicestatus.md +0 -12
- package/docs/models/shared/updateevent.md +0 -12
- package/docs/models/shared/updateeventproperties.md +0 -9
- package/docs/models/shared/validationerror.md +0 -9
- package/docs/sdks/availability/README.md +0 -46
- package/docs/sdks/coupon/README.md +0 -235
- package/docs/sdks/credit/README.md +0 -565
- package/docs/sdks/creditnote/README.md +0 -94
- package/docs/sdks/customer/README.md +0 -1080
- package/docs/sdks/event/README.md +0 -674
- package/docs/sdks/invoice/README.md +0 -388
- package/docs/sdks/item/README.md +0 -92
- package/docs/sdks/metric/README.md +0 -136
- package/docs/sdks/orb/README.md +0 -21
- package/docs/sdks/plan/README.md +0 -298
- package/docs/sdks/price/README.md +0 -375
- package/docs/sdks/priceinterval/README.md +0 -137
- package/docs/sdks/subscription/README.md +0 -1306
- package/docs/types/rfcdate.md +0 -11
|
@@ -0,0 +1,1906 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless.
|
|
2
|
+
|
|
3
|
+
import * as Core from "../core";
|
|
4
|
+
import { APIResource } from "../resource";
|
|
5
|
+
import { isRequestOptions } from "../core";
|
|
6
|
+
import * as InvoicesAPI from "./invoices";
|
|
7
|
+
import * as PricesAPI from "./prices/prices";
|
|
8
|
+
import { Page, type PageParams } from "../pagination";
|
|
9
|
+
|
|
10
|
+
export class Invoices extends APIResource {
|
|
11
|
+
/**
|
|
12
|
+
* This endpoint is used to create a one-off invoice for a customer.
|
|
13
|
+
*/
|
|
14
|
+
create(body: InvoiceCreateParams, options?: Core.RequestOptions): Core.APIPromise<Invoice> {
|
|
15
|
+
return this.post('/invoices', { body, ...options });
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* This endpoint returns a list of all [`Invoice`](../guides/concepts#invoice)s for
|
|
20
|
+
* an account in a list format.
|
|
21
|
+
*
|
|
22
|
+
* The list of invoices is ordered starting from the most recently issued invoice
|
|
23
|
+
* date. The response also includes
|
|
24
|
+
* [`pagination_metadata`](../reference/pagination), which lets the caller retrieve
|
|
25
|
+
* the next page of results if they exist.
|
|
26
|
+
*
|
|
27
|
+
* By default, this only returns invoices that are `issued`, `paid`, or `synced`.
|
|
28
|
+
*/
|
|
29
|
+
list(query?: InvoiceListParams, options?: Core.RequestOptions): Core.PagePromise<InvoicesPage, Invoice>;
|
|
30
|
+
list(options?: Core.RequestOptions): Core.PagePromise<InvoicesPage, Invoice>;
|
|
31
|
+
list(
|
|
32
|
+
query: InvoiceListParams | Core.RequestOptions = {},
|
|
33
|
+
options?: Core.RequestOptions,
|
|
34
|
+
): Core.PagePromise<InvoicesPage, Invoice> {
|
|
35
|
+
if (isRequestOptions(query)) {
|
|
36
|
+
return this.list({}, query);
|
|
37
|
+
}
|
|
38
|
+
return this.getAPIList('/invoices', InvoicesPage, { query, ...options });
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* This endpoint is used to fetch an [`Invoice`](../guides/concepts#invoice) given
|
|
43
|
+
* an identifier.
|
|
44
|
+
*/
|
|
45
|
+
fetch(invoiceId: string, options?: Core.RequestOptions): Core.APIPromise<Invoice> {
|
|
46
|
+
return this.get(`/invoices/${invoiceId}`, options);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* This endpoint can be used to fetch the upcoming
|
|
51
|
+
* [invoice](../guides/concepts#invoice) for the current billing period given a
|
|
52
|
+
* subscription.
|
|
53
|
+
*/
|
|
54
|
+
fetchUpcoming(
|
|
55
|
+
query?: InvoiceFetchUpcomingParams,
|
|
56
|
+
options?: Core.RequestOptions,
|
|
57
|
+
): Core.APIPromise<InvoiceFetchUpcomingResponse>;
|
|
58
|
+
fetchUpcoming(options?: Core.RequestOptions): Core.APIPromise<InvoiceFetchUpcomingResponse>;
|
|
59
|
+
fetchUpcoming(
|
|
60
|
+
query: InvoiceFetchUpcomingParams | Core.RequestOptions = {},
|
|
61
|
+
options?: Core.RequestOptions,
|
|
62
|
+
): Core.APIPromise<InvoiceFetchUpcomingResponse> {
|
|
63
|
+
if (isRequestOptions(query)) {
|
|
64
|
+
return this.fetchUpcoming({}, query);
|
|
65
|
+
}
|
|
66
|
+
return this.get('/invoices/upcoming', { query, ...options });
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* This endpoint allows an eligible invoice to be issued manually. This is only
|
|
71
|
+
* possible with invoices where status is `draft`, `will_auto_issue` is true, and
|
|
72
|
+
* an `eligible_to_issue_at` is a time in the past. Issuing an invoice could
|
|
73
|
+
* possibly trigger side effects, some of which could be customer-visible (e.g.
|
|
74
|
+
* sending emails, auto-collecting payment, syncing the invoice to external
|
|
75
|
+
* providers, etc).
|
|
76
|
+
*/
|
|
77
|
+
issue(invoiceId: string, options?: Core.RequestOptions): Core.APIPromise<Invoice> {
|
|
78
|
+
return this.post(`/invoices/${invoiceId}/issue`, options);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* This endpoint allows an invoice's status to be set the `paid` status. This can
|
|
83
|
+
* only be done to invoices that are in the `issued` status.
|
|
84
|
+
*/
|
|
85
|
+
markPaid(
|
|
86
|
+
invoiceId: string,
|
|
87
|
+
body: InvoiceMarkPaidParams,
|
|
88
|
+
options?: Core.RequestOptions,
|
|
89
|
+
): Core.APIPromise<Invoice> {
|
|
90
|
+
return this.post(`/invoices/${invoiceId}/mark_paid`, { body, ...options });
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* This endpoint allows an invoice's status to be set the `void` status. This can
|
|
95
|
+
* only be done to invoices that are in the `issued` status.
|
|
96
|
+
*
|
|
97
|
+
* If the associated invoice has used the customer balance to change the amount
|
|
98
|
+
* due, the customer balance operation will be reverted. For example, if the
|
|
99
|
+
* invoice used $10 of customer balance, that amount will be added back to the
|
|
100
|
+
* customer balance upon voiding.
|
|
101
|
+
*/
|
|
102
|
+
void(invoiceId: string, options?: Core.RequestOptions): Core.APIPromise<Invoice> {
|
|
103
|
+
return this.post(`/invoices/${invoiceId}/void`, options);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export class InvoicesPage extends Page<Invoice> {}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* An [`Invoice`](../guides/concepts#invoice) is a fundamental billing entity,
|
|
111
|
+
* representing the request for payment for a single subscription. This includes a
|
|
112
|
+
* set of line items, which correspond to prices in the subscription's plan and can
|
|
113
|
+
* represent fixed recurring fees or usage-based fees. They are generated at the
|
|
114
|
+
* end of a billing period, or as the result of an action, such as a cancellation.
|
|
115
|
+
*/
|
|
116
|
+
export interface Invoice {
|
|
117
|
+
id: string;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* This is the final amount required to be charged to the customer and reflects the
|
|
121
|
+
* application of the customer balance to the `total` of the invoice.
|
|
122
|
+
*/
|
|
123
|
+
amount_due: string;
|
|
124
|
+
|
|
125
|
+
auto_collection: Invoice.AutoCollection;
|
|
126
|
+
|
|
127
|
+
billing_address: Invoice.BillingAddress | null;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* The creation time of the resource in Orb.
|
|
131
|
+
*/
|
|
132
|
+
created_at: string;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* A list of credit notes associated with the invoice
|
|
136
|
+
*/
|
|
137
|
+
credit_notes: Array<Invoice.CreditNote>;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* An ISO 4217 currency string or `credits`
|
|
141
|
+
*/
|
|
142
|
+
currency: string;
|
|
143
|
+
|
|
144
|
+
customer: Invoice.Customer;
|
|
145
|
+
|
|
146
|
+
customer_balance_transactions: Array<Invoice.CustomerBalanceTransaction>;
|
|
147
|
+
|
|
148
|
+
customer_tax_id: Invoice.CustomerTaxID | null;
|
|
149
|
+
|
|
150
|
+
discount: InvoiceDiscount | null;
|
|
151
|
+
|
|
152
|
+
discounts: Array<InvoiceDiscount>;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* When the invoice payment is due.
|
|
156
|
+
*/
|
|
157
|
+
due_date: string;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* If the invoice has a status of `draft`, this will be the time that the invoice
|
|
161
|
+
* will be eligible to be issued, otherwise it will be `null`. If `auto-issue` is
|
|
162
|
+
* true, the invoice will automatically begin issuing at this time.
|
|
163
|
+
*/
|
|
164
|
+
eligible_to_issue_at: string | null;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* A URL for the invoice portal.
|
|
168
|
+
*/
|
|
169
|
+
hosted_invoice_url: string | null;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* The scheduled date of the invoice
|
|
173
|
+
*/
|
|
174
|
+
invoice_date: string;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Automatically generated invoice number to help track and reconcile invoices.
|
|
178
|
+
* Invoice numbers have a prefix such as `RFOBWG`. These can be sequential per
|
|
179
|
+
* account or customer.
|
|
180
|
+
*/
|
|
181
|
+
invoice_number: string;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* The link to download the PDF representation of the `Invoice`.
|
|
185
|
+
*/
|
|
186
|
+
invoice_pdf: string | null;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* If the invoice failed to issue, this will be the last time it failed to issue
|
|
190
|
+
* (even if it is now in a different state.)
|
|
191
|
+
*/
|
|
192
|
+
issue_failed_at: string | null;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* If the invoice has been issued, this will be the time it transitioned to
|
|
196
|
+
* `issued` (even if it is now in a different state.)
|
|
197
|
+
*/
|
|
198
|
+
issued_at: string | null;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* The breakdown of prices in this invoice.
|
|
202
|
+
*/
|
|
203
|
+
line_items: Array<Invoice.LineItem>;
|
|
204
|
+
|
|
205
|
+
maximum: Invoice.Maximum | null;
|
|
206
|
+
|
|
207
|
+
maximum_amount: string | null;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Free-form text which is available on the invoice PDF and the Orb invoice portal.
|
|
211
|
+
*/
|
|
212
|
+
memo: string | null;
|
|
213
|
+
|
|
214
|
+
metadata: unknown;
|
|
215
|
+
|
|
216
|
+
minimum: Invoice.Minimum | null;
|
|
217
|
+
|
|
218
|
+
minimum_amount: string | null;
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* If the invoice has a status of `paid`, this gives a timestamp when the invoice
|
|
222
|
+
* was paid.
|
|
223
|
+
*/
|
|
224
|
+
paid_at: string | null;
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* If payment was attempted on this invoice but failed, this will be the time of
|
|
228
|
+
* the most recent attempt.
|
|
229
|
+
*/
|
|
230
|
+
payment_failed_at: string | null;
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* If payment was attempted on this invoice, this will be the start time of the
|
|
234
|
+
* most recent attempt. This field is especially useful for delayed-notification
|
|
235
|
+
* payment mechanisms (like bank transfers), where payment can take 3 days or more.
|
|
236
|
+
*/
|
|
237
|
+
payment_started_at: string | null;
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* If the invoice is in draft, this timestamp will reflect when the invoice is
|
|
241
|
+
* scheduled to be issued.
|
|
242
|
+
*/
|
|
243
|
+
scheduled_issue_at: string | null;
|
|
244
|
+
|
|
245
|
+
shipping_address: Invoice.ShippingAddress | null;
|
|
246
|
+
|
|
247
|
+
status: 'issued' | 'paid' | 'synced' | 'void' | 'draft';
|
|
248
|
+
|
|
249
|
+
subscription: Invoice.Subscription | null;
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* The total before any discounts and minimums are applied.
|
|
253
|
+
*/
|
|
254
|
+
subtotal: string;
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* If the invoice failed to sync, this will be the last time an external invoicing
|
|
258
|
+
* provider sync was attempted. This field will always be `null` for invoices using
|
|
259
|
+
* Orb Invoicing.
|
|
260
|
+
*/
|
|
261
|
+
sync_failed_at: string | null;
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* The total after any minimums and discounts have been applied.
|
|
265
|
+
*/
|
|
266
|
+
total: string;
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* If the invoice has a status of `void`, this gives a timestamp when the invoice
|
|
270
|
+
* was voided.
|
|
271
|
+
*/
|
|
272
|
+
voided_at: string | null;
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* This is true if the invoice will be automatically issued in the future, and
|
|
276
|
+
* false otherwise.
|
|
277
|
+
*/
|
|
278
|
+
will_auto_issue: boolean;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
export namespace Invoice {
|
|
282
|
+
export interface AutoCollection {
|
|
283
|
+
/**
|
|
284
|
+
* True only if auto-collection is enabled for this invoice.
|
|
285
|
+
*/
|
|
286
|
+
enabled: boolean | null;
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* If the invoice is scheduled for auto-collection, this field will reflect when
|
|
290
|
+
* the next attempt will occur. If dunning has been exhausted, or auto-collection
|
|
291
|
+
* is not enabled for this invoice, this field will be `null`.
|
|
292
|
+
*/
|
|
293
|
+
next_attempt_at: string | null;
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* If Orb has ever attempted payment auto-collection for this invoice, this field
|
|
297
|
+
* will reflect when that attempt occurred. In conjunction with `next_attempt_at`,
|
|
298
|
+
* this can be used to tell whether the invoice is currently in dunning (that is,
|
|
299
|
+
* `previously_attempted_at` is non-null, and `next_attempt_time` is non-null), or
|
|
300
|
+
* if dunning has been exhausted (`previously_attempted_at` is non-null, but
|
|
301
|
+
* `next_attempt_time` is null).
|
|
302
|
+
*/
|
|
303
|
+
previously_attempted_at: string | null;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
export interface BillingAddress {
|
|
307
|
+
city: string | null;
|
|
308
|
+
|
|
309
|
+
country: string | null;
|
|
310
|
+
|
|
311
|
+
line1: string | null;
|
|
312
|
+
|
|
313
|
+
line2: string | null;
|
|
314
|
+
|
|
315
|
+
postal_code: string | null;
|
|
316
|
+
|
|
317
|
+
state: string | null;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
export interface CreditNote {
|
|
321
|
+
id: string;
|
|
322
|
+
|
|
323
|
+
credit_note_number: string;
|
|
324
|
+
|
|
325
|
+
reason: string;
|
|
326
|
+
|
|
327
|
+
total: string;
|
|
328
|
+
|
|
329
|
+
type: string;
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* If the credit note has a status of `void`, this gives a timestamp when the
|
|
333
|
+
* credit note was voided.
|
|
334
|
+
*/
|
|
335
|
+
voided_at: string | null;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
export interface Customer {
|
|
339
|
+
id: string;
|
|
340
|
+
|
|
341
|
+
external_customer_id: string | null;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
export interface CustomerBalanceTransaction {
|
|
345
|
+
/**
|
|
346
|
+
* A unique id for this transaction.
|
|
347
|
+
*/
|
|
348
|
+
id: string;
|
|
349
|
+
|
|
350
|
+
action: 'applied_to_invoice' | 'prorated_refund' | 'manual_adjustment';
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* The value of the amount changed in the transaction.
|
|
354
|
+
*/
|
|
355
|
+
amount: string;
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* The creation time of this transaction.
|
|
359
|
+
*/
|
|
360
|
+
created_at: string;
|
|
361
|
+
|
|
362
|
+
credit_note: CustomerBalanceTransaction.CreditNote | null;
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* An optional description provided for manual customer balance adjustments.
|
|
366
|
+
*/
|
|
367
|
+
description: string | null;
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* The new value of the customer's balance prior to the transaction, in the
|
|
371
|
+
* customer's currency.
|
|
372
|
+
*/
|
|
373
|
+
ending_balance: string;
|
|
374
|
+
|
|
375
|
+
invoice: CustomerBalanceTransaction.Invoice | null;
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* The original value of the customer's balance prior to the transaction, in the
|
|
379
|
+
* customer's currency.
|
|
380
|
+
*/
|
|
381
|
+
starting_balance: string;
|
|
382
|
+
|
|
383
|
+
type: 'increment' | 'decrement';
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
export namespace CustomerBalanceTransaction {
|
|
387
|
+
export interface CreditNote {
|
|
388
|
+
/**
|
|
389
|
+
* The id of the Credit note
|
|
390
|
+
*/
|
|
391
|
+
id: string;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
export interface Invoice {
|
|
395
|
+
/**
|
|
396
|
+
* The Invoice id
|
|
397
|
+
*/
|
|
398
|
+
id: string;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
export interface CustomerTaxID {
|
|
403
|
+
country: string;
|
|
404
|
+
|
|
405
|
+
type: string;
|
|
406
|
+
|
|
407
|
+
value: string;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
export interface LineItem {
|
|
411
|
+
/**
|
|
412
|
+
* A unique ID for this line item.
|
|
413
|
+
*/
|
|
414
|
+
id: string;
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* The final amount after any discounts or minimums.
|
|
418
|
+
*/
|
|
419
|
+
amount: string;
|
|
420
|
+
|
|
421
|
+
discount: InvoicesAPI.InvoiceDiscount | null;
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* The end date of the range of time applied for this line item's price.
|
|
425
|
+
*/
|
|
426
|
+
end_date: string;
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* [DEPRECATED] For configured prices that are split by a grouping key, this will
|
|
430
|
+
* be populated with the key and a value. The `amount` and `subtotal` will be the
|
|
431
|
+
* values for this particular grouping.
|
|
432
|
+
*/
|
|
433
|
+
grouping: string | null;
|
|
434
|
+
|
|
435
|
+
maximum: LineItem.Maximum | null;
|
|
436
|
+
|
|
437
|
+
maximum_amount: string | null;
|
|
438
|
+
|
|
439
|
+
minimum: LineItem.Minimum | null;
|
|
440
|
+
|
|
441
|
+
minimum_amount: string | null;
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* The name of the price associated with this line item.
|
|
445
|
+
*/
|
|
446
|
+
name: string;
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* The Price resource represents a price that can be billed on a subscription,
|
|
450
|
+
* resulting in a charge on an invoice in the form of an invoice line item. Prices
|
|
451
|
+
* take a quantity and determine an amount to bill.
|
|
452
|
+
*
|
|
453
|
+
* Orb supports a few different pricing models out of the box. Each of these models
|
|
454
|
+
* is serialized differently in a given Price object. The model_type field
|
|
455
|
+
* determines the key for the configuration object that is present.
|
|
456
|
+
*
|
|
457
|
+
* ## Unit pricing
|
|
458
|
+
*
|
|
459
|
+
* With unit pricing, each unit costs a fixed amount.
|
|
460
|
+
*
|
|
461
|
+
* ```json
|
|
462
|
+
* {
|
|
463
|
+
* ...
|
|
464
|
+
* "model_type": "unit",
|
|
465
|
+
* "unit_config": {
|
|
466
|
+
* "unit_amount": "0.50"
|
|
467
|
+
* }
|
|
468
|
+
* ...
|
|
469
|
+
* }
|
|
470
|
+
* ```
|
|
471
|
+
*
|
|
472
|
+
* ## Tiered pricing
|
|
473
|
+
*
|
|
474
|
+
* In tiered pricing, the cost of a given unit depends on the tier range that it
|
|
475
|
+
* falls into, where each tier range is defined by an upper and lower bound. For
|
|
476
|
+
* example, the first ten units may cost $0.50 each and all units thereafter may
|
|
477
|
+
* cost $0.10 each.
|
|
478
|
+
*
|
|
479
|
+
* ```json
|
|
480
|
+
* {
|
|
481
|
+
* ...
|
|
482
|
+
* "model_type": "tiered",
|
|
483
|
+
* "tiered_config": {
|
|
484
|
+
* "tiers": [
|
|
485
|
+
* {
|
|
486
|
+
* "first_unit": 1,
|
|
487
|
+
* "last_unit": 10,
|
|
488
|
+
* "unit_amount": "0.50"
|
|
489
|
+
* },
|
|
490
|
+
* {
|
|
491
|
+
* "first_unit": 11,
|
|
492
|
+
* "last_unit": null,
|
|
493
|
+
* "unit_amount": "0.10"
|
|
494
|
+
* }
|
|
495
|
+
* ]
|
|
496
|
+
* }
|
|
497
|
+
* ...
|
|
498
|
+
* ```
|
|
499
|
+
*
|
|
500
|
+
* ## Bulk pricing
|
|
501
|
+
*
|
|
502
|
+
* Bulk pricing applies when the number of units determine the cost of all units.
|
|
503
|
+
* For example, if you've bought less than 10 units, they may each be $0.50 for a
|
|
504
|
+
* total of $5.00. Once you've bought more than 10 units, all units may now be
|
|
505
|
+
* priced at $0.40 (i.e. 101 units total would be $40.40).
|
|
506
|
+
*
|
|
507
|
+
* ```json
|
|
508
|
+
* {
|
|
509
|
+
* ...
|
|
510
|
+
* "model_type": "bulk",
|
|
511
|
+
* "bulk_config": {
|
|
512
|
+
* "tiers": [
|
|
513
|
+
* {
|
|
514
|
+
* "maximum_units": 10,
|
|
515
|
+
* "unit_amount": "0.50"
|
|
516
|
+
* },
|
|
517
|
+
* {
|
|
518
|
+
* "maximum_units": 1000,
|
|
519
|
+
* "unit_amount": "0.40"
|
|
520
|
+
* }
|
|
521
|
+
* ]
|
|
522
|
+
* }
|
|
523
|
+
* ...
|
|
524
|
+
* }
|
|
525
|
+
* ```
|
|
526
|
+
*
|
|
527
|
+
* ## Package pricing
|
|
528
|
+
*
|
|
529
|
+
* Package pricing defines the size or granularity of a unit for billing purposes.
|
|
530
|
+
* For example, if the package size is set to 5, then 4 units will be billed as 5
|
|
531
|
+
* and 6 units will be billed at 10.
|
|
532
|
+
*
|
|
533
|
+
* ```json
|
|
534
|
+
* {
|
|
535
|
+
* ...
|
|
536
|
+
* "model_type": "package",
|
|
537
|
+
* "package_config": {
|
|
538
|
+
* "package_amount": "0.80",
|
|
539
|
+
* "package_size": 10
|
|
540
|
+
* }
|
|
541
|
+
* ...
|
|
542
|
+
* }
|
|
543
|
+
* ```
|
|
544
|
+
*
|
|
545
|
+
* ## BPS pricing
|
|
546
|
+
*
|
|
547
|
+
* BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
|
|
548
|
+
* percent (the number of basis points to charge), as well as a cap per event to
|
|
549
|
+
* assess. For example, this would allow you to assess a fee of 0.25% on every
|
|
550
|
+
* payment you process, with a maximum charge of $25 per payment.
|
|
551
|
+
*
|
|
552
|
+
* ```json
|
|
553
|
+
* {
|
|
554
|
+
* ...
|
|
555
|
+
* "model_type": "bps",
|
|
556
|
+
* "bps_config": {
|
|
557
|
+
* "bps": 125,
|
|
558
|
+
* "per_unit_maximum": "11.00"
|
|
559
|
+
* }
|
|
560
|
+
* ...
|
|
561
|
+
* }
|
|
562
|
+
* ```
|
|
563
|
+
*
|
|
564
|
+
* ## Bulk BPS pricing
|
|
565
|
+
*
|
|
566
|
+
* Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
|
|
567
|
+
* total quantity across all events. Similar to bulk pricing, the BPS parameters of
|
|
568
|
+
* a given event depends on the tier range that the billing period falls into. Each
|
|
569
|
+
* tier range is defined by an upper bound. For example, after $1.5M of payment
|
|
570
|
+
* volume is reached, each individual payment may have a lower cap or a smaller
|
|
571
|
+
* take-rate.
|
|
572
|
+
*
|
|
573
|
+
* ```json
|
|
574
|
+
* ...
|
|
575
|
+
* "model_type": "bulk_bps",
|
|
576
|
+
* "bulk_bps_config": {
|
|
577
|
+
* "tiers": [
|
|
578
|
+
* {
|
|
579
|
+
* "maximum_amount": "1000000.00",
|
|
580
|
+
* "bps": 125,
|
|
581
|
+
* "per_unit_maximum": "19.00"
|
|
582
|
+
* },
|
|
583
|
+
* {
|
|
584
|
+
* "maximum_amount": null,
|
|
585
|
+
* "bps": 115,
|
|
586
|
+
* "per_unit_maximum": "4.00"
|
|
587
|
+
* }
|
|
588
|
+
* ]
|
|
589
|
+
* }
|
|
590
|
+
* ...
|
|
591
|
+
* }
|
|
592
|
+
* ```
|
|
593
|
+
*
|
|
594
|
+
* ## Tiered BPS pricing
|
|
595
|
+
*
|
|
596
|
+
* Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
|
|
597
|
+
* event's applicable parameter is a function of its marginal addition to the
|
|
598
|
+
* period total. Similar to tiered pricing, the BPS parameters of a given event
|
|
599
|
+
* depends on the tier range that it falls into, where each tier range is defined
|
|
600
|
+
* by an upper and lower bound. For example, the first few payments may have a 0.8
|
|
601
|
+
* BPS take-rate and all payments after a specific volume may incur a take-rate of
|
|
602
|
+
* 0.5 BPS each.
|
|
603
|
+
*
|
|
604
|
+
* ```json
|
|
605
|
+
* ...
|
|
606
|
+
* "model_type": "tiered_bps",
|
|
607
|
+
* "tiered_bps_config": {
|
|
608
|
+
* "tiers": [
|
|
609
|
+
* {
|
|
610
|
+
* "minimum_amount": "0",
|
|
611
|
+
* "maximum_amount": "1000000.00",
|
|
612
|
+
* "bps": 125,
|
|
613
|
+
* "per_unit_maximum": "19.00"
|
|
614
|
+
* },
|
|
615
|
+
* {
|
|
616
|
+
* "minimum_amount": "1000000.00",
|
|
617
|
+
* "maximum_amount": null,
|
|
618
|
+
* "bps": 115,
|
|
619
|
+
* "per_unit_maximum": "4.00"
|
|
620
|
+
* }
|
|
621
|
+
* ]
|
|
622
|
+
* }
|
|
623
|
+
* ...
|
|
624
|
+
* }
|
|
625
|
+
* ```
|
|
626
|
+
*
|
|
627
|
+
* ## Matrix pricing
|
|
628
|
+
*
|
|
629
|
+
* Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
|
|
630
|
+
* `dimensions` defines the two event property values evaluated in this pricing
|
|
631
|
+
* model. In a one-dimensional matrix, the second value is `null`. Every
|
|
632
|
+
* configuration has a list of `matrix_values` which give the unit prices for
|
|
633
|
+
* specified property values. In a one-dimensional matrix, the matrix values will
|
|
634
|
+
* have `dimension_values` where the second value of the pair is null. If an event
|
|
635
|
+
* does not match any of the dimension values in the matrix, it will resort to the
|
|
636
|
+
* `default_unit_amount`.
|
|
637
|
+
*
|
|
638
|
+
* ```json
|
|
639
|
+
* {
|
|
640
|
+
* "model_type": "matrix"
|
|
641
|
+
* "matrix_config": {
|
|
642
|
+
* "default_unit_amount": "3.00",
|
|
643
|
+
* "dimensions": [
|
|
644
|
+
* "cluster_name",
|
|
645
|
+
* "region"
|
|
646
|
+
* ],
|
|
647
|
+
* "matrix_values": [
|
|
648
|
+
* {
|
|
649
|
+
* "dimension_values": [
|
|
650
|
+
* "alpha",
|
|
651
|
+
* "west"
|
|
652
|
+
* ],
|
|
653
|
+
* "unit_amount": "2.00"
|
|
654
|
+
* },
|
|
655
|
+
* ...
|
|
656
|
+
* ]
|
|
657
|
+
* }
|
|
658
|
+
* }
|
|
659
|
+
* ```
|
|
660
|
+
*
|
|
661
|
+
* ### Fixed fees
|
|
662
|
+
*
|
|
663
|
+
* Fixed fees are prices that are applied independent of usage quantities, and
|
|
664
|
+
* follow unit pricing. They also have an additional parameter
|
|
665
|
+
* `fixed_price_quantity`. If the Price represents a fixed cost, this represents
|
|
666
|
+
* the quantity of units applied.
|
|
667
|
+
*
|
|
668
|
+
* ```json
|
|
669
|
+
* {
|
|
670
|
+
* ...
|
|
671
|
+
* "id": "price_id",
|
|
672
|
+
* "model_type": "unit",
|
|
673
|
+
* "unit_config": {
|
|
674
|
+
* "unit_amount": "2.00"
|
|
675
|
+
* },
|
|
676
|
+
* "fixed_price_quantity": 3.0
|
|
677
|
+
* ...
|
|
678
|
+
* }
|
|
679
|
+
* ```
|
|
680
|
+
*/
|
|
681
|
+
price: PricesAPI.Price | null;
|
|
682
|
+
|
|
683
|
+
quantity: number;
|
|
684
|
+
|
|
685
|
+
/**
|
|
686
|
+
* The start date of the range of time applied for this line item's price.
|
|
687
|
+
*/
|
|
688
|
+
start_date: string;
|
|
689
|
+
|
|
690
|
+
/**
|
|
691
|
+
* For complex pricing structures, the line item can be broken down further in
|
|
692
|
+
* `sub_line_items`.
|
|
693
|
+
*/
|
|
694
|
+
sub_line_items: Array<LineItem.MatrixSubLineItem | LineItem.TierSubLineItem | LineItem.OtherSubLineItem>;
|
|
695
|
+
|
|
696
|
+
/**
|
|
697
|
+
* The line amount before any line item-specific discounts or minimums.
|
|
698
|
+
*/
|
|
699
|
+
subtotal: string;
|
|
700
|
+
|
|
701
|
+
/**
|
|
702
|
+
* An array of tax rates and their incurred tax amounts. Empty if no tax
|
|
703
|
+
* integration is configured.
|
|
704
|
+
*/
|
|
705
|
+
tax_amounts: Array<LineItem.TaxAmount>;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
export namespace LineItem {
|
|
709
|
+
export interface Maximum {
|
|
710
|
+
/**
|
|
711
|
+
* List of price_ids that this maximum amount applies to. For plan/plan phase
|
|
712
|
+
* maximums, this can be a subset of prices.
|
|
713
|
+
*/
|
|
714
|
+
applies_to_price_ids: Array<string>;
|
|
715
|
+
|
|
716
|
+
/**
|
|
717
|
+
* Maximum amount applied
|
|
718
|
+
*/
|
|
719
|
+
maximum_amount: string;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
export interface Minimum {
|
|
723
|
+
/**
|
|
724
|
+
* List of price_ids that this minimum amount applies to. For plan/plan phase
|
|
725
|
+
* minimums, this can be a subset of prices.
|
|
726
|
+
*/
|
|
727
|
+
applies_to_price_ids: Array<string>;
|
|
728
|
+
|
|
729
|
+
/**
|
|
730
|
+
* Minimum amount applied
|
|
731
|
+
*/
|
|
732
|
+
minimum_amount: string;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
export interface MatrixSubLineItem {
|
|
736
|
+
/**
|
|
737
|
+
* The total amount for this sub line item.
|
|
738
|
+
*/
|
|
739
|
+
amount: string;
|
|
740
|
+
|
|
741
|
+
grouping: MatrixSubLineItem.Grouping | null;
|
|
742
|
+
|
|
743
|
+
matrix_config: MatrixSubLineItem.MatrixConfig;
|
|
744
|
+
|
|
745
|
+
name: string;
|
|
746
|
+
|
|
747
|
+
quantity: number;
|
|
748
|
+
|
|
749
|
+
type: 'matrix';
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
export namespace MatrixSubLineItem {
|
|
753
|
+
export interface Grouping {
|
|
754
|
+
key: string;
|
|
755
|
+
|
|
756
|
+
/**
|
|
757
|
+
* No value indicates the default group
|
|
758
|
+
*/
|
|
759
|
+
value: string | null;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
export interface MatrixConfig {
|
|
763
|
+
/**
|
|
764
|
+
* The ordered dimension values for this line item.
|
|
765
|
+
*/
|
|
766
|
+
dimension_values: Array<string | null>;
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
export interface TierSubLineItem {
|
|
771
|
+
/**
|
|
772
|
+
* The total amount for this sub line item.
|
|
773
|
+
*/
|
|
774
|
+
amount: string;
|
|
775
|
+
|
|
776
|
+
grouping: TierSubLineItem.Grouping | null;
|
|
777
|
+
|
|
778
|
+
name: string;
|
|
779
|
+
|
|
780
|
+
quantity: number;
|
|
781
|
+
|
|
782
|
+
tier_config: TierSubLineItem.TierConfig;
|
|
783
|
+
|
|
784
|
+
type: 'tier';
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
export namespace TierSubLineItem {
|
|
788
|
+
export interface Grouping {
|
|
789
|
+
key: string;
|
|
790
|
+
|
|
791
|
+
/**
|
|
792
|
+
* No value indicates the default group
|
|
793
|
+
*/
|
|
794
|
+
value: string | null;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
export interface TierConfig {
|
|
798
|
+
first_unit: number;
|
|
799
|
+
|
|
800
|
+
last_unit: number | null;
|
|
801
|
+
|
|
802
|
+
unit_amount: string;
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
export interface OtherSubLineItem {
|
|
807
|
+
/**
|
|
808
|
+
* The total amount for this sub line item.
|
|
809
|
+
*/
|
|
810
|
+
amount: string;
|
|
811
|
+
|
|
812
|
+
grouping: OtherSubLineItem.Grouping | null;
|
|
813
|
+
|
|
814
|
+
name: string;
|
|
815
|
+
|
|
816
|
+
quantity: number;
|
|
817
|
+
|
|
818
|
+
type: "'null'";
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
export namespace OtherSubLineItem {
|
|
822
|
+
export interface Grouping {
|
|
823
|
+
key: string;
|
|
824
|
+
|
|
825
|
+
/**
|
|
826
|
+
* No value indicates the default group
|
|
827
|
+
*/
|
|
828
|
+
value: string | null;
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
export interface TaxAmount {
|
|
833
|
+
/**
|
|
834
|
+
* The amount of additional tax incurred by this tax rate.
|
|
835
|
+
*/
|
|
836
|
+
amount: string;
|
|
837
|
+
|
|
838
|
+
/**
|
|
839
|
+
* The human-readable description of the applied tax rate.
|
|
840
|
+
*/
|
|
841
|
+
tax_rate_description: string;
|
|
842
|
+
|
|
843
|
+
/**
|
|
844
|
+
* The tax rate percentage, out of 100.
|
|
845
|
+
*/
|
|
846
|
+
tax_rate_percentage: string | null;
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
export interface Maximum {
|
|
851
|
+
/**
|
|
852
|
+
* List of price_ids that this maximum amount applies to. For plan/plan phase
|
|
853
|
+
* maximums, this can be a subset of prices.
|
|
854
|
+
*/
|
|
855
|
+
applies_to_price_ids: Array<string>;
|
|
856
|
+
|
|
857
|
+
/**
|
|
858
|
+
* Maximum amount applied
|
|
859
|
+
*/
|
|
860
|
+
maximum_amount: string;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
export interface Minimum {
|
|
864
|
+
/**
|
|
865
|
+
* List of price_ids that this minimum amount applies to. For plan/plan phase
|
|
866
|
+
* minimums, this can be a subset of prices.
|
|
867
|
+
*/
|
|
868
|
+
applies_to_price_ids: Array<string>;
|
|
869
|
+
|
|
870
|
+
/**
|
|
871
|
+
* Minimum amount applied
|
|
872
|
+
*/
|
|
873
|
+
minimum_amount: string;
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
export interface ShippingAddress {
|
|
877
|
+
city: string | null;
|
|
878
|
+
|
|
879
|
+
country: string | null;
|
|
880
|
+
|
|
881
|
+
line1: string | null;
|
|
882
|
+
|
|
883
|
+
line2: string | null;
|
|
884
|
+
|
|
885
|
+
postal_code: string | null;
|
|
886
|
+
|
|
887
|
+
state: string | null;
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
export interface Subscription {
|
|
891
|
+
id: string;
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
export type InvoiceDiscount =
|
|
896
|
+
| InvoiceDiscount.PercentageDiscount
|
|
897
|
+
| InvoiceDiscount.TrialDiscount
|
|
898
|
+
| InvoiceDiscount.UsageDiscount
|
|
899
|
+
| InvoiceDiscount.AmountDiscount;
|
|
900
|
+
|
|
901
|
+
export namespace InvoiceDiscount {
|
|
902
|
+
export interface PercentageDiscount {
|
|
903
|
+
/**
|
|
904
|
+
* List of price_ids that this discount applies to. For plan/plan phase discounts,
|
|
905
|
+
* this can be a subset of prices.
|
|
906
|
+
*/
|
|
907
|
+
applies_to_price_ids: Array<string>;
|
|
908
|
+
|
|
909
|
+
discount_type: 'percentage';
|
|
910
|
+
|
|
911
|
+
/**
|
|
912
|
+
* Only available if discount_type is `percentage`.This is a number between 0
|
|
913
|
+
* and 1.
|
|
914
|
+
*/
|
|
915
|
+
percentage_discount: number;
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
export interface TrialDiscount {
|
|
919
|
+
/**
|
|
920
|
+
* List of price_ids that this discount applies to. For plan/plan phase discounts,
|
|
921
|
+
* this can be a subset of prices.
|
|
922
|
+
*/
|
|
923
|
+
applies_to_price_ids: Array<string>;
|
|
924
|
+
|
|
925
|
+
discount_type: 'trial';
|
|
926
|
+
|
|
927
|
+
/**
|
|
928
|
+
* Only available if discount_type is `trial`
|
|
929
|
+
*/
|
|
930
|
+
trial_amount_discount?: string | null;
|
|
931
|
+
|
|
932
|
+
/**
|
|
933
|
+
* Only available if discount_type is `trial`
|
|
934
|
+
*/
|
|
935
|
+
trial_percentage_discount?: number | null;
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
export interface UsageDiscount {
|
|
939
|
+
/**
|
|
940
|
+
* List of price_ids that this discount applies to. For plan/plan phase discounts,
|
|
941
|
+
* this can be a subset of prices.
|
|
942
|
+
*/
|
|
943
|
+
applies_to_price_ids: Array<string>;
|
|
944
|
+
|
|
945
|
+
discount_type: 'usage';
|
|
946
|
+
|
|
947
|
+
/**
|
|
948
|
+
* Only available if discount_type is `usage`. Number of usage units that this
|
|
949
|
+
* discount is for
|
|
950
|
+
*/
|
|
951
|
+
usage_discount: number;
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
export interface AmountDiscount {
|
|
955
|
+
/**
|
|
956
|
+
* Only available if discount_type is `amount`.
|
|
957
|
+
*/
|
|
958
|
+
amount_discount: string;
|
|
959
|
+
|
|
960
|
+
/**
|
|
961
|
+
* List of price_ids that this discount applies to. For plan/plan phase discounts,
|
|
962
|
+
* this can be a subset of prices.
|
|
963
|
+
*/
|
|
964
|
+
applies_to_price_ids: Array<string>;
|
|
965
|
+
|
|
966
|
+
discount_type: 'amount';
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
export interface InvoiceFetchUpcomingResponse {
|
|
971
|
+
id: string;
|
|
972
|
+
|
|
973
|
+
/**
|
|
974
|
+
* This is the final amount required to be charged to the customer and reflects the
|
|
975
|
+
* application of the customer balance to the `total` of the invoice.
|
|
976
|
+
*/
|
|
977
|
+
amount_due: string;
|
|
978
|
+
|
|
979
|
+
auto_collection: InvoiceFetchUpcomingResponse.AutoCollection;
|
|
980
|
+
|
|
981
|
+
billing_address: InvoiceFetchUpcomingResponse.BillingAddress | null;
|
|
982
|
+
|
|
983
|
+
/**
|
|
984
|
+
* The creation time of the resource in Orb.
|
|
985
|
+
*/
|
|
986
|
+
created_at: string;
|
|
987
|
+
|
|
988
|
+
/**
|
|
989
|
+
* A list of credit notes associated with the invoice
|
|
990
|
+
*/
|
|
991
|
+
credit_notes: Array<InvoiceFetchUpcomingResponse.CreditNote>;
|
|
992
|
+
|
|
993
|
+
/**
|
|
994
|
+
* An ISO 4217 currency string or `credits`
|
|
995
|
+
*/
|
|
996
|
+
currency: string;
|
|
997
|
+
|
|
998
|
+
customer: InvoiceFetchUpcomingResponse.Customer;
|
|
999
|
+
|
|
1000
|
+
customer_balance_transactions: Array<InvoiceFetchUpcomingResponse.CustomerBalanceTransaction>;
|
|
1001
|
+
|
|
1002
|
+
customer_tax_id: InvoiceFetchUpcomingResponse.CustomerTaxID | null;
|
|
1003
|
+
|
|
1004
|
+
discount: InvoiceDiscount | null;
|
|
1005
|
+
|
|
1006
|
+
discounts: Array<InvoiceDiscount>;
|
|
1007
|
+
|
|
1008
|
+
/**
|
|
1009
|
+
* When the invoice payment is due.
|
|
1010
|
+
*/
|
|
1011
|
+
due_date: string;
|
|
1012
|
+
|
|
1013
|
+
/**
|
|
1014
|
+
* If the invoice has a status of `draft`, this will be the time that the invoice
|
|
1015
|
+
* will be eligible to be issued, otherwise it will be `null`. If `auto-issue` is
|
|
1016
|
+
* true, the invoice will automatically begin issuing at this time.
|
|
1017
|
+
*/
|
|
1018
|
+
eligible_to_issue_at: string | null;
|
|
1019
|
+
|
|
1020
|
+
/**
|
|
1021
|
+
* A URL for the invoice portal.
|
|
1022
|
+
*/
|
|
1023
|
+
hosted_invoice_url: string | null;
|
|
1024
|
+
|
|
1025
|
+
/**
|
|
1026
|
+
* Automatically generated invoice number to help track and reconcile invoices.
|
|
1027
|
+
* Invoice numbers have a prefix such as `RFOBWG`. These can be sequential per
|
|
1028
|
+
* account or customer.
|
|
1029
|
+
*/
|
|
1030
|
+
invoice_number: string;
|
|
1031
|
+
|
|
1032
|
+
/**
|
|
1033
|
+
* The link to download the PDF representation of the `Invoice`.
|
|
1034
|
+
*/
|
|
1035
|
+
invoice_pdf: string | null;
|
|
1036
|
+
|
|
1037
|
+
/**
|
|
1038
|
+
* If the invoice failed to issue, this will be the last time it failed to issue
|
|
1039
|
+
* (even if it is now in a different state.)
|
|
1040
|
+
*/
|
|
1041
|
+
issue_failed_at: string | null;
|
|
1042
|
+
|
|
1043
|
+
/**
|
|
1044
|
+
* If the invoice has been issued, this will be the time it transitioned to
|
|
1045
|
+
* `issued` (even if it is now in a different state.)
|
|
1046
|
+
*/
|
|
1047
|
+
issued_at: string | null;
|
|
1048
|
+
|
|
1049
|
+
/**
|
|
1050
|
+
* The breakdown of prices in this invoice.
|
|
1051
|
+
*/
|
|
1052
|
+
line_items: Array<InvoiceFetchUpcomingResponse.LineItem>;
|
|
1053
|
+
|
|
1054
|
+
maximum: InvoiceFetchUpcomingResponse.Maximum | null;
|
|
1055
|
+
|
|
1056
|
+
maximum_amount: string | null;
|
|
1057
|
+
|
|
1058
|
+
/**
|
|
1059
|
+
* Free-form text which is available on the invoice PDF and the Orb invoice portal.
|
|
1060
|
+
*/
|
|
1061
|
+
memo: string | null;
|
|
1062
|
+
|
|
1063
|
+
metadata: unknown;
|
|
1064
|
+
|
|
1065
|
+
minimum: InvoiceFetchUpcomingResponse.Minimum | null;
|
|
1066
|
+
|
|
1067
|
+
minimum_amount: string | null;
|
|
1068
|
+
|
|
1069
|
+
/**
|
|
1070
|
+
* If the invoice has a status of `paid`, this gives a timestamp when the invoice
|
|
1071
|
+
* was paid.
|
|
1072
|
+
*/
|
|
1073
|
+
paid_at: string | null;
|
|
1074
|
+
|
|
1075
|
+
/**
|
|
1076
|
+
* If payment was attempted on this invoice but failed, this will be the time of
|
|
1077
|
+
* the most recent attempt.
|
|
1078
|
+
*/
|
|
1079
|
+
payment_failed_at: string | null;
|
|
1080
|
+
|
|
1081
|
+
/**
|
|
1082
|
+
* If payment was attempted on this invoice, this will be the start time of the
|
|
1083
|
+
* most recent attempt. This field is especially useful for delayed-notification
|
|
1084
|
+
* payment mechanisms (like bank transfers), where payment can take 3 days or more.
|
|
1085
|
+
*/
|
|
1086
|
+
payment_started_at: string | null;
|
|
1087
|
+
|
|
1088
|
+
/**
|
|
1089
|
+
* If the invoice is in draft, this timestamp will reflect when the invoice is
|
|
1090
|
+
* scheduled to be issued.
|
|
1091
|
+
*/
|
|
1092
|
+
scheduled_issue_at: string | null;
|
|
1093
|
+
|
|
1094
|
+
shipping_address: InvoiceFetchUpcomingResponse.ShippingAddress | null;
|
|
1095
|
+
|
|
1096
|
+
status: 'issued' | 'paid' | 'synced' | 'void' | 'draft';
|
|
1097
|
+
|
|
1098
|
+
subscription: InvoiceFetchUpcomingResponse.Subscription | null;
|
|
1099
|
+
|
|
1100
|
+
/**
|
|
1101
|
+
* The total before any discounts and minimums are applied.
|
|
1102
|
+
*/
|
|
1103
|
+
subtotal: string;
|
|
1104
|
+
|
|
1105
|
+
/**
|
|
1106
|
+
* If the invoice failed to sync, this will be the last time an external invoicing
|
|
1107
|
+
* provider sync was attempted. This field will always be `null` for invoices using
|
|
1108
|
+
* Orb Invoicing.
|
|
1109
|
+
*/
|
|
1110
|
+
sync_failed_at: string | null;
|
|
1111
|
+
|
|
1112
|
+
/**
|
|
1113
|
+
* The scheduled date of the invoice
|
|
1114
|
+
*/
|
|
1115
|
+
target_date: string;
|
|
1116
|
+
|
|
1117
|
+
/**
|
|
1118
|
+
* The total after any minimums and discounts have been applied.
|
|
1119
|
+
*/
|
|
1120
|
+
total: string;
|
|
1121
|
+
|
|
1122
|
+
/**
|
|
1123
|
+
* If the invoice has a status of `void`, this gives a timestamp when the invoice
|
|
1124
|
+
* was voided.
|
|
1125
|
+
*/
|
|
1126
|
+
voided_at: string | null;
|
|
1127
|
+
|
|
1128
|
+
/**
|
|
1129
|
+
* This is true if the invoice will be automatically issued in the future, and
|
|
1130
|
+
* false otherwise.
|
|
1131
|
+
*/
|
|
1132
|
+
will_auto_issue: boolean;
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
export namespace InvoiceFetchUpcomingResponse {
|
|
1136
|
+
export interface AutoCollection {
|
|
1137
|
+
/**
|
|
1138
|
+
* True only if auto-collection is enabled for this invoice.
|
|
1139
|
+
*/
|
|
1140
|
+
enabled: boolean | null;
|
|
1141
|
+
|
|
1142
|
+
/**
|
|
1143
|
+
* If the invoice is scheduled for auto-collection, this field will reflect when
|
|
1144
|
+
* the next attempt will occur. If dunning has been exhausted, or auto-collection
|
|
1145
|
+
* is not enabled for this invoice, this field will be `null`.
|
|
1146
|
+
*/
|
|
1147
|
+
next_attempt_at: string | null;
|
|
1148
|
+
|
|
1149
|
+
/**
|
|
1150
|
+
* If Orb has ever attempted payment auto-collection for this invoice, this field
|
|
1151
|
+
* will reflect when that attempt occurred. In conjunction with `next_attempt_at`,
|
|
1152
|
+
* this can be used to tell whether the invoice is currently in dunning (that is,
|
|
1153
|
+
* `previously_attempted_at` is non-null, and `next_attempt_time` is non-null), or
|
|
1154
|
+
* if dunning has been exhausted (`previously_attempted_at` is non-null, but
|
|
1155
|
+
* `next_attempt_time` is null).
|
|
1156
|
+
*/
|
|
1157
|
+
previously_attempted_at: string | null;
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
export interface BillingAddress {
|
|
1161
|
+
city: string | null;
|
|
1162
|
+
|
|
1163
|
+
country: string | null;
|
|
1164
|
+
|
|
1165
|
+
line1: string | null;
|
|
1166
|
+
|
|
1167
|
+
line2: string | null;
|
|
1168
|
+
|
|
1169
|
+
postal_code: string | null;
|
|
1170
|
+
|
|
1171
|
+
state: string | null;
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
export interface CreditNote {
|
|
1175
|
+
id: string;
|
|
1176
|
+
|
|
1177
|
+
credit_note_number: string;
|
|
1178
|
+
|
|
1179
|
+
reason: string;
|
|
1180
|
+
|
|
1181
|
+
total: string;
|
|
1182
|
+
|
|
1183
|
+
type: string;
|
|
1184
|
+
|
|
1185
|
+
/**
|
|
1186
|
+
* If the credit note has a status of `void`, this gives a timestamp when the
|
|
1187
|
+
* credit note was voided.
|
|
1188
|
+
*/
|
|
1189
|
+
voided_at: string | null;
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
export interface Customer {
|
|
1193
|
+
id: string;
|
|
1194
|
+
|
|
1195
|
+
external_customer_id: string | null;
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
export interface CustomerBalanceTransaction {
|
|
1199
|
+
/**
|
|
1200
|
+
* A unique id for this transaction.
|
|
1201
|
+
*/
|
|
1202
|
+
id: string;
|
|
1203
|
+
|
|
1204
|
+
action: 'applied_to_invoice' | 'prorated_refund' | 'manual_adjustment';
|
|
1205
|
+
|
|
1206
|
+
/**
|
|
1207
|
+
* The value of the amount changed in the transaction.
|
|
1208
|
+
*/
|
|
1209
|
+
amount: string;
|
|
1210
|
+
|
|
1211
|
+
/**
|
|
1212
|
+
* The creation time of this transaction.
|
|
1213
|
+
*/
|
|
1214
|
+
created_at: string;
|
|
1215
|
+
|
|
1216
|
+
credit_note: CustomerBalanceTransaction.CreditNote | null;
|
|
1217
|
+
|
|
1218
|
+
/**
|
|
1219
|
+
* An optional description provided for manual customer balance adjustments.
|
|
1220
|
+
*/
|
|
1221
|
+
description: string | null;
|
|
1222
|
+
|
|
1223
|
+
/**
|
|
1224
|
+
* The new value of the customer's balance prior to the transaction, in the
|
|
1225
|
+
* customer's currency.
|
|
1226
|
+
*/
|
|
1227
|
+
ending_balance: string;
|
|
1228
|
+
|
|
1229
|
+
invoice: CustomerBalanceTransaction.Invoice | null;
|
|
1230
|
+
|
|
1231
|
+
/**
|
|
1232
|
+
* The original value of the customer's balance prior to the transaction, in the
|
|
1233
|
+
* customer's currency.
|
|
1234
|
+
*/
|
|
1235
|
+
starting_balance: string;
|
|
1236
|
+
|
|
1237
|
+
type: 'increment' | 'decrement';
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
export namespace CustomerBalanceTransaction {
|
|
1241
|
+
export interface CreditNote {
|
|
1242
|
+
/**
|
|
1243
|
+
* The id of the Credit note
|
|
1244
|
+
*/
|
|
1245
|
+
id: string;
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
export interface Invoice {
|
|
1249
|
+
/**
|
|
1250
|
+
* The Invoice id
|
|
1251
|
+
*/
|
|
1252
|
+
id: string;
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
export interface CustomerTaxID {
|
|
1257
|
+
country: string;
|
|
1258
|
+
|
|
1259
|
+
type: string;
|
|
1260
|
+
|
|
1261
|
+
value: string;
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
export interface LineItem {
|
|
1265
|
+
/**
|
|
1266
|
+
* A unique ID for this line item.
|
|
1267
|
+
*/
|
|
1268
|
+
id: string;
|
|
1269
|
+
|
|
1270
|
+
/**
|
|
1271
|
+
* The final amount after any discounts or minimums.
|
|
1272
|
+
*/
|
|
1273
|
+
amount: string;
|
|
1274
|
+
|
|
1275
|
+
discount: InvoicesAPI.InvoiceDiscount | null;
|
|
1276
|
+
|
|
1277
|
+
/**
|
|
1278
|
+
* The end date of the range of time applied for this line item's price.
|
|
1279
|
+
*/
|
|
1280
|
+
end_date: string;
|
|
1281
|
+
|
|
1282
|
+
/**
|
|
1283
|
+
* [DEPRECATED] For configured prices that are split by a grouping key, this will
|
|
1284
|
+
* be populated with the key and a value. The `amount` and `subtotal` will be the
|
|
1285
|
+
* values for this particular grouping.
|
|
1286
|
+
*/
|
|
1287
|
+
grouping: string | null;
|
|
1288
|
+
|
|
1289
|
+
maximum: LineItem.Maximum | null;
|
|
1290
|
+
|
|
1291
|
+
maximum_amount: string | null;
|
|
1292
|
+
|
|
1293
|
+
minimum: LineItem.Minimum | null;
|
|
1294
|
+
|
|
1295
|
+
minimum_amount: string | null;
|
|
1296
|
+
|
|
1297
|
+
/**
|
|
1298
|
+
* The name of the price associated with this line item.
|
|
1299
|
+
*/
|
|
1300
|
+
name: string;
|
|
1301
|
+
|
|
1302
|
+
/**
|
|
1303
|
+
* The Price resource represents a price that can be billed on a subscription,
|
|
1304
|
+
* resulting in a charge on an invoice in the form of an invoice line item. Prices
|
|
1305
|
+
* take a quantity and determine an amount to bill.
|
|
1306
|
+
*
|
|
1307
|
+
* Orb supports a few different pricing models out of the box. Each of these models
|
|
1308
|
+
* is serialized differently in a given Price object. The model_type field
|
|
1309
|
+
* determines the key for the configuration object that is present.
|
|
1310
|
+
*
|
|
1311
|
+
* ## Unit pricing
|
|
1312
|
+
*
|
|
1313
|
+
* With unit pricing, each unit costs a fixed amount.
|
|
1314
|
+
*
|
|
1315
|
+
* ```json
|
|
1316
|
+
* {
|
|
1317
|
+
* ...
|
|
1318
|
+
* "model_type": "unit",
|
|
1319
|
+
* "unit_config": {
|
|
1320
|
+
* "unit_amount": "0.50"
|
|
1321
|
+
* }
|
|
1322
|
+
* ...
|
|
1323
|
+
* }
|
|
1324
|
+
* ```
|
|
1325
|
+
*
|
|
1326
|
+
* ## Tiered pricing
|
|
1327
|
+
*
|
|
1328
|
+
* In tiered pricing, the cost of a given unit depends on the tier range that it
|
|
1329
|
+
* falls into, where each tier range is defined by an upper and lower bound. For
|
|
1330
|
+
* example, the first ten units may cost $0.50 each and all units thereafter may
|
|
1331
|
+
* cost $0.10 each.
|
|
1332
|
+
*
|
|
1333
|
+
* ```json
|
|
1334
|
+
* {
|
|
1335
|
+
* ...
|
|
1336
|
+
* "model_type": "tiered",
|
|
1337
|
+
* "tiered_config": {
|
|
1338
|
+
* "tiers": [
|
|
1339
|
+
* {
|
|
1340
|
+
* "first_unit": 1,
|
|
1341
|
+
* "last_unit": 10,
|
|
1342
|
+
* "unit_amount": "0.50"
|
|
1343
|
+
* },
|
|
1344
|
+
* {
|
|
1345
|
+
* "first_unit": 11,
|
|
1346
|
+
* "last_unit": null,
|
|
1347
|
+
* "unit_amount": "0.10"
|
|
1348
|
+
* }
|
|
1349
|
+
* ]
|
|
1350
|
+
* }
|
|
1351
|
+
* ...
|
|
1352
|
+
* ```
|
|
1353
|
+
*
|
|
1354
|
+
* ## Bulk pricing
|
|
1355
|
+
*
|
|
1356
|
+
* Bulk pricing applies when the number of units determine the cost of all units.
|
|
1357
|
+
* For example, if you've bought less than 10 units, they may each be $0.50 for a
|
|
1358
|
+
* total of $5.00. Once you've bought more than 10 units, all units may now be
|
|
1359
|
+
* priced at $0.40 (i.e. 101 units total would be $40.40).
|
|
1360
|
+
*
|
|
1361
|
+
* ```json
|
|
1362
|
+
* {
|
|
1363
|
+
* ...
|
|
1364
|
+
* "model_type": "bulk",
|
|
1365
|
+
* "bulk_config": {
|
|
1366
|
+
* "tiers": [
|
|
1367
|
+
* {
|
|
1368
|
+
* "maximum_units": 10,
|
|
1369
|
+
* "unit_amount": "0.50"
|
|
1370
|
+
* },
|
|
1371
|
+
* {
|
|
1372
|
+
* "maximum_units": 1000,
|
|
1373
|
+
* "unit_amount": "0.40"
|
|
1374
|
+
* }
|
|
1375
|
+
* ]
|
|
1376
|
+
* }
|
|
1377
|
+
* ...
|
|
1378
|
+
* }
|
|
1379
|
+
* ```
|
|
1380
|
+
*
|
|
1381
|
+
* ## Package pricing
|
|
1382
|
+
*
|
|
1383
|
+
* Package pricing defines the size or granularity of a unit for billing purposes.
|
|
1384
|
+
* For example, if the package size is set to 5, then 4 units will be billed as 5
|
|
1385
|
+
* and 6 units will be billed at 10.
|
|
1386
|
+
*
|
|
1387
|
+
* ```json
|
|
1388
|
+
* {
|
|
1389
|
+
* ...
|
|
1390
|
+
* "model_type": "package",
|
|
1391
|
+
* "package_config": {
|
|
1392
|
+
* "package_amount": "0.80",
|
|
1393
|
+
* "package_size": 10
|
|
1394
|
+
* }
|
|
1395
|
+
* ...
|
|
1396
|
+
* }
|
|
1397
|
+
* ```
|
|
1398
|
+
*
|
|
1399
|
+
* ## BPS pricing
|
|
1400
|
+
*
|
|
1401
|
+
* BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
|
|
1402
|
+
* percent (the number of basis points to charge), as well as a cap per event to
|
|
1403
|
+
* assess. For example, this would allow you to assess a fee of 0.25% on every
|
|
1404
|
+
* payment you process, with a maximum charge of $25 per payment.
|
|
1405
|
+
*
|
|
1406
|
+
* ```json
|
|
1407
|
+
* {
|
|
1408
|
+
* ...
|
|
1409
|
+
* "model_type": "bps",
|
|
1410
|
+
* "bps_config": {
|
|
1411
|
+
* "bps": 125,
|
|
1412
|
+
* "per_unit_maximum": "11.00"
|
|
1413
|
+
* }
|
|
1414
|
+
* ...
|
|
1415
|
+
* }
|
|
1416
|
+
* ```
|
|
1417
|
+
*
|
|
1418
|
+
* ## Bulk BPS pricing
|
|
1419
|
+
*
|
|
1420
|
+
* Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
|
|
1421
|
+
* total quantity across all events. Similar to bulk pricing, the BPS parameters of
|
|
1422
|
+
* a given event depends on the tier range that the billing period falls into. Each
|
|
1423
|
+
* tier range is defined by an upper bound. For example, after $1.5M of payment
|
|
1424
|
+
* volume is reached, each individual payment may have a lower cap or a smaller
|
|
1425
|
+
* take-rate.
|
|
1426
|
+
*
|
|
1427
|
+
* ```json
|
|
1428
|
+
* ...
|
|
1429
|
+
* "model_type": "bulk_bps",
|
|
1430
|
+
* "bulk_bps_config": {
|
|
1431
|
+
* "tiers": [
|
|
1432
|
+
* {
|
|
1433
|
+
* "maximum_amount": "1000000.00",
|
|
1434
|
+
* "bps": 125,
|
|
1435
|
+
* "per_unit_maximum": "19.00"
|
|
1436
|
+
* },
|
|
1437
|
+
* {
|
|
1438
|
+
* "maximum_amount": null,
|
|
1439
|
+
* "bps": 115,
|
|
1440
|
+
* "per_unit_maximum": "4.00"
|
|
1441
|
+
* }
|
|
1442
|
+
* ]
|
|
1443
|
+
* }
|
|
1444
|
+
* ...
|
|
1445
|
+
* }
|
|
1446
|
+
* ```
|
|
1447
|
+
*
|
|
1448
|
+
* ## Tiered BPS pricing
|
|
1449
|
+
*
|
|
1450
|
+
* Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
|
|
1451
|
+
* event's applicable parameter is a function of its marginal addition to the
|
|
1452
|
+
* period total. Similar to tiered pricing, the BPS parameters of a given event
|
|
1453
|
+
* depends on the tier range that it falls into, where each tier range is defined
|
|
1454
|
+
* by an upper and lower bound. For example, the first few payments may have a 0.8
|
|
1455
|
+
* BPS take-rate and all payments after a specific volume may incur a take-rate of
|
|
1456
|
+
* 0.5 BPS each.
|
|
1457
|
+
*
|
|
1458
|
+
* ```json
|
|
1459
|
+
* ...
|
|
1460
|
+
* "model_type": "tiered_bps",
|
|
1461
|
+
* "tiered_bps_config": {
|
|
1462
|
+
* "tiers": [
|
|
1463
|
+
* {
|
|
1464
|
+
* "minimum_amount": "0",
|
|
1465
|
+
* "maximum_amount": "1000000.00",
|
|
1466
|
+
* "bps": 125,
|
|
1467
|
+
* "per_unit_maximum": "19.00"
|
|
1468
|
+
* },
|
|
1469
|
+
* {
|
|
1470
|
+
* "minimum_amount": "1000000.00",
|
|
1471
|
+
* "maximum_amount": null,
|
|
1472
|
+
* "bps": 115,
|
|
1473
|
+
* "per_unit_maximum": "4.00"
|
|
1474
|
+
* }
|
|
1475
|
+
* ]
|
|
1476
|
+
* }
|
|
1477
|
+
* ...
|
|
1478
|
+
* }
|
|
1479
|
+
* ```
|
|
1480
|
+
*
|
|
1481
|
+
* ## Matrix pricing
|
|
1482
|
+
*
|
|
1483
|
+
* Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
|
|
1484
|
+
* `dimensions` defines the two event property values evaluated in this pricing
|
|
1485
|
+
* model. In a one-dimensional matrix, the second value is `null`. Every
|
|
1486
|
+
* configuration has a list of `matrix_values` which give the unit prices for
|
|
1487
|
+
* specified property values. In a one-dimensional matrix, the matrix values will
|
|
1488
|
+
* have `dimension_values` where the second value of the pair is null. If an event
|
|
1489
|
+
* does not match any of the dimension values in the matrix, it will resort to the
|
|
1490
|
+
* `default_unit_amount`.
|
|
1491
|
+
*
|
|
1492
|
+
* ```json
|
|
1493
|
+
* {
|
|
1494
|
+
* "model_type": "matrix"
|
|
1495
|
+
* "matrix_config": {
|
|
1496
|
+
* "default_unit_amount": "3.00",
|
|
1497
|
+
* "dimensions": [
|
|
1498
|
+
* "cluster_name",
|
|
1499
|
+
* "region"
|
|
1500
|
+
* ],
|
|
1501
|
+
* "matrix_values": [
|
|
1502
|
+
* {
|
|
1503
|
+
* "dimension_values": [
|
|
1504
|
+
* "alpha",
|
|
1505
|
+
* "west"
|
|
1506
|
+
* ],
|
|
1507
|
+
* "unit_amount": "2.00"
|
|
1508
|
+
* },
|
|
1509
|
+
* ...
|
|
1510
|
+
* ]
|
|
1511
|
+
* }
|
|
1512
|
+
* }
|
|
1513
|
+
* ```
|
|
1514
|
+
*
|
|
1515
|
+
* ### Fixed fees
|
|
1516
|
+
*
|
|
1517
|
+
* Fixed fees are prices that are applied independent of usage quantities, and
|
|
1518
|
+
* follow unit pricing. They also have an additional parameter
|
|
1519
|
+
* `fixed_price_quantity`. If the Price represents a fixed cost, this represents
|
|
1520
|
+
* the quantity of units applied.
|
|
1521
|
+
*
|
|
1522
|
+
* ```json
|
|
1523
|
+
* {
|
|
1524
|
+
* ...
|
|
1525
|
+
* "id": "price_id",
|
|
1526
|
+
* "model_type": "unit",
|
|
1527
|
+
* "unit_config": {
|
|
1528
|
+
* "unit_amount": "2.00"
|
|
1529
|
+
* },
|
|
1530
|
+
* "fixed_price_quantity": 3.0
|
|
1531
|
+
* ...
|
|
1532
|
+
* }
|
|
1533
|
+
* ```
|
|
1534
|
+
*/
|
|
1535
|
+
price: PricesAPI.Price | null;
|
|
1536
|
+
|
|
1537
|
+
quantity: number;
|
|
1538
|
+
|
|
1539
|
+
/**
|
|
1540
|
+
* The start date of the range of time applied for this line item's price.
|
|
1541
|
+
*/
|
|
1542
|
+
start_date: string;
|
|
1543
|
+
|
|
1544
|
+
/**
|
|
1545
|
+
* For complex pricing structures, the line item can be broken down further in
|
|
1546
|
+
* `sub_line_items`.
|
|
1547
|
+
*/
|
|
1548
|
+
sub_line_items: Array<LineItem.MatrixSubLineItem | LineItem.TierSubLineItem | LineItem.OtherSubLineItem>;
|
|
1549
|
+
|
|
1550
|
+
/**
|
|
1551
|
+
* The line amount before any line item-specific discounts or minimums.
|
|
1552
|
+
*/
|
|
1553
|
+
subtotal: string;
|
|
1554
|
+
|
|
1555
|
+
/**
|
|
1556
|
+
* An array of tax rates and their incurred tax amounts. Empty if no tax
|
|
1557
|
+
* integration is configured.
|
|
1558
|
+
*/
|
|
1559
|
+
tax_amounts: Array<LineItem.TaxAmount>;
|
|
1560
|
+
}
|
|
1561
|
+
|
|
1562
|
+
export namespace LineItem {
|
|
1563
|
+
export interface Maximum {
|
|
1564
|
+
/**
|
|
1565
|
+
* List of price_ids that this maximum amount applies to. For plan/plan phase
|
|
1566
|
+
* maximums, this can be a subset of prices.
|
|
1567
|
+
*/
|
|
1568
|
+
applies_to_price_ids: Array<string>;
|
|
1569
|
+
|
|
1570
|
+
/**
|
|
1571
|
+
* Maximum amount applied
|
|
1572
|
+
*/
|
|
1573
|
+
maximum_amount: string;
|
|
1574
|
+
}
|
|
1575
|
+
|
|
1576
|
+
export interface Minimum {
|
|
1577
|
+
/**
|
|
1578
|
+
* List of price_ids that this minimum amount applies to. For plan/plan phase
|
|
1579
|
+
* minimums, this can be a subset of prices.
|
|
1580
|
+
*/
|
|
1581
|
+
applies_to_price_ids: Array<string>;
|
|
1582
|
+
|
|
1583
|
+
/**
|
|
1584
|
+
* Minimum amount applied
|
|
1585
|
+
*/
|
|
1586
|
+
minimum_amount: string;
|
|
1587
|
+
}
|
|
1588
|
+
|
|
1589
|
+
export interface MatrixSubLineItem {
|
|
1590
|
+
/**
|
|
1591
|
+
* The total amount for this sub line item.
|
|
1592
|
+
*/
|
|
1593
|
+
amount: string;
|
|
1594
|
+
|
|
1595
|
+
grouping: MatrixSubLineItem.Grouping | null;
|
|
1596
|
+
|
|
1597
|
+
matrix_config: MatrixSubLineItem.MatrixConfig;
|
|
1598
|
+
|
|
1599
|
+
name: string;
|
|
1600
|
+
|
|
1601
|
+
quantity: number;
|
|
1602
|
+
|
|
1603
|
+
type: 'matrix';
|
|
1604
|
+
}
|
|
1605
|
+
|
|
1606
|
+
export namespace MatrixSubLineItem {
|
|
1607
|
+
export interface Grouping {
|
|
1608
|
+
key: string;
|
|
1609
|
+
|
|
1610
|
+
/**
|
|
1611
|
+
* No value indicates the default group
|
|
1612
|
+
*/
|
|
1613
|
+
value: string | null;
|
|
1614
|
+
}
|
|
1615
|
+
|
|
1616
|
+
export interface MatrixConfig {
|
|
1617
|
+
/**
|
|
1618
|
+
* The ordered dimension values for this line item.
|
|
1619
|
+
*/
|
|
1620
|
+
dimension_values: Array<string | null>;
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1624
|
+
export interface TierSubLineItem {
|
|
1625
|
+
/**
|
|
1626
|
+
* The total amount for this sub line item.
|
|
1627
|
+
*/
|
|
1628
|
+
amount: string;
|
|
1629
|
+
|
|
1630
|
+
grouping: TierSubLineItem.Grouping | null;
|
|
1631
|
+
|
|
1632
|
+
name: string;
|
|
1633
|
+
|
|
1634
|
+
quantity: number;
|
|
1635
|
+
|
|
1636
|
+
tier_config: TierSubLineItem.TierConfig;
|
|
1637
|
+
|
|
1638
|
+
type: 'tier';
|
|
1639
|
+
}
|
|
1640
|
+
|
|
1641
|
+
export namespace TierSubLineItem {
|
|
1642
|
+
export interface Grouping {
|
|
1643
|
+
key: string;
|
|
1644
|
+
|
|
1645
|
+
/**
|
|
1646
|
+
* No value indicates the default group
|
|
1647
|
+
*/
|
|
1648
|
+
value: string | null;
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1651
|
+
export interface TierConfig {
|
|
1652
|
+
first_unit: number;
|
|
1653
|
+
|
|
1654
|
+
last_unit: number | null;
|
|
1655
|
+
|
|
1656
|
+
unit_amount: string;
|
|
1657
|
+
}
|
|
1658
|
+
}
|
|
1659
|
+
|
|
1660
|
+
export interface OtherSubLineItem {
|
|
1661
|
+
/**
|
|
1662
|
+
* The total amount for this sub line item.
|
|
1663
|
+
*/
|
|
1664
|
+
amount: string;
|
|
1665
|
+
|
|
1666
|
+
grouping: OtherSubLineItem.Grouping | null;
|
|
1667
|
+
|
|
1668
|
+
name: string;
|
|
1669
|
+
|
|
1670
|
+
quantity: number;
|
|
1671
|
+
|
|
1672
|
+
type: "'null'";
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1675
|
+
export namespace OtherSubLineItem {
|
|
1676
|
+
export interface Grouping {
|
|
1677
|
+
key: string;
|
|
1678
|
+
|
|
1679
|
+
/**
|
|
1680
|
+
* No value indicates the default group
|
|
1681
|
+
*/
|
|
1682
|
+
value: string | null;
|
|
1683
|
+
}
|
|
1684
|
+
}
|
|
1685
|
+
|
|
1686
|
+
export interface TaxAmount {
|
|
1687
|
+
/**
|
|
1688
|
+
* The amount of additional tax incurred by this tax rate.
|
|
1689
|
+
*/
|
|
1690
|
+
amount: string;
|
|
1691
|
+
|
|
1692
|
+
/**
|
|
1693
|
+
* The human-readable description of the applied tax rate.
|
|
1694
|
+
*/
|
|
1695
|
+
tax_rate_description: string;
|
|
1696
|
+
|
|
1697
|
+
/**
|
|
1698
|
+
* The tax rate percentage, out of 100.
|
|
1699
|
+
*/
|
|
1700
|
+
tax_rate_percentage: string | null;
|
|
1701
|
+
}
|
|
1702
|
+
}
|
|
1703
|
+
|
|
1704
|
+
export interface Maximum {
|
|
1705
|
+
/**
|
|
1706
|
+
* List of price_ids that this maximum amount applies to. For plan/plan phase
|
|
1707
|
+
* maximums, this can be a subset of prices.
|
|
1708
|
+
*/
|
|
1709
|
+
applies_to_price_ids: Array<string>;
|
|
1710
|
+
|
|
1711
|
+
/**
|
|
1712
|
+
* Maximum amount applied
|
|
1713
|
+
*/
|
|
1714
|
+
maximum_amount: string;
|
|
1715
|
+
}
|
|
1716
|
+
|
|
1717
|
+
export interface Minimum {
|
|
1718
|
+
/**
|
|
1719
|
+
* List of price_ids that this minimum amount applies to. For plan/plan phase
|
|
1720
|
+
* minimums, this can be a subset of prices.
|
|
1721
|
+
*/
|
|
1722
|
+
applies_to_price_ids: Array<string>;
|
|
1723
|
+
|
|
1724
|
+
/**
|
|
1725
|
+
* Minimum amount applied
|
|
1726
|
+
*/
|
|
1727
|
+
minimum_amount: string;
|
|
1728
|
+
}
|
|
1729
|
+
|
|
1730
|
+
export interface ShippingAddress {
|
|
1731
|
+
city: string | null;
|
|
1732
|
+
|
|
1733
|
+
country: string | null;
|
|
1734
|
+
|
|
1735
|
+
line1: string | null;
|
|
1736
|
+
|
|
1737
|
+
line2: string | null;
|
|
1738
|
+
|
|
1739
|
+
postal_code: string | null;
|
|
1740
|
+
|
|
1741
|
+
state: string | null;
|
|
1742
|
+
}
|
|
1743
|
+
|
|
1744
|
+
export interface Subscription {
|
|
1745
|
+
id: string;
|
|
1746
|
+
}
|
|
1747
|
+
}
|
|
1748
|
+
|
|
1749
|
+
export interface InvoiceCreateParams {
|
|
1750
|
+
/**
|
|
1751
|
+
* An ISO 4217 currency string. Must be the same as the customer's currency if it
|
|
1752
|
+
* is set.
|
|
1753
|
+
*/
|
|
1754
|
+
currency: string;
|
|
1755
|
+
|
|
1756
|
+
/**
|
|
1757
|
+
* Optional invoice date to set. Must be in the past, if not set, `invoice_date` is
|
|
1758
|
+
* set to the current time in the customer's timezone.
|
|
1759
|
+
*/
|
|
1760
|
+
invoice_date: string;
|
|
1761
|
+
|
|
1762
|
+
line_items: Array<InvoiceCreateParams.LineItem>;
|
|
1763
|
+
|
|
1764
|
+
/**
|
|
1765
|
+
* Determines the difference between the invoice issue date for subscription
|
|
1766
|
+
* invoices as the date that they are due. A value of '0' here represents that the
|
|
1767
|
+
* invoice is due on issue, whereas a value of 30 represents that the customer has
|
|
1768
|
+
* 30 days to pay the invoice.
|
|
1769
|
+
*/
|
|
1770
|
+
net_terms: number;
|
|
1771
|
+
|
|
1772
|
+
/**
|
|
1773
|
+
* The id of the `Customer` to create this invoice for. One of `customer_id` and
|
|
1774
|
+
* `external_customer_id` are required.
|
|
1775
|
+
*/
|
|
1776
|
+
customer_id?: string | null;
|
|
1777
|
+
|
|
1778
|
+
/**
|
|
1779
|
+
* The `external_customer_id` of the `Customer` to create this invoice for. One of
|
|
1780
|
+
* `customer_id` and `external_customer_id` are required.
|
|
1781
|
+
*/
|
|
1782
|
+
external_customer_id?: string | null;
|
|
1783
|
+
|
|
1784
|
+
/**
|
|
1785
|
+
* An optional memo to attach to the invoice.
|
|
1786
|
+
*/
|
|
1787
|
+
memo?: string | null;
|
|
1788
|
+
|
|
1789
|
+
/**
|
|
1790
|
+
* When true, this invoice will automatically be issued upon creation. When false,
|
|
1791
|
+
* the resulting invoice will require manual review to issue. Defaulted to false.
|
|
1792
|
+
*/
|
|
1793
|
+
will_auto_issue?: boolean;
|
|
1794
|
+
}
|
|
1795
|
+
|
|
1796
|
+
export namespace InvoiceCreateParams {
|
|
1797
|
+
export interface LineItem {
|
|
1798
|
+
/**
|
|
1799
|
+
* A date string to specify the line item's end date in the customer's timezone.
|
|
1800
|
+
*/
|
|
1801
|
+
end_date: string;
|
|
1802
|
+
|
|
1803
|
+
item_id: string;
|
|
1804
|
+
|
|
1805
|
+
model_type: 'unit';
|
|
1806
|
+
|
|
1807
|
+
/**
|
|
1808
|
+
* The name of the line item.
|
|
1809
|
+
*/
|
|
1810
|
+
name: string;
|
|
1811
|
+
|
|
1812
|
+
/**
|
|
1813
|
+
* The number of units on the line item
|
|
1814
|
+
*/
|
|
1815
|
+
quantity: number;
|
|
1816
|
+
|
|
1817
|
+
/**
|
|
1818
|
+
* A date string to specify the line item's start date in the customer's timezone.
|
|
1819
|
+
*/
|
|
1820
|
+
start_date: string;
|
|
1821
|
+
|
|
1822
|
+
unit_config: LineItem.UnitConfig;
|
|
1823
|
+
}
|
|
1824
|
+
|
|
1825
|
+
export namespace LineItem {
|
|
1826
|
+
export interface UnitConfig {
|
|
1827
|
+
/**
|
|
1828
|
+
* Rate per unit of usage
|
|
1829
|
+
*/
|
|
1830
|
+
unit_amount: string;
|
|
1831
|
+
|
|
1832
|
+
/**
|
|
1833
|
+
* Multiplier to scale rated quantity by
|
|
1834
|
+
*/
|
|
1835
|
+
scaling_factor?: number | null;
|
|
1836
|
+
}
|
|
1837
|
+
}
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1840
|
+
export interface InvoiceListParams extends PageParams {
|
|
1841
|
+
amount?: string | null;
|
|
1842
|
+
|
|
1843
|
+
'amount[gt]'?: string | null;
|
|
1844
|
+
|
|
1845
|
+
'amount[lt]'?: string | null;
|
|
1846
|
+
|
|
1847
|
+
customer_id?: string | null;
|
|
1848
|
+
|
|
1849
|
+
date_type?: 'due_date' | 'invoice_date' | null;
|
|
1850
|
+
|
|
1851
|
+
due_date?: string | null;
|
|
1852
|
+
|
|
1853
|
+
due_date_window?: string | null;
|
|
1854
|
+
|
|
1855
|
+
'due_date[gt]'?: string | null;
|
|
1856
|
+
|
|
1857
|
+
'due_date[lt]'?: string | null;
|
|
1858
|
+
|
|
1859
|
+
external_customer_id?: string | null;
|
|
1860
|
+
|
|
1861
|
+
'invoice_date[gt]'?: string | null;
|
|
1862
|
+
|
|
1863
|
+
'invoice_date[gte]'?: string | null;
|
|
1864
|
+
|
|
1865
|
+
'invoice_date[lt]'?: string | null;
|
|
1866
|
+
|
|
1867
|
+
'invoice_date[lte]'?: string | null;
|
|
1868
|
+
|
|
1869
|
+
is_recurring?: boolean | null;
|
|
1870
|
+
|
|
1871
|
+
status?: 'draft' | 'issued' | 'paid' | 'synced' | 'void' | null;
|
|
1872
|
+
|
|
1873
|
+
subscription_id?: string | null;
|
|
1874
|
+
}
|
|
1875
|
+
|
|
1876
|
+
export interface InvoiceFetchUpcomingParams {
|
|
1877
|
+
subscription_id?: string;
|
|
1878
|
+
}
|
|
1879
|
+
|
|
1880
|
+
export interface InvoiceMarkPaidParams {
|
|
1881
|
+
/**
|
|
1882
|
+
* An optional external ID to associate with the payment.
|
|
1883
|
+
*/
|
|
1884
|
+
external_id: string | null;
|
|
1885
|
+
|
|
1886
|
+
/**
|
|
1887
|
+
* An optional note to associate with the payment.
|
|
1888
|
+
*/
|
|
1889
|
+
notes: string | null;
|
|
1890
|
+
|
|
1891
|
+
/**
|
|
1892
|
+
* A date string to specify the date of the payment.
|
|
1893
|
+
*/
|
|
1894
|
+
payment_received_date: string;
|
|
1895
|
+
}
|
|
1896
|
+
|
|
1897
|
+
export namespace Invoices {
|
|
1898
|
+
export import Invoice = InvoicesAPI.Invoice;
|
|
1899
|
+
export import InvoiceDiscount = InvoicesAPI.InvoiceDiscount;
|
|
1900
|
+
export import InvoiceFetchUpcomingResponse = InvoicesAPI.InvoiceFetchUpcomingResponse;
|
|
1901
|
+
export import InvoicesPage = InvoicesAPI.InvoicesPage;
|
|
1902
|
+
export import InvoiceCreateParams = InvoicesAPI.InvoiceCreateParams;
|
|
1903
|
+
export import InvoiceListParams = InvoicesAPI.InvoiceListParams;
|
|
1904
|
+
export import InvoiceFetchUpcomingParams = InvoicesAPI.InvoiceFetchUpcomingParams;
|
|
1905
|
+
export import InvoiceMarkPaidParams = InvoicesAPI.InvoiceMarkPaidParams;
|
|
1906
|
+
}
|