@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
|
@@ -1,12 +1,53 @@
|
|
|
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 pagination_1 = require("../../../pagination.js");
|
|
4
|
+
exports.Invoices = void 0;
|
|
5
|
+
const resource_1 = require("../../../core/resource.js");
|
|
6
|
+
const pagination_1 = require("../../../core/pagination.js");
|
|
7
|
+
const headers_1 = require("../../../internal/headers.js");
|
|
8
|
+
const path_1 = require("../../../internal/utils/path.js");
|
|
7
9
|
class Invoices extends resource_1.APIResource {
|
|
8
10
|
/**
|
|
9
|
-
*
|
|
11
|
+
* Retrieve detailed information for a specific invoice by its unique identifier.
|
|
12
|
+
* This endpoint returns comprehensive invoice data including line items, applied
|
|
13
|
+
* credits, totals, and billing period details for both finalized and draft
|
|
14
|
+
* invoices.
|
|
15
|
+
*
|
|
16
|
+
* ### Use this endpoint to:
|
|
17
|
+
*
|
|
18
|
+
* - Display historical invoice details in customer-facing dashboards or billing
|
|
19
|
+
* portals.
|
|
20
|
+
* - Retrieve current month draft invoices to show customers their month-to-date
|
|
21
|
+
* spend.
|
|
22
|
+
* - Access finalized invoices for historical billing records and payment
|
|
23
|
+
* reconciliation.
|
|
24
|
+
* - Validate customer pricing and credit applications for customer support
|
|
25
|
+
* queries.
|
|
26
|
+
*
|
|
27
|
+
* ### Key response fields:
|
|
28
|
+
*
|
|
29
|
+
* Invoice status (DRAFT, FINALIZED, VOID) Billing period start and end dates Total
|
|
30
|
+
* amount and amount due after credits Detailed line items broken down by:
|
|
31
|
+
*
|
|
32
|
+
* - Customer and contract information
|
|
33
|
+
* - Invoice line item type
|
|
34
|
+
* - Product/service name and ID
|
|
35
|
+
* - Quantity consumed
|
|
36
|
+
* - Unit and total price
|
|
37
|
+
* - Time period for usage-based charges
|
|
38
|
+
* - Applied credits or prepaid commitments
|
|
39
|
+
*
|
|
40
|
+
* ### Usage guidelines:
|
|
41
|
+
*
|
|
42
|
+
* - Draft invoices update in real-time as usage is reported and may change before
|
|
43
|
+
* finalization
|
|
44
|
+
* - The response includes both usage-based line items (e.g., API calls, data
|
|
45
|
+
* processed) and scheduled charges (e.g., monthly subscriptions, commitment
|
|
46
|
+
* fees)
|
|
47
|
+
* - Credit and commitment applications are shown as separate line items with
|
|
48
|
+
* negative amounts
|
|
49
|
+
* - For voided invoices, the response will indicate VOID status but retain all
|
|
50
|
+
* original line item details
|
|
10
51
|
*
|
|
11
52
|
* @example
|
|
12
53
|
* ```ts
|
|
@@ -20,11 +61,55 @@ class Invoices extends resource_1.APIResource {
|
|
|
20
61
|
*/
|
|
21
62
|
retrieve(params, options) {
|
|
22
63
|
const { customer_id, invoice_id, ...query } = params;
|
|
23
|
-
return this._client.get(`/v1/customers/${customer_id}/invoices/${invoice_id}`, { query, ...options });
|
|
64
|
+
return this._client.get((0, path_1.path) `/v1/customers/${customer_id}/invoices/${invoice_id}`, { query, ...options });
|
|
24
65
|
}
|
|
25
66
|
/**
|
|
26
|
-
*
|
|
27
|
-
* range,
|
|
67
|
+
* Retrieves a paginated list of invoices for a specific customer, with flexible
|
|
68
|
+
* filtering options to narrow results by status, date range, credit type, and
|
|
69
|
+
* more. This endpoint provides a comprehensive view of a customer's billing
|
|
70
|
+
* history and current charges, supporting both real-time billing dashboards and
|
|
71
|
+
* historical reporting needs.
|
|
72
|
+
*
|
|
73
|
+
* ### Use this endpoint to:
|
|
74
|
+
*
|
|
75
|
+
* - Display historical invoice details in customer-facing dashboards or billing
|
|
76
|
+
* portals.
|
|
77
|
+
* - Retrieve current month draft invoices to show customers their month-to-date
|
|
78
|
+
* spend.
|
|
79
|
+
* - Access finalized invoices for historical billing records and payment
|
|
80
|
+
* reconciliation.
|
|
81
|
+
* - Validate customer pricing and credit applications for customer support
|
|
82
|
+
* queries.
|
|
83
|
+
* - Generate financial reports by filtering invoices within specific date ranges
|
|
84
|
+
*
|
|
85
|
+
* ### Key response fields:
|
|
86
|
+
*
|
|
87
|
+
* Array of invoice objects containing:
|
|
88
|
+
*
|
|
89
|
+
* - Invoice ID and status (DRAFT, FINALIZED, VOID)
|
|
90
|
+
* - Invoice type (USAGE, SCHEDULED)
|
|
91
|
+
* - Billing period start and end dates
|
|
92
|
+
* - Issue date and due date
|
|
93
|
+
* - Total amount, subtotal, and amount due
|
|
94
|
+
* - Applied credits summary
|
|
95
|
+
* - Contract ID reference
|
|
96
|
+
* - External billing provider status (if integrated with Stripe, etc.)
|
|
97
|
+
* - Pagination metadata `next_page` cursor
|
|
98
|
+
*
|
|
99
|
+
* ### Usage guidelines:
|
|
100
|
+
*
|
|
101
|
+
* - The endpoint returns invoice summaries; use the Get Invoice endpoint for
|
|
102
|
+
* detailed line items
|
|
103
|
+
* - Draft invoices are continuously updated as new usage is reported and will show
|
|
104
|
+
* real-time spend
|
|
105
|
+
* - Results are ordered by creation date descending by default (newest first)
|
|
106
|
+
* - When filtering by date range, the filter applies to the billing period, not
|
|
107
|
+
* the issue date
|
|
108
|
+
* - For customers with many invoices, implement pagination to ensure all results
|
|
109
|
+
* are retrieved External billing provider statuses (like Stripe payment status)
|
|
110
|
+
* are included when applicable
|
|
111
|
+
* - Voided invoices are included in results by default unless filtered out by
|
|
112
|
+
* status
|
|
28
113
|
*
|
|
29
114
|
* @example
|
|
30
115
|
* ```ts
|
|
@@ -38,7 +123,7 @@ class Invoices extends resource_1.APIResource {
|
|
|
38
123
|
*/
|
|
39
124
|
list(params, options) {
|
|
40
125
|
const { customer_id, ...query } = params;
|
|
41
|
-
return this._client.getAPIList(`/v1/customers/${customer_id}/invoices`,
|
|
126
|
+
return this._client.getAPIList((0, path_1.path) `/v1/customers/${customer_id}/invoices`, (pagination_1.CursorPage), {
|
|
42
127
|
query,
|
|
43
128
|
...options,
|
|
44
129
|
});
|
|
@@ -63,14 +148,47 @@ class Invoices extends resource_1.APIResource {
|
|
|
63
148
|
*/
|
|
64
149
|
addCharge(params, options) {
|
|
65
150
|
const { customer_id, ...body } = params;
|
|
66
|
-
return this._client.post(`/v1/customers/${customer_id}/addCharge`, { body, ...options });
|
|
151
|
+
return this._client.post((0, path_1.path) `/v1/customers/${customer_id}/addCharge`, { body, ...options });
|
|
67
152
|
}
|
|
68
153
|
/**
|
|
69
|
-
*
|
|
70
|
-
*
|
|
154
|
+
* Retrieve granular time-series breakdowns of invoice data at hourly or daily
|
|
155
|
+
* intervals. This endpoint transforms standard invoices into detailed timelines,
|
|
156
|
+
* enabling you to track usage patterns, identify consumption spikes, and provide
|
|
157
|
+
* customers with transparency into their billing details throughout the billing
|
|
158
|
+
* period.
|
|
159
|
+
*
|
|
160
|
+
* ### Use this endpoint to:
|
|
161
|
+
*
|
|
162
|
+
* - Build usage analytics dashboards showing daily or hourly consumption trends
|
|
163
|
+
* - Identify peak usage periods for capacity planning and cost optimization
|
|
164
|
+
* - Generate detailed billing reports for finance teams and customer success
|
|
165
|
+
* - Troubleshoot billing disputes by examining usage patterns at specific times
|
|
166
|
+
* - Power real-time cost monitoring and alerting systems
|
|
71
167
|
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
168
|
+
* ### Key response fields:
|
|
169
|
+
*
|
|
170
|
+
* An array of BreakdownInvoice objects, each containing:
|
|
171
|
+
*
|
|
172
|
+
* - All standard invoice fields (ID, customer, commit, line items, totals, status)
|
|
173
|
+
* - Line items with quantities and costs for that specific period
|
|
174
|
+
* - `breakdown_start_timestamp`: Start of the specific time window
|
|
175
|
+
* - `breakdown_end_timestamp`: End of the specific time window
|
|
176
|
+
* - `next_page`: Pagination cursor for large result sets
|
|
177
|
+
*
|
|
178
|
+
* ### Usage guidelines:
|
|
179
|
+
*
|
|
180
|
+
* - Time granularity: Set `window_size` to hour or day based on your analysis
|
|
181
|
+
* needs
|
|
182
|
+
* - Response limits: Daily breakdowns return up to 35 days; hourly breakdowns
|
|
183
|
+
* return up to 24 hours per request
|
|
184
|
+
* - Date filtering: Use `starting_on` and `ending_before` to focus on specific
|
|
185
|
+
* periods
|
|
186
|
+
* - Performance: For large date ranges, use pagination to retrieve all data
|
|
187
|
+
* efficiently
|
|
188
|
+
* - Backdated usage: If usage events arrive after invoice finalization, breakdowns
|
|
189
|
+
* will reflect the updated usage
|
|
190
|
+
* - Zero quantity filtering: Use `skip_zero_qty_line_items=true` to exclude
|
|
191
|
+
* periods with no usage
|
|
74
192
|
*
|
|
75
193
|
* @example
|
|
76
194
|
* ```ts
|
|
@@ -88,16 +206,56 @@ class Invoices extends resource_1.APIResource {
|
|
|
88
206
|
*/
|
|
89
207
|
listBreakdowns(params, options) {
|
|
90
208
|
const { customer_id, ...query } = params;
|
|
91
|
-
return this._client.getAPIList(`/v1/customers/${customer_id}/invoices/breakdowns`,
|
|
209
|
+
return this._client.getAPIList((0, path_1.path) `/v1/customers/${customer_id}/invoices/breakdowns`, (pagination_1.CursorPage), { query, ...options });
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Retrieve a PDF version of a specific invoice by its unique identifier. This
|
|
213
|
+
* endpoint generates a professionally formatted invoice document suitable for
|
|
214
|
+
* sharing with customers, accounting teams, or for record-keeping purposes.
|
|
215
|
+
*
|
|
216
|
+
* ### Use this endpoint to:
|
|
217
|
+
*
|
|
218
|
+
* - Provide customers with downloadable or emailable copies of their invoices
|
|
219
|
+
* - Support accounting and finance teams with official billing documents
|
|
220
|
+
* - Maintain accurate records of billing transactions for audits and compliance
|
|
221
|
+
*
|
|
222
|
+
* ### Key response details:
|
|
223
|
+
*
|
|
224
|
+
* - The response is a binary PDF file representing the full invoice
|
|
225
|
+
* - The PDF includes all standard invoice information such as line items, totals,
|
|
226
|
+
* billing period, and customer details
|
|
227
|
+
* - The document is formatted for clarity and professionalism, suitable for
|
|
228
|
+
* official use
|
|
229
|
+
*
|
|
230
|
+
* ### Usage guidelines:
|
|
231
|
+
*
|
|
232
|
+
* - Ensure the `invoice_id` corresponds to an existing invoice for the specified
|
|
233
|
+
* `customer_id`
|
|
234
|
+
* - The PDF is generated on-demand; frequent requests for the same invoice may
|
|
235
|
+
* impact performance
|
|
236
|
+
* - Use appropriate headers to handle the binary response in your application
|
|
237
|
+
* (e.g., setting `Content-Type: application/pdf`)
|
|
238
|
+
*
|
|
239
|
+
* @example
|
|
240
|
+
* ```ts
|
|
241
|
+
* const response =
|
|
242
|
+
* await client.v1.customers.invoices.retrievePdf({
|
|
243
|
+
* customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
244
|
+
* invoice_id: '6a37bb88-8538-48c5-b37b-a41c836328bd',
|
|
245
|
+
* });
|
|
246
|
+
*
|
|
247
|
+
* const content = await response.blob();
|
|
248
|
+
* console.log(content);
|
|
249
|
+
* ```
|
|
250
|
+
*/
|
|
251
|
+
retrievePdf(params, options) {
|
|
252
|
+
const { customer_id, invoice_id } = params;
|
|
253
|
+
return this._client.get((0, path_1.path) `/v1/customers/${customer_id}/invoices/${invoice_id}/pdf`, {
|
|
254
|
+
...options,
|
|
255
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: 'application/pdf' }, options?.headers]),
|
|
256
|
+
__binaryResponse: true,
|
|
257
|
+
});
|
|
92
258
|
}
|
|
93
259
|
}
|
|
94
260
|
exports.Invoices = Invoices;
|
|
95
|
-
class InvoicesCursorPage extends pagination_1.CursorPage {
|
|
96
|
-
}
|
|
97
|
-
exports.InvoicesCursorPage = InvoicesCursorPage;
|
|
98
|
-
class InvoiceListBreakdownsResponsesCursorPage extends pagination_1.CursorPage {
|
|
99
|
-
}
|
|
100
|
-
exports.InvoiceListBreakdownsResponsesCursorPage = InvoiceListBreakdownsResponsesCursorPage;
|
|
101
|
-
Invoices.InvoicesCursorPage = InvoicesCursorPage;
|
|
102
|
-
Invoices.InvoiceListBreakdownsResponsesCursorPage = InvoiceListBreakdownsResponsesCursorPage;
|
|
103
261
|
//# sourceMappingURL=invoices.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoices.js","sourceRoot":"","sources":["../../../src/resources/v1/customers/invoices.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,
|
|
1
|
+
{"version":3,"file":"invoices.js","sourceRoot":"","sources":["../../../src/resources/v1/customers/invoices.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAGrD,4DAA0F;AAC1F,0DAAyD;AAEzD,0DAAoD;AAEpD,MAAa,QAAS,SAAQ,sBAAW;IACvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmDG;IACH,QAAQ,CAAC,MAA6B,EAAE,OAAwB;QAC9D,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,iBAAiB,WAAW,aAAa,UAAU,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5G,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyDG;IACH,IAAI,CAAC,MAAyB,EAAE,OAAwB;QACtD,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAA,WAAI,EAAA,iBAAiB,WAAW,WAAW,EAAE,CAAA,uBAAmB,CAAA,EAAE;YAC/F,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,SAAS,CAAC,MAA8B,EAAE,OAAwB;QAChE,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACxC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,iBAAiB,WAAW,YAAY,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/F,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqDG;IACH,cAAc,CACZ,MAAmC,EACnC,OAAwB;QAExB,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAA,WAAI,EAAA,iBAAiB,WAAW,sBAAsB,EACtD,CAAA,uBAAyC,CAAA,EACzC,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACtB,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;IACH,WAAW,CAAC,MAAgC,EAAE,OAAwB;QACpE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,iBAAiB,WAAW,aAAa,UAAU,MAAM,EAAE;YACrF,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,iBAAiB,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YACxE,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;IACL,CAAC;CACF;AArQD,4BAqQC"}
|
|
@@ -1,9 +1,50 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
import { APIResource } from "../../../resource.mjs";
|
|
3
|
-
import { CursorPage } from "../../../pagination.mjs";
|
|
2
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
3
|
+
import { CursorPage } from "../../../core/pagination.mjs";
|
|
4
|
+
import { buildHeaders } from "../../../internal/headers.mjs";
|
|
5
|
+
import { path } from "../../../internal/utils/path.mjs";
|
|
4
6
|
export class Invoices extends APIResource {
|
|
5
7
|
/**
|
|
6
|
-
*
|
|
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
|
|
7
48
|
*
|
|
8
49
|
* @example
|
|
9
50
|
* ```ts
|
|
@@ -17,11 +58,55 @@ export class Invoices extends APIResource {
|
|
|
17
58
|
*/
|
|
18
59
|
retrieve(params, options) {
|
|
19
60
|
const { customer_id, invoice_id, ...query } = params;
|
|
20
|
-
return this._client.get(`/v1/customers/${customer_id}/invoices/${invoice_id}`, { query, ...options });
|
|
61
|
+
return this._client.get(path `/v1/customers/${customer_id}/invoices/${invoice_id}`, { query, ...options });
|
|
21
62
|
}
|
|
22
63
|
/**
|
|
23
|
-
*
|
|
24
|
-
* range,
|
|
64
|
+
* Retrieves a paginated list of invoices for a specific customer, with flexible
|
|
65
|
+
* filtering options to narrow results by status, date range, credit type, and
|
|
66
|
+
* more. This endpoint provides a comprehensive view of a customer's billing
|
|
67
|
+
* history and current charges, supporting both real-time billing dashboards and
|
|
68
|
+
* historical reporting needs.
|
|
69
|
+
*
|
|
70
|
+
* ### Use this endpoint to:
|
|
71
|
+
*
|
|
72
|
+
* - Display historical invoice details in customer-facing dashboards or billing
|
|
73
|
+
* portals.
|
|
74
|
+
* - Retrieve current month draft invoices to show customers their month-to-date
|
|
75
|
+
* spend.
|
|
76
|
+
* - Access finalized invoices for historical billing records and payment
|
|
77
|
+
* reconciliation.
|
|
78
|
+
* - Validate customer pricing and credit applications for customer support
|
|
79
|
+
* queries.
|
|
80
|
+
* - Generate financial reports by filtering invoices within specific date ranges
|
|
81
|
+
*
|
|
82
|
+
* ### Key response fields:
|
|
83
|
+
*
|
|
84
|
+
* Array of invoice objects containing:
|
|
85
|
+
*
|
|
86
|
+
* - Invoice ID and status (DRAFT, FINALIZED, VOID)
|
|
87
|
+
* - Invoice type (USAGE, SCHEDULED)
|
|
88
|
+
* - Billing period start and end dates
|
|
89
|
+
* - Issue date and due date
|
|
90
|
+
* - Total amount, subtotal, and amount due
|
|
91
|
+
* - Applied credits summary
|
|
92
|
+
* - Contract ID reference
|
|
93
|
+
* - External billing provider status (if integrated with Stripe, etc.)
|
|
94
|
+
* - Pagination metadata `next_page` cursor
|
|
95
|
+
*
|
|
96
|
+
* ### Usage guidelines:
|
|
97
|
+
*
|
|
98
|
+
* - The endpoint returns invoice summaries; use the Get Invoice endpoint for
|
|
99
|
+
* detailed line items
|
|
100
|
+
* - Draft invoices are continuously updated as new usage is reported and will show
|
|
101
|
+
* real-time spend
|
|
102
|
+
* - Results are ordered by creation date descending by default (newest first)
|
|
103
|
+
* - When filtering by date range, the filter applies to the billing period, not
|
|
104
|
+
* the issue date
|
|
105
|
+
* - For customers with many invoices, implement pagination to ensure all results
|
|
106
|
+
* are retrieved External billing provider statuses (like Stripe payment status)
|
|
107
|
+
* are included when applicable
|
|
108
|
+
* - Voided invoices are included in results by default unless filtered out by
|
|
109
|
+
* status
|
|
25
110
|
*
|
|
26
111
|
* @example
|
|
27
112
|
* ```ts
|
|
@@ -35,7 +120,7 @@ export class Invoices extends APIResource {
|
|
|
35
120
|
*/
|
|
36
121
|
list(params, options) {
|
|
37
122
|
const { customer_id, ...query } = params;
|
|
38
|
-
return this._client.getAPIList(`/v1/customers/${customer_id}/invoices`,
|
|
123
|
+
return this._client.getAPIList(path `/v1/customers/${customer_id}/invoices`, (CursorPage), {
|
|
39
124
|
query,
|
|
40
125
|
...options,
|
|
41
126
|
});
|
|
@@ -60,14 +145,47 @@ export class Invoices extends APIResource {
|
|
|
60
145
|
*/
|
|
61
146
|
addCharge(params, options) {
|
|
62
147
|
const { customer_id, ...body } = params;
|
|
63
|
-
return this._client.post(`/v1/customers/${customer_id}/addCharge`, { body, ...options });
|
|
148
|
+
return this._client.post(path `/v1/customers/${customer_id}/addCharge`, { body, ...options });
|
|
64
149
|
}
|
|
65
150
|
/**
|
|
66
|
-
*
|
|
67
|
-
*
|
|
151
|
+
* Retrieve granular time-series breakdowns of invoice data at hourly or daily
|
|
152
|
+
* intervals. This endpoint transforms standard invoices into detailed timelines,
|
|
153
|
+
* enabling you to track usage patterns, identify consumption spikes, and provide
|
|
154
|
+
* customers with transparency into their billing details throughout the billing
|
|
155
|
+
* period.
|
|
156
|
+
*
|
|
157
|
+
* ### Use this endpoint to:
|
|
158
|
+
*
|
|
159
|
+
* - Build usage analytics dashboards showing daily or hourly consumption trends
|
|
160
|
+
* - Identify peak usage periods for capacity planning and cost optimization
|
|
161
|
+
* - Generate detailed billing reports for finance teams and customer success
|
|
162
|
+
* - Troubleshoot billing disputes by examining usage patterns at specific times
|
|
163
|
+
* - Power real-time cost monitoring and alerting systems
|
|
68
164
|
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
165
|
+
* ### Key response fields:
|
|
166
|
+
*
|
|
167
|
+
* An array of BreakdownInvoice objects, each containing:
|
|
168
|
+
*
|
|
169
|
+
* - All standard invoice fields (ID, customer, commit, line items, totals, status)
|
|
170
|
+
* - Line items with quantities and costs for that specific period
|
|
171
|
+
* - `breakdown_start_timestamp`: Start of the specific time window
|
|
172
|
+
* - `breakdown_end_timestamp`: End of the specific time window
|
|
173
|
+
* - `next_page`: Pagination cursor for large result sets
|
|
174
|
+
*
|
|
175
|
+
* ### Usage guidelines:
|
|
176
|
+
*
|
|
177
|
+
* - Time granularity: Set `window_size` to hour or day based on your analysis
|
|
178
|
+
* needs
|
|
179
|
+
* - Response limits: Daily breakdowns return up to 35 days; hourly breakdowns
|
|
180
|
+
* return up to 24 hours per request
|
|
181
|
+
* - Date filtering: Use `starting_on` and `ending_before` to focus on specific
|
|
182
|
+
* periods
|
|
183
|
+
* - Performance: For large date ranges, use pagination to retrieve all data
|
|
184
|
+
* efficiently
|
|
185
|
+
* - Backdated usage: If usage events arrive after invoice finalization, breakdowns
|
|
186
|
+
* will reflect the updated usage
|
|
187
|
+
* - Zero quantity filtering: Use `skip_zero_qty_line_items=true` to exclude
|
|
188
|
+
* periods with no usage
|
|
71
189
|
*
|
|
72
190
|
* @example
|
|
73
191
|
* ```ts
|
|
@@ -85,13 +203,55 @@ export class Invoices extends APIResource {
|
|
|
85
203
|
*/
|
|
86
204
|
listBreakdowns(params, options) {
|
|
87
205
|
const { customer_id, ...query } = params;
|
|
88
|
-
return this._client.getAPIList(`/v1/customers/${customer_id}/invoices/breakdowns`,
|
|
206
|
+
return this._client.getAPIList(path `/v1/customers/${customer_id}/invoices/breakdowns`, (CursorPage), { query, ...options });
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Retrieve a PDF version of a specific invoice by its unique identifier. This
|
|
210
|
+
* endpoint generates a professionally formatted invoice document suitable for
|
|
211
|
+
* sharing with customers, accounting teams, or for record-keeping purposes.
|
|
212
|
+
*
|
|
213
|
+
* ### Use this endpoint to:
|
|
214
|
+
*
|
|
215
|
+
* - Provide customers with downloadable or emailable copies of their invoices
|
|
216
|
+
* - Support accounting and finance teams with official billing documents
|
|
217
|
+
* - Maintain accurate records of billing transactions for audits and compliance
|
|
218
|
+
*
|
|
219
|
+
* ### Key response details:
|
|
220
|
+
*
|
|
221
|
+
* - The response is a binary PDF file representing the full invoice
|
|
222
|
+
* - The PDF includes all standard invoice information such as line items, totals,
|
|
223
|
+
* billing period, and customer details
|
|
224
|
+
* - The document is formatted for clarity and professionalism, suitable for
|
|
225
|
+
* official use
|
|
226
|
+
*
|
|
227
|
+
* ### Usage guidelines:
|
|
228
|
+
*
|
|
229
|
+
* - Ensure the `invoice_id` corresponds to an existing invoice for the specified
|
|
230
|
+
* `customer_id`
|
|
231
|
+
* - The PDF is generated on-demand; frequent requests for the same invoice may
|
|
232
|
+
* impact performance
|
|
233
|
+
* - Use appropriate headers to handle the binary response in your application
|
|
234
|
+
* (e.g., setting `Content-Type: application/pdf`)
|
|
235
|
+
*
|
|
236
|
+
* @example
|
|
237
|
+
* ```ts
|
|
238
|
+
* const response =
|
|
239
|
+
* await client.v1.customers.invoices.retrievePdf({
|
|
240
|
+
* customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
241
|
+
* invoice_id: '6a37bb88-8538-48c5-b37b-a41c836328bd',
|
|
242
|
+
* });
|
|
243
|
+
*
|
|
244
|
+
* const content = await response.blob();
|
|
245
|
+
* console.log(content);
|
|
246
|
+
* ```
|
|
247
|
+
*/
|
|
248
|
+
retrievePdf(params, options) {
|
|
249
|
+
const { customer_id, invoice_id } = params;
|
|
250
|
+
return this._client.get(path `/v1/customers/${customer_id}/invoices/${invoice_id}/pdf`, {
|
|
251
|
+
...options,
|
|
252
|
+
headers: buildHeaders([{ Accept: 'application/pdf' }, options?.headers]),
|
|
253
|
+
__binaryResponse: true,
|
|
254
|
+
});
|
|
89
255
|
}
|
|
90
256
|
}
|
|
91
|
-
export class InvoicesCursorPage extends CursorPage {
|
|
92
|
-
}
|
|
93
|
-
export class InvoiceListBreakdownsResponsesCursorPage extends CursorPage {
|
|
94
|
-
}
|
|
95
|
-
Invoices.InvoicesCursorPage = InvoicesCursorPage;
|
|
96
|
-
Invoices.InvoiceListBreakdownsResponsesCursorPage = InvoiceListBreakdownsResponsesCursorPage;
|
|
97
257
|
//# sourceMappingURL=invoices.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoices.mjs","sourceRoot":"","sources":["../../../src/resources/v1/customers/invoices.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"invoices.mjs","sourceRoot":"","sources":["../../../src/resources/v1/customers/invoices.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,UAAU,EAAsC;OAClD,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmDG;IACH,QAAQ,CAAC,MAA6B,EAAE,OAAwB;QAC9D,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,iBAAiB,WAAW,aAAa,UAAU,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5G,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyDG;IACH,IAAI,CAAC,MAAyB,EAAE,OAAwB;QACtD,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAA,iBAAiB,WAAW,WAAW,EAAE,CAAA,UAAmB,CAAA,EAAE;YAC/F,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,SAAS,CAAC,MAA8B,EAAE,OAAwB;QAChE,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACxC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,iBAAiB,WAAW,YAAY,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/F,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqDG;IACH,cAAc,CACZ,MAAmC,EACnC,OAAwB;QAExB,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAI,CAAA,iBAAiB,WAAW,sBAAsB,EACtD,CAAA,UAAyC,CAAA,EACzC,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACtB,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;IACH,WAAW,CAAC,MAAgC,EAAE,OAAwB;QACpE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,iBAAiB,WAAW,aAAa,UAAU,MAAM,EAAE;YACrF,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,iBAAiB,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YACxE,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../../../core/api-promise.mjs";
|
|
3
|
+
import { RequestOptions } from "../../../internal/request-options.mjs";
|
|
4
|
+
export declare class NamedSchedules extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Get a named schedule for the given customer. This endpoint's availability is
|
|
7
|
+
* dependent on your client's configuration.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const namedSchedule =
|
|
12
|
+
* await client.v1.customers.namedSchedules.retrieve({
|
|
13
|
+
* customer_id: '9b85c1c1-5238-4f2a-a409-61412905e1e1',
|
|
14
|
+
* schedule_name: 'my-schedule',
|
|
15
|
+
* covering_date: '2022-02-15T00:00:00Z',
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
retrieve(body: NamedScheduleRetrieveParams, options?: RequestOptions): APIPromise<NamedScheduleRetrieveResponse>;
|
|
20
|
+
/**
|
|
21
|
+
* Update a named schedule for the given customer. This endpoint's availability is
|
|
22
|
+
* dependent on your client's configuration.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* await client.v1.customers.namedSchedules.update({
|
|
27
|
+
* customer_id: '9b85c1c1-5238-4f2a-a409-61412905e1e1',
|
|
28
|
+
* schedule_name: 'my-schedule',
|
|
29
|
+
* starting_at: '2022-02-01T00:00:00Z',
|
|
30
|
+
* value: { my_key: 'my_value' },
|
|
31
|
+
* ending_before: '2022-02-15T00:00:00Z',
|
|
32
|
+
* });
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
update(body: NamedScheduleUpdateParams, options?: RequestOptions): APIPromise<void>;
|
|
36
|
+
}
|
|
37
|
+
export interface NamedScheduleRetrieveResponse {
|
|
38
|
+
data: Array<NamedScheduleRetrieveResponse.Data>;
|
|
39
|
+
}
|
|
40
|
+
export declare namespace NamedScheduleRetrieveResponse {
|
|
41
|
+
interface Data {
|
|
42
|
+
starting_at: string;
|
|
43
|
+
value: unknown;
|
|
44
|
+
ending_before?: string;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export interface NamedScheduleRetrieveParams {
|
|
48
|
+
/**
|
|
49
|
+
* ID of the customer whose named schedule is to be retrieved
|
|
50
|
+
*/
|
|
51
|
+
customer_id: string;
|
|
52
|
+
/**
|
|
53
|
+
* The identifier for the schedule to be retrieved
|
|
54
|
+
*/
|
|
55
|
+
schedule_name: string;
|
|
56
|
+
/**
|
|
57
|
+
* If provided, at most one schedule segment will be returned (the one that covers
|
|
58
|
+
* this date). If not provided, all segments will be returned.
|
|
59
|
+
*/
|
|
60
|
+
covering_date?: string;
|
|
61
|
+
}
|
|
62
|
+
export interface NamedScheduleUpdateParams {
|
|
63
|
+
/**
|
|
64
|
+
* ID of the customer whose named schedule is to be updated
|
|
65
|
+
*/
|
|
66
|
+
customer_id: string;
|
|
67
|
+
/**
|
|
68
|
+
* The identifier for the schedule to be updated
|
|
69
|
+
*/
|
|
70
|
+
schedule_name: string;
|
|
71
|
+
starting_at: string;
|
|
72
|
+
/**
|
|
73
|
+
* The value to set for the named schedule. The structure of this object is
|
|
74
|
+
* specific to the named schedule.
|
|
75
|
+
*/
|
|
76
|
+
value: unknown;
|
|
77
|
+
ending_before?: string;
|
|
78
|
+
}
|
|
79
|
+
export declare namespace NamedSchedules {
|
|
80
|
+
export { type NamedScheduleRetrieveResponse as NamedScheduleRetrieveResponse, type NamedScheduleRetrieveParams as NamedScheduleRetrieveParams, type NamedScheduleUpdateParams as NamedScheduleUpdateParams, };
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=named-schedules.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"named-schedules.d.mts","sourceRoot":"","sources":["../../../src/resources/v1/customers/named-schedules.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAEzB,qBAAa,cAAe,SAAQ,WAAW;IAC7C;;;;;;;;;;;;;OAaG;IACH,QAAQ,CACN,IAAI,EAAE,2BAA2B,EACjC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,6BAA6B,CAAC;IAI5C;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,IAAI,EAAE,yBAAyB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;CAOpF;AAED,MAAM,WAAW,6BAA6B;IAC5C,IAAI,EAAE,KAAK,CAAC,6BAA6B,CAAC,IAAI,CAAC,CAAC;CACjD;AAED,yBAAiB,6BAA6B,CAAC;IAC7C,UAAiB,IAAI;QACnB,WAAW,EAAE,MAAM,CAAC;QAEpB,KAAK,EAAE,OAAO,CAAC;QAEf,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB;CACF;AAED,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB,WAAW,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,KAAK,EAAE,OAAO,CAAC;IAEf,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,WAAW,cAAc,CAAC;IACtC,OAAO,EACL,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,yBAAyB,IAAI,yBAAyB,GAC5D,CAAC;CACH"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { APIResource } from "../../../resource.js";
|
|
2
|
-
import
|
|
1
|
+
import { APIResource } from "../../../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../../../core/api-promise.js";
|
|
3
|
+
import { RequestOptions } from "../../../internal/request-options.js";
|
|
3
4
|
export declare class NamedSchedules extends APIResource {
|
|
4
5
|
/**
|
|
5
6
|
* Get a named schedule for the given customer. This endpoint's availability is
|
|
@@ -15,7 +16,7 @@ export declare class NamedSchedules extends APIResource {
|
|
|
15
16
|
* });
|
|
16
17
|
* ```
|
|
17
18
|
*/
|
|
18
|
-
retrieve(body: NamedScheduleRetrieveParams, options?:
|
|
19
|
+
retrieve(body: NamedScheduleRetrieveParams, options?: RequestOptions): APIPromise<NamedScheduleRetrieveResponse>;
|
|
19
20
|
/**
|
|
20
21
|
* Update a named schedule for the given customer. This endpoint's availability is
|
|
21
22
|
* dependent on your client's configuration.
|
|
@@ -31,7 +32,7 @@ export declare class NamedSchedules extends APIResource {
|
|
|
31
32
|
* });
|
|
32
33
|
* ```
|
|
33
34
|
*/
|
|
34
|
-
update(body: NamedScheduleUpdateParams, options?:
|
|
35
|
+
update(body: NamedScheduleUpdateParams, options?: RequestOptions): APIPromise<void>;
|
|
35
36
|
}
|
|
36
37
|
export interface NamedScheduleRetrieveResponse {
|
|
37
38
|
data: Array<NamedScheduleRetrieveResponse.Data>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"named-schedules.d.ts","sourceRoot":"","sources":["../../../src/resources/v1/customers/named-schedules.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"named-schedules.d.ts","sourceRoot":"","sources":["../../../src/resources/v1/customers/named-schedules.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAEzB,qBAAa,cAAe,SAAQ,WAAW;IAC7C;;;;;;;;;;;;;OAaG;IACH,QAAQ,CACN,IAAI,EAAE,2BAA2B,EACjC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,6BAA6B,CAAC;IAI5C;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,IAAI,EAAE,yBAAyB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;CAOpF;AAED,MAAM,WAAW,6BAA6B;IAC5C,IAAI,EAAE,KAAK,CAAC,6BAA6B,CAAC,IAAI,CAAC,CAAC;CACjD;AAED,yBAAiB,6BAA6B,CAAC;IAC7C,UAAiB,IAAI;QACnB,WAAW,EAAE,MAAM,CAAC;QAEpB,KAAK,EAAE,OAAO,CAAC;QAEf,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB;CACF;AAED,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB,WAAW,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,KAAK,EAAE,OAAO,CAAC;IAEf,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,WAAW,cAAc,CAAC;IACtC,OAAO,EACL,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,yBAAyB,IAAI,yBAAyB,GAC5D,CAAC;CACH"}
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.NamedSchedules = void 0;
|
|
5
|
-
const resource_1 = require("../../../resource.js");
|
|
5
|
+
const resource_1 = require("../../../core/resource.js");
|
|
6
|
+
const headers_1 = require("../../../internal/headers.js");
|
|
6
7
|
class NamedSchedules extends resource_1.APIResource {
|
|
7
8
|
/**
|
|
8
9
|
* Get a named schedule for the given customer. This endpoint's availability is
|
|
@@ -40,7 +41,7 @@ class NamedSchedules extends resource_1.APIResource {
|
|
|
40
41
|
return this._client.post('/v1/customers/updateNamedSchedule', {
|
|
41
42
|
body,
|
|
42
43
|
...options,
|
|
43
|
-
headers: { Accept: '*/*',
|
|
44
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
44
45
|
});
|
|
45
46
|
}
|
|
46
47
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"named-schedules.js","sourceRoot":"","sources":["../../../src/resources/v1/customers/named-schedules.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,
|
|
1
|
+
{"version":3,"file":"named-schedules.js","sourceRoot":"","sources":["../../../src/resources/v1/customers/named-schedules.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAErD,0DAAyD;AAGzD,MAAa,cAAe,SAAQ,sBAAW;IAC7C;;;;;;;;;;;;;OAaG;IACH,QAAQ,CACN,IAAiC,EACjC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gCAAgC,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnF,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,IAA+B,EAAE,OAAwB;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,mCAAmC,EAAE;YAC5D,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF;AA5CD,wCA4CC"}
|