orb-billing 5.75.1 → 6.0.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 +31 -0
- package/README.md +118 -45
- package/api-promise.d.mts +3 -0
- package/api-promise.d.mts.map +1 -0
- package/api-promise.d.ts +3 -0
- package/api-promise.d.ts.map +1 -0
- package/api-promise.js +6 -0
- package/api-promise.js.map +1 -0
- package/api-promise.mjs +3 -0
- package/api-promise.mjs.map +1 -0
- package/client.d.mts +474 -0
- package/client.d.mts.map +1 -0
- package/client.d.ts +474 -0
- package/client.d.ts.map +1 -0
- package/client.js +650 -0
- package/client.js.map +1 -0
- package/client.mjs +645 -0
- package/client.mjs.map +1 -0
- package/core/api-promise.d.mts +46 -0
- package/core/api-promise.d.mts.map +1 -0
- package/core/api-promise.d.ts +46 -0
- package/core/api-promise.d.ts.map +1 -0
- package/core/api-promise.js +74 -0
- package/core/api-promise.js.map +1 -0
- package/core/api-promise.mjs +70 -0
- package/core/api-promise.mjs.map +1 -0
- package/core/error.d.mts +131 -0
- package/core/error.d.mts.map +1 -0
- package/core/error.d.ts +131 -0
- package/core/error.d.ts.map +1 -0
- package/core/error.js +294 -0
- package/core/error.js.map +1 -0
- package/core/error.mjs +266 -0
- package/core/error.mjs.map +1 -0
- package/core/pagination.d.mts +67 -0
- package/core/pagination.d.mts.map +1 -0
- package/core/pagination.d.ts +67 -0
- package/core/pagination.d.ts.map +1 -0
- package/core/pagination.js +101 -0
- package/core/pagination.js.map +1 -0
- package/core/pagination.mjs +95 -0
- package/core/pagination.mjs.map +1 -0
- package/core/resource.d.mts +6 -0
- package/core/resource.d.mts.map +1 -0
- package/core/resource.d.ts +6 -0
- package/core/resource.d.ts.map +1 -0
- package/core/resource.js +11 -0
- package/core/resource.js.map +1 -0
- package/core/resource.mjs +7 -0
- package/core/resource.mjs.map +1 -0
- package/core/uploads.d.mts +3 -0
- package/core/uploads.d.mts.map +1 -0
- package/core/uploads.d.ts +3 -0
- package/core/uploads.d.ts.map +1 -0
- package/core/uploads.js +6 -0
- package/core/uploads.js.map +1 -0
- package/core/uploads.mjs +2 -0
- package/core/uploads.mjs.map +1 -0
- package/error.d.mts +3 -0
- package/error.d.mts.map +1 -0
- package/error.d.ts +2 -131
- package/error.d.ts.map +1 -1
- package/error.js +3 -291
- package/error.js.map +1 -1
- package/error.mjs +2 -265
- package/error.mjs.map +1 -1
- package/index.d.mts +7 -401
- package/index.d.mts.map +1 -0
- package/index.d.ts +6 -400
- package/index.d.ts.map +1 -1
- package/index.js +15 -286
- package/index.js.map +1 -1
- package/index.mjs +6 -259
- package/index.mjs.map +1 -1
- package/internal/builtin-types.d.mts +73 -0
- package/internal/builtin-types.d.mts.map +1 -0
- package/internal/builtin-types.d.ts +73 -0
- package/internal/builtin-types.d.ts.map +1 -0
- package/internal/builtin-types.js +4 -0
- package/internal/builtin-types.js.map +1 -0
- package/internal/builtin-types.mjs +3 -0
- package/internal/builtin-types.mjs.map +1 -0
- package/internal/detect-platform.d.mts +15 -0
- package/internal/detect-platform.d.mts.map +1 -0
- package/internal/detect-platform.d.ts +15 -0
- package/internal/detect-platform.d.ts.map +1 -0
- package/internal/detect-platform.js +162 -0
- package/internal/detect-platform.js.map +1 -0
- package/internal/detect-platform.mjs +157 -0
- package/internal/detect-platform.mjs.map +1 -0
- package/internal/errors.d.mts +3 -0
- package/internal/errors.d.mts.map +1 -0
- package/internal/errors.d.ts +3 -0
- package/internal/errors.d.ts.map +1 -0
- package/internal/errors.js +41 -0
- package/internal/errors.js.map +1 -0
- package/internal/errors.mjs +36 -0
- package/internal/errors.mjs.map +1 -0
- package/internal/headers.d.mts +20 -0
- package/internal/headers.d.mts.map +1 -0
- package/internal/headers.d.ts +20 -0
- package/internal/headers.d.ts.map +1 -0
- package/internal/headers.js +79 -0
- package/internal/headers.js.map +1 -0
- package/internal/headers.mjs +74 -0
- package/internal/headers.mjs.map +1 -0
- package/internal/parse.d.mts +12 -0
- package/internal/parse.d.mts.map +1 -0
- package/internal/parse.d.ts +12 -0
- package/internal/parse.d.ts.map +1 -0
- package/internal/parse.js +40 -0
- package/internal/parse.js.map +1 -0
- package/internal/parse.mjs +37 -0
- package/internal/parse.mjs.map +1 -0
- package/internal/qs/formats.d.mts +7 -0
- package/internal/qs/formats.d.mts.map +1 -0
- package/internal/qs/formats.d.ts +1 -0
- package/internal/qs/formats.d.ts.map +1 -1
- package/internal/qs/formats.js +4 -2
- package/internal/qs/formats.js.map +1 -1
- package/internal/qs/formats.mjs +2 -1
- package/internal/qs/formats.mjs.map +1 -1
- package/internal/qs/index.d.mts +10 -0
- package/internal/qs/index.d.mts.map +1 -0
- package/internal/qs/index.d.ts +2 -2
- package/internal/qs/index.d.ts.map +1 -1
- package/internal/qs/index.mjs.map +1 -1
- package/internal/qs/stringify.d.mts +3 -0
- package/internal/qs/stringify.d.mts.map +1 -0
- package/internal/qs/stringify.d.ts.map +1 -1
- package/internal/qs/stringify.js +16 -19
- package/internal/qs/stringify.js.map +1 -1
- package/internal/qs/stringify.mjs +17 -19
- package/internal/qs/stringify.mjs.map +1 -1
- package/internal/qs/types.d.mts +57 -0
- package/internal/qs/types.d.mts.map +1 -0
- package/internal/qs/utils.d.mts +15 -0
- package/internal/qs/utils.d.mts.map +1 -0
- package/internal/qs/utils.d.ts +1 -0
- package/internal/qs/utils.d.ts.map +1 -1
- package/internal/qs/utils.js +22 -21
- package/internal/qs/utils.js.map +1 -1
- package/internal/qs/utils.mjs +12 -12
- package/internal/qs/utils.mjs.map +1 -1
- package/internal/request-options.d.mts +75 -0
- package/internal/request-options.d.mts.map +1 -0
- package/internal/request-options.d.ts +75 -0
- package/internal/request-options.d.ts.map +1 -0
- package/internal/request-options.js +14 -0
- package/internal/request-options.js.map +1 -0
- package/internal/request-options.mjs +10 -0
- package/internal/request-options.mjs.map +1 -0
- package/internal/shim-types.d.mts +17 -0
- package/internal/shim-types.d.mts.map +1 -0
- package/internal/shim-types.d.ts +17 -0
- package/internal/shim-types.d.ts.map +1 -0
- package/internal/shim-types.js +4 -0
- package/internal/shim-types.js.map +1 -0
- package/internal/shim-types.mjs +3 -0
- package/internal/shim-types.mjs.map +1 -0
- package/internal/shims.d.mts +26 -0
- package/internal/shims.d.mts.map +1 -0
- package/internal/shims.d.ts +26 -0
- package/internal/shims.d.ts.map +1 -0
- package/internal/shims.js +92 -0
- package/internal/shims.js.map +1 -0
- package/internal/shims.mjs +85 -0
- package/internal/shims.mjs.map +1 -0
- package/internal/to-file.d.mts +45 -0
- package/internal/to-file.d.mts.map +1 -0
- package/internal/to-file.d.ts +45 -0
- package/internal/to-file.d.ts.map +1 -0
- package/internal/to-file.js +91 -0
- package/internal/to-file.js.map +1 -0
- package/internal/to-file.mjs +88 -0
- package/internal/to-file.mjs.map +1 -0
- package/internal/tslib.js +81 -0
- package/internal/tslib.mjs +17 -0
- package/internal/types.d.mts +69 -0
- package/internal/types.d.mts.map +1 -0
- package/internal/types.d.ts +69 -0
- package/internal/types.d.ts.map +1 -0
- package/internal/types.js +4 -0
- package/internal/types.js.map +1 -0
- package/internal/types.mjs +3 -0
- package/internal/types.mjs.map +1 -0
- package/internal/uploads.d.mts +42 -0
- package/internal/uploads.d.mts.map +1 -0
- package/internal/uploads.d.ts +42 -0
- package/internal/uploads.d.ts.map +1 -0
- package/internal/uploads.js +141 -0
- package/internal/uploads.js.map +1 -0
- package/internal/uploads.mjs +131 -0
- package/internal/uploads.mjs.map +1 -0
- package/internal/utils/base64.d.mts +3 -0
- package/internal/utils/base64.d.mts.map +1 -0
- package/internal/utils/base64.d.ts +3 -0
- package/internal/utils/base64.d.ts.map +1 -0
- package/internal/utils/base64.js +38 -0
- package/internal/utils/base64.js.map +1 -0
- package/internal/utils/base64.mjs +33 -0
- package/internal/utils/base64.mjs.map +1 -0
- package/internal/utils/bytes.d.mts +4 -0
- package/internal/utils/bytes.d.mts.map +1 -0
- package/internal/utils/bytes.d.ts +4 -0
- package/internal/utils/bytes.d.ts.map +1 -0
- package/internal/utils/bytes.js +31 -0
- package/internal/utils/bytes.js.map +1 -0
- package/internal/utils/bytes.mjs +26 -0
- package/internal/utils/bytes.mjs.map +1 -0
- package/internal/utils/env.d.mts +9 -0
- package/internal/utils/env.d.mts.map +1 -0
- package/internal/utils/env.d.ts +9 -0
- package/internal/utils/env.d.ts.map +1 -0
- package/internal/utils/env.js +22 -0
- package/internal/utils/env.js.map +1 -0
- package/internal/utils/env.mjs +18 -0
- package/internal/utils/env.mjs.map +1 -0
- package/internal/utils/log.d.mts +37 -0
- package/internal/utils/log.d.mts.map +1 -0
- package/internal/utils/log.d.ts +37 -0
- package/internal/utils/log.d.ts.map +1 -0
- package/internal/utils/log.js +87 -0
- package/internal/utils/log.js.map +1 -0
- package/internal/utils/log.mjs +81 -0
- package/internal/utils/log.mjs.map +1 -0
- package/internal/utils/path.d.mts +15 -0
- package/internal/utils/path.d.mts.map +1 -0
- package/internal/utils/path.d.ts +15 -0
- package/internal/utils/path.d.ts.map +1 -0
- package/internal/utils/path.js +79 -0
- package/internal/utils/path.js.map +1 -0
- package/internal/utils/path.mjs +74 -0
- package/internal/utils/path.mjs.map +1 -0
- package/internal/utils/query.d.mts +2 -0
- package/internal/utils/query.d.mts.map +1 -0
- package/internal/utils/query.js +3 -26
- package/internal/utils/query.js.map +1 -1
- package/internal/utils/query.mjs.map +1 -1
- package/internal/utils/sleep.d.mts +2 -0
- package/internal/utils/sleep.d.mts.map +1 -0
- package/internal/utils/sleep.d.ts +2 -0
- package/internal/utils/sleep.d.ts.map +1 -0
- package/internal/utils/sleep.js +7 -0
- package/internal/utils/sleep.js.map +1 -0
- package/internal/utils/sleep.mjs +3 -0
- package/internal/utils/sleep.mjs.map +1 -0
- package/internal/utils/uuid.d.mts +5 -0
- package/internal/utils/uuid.d.mts.map +1 -0
- package/internal/utils/uuid.d.ts +5 -0
- package/internal/utils/uuid.d.ts.map +1 -0
- package/internal/utils/uuid.js +19 -0
- package/internal/utils/uuid.js.map +1 -0
- package/internal/utils/uuid.mjs +15 -0
- package/internal/utils/uuid.mjs.map +1 -0
- package/internal/utils/values.d.mts +18 -0
- package/internal/utils/values.d.mts.map +1 -0
- package/internal/utils/values.d.ts +18 -0
- package/internal/utils/values.d.ts.map +1 -0
- package/internal/utils/values.js +112 -0
- package/internal/utils/values.js.map +1 -0
- package/internal/utils/values.mjs +94 -0
- package/internal/utils/values.mjs.map +1 -0
- package/internal/utils.d.mts +8 -0
- package/internal/utils.d.mts.map +1 -0
- package/internal/utils.d.ts +8 -0
- package/internal/utils.d.ts.map +1 -0
- package/internal/utils.js +12 -0
- package/internal/utils.js.map +1 -0
- package/internal/utils.mjs +9 -0
- package/internal/utils.mjs.map +1 -0
- package/package.json +122 -65
- package/pagination.d.mts +3 -0
- package/pagination.d.mts.map +1 -0
- package/pagination.d.ts +2 -30
- package/pagination.d.ts.map +1 -1
- package/pagination.js +3 -37
- package/pagination.js.map +1 -1
- package/pagination.mjs +2 -35
- package/pagination.mjs.map +1 -1
- package/resource.d.mts +3 -0
- package/resource.d.mts.map +1 -0
- package/resource.d.ts +2 -5
- package/resource.d.ts.map +1 -1
- package/resource.js +3 -8
- package/resource.js.map +1 -1
- package/resource.mjs +2 -6
- package/resource.mjs.map +1 -1
- package/resources/alerts.d.mts +430 -0
- package/resources/alerts.d.mts.map +1 -0
- package/resources/alerts.d.ts +14 -17
- package/resources/alerts.d.ts.map +1 -1
- package/resources/alerts.js +37 -27
- package/resources/alerts.js.map +1 -1
- package/resources/alerts.mjs +36 -25
- package/resources/alerts.mjs.map +1 -1
- package/resources/beta/beta.d.mts +2826 -0
- package/resources/beta/beta.d.mts.map +1 -0
- package/resources/beta/beta.d.ts +13 -9
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js +10 -30
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs +8 -6
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/external-plan-id.d.mts +2713 -0
- package/resources/beta/external-plan-id.d.mts.map +1 -0
- package/resources/beta/external-plan-id.d.ts +10 -6
- package/resources/beta/external-plan-id.d.ts.map +1 -1
- package/resources/beta/external-plan-id.js +7 -5
- package/resources/beta/external-plan-id.js.map +1 -1
- package/resources/beta/external-plan-id.mjs +7 -5
- package/resources/beta/external-plan-id.mjs.map +1 -1
- package/resources/beta/index.d.mts +3 -0
- package/resources/beta/index.d.mts.map +1 -0
- package/resources/beta/index.d.ts +2 -2
- package/resources/beta/index.d.ts.map +1 -1
- package/resources/beta/index.js.map +1 -1
- package/resources/beta/index.mjs.map +1 -1
- package/resources/beta.d.mts +2 -0
- package/resources/beta.d.mts.map +1 -0
- package/resources/beta.d.ts.map +1 -1
- package/resources/beta.js +2 -15
- package/resources/beta.js.map +1 -1
- package/resources/beta.mjs.map +1 -1
- package/resources/coupons/coupons.d.mts +148 -0
- package/resources/coupons/coupons.d.mts.map +1 -0
- package/resources/coupons/coupons.d.ts +10 -11
- package/resources/coupons/coupons.d.ts.map +1 -1
- package/resources/coupons/coupons.js +24 -38
- package/resources/coupons/coupons.js.map +1 -1
- package/resources/coupons/coupons.mjs +21 -12
- package/resources/coupons/coupons.mjs.map +1 -1
- package/resources/coupons/index.d.mts +3 -0
- package/resources/coupons/index.d.mts.map +1 -0
- package/resources/coupons/index.d.ts +1 -1
- package/resources/coupons/index.d.ts.map +1 -1
- package/resources/coupons/index.js +1 -2
- package/resources/coupons/index.js.map +1 -1
- package/resources/coupons/index.mjs +1 -1
- package/resources/coupons/index.mjs.map +1 -1
- package/resources/coupons/subscriptions.d.mts +34 -0
- package/resources/coupons/subscriptions.d.mts.map +1 -0
- package/resources/coupons/subscriptions.d.ts +5 -6
- package/resources/coupons/subscriptions.d.ts.map +1 -1
- package/resources/coupons/subscriptions.js +21 -12
- package/resources/coupons/subscriptions.js.map +1 -1
- package/resources/coupons/subscriptions.mjs +20 -11
- package/resources/coupons/subscriptions.mjs.map +1 -1
- package/resources/coupons.d.mts +2 -0
- package/resources/coupons.d.mts.map +1 -0
- package/resources/coupons.d.ts.map +1 -1
- package/resources/coupons.js +2 -15
- package/resources/coupons.js.map +1 -1
- package/resources/coupons.mjs.map +1 -1
- package/resources/credit-blocks.d.mts +275 -0
- package/resources/credit-blocks.d.mts.map +1 -0
- package/resources/credit-blocks.d.ts +50 -9
- package/resources/credit-blocks.d.ts.map +1 -1
- package/resources/credit-blocks.js +7 -5
- package/resources/credit-blocks.js.map +1 -1
- package/resources/credit-blocks.mjs +7 -5
- package/resources/credit-blocks.mjs.map +1 -1
- package/resources/credit-notes.d.mts +144 -0
- package/resources/credit-notes.d.mts.map +1 -0
- package/resources/credit-notes.d.ts +8 -8
- package/resources/credit-notes.d.ts.map +1 -1
- package/resources/credit-notes.js +19 -10
- package/resources/credit-notes.js.map +1 -1
- package/resources/credit-notes.mjs +18 -9
- package/resources/credit-notes.mjs.map +1 -1
- package/resources/customers/balance-transactions.d.mts +135 -0
- package/resources/customers/balance-transactions.d.mts.map +1 -0
- package/resources/customers/balance-transactions.d.ts +8 -9
- package/resources/customers/balance-transactions.d.ts.map +1 -1
- package/resources/customers/balance-transactions.js +29 -13
- package/resources/customers/balance-transactions.js.map +1 -1
- package/resources/customers/balance-transactions.mjs +28 -11
- package/resources/customers/balance-transactions.mjs.map +1 -1
- package/resources/customers/costs.d.mts +314 -0
- package/resources/customers/costs.d.mts.map +1 -0
- package/resources/customers/costs.d.ts +5 -6
- package/resources/customers/costs.d.ts.map +1 -1
- package/resources/customers/costs.js +243 -11
- package/resources/customers/costs.js.map +1 -1
- package/resources/customers/costs.mjs +243 -11
- package/resources/customers/costs.mjs.map +1 -1
- package/resources/customers/credits/credits.d.mts +287 -0
- package/resources/customers/credits/credits.d.mts.map +1 -0
- package/resources/customers/credits/credits.d.ts +55 -19
- package/resources/customers/credits/credits.d.ts.map +1 -1
- package/resources/customers/credits/credits.js +38 -50
- package/resources/customers/credits/credits.js.map +1 -1
- package/resources/customers/credits/credits.mjs +36 -24
- package/resources/customers/credits/credits.mjs.map +1 -1
- package/resources/customers/credits/index.d.mts +4 -0
- package/resources/customers/credits/index.d.mts.map +1 -0
- package/resources/customers/credits/index.d.ts +3 -3
- package/resources/customers/credits/index.d.ts.map +1 -1
- package/resources/customers/credits/index.js +1 -7
- package/resources/customers/credits/index.js.map +1 -1
- package/resources/customers/credits/index.mjs +3 -3
- package/resources/customers/credits/index.mjs.map +1 -1
- package/resources/customers/credits/ledger.d.mts +1202 -0
- package/resources/customers/credits/ledger.d.mts.map +1 -0
- package/resources/customers/credits/ledger.d.ts +11 -14
- package/resources/customers/credits/ledger.d.ts.map +1 -1
- package/resources/customers/credits/ledger.js +172 -27
- package/resources/customers/credits/ledger.js.map +1 -1
- package/resources/customers/credits/ledger.mjs +171 -24
- package/resources/customers/credits/ledger.mjs.map +1 -1
- package/resources/customers/credits/top-ups.d.mts +357 -0
- package/resources/customers/credits/top-ups.d.mts.map +1 -0
- package/resources/customers/credits/top-ups.d.ts +19 -16
- package/resources/customers/credits/top-ups.d.ts.map +1 -1
- package/resources/customers/credits/top-ups.js +24 -29
- package/resources/customers/credits/top-ups.js.map +1 -1
- package/resources/customers/credits/top-ups.mjs +23 -26
- package/resources/customers/credits/top-ups.mjs.map +1 -1
- package/resources/customers/credits.d.mts +2 -0
- package/resources/customers/credits.d.mts.map +1 -0
- package/resources/customers/credits.d.ts.map +1 -1
- package/resources/customers/credits.js +2 -15
- package/resources/customers/credits.js.map +1 -1
- package/resources/customers/credits.mjs.map +1 -1
- package/resources/customers/customers.d.mts +1453 -0
- package/resources/customers/customers.d.mts.map +1 -0
- package/resources/customers/customers.d.ts +17 -18
- package/resources/customers/customers.d.ts.map +1 -1
- package/resources/customers/customers.js +30 -53
- package/resources/customers/customers.js.map +1 -1
- package/resources/customers/customers.mjs +27 -27
- package/resources/customers/customers.mjs.map +1 -1
- package/resources/customers/index.d.mts +5 -0
- package/resources/customers/index.d.mts.map +1 -0
- package/resources/customers/index.d.ts +3 -3
- package/resources/customers/index.d.ts.map +1 -1
- package/resources/customers/index.js +1 -5
- package/resources/customers/index.js.map +1 -1
- package/resources/customers/index.mjs +3 -3
- package/resources/customers/index.mjs.map +1 -1
- package/resources/customers.d.mts +2 -0
- package/resources/customers.d.mts.map +1 -0
- package/resources/customers.d.ts.map +1 -1
- package/resources/customers.js +2 -15
- package/resources/customers.js.map +1 -1
- package/resources/customers.mjs.map +1 -1
- package/resources/dimensional-price-groups/dimensional-price-groups.d.mts +150 -0
- package/resources/dimensional-price-groups/dimensional-price-groups.d.mts.map +1 -0
- package/resources/dimensional-price-groups/dimensional-price-groups.d.ts +11 -12
- package/resources/dimensional-price-groups/dimensional-price-groups.d.ts.map +1 -1
- package/resources/dimensional-price-groups/dimensional-price-groups.js +21 -39
- package/resources/dimensional-price-groups/dimensional-price-groups.js.map +1 -1
- package/resources/dimensional-price-groups/dimensional-price-groups.mjs +18 -13
- package/resources/dimensional-price-groups/dimensional-price-groups.mjs.map +1 -1
- package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.mts +53 -0
- package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.mts.map +1 -0
- package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.ts +7 -6
- package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.ts.map +1 -1
- package/resources/dimensional-price-groups/external-dimensional-price-group-id.js +6 -5
- package/resources/dimensional-price-groups/external-dimensional-price-group-id.js.map +1 -1
- package/resources/dimensional-price-groups/external-dimensional-price-group-id.mjs +6 -5
- package/resources/dimensional-price-groups/external-dimensional-price-group-id.mjs.map +1 -1
- package/resources/dimensional-price-groups/index.d.mts +3 -0
- package/resources/dimensional-price-groups/index.d.mts.map +1 -0
- package/resources/dimensional-price-groups/index.d.ts +1 -1
- package/resources/dimensional-price-groups/index.d.ts.map +1 -1
- package/resources/dimensional-price-groups/index.js +1 -2
- package/resources/dimensional-price-groups/index.js.map +1 -1
- package/resources/dimensional-price-groups/index.mjs +1 -1
- package/resources/dimensional-price-groups/index.mjs.map +1 -1
- package/resources/dimensional-price-groups.d.mts +2 -0
- package/resources/dimensional-price-groups.d.mts.map +1 -0
- package/resources/dimensional-price-groups.d.ts.map +1 -1
- package/resources/dimensional-price-groups.js +2 -15
- package/resources/dimensional-price-groups.js.map +1 -1
- package/resources/dimensional-price-groups.mjs.map +1 -1
- package/resources/events/backfills.d.mts +389 -0
- package/resources/events/backfills.d.mts.map +1 -0
- package/resources/events/backfills.d.ts +11 -12
- package/resources/events/backfills.d.ts.map +1 -1
- package/resources/events/backfills.js +24 -15
- package/resources/events/backfills.js.map +1 -1
- package/resources/events/backfills.mjs +23 -13
- package/resources/events/backfills.mjs.map +1 -1
- package/resources/events/events.d.mts +536 -0
- package/resources/events/events.d.mts.map +1 -0
- package/resources/events/events.d.ts +10 -11
- package/resources/events/events.d.ts.map +1 -1
- package/resources/events/events.js +7 -29
- package/resources/events/events.js.map +1 -1
- package/resources/events/events.mjs +5 -5
- package/resources/events/events.mjs.map +1 -1
- package/resources/events/index.d.mts +4 -0
- package/resources/events/index.d.mts.map +1 -0
- package/resources/events/index.d.ts +1 -1
- package/resources/events/index.d.ts.map +1 -1
- package/resources/events/index.js +1 -2
- package/resources/events/index.js.map +1 -1
- package/resources/events/index.mjs +1 -1
- package/resources/events/index.mjs.map +1 -1
- package/resources/events/volume.d.mts +79 -0
- package/resources/events/volume.d.mts.map +1 -0
- package/resources/events/volume.d.ts +4 -3
- package/resources/events/volume.d.ts.map +1 -1
- package/resources/events/volume.js +1 -1
- package/resources/events/volume.js.map +1 -1
- package/resources/events/volume.mjs +1 -1
- package/resources/events/volume.mjs.map +1 -1
- package/resources/events.d.mts +2 -0
- package/resources/events.d.mts.map +1 -0
- package/resources/events.d.ts.map +1 -1
- package/resources/events.js +2 -15
- package/resources/events.js.map +1 -1
- package/resources/events.mjs.map +1 -1
- package/resources/index.d.mts +22 -0
- package/resources/index.d.mts.map +1 -0
- package/resources/index.d.ts +13 -13
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +7 -33
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +12 -12
- package/resources/index.mjs.map +1 -1
- package/resources/invoice-line-items.d.mts +245 -0
- package/resources/invoice-line-items.d.mts.map +1 -0
- package/resources/invoice-line-items.d.ts +4 -3
- package/resources/invoice-line-items.d.ts.map +1 -1
- package/resources/invoice-line-items.js +1 -1
- package/resources/invoice-line-items.js.map +1 -1
- package/resources/invoice-line-items.mjs +1 -1
- package/resources/invoice-line-items.mjs.map +1 -1
- package/resources/invoices.d.mts +1795 -0
- package/resources/invoices.d.mts.map +1 -0
- package/resources/invoices.d.ts +25 -27
- package/resources/invoices.d.ts.map +1 -1
- package/resources/invoices.js +105 -38
- package/resources/invoices.js.map +1 -1
- package/resources/invoices.mjs +104 -36
- package/resources/invoices.mjs.map +1 -1
- package/resources/items.d.mts +163 -0
- package/resources/items.d.mts.map +1 -0
- package/resources/items.d.ts +11 -12
- package/resources/items.d.ts.map +1 -1
- package/resources/items.js +20 -15
- package/resources/items.js.map +1 -1
- package/resources/items.mjs +19 -13
- package/resources/items.mjs.map +1 -1
- package/resources/license-types.d.mts +112 -0
- package/resources/license-types.d.mts.map +1 -0
- package/resources/license-types.d.ts +9 -10
- package/resources/license-types.d.ts.map +1 -1
- package/resources/license-types.js +14 -13
- package/resources/license-types.js.map +1 -1
- package/resources/license-types.mjs +13 -11
- package/resources/license-types.mjs.map +1 -1
- package/resources/licenses/external-licenses.d.mts +127 -0
- package/resources/licenses/external-licenses.d.mts.map +1 -0
- package/resources/licenses/external-licenses.d.ts +4 -3
- package/resources/licenses/external-licenses.d.ts.map +1 -1
- package/resources/licenses/external-licenses.js +6 -2
- package/resources/licenses/external-licenses.js.map +1 -1
- package/resources/licenses/external-licenses.mjs +6 -2
- package/resources/licenses/external-licenses.mjs.map +1 -1
- package/resources/licenses/index.d.mts +4 -0
- package/resources/licenses/index.d.mts.map +1 -0
- package/resources/licenses/index.d.ts +1 -1
- package/resources/licenses/index.d.ts.map +1 -1
- package/resources/licenses/index.js +1 -2
- package/resources/licenses/index.js.map +1 -1
- package/resources/licenses/index.mjs +1 -1
- package/resources/licenses/index.mjs.map +1 -1
- package/resources/licenses/licenses.d.mts +177 -0
- package/resources/licenses/licenses.d.mts.map +1 -0
- package/resources/licenses/licenses.d.ts +12 -12
- package/resources/licenses/licenses.d.ts.map +1 -1
- package/resources/licenses/licenses.js +13 -38
- package/resources/licenses/licenses.js.map +1 -1
- package/resources/licenses/licenses.mjs +9 -11
- package/resources/licenses/licenses.mjs.map +1 -1
- package/resources/licenses/usage.d.mts +226 -0
- package/resources/licenses/usage.d.mts.map +1 -0
- package/resources/licenses/usage.d.ts +5 -5
- package/resources/licenses/usage.d.ts.map +1 -1
- package/resources/licenses/usage.js +15 -6
- package/resources/licenses/usage.js.map +1 -1
- package/resources/licenses/usage.mjs +15 -6
- package/resources/licenses/usage.mjs.map +1 -1
- package/resources/licenses.d.mts +2 -0
- package/resources/licenses.d.mts.map +1 -0
- package/resources/licenses.d.ts.map +1 -1
- package/resources/licenses.js +2 -15
- package/resources/licenses.js.map +1 -1
- package/resources/licenses.mjs.map +1 -1
- package/resources/metrics.d.mts +147 -0
- package/resources/metrics.d.mts.map +1 -0
- package/resources/metrics.d.ts +15 -11
- package/resources/metrics.d.ts.map +1 -1
- package/resources/metrics.js +19 -14
- package/resources/metrics.js.map +1 -1
- package/resources/metrics.mjs +18 -12
- package/resources/metrics.mjs.map +1 -1
- package/resources/plans/external-plan-id.d.mts +61 -0
- package/resources/plans/external-plan-id.d.mts.map +1 -0
- package/resources/plans/external-plan-id.d.ts +5 -4
- package/resources/plans/external-plan-id.d.ts.map +1 -1
- package/resources/plans/external-plan-id.js +4 -3
- package/resources/plans/external-plan-id.js.map +1 -1
- package/resources/plans/external-plan-id.mjs +4 -3
- package/resources/plans/external-plan-id.mjs.map +1 -1
- package/resources/plans/index.d.mts +4 -0
- package/resources/plans/index.d.mts.map +1 -0
- package/resources/plans/index.d.ts +2 -2
- package/resources/plans/index.d.ts.map +1 -1
- package/resources/plans/index.js +1 -3
- package/resources/plans/index.js.map +1 -1
- package/resources/plans/index.mjs +2 -2
- package/resources/plans/index.mjs.map +1 -1
- package/resources/plans/migrations.d.mts +99 -0
- package/resources/plans/migrations.d.mts.map +1 -0
- package/resources/plans/migrations.d.ts +15 -10
- package/resources/plans/migrations.d.ts.map +1 -1
- package/resources/plans/migrations.js +17 -16
- package/resources/plans/migrations.js.map +1 -1
- package/resources/plans/migrations.mjs +16 -14
- package/resources/plans/migrations.mjs.map +1 -1
- package/resources/plans/plans.d.mts +1682 -0
- package/resources/plans/plans.d.mts.map +1 -0
- package/resources/plans/plans.d.ts +13 -14
- package/resources/plans/plans.d.ts.map +1 -1
- package/resources/plans/plans.js +18 -41
- package/resources/plans/plans.js.map +1 -1
- package/resources/plans/plans.mjs +15 -15
- package/resources/plans/plans.mjs.map +1 -1
- package/resources/plans.d.mts +2 -0
- package/resources/plans.d.mts.map +1 -0
- package/resources/plans.d.ts.map +1 -1
- package/resources/plans.js +2 -15
- package/resources/plans.js.map +1 -1
- package/resources/plans.mjs.map +1 -1
- package/resources/prices/external-price-id.d.mts +55 -0
- package/resources/prices/external-price-id.d.mts.map +1 -0
- package/resources/prices/external-price-id.d.ts +7 -6
- package/resources/prices/external-price-id.d.ts.map +1 -1
- package/resources/prices/external-price-id.js +6 -5
- package/resources/prices/external-price-id.js.map +1 -1
- package/resources/prices/external-price-id.mjs +6 -5
- package/resources/prices/external-price-id.mjs.map +1 -1
- package/resources/prices/index.d.mts +3 -0
- package/resources/prices/index.d.mts.map +1 -0
- package/resources/prices/index.d.ts.map +1 -1
- package/resources/prices/index.mjs.map +1 -1
- package/resources/prices/prices.d.mts +5950 -0
- package/resources/prices/prices.d.mts.map +1 -0
- package/resources/prices/prices.d.ts +13 -13
- package/resources/prices/prices.d.ts.map +1 -1
- package/resources/prices/prices.js +23 -37
- package/resources/prices/prices.js.map +1 -1
- package/resources/prices/prices.mjs +20 -12
- package/resources/prices/prices.mjs.map +1 -1
- package/resources/prices.d.mts +2 -0
- package/resources/prices.d.mts.map +1 -0
- package/resources/prices.d.ts.map +1 -1
- package/resources/prices.js +2 -15
- package/resources/prices.js.map +1 -1
- package/resources/prices.mjs.map +1 -1
- package/resources/shared.d.mts +13354 -0
- package/resources/shared.d.mts.map +1 -0
- package/resources/shared.d.ts +4 -7
- package/resources/shared.d.ts.map +1 -1
- package/resources/shared.js +0 -11
- package/resources/shared.js.map +1 -1
- package/resources/shared.mjs +1 -7
- package/resources/shared.mjs.map +1 -1
- package/resources/subscription-changes.d.mts +434 -0
- package/resources/subscription-changes.d.mts.map +1 -0
- package/resources/subscription-changes.d.ts +10 -12
- package/resources/subscription-changes.d.ts.map +1 -1
- package/resources/subscription-changes.js +18 -18
- package/resources/subscription-changes.js.map +1 -1
- package/resources/subscription-changes.mjs +17 -16
- package/resources/subscription-changes.mjs.map +1 -1
- package/resources/subscriptions.d.mts +10821 -0
- package/resources/subscriptions.d.mts.map +1 -0
- package/resources/subscriptions.d.ts +24 -29
- package/resources/subscriptions.d.ts.map +1 -1
- package/resources/subscriptions.js +284 -40
- package/resources/subscriptions.js.map +1 -1
- package/resources/subscriptions.mjs +283 -37
- package/resources/subscriptions.mjs.map +1 -1
- package/resources/top-level.d.mts +21 -0
- package/resources/top-level.d.mts.map +1 -0
- package/resources/top-level.d.ts +4 -3
- package/resources/top-level.d.ts.map +1 -1
- package/resources/top-level.js +1 -1
- package/resources/top-level.js.map +1 -1
- package/resources/top-level.mjs +1 -1
- package/resources/top-level.mjs.map +1 -1
- package/resources/webhooks.d.mts +24 -0
- package/resources/webhooks.d.mts.map +1 -0
- package/resources/webhooks.d.ts +2 -2
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js +18 -5
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs +16 -3
- package/resources/webhooks.mjs.map +1 -1
- package/resources.d.mts +2 -0
- package/resources.d.mts.map +1 -0
- package/resources.d.ts.map +1 -1
- package/resources.js +2 -15
- package/resources.js.map +1 -1
- package/resources.mjs.map +1 -1
- package/src/api-promise.ts +2 -0
- package/src/client.ts +1499 -0
- package/src/core/README.md +3 -0
- package/src/core/api-promise.ts +92 -0
- package/src/core/error.ts +456 -0
- package/src/core/pagination.ts +167 -0
- package/src/core/resource.ts +11 -0
- package/src/core/uploads.ts +2 -0
- package/src/error.ts +2 -456
- package/src/index.ts +6 -923
- package/src/internal/README.md +3 -0
- package/src/internal/builtin-types.ts +93 -0
- package/src/internal/detect-platform.ts +196 -0
- package/src/internal/errors.ts +33 -0
- package/src/internal/headers.ts +97 -0
- package/src/internal/parse.ts +56 -0
- package/src/internal/qs/formats.ts +2 -1
- package/src/internal/qs/stringify.ts +17 -20
- package/src/internal/qs/utils.ts +14 -14
- package/src/internal/request-options.ts +91 -0
- package/src/internal/shim-types.ts +26 -0
- package/src/internal/shims.ts +107 -0
- package/src/internal/to-file.ts +154 -0
- package/src/internal/types.ts +93 -0
- package/src/internal/uploads.ts +187 -0
- package/src/internal/utils/base64.ts +40 -0
- package/src/internal/utils/bytes.ts +32 -0
- package/src/internal/utils/env.ts +18 -0
- package/src/internal/utils/log.ts +128 -0
- package/src/internal/utils/path.ts +88 -0
- package/src/internal/utils/sleep.ts +3 -0
- package/src/internal/utils/uuid.ts +17 -0
- package/src/internal/utils/values.ts +105 -0
- package/src/internal/utils.ts +9 -0
- package/src/pagination.ts +2 -70
- package/src/resource.ts +2 -11
- package/src/resources/alerts.ts +34 -62
- package/src/resources/beta/beta.ts +23 -13
- package/src/resources/beta/external-plan-id.ts +20 -12
- package/src/resources/beta/index.ts +2 -0
- package/src/resources/coupons/coupons.ts +16 -21
- package/src/resources/coupons/index.ts +7 -1
- package/src/resources/coupons/subscriptions.ts +13 -24
- package/src/resources/credit-blocks.ts +62 -16
- package/src/resources/credit-notes.ts +13 -20
- package/src/resources/customers/balance-transactions.ts +15 -28
- package/src/resources/customers/costs.ts +13 -33
- package/src/resources/customers/credits/credits.ts +76 -56
- package/src/resources/customers/credits/index.ts +8 -6
- package/src/resources/customers/credits/ledger.ts +29 -55
- package/src/resources/customers/credits/top-ups.ts +48 -61
- package/src/resources/customers/customers.ts +37 -48
- package/src/resources/customers/index.ts +4 -4
- package/src/resources/dimensional-price-groups/dimensional-price-groups.ts +19 -30
- package/src/resources/dimensional-price-groups/external-dimensional-price-group-id.ts +12 -10
- package/src/resources/dimensional-price-groups/index.ts +1 -1
- package/src/resources/events/backfills.ts +18 -27
- package/src/resources/events/events.ts +14 -15
- package/src/resources/events/index.ts +1 -1
- package/src/resources/events/volume.ts +4 -3
- package/src/resources/index.ts +29 -28
- package/src/resources/invoice-line-items.ts +5 -4
- package/src/resources/invoices.ts +53 -95
- package/src/resources/items.ts +18 -24
- package/src/resources/license-types.ts +14 -31
- package/src/resources/licenses/external-licenses.ts +10 -5
- package/src/resources/licenses/index.ts +1 -1
- package/src/resources/licenses/licenses.ts +21 -20
- package/src/resources/licenses/usage.ts +9 -20
- package/src/resources/metrics.ts +22 -29
- package/src/resources/plans/external-plan-id.ts +9 -7
- package/src/resources/plans/index.ts +4 -2
- package/src/resources/plans/migrations.ts +30 -31
- package/src/resources/plans/plans.ts +22 -24
- package/src/resources/prices/external-price-id.ts +11 -9
- package/src/resources/prices/prices.ts +23 -31
- package/src/resources/shared.ts +4 -4
- package/src/resources/subscription-changes.ts +21 -44
- package/src/resources/subscriptions.ts +66 -106
- package/src/resources/top-level.ts +4 -3
- package/src/resources/webhooks.ts +17 -3
- package/src/tsconfig.json +2 -2
- package/src/uploads.ts +2 -255
- package/src/version.ts +1 -1
- package/uploads.d.mts +3 -0
- package/uploads.d.mts.map +1 -0
- package/uploads.d.ts +2 -74
- package/uploads.d.ts.map +1 -1
- package/uploads.js +3 -168
- package/uploads.js.map +1 -1
- package/uploads.mjs +2 -157
- package/uploads.mjs.map +1 -1
- package/version.d.mts +2 -0
- package/version.d.mts.map +1 -0
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
- package/_shims/MultipartBody.d.ts +0 -9
- package/_shims/MultipartBody.d.ts.map +0 -1
- package/_shims/MultipartBody.js +0 -16
- package/_shims/MultipartBody.js.map +0 -1
- package/_shims/MultipartBody.mjs +0 -12
- package/_shims/MultipartBody.mjs.map +0 -1
- package/_shims/README.md +0 -46
- package/_shims/auto/runtime-bun.d.ts +0 -5
- package/_shims/auto/runtime-bun.d.ts.map +0 -1
- package/_shims/auto/runtime-bun.js +0 -21
- package/_shims/auto/runtime-bun.js.map +0 -1
- package/_shims/auto/runtime-bun.mjs +0 -2
- package/_shims/auto/runtime-bun.mjs.map +0 -1
- package/_shims/auto/runtime-node.d.ts +0 -5
- package/_shims/auto/runtime-node.d.ts.map +0 -1
- package/_shims/auto/runtime-node.js +0 -21
- package/_shims/auto/runtime-node.js.map +0 -1
- package/_shims/auto/runtime-node.mjs +0 -2
- package/_shims/auto/runtime-node.mjs.map +0 -1
- package/_shims/auto/runtime.d.ts +0 -5
- package/_shims/auto/runtime.d.ts.map +0 -1
- package/_shims/auto/runtime.js +0 -21
- package/_shims/auto/runtime.js.map +0 -1
- package/_shims/auto/runtime.mjs +0 -2
- package/_shims/auto/runtime.mjs.map +0 -1
- package/_shims/auto/types-node.d.ts +0 -5
- package/_shims/auto/types-node.d.ts.map +0 -1
- package/_shims/auto/types-node.js +0 -21
- package/_shims/auto/types-node.js.map +0 -1
- package/_shims/auto/types-node.mjs +0 -2
- package/_shims/auto/types-node.mjs.map +0 -1
- package/_shims/auto/types.d.ts +0 -101
- package/_shims/auto/types.js +0 -3
- package/_shims/auto/types.mjs +0 -3
- package/_shims/bun-runtime.d.ts +0 -6
- package/_shims/bun-runtime.d.ts.map +0 -1
- package/_shims/bun-runtime.js +0 -14
- package/_shims/bun-runtime.js.map +0 -1
- package/_shims/bun-runtime.mjs +0 -10
- package/_shims/bun-runtime.mjs.map +0 -1
- package/_shims/index.d.ts +0 -83
- package/_shims/index.js +0 -17
- package/_shims/index.mjs +0 -11
- package/_shims/manual-types.d.ts +0 -12
- package/_shims/manual-types.js +0 -3
- package/_shims/manual-types.mjs +0 -3
- package/_shims/node-runtime.d.ts +0 -3
- package/_shims/node-runtime.d.ts.map +0 -1
- package/_shims/node-runtime.js +0 -89
- package/_shims/node-runtime.js.map +0 -1
- package/_shims/node-runtime.mjs +0 -56
- package/_shims/node-runtime.mjs.map +0 -1
- package/_shims/node-types.d.ts +0 -42
- package/_shims/node-types.js +0 -3
- package/_shims/node-types.mjs +0 -3
- package/_shims/registry.d.ts +0 -37
- package/_shims/registry.d.ts.map +0 -1
- package/_shims/registry.js +0 -41
- package/_shims/registry.js.map +0 -1
- package/_shims/registry.mjs +0 -37
- package/_shims/registry.mjs.map +0 -1
- package/_shims/web-runtime.d.ts +0 -5
- package/_shims/web-runtime.d.ts.map +0 -1
- package/_shims/web-runtime.js +0 -78
- package/_shims/web-runtime.js.map +0 -1
- package/_shims/web-runtime.mjs +0 -71
- package/_shims/web-runtime.mjs.map +0 -1
- package/_shims/web-types.d.ts +0 -83
- package/_shims/web-types.js +0 -3
- package/_shims/web-types.mjs +0 -3
- package/core.d.ts +0 -255
- package/core.d.ts.map +0 -1
- package/core.js +0 -920
- package/core.js.map +0 -1
- package/core.mjs +0 -888
- package/core.mjs.map +0 -1
- package/shims/node.d.ts +0 -30
- package/shims/node.d.ts.map +0 -1
- package/shims/node.js +0 -31
- package/shims/node.js.map +0 -1
- package/shims/node.mjs +0 -5
- package/shims/node.mjs.map +0 -1
- package/shims/web.d.ts +0 -26
- package/shims/web.d.ts.map +0 -1
- package/shims/web.js +0 -31
- package/shims/web.js.map +0 -1
- package/shims/web.mjs +0 -5
- package/shims/web.mjs.map +0 -1
- package/src/_shims/MultipartBody.ts +0 -9
- package/src/_shims/README.md +0 -46
- package/src/_shims/auto/runtime-bun.ts +0 -4
- package/src/_shims/auto/runtime-node.ts +0 -4
- package/src/_shims/auto/runtime.ts +0 -4
- package/src/_shims/auto/types-node.ts +0 -4
- package/src/_shims/auto/types.d.ts +0 -101
- package/src/_shims/auto/types.js +0 -3
- package/src/_shims/auto/types.mjs +0 -3
- package/src/_shims/bun-runtime.ts +0 -14
- package/src/_shims/index.d.ts +0 -83
- package/src/_shims/index.js +0 -17
- package/src/_shims/index.mjs +0 -11
- package/src/_shims/manual-types.d.ts +0 -12
- package/src/_shims/manual-types.js +0 -3
- package/src/_shims/manual-types.mjs +0 -3
- package/src/_shims/node-runtime.ts +0 -81
- package/src/_shims/node-types.d.ts +0 -42
- package/src/_shims/node-types.js +0 -3
- package/src/_shims/node-types.mjs +0 -3
- package/src/_shims/registry.ts +0 -67
- package/src/_shims/web-runtime.ts +0 -103
- package/src/_shims/web-types.d.ts +0 -83
- package/src/_shims/web-types.js +0 -3
- package/src/_shims/web-types.mjs +0 -3
- package/src/core.ts +0 -1231
- package/src/shims/node.ts +0 -50
- package/src/shims/web.ts +0 -50
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.mjs";
|
|
2
|
+
import * as Shared from "./shared.mjs";
|
|
3
|
+
import { CreditNotesPage } from "./shared.mjs";
|
|
4
|
+
import { APIPromise } from "../core/api-promise.mjs";
|
|
5
|
+
import { type PageParams, PagePromise } from "../core/pagination.mjs";
|
|
6
|
+
import { RequestOptions } from "../internal/request-options.mjs";
|
|
7
|
+
/**
|
|
8
|
+
* The [Credit Note](/invoicing/credit-notes) resource represents a credit that has been applied to a
|
|
9
|
+
* particular invoice.
|
|
10
|
+
*/
|
|
11
|
+
export declare class CreditNotes extends APIResource {
|
|
12
|
+
/**
|
|
13
|
+
* This endpoint is used to create a single
|
|
14
|
+
* [`Credit Note`](/invoicing/credit-notes).
|
|
15
|
+
*
|
|
16
|
+
* The credit note service period configuration supports two explicit modes:
|
|
17
|
+
*
|
|
18
|
+
* 1. Global service periods: Specify start_date and end_date at the credit note
|
|
19
|
+
* level. These dates will be applied to all line items uniformly.
|
|
20
|
+
*
|
|
21
|
+
* 2. Individual service periods: Specify start_date and end_date for each line
|
|
22
|
+
* item. When using this mode, ALL line items must have individual periods
|
|
23
|
+
* specified.
|
|
24
|
+
*
|
|
25
|
+
* 3. Default behavior: If no service periods are specified (neither global nor
|
|
26
|
+
* individual), the original invoice line item service periods will be used.
|
|
27
|
+
*
|
|
28
|
+
* Note: Mixing global and individual service periods in the same request is not
|
|
29
|
+
* allowed to prevent confusion.
|
|
30
|
+
*
|
|
31
|
+
* Service period dates are normalized to the start of the day in the customer's
|
|
32
|
+
* timezone to ensure consistent handling across different timezones.
|
|
33
|
+
*
|
|
34
|
+
* Date Format: Use start_date and end_date with format "YYYY-MM-DD" (e.g.,
|
|
35
|
+
* "2023-09-22") to match other Orb APIs like /v1/invoice_line_items.
|
|
36
|
+
*
|
|
37
|
+
* Note: Both start_date and end_date are inclusive - the service period will cover
|
|
38
|
+
* both the start date and end date completely (from start of start_date to end of
|
|
39
|
+
* end_date).
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* const creditNote = await client.creditNotes.create({
|
|
44
|
+
* line_items: [
|
|
45
|
+
* {
|
|
46
|
+
* amount: 'amount',
|
|
47
|
+
* invoice_line_item_id: '4khy3nwzktxv7',
|
|
48
|
+
* },
|
|
49
|
+
* ],
|
|
50
|
+
* reason: 'duplicate',
|
|
51
|
+
* });
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
create(body: CreditNoteCreateParams, options?: RequestOptions): APIPromise<Shared.CreditNote>;
|
|
55
|
+
/**
|
|
56
|
+
* Get a paginated list of CreditNotes. Users can also filter by customer_id,
|
|
57
|
+
* subscription_id, or external_customer_id. The credit notes will be returned in
|
|
58
|
+
* reverse chronological order by `creation_time`.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* // Automatically fetches more pages as needed.
|
|
63
|
+
* for await (const creditNote of client.creditNotes.list()) {
|
|
64
|
+
* // ...
|
|
65
|
+
* }
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
list(query?: CreditNoteListParams | null | undefined, options?: RequestOptions): PagePromise<CreditNotesPage, Shared.CreditNote>;
|
|
69
|
+
/**
|
|
70
|
+
* This endpoint is used to fetch a single [`Credit Note`](/invoicing/credit-notes)
|
|
71
|
+
* given an identifier.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* const creditNote = await client.creditNotes.fetch(
|
|
76
|
+
* 'credit_note_id',
|
|
77
|
+
* );
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
fetch(creditNoteId: string, options?: RequestOptions): APIPromise<Shared.CreditNote>;
|
|
81
|
+
}
|
|
82
|
+
export interface CreditNoteCreateParams {
|
|
83
|
+
line_items: Array<CreditNoteCreateParams.LineItem>;
|
|
84
|
+
/**
|
|
85
|
+
* An optional reason for the credit note.
|
|
86
|
+
*/
|
|
87
|
+
reason: 'duplicate' | 'fraudulent' | 'order_change' | 'product_unsatisfactory';
|
|
88
|
+
/**
|
|
89
|
+
* A date string to specify the global credit note service period end date in the
|
|
90
|
+
* customer's timezone. This will be applied to all line items that don't have
|
|
91
|
+
* their own individual service periods specified. If not provided, line items will
|
|
92
|
+
* use their original invoice line item service periods. This date is inclusive.
|
|
93
|
+
*/
|
|
94
|
+
end_date?: string | null;
|
|
95
|
+
/**
|
|
96
|
+
* An optional memo to attach to the credit note.
|
|
97
|
+
*/
|
|
98
|
+
memo?: string | null;
|
|
99
|
+
/**
|
|
100
|
+
* A date string to specify the global credit note service period start date in the
|
|
101
|
+
* customer's timezone. This will be applied to all line items that don't have
|
|
102
|
+
* their own individual service periods specified. If not provided, line items will
|
|
103
|
+
* use their original invoice line item service periods. This date is inclusive.
|
|
104
|
+
*/
|
|
105
|
+
start_date?: string | null;
|
|
106
|
+
}
|
|
107
|
+
export declare namespace CreditNoteCreateParams {
|
|
108
|
+
interface LineItem {
|
|
109
|
+
/**
|
|
110
|
+
* The total amount in the invoice's currency to credit this line item.
|
|
111
|
+
*/
|
|
112
|
+
amount: string;
|
|
113
|
+
/**
|
|
114
|
+
* The ID of the line item to credit.
|
|
115
|
+
*/
|
|
116
|
+
invoice_line_item_id: string;
|
|
117
|
+
/**
|
|
118
|
+
* A date string to specify this line item's credit note service period end date in
|
|
119
|
+
* the customer's timezone. If provided, this will be used for this specific line
|
|
120
|
+
* item. If not provided, will use the global end_date if available, otherwise
|
|
121
|
+
* defaults to the original invoice line item's end date. This date is inclusive.
|
|
122
|
+
*/
|
|
123
|
+
end_date?: string | null;
|
|
124
|
+
/**
|
|
125
|
+
* A date string to specify this line item's credit note service period start date
|
|
126
|
+
* in the customer's timezone. If provided, this will be used for this specific
|
|
127
|
+
* line item. If not provided, will use the global start_date if available,
|
|
128
|
+
* otherwise defaults to the original invoice line item's start date. This date is
|
|
129
|
+
* inclusive.
|
|
130
|
+
*/
|
|
131
|
+
start_date?: string | null;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
export interface CreditNoteListParams extends PageParams {
|
|
135
|
+
'created_at[gt]'?: string | null;
|
|
136
|
+
'created_at[gte]'?: string | null;
|
|
137
|
+
'created_at[lt]'?: string | null;
|
|
138
|
+
'created_at[lte]'?: string | null;
|
|
139
|
+
}
|
|
140
|
+
export declare namespace CreditNotes {
|
|
141
|
+
export { type CreditNoteCreateParams as CreditNoteCreateParams, type CreditNoteListParams as CreditNoteListParams, };
|
|
142
|
+
}
|
|
143
|
+
export { type CreditNotesPage };
|
|
144
|
+
//# sourceMappingURL=credit-notes.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credit-notes.d.mts","sourceRoot":"","sources":["../src/resources/credit-notes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,KAAK,MAAM,qBAAiB;AACnC,OAAO,EAAE,eAAe,EAAE,qBAAiB;AAC3C,OAAO,EAAE,UAAU,EAAE,gCAA4B;AACjD,OAAO,EAAQ,KAAK,UAA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KAC5B;CACF;AAED,MAAM,WAAW,oBAAqB,SAAQ,UAAU;IACtD,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEjC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAElC,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEjC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH;AAED,OAAO,EAAE,KAAK,eAAe,EAAE,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { APIResource } from "../resource.js";
|
|
2
|
-
import * as Core from "../core.js";
|
|
1
|
+
import { APIResource } from "../core/resource.js";
|
|
3
2
|
import * as Shared from "./shared.js";
|
|
4
3
|
import { CreditNotesPage } from "./shared.js";
|
|
5
|
-
import {
|
|
4
|
+
import { APIPromise } from "../core/api-promise.js";
|
|
5
|
+
import { type PageParams, PagePromise } from "../core/pagination.js";
|
|
6
|
+
import { RequestOptions } from "../internal/request-options.js";
|
|
6
7
|
/**
|
|
7
8
|
* The [Credit Note](/invoicing/credit-notes) resource represents a credit that has been applied to a
|
|
8
9
|
* particular invoice.
|
|
@@ -50,7 +51,7 @@ export declare class CreditNotes extends APIResource {
|
|
|
50
51
|
* });
|
|
51
52
|
* ```
|
|
52
53
|
*/
|
|
53
|
-
create(body: CreditNoteCreateParams, options?:
|
|
54
|
+
create(body: CreditNoteCreateParams, options?: RequestOptions): APIPromise<Shared.CreditNote>;
|
|
54
55
|
/**
|
|
55
56
|
* Get a paginated list of CreditNotes. Users can also filter by customer_id,
|
|
56
57
|
* subscription_id, or external_customer_id. The credit notes will be returned in
|
|
@@ -64,8 +65,7 @@ export declare class CreditNotes extends APIResource {
|
|
|
64
65
|
* }
|
|
65
66
|
* ```
|
|
66
67
|
*/
|
|
67
|
-
list(query?: CreditNoteListParams, options?:
|
|
68
|
-
list(options?: Core.RequestOptions): Core.PagePromise<CreditNotesPage, Shared.CreditNote>;
|
|
68
|
+
list(query?: CreditNoteListParams | null | undefined, options?: RequestOptions): PagePromise<CreditNotesPage, Shared.CreditNote>;
|
|
69
69
|
/**
|
|
70
70
|
* This endpoint is used to fetch a single [`Credit Note`](/invoicing/credit-notes)
|
|
71
71
|
* given an identifier.
|
|
@@ -77,7 +77,7 @@ export declare class CreditNotes extends APIResource {
|
|
|
77
77
|
* );
|
|
78
78
|
* ```
|
|
79
79
|
*/
|
|
80
|
-
fetch(creditNoteId: string, options?:
|
|
80
|
+
fetch(creditNoteId: string, options?: RequestOptions): APIPromise<Shared.CreditNote>;
|
|
81
81
|
}
|
|
82
82
|
export interface CreditNoteCreateParams {
|
|
83
83
|
line_items: Array<CreditNoteCreateParams.LineItem>;
|
|
@@ -140,5 +140,5 @@ export interface CreditNoteListParams extends PageParams {
|
|
|
140
140
|
export declare namespace CreditNotes {
|
|
141
141
|
export { type CreditNoteCreateParams as CreditNoteCreateParams, type CreditNoteListParams as CreditNoteListParams, };
|
|
142
142
|
}
|
|
143
|
-
export { CreditNotesPage };
|
|
143
|
+
export { type CreditNotesPage };
|
|
144
144
|
//# sourceMappingURL=credit-notes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credit-notes.d.ts","sourceRoot":"","sources":["../src/resources/credit-notes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"credit-notes.d.ts","sourceRoot":"","sources":["../src/resources/credit-notes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,KAAK,MAAM,oBAAiB;AACnC,OAAO,EAAE,eAAe,EAAE,oBAAiB;AAC3C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAQ,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AI,CAAC;KAC5B;CACF;AAED,MAAM,WAAW,oBAAqB,SAAQ,UAAU;IACtD,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEjC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAElC,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEjC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH;AAED,OAAO,EAAE,KAAK,eAAe,EAAE,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
5
|
-
const resource_1 = require("../resource.js");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
Object.defineProperty(exports, "CreditNotesPage", { enumerable: true, get: function () { return shared_1.CreditNotesPage; } });
|
|
4
|
+
exports.CreditNotes = void 0;
|
|
5
|
+
const resource_1 = require("../core/resource.js");
|
|
6
|
+
const pagination_1 = require("../core/pagination.js");
|
|
7
|
+
const path_1 = require("../internal/utils/path.js");
|
|
9
8
|
/**
|
|
10
9
|
* The [Credit Note](/invoicing/credit-notes) resource represents a credit that has been applied to a
|
|
11
10
|
* particular invoice.
|
|
@@ -56,11 +55,21 @@ class CreditNotes extends resource_1.APIResource {
|
|
|
56
55
|
create(body, options) {
|
|
57
56
|
return this._client.post('/credit_notes', { body, ...options });
|
|
58
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Get a paginated list of CreditNotes. Users can also filter by customer_id,
|
|
60
|
+
* subscription_id, or external_customer_id. The credit notes will be returned in
|
|
61
|
+
* reverse chronological order by `creation_time`.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```ts
|
|
65
|
+
* // Automatically fetches more pages as needed.
|
|
66
|
+
* for await (const creditNote of client.creditNotes.list()) {
|
|
67
|
+
* // ...
|
|
68
|
+
* }
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
59
71
|
list(query = {}, options) {
|
|
60
|
-
|
|
61
|
-
return this.list({}, query);
|
|
62
|
-
}
|
|
63
|
-
return this._client.getAPIList('/credit_notes', shared_1.CreditNotesPage, { query, ...options });
|
|
72
|
+
return this._client.getAPIList('/credit_notes', (pagination_1.Page), { query, ...options });
|
|
64
73
|
}
|
|
65
74
|
/**
|
|
66
75
|
* This endpoint is used to fetch a single [`Credit Note`](/invoicing/credit-notes)
|
|
@@ -74,7 +83,7 @@ class CreditNotes extends resource_1.APIResource {
|
|
|
74
83
|
* ```
|
|
75
84
|
*/
|
|
76
85
|
fetch(creditNoteId, options) {
|
|
77
|
-
return this._client.get(`/credit_notes/${creditNoteId}`, options);
|
|
86
|
+
return this._client.get((0, path_1.path) `/credit_notes/${creditNoteId}`, options);
|
|
78
87
|
}
|
|
79
88
|
}
|
|
80
89
|
exports.CreditNotes = CreditNotes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credit-notes.js","sourceRoot":"","sources":["../src/resources/credit-notes.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,
|
|
1
|
+
{"version":3,"file":"credit-notes.js","sourceRoot":"","sources":["../src/resources/credit-notes.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,sDAAwE;AAExE,oDAA8C;AAE9C;;;GAGG;AACH,MAAa,WAAY,SAAQ,sBAAW;IAC1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyCG;IACH,MAAM,CAAC,IAA4B,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,QAAiD,EAAE,EACnD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,eAAe,EAAE,CAAA,iBAAuB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClG,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,YAAoB,EAAE,OAAwB;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,iBAAiB,YAAY,EAAE,EAAE,OAAO,CAAC,CAAC;IACxE,CAAC;CACF;AAjFD,kCAiFC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
import { APIResource } from "../resource.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { APIResource } from "../core/resource.mjs";
|
|
3
|
+
import { Page } from "../core/pagination.mjs";
|
|
4
|
+
import { path } from "../internal/utils/path.mjs";
|
|
5
5
|
/**
|
|
6
6
|
* The [Credit Note](/invoicing/credit-notes) resource represents a credit that has been applied to a
|
|
7
7
|
* particular invoice.
|
|
@@ -52,11 +52,21 @@ export class CreditNotes extends APIResource {
|
|
|
52
52
|
create(body, options) {
|
|
53
53
|
return this._client.post('/credit_notes', { body, ...options });
|
|
54
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* Get a paginated list of CreditNotes. Users can also filter by customer_id,
|
|
57
|
+
* subscription_id, or external_customer_id. The credit notes will be returned in
|
|
58
|
+
* reverse chronological order by `creation_time`.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* // Automatically fetches more pages as needed.
|
|
63
|
+
* for await (const creditNote of client.creditNotes.list()) {
|
|
64
|
+
* // ...
|
|
65
|
+
* }
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
55
68
|
list(query = {}, options) {
|
|
56
|
-
|
|
57
|
-
return this.list({}, query);
|
|
58
|
-
}
|
|
59
|
-
return this._client.getAPIList('/credit_notes', CreditNotesPage, { query, ...options });
|
|
69
|
+
return this._client.getAPIList('/credit_notes', (Page), { query, ...options });
|
|
60
70
|
}
|
|
61
71
|
/**
|
|
62
72
|
* This endpoint is used to fetch a single [`Credit Note`](/invoicing/credit-notes)
|
|
@@ -70,8 +80,7 @@ export class CreditNotes extends APIResource {
|
|
|
70
80
|
* ```
|
|
71
81
|
*/
|
|
72
82
|
fetch(creditNoteId, options) {
|
|
73
|
-
return this._client.get(`/credit_notes/${creditNoteId}`, options);
|
|
83
|
+
return this._client.get(path `/credit_notes/${creditNoteId}`, options);
|
|
74
84
|
}
|
|
75
85
|
}
|
|
76
|
-
export { CreditNotesPage };
|
|
77
86
|
//# sourceMappingURL=credit-notes.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credit-notes.mjs","sourceRoot":"","sources":["../src/resources/credit-notes.ts"],"names":[],"mappings":"AAAA,sFAAsF;
|
|
1
|
+
{"version":3,"file":"credit-notes.mjs","sourceRoot":"","sources":["../src/resources/credit-notes.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAI/C,OAAO,EAAE,IAAI,EAAgC,+BAA2B;AAExE,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C;;;GAGG;AACH,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyCG;IACH,MAAM,CAAC,IAA4B,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,QAAiD,EAAE,EACnD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,eAAe,EAAE,CAAA,IAAuB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClG,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,YAAoB,EAAE,OAAwB;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,iBAAiB,YAAY,EAAE,EAAE,OAAO,CAAC,CAAC;IACxE,CAAC;CACF"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
2
|
+
import * as Shared from "../shared.mjs";
|
|
3
|
+
import { APIPromise } from "../../core/api-promise.mjs";
|
|
4
|
+
import { Page, type PageParams, PagePromise } from "../../core/pagination.mjs";
|
|
5
|
+
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
6
|
+
/**
|
|
7
|
+
* A customer is a buyer of your products, and the other party to the billing relationship.
|
|
8
|
+
*
|
|
9
|
+
* In Orb, customers are assigned system generated identifiers automatically, but it's often desirable to have these
|
|
10
|
+
* match existing identifiers in your system. To avoid having to denormalize Orb ID information, you can pass in an
|
|
11
|
+
* `external_customer_id` with your own identifier. See
|
|
12
|
+
* [Customer ID Aliases](/events-and-metrics/customer-aliases) for further information about how these
|
|
13
|
+
* aliases work in Orb.
|
|
14
|
+
*
|
|
15
|
+
* In addition to having an identifier in your system, a customer may exist in a payment provider solution like
|
|
16
|
+
* Stripe. Use the `payment_provider_id` and the `payment_provider` enum field to express this mapping.
|
|
17
|
+
*
|
|
18
|
+
* A customer also has a timezone (from the standard [IANA timezone database](https://www.iana.org/time-zones)), which
|
|
19
|
+
* defaults to your account's timezone. See [Timezone localization](/essentials/timezones) for
|
|
20
|
+
* information on what this timezone parameter influences within Orb.
|
|
21
|
+
*/
|
|
22
|
+
export declare class BalanceTransactions extends APIResource {
|
|
23
|
+
/**
|
|
24
|
+
* Creates an immutable balance transaction that updates the customer's balance and
|
|
25
|
+
* returns back the newly created transaction.
|
|
26
|
+
*/
|
|
27
|
+
create(customerId: string, body: BalanceTransactionCreateParams, options?: RequestOptions): APIPromise<BalanceTransactionCreateResponse>;
|
|
28
|
+
/**
|
|
29
|
+
* ## The customer balance
|
|
30
|
+
*
|
|
31
|
+
* The customer balance is an amount in the customer's currency, which Orb
|
|
32
|
+
* automatically applies to subsequent invoices. This balance can be adjusted
|
|
33
|
+
* manually via Orb's webapp on the customer details page. You can use this balance
|
|
34
|
+
* to provide a fixed mid-period credit to the customer. Commonly, this is done due
|
|
35
|
+
* to system downtime/SLA violation, or an adhoc adjustment discussed with the
|
|
36
|
+
* customer.
|
|
37
|
+
*
|
|
38
|
+
* If the balance is a positive value at the time of invoicing, it represents that
|
|
39
|
+
* the customer has credit that should be used to offset the amount due on the next
|
|
40
|
+
* issued invoice. In this case, Orb will automatically reduce the next invoice by
|
|
41
|
+
* the balance amount, and roll over any remaining balance if the invoice is fully
|
|
42
|
+
* discounted.
|
|
43
|
+
*
|
|
44
|
+
* If the balance is a negative value at the time of invoicing, Orb will increase
|
|
45
|
+
* the invoice's amount due with a positive adjustment, and reset the balance to 0.
|
|
46
|
+
*
|
|
47
|
+
* This endpoint retrieves all customer balance transactions in reverse
|
|
48
|
+
* chronological order for a single customer, providing a complete audit trail of
|
|
49
|
+
* all adjustments and invoice applications.
|
|
50
|
+
*/
|
|
51
|
+
list(customerId: string, query?: BalanceTransactionListParams | null | undefined, options?: RequestOptions): PagePromise<BalanceTransactionListResponsesPage, BalanceTransactionListResponse>;
|
|
52
|
+
}
|
|
53
|
+
export type BalanceTransactionListResponsesPage = Page<BalanceTransactionListResponse>;
|
|
54
|
+
export interface BalanceTransactionCreateResponse {
|
|
55
|
+
/**
|
|
56
|
+
* A unique id for this transaction.
|
|
57
|
+
*/
|
|
58
|
+
id: string;
|
|
59
|
+
action: 'applied_to_invoice' | 'manual_adjustment' | 'prorated_refund' | 'revert_prorated_refund' | 'return_from_voiding' | 'credit_note_applied' | 'credit_note_voided' | 'overpayment_refund' | 'external_payment' | 'small_invoice_carryover';
|
|
60
|
+
/**
|
|
61
|
+
* The value of the amount changed in the transaction.
|
|
62
|
+
*/
|
|
63
|
+
amount: string;
|
|
64
|
+
/**
|
|
65
|
+
* The creation time of this transaction.
|
|
66
|
+
*/
|
|
67
|
+
created_at: string;
|
|
68
|
+
credit_note: Shared.CreditNoteTiny | null;
|
|
69
|
+
/**
|
|
70
|
+
* An optional description provided for manual customer balance adjustments.
|
|
71
|
+
*/
|
|
72
|
+
description: string | null;
|
|
73
|
+
/**
|
|
74
|
+
* The new value of the customer's balance prior to the transaction, in the
|
|
75
|
+
* customer's currency.
|
|
76
|
+
*/
|
|
77
|
+
ending_balance: string;
|
|
78
|
+
invoice: Shared.InvoiceTiny | null;
|
|
79
|
+
/**
|
|
80
|
+
* The original value of the customer's balance prior to the transaction, in the
|
|
81
|
+
* customer's currency.
|
|
82
|
+
*/
|
|
83
|
+
starting_balance: string;
|
|
84
|
+
type: 'increment' | 'decrement';
|
|
85
|
+
}
|
|
86
|
+
export interface BalanceTransactionListResponse {
|
|
87
|
+
/**
|
|
88
|
+
* A unique id for this transaction.
|
|
89
|
+
*/
|
|
90
|
+
id: string;
|
|
91
|
+
action: 'applied_to_invoice' | 'manual_adjustment' | 'prorated_refund' | 'revert_prorated_refund' | 'return_from_voiding' | 'credit_note_applied' | 'credit_note_voided' | 'overpayment_refund' | 'external_payment' | 'small_invoice_carryover';
|
|
92
|
+
/**
|
|
93
|
+
* The value of the amount changed in the transaction.
|
|
94
|
+
*/
|
|
95
|
+
amount: string;
|
|
96
|
+
/**
|
|
97
|
+
* The creation time of this transaction.
|
|
98
|
+
*/
|
|
99
|
+
created_at: string;
|
|
100
|
+
credit_note: Shared.CreditNoteTiny | null;
|
|
101
|
+
/**
|
|
102
|
+
* An optional description provided for manual customer balance adjustments.
|
|
103
|
+
*/
|
|
104
|
+
description: string | null;
|
|
105
|
+
/**
|
|
106
|
+
* The new value of the customer's balance prior to the transaction, in the
|
|
107
|
+
* customer's currency.
|
|
108
|
+
*/
|
|
109
|
+
ending_balance: string;
|
|
110
|
+
invoice: Shared.InvoiceTiny | null;
|
|
111
|
+
/**
|
|
112
|
+
* The original value of the customer's balance prior to the transaction, in the
|
|
113
|
+
* customer's currency.
|
|
114
|
+
*/
|
|
115
|
+
starting_balance: string;
|
|
116
|
+
type: 'increment' | 'decrement';
|
|
117
|
+
}
|
|
118
|
+
export interface BalanceTransactionCreateParams {
|
|
119
|
+
amount: string;
|
|
120
|
+
type: 'increment' | 'decrement';
|
|
121
|
+
/**
|
|
122
|
+
* An optional description that can be specified around this entry.
|
|
123
|
+
*/
|
|
124
|
+
description?: string | null;
|
|
125
|
+
}
|
|
126
|
+
export interface BalanceTransactionListParams extends PageParams {
|
|
127
|
+
'operation_time[gt]'?: string | null;
|
|
128
|
+
'operation_time[gte]'?: string | null;
|
|
129
|
+
'operation_time[lt]'?: string | null;
|
|
130
|
+
'operation_time[lte]'?: string | null;
|
|
131
|
+
}
|
|
132
|
+
export declare namespace BalanceTransactions {
|
|
133
|
+
export { type BalanceTransactionCreateResponse as BalanceTransactionCreateResponse, type BalanceTransactionListResponse as BalanceTransactionListResponse, type BalanceTransactionListResponsesPage as BalanceTransactionListResponsesPage, type BalanceTransactionCreateParams as BalanceTransactionCreateParams, type BalanceTransactionListParams as BalanceTransactionListParams, };
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=balance-transactions.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"balance-transactions.d.mts","sourceRoot":"","sources":["../../src/resources/customers/balance-transactions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,MAAM,sBAAkB;AACpC,OAAO,EAAE,UAAU,EAAE,mCAA+B;AACpD,OAAO,EAAE,IAAI,EAAE,KAAK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|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { APIResource } from "../../resource.js";
|
|
2
|
-
import * as Core from "../../core.js";
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
3
2
|
import * as Shared from "../shared.js";
|
|
4
|
-
import {
|
|
3
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
4
|
+
import { Page, type PageParams, PagePromise } from "../../core/pagination.js";
|
|
5
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
5
6
|
/**
|
|
6
7
|
* A customer is a buyer of your products, and the other party to the billing relationship.
|
|
7
8
|
*
|
|
@@ -23,7 +24,7 @@ export declare class BalanceTransactions extends APIResource {
|
|
|
23
24
|
* Creates an immutable balance transaction that updates the customer's balance and
|
|
24
25
|
* returns back the newly created transaction.
|
|
25
26
|
*/
|
|
26
|
-
create(customerId: string, body: BalanceTransactionCreateParams, options?:
|
|
27
|
+
create(customerId: string, body: BalanceTransactionCreateParams, options?: RequestOptions): APIPromise<BalanceTransactionCreateResponse>;
|
|
27
28
|
/**
|
|
28
29
|
* ## The customer balance
|
|
29
30
|
*
|
|
@@ -47,11 +48,9 @@ export declare class BalanceTransactions extends APIResource {
|
|
|
47
48
|
* chronological order for a single customer, providing a complete audit trail of
|
|
48
49
|
* all adjustments and invoice applications.
|
|
49
50
|
*/
|
|
50
|
-
list(customerId: string, query?: BalanceTransactionListParams, options?:
|
|
51
|
-
list(customerId: string, options?: Core.RequestOptions): Core.PagePromise<BalanceTransactionListResponsesPage, BalanceTransactionListResponse>;
|
|
52
|
-
}
|
|
53
|
-
export declare class BalanceTransactionListResponsesPage extends Page<BalanceTransactionListResponse> {
|
|
51
|
+
list(customerId: string, query?: BalanceTransactionListParams | null | undefined, options?: RequestOptions): PagePromise<BalanceTransactionListResponsesPage, BalanceTransactionListResponse>;
|
|
54
52
|
}
|
|
53
|
+
export type BalanceTransactionListResponsesPage = Page<BalanceTransactionListResponse>;
|
|
55
54
|
export interface BalanceTransactionCreateResponse {
|
|
56
55
|
/**
|
|
57
56
|
* A unique id for this transaction.
|
|
@@ -131,6 +130,6 @@ export interface BalanceTransactionListParams extends PageParams {
|
|
|
131
130
|
'operation_time[lte]'?: string | null;
|
|
132
131
|
}
|
|
133
132
|
export declare namespace BalanceTransactions {
|
|
134
|
-
export { type BalanceTransactionCreateResponse as BalanceTransactionCreateResponse, type BalanceTransactionListResponse as BalanceTransactionListResponse, BalanceTransactionListResponsesPage as BalanceTransactionListResponsesPage, type BalanceTransactionCreateParams as BalanceTransactionCreateParams, type BalanceTransactionListParams as BalanceTransactionListParams, };
|
|
133
|
+
export { type BalanceTransactionCreateResponse as BalanceTransactionCreateResponse, type BalanceTransactionListResponse as BalanceTransactionListResponse, type BalanceTransactionListResponsesPage as BalanceTransactionListResponsesPage, type BalanceTransactionCreateParams as BalanceTransactionCreateParams, type BalanceTransactionListParams as BalanceTransactionListParams, };
|
|
135
134
|
}
|
|
136
135
|
//# sourceMappingURL=balance-transactions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"balance-transactions.d.ts","sourceRoot":"","sources":["../../src/resources/customers/balance-transactions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE
|
|
1
|
+
{"version":3,"file":"balance-transactions.d.ts","sourceRoot":"","sources":["../../src/resources/customers/balance-transactions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,KAAK,MAAM,qBAAkB;AACpC,OAAO,EAAE,UAAU,EAAE,kCAA+B;AACpD,OAAO,EAAE,IAAI,EAAE,KAAK,UAAU,EAAE,WAAW,EAAE,iCAA8B;AAC3E,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAGhE;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,mBAAoB,SAAQ,WAAW;IAClD;;;OAGG;IACH,MAAM,CACJ,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,8BAA8B,EACpC,OAAO,CAAC,EAAE,cAAc,GACv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AM,CAAC;IAEnB,WAAW,EAAE,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC;IAE1C;;OAEG;IACH,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB,OAAO,EAAE,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC;IAEnC;;;OAGG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB,IAAI,EAAE,WAAW,GAAG,WAAW,CAAC;CACjC;AAED,MAAM,WAAW,8BAA8B;IAC7C,MAAM,EAAE,MAAM,CAAC;IAEf,IAAI,EAAE,WAAW,GAAG,WAAW,CAAC;IAEhC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,4BAA6B,SAAQ,UAAU;IAC9D,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAErC,qBAAqB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtC,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAErC,qBAAqB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvC;AAED,MAAM,CAAC,OAAO,WAAW,mBAAmB,CAAC;IAC3C,OAAO,EACL,KAAK,gCAAgC,IAAI,gCAAgC,EACzE,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,mCAAmC,IAAI,mCAAmC,EAC/E,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,4BAA4B,IAAI,4BAA4B,GAClE,CAAC;CACH"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
5
|
-
const resource_1 = require("../../resource.js");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
4
|
+
exports.BalanceTransactions = void 0;
|
|
5
|
+
const resource_1 = require("../../core/resource.js");
|
|
6
|
+
const pagination_1 = require("../../core/pagination.js");
|
|
7
|
+
const path_1 = require("../../internal/utils/path.js");
|
|
8
8
|
/**
|
|
9
9
|
* A customer is a buyer of your products, and the other party to the billing relationship.
|
|
10
10
|
*
|
|
@@ -27,18 +27,34 @@ class BalanceTransactions extends resource_1.APIResource {
|
|
|
27
27
|
* returns back the newly created transaction.
|
|
28
28
|
*/
|
|
29
29
|
create(customerId, body, options) {
|
|
30
|
-
return this._client.post(`/customers/${customerId}/balance_transactions`, { body, ...options });
|
|
30
|
+
return this._client.post((0, path_1.path) `/customers/${customerId}/balance_transactions`, { body, ...options });
|
|
31
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* ## The customer balance
|
|
34
|
+
*
|
|
35
|
+
* The customer balance is an amount in the customer's currency, which Orb
|
|
36
|
+
* automatically applies to subsequent invoices. This balance can be adjusted
|
|
37
|
+
* manually via Orb's webapp on the customer details page. You can use this balance
|
|
38
|
+
* to provide a fixed mid-period credit to the customer. Commonly, this is done due
|
|
39
|
+
* to system downtime/SLA violation, or an adhoc adjustment discussed with the
|
|
40
|
+
* customer.
|
|
41
|
+
*
|
|
42
|
+
* If the balance is a positive value at the time of invoicing, it represents that
|
|
43
|
+
* the customer has credit that should be used to offset the amount due on the next
|
|
44
|
+
* issued invoice. In this case, Orb will automatically reduce the next invoice by
|
|
45
|
+
* the balance amount, and roll over any remaining balance if the invoice is fully
|
|
46
|
+
* discounted.
|
|
47
|
+
*
|
|
48
|
+
* If the balance is a negative value at the time of invoicing, Orb will increase
|
|
49
|
+
* the invoice's amount due with a positive adjustment, and reset the balance to 0.
|
|
50
|
+
*
|
|
51
|
+
* This endpoint retrieves all customer balance transactions in reverse
|
|
52
|
+
* chronological order for a single customer, providing a complete audit trail of
|
|
53
|
+
* all adjustments and invoice applications.
|
|
54
|
+
*/
|
|
32
55
|
list(customerId, query = {}, options) {
|
|
33
|
-
|
|
34
|
-
return this.list(customerId, {}, query);
|
|
35
|
-
}
|
|
36
|
-
return this._client.getAPIList(`/customers/${customerId}/balance_transactions`, BalanceTransactionListResponsesPage, { query, ...options });
|
|
56
|
+
return this._client.getAPIList((0, path_1.path) `/customers/${customerId}/balance_transactions`, (pagination_1.Page), { query, ...options });
|
|
37
57
|
}
|
|
38
58
|
}
|
|
39
59
|
exports.BalanceTransactions = BalanceTransactions;
|
|
40
|
-
class BalanceTransactionListResponsesPage extends pagination_1.Page {
|
|
41
|
-
}
|
|
42
|
-
exports.BalanceTransactionListResponsesPage = BalanceTransactionListResponsesPage;
|
|
43
|
-
BalanceTransactions.BalanceTransactionListResponsesPage = BalanceTransactionListResponsesPage;
|
|
44
60
|
//# sourceMappingURL=balance-transactions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"balance-transactions.js","sourceRoot":"","sources":["../../src/resources/customers/balance-transactions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,
|
|
1
|
+
{"version":3,"file":"balance-transactions.js","sourceRoot":"","sources":["../../src/resources/customers/balance-transactions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAGlD,yDAA2E;AAE3E,uDAAiD;AAEjD;;;;;;;;;;;;;;;GAeG;AACH,MAAa,mBAAoB,SAAQ,sBAAW;IAClD;;;OAGG;IACH,MAAM,CACJ,UAAkB,EAClB,IAAoC,EACpC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,cAAc,UAAU,uBAAuB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtG,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,IAAI,CACF,UAAkB,EAClB,QAAyD,EAAE,EAC3D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAA,WAAI,EAAA,cAAc,UAAU,uBAAuB,EACnD,CAAA,iBAAoC,CAAA,EACpC,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACtB,CAAC;IACJ,CAAC;CACF;AA/CD,kDA+CC"}
|