@metronome/sdk 0.3.0 → 2.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 +113 -28
- package/README.md +123 -51
- package/api-promise.d.mts +2 -0
- package/api-promise.d.mts.map +1 -0
- package/api-promise.d.ts +2 -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 +2 -0
- package/api-promise.mjs.map +1 -0
- package/bin/cli +46 -0
- package/bin/migration-config.json +6 -0
- package/client.d.mts +232 -0
- package/client.d.mts.map +1 -0
- package/client.d.ts +232 -0
- package/client.d.ts.map +1 -0
- package/client.js +464 -0
- package/client.js.map +1 -0
- package/client.mjs +460 -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 +46 -0
- package/core/error.d.mts.map +1 -0
- package/core/error.d.ts +46 -0
- package/core/error.d.ts.map +1 -0
- package/core/error.js +113 -0
- package/core/error.js.map +1 -0
- package/core/error.mjs +97 -0
- package/core/error.mjs.map +1 -0
- package/core/pagination.d.mts +137 -0
- package/core/pagination.d.mts.map +1 -0
- package/core/pagination.d.ts +137 -0
- package/core/pagination.d.ts.map +1 -0
- package/core/pagination.js +158 -0
- package/core/pagination.js.map +1 -0
- package/core/pagination.mjs +150 -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 +2 -0
- package/error.d.mts.map +1 -0
- package/error.d.ts +1 -46
- package/error.d.ts.map +1 -1
- package/error.js +3 -110
- package/error.js.map +1 -1
- package/error.mjs +1 -96
- package/error.mjs.map +1 -1
- package/index.d.mts +7 -144
- package/index.d.mts.map +1 -0
- package/index.d.ts +6 -143
- package/index.d.ts.map +1 -1
- package/index.js +14 -120
- package/index.js.map +1 -1
- package/index.mjs +6 -93
- 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 +26 -0
- package/internal/headers.d.mts.map +1 -0
- package/internal/headers.d.ts +26 -0
- package/internal/headers.d.ts.map +1 -0
- package/internal/headers.js +120 -0
- package/internal/headers.js.map +1 -0
- package/internal/headers.mjs +112 -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 +35 -0
- package/internal/parse.js.map +1 -0
- package/internal/parse.mjs +32 -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.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 +20 -0
- package/internal/shims.d.mts.map +1 -0
- package/internal/shims.d.ts +20 -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 +85 -0
- package/internal/utils/log.js.map +1 -0
- package/internal/utils/log.mjs +79 -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/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 +7 -0
- package/internal/utils.d.mts.map +1 -0
- package/internal/utils.d.ts +7 -0
- package/internal/utils.d.ts.map +1 -0
- package/internal/utils.js +11 -0
- package/internal/utils.js.map +1 -0
- package/internal/utils.mjs +8 -0
- package/internal/utils.mjs.map +1 -0
- package/package.json +113 -64
- package/pagination.d.mts +2 -0
- package/pagination.d.mts.map +1 -0
- package/pagination.d.ts +1 -36
- package/pagination.d.ts.map +1 -1
- package/pagination.js +3 -40
- package/pagination.js.map +1 -1
- package/pagination.mjs +1 -38
- package/pagination.mjs.map +1 -1
- package/resource.d.mts +2 -0
- package/resource.d.mts.map +1 -0
- package/resource.d.ts +1 -5
- package/resource.d.ts.map +1 -1
- package/resource.js +3 -8
- package/resource.js.map +1 -1
- package/resource.mjs +1 -6
- package/resource.mjs.map +1 -1
- package/resources/index.d.mts +5 -0
- package/resources/index.d.mts.map +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +2 -15
- package/resources/index.js.map +1 -1
- package/resources/shared.d.mts +2363 -0
- package/resources/shared.d.mts.map +1 -0
- package/resources/shared.d.ts +1470 -465
- package/resources/shared.d.ts.map +1 -1
- package/resources/v1/alerts.d.mts +207 -0
- package/resources/v1/alerts.d.mts.map +1 -0
- package/resources/v1/alerts.d.ts +107 -32
- package/resources/v1/alerts.d.ts.map +1 -1
- package/resources/v1/alerts.js +74 -3
- package/resources/v1/alerts.js.map +1 -1
- package/resources/v1/alerts.mjs +74 -3
- package/resources/v1/alerts.mjs.map +1 -1
- package/resources/v1/audit-logs.d.mts +108 -0
- package/resources/v1/audit-logs.d.mts.map +1 -0
- package/resources/v1/audit-logs.d.ts +45 -12
- package/resources/v1/audit-logs.d.ts.map +1 -1
- package/resources/v1/audit-logs.js +53 -12
- package/resources/v1/audit-logs.js.map +1 -1
- package/resources/v1/audit-logs.mjs +52 -10
- package/resources/v1/audit-logs.mjs.map +1 -1
- package/resources/v1/billable-metrics.d.mts +293 -0
- package/resources/v1/billable-metrics.d.mts.map +1 -0
- package/resources/v1/billable-metrics.d.ts +70 -15
- package/resources/v1/billable-metrics.d.ts.map +1 -1
- package/resources/v1/billable-metrics.js +70 -16
- package/resources/v1/billable-metrics.js.map +1 -1
- package/resources/v1/billable-metrics.mjs +69 -14
- package/resources/v1/billable-metrics.mjs.map +1 -1
- package/resources/v1/contracts/contracts.d.mts +3006 -0
- package/resources/v1/contracts/contracts.d.mts.map +1 -0
- package/resources/v1/contracts/contracts.d.ts +428 -1299
- package/resources/v1/contracts/contracts.d.ts.map +1 -1
- package/resources/v1/contracts/contracts.js +269 -50
- package/resources/v1/contracts/contracts.js.map +1 -1
- package/resources/v1/contracts/contracts.mjs +267 -26
- package/resources/v1/contracts/contracts.mjs.map +1 -1
- package/resources/v1/contracts/index.d.mts +5 -0
- package/resources/v1/contracts/index.d.mts.map +1 -0
- package/resources/v1/contracts/index.d.ts +3 -3
- package/resources/v1/contracts/index.d.ts.map +1 -1
- package/resources/v1/contracts/index.js +1 -3
- package/resources/v1/contracts/index.js.map +1 -1
- package/resources/v1/contracts/index.mjs +2 -2
- package/resources/v1/contracts/index.mjs.map +1 -1
- package/resources/v1/contracts/named-schedules.d.mts +82 -0
- package/resources/v1/contracts/named-schedules.d.mts.map +1 -0
- package/resources/v1/contracts/named-schedules.d.ts +5 -4
- package/resources/v1/contracts/named-schedules.d.ts.map +1 -1
- package/resources/v1/contracts/named-schedules.js +3 -2
- package/resources/v1/contracts/named-schedules.js.map +1 -1
- package/resources/v1/contracts/named-schedules.mjs +3 -2
- package/resources/v1/contracts/named-schedules.mjs.map +1 -1
- package/resources/v1/contracts/products.d.mts +502 -0
- package/resources/v1/contracts/products.d.mts.map +1 -0
- package/resources/v1/contracts/products.d.ts +44 -17
- package/resources/v1/contracts/products.d.ts.map +1 -1
- package/resources/v1/contracts/products.js +41 -17
- package/resources/v1/contracts/products.js.map +1 -1
- package/resources/v1/contracts/products.mjs +40 -15
- package/resources/v1/contracts/products.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/index.d.mts +5 -0
- package/resources/v1/contracts/rate-cards/index.d.mts.map +1 -0
- package/resources/v1/contracts/rate-cards/index.d.ts +2 -2
- package/resources/v1/contracts/rate-cards/index.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/index.js +1 -3
- package/resources/v1/contracts/rate-cards/index.js.map +1 -1
- package/resources/v1/contracts/rate-cards/index.mjs +2 -2
- package/resources/v1/contracts/rate-cards/index.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.d.mts +94 -0
- package/resources/v1/contracts/rate-cards/named-schedules.d.mts.map +1 -0
- package/resources/v1/contracts/rate-cards/named-schedules.d.ts +5 -4
- package/resources/v1/contracts/rate-cards/named-schedules.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.js +3 -2
- package/resources/v1/contracts/rate-cards/named-schedules.js.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.mjs +3 -2
- package/resources/v1/contracts/rate-cards/named-schedules.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.d.mts +85 -0
- package/resources/v1/contracts/rate-cards/product-orders.d.mts.map +1 -0
- package/resources/v1/contracts/rate-cards/product-orders.d.ts +12 -6
- package/resources/v1/contracts/rate-cards/product-orders.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.js +8 -3
- package/resources/v1/contracts/rate-cards/product-orders.js.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.mjs +8 -3
- package/resources/v1/contracts/rate-cards/product-orders.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.d.mts +452 -0
- package/resources/v1/contracts/rate-cards/rate-cards.d.mts.map +1 -0
- package/resources/v1/contracts/rate-cards/rate-cards.d.ts +134 -41
- package/resources/v1/contracts/rate-cards/rate-cards.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.js +127 -47
- package/resources/v1/contracts/rate-cards/rate-cards.js.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.mjs +123 -20
- package/resources/v1/contracts/rate-cards/rate-cards.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.d.mts +382 -0
- package/resources/v1/contracts/rate-cards/rates.d.mts.map +1 -0
- package/resources/v1/contracts/rate-cards/rates.d.ts +25 -82
- package/resources/v1/contracts/rate-cards/rates.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.js +13 -9
- package/resources/v1/contracts/rate-cards/rates.js.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.mjs +12 -7
- package/resources/v1/contracts/rate-cards/rates.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards.d.mts +2 -0
- package/resources/v1/contracts/rate-cards.d.mts.map +1 -0
- package/resources/v1/contracts/rate-cards.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards.js +2 -15
- package/resources/v1/contracts/rate-cards.js.map +1 -1
- package/resources/v1/contracts.d.mts +2 -0
- package/resources/v1/contracts.d.mts.map +1 -0
- package/resources/v1/contracts.d.ts.map +1 -1
- package/resources/v1/contracts.js +2 -15
- package/resources/v1/contracts.js.map +1 -1
- package/resources/v1/credit-grants.d.mts +505 -0
- package/resources/v1/credit-grants.d.mts.map +1 -0
- package/resources/v1/credit-grants.d.ts +73 -74
- package/resources/v1/credit-grants.d.ts.map +1 -1
- package/resources/v1/credit-grants.js +52 -18
- package/resources/v1/credit-grants.js.map +1 -1
- package/resources/v1/credit-grants.mjs +51 -16
- package/resources/v1/credit-grants.mjs.map +1 -1
- package/resources/v1/custom-fields.d.mts +151 -0
- package/resources/v1/custom-fields.d.mts.map +1 -0
- package/resources/v1/custom-fields.d.ts +69 -38
- package/resources/v1/custom-fields.d.ts.map +1 -1
- package/resources/v1/custom-fields.js +66 -22
- package/resources/v1/custom-fields.js.map +1 -1
- package/resources/v1/custom-fields.mjs +66 -22
- package/resources/v1/custom-fields.mjs.map +1 -1
- package/resources/v1/customers/alerts.d.mts +309 -0
- package/resources/v1/customers/alerts.d.mts.map +1 -0
- package/resources/v1/customers/alerts.d.ts +176 -50
- package/resources/v1/customers/alerts.d.ts.map +1 -1
- package/resources/v1/customers/alerts.js +131 -10
- package/resources/v1/customers/alerts.js.map +1 -1
- package/resources/v1/customers/alerts.mjs +131 -10
- package/resources/v1/customers/alerts.mjs.map +1 -1
- package/resources/v1/customers/billing-config.d.mts +125 -0
- package/resources/v1/customers/billing-config.d.mts.map +1 -0
- package/resources/v1/customers/billing-config.d.ts +8 -7
- package/resources/v1/customers/billing-config.d.ts.map +1 -1
- package/resources/v1/customers/billing-config.js +8 -6
- package/resources/v1/customers/billing-config.js.map +1 -1
- package/resources/v1/customers/billing-config.mjs +8 -6
- package/resources/v1/customers/billing-config.mjs.map +1 -1
- package/resources/v1/customers/commits.d.mts +456 -0
- package/resources/v1/customers/commits.d.mts.map +1 -0
- package/resources/v1/customers/commits.d.ts +139 -47
- package/resources/v1/customers/commits.d.ts.map +1 -1
- package/resources/v1/customers/commits.js +131 -12
- package/resources/v1/customers/commits.js.map +1 -1
- package/resources/v1/customers/commits.mjs +131 -12
- package/resources/v1/customers/commits.mjs.map +1 -1
- package/resources/v1/customers/credits.d.mts +310 -0
- package/resources/v1/customers/credits.d.mts.map +1 -0
- package/resources/v1/customers/credits.d.ts +124 -46
- package/resources/v1/customers/credits.d.ts.map +1 -1
- package/resources/v1/customers/credits.js +116 -11
- package/resources/v1/customers/credits.js.map +1 -1
- package/resources/v1/customers/credits.mjs +116 -11
- package/resources/v1/customers/credits.mjs.map +1 -1
- package/resources/v1/customers/customers.d.mts +819 -0
- package/resources/v1/customers/customers.d.mts.map +1 -0
- package/resources/v1/customers/customers.d.ts +319 -55
- package/resources/v1/customers/customers.d.ts.map +1 -1
- package/resources/v1/customers/customers.js +220 -76
- package/resources/v1/customers/customers.js.map +1 -1
- package/resources/v1/customers/customers.mjs +213 -44
- package/resources/v1/customers/customers.mjs.map +1 -1
- package/resources/v1/customers/index.d.mts +9 -0
- package/resources/v1/customers/index.d.mts.map +1 -0
- package/resources/v1/customers/index.d.ts +6 -6
- package/resources/v1/customers/index.d.ts.map +1 -1
- package/resources/v1/customers/index.js +1 -8
- package/resources/v1/customers/index.js.map +1 -1
- package/resources/v1/customers/index.mjs +3 -3
- package/resources/v1/customers/index.mjs.map +1 -1
- package/resources/v1/customers/invoices.d.mts +825 -0
- package/resources/v1/customers/invoices.d.mts.map +1 -0
- package/resources/v1/customers/invoices.d.ts +309 -25
- package/resources/v1/customers/invoices.d.ts.map +1 -1
- package/resources/v1/customers/invoices.js +180 -22
- package/resources/v1/customers/invoices.js.map +1 -1
- package/resources/v1/customers/invoices.mjs +179 -19
- package/resources/v1/customers/invoices.mjs.map +1 -1
- package/resources/v1/customers/named-schedules.d.mts +82 -0
- package/resources/v1/customers/named-schedules.d.mts.map +1 -0
- package/resources/v1/customers/named-schedules.d.ts +5 -4
- package/resources/v1/customers/named-schedules.d.ts.map +1 -1
- package/resources/v1/customers/named-schedules.js +3 -2
- package/resources/v1/customers/named-schedules.js.map +1 -1
- package/resources/v1/customers/named-schedules.mjs +3 -2
- package/resources/v1/customers/named-schedules.mjs.map +1 -1
- package/resources/v1/customers/plans.d.mts +281 -0
- package/resources/v1/customers/plans.d.mts.map +1 -0
- package/resources/v1/customers/plans.d.ts +14 -12
- package/resources/v1/customers/plans.d.ts.map +1 -1
- package/resources/v1/customers/plans.js +8 -15
- package/resources/v1/customers/plans.js.map +1 -1
- package/resources/v1/customers/plans.mjs +7 -12
- package/resources/v1/customers/plans.mjs.map +1 -1
- package/resources/v1/customers.d.mts +2 -0
- package/resources/v1/customers.d.mts.map +1 -0
- package/resources/v1/customers.d.ts.map +1 -1
- package/resources/v1/customers.js +2 -15
- package/resources/v1/customers.js.map +1 -1
- package/resources/v1/dashboards.d.mts +133 -0
- package/resources/v1/dashboards.d.mts.map +1 -0
- package/resources/v1/dashboards.d.ts +33 -6
- package/resources/v1/dashboards.d.ts.map +1 -1
- package/resources/v1/dashboards.js +30 -4
- package/resources/v1/dashboards.js.map +1 -1
- package/resources/v1/dashboards.mjs +30 -4
- package/resources/v1/dashboards.mjs.map +1 -1
- package/resources/v1/index.d.mts +16 -0
- package/resources/v1/index.d.mts.map +1 -0
- package/resources/v1/index.d.ts +10 -9
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js +3 -12
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs +8 -7
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/invoices.d.mts +83 -0
- package/resources/v1/invoices.d.mts.map +1 -0
- package/resources/v1/invoices.d.ts +28 -6
- package/resources/v1/invoices.d.ts.map +1 -1
- package/resources/v1/invoices.js +24 -3
- package/resources/v1/invoices.js.map +1 -1
- package/resources/v1/invoices.mjs +24 -3
- package/resources/v1/invoices.mjs.map +1 -1
- package/resources/v1/payments.d.mts +116 -0
- package/resources/v1/payments.d.mts.map +1 -0
- package/resources/v1/payments.d.ts +116 -0
- package/resources/v1/payments.d.ts.map +1 -0
- package/resources/v1/payments.js +71 -0
- package/resources/v1/payments.js.map +1 -0
- package/resources/v1/payments.mjs +67 -0
- package/resources/v1/payments.mjs.map +1 -0
- package/resources/v1/plans.d.mts +240 -0
- package/resources/v1/plans.d.mts.map +1 -0
- package/resources/v1/plans.d.ts +24 -15
- package/resources/v1/plans.d.ts.map +1 -1
- package/resources/v1/plans.js +19 -26
- package/resources/v1/plans.js.map +1 -1
- package/resources/v1/plans.mjs +18 -22
- package/resources/v1/plans.mjs.map +1 -1
- package/resources/v1/pricing-units.d.mts +34 -0
- package/resources/v1/pricing-units.d.mts.map +1 -0
- package/resources/v1/pricing-units.d.ts +12 -9
- package/resources/v1/pricing-units.d.ts.map +1 -1
- package/resources/v1/pricing-units.js +20 -12
- package/resources/v1/pricing-units.js.map +1 -1
- package/resources/v1/pricing-units.mjs +19 -10
- package/resources/v1/pricing-units.mjs.map +1 -1
- package/resources/v1/services.d.mts +33 -0
- package/resources/v1/services.d.mts.map +1 -0
- package/resources/v1/services.d.ts +10 -7
- package/resources/v1/services.d.ts.map +1 -1
- package/resources/v1/services.js +7 -5
- package/resources/v1/services.js.map +1 -1
- package/resources/v1/services.mjs +7 -5
- package/resources/v1/services.mjs.map +1 -1
- package/resources/v1/usage.d.mts +490 -0
- package/resources/v1/usage.d.mts.map +1 -0
- package/resources/v1/usage.d.ts +223 -58
- package/resources/v1/usage.d.ts.map +1 -1
- package/resources/v1/usage.js +214 -26
- package/resources/v1/usage.js.map +1 -1
- package/resources/v1/usage.mjs +213 -24
- package/resources/v1/usage.mjs.map +1 -1
- package/resources/v1/v1.d.mts +62 -0
- package/resources/v1/v1.d.mts.map +1 -0
- package/resources/v1/v1.d.ts +19 -15
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js +19 -48
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs +12 -19
- package/resources/v1/v1.mjs.map +1 -1
- package/resources/v1.d.mts +2 -0
- package/resources/v1.d.mts.map +1 -0
- package/resources/v1.d.ts.map +1 -1
- package/resources/v1.js +2 -15
- package/resources/v1.js.map +1 -1
- package/resources/v2/contracts.d.mts +2900 -0
- package/resources/v2/contracts.d.mts.map +1 -0
- package/resources/v2/contracts.d.ts +399 -3830
- package/resources/v2/contracts.d.ts.map +1 -1
- package/resources/v2/contracts.js +102 -12
- package/resources/v2/contracts.js.map +1 -1
- package/resources/v2/contracts.mjs +102 -12
- package/resources/v2/contracts.mjs.map +1 -1
- package/resources/v2/index.d.mts +3 -0
- package/resources/v2/index.d.mts.map +1 -0
- package/resources/v2/index.d.ts.map +1 -1
- package/resources/v2/v2.d.mts +10 -0
- package/resources/v2/v2.d.mts.map +1 -0
- package/resources/v2/v2.d.ts +1 -1
- package/resources/v2/v2.d.ts.map +1 -1
- package/resources/v2/v2.js +3 -25
- package/resources/v2/v2.js.map +1 -1
- package/resources/v2/v2.mjs +1 -1
- package/resources/v2.d.mts +2 -0
- package/resources/v2.d.mts.map +1 -0
- package/resources/v2.d.ts.map +1 -1
- package/resources/v2.js +2 -15
- package/resources/v2.js.map +1 -1
- package/resources/webhooks.d.mts +22 -0
- package/resources/webhooks.d.mts.map +1 -0
- package/resources/webhooks.d.ts +1 -1
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js +3 -3
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs +1 -1
- 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/src/api-promise.ts +2 -0
- package/src/client.ts +809 -0
- package/src/core/README.md +3 -0
- package/src/core/api-promise.ts +92 -0
- package/src/core/error.ts +130 -0
- package/src/core/pagination.ts +319 -0
- package/src/core/resource.ts +11 -0
- package/src/core/uploads.ts +2 -0
- package/src/error.ts +2 -130
- package/src/index.ts +6 -221
- 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 +144 -0
- package/src/internal/parse.ts +50 -0
- package/src/internal/qs/formats.ts +3 -2
- package/src/internal/qs/index.ts +3 -3
- package/src/internal/qs/stringify.ts +18 -21
- package/src/internal/qs/utils.ts +16 -16
- 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 +95 -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 +126 -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 +8 -0
- package/src/pagination.ts +2 -82
- package/src/resource.ts +2 -11
- package/src/resources/index.ts +4 -4
- package/src/resources/shared.ts +1921 -506
- package/src/resources/v1/alerts.ts +108 -33
- package/src/resources/v1/audit-logs.ts +48 -26
- package/src/resources/v1/billable-metrics.ts +79 -34
- package/src/resources/v1/contracts/contracts.ts +490 -1632
- package/src/resources/v1/contracts/index.ts +7 -6
- package/src/resources/v1/contracts/named-schedules.ts +8 -6
- package/src/resources/v1/contracts/products.ts +50 -38
- package/src/resources/v1/contracts/rate-cards/index.ts +6 -6
- package/src/resources/v1/contracts/rate-cards/named-schedules.ts +8 -6
- package/src/resources/v1/contracts/rate-cards/product-orders.ts +13 -10
- package/src/resources/v1/contracts/rate-cards/rate-cards.ts +145 -72
- package/src/resources/v1/contracts/rate-cards/rates.ts +28 -98
- package/src/resources/v1/contracts/rate-cards.ts +1 -1
- package/src/resources/v1/contracts.ts +1 -1
- package/src/resources/v1/credit-grants.ts +100 -112
- package/src/resources/v1/custom-fields.ts +106 -74
- package/src/resources/v1/customers/alerts.ts +195 -55
- package/src/resources/v1/customers/billing-config.ts +27 -13
- package/src/resources/v1/customers/commits.ts +146 -54
- package/src/resources/v1/customers/credits.ts +131 -53
- package/src/resources/v1/customers/customers.ts +407 -115
- package/src/resources/v1/customers/index.ts +20 -18
- package/src/resources/v1/customers/invoices.ts +343 -42
- package/src/resources/v1/customers/named-schedules.ts +8 -6
- package/src/resources/v1/customers/plans.ts +24 -22
- package/src/resources/v1/customers.ts +1 -1
- package/src/resources/v1/dashboards.ts +34 -7
- package/src/resources/v1/index.ts +43 -25
- package/src/resources/v1/invoices.ts +28 -9
- package/src/resources/v1/payments.ts +170 -0
- package/src/resources/v1/plans.ts +42 -43
- package/src/resources/v1/pricing-units.ts +15 -23
- package/src/resources/v1/services.ts +10 -7
- package/src/resources/v1/usage.ts +247 -73
- package/src/resources/v1/v1.ts +78 -49
- package/src/resources/v1.ts +1 -1
- package/src/resources/v2/contracts.ts +469 -4930
- package/src/resources/v2/index.ts +2 -2
- package/src/resources/v2/v2.ts +3 -3
- package/src/resources/v2.ts +1 -1
- package/src/resources/webhooks.ts +2 -2
- package/src/resources.ts +1 -1
- package/src/tsconfig.json +2 -2
- package/src/uploads.ts +2 -255
- package/src/version.ts +1 -1
- package/uploads.d.mts +2 -0
- package/uploads.d.mts.map +1 -0
- package/uploads.d.ts +1 -74
- package/uploads.d.ts.map +1 -1
- package/uploads.js +3 -168
- package/uploads.js.map +1 -1
- package/uploads.mjs +1 -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.js +1 -1
- package/version.mjs +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 -924
- package/core.js.map +0 -1
- package/core.mjs +0 -892
- 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 -1236
- package/src/shims/node.ts +0 -50
- package/src/shims/web.ts +0 -50
|
@@ -0,0 +1,825 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
2
|
+
import * as Shared from "../../shared.mjs";
|
|
3
|
+
import { APIPromise } from "../../../core/api-promise.mjs";
|
|
4
|
+
import { CursorPage, type CursorPageParams, PagePromise } from "../../../core/pagination.mjs";
|
|
5
|
+
import { RequestOptions } from "../../../internal/request-options.mjs";
|
|
6
|
+
export declare class Invoices extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Retrieve detailed information for a specific invoice by its unique identifier.
|
|
9
|
+
* This endpoint returns comprehensive invoice data including line items, applied
|
|
10
|
+
* credits, totals, and billing period details for both finalized and draft
|
|
11
|
+
* invoices.
|
|
12
|
+
*
|
|
13
|
+
* ### Use this endpoint to:
|
|
14
|
+
*
|
|
15
|
+
* - Display historical invoice details in customer-facing dashboards or billing
|
|
16
|
+
* portals.
|
|
17
|
+
* - Retrieve current month draft invoices to show customers their month-to-date
|
|
18
|
+
* spend.
|
|
19
|
+
* - Access finalized invoices for historical billing records and payment
|
|
20
|
+
* reconciliation.
|
|
21
|
+
* - Validate customer pricing and credit applications for customer support
|
|
22
|
+
* queries.
|
|
23
|
+
*
|
|
24
|
+
* ### Key response fields:
|
|
25
|
+
*
|
|
26
|
+
* Invoice status (DRAFT, FINALIZED, VOID) Billing period start and end dates Total
|
|
27
|
+
* amount and amount due after credits Detailed line items broken down by:
|
|
28
|
+
*
|
|
29
|
+
* - Customer and contract information
|
|
30
|
+
* - Invoice line item type
|
|
31
|
+
* - Product/service name and ID
|
|
32
|
+
* - Quantity consumed
|
|
33
|
+
* - Unit and total price
|
|
34
|
+
* - Time period for usage-based charges
|
|
35
|
+
* - Applied credits or prepaid commitments
|
|
36
|
+
*
|
|
37
|
+
* ### Usage guidelines:
|
|
38
|
+
*
|
|
39
|
+
* - Draft invoices update in real-time as usage is reported and may change before
|
|
40
|
+
* finalization
|
|
41
|
+
* - The response includes both usage-based line items (e.g., API calls, data
|
|
42
|
+
* processed) and scheduled charges (e.g., monthly subscriptions, commitment
|
|
43
|
+
* fees)
|
|
44
|
+
* - Credit and commitment applications are shown as separate line items with
|
|
45
|
+
* negative amounts
|
|
46
|
+
* - For voided invoices, the response will indicate VOID status but retain all
|
|
47
|
+
* original line item details
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* const invoice = await client.v1.customers.invoices.retrieve(
|
|
52
|
+
* {
|
|
53
|
+
* customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
54
|
+
* invoice_id: '6a37bb88-8538-48c5-b37b-a41c836328bd',
|
|
55
|
+
* },
|
|
56
|
+
* );
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
retrieve(params: InvoiceRetrieveParams, options?: RequestOptions): APIPromise<InvoiceRetrieveResponse>;
|
|
60
|
+
/**
|
|
61
|
+
* Retrieves a paginated list of invoices for a specific customer, with flexible
|
|
62
|
+
* filtering options to narrow results by status, date range, credit type, and
|
|
63
|
+
* more. This endpoint provides a comprehensive view of a customer's billing
|
|
64
|
+
* history and current charges, supporting both real-time billing dashboards and
|
|
65
|
+
* historical reporting needs.
|
|
66
|
+
*
|
|
67
|
+
* ### Use this endpoint to:
|
|
68
|
+
*
|
|
69
|
+
* - Display historical invoice details in customer-facing dashboards or billing
|
|
70
|
+
* portals.
|
|
71
|
+
* - Retrieve current month draft invoices to show customers their month-to-date
|
|
72
|
+
* spend.
|
|
73
|
+
* - Access finalized invoices for historical billing records and payment
|
|
74
|
+
* reconciliation.
|
|
75
|
+
* - Validate customer pricing and credit applications for customer support
|
|
76
|
+
* queries.
|
|
77
|
+
* - Generate financial reports by filtering invoices within specific date ranges
|
|
78
|
+
*
|
|
79
|
+
* ### Key response fields:
|
|
80
|
+
*
|
|
81
|
+
* Array of invoice objects containing:
|
|
82
|
+
*
|
|
83
|
+
* - Invoice ID and status (DRAFT, FINALIZED, VOID)
|
|
84
|
+
* - Invoice type (USAGE, SCHEDULED)
|
|
85
|
+
* - Billing period start and end dates
|
|
86
|
+
* - Issue date and due date
|
|
87
|
+
* - Total amount, subtotal, and amount due
|
|
88
|
+
* - Applied credits summary
|
|
89
|
+
* - Contract ID reference
|
|
90
|
+
* - External billing provider status (if integrated with Stripe, etc.)
|
|
91
|
+
* - Pagination metadata `next_page` cursor
|
|
92
|
+
*
|
|
93
|
+
* ### Usage guidelines:
|
|
94
|
+
*
|
|
95
|
+
* - The endpoint returns invoice summaries; use the Get Invoice endpoint for
|
|
96
|
+
* detailed line items
|
|
97
|
+
* - Draft invoices are continuously updated as new usage is reported and will show
|
|
98
|
+
* real-time spend
|
|
99
|
+
* - Results are ordered by creation date descending by default (newest first)
|
|
100
|
+
* - When filtering by date range, the filter applies to the billing period, not
|
|
101
|
+
* the issue date
|
|
102
|
+
* - For customers with many invoices, implement pagination to ensure all results
|
|
103
|
+
* are retrieved External billing provider statuses (like Stripe payment status)
|
|
104
|
+
* are included when applicable
|
|
105
|
+
* - Voided invoices are included in results by default unless filtered out by
|
|
106
|
+
* status
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* ```ts
|
|
110
|
+
* // Automatically fetches more pages as needed.
|
|
111
|
+
* for await (const invoice of client.v1.customers.invoices.list(
|
|
112
|
+
* { customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc' },
|
|
113
|
+
* )) {
|
|
114
|
+
* // ...
|
|
115
|
+
* }
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
118
|
+
list(params: InvoiceListParams, options?: RequestOptions): PagePromise<InvoicesCursorPage, Invoice>;
|
|
119
|
+
/**
|
|
120
|
+
* Add a one time charge to the specified invoice
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```ts
|
|
124
|
+
* const response =
|
|
125
|
+
* await client.v1.customers.invoices.addCharge({
|
|
126
|
+
* customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
127
|
+
* charge_id: '5ae4b726-1ebe-439c-9190-9831760ba195',
|
|
128
|
+
* customer_plan_id:
|
|
129
|
+
* 'a23b3cf4-47fb-4c3f-bb3d-9e64f7704015',
|
|
130
|
+
* description: 'One time charge',
|
|
131
|
+
* invoice_start_timestamp: '2024-01-01T00:00:00Z',
|
|
132
|
+
* price: 250,
|
|
133
|
+
* quantity: 1,
|
|
134
|
+
* });
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
addCharge(params: InvoiceAddChargeParams, options?: RequestOptions): APIPromise<InvoiceAddChargeResponse>;
|
|
138
|
+
/**
|
|
139
|
+
* Retrieve granular time-series breakdowns of invoice data at hourly or daily
|
|
140
|
+
* intervals. This endpoint transforms standard invoices into detailed timelines,
|
|
141
|
+
* enabling you to track usage patterns, identify consumption spikes, and provide
|
|
142
|
+
* customers with transparency into their billing details throughout the billing
|
|
143
|
+
* period.
|
|
144
|
+
*
|
|
145
|
+
* ### Use this endpoint to:
|
|
146
|
+
*
|
|
147
|
+
* - Build usage analytics dashboards showing daily or hourly consumption trends
|
|
148
|
+
* - Identify peak usage periods for capacity planning and cost optimization
|
|
149
|
+
* - Generate detailed billing reports for finance teams and customer success
|
|
150
|
+
* - Troubleshoot billing disputes by examining usage patterns at specific times
|
|
151
|
+
* - Power real-time cost monitoring and alerting systems
|
|
152
|
+
*
|
|
153
|
+
* ### Key response fields:
|
|
154
|
+
*
|
|
155
|
+
* An array of BreakdownInvoice objects, each containing:
|
|
156
|
+
*
|
|
157
|
+
* - All standard invoice fields (ID, customer, commit, line items, totals, status)
|
|
158
|
+
* - Line items with quantities and costs for that specific period
|
|
159
|
+
* - `breakdown_start_timestamp`: Start of the specific time window
|
|
160
|
+
* - `breakdown_end_timestamp`: End of the specific time window
|
|
161
|
+
* - `next_page`: Pagination cursor for large result sets
|
|
162
|
+
*
|
|
163
|
+
* ### Usage guidelines:
|
|
164
|
+
*
|
|
165
|
+
* - Time granularity: Set `window_size` to hour or day based on your analysis
|
|
166
|
+
* needs
|
|
167
|
+
* - Response limits: Daily breakdowns return up to 35 days; hourly breakdowns
|
|
168
|
+
* return up to 24 hours per request
|
|
169
|
+
* - Date filtering: Use `starting_on` and `ending_before` to focus on specific
|
|
170
|
+
* periods
|
|
171
|
+
* - Performance: For large date ranges, use pagination to retrieve all data
|
|
172
|
+
* efficiently
|
|
173
|
+
* - Backdated usage: If usage events arrive after invoice finalization, breakdowns
|
|
174
|
+
* will reflect the updated usage
|
|
175
|
+
* - Zero quantity filtering: Use `skip_zero_qty_line_items=true` to exclude
|
|
176
|
+
* periods with no usage
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* ```ts
|
|
180
|
+
* // Automatically fetches more pages as needed.
|
|
181
|
+
* for await (const invoiceListBreakdownsResponse of client.v1.customers.invoices.listBreakdowns(
|
|
182
|
+
* {
|
|
183
|
+
* customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
184
|
+
* ending_before: '2019-12-27T18:11:19.117Z',
|
|
185
|
+
* starting_on: '2019-12-27T18:11:19.117Z',
|
|
186
|
+
* },
|
|
187
|
+
* )) {
|
|
188
|
+
* // ...
|
|
189
|
+
* }
|
|
190
|
+
* ```
|
|
191
|
+
*/
|
|
192
|
+
listBreakdowns(params: InvoiceListBreakdownsParams, options?: RequestOptions): PagePromise<InvoiceListBreakdownsResponsesCursorPage, InvoiceListBreakdownsResponse>;
|
|
193
|
+
/**
|
|
194
|
+
* Retrieve a PDF version of a specific invoice by its unique identifier. This
|
|
195
|
+
* endpoint generates a professionally formatted invoice document suitable for
|
|
196
|
+
* sharing with customers, accounting teams, or for record-keeping purposes.
|
|
197
|
+
*
|
|
198
|
+
* ### Use this endpoint to:
|
|
199
|
+
*
|
|
200
|
+
* - Provide customers with downloadable or emailable copies of their invoices
|
|
201
|
+
* - Support accounting and finance teams with official billing documents
|
|
202
|
+
* - Maintain accurate records of billing transactions for audits and compliance
|
|
203
|
+
*
|
|
204
|
+
* ### Key response details:
|
|
205
|
+
*
|
|
206
|
+
* - The response is a binary PDF file representing the full invoice
|
|
207
|
+
* - The PDF includes all standard invoice information such as line items, totals,
|
|
208
|
+
* billing period, and customer details
|
|
209
|
+
* - The document is formatted for clarity and professionalism, suitable for
|
|
210
|
+
* official use
|
|
211
|
+
*
|
|
212
|
+
* ### Usage guidelines:
|
|
213
|
+
*
|
|
214
|
+
* - Ensure the `invoice_id` corresponds to an existing invoice for the specified
|
|
215
|
+
* `customer_id`
|
|
216
|
+
* - The PDF is generated on-demand; frequent requests for the same invoice may
|
|
217
|
+
* impact performance
|
|
218
|
+
* - Use appropriate headers to handle the binary response in your application
|
|
219
|
+
* (e.g., setting `Content-Type: application/pdf`)
|
|
220
|
+
*
|
|
221
|
+
* @example
|
|
222
|
+
* ```ts
|
|
223
|
+
* const response =
|
|
224
|
+
* await client.v1.customers.invoices.retrievePdf({
|
|
225
|
+
* customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
226
|
+
* invoice_id: '6a37bb88-8538-48c5-b37b-a41c836328bd',
|
|
227
|
+
* });
|
|
228
|
+
*
|
|
229
|
+
* const content = await response.blob();
|
|
230
|
+
* console.log(content);
|
|
231
|
+
* ```
|
|
232
|
+
*/
|
|
233
|
+
retrievePdf(params: InvoiceRetrievePdfParams, options?: RequestOptions): APIPromise<Response>;
|
|
234
|
+
}
|
|
235
|
+
export type InvoicesCursorPage = CursorPage<Invoice>;
|
|
236
|
+
export type InvoiceListBreakdownsResponsesCursorPage = CursorPage<InvoiceListBreakdownsResponse>;
|
|
237
|
+
export interface Invoice {
|
|
238
|
+
id: string;
|
|
239
|
+
credit_type: Shared.CreditTypeData;
|
|
240
|
+
customer_id: string;
|
|
241
|
+
line_items: Array<Invoice.LineItem>;
|
|
242
|
+
status: string;
|
|
243
|
+
total: number;
|
|
244
|
+
type: string;
|
|
245
|
+
amendment_id?: string;
|
|
246
|
+
/**
|
|
247
|
+
* This field's availability is dependent on your client's configuration.
|
|
248
|
+
*/
|
|
249
|
+
billable_status?: unknown;
|
|
250
|
+
/**
|
|
251
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
252
|
+
*/
|
|
253
|
+
contract_custom_fields?: {
|
|
254
|
+
[key: string]: string;
|
|
255
|
+
};
|
|
256
|
+
contract_id?: string;
|
|
257
|
+
correction_record?: Invoice.CorrectionRecord;
|
|
258
|
+
/**
|
|
259
|
+
* When the invoice was created (UTC). This field is present for correction
|
|
260
|
+
* invoices only.
|
|
261
|
+
*/
|
|
262
|
+
created_at?: string;
|
|
263
|
+
custom_fields?: {
|
|
264
|
+
[key: string]: unknown;
|
|
265
|
+
};
|
|
266
|
+
/**
|
|
267
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
268
|
+
*/
|
|
269
|
+
customer_custom_fields?: {
|
|
270
|
+
[key: string]: string;
|
|
271
|
+
};
|
|
272
|
+
/**
|
|
273
|
+
* End of the usage period this invoice covers (UTC)
|
|
274
|
+
*/
|
|
275
|
+
end_timestamp?: string;
|
|
276
|
+
external_invoice?: Invoice.ExternalInvoice | null;
|
|
277
|
+
invoice_adjustments?: Array<Invoice.InvoiceAdjustment>;
|
|
278
|
+
/**
|
|
279
|
+
* When the invoice was issued (UTC)
|
|
280
|
+
*/
|
|
281
|
+
issued_at?: string;
|
|
282
|
+
net_payment_terms_days?: number;
|
|
283
|
+
/**
|
|
284
|
+
* This field's availability is dependent on your client's configuration.
|
|
285
|
+
*/
|
|
286
|
+
netsuite_sales_order_id?: string;
|
|
287
|
+
/**
|
|
288
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
289
|
+
*/
|
|
290
|
+
plan_custom_fields?: {
|
|
291
|
+
[key: string]: string;
|
|
292
|
+
};
|
|
293
|
+
plan_id?: string;
|
|
294
|
+
plan_name?: string;
|
|
295
|
+
/**
|
|
296
|
+
* Only present for contract invoices with reseller royalties.
|
|
297
|
+
*/
|
|
298
|
+
reseller_royalty?: Invoice.ResellerRoyalty;
|
|
299
|
+
/**
|
|
300
|
+
* This field's availability is dependent on your client's configuration.
|
|
301
|
+
*/
|
|
302
|
+
salesforce_opportunity_id?: string;
|
|
303
|
+
/**
|
|
304
|
+
* Beginning of the usage period this invoice covers (UTC)
|
|
305
|
+
*/
|
|
306
|
+
start_timestamp?: string;
|
|
307
|
+
subtotal?: number;
|
|
308
|
+
}
|
|
309
|
+
export declare namespace Invoice {
|
|
310
|
+
interface LineItem {
|
|
311
|
+
credit_type: Shared.CreditTypeData;
|
|
312
|
+
name: string;
|
|
313
|
+
total: number;
|
|
314
|
+
/**
|
|
315
|
+
* The type of line item.
|
|
316
|
+
*
|
|
317
|
+
* - `scheduled`: Line item is associated with a scheduled charge. View the
|
|
318
|
+
* scheduled_charge_id on the line item.
|
|
319
|
+
* - `commit_purchase`: Line item is associated with a payment for a prepaid
|
|
320
|
+
* commit. View the commit_id on the line item.
|
|
321
|
+
* - `usage`: Line item is associated with a usage product or composite product.
|
|
322
|
+
* View the product_id on the line item to determine which product.
|
|
323
|
+
* - `subscription`: Line item is associated with a subscription. e.g. monthly
|
|
324
|
+
* recurring payment for an in-advance subscription.
|
|
325
|
+
* - `applied_commit_or_credit`: On metronome invoices, applied commits and credits
|
|
326
|
+
* are associated with their own line items. These line items have negative
|
|
327
|
+
* totals. Use the applied_commit_or_credit object on the line item to understand
|
|
328
|
+
* the id of the applied commit or credit, and its type. Note that the
|
|
329
|
+
* application of a postpaid commit is associated with a line item, but the total
|
|
330
|
+
* on the line item is not included in the invoice's total as postpaid commits
|
|
331
|
+
* are paid in-arrears.
|
|
332
|
+
* - `cpu_conversion`: Line item converting between a custom pricing unit and fiat
|
|
333
|
+
* currency, using the conversion rate set on the rate card. This line item will
|
|
334
|
+
* appear when there are products priced in custom pricing units, and there is
|
|
335
|
+
* insufficient prepaid commit/credit in that custom pricing unit to fully cover
|
|
336
|
+
* the spend. Then, the outstanding spend in custom pricing units will be
|
|
337
|
+
* converted to fiat currency using a cpu_conversion line item.
|
|
338
|
+
*/
|
|
339
|
+
type: string;
|
|
340
|
+
/**
|
|
341
|
+
* Details about the credit or commit that was applied to this line item. Only
|
|
342
|
+
* present on line items with product of `USAGE`, `SUBSCRIPTION` or `COMPOSITE`
|
|
343
|
+
* types.
|
|
344
|
+
*/
|
|
345
|
+
applied_commit_or_credit?: LineItem.AppliedCommitOrCredit;
|
|
346
|
+
/**
|
|
347
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
348
|
+
*/
|
|
349
|
+
commit_custom_fields?: {
|
|
350
|
+
[key: string]: string;
|
|
351
|
+
};
|
|
352
|
+
/**
|
|
353
|
+
* For line items with product of `USAGE`, `SUBSCRIPTION`, or `COMPOSITE` types,
|
|
354
|
+
* the ID of the credit or commit that was applied to this line item. For line
|
|
355
|
+
* items with product type of `FIXED`, the ID of the prepaid or postpaid commit
|
|
356
|
+
* that is being paid for.
|
|
357
|
+
*/
|
|
358
|
+
commit_id?: string;
|
|
359
|
+
commit_netsuite_item_id?: string;
|
|
360
|
+
commit_netsuite_sales_order_id?: string;
|
|
361
|
+
commit_segment_id?: string;
|
|
362
|
+
/**
|
|
363
|
+
* `PrepaidCommit` (for commit types `PREPAID` and `CREDIT`) or `PostpaidCommit`
|
|
364
|
+
* (for commit type `POSTPAID`).
|
|
365
|
+
*/
|
|
366
|
+
commit_type?: string;
|
|
367
|
+
/**
|
|
368
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
369
|
+
*/
|
|
370
|
+
custom_fields?: {
|
|
371
|
+
[key: string]: string;
|
|
372
|
+
};
|
|
373
|
+
/**
|
|
374
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
375
|
+
*/
|
|
376
|
+
discount_custom_fields?: {
|
|
377
|
+
[key: string]: string;
|
|
378
|
+
};
|
|
379
|
+
/**
|
|
380
|
+
* ID of the discount applied to this line item.
|
|
381
|
+
*/
|
|
382
|
+
discount_id?: string;
|
|
383
|
+
/**
|
|
384
|
+
* The line item's end date (exclusive).
|
|
385
|
+
*/
|
|
386
|
+
ending_before?: string;
|
|
387
|
+
group_key?: string;
|
|
388
|
+
group_value?: string | null;
|
|
389
|
+
/**
|
|
390
|
+
* Indicates whether the line item is prorated for `SUBSCRIPTION` type product.
|
|
391
|
+
*/
|
|
392
|
+
is_prorated?: boolean;
|
|
393
|
+
/**
|
|
394
|
+
* Only present for contract invoices and when the `include_list_prices` query
|
|
395
|
+
* parameter is set to true. This will include the list rate for the charge if
|
|
396
|
+
* applicable. Only present for usage and subscription line items.
|
|
397
|
+
*/
|
|
398
|
+
list_price?: Shared.Rate;
|
|
399
|
+
metadata?: string;
|
|
400
|
+
/**
|
|
401
|
+
* The end date for the billing period on the invoice.
|
|
402
|
+
*/
|
|
403
|
+
netsuite_invoice_billing_end?: string;
|
|
404
|
+
/**
|
|
405
|
+
* The start date for the billing period on the invoice.
|
|
406
|
+
*/
|
|
407
|
+
netsuite_invoice_billing_start?: string;
|
|
408
|
+
netsuite_item_id?: string;
|
|
409
|
+
/**
|
|
410
|
+
* Only present for line items paying for a postpaid commit true-up.
|
|
411
|
+
*/
|
|
412
|
+
postpaid_commit?: LineItem.PostpaidCommit;
|
|
413
|
+
/**
|
|
414
|
+
* Includes the presentation group values associated with this line item if
|
|
415
|
+
* presentation group keys are used.
|
|
416
|
+
*/
|
|
417
|
+
presentation_group_values?: {
|
|
418
|
+
[key: string]: string | null;
|
|
419
|
+
};
|
|
420
|
+
/**
|
|
421
|
+
* Includes the pricing group values associated with this line item if dimensional
|
|
422
|
+
* pricing is used.
|
|
423
|
+
*/
|
|
424
|
+
pricing_group_values?: {
|
|
425
|
+
[key: string]: string;
|
|
426
|
+
};
|
|
427
|
+
/**
|
|
428
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
429
|
+
*/
|
|
430
|
+
product_custom_fields?: {
|
|
431
|
+
[key: string]: string;
|
|
432
|
+
};
|
|
433
|
+
/**
|
|
434
|
+
* ID of the product associated with the line item.
|
|
435
|
+
*/
|
|
436
|
+
product_id?: string;
|
|
437
|
+
/**
|
|
438
|
+
* The current product tags associated with the line item's `product_id`.
|
|
439
|
+
*/
|
|
440
|
+
product_tags?: Array<string>;
|
|
441
|
+
/**
|
|
442
|
+
* The type of the line item's product. Possible values are `FixedProductListItem`
|
|
443
|
+
* (for `FIXED` type products), `UsageProductListItem` (for `USAGE` type products),
|
|
444
|
+
* `SubscriptionProductListItem` (for `SUBSCRIPTION` type products) or
|
|
445
|
+
* `CompositeProductListItem` (for `COMPOSITE` type products). For scheduled
|
|
446
|
+
* charges, commit and credit payments, the value is `FixedProductListItem`.
|
|
447
|
+
*/
|
|
448
|
+
product_type?: string;
|
|
449
|
+
/**
|
|
450
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
451
|
+
*/
|
|
452
|
+
professional_service_custom_fields?: {
|
|
453
|
+
[key: string]: string;
|
|
454
|
+
};
|
|
455
|
+
professional_service_id?: string;
|
|
456
|
+
/**
|
|
457
|
+
* The quantity associated with the line item.
|
|
458
|
+
*/
|
|
459
|
+
quantity?: number;
|
|
460
|
+
reseller_type?: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
|
|
461
|
+
/**
|
|
462
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
463
|
+
*/
|
|
464
|
+
scheduled_charge_custom_fields?: {
|
|
465
|
+
[key: string]: string;
|
|
466
|
+
};
|
|
467
|
+
/**
|
|
468
|
+
* ID of scheduled charge.
|
|
469
|
+
*/
|
|
470
|
+
scheduled_charge_id?: string;
|
|
471
|
+
/**
|
|
472
|
+
* The line item's start date (inclusive).
|
|
473
|
+
*/
|
|
474
|
+
starting_at?: string;
|
|
475
|
+
sub_line_items?: Array<LineItem.SubLineItem>;
|
|
476
|
+
/**
|
|
477
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
478
|
+
*/
|
|
479
|
+
subscription_custom_fields?: {
|
|
480
|
+
[key: string]: string;
|
|
481
|
+
};
|
|
482
|
+
/**
|
|
483
|
+
* Populated if the line item has a tiered price.
|
|
484
|
+
*/
|
|
485
|
+
tier?: LineItem.Tier;
|
|
486
|
+
/**
|
|
487
|
+
* The unit price associated with the line item.
|
|
488
|
+
*/
|
|
489
|
+
unit_price?: number;
|
|
490
|
+
}
|
|
491
|
+
namespace LineItem {
|
|
492
|
+
/**
|
|
493
|
+
* Details about the credit or commit that was applied to this line item. Only
|
|
494
|
+
* present on line items with product of `USAGE`, `SUBSCRIPTION` or `COMPOSITE`
|
|
495
|
+
* types.
|
|
496
|
+
*/
|
|
497
|
+
interface AppliedCommitOrCredit {
|
|
498
|
+
id: string;
|
|
499
|
+
type: 'PREPAID' | 'POSTPAID' | 'CREDIT';
|
|
500
|
+
}
|
|
501
|
+
/**
|
|
502
|
+
* Only present for line items paying for a postpaid commit true-up.
|
|
503
|
+
*/
|
|
504
|
+
interface PostpaidCommit {
|
|
505
|
+
id: string;
|
|
506
|
+
}
|
|
507
|
+
interface SubLineItem {
|
|
508
|
+
/**
|
|
509
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
510
|
+
*/
|
|
511
|
+
custom_fields: {
|
|
512
|
+
[key: string]: string;
|
|
513
|
+
};
|
|
514
|
+
name: string;
|
|
515
|
+
quantity: number;
|
|
516
|
+
subtotal: number;
|
|
517
|
+
charge_id?: string;
|
|
518
|
+
credit_grant_id?: string;
|
|
519
|
+
/**
|
|
520
|
+
* The end date for the charge (for seats charges only).
|
|
521
|
+
*/
|
|
522
|
+
end_date?: string;
|
|
523
|
+
/**
|
|
524
|
+
* the unit price for this charge, present only if the charge is not tiered and the
|
|
525
|
+
* quantity is nonzero
|
|
526
|
+
*/
|
|
527
|
+
price?: number;
|
|
528
|
+
/**
|
|
529
|
+
* The start date for the charge (for seats charges only).
|
|
530
|
+
*/
|
|
531
|
+
start_date?: string;
|
|
532
|
+
/**
|
|
533
|
+
* when the current tier started and ends (for tiered charges only)
|
|
534
|
+
*/
|
|
535
|
+
tier_period?: SubLineItem.TierPeriod;
|
|
536
|
+
tiers?: Array<SubLineItem.Tier>;
|
|
537
|
+
}
|
|
538
|
+
namespace SubLineItem {
|
|
539
|
+
/**
|
|
540
|
+
* when the current tier started and ends (for tiered charges only)
|
|
541
|
+
*/
|
|
542
|
+
interface TierPeriod {
|
|
543
|
+
starting_at: string;
|
|
544
|
+
ending_before?: string;
|
|
545
|
+
}
|
|
546
|
+
interface Tier {
|
|
547
|
+
price: number;
|
|
548
|
+
quantity: number;
|
|
549
|
+
/**
|
|
550
|
+
* at what metric amount this tier begins
|
|
551
|
+
*/
|
|
552
|
+
starting_at: number;
|
|
553
|
+
subtotal: number;
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* Populated if the line item has a tiered price.
|
|
558
|
+
*/
|
|
559
|
+
interface Tier {
|
|
560
|
+
level: number;
|
|
561
|
+
starting_at: string;
|
|
562
|
+
size?: string | null;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
interface CorrectionRecord {
|
|
566
|
+
corrected_invoice_id: string;
|
|
567
|
+
memo: string;
|
|
568
|
+
reason: string;
|
|
569
|
+
corrected_external_invoice?: CorrectionRecord.CorrectedExternalInvoice;
|
|
570
|
+
}
|
|
571
|
+
namespace CorrectionRecord {
|
|
572
|
+
interface CorrectedExternalInvoice {
|
|
573
|
+
billing_provider_type: 'aws_marketplace' | 'stripe' | 'netsuite' | 'custom' | 'azure_marketplace' | 'quickbooks_online' | 'workday' | 'gcp_marketplace';
|
|
574
|
+
external_status?: 'DRAFT' | 'FINALIZED' | 'PAID' | 'UNCOLLECTIBLE' | 'VOID' | 'DELETED' | 'PAYMENT_FAILED' | 'INVALID_REQUEST_ERROR' | 'SKIPPED' | 'SENT' | 'QUEUED';
|
|
575
|
+
invoice_id?: string;
|
|
576
|
+
/**
|
|
577
|
+
* The subtotal amount invoiced, if available from the billing provider.
|
|
578
|
+
*/
|
|
579
|
+
invoiced_sub_total?: number;
|
|
580
|
+
/**
|
|
581
|
+
* The total amount invoiced, if available from the billing provider.
|
|
582
|
+
*/
|
|
583
|
+
invoiced_total?: number;
|
|
584
|
+
issued_at_timestamp?: string;
|
|
585
|
+
/**
|
|
586
|
+
* A URL to the PDF of the invoice, if available from the billing provider.
|
|
587
|
+
*/
|
|
588
|
+
pdf_url?: string;
|
|
589
|
+
/**
|
|
590
|
+
* Tax details for the invoice, if available from the billing provider.
|
|
591
|
+
*/
|
|
592
|
+
tax?: CorrectedExternalInvoice.Tax;
|
|
593
|
+
}
|
|
594
|
+
namespace CorrectedExternalInvoice {
|
|
595
|
+
/**
|
|
596
|
+
* Tax details for the invoice, if available from the billing provider.
|
|
597
|
+
*/
|
|
598
|
+
interface Tax {
|
|
599
|
+
/**
|
|
600
|
+
* The total tax amount applied to the invoice.
|
|
601
|
+
*/
|
|
602
|
+
total_tax_amount?: number;
|
|
603
|
+
/**
|
|
604
|
+
* The total taxable amount of the invoice.
|
|
605
|
+
*/
|
|
606
|
+
total_taxable_amount?: number;
|
|
607
|
+
/**
|
|
608
|
+
* The transaction ID associated with the tax calculation.
|
|
609
|
+
*/
|
|
610
|
+
transaction_id?: string;
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
interface ExternalInvoice {
|
|
615
|
+
billing_provider_type: 'aws_marketplace' | 'stripe' | 'netsuite' | 'custom' | 'azure_marketplace' | 'quickbooks_online' | 'workday' | 'gcp_marketplace';
|
|
616
|
+
external_status?: 'DRAFT' | 'FINALIZED' | 'PAID' | 'UNCOLLECTIBLE' | 'VOID' | 'DELETED' | 'PAYMENT_FAILED' | 'INVALID_REQUEST_ERROR' | 'SKIPPED' | 'SENT' | 'QUEUED';
|
|
617
|
+
invoice_id?: string;
|
|
618
|
+
/**
|
|
619
|
+
* The subtotal amount invoiced, if available from the billing provider.
|
|
620
|
+
*/
|
|
621
|
+
invoiced_sub_total?: number;
|
|
622
|
+
/**
|
|
623
|
+
* The total amount invoiced, if available from the billing provider.
|
|
624
|
+
*/
|
|
625
|
+
invoiced_total?: number;
|
|
626
|
+
issued_at_timestamp?: string;
|
|
627
|
+
/**
|
|
628
|
+
* A URL to the PDF of the invoice, if available from the billing provider.
|
|
629
|
+
*/
|
|
630
|
+
pdf_url?: string;
|
|
631
|
+
/**
|
|
632
|
+
* Tax details for the invoice, if available from the billing provider.
|
|
633
|
+
*/
|
|
634
|
+
tax?: ExternalInvoice.Tax;
|
|
635
|
+
}
|
|
636
|
+
namespace ExternalInvoice {
|
|
637
|
+
/**
|
|
638
|
+
* Tax details for the invoice, if available from the billing provider.
|
|
639
|
+
*/
|
|
640
|
+
interface Tax {
|
|
641
|
+
/**
|
|
642
|
+
* The total tax amount applied to the invoice.
|
|
643
|
+
*/
|
|
644
|
+
total_tax_amount?: number;
|
|
645
|
+
/**
|
|
646
|
+
* The total taxable amount of the invoice.
|
|
647
|
+
*/
|
|
648
|
+
total_taxable_amount?: number;
|
|
649
|
+
/**
|
|
650
|
+
* The transaction ID associated with the tax calculation.
|
|
651
|
+
*/
|
|
652
|
+
transaction_id?: string;
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
interface InvoiceAdjustment {
|
|
656
|
+
credit_type: Shared.CreditTypeData;
|
|
657
|
+
name: string;
|
|
658
|
+
total: number;
|
|
659
|
+
/**
|
|
660
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
661
|
+
*/
|
|
662
|
+
credit_grant_custom_fields?: {
|
|
663
|
+
[key: string]: string;
|
|
664
|
+
};
|
|
665
|
+
credit_grant_id?: string;
|
|
666
|
+
}
|
|
667
|
+
/**
|
|
668
|
+
* Only present for contract invoices with reseller royalties.
|
|
669
|
+
*/
|
|
670
|
+
interface ResellerRoyalty {
|
|
671
|
+
fraction: string;
|
|
672
|
+
netsuite_reseller_id: string;
|
|
673
|
+
reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
|
|
674
|
+
aws_options?: ResellerRoyalty.AwsOptions;
|
|
675
|
+
gcp_options?: ResellerRoyalty.GcpOptions;
|
|
676
|
+
}
|
|
677
|
+
namespace ResellerRoyalty {
|
|
678
|
+
interface AwsOptions {
|
|
679
|
+
aws_account_number?: string;
|
|
680
|
+
aws_offer_id?: string;
|
|
681
|
+
aws_payer_reference_id?: string;
|
|
682
|
+
}
|
|
683
|
+
interface GcpOptions {
|
|
684
|
+
gcp_account_id?: string;
|
|
685
|
+
gcp_offer_id?: string;
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
export interface InvoiceRetrieveResponse {
|
|
690
|
+
data: Invoice;
|
|
691
|
+
}
|
|
692
|
+
export interface InvoiceAddChargeResponse {
|
|
693
|
+
}
|
|
694
|
+
export interface InvoiceListBreakdownsResponse extends Invoice {
|
|
695
|
+
breakdown_end_timestamp: string;
|
|
696
|
+
breakdown_start_timestamp: string;
|
|
697
|
+
}
|
|
698
|
+
export interface InvoiceRetrieveParams {
|
|
699
|
+
/**
|
|
700
|
+
* Path param:
|
|
701
|
+
*/
|
|
702
|
+
customer_id: string;
|
|
703
|
+
/**
|
|
704
|
+
* Path param:
|
|
705
|
+
*/
|
|
706
|
+
invoice_id: string;
|
|
707
|
+
/**
|
|
708
|
+
* Query param: If set, all zero quantity line items will be filtered out of the
|
|
709
|
+
* response
|
|
710
|
+
*/
|
|
711
|
+
skip_zero_qty_line_items?: boolean;
|
|
712
|
+
}
|
|
713
|
+
export interface InvoiceListParams extends CursorPageParams {
|
|
714
|
+
/**
|
|
715
|
+
* Path param:
|
|
716
|
+
*/
|
|
717
|
+
customer_id: string;
|
|
718
|
+
/**
|
|
719
|
+
* Query param: Only return invoices for the specified credit type
|
|
720
|
+
*/
|
|
721
|
+
credit_type_id?: string;
|
|
722
|
+
/**
|
|
723
|
+
* Query param: RFC 3339 timestamp (exclusive). Invoices will only be returned for
|
|
724
|
+
* billing periods that end before this time.
|
|
725
|
+
*/
|
|
726
|
+
ending_before?: string;
|
|
727
|
+
/**
|
|
728
|
+
* Query param: If set, all zero quantity line items will be filtered out of the
|
|
729
|
+
* response
|
|
730
|
+
*/
|
|
731
|
+
skip_zero_qty_line_items?: boolean;
|
|
732
|
+
/**
|
|
733
|
+
* Query param: Invoice sort order by issued_at, e.g. date_asc or date_desc.
|
|
734
|
+
* Defaults to date_asc.
|
|
735
|
+
*/
|
|
736
|
+
sort?: 'date_asc' | 'date_desc';
|
|
737
|
+
/**
|
|
738
|
+
* Query param: RFC 3339 timestamp (inclusive). Invoices will only be returned for
|
|
739
|
+
* billing periods that start at or after this time.
|
|
740
|
+
*/
|
|
741
|
+
starting_on?: string;
|
|
742
|
+
/**
|
|
743
|
+
* Query param: Invoice status, e.g. DRAFT, FINALIZED, or VOID
|
|
744
|
+
*/
|
|
745
|
+
status?: string;
|
|
746
|
+
}
|
|
747
|
+
export interface InvoiceAddChargeParams {
|
|
748
|
+
/**
|
|
749
|
+
* Path param:
|
|
750
|
+
*/
|
|
751
|
+
customer_id: string;
|
|
752
|
+
/**
|
|
753
|
+
* Body param: The Metronome ID of the charge to add to the invoice. Note that the
|
|
754
|
+
* charge must be on a product that is not on the current plan, and the product
|
|
755
|
+
* must have only fixed charges.
|
|
756
|
+
*/
|
|
757
|
+
charge_id: string;
|
|
758
|
+
/**
|
|
759
|
+
* Body param: The Metronome ID of the customer plan to add the charge to.
|
|
760
|
+
*/
|
|
761
|
+
customer_plan_id: string;
|
|
762
|
+
/**
|
|
763
|
+
* Body param:
|
|
764
|
+
*/
|
|
765
|
+
description: string;
|
|
766
|
+
/**
|
|
767
|
+
* Body param: The start_timestamp of the invoice to add the charge to.
|
|
768
|
+
*/
|
|
769
|
+
invoice_start_timestamp: string;
|
|
770
|
+
/**
|
|
771
|
+
* Body param: The price of the charge. This price will match the currency on the
|
|
772
|
+
* invoice, e.g. USD cents.
|
|
773
|
+
*/
|
|
774
|
+
price: number;
|
|
775
|
+
/**
|
|
776
|
+
* Body param:
|
|
777
|
+
*/
|
|
778
|
+
quantity: number;
|
|
779
|
+
}
|
|
780
|
+
export interface InvoiceListBreakdownsParams extends CursorPageParams {
|
|
781
|
+
/**
|
|
782
|
+
* Path param:
|
|
783
|
+
*/
|
|
784
|
+
customer_id: string;
|
|
785
|
+
/**
|
|
786
|
+
* Query param: RFC 3339 timestamp. Breakdowns will only be returned for time
|
|
787
|
+
* windows that end on or before this time.
|
|
788
|
+
*/
|
|
789
|
+
ending_before: string;
|
|
790
|
+
/**
|
|
791
|
+
* Query param: RFC 3339 timestamp. Breakdowns will only be returned for time
|
|
792
|
+
* windows that start on or after this time.
|
|
793
|
+
*/
|
|
794
|
+
starting_on: string;
|
|
795
|
+
/**
|
|
796
|
+
* Query param: Only return invoices for the specified credit type
|
|
797
|
+
*/
|
|
798
|
+
credit_type_id?: string;
|
|
799
|
+
/**
|
|
800
|
+
* Query param: If set, all zero quantity line items will be filtered out of the
|
|
801
|
+
* response
|
|
802
|
+
*/
|
|
803
|
+
skip_zero_qty_line_items?: boolean;
|
|
804
|
+
/**
|
|
805
|
+
* Query param: Invoice sort order by issued_at, e.g. date_asc or date_desc.
|
|
806
|
+
* Defaults to date_asc.
|
|
807
|
+
*/
|
|
808
|
+
sort?: 'date_asc' | 'date_desc';
|
|
809
|
+
/**
|
|
810
|
+
* Query param: Invoice status, e.g. DRAFT or FINALIZED
|
|
811
|
+
*/
|
|
812
|
+
status?: string;
|
|
813
|
+
/**
|
|
814
|
+
* Query param: The granularity of the breakdowns to return. Defaults to day.
|
|
815
|
+
*/
|
|
816
|
+
window_size?: 'HOUR' | 'DAY';
|
|
817
|
+
}
|
|
818
|
+
export interface InvoiceRetrievePdfParams {
|
|
819
|
+
customer_id: string;
|
|
820
|
+
invoice_id: string;
|
|
821
|
+
}
|
|
822
|
+
export declare namespace Invoices {
|
|
823
|
+
export { type Invoice as Invoice, type InvoiceRetrieveResponse as InvoiceRetrieveResponse, type InvoiceAddChargeResponse as InvoiceAddChargeResponse, type InvoiceListBreakdownsResponse as InvoiceListBreakdownsResponse, type InvoicesCursorPage as InvoicesCursorPage, type InvoiceListBreakdownsResponsesCursorPage as InvoiceListBreakdownsResponsesCursorPage, type InvoiceRetrieveParams as InvoiceRetrieveParams, type InvoiceListParams as InvoiceListParams, type InvoiceAddChargeParams as InvoiceAddChargeParams, type InvoiceListBreakdownsParams as InvoiceListBreakdownsParams, type InvoiceRetrievePdfParams as InvoiceRetrievePdfParams, };
|
|
824
|
+
}
|
|
825
|
+
//# sourceMappingURL=invoices.d.mts.map
|