@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,3006 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
2
|
+
import * as Shared from "../../shared.mjs";
|
|
3
|
+
import * as NamedSchedulesAPI from "./named-schedules.mjs";
|
|
4
|
+
import { NamedScheduleRetrieveParams, NamedScheduleRetrieveResponse, NamedScheduleUpdateParams, NamedSchedules } from "./named-schedules.mjs";
|
|
5
|
+
import * as ProductsAPI from "./products.mjs";
|
|
6
|
+
import { ProductArchiveParams, ProductArchiveResponse, ProductCreateParams, ProductCreateResponse, ProductListItemState, ProductListParams, ProductListResponse, ProductListResponsesCursorPage, ProductRetrieveParams, ProductRetrieveResponse, ProductUpdateParams, ProductUpdateResponse, Products, QuantityConversion, QuantityRounding } from "./products.mjs";
|
|
7
|
+
import * as InvoicesAPI from "../customers/invoices.mjs";
|
|
8
|
+
import * as RateCardsAPI from "./rate-cards/rate-cards.mjs";
|
|
9
|
+
import { RateCardArchiveParams, RateCardArchiveResponse, RateCardCreateParams, RateCardCreateResponse, RateCardListParams, RateCardListResponse, RateCardListResponsesCursorPage, RateCardRetrieveParams, RateCardRetrieveRateScheduleParams, RateCardRetrieveRateScheduleResponse, RateCardRetrieveResponse, RateCardUpdateParams, RateCardUpdateResponse, RateCards } from "./rate-cards/rate-cards.mjs";
|
|
10
|
+
import { APIPromise } from "../../../core/api-promise.mjs";
|
|
11
|
+
import { BodyCursorPage, type BodyCursorPageParams, PagePromise } from "../../../core/pagination.mjs";
|
|
12
|
+
import { RequestOptions } from "../../../internal/request-options.mjs";
|
|
13
|
+
export declare class Contracts extends APIResource {
|
|
14
|
+
products: ProductsAPI.Products;
|
|
15
|
+
rateCards: RateCardsAPI.RateCards;
|
|
16
|
+
namedSchedules: NamedSchedulesAPI.NamedSchedules;
|
|
17
|
+
/**
|
|
18
|
+
* Contracts define a customer's products, pricing, discounts, access duration, and
|
|
19
|
+
* billing configuration. Contracts serve as the central billing agreement for both
|
|
20
|
+
* PLG and Enterprise customers, you can automatically customers access to your
|
|
21
|
+
* products and services directly from your product or CRM.
|
|
22
|
+
*
|
|
23
|
+
* ### Use this endpoint to:
|
|
24
|
+
*
|
|
25
|
+
* - PLG onboarding: Automatically provision new self-serve customers with
|
|
26
|
+
* contracts when they sign up.
|
|
27
|
+
* - Enterprise sales: Push negotiated contracts from Salesforce with custom
|
|
28
|
+
* pricing and commitments
|
|
29
|
+
* - Promotional pricing: Implement time-limited discounts and free trials through
|
|
30
|
+
* overrides
|
|
31
|
+
*
|
|
32
|
+
* ### Key components:
|
|
33
|
+
*
|
|
34
|
+
* #### Contract Term and Billing Schedule
|
|
35
|
+
*
|
|
36
|
+
* - Set contract duration using `starting_at` and `ending_before` fields. PLG
|
|
37
|
+
* contracts typically use perpetual agreements (no end date), while Enterprise
|
|
38
|
+
* contracts have fixed end dates which can be edited over time in the case of
|
|
39
|
+
* co-term upsells.
|
|
40
|
+
*
|
|
41
|
+
* #### Rate Card
|
|
42
|
+
*
|
|
43
|
+
* If you are offering usage based pricing, you can set a rate card for the
|
|
44
|
+
* contract to reference through `rate_card_id` or `rate_card_alias`. The rate card
|
|
45
|
+
* is a store of all of your usage based products and their centralized pricing.
|
|
46
|
+
* Any new products or price changes on the rate card can be set to automatically
|
|
47
|
+
* propagate to all associated contracts - this ensures consistent pricing and
|
|
48
|
+
* product launches flow to contracts without manual updates and migrations. The
|
|
49
|
+
* `usage_statement_schedule` determines the cadence on which Metronome will
|
|
50
|
+
* finalize a usage invoice for the customer. This defaults to monthly on the 1st,
|
|
51
|
+
* with options for custom dates, quarterly, or annual cadences. Note: Most usage
|
|
52
|
+
* based billing companies align usage statements to be evaluated aligned to the
|
|
53
|
+
* first of the month. Read more about
|
|
54
|
+
* [Rate Cards](https://docs.metronome.com/pricing-packaging/create-manage-rate-cards/).
|
|
55
|
+
*
|
|
56
|
+
* #### Overrides and discounts
|
|
57
|
+
*
|
|
58
|
+
* Customize pricing on the contract through time-bounded overrides that can target
|
|
59
|
+
* specific products, product families, or complex usage scenarios. Overrides
|
|
60
|
+
* enable two key capabilities:
|
|
61
|
+
*
|
|
62
|
+
* - Discounts: Apply percentage discounts, fixed rate reductions, or
|
|
63
|
+
* quantity-based pricing tiers
|
|
64
|
+
* - Entitlements: Provide special pricing or access to specific products for
|
|
65
|
+
* negotiated deals
|
|
66
|
+
*
|
|
67
|
+
* Read more about
|
|
68
|
+
* [Contract Overrides](https://docs.metronome.com/manage-product-access/add-contract-override/).
|
|
69
|
+
*
|
|
70
|
+
* #### Commits and Credits
|
|
71
|
+
*
|
|
72
|
+
* Using commits, configure prepaid or postpaid spending commitments where
|
|
73
|
+
* customers promise to spend a certain amount over the contract period paid in
|
|
74
|
+
* advance or in arrears. Use credits to provide free spending allowances. Under
|
|
75
|
+
* the hood these are the same mechanisms, however, credits are typically offered
|
|
76
|
+
* for free (SLA or promotional) or as a part of an allotment associated with a
|
|
77
|
+
* Subscription.
|
|
78
|
+
*
|
|
79
|
+
* In Metronome, you can set commits and credits to only be applicable for a subset
|
|
80
|
+
* of usage. Use `applicable_product_ids` or `applicable_product_tags` to create
|
|
81
|
+
* product or product-family specific commits or credits, or you can build complex
|
|
82
|
+
* boolean logic specifiers to target usage based on pricing and presentation group
|
|
83
|
+
* values using `override_specifiers`.
|
|
84
|
+
*
|
|
85
|
+
* These objects can also also be configured to have a recurrence schedule to
|
|
86
|
+
* easily model customer packaging which includes recurring monthly or quarterly
|
|
87
|
+
* allotments.
|
|
88
|
+
*
|
|
89
|
+
* Commits support rollover settings (`rollover_fraction`) to transfer unused
|
|
90
|
+
* balances between contract periods, either entirely or as a percentage.
|
|
91
|
+
*
|
|
92
|
+
* Read more about
|
|
93
|
+
* [Credits and Commits](https://docs.metronome.com/pricing-packaging/apply-credits-commits/).
|
|
94
|
+
*
|
|
95
|
+
* #### Subscriptions
|
|
96
|
+
*
|
|
97
|
+
* You can add a fixed recurring charge to a contract, like monthly licenses or
|
|
98
|
+
* seat-based fees, using the subscription charge. Subscription charges are defined
|
|
99
|
+
* on your rate card and you can select which subscription is applicable to add to
|
|
100
|
+
* each contract. When you add a subscription to a contract you need to:
|
|
101
|
+
*
|
|
102
|
+
* - Define whether the subscription is paid for in-advance or in-arrears
|
|
103
|
+
* (`collection_schedule`)
|
|
104
|
+
* - Define the proration behavior (`proration`)
|
|
105
|
+
* - Specify an initial quantity (`initial_quantity`)
|
|
106
|
+
* - Define which subscription rate on the rate card should be used
|
|
107
|
+
* (`subscription_rate`)
|
|
108
|
+
*
|
|
109
|
+
* Read more about
|
|
110
|
+
* [Subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/).
|
|
111
|
+
*
|
|
112
|
+
* #### Scheduled Charges
|
|
113
|
+
*
|
|
114
|
+
* Set up one-time, recurring, or entirely custom charges that occur on specific
|
|
115
|
+
* dates, separate from usage-based billing or commitments. These can be used to
|
|
116
|
+
* model non-recurring platform charges or professional services.
|
|
117
|
+
*
|
|
118
|
+
* #### Threshold Billing
|
|
119
|
+
*
|
|
120
|
+
* Metronome allows you to configure automatic billing triggers when customers
|
|
121
|
+
* reach spending thresholds to prevent fraud and manage risk. You can use
|
|
122
|
+
* `spend_threshold_configuration` to trigger an invoice to cover current charges
|
|
123
|
+
* whenever the threshold is reached or you can ensure the customer maintains a
|
|
124
|
+
* minimum prepaid balance using the `prepaid_balance_configuration`.
|
|
125
|
+
*
|
|
126
|
+
* Read more about
|
|
127
|
+
* [Spend Threshold](https://docs.metronome.com/manage-product-access/spend-thresholds/)
|
|
128
|
+
* and
|
|
129
|
+
* [Prepaid Balance Thresholds](https://docs.metronome.com/manage-product-access/prepaid-balance-thresholds/).
|
|
130
|
+
*
|
|
131
|
+
* ### Usage guidelines:
|
|
132
|
+
*
|
|
133
|
+
* - You can always
|
|
134
|
+
* [Edit Contracts](https://docs.metronome.com/manage-product-access/edit-contract/)
|
|
135
|
+
* after it has been created, using the `editContract` endpoint. Metronome keeps
|
|
136
|
+
* track of all edits, both in the audit log and over the `getEditHistory`
|
|
137
|
+
* endpoint.
|
|
138
|
+
* - Customers in Metronome can have multiple concurrent contracts at one time. Use
|
|
139
|
+
* `usage_filters` to route the correct usage to each contract.
|
|
140
|
+
* [Read more about usage filters](https://docs.metronome.com/manage-product-access/provision-customer/#create-a-usage-filter).
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* ```ts
|
|
144
|
+
* const contract = await client.v1.contracts.create({
|
|
145
|
+
* customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
|
|
146
|
+
* starting_at: '2020-01-01T00:00:00.000Z',
|
|
147
|
+
* billing_provider_configuration: {
|
|
148
|
+
* billing_provider: 'stripe',
|
|
149
|
+
* delivery_method: 'direct_to_billing_provider',
|
|
150
|
+
* },
|
|
151
|
+
* rate_card_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
152
|
+
* });
|
|
153
|
+
* ```
|
|
154
|
+
*/
|
|
155
|
+
create(body: ContractCreateParams, options?: RequestOptions): APIPromise<ContractCreateResponse>;
|
|
156
|
+
/**
|
|
157
|
+
* This is the v1 endpoint to get a contract. New clients should implement using
|
|
158
|
+
* the v2 endpoint.
|
|
159
|
+
*
|
|
160
|
+
* @example
|
|
161
|
+
* ```ts
|
|
162
|
+
* const contract = await client.v1.contracts.retrieve({
|
|
163
|
+
* contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
164
|
+
* customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
|
|
165
|
+
* });
|
|
166
|
+
* ```
|
|
167
|
+
*/
|
|
168
|
+
retrieve(body: ContractRetrieveParams, options?: RequestOptions): APIPromise<ContractRetrieveResponse>;
|
|
169
|
+
/**
|
|
170
|
+
* Retrieves all contracts for a specific customer, including pricing, terms,
|
|
171
|
+
* credits, and commitments. Use this to view a customer's contract history and
|
|
172
|
+
* current agreements for billing management. Returns contract details with
|
|
173
|
+
* optional ledgers and balance information.
|
|
174
|
+
*
|
|
175
|
+
* ⚠️ Note: This is the legacy v1 endpoint - new integrations should use the v2
|
|
176
|
+
* endpoint for enhanced features.
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* ```ts
|
|
180
|
+
* const contracts = await client.v1.contracts.list({
|
|
181
|
+
* customer_id: '9b85c1c1-5238-4f2a-a409-61412905e1e1',
|
|
182
|
+
* });
|
|
183
|
+
* ```
|
|
184
|
+
*/
|
|
185
|
+
list(body: ContractListParams, options?: RequestOptions): APIPromise<ContractListResponse>;
|
|
186
|
+
/**
|
|
187
|
+
* Manually adjust the available balance on a commit or credit. This entry is
|
|
188
|
+
* appended to the commit ledger as a new event. Optionally include a description
|
|
189
|
+
* that provides the reasoning for the entry.
|
|
190
|
+
*
|
|
191
|
+
* ### Use this endpoint to:
|
|
192
|
+
*
|
|
193
|
+
* - Address incorrect usage burn-down caused by malformed usage or invalid config
|
|
194
|
+
* - Decrease available balance to account for outages where usage may have not
|
|
195
|
+
* been tracked or sent to Metronome
|
|
196
|
+
* - Issue credits to customers in the form of increased balance on existing commit
|
|
197
|
+
* or credit
|
|
198
|
+
*
|
|
199
|
+
* ### Usage guidelines:
|
|
200
|
+
*
|
|
201
|
+
* Manual ledger entries can be extremely useful for resolving discrepancies in
|
|
202
|
+
* Metronome. However, most corrections to inaccurate billings can be modified
|
|
203
|
+
* upstream of the commit, whether that is via contract editing, rate editing, or
|
|
204
|
+
* other actions that cause an invoice to be recalculated.
|
|
205
|
+
*
|
|
206
|
+
* @example
|
|
207
|
+
* ```ts
|
|
208
|
+
* await client.v1.contracts.addManualBalanceEntry({
|
|
209
|
+
* id: '6162d87b-e5db-4a33-b7f2-76ce6ead4e85',
|
|
210
|
+
* amount: -1000,
|
|
211
|
+
* customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
|
|
212
|
+
* reason: 'Reason for entry',
|
|
213
|
+
* segment_id: '66368e29-3f97-4d15-a6e9-120897f0070a',
|
|
214
|
+
* contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
215
|
+
* });
|
|
216
|
+
* ```
|
|
217
|
+
*/
|
|
218
|
+
addManualBalanceEntry(body: ContractAddManualBalanceEntryParams, options?: RequestOptions): APIPromise<void>;
|
|
219
|
+
/**
|
|
220
|
+
* Amendments will be replaced by Contract editing. New clients should implement
|
|
221
|
+
* using the `editContract` endpoint. Read more about the migration to contract
|
|
222
|
+
* editing [here](https://docs.metronome.com/migrate-amendments-to-edits/) and
|
|
223
|
+
* reach out to your Metronome representative for more details. Once contract
|
|
224
|
+
* editing is enabled, access to this endpoint will be removed.
|
|
225
|
+
*
|
|
226
|
+
* @example
|
|
227
|
+
* ```ts
|
|
228
|
+
* const response = await client.v1.contracts.amend({
|
|
229
|
+
* contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
230
|
+
* customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
|
|
231
|
+
* starting_at: '2020-01-01T00:00:00.000Z',
|
|
232
|
+
* });
|
|
233
|
+
* ```
|
|
234
|
+
*/
|
|
235
|
+
amend(body: ContractAmendParams, options?: RequestOptions): APIPromise<ContractAmendResponse>;
|
|
236
|
+
/**
|
|
237
|
+
* Permanently end and archive a contract along with all its terms. Any draft
|
|
238
|
+
* invoices will be canceled, and all upcoming scheduled invoices will be
|
|
239
|
+
* voided–also all finalized invoices can optionally be voided. Use this in the
|
|
240
|
+
* event a contract was incorrectly created and needed to be removed from a
|
|
241
|
+
* customer.
|
|
242
|
+
*
|
|
243
|
+
* #### Impact on commits and credits:
|
|
244
|
+
*
|
|
245
|
+
* When archiving a contract, all associated commits and credits are also archived.
|
|
246
|
+
* For prepaid commits with active segments, Metronome automatically generates
|
|
247
|
+
* expiration ledger entries to close out any remaining balances, ensuring accurate
|
|
248
|
+
* accounting of unused prepaid amounts. These ledger entries will appear in the
|
|
249
|
+
* commit's transaction history with type `PREPAID_COMMIT_EXPIRATION`.
|
|
250
|
+
*
|
|
251
|
+
* #### Archived contract visibility:
|
|
252
|
+
*
|
|
253
|
+
* Archived contracts remain accessible for historical reporting and audit
|
|
254
|
+
* purposes. They can be retrieved using the `ListContracts` endpoint by setting
|
|
255
|
+
* the `include_archived` parameter to `true` or in the Metronome UI when the "Show
|
|
256
|
+
* archived" option is enabled.
|
|
257
|
+
*
|
|
258
|
+
* @example
|
|
259
|
+
* ```ts
|
|
260
|
+
* const response = await client.v1.contracts.archive({
|
|
261
|
+
* contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
262
|
+
* customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
|
|
263
|
+
* void_invoices: true,
|
|
264
|
+
* });
|
|
265
|
+
* ```
|
|
266
|
+
*/
|
|
267
|
+
archive(body: ContractArchiveParams, options?: RequestOptions): APIPromise<ContractArchiveResponse>;
|
|
268
|
+
/**
|
|
269
|
+
* Create historical usage invoices for past billing periods on specific contracts.
|
|
270
|
+
* Use this endpoint to generate retroactive invoices with custom usage line items,
|
|
271
|
+
* quantities, and date ranges. Supports preview mode to validate invoice data
|
|
272
|
+
* before creation. Ideal for billing migrations or correcting past billing
|
|
273
|
+
* periods.
|
|
274
|
+
*
|
|
275
|
+
* @example
|
|
276
|
+
* ```ts
|
|
277
|
+
* const response =
|
|
278
|
+
* await client.v1.contracts.createHistoricalInvoices({
|
|
279
|
+
* invoices: [
|
|
280
|
+
* {
|
|
281
|
+
* customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
|
|
282
|
+
* contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
283
|
+
* credit_type_id:
|
|
284
|
+
* '2714e483-4ff1-48e4-9e25-ac732e8f24f2',
|
|
285
|
+
* inclusive_start_date: '2020-01-01T00:00:00.000Z',
|
|
286
|
+
* exclusive_end_date: '2020-02-01T00:00:00.000Z',
|
|
287
|
+
* issue_date: '2020-02-01T00:00:00.000Z',
|
|
288
|
+
* usage_line_items: [
|
|
289
|
+
* {
|
|
290
|
+
* product_id:
|
|
291
|
+
* 'f14d6729-6a44-4b13-9908-9387f1918790',
|
|
292
|
+
* inclusive_start_date:
|
|
293
|
+
* '2020-01-01T00:00:00.000Z',
|
|
294
|
+
* exclusive_end_date: '2020-02-01T00:00:00.000Z',
|
|
295
|
+
* quantity: 100,
|
|
296
|
+
* },
|
|
297
|
+
* ],
|
|
298
|
+
* },
|
|
299
|
+
* ],
|
|
300
|
+
* preview: false,
|
|
301
|
+
* });
|
|
302
|
+
* ```
|
|
303
|
+
*/
|
|
304
|
+
createHistoricalInvoices(body: ContractCreateHistoricalInvoicesParams, options?: RequestOptions): APIPromise<ContractCreateHistoricalInvoicesResponse>;
|
|
305
|
+
/**
|
|
306
|
+
* Retrieve a comprehensive view of all available balances (commits and credits)
|
|
307
|
+
* for a customer. This endpoint provides real-time visibility into prepaid funds,
|
|
308
|
+
* postpaid commitments, promotional credits, and other balance types that can
|
|
309
|
+
* offset usage charges, helping you build transparent billing experiences.
|
|
310
|
+
*
|
|
311
|
+
* ### Use this endpoint to:
|
|
312
|
+
*
|
|
313
|
+
* - Display current available balances in customer dashboards
|
|
314
|
+
* - Verify available funds before approving high-usage operations
|
|
315
|
+
* - Generate balance reports for finance teams
|
|
316
|
+
* - Filter balances by contract or date ranges
|
|
317
|
+
*
|
|
318
|
+
* ### Key response fields:
|
|
319
|
+
*
|
|
320
|
+
* An array of balance objects (all credits and commits) containing:
|
|
321
|
+
*
|
|
322
|
+
* - Balance details: Current available amount for each commit or credit
|
|
323
|
+
* - Metadata: Product associations, priorities, applicable date ranges
|
|
324
|
+
* - Optional ledger entries: Detailed transaction history (if
|
|
325
|
+
* `include_ledgers=true`)
|
|
326
|
+
* - Balance calculations: Including pending transactions and future-dated entries
|
|
327
|
+
* - Custom fields: Any additional metadata attached to balances
|
|
328
|
+
*
|
|
329
|
+
* ### Usage guidelines:
|
|
330
|
+
*
|
|
331
|
+
* - Date filtering: Use `effective_before` to include only balances with access
|
|
332
|
+
* before a specific date (exclusive)
|
|
333
|
+
* - Set `include_balance=true` for calculated balance amounts on each commit or
|
|
334
|
+
* credit
|
|
335
|
+
* - Set `include_ledgers=true` for full transaction history
|
|
336
|
+
* - Set `include_contract_balances = true` to see contract level balances
|
|
337
|
+
* - Balance logic: Reflects currently accessible amounts, excluding expired/future
|
|
338
|
+
* segments
|
|
339
|
+
* - Manual adjustments: Includes all manual ledger entries, even future-dated ones
|
|
340
|
+
*
|
|
341
|
+
* @example
|
|
342
|
+
* ```ts
|
|
343
|
+
* // Automatically fetches more pages as needed.
|
|
344
|
+
* for await (const contractListBalancesResponse of client.v1.contracts.listBalances(
|
|
345
|
+
* {
|
|
346
|
+
* customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
|
|
347
|
+
* id: '6162d87b-e5db-4a33-b7f2-76ce6ead4e85',
|
|
348
|
+
* include_ledgers: true,
|
|
349
|
+
* },
|
|
350
|
+
* )) {
|
|
351
|
+
* // ...
|
|
352
|
+
* }
|
|
353
|
+
* ```
|
|
354
|
+
*/
|
|
355
|
+
listBalances(body: ContractListBalancesParams, options?: RequestOptions): PagePromise<ContractListBalancesResponsesBodyCursorPage, ContractListBalancesResponse>;
|
|
356
|
+
/**
|
|
357
|
+
* For a specific customer and contract, get the rates at a specific point in time.
|
|
358
|
+
* This endpoint takes the contract's rate card into consideration, including
|
|
359
|
+
* scheduled changes. It also takes into account overrides on the contract.
|
|
360
|
+
*
|
|
361
|
+
* For example, if you want to show your customer a summary of the prices they are
|
|
362
|
+
* paying, inclusive of any negotiated discounts or promotions, use this endpoint.
|
|
363
|
+
* This endpoint only returns rates that are entitled.
|
|
364
|
+
*
|
|
365
|
+
* @example
|
|
366
|
+
* ```ts
|
|
367
|
+
* const response =
|
|
368
|
+
* await client.v1.contracts.retrieveRateSchedule({
|
|
369
|
+
* contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
370
|
+
* customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
|
|
371
|
+
* at: '2020-01-01T00:00:00.000Z',
|
|
372
|
+
* selectors: [
|
|
373
|
+
* {
|
|
374
|
+
* product_id: 'd6300dbb-882e-4d2d-8dec-5125d16b65d0',
|
|
375
|
+
* partial_pricing_group_values: {
|
|
376
|
+
* region: 'us-west-2',
|
|
377
|
+
* cloud: 'aws',
|
|
378
|
+
* },
|
|
379
|
+
* },
|
|
380
|
+
* ],
|
|
381
|
+
* });
|
|
382
|
+
* ```
|
|
383
|
+
*/
|
|
384
|
+
retrieveRateSchedule(params: ContractRetrieveRateScheduleParams, options?: RequestOptions): APIPromise<ContractRetrieveRateScheduleResponse>;
|
|
385
|
+
/**
|
|
386
|
+
* Get the history of subscription quantities and prices over time for a given
|
|
387
|
+
* `subscription_id`. This endpoint can be used to power an in-product experience
|
|
388
|
+
* where you show a customer their historical changes to seat count. Future changes
|
|
389
|
+
* are not included in this endpoint - use the `getContract` endpoint to view the
|
|
390
|
+
* future scheduled changes to a subscription's quantity.
|
|
391
|
+
*
|
|
392
|
+
* Subscriptions are used to model fixed recurring fees as well as seat-based
|
|
393
|
+
* recurring fees. To model changes to the number of seats in Metronome, you can
|
|
394
|
+
* increment or decrement the quantity on a subscription at any point in the past
|
|
395
|
+
* or future.
|
|
396
|
+
*
|
|
397
|
+
* @example
|
|
398
|
+
* ```ts
|
|
399
|
+
* const response =
|
|
400
|
+
* await client.v1.contracts.retrieveSubscriptionQuantityHistory(
|
|
401
|
+
* {
|
|
402
|
+
* contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
403
|
+
* customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
|
|
404
|
+
* subscription_id:
|
|
405
|
+
* '1a824d53-bde6-4d82-96d7-6347ff227d5c',
|
|
406
|
+
* },
|
|
407
|
+
* );
|
|
408
|
+
* ```
|
|
409
|
+
*/
|
|
410
|
+
retrieveSubscriptionQuantityHistory(body: ContractRetrieveSubscriptionQuantityHistoryParams, options?: RequestOptions): APIPromise<ContractRetrieveSubscriptionQuantityHistoryResponse>;
|
|
411
|
+
/**
|
|
412
|
+
* Create a new scheduled invoice for Professional Services terms on a contract.
|
|
413
|
+
* This endpoint's availability is dependent on your client's configuration.
|
|
414
|
+
*
|
|
415
|
+
* @example
|
|
416
|
+
* ```ts
|
|
417
|
+
* const response =
|
|
418
|
+
* await client.v1.contracts.scheduleProServicesInvoice({
|
|
419
|
+
* contract_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
420
|
+
* customer_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
421
|
+
* issued_at: '2019-12-27T18:11:19.117Z',
|
|
422
|
+
* line_items: [
|
|
423
|
+
* {
|
|
424
|
+
* professional_service_id:
|
|
425
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
426
|
+
* },
|
|
427
|
+
* ],
|
|
428
|
+
* });
|
|
429
|
+
* ```
|
|
430
|
+
*/
|
|
431
|
+
scheduleProServicesInvoice(body: ContractScheduleProServicesInvoiceParams, options?: RequestOptions): APIPromise<ContractScheduleProServicesInvoiceResponse>;
|
|
432
|
+
/**
|
|
433
|
+
* If a customer has multiple contracts with overlapping rates, the usage filter
|
|
434
|
+
* routes usage to the appropriate contract based on a predefined group key.
|
|
435
|
+
*
|
|
436
|
+
* As an example, imagine you have a customer associated with two projects. Each
|
|
437
|
+
* project is associated with its own contract. You can create a usage filter with
|
|
438
|
+
* group key `project_id` on each contract, and route usage for `project_1` to the
|
|
439
|
+
* first contract and `project_2` to the second contract.
|
|
440
|
+
*
|
|
441
|
+
* ### Use this endpoint to:
|
|
442
|
+
*
|
|
443
|
+
* - Support enterprise contracting scenarios where multiple contracts are
|
|
444
|
+
* associated to the same customer with the same rates.
|
|
445
|
+
* - Update the usage filter associated with the contract over time.
|
|
446
|
+
*
|
|
447
|
+
* ### Usage guidelines:
|
|
448
|
+
*
|
|
449
|
+
* To use usage filters, the `group_key` must be defined on the billable metrics
|
|
450
|
+
* underlying the rate card on the contracts.
|
|
451
|
+
*
|
|
452
|
+
* @example
|
|
453
|
+
* ```ts
|
|
454
|
+
* await client.v1.contracts.setUsageFilter({
|
|
455
|
+
* contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
456
|
+
* customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
|
|
457
|
+
* group_key: 'business_subscription_id',
|
|
458
|
+
* group_values: ['ID-1', 'ID-2'],
|
|
459
|
+
* starting_at: '2020-01-01T00:00:00.000Z',
|
|
460
|
+
* });
|
|
461
|
+
* ```
|
|
462
|
+
*/
|
|
463
|
+
setUsageFilter(body: ContractSetUsageFilterParams, options?: RequestOptions): APIPromise<void>;
|
|
464
|
+
/**
|
|
465
|
+
* Update or add an end date to a contract. Ending a contract early will impact
|
|
466
|
+
* draft usage statements, truncate any terms, and remove upcoming scheduled
|
|
467
|
+
* invoices. Moving the date into the future will only extend the contract length.
|
|
468
|
+
* Terms and scheduled invoices are not extended. In-advance subscriptions will not
|
|
469
|
+
* be extended. Use this if a contract's end date has changed or if a perpetual
|
|
470
|
+
* contract ends.
|
|
471
|
+
*
|
|
472
|
+
* @example
|
|
473
|
+
* ```ts
|
|
474
|
+
* const response = await client.v1.contracts.updateEndDate({
|
|
475
|
+
* contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
476
|
+
* customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
|
|
477
|
+
* ending_before: '2020-01-01T00:00:00.000Z',
|
|
478
|
+
* });
|
|
479
|
+
* ```
|
|
480
|
+
*/
|
|
481
|
+
updateEndDate(body: ContractUpdateEndDateParams, options?: RequestOptions): APIPromise<ContractUpdateEndDateResponse>;
|
|
482
|
+
}
|
|
483
|
+
export type ContractListBalancesResponsesBodyCursorPage = BodyCursorPage<ContractListBalancesResponse>;
|
|
484
|
+
export interface ContractCreateResponse {
|
|
485
|
+
data: Shared.ID;
|
|
486
|
+
}
|
|
487
|
+
export interface ContractRetrieveResponse {
|
|
488
|
+
data: Shared.Contract;
|
|
489
|
+
}
|
|
490
|
+
export interface ContractListResponse {
|
|
491
|
+
data: Array<Shared.Contract>;
|
|
492
|
+
}
|
|
493
|
+
export interface ContractAmendResponse {
|
|
494
|
+
data: Shared.ID;
|
|
495
|
+
}
|
|
496
|
+
export interface ContractArchiveResponse {
|
|
497
|
+
data: Shared.ID;
|
|
498
|
+
}
|
|
499
|
+
export interface ContractCreateHistoricalInvoicesResponse {
|
|
500
|
+
data: Array<InvoicesAPI.Invoice>;
|
|
501
|
+
}
|
|
502
|
+
export type ContractListBalancesResponse = Shared.Commit | Shared.Credit;
|
|
503
|
+
export interface ContractRetrieveRateScheduleResponse {
|
|
504
|
+
data: Array<ContractRetrieveRateScheduleResponse.Data>;
|
|
505
|
+
next_page?: string | null;
|
|
506
|
+
}
|
|
507
|
+
export declare namespace ContractRetrieveRateScheduleResponse {
|
|
508
|
+
interface Data {
|
|
509
|
+
entitled: boolean;
|
|
510
|
+
list_rate: Shared.Rate;
|
|
511
|
+
/**
|
|
512
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
513
|
+
*/
|
|
514
|
+
product_custom_fields: {
|
|
515
|
+
[key: string]: string;
|
|
516
|
+
};
|
|
517
|
+
product_id: string;
|
|
518
|
+
product_name: string;
|
|
519
|
+
product_tags: Array<string>;
|
|
520
|
+
rate_card_id: string;
|
|
521
|
+
starting_at: string;
|
|
522
|
+
billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
523
|
+
/**
|
|
524
|
+
* A distinct rate on the rate card. You can choose to use this rate rather than
|
|
525
|
+
* list rate when consuming a credit or commit.
|
|
526
|
+
*/
|
|
527
|
+
commit_rate?: Shared.CommitRate;
|
|
528
|
+
ending_before?: string;
|
|
529
|
+
override_rate?: Shared.Rate;
|
|
530
|
+
pricing_group_values?: {
|
|
531
|
+
[key: string]: string;
|
|
532
|
+
};
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
export interface ContractRetrieveSubscriptionQuantityHistoryResponse {
|
|
536
|
+
data: ContractRetrieveSubscriptionQuantityHistoryResponse.Data;
|
|
537
|
+
}
|
|
538
|
+
export declare namespace ContractRetrieveSubscriptionQuantityHistoryResponse {
|
|
539
|
+
interface Data {
|
|
540
|
+
fiat_credit_type_id?: string;
|
|
541
|
+
history?: Array<Data.History>;
|
|
542
|
+
subscription_id?: string;
|
|
543
|
+
}
|
|
544
|
+
namespace Data {
|
|
545
|
+
interface History {
|
|
546
|
+
data: Array<History.Data>;
|
|
547
|
+
starting_at: string;
|
|
548
|
+
}
|
|
549
|
+
namespace History {
|
|
550
|
+
interface Data {
|
|
551
|
+
quantity: number;
|
|
552
|
+
total: number;
|
|
553
|
+
unit_price: number;
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
export interface ContractScheduleProServicesInvoiceResponse {
|
|
559
|
+
data: Array<InvoicesAPI.Invoice>;
|
|
560
|
+
}
|
|
561
|
+
export interface ContractUpdateEndDateResponse {
|
|
562
|
+
data: Shared.ID;
|
|
563
|
+
}
|
|
564
|
+
export interface ContractCreateParams {
|
|
565
|
+
customer_id: string;
|
|
566
|
+
/**
|
|
567
|
+
* inclusive contract start time
|
|
568
|
+
*/
|
|
569
|
+
starting_at: string;
|
|
570
|
+
/**
|
|
571
|
+
* The billing provider configuration associated with a contract. Provide either an
|
|
572
|
+
* ID or the provider and delivery method.
|
|
573
|
+
*/
|
|
574
|
+
billing_provider_configuration?: ContractCreateParams.BillingProviderConfiguration;
|
|
575
|
+
commits?: Array<ContractCreateParams.Commit>;
|
|
576
|
+
credits?: Array<ContractCreateParams.Credit>;
|
|
577
|
+
/**
|
|
578
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
579
|
+
*/
|
|
580
|
+
custom_fields?: {
|
|
581
|
+
[key: string]: string;
|
|
582
|
+
};
|
|
583
|
+
/**
|
|
584
|
+
* This field's availability is dependent on your client's configuration.
|
|
585
|
+
*/
|
|
586
|
+
discounts?: Array<ContractCreateParams.Discount>;
|
|
587
|
+
/**
|
|
588
|
+
* exclusive contract end time
|
|
589
|
+
*/
|
|
590
|
+
ending_before?: string;
|
|
591
|
+
hierarchy_configuration?: ContractCreateParams.HierarchyConfiguration;
|
|
592
|
+
/**
|
|
593
|
+
* Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list
|
|
594
|
+
* prices automatically. EXPLICIT prioritization requires specifying priorities for
|
|
595
|
+
* each multiplier; the one with the lowest priority value will be prioritized
|
|
596
|
+
* first. If tiered overrides are used, prioritization must be explicit.
|
|
597
|
+
*/
|
|
598
|
+
multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT';
|
|
599
|
+
name?: string;
|
|
600
|
+
net_payment_terms_days?: number;
|
|
601
|
+
/**
|
|
602
|
+
* This field's availability is dependent on your client's configuration.
|
|
603
|
+
*/
|
|
604
|
+
netsuite_sales_order_id?: string;
|
|
605
|
+
overrides?: Array<ContractCreateParams.Override>;
|
|
606
|
+
prepaid_balance_threshold_configuration?: Shared.PrepaidBalanceThresholdConfiguration;
|
|
607
|
+
/**
|
|
608
|
+
* Priority of the contract.
|
|
609
|
+
*/
|
|
610
|
+
priority?: number;
|
|
611
|
+
/**
|
|
612
|
+
* This field's availability is dependent on your client's configuration.
|
|
613
|
+
*/
|
|
614
|
+
professional_services?: Array<ContractCreateParams.ProfessionalService>;
|
|
615
|
+
/**
|
|
616
|
+
* Selects the rate card linked to the specified alias as of the contract's start
|
|
617
|
+
* date.
|
|
618
|
+
*/
|
|
619
|
+
rate_card_alias?: string;
|
|
620
|
+
rate_card_id?: string;
|
|
621
|
+
recurring_commits?: Array<ContractCreateParams.RecurringCommit>;
|
|
622
|
+
recurring_credits?: Array<ContractCreateParams.RecurringCredit>;
|
|
623
|
+
/**
|
|
624
|
+
* This field's availability is dependent on your client's configuration.
|
|
625
|
+
*/
|
|
626
|
+
reseller_royalties?: Array<ContractCreateParams.ResellerRoyalty>;
|
|
627
|
+
/**
|
|
628
|
+
* This field's availability is dependent on your client's configuration.
|
|
629
|
+
*/
|
|
630
|
+
salesforce_opportunity_id?: string;
|
|
631
|
+
scheduled_charges?: Array<ContractCreateParams.ScheduledCharge>;
|
|
632
|
+
/**
|
|
633
|
+
* Determines which scheduled and commit charges to consolidate onto the Contract's
|
|
634
|
+
* usage invoice. The charge's `timestamp` must match the usage invoice's
|
|
635
|
+
* `ending_before` date for consolidation to occur. This field cannot be modified
|
|
636
|
+
* after a Contract has been created. If this field is omitted, charges will appear
|
|
637
|
+
* on a separate invoice from usage charges.
|
|
638
|
+
*/
|
|
639
|
+
scheduled_charges_on_usage_invoices?: 'ALL';
|
|
640
|
+
spend_threshold_configuration?: Shared.SpendThresholdConfiguration;
|
|
641
|
+
/**
|
|
642
|
+
* Optional list of
|
|
643
|
+
* [subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/)
|
|
644
|
+
* to add to the contract.
|
|
645
|
+
*/
|
|
646
|
+
subscriptions?: Array<ContractCreateParams.Subscription>;
|
|
647
|
+
/**
|
|
648
|
+
* This field's availability is dependent on your client's configuration.
|
|
649
|
+
*/
|
|
650
|
+
total_contract_value?: number;
|
|
651
|
+
transition?: ContractCreateParams.Transition;
|
|
652
|
+
/**
|
|
653
|
+
* Prevents the creation of duplicates. If a request to create a record is made
|
|
654
|
+
* with a previously used uniqueness key, a new record will not be created and the
|
|
655
|
+
* request will fail with a 409 error.
|
|
656
|
+
*/
|
|
657
|
+
uniqueness_key?: string;
|
|
658
|
+
usage_filter?: Shared.BaseUsageFilter;
|
|
659
|
+
usage_statement_schedule?: ContractCreateParams.UsageStatementSchedule;
|
|
660
|
+
}
|
|
661
|
+
export declare namespace ContractCreateParams {
|
|
662
|
+
/**
|
|
663
|
+
* The billing provider configuration associated with a contract. Provide either an
|
|
664
|
+
* ID or the provider and delivery method.
|
|
665
|
+
*/
|
|
666
|
+
interface BillingProviderConfiguration {
|
|
667
|
+
/**
|
|
668
|
+
* Do not specify if using billing_provider_configuration_id.
|
|
669
|
+
*/
|
|
670
|
+
billing_provider?: 'aws_marketplace' | 'azure_marketplace' | 'gcp_marketplace' | 'stripe' | 'netsuite';
|
|
671
|
+
/**
|
|
672
|
+
* The Metronome ID of the billing provider configuration. Use when a customer has
|
|
673
|
+
* multiple configurations with the same billing provider and delivery method.
|
|
674
|
+
* Otherwise, specify the billing_provider and delivery_method.
|
|
675
|
+
*/
|
|
676
|
+
billing_provider_configuration_id?: string;
|
|
677
|
+
/**
|
|
678
|
+
* Do not specify if using billing_provider_configuration_id.
|
|
679
|
+
*/
|
|
680
|
+
delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
|
|
681
|
+
}
|
|
682
|
+
interface Commit {
|
|
683
|
+
product_id: string;
|
|
684
|
+
type: 'PREPAID' | 'POSTPAID';
|
|
685
|
+
/**
|
|
686
|
+
* Required: Schedule for distributing the commit to the customer. For "POSTPAID"
|
|
687
|
+
* commits only one schedule item is allowed and amount must match invoice_schedule
|
|
688
|
+
* total.
|
|
689
|
+
*/
|
|
690
|
+
access_schedule?: Commit.AccessSchedule;
|
|
691
|
+
/**
|
|
692
|
+
* (DEPRECATED) Use access_schedule and invoice_schedule instead.
|
|
693
|
+
*/
|
|
694
|
+
amount?: number;
|
|
695
|
+
/**
|
|
696
|
+
* Which products the commit applies to. If applicable_product_ids,
|
|
697
|
+
* applicable_product_tags or specifiers are not provided, the commit applies to
|
|
698
|
+
* all products.
|
|
699
|
+
*/
|
|
700
|
+
applicable_product_ids?: Array<string>;
|
|
701
|
+
/**
|
|
702
|
+
* Which tags the commit applies to. If applicable_product_ids,
|
|
703
|
+
* applicable_product_tags or specifiers are not provided, the commit applies to
|
|
704
|
+
* all products.
|
|
705
|
+
*/
|
|
706
|
+
applicable_product_tags?: Array<string>;
|
|
707
|
+
/**
|
|
708
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
709
|
+
*/
|
|
710
|
+
custom_fields?: {
|
|
711
|
+
[key: string]: string;
|
|
712
|
+
};
|
|
713
|
+
/**
|
|
714
|
+
* Used only in UI/API. It is not exposed to end customers.
|
|
715
|
+
*/
|
|
716
|
+
description?: string;
|
|
717
|
+
/**
|
|
718
|
+
* Optional configuration for commit hierarchy access control
|
|
719
|
+
*/
|
|
720
|
+
hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
|
|
721
|
+
/**
|
|
722
|
+
* Required for "POSTPAID" commits: the true up invoice will be generated at this
|
|
723
|
+
* time and only one schedule item is allowed; the total must match access_schedule
|
|
724
|
+
* amount. Optional for "PREPAID" commits: if not provided, this will be a
|
|
725
|
+
* "complimentary" commit with no invoice.
|
|
726
|
+
*/
|
|
727
|
+
invoice_schedule?: Commit.InvoiceSchedule;
|
|
728
|
+
/**
|
|
729
|
+
* displayed on invoices
|
|
730
|
+
*/
|
|
731
|
+
name?: string;
|
|
732
|
+
/**
|
|
733
|
+
* This field's availability is dependent on your client's configuration.
|
|
734
|
+
*/
|
|
735
|
+
netsuite_sales_order_id?: string;
|
|
736
|
+
/**
|
|
737
|
+
* optionally payment gate this commit
|
|
738
|
+
*/
|
|
739
|
+
payment_gate_config?: Commit.PaymentGateConfig;
|
|
740
|
+
/**
|
|
741
|
+
* If multiple commits are applicable, the one with the lower priority will apply
|
|
742
|
+
* first.
|
|
743
|
+
*/
|
|
744
|
+
priority?: number;
|
|
745
|
+
rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
|
|
746
|
+
/**
|
|
747
|
+
* Fraction of unused segments that will be rolled over. Must be between 0 and 1.
|
|
748
|
+
*/
|
|
749
|
+
rollover_fraction?: number;
|
|
750
|
+
/**
|
|
751
|
+
* List of filters that determine what kind of customer usage draws down a commit
|
|
752
|
+
* or credit. A customer's usage needs to meet the condition of at least one of the
|
|
753
|
+
* specifiers to contribute to a commit's or credit's drawdown. This field cannot
|
|
754
|
+
* be used together with `applicable_product_ids` or `applicable_product_tags`.
|
|
755
|
+
*/
|
|
756
|
+
specifiers?: Array<Shared.CommitSpecifierInput>;
|
|
757
|
+
/**
|
|
758
|
+
* A temporary ID for the commit that can be used to reference the commit for
|
|
759
|
+
* commit specific overrides.
|
|
760
|
+
*/
|
|
761
|
+
temporary_id?: string;
|
|
762
|
+
}
|
|
763
|
+
namespace Commit {
|
|
764
|
+
/**
|
|
765
|
+
* Required: Schedule for distributing the commit to the customer. For "POSTPAID"
|
|
766
|
+
* commits only one schedule item is allowed and amount must match invoice_schedule
|
|
767
|
+
* total.
|
|
768
|
+
*/
|
|
769
|
+
interface AccessSchedule {
|
|
770
|
+
schedule_items: Array<AccessSchedule.ScheduleItem>;
|
|
771
|
+
/**
|
|
772
|
+
* Defaults to USD (cents) if not passed
|
|
773
|
+
*/
|
|
774
|
+
credit_type_id?: string;
|
|
775
|
+
}
|
|
776
|
+
namespace AccessSchedule {
|
|
777
|
+
interface ScheduleItem {
|
|
778
|
+
amount: number;
|
|
779
|
+
/**
|
|
780
|
+
* RFC 3339 timestamp (exclusive)
|
|
781
|
+
*/
|
|
782
|
+
ending_before: string;
|
|
783
|
+
/**
|
|
784
|
+
* RFC 3339 timestamp (inclusive)
|
|
785
|
+
*/
|
|
786
|
+
starting_at: string;
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
/**
|
|
790
|
+
* Required for "POSTPAID" commits: the true up invoice will be generated at this
|
|
791
|
+
* time and only one schedule item is allowed; the total must match access_schedule
|
|
792
|
+
* amount. Optional for "PREPAID" commits: if not provided, this will be a
|
|
793
|
+
* "complimentary" commit with no invoice.
|
|
794
|
+
*/
|
|
795
|
+
interface InvoiceSchedule {
|
|
796
|
+
/**
|
|
797
|
+
* Defaults to USD (cents) if not passed.
|
|
798
|
+
*/
|
|
799
|
+
credit_type_id?: string;
|
|
800
|
+
/**
|
|
801
|
+
* This field is only applicable to commit invoice schedules. If true, this
|
|
802
|
+
* schedule will not generate an invoice.
|
|
803
|
+
*/
|
|
804
|
+
do_not_invoice?: boolean;
|
|
805
|
+
/**
|
|
806
|
+
* Enter the unit price and quantity for the charge or instead only send the
|
|
807
|
+
* amount. If amount is sent, the unit price is assumed to be the amount and
|
|
808
|
+
* quantity is inferred to be 1.
|
|
809
|
+
*/
|
|
810
|
+
recurring_schedule?: InvoiceSchedule.RecurringSchedule;
|
|
811
|
+
/**
|
|
812
|
+
* Either provide amount or provide both unit_price and quantity.
|
|
813
|
+
*/
|
|
814
|
+
schedule_items?: Array<InvoiceSchedule.ScheduleItem>;
|
|
815
|
+
}
|
|
816
|
+
namespace InvoiceSchedule {
|
|
817
|
+
/**
|
|
818
|
+
* Enter the unit price and quantity for the charge or instead only send the
|
|
819
|
+
* amount. If amount is sent, the unit price is assumed to be the amount and
|
|
820
|
+
* quantity is inferred to be 1.
|
|
821
|
+
*/
|
|
822
|
+
interface RecurringSchedule {
|
|
823
|
+
amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH';
|
|
824
|
+
/**
|
|
825
|
+
* RFC 3339 timestamp (exclusive).
|
|
826
|
+
*/
|
|
827
|
+
ending_before: string;
|
|
828
|
+
frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL';
|
|
829
|
+
/**
|
|
830
|
+
* RFC 3339 timestamp (inclusive).
|
|
831
|
+
*/
|
|
832
|
+
starting_at: string;
|
|
833
|
+
/**
|
|
834
|
+
* Amount for the charge. Can be provided instead of unit_price and quantity. If
|
|
835
|
+
* amount is sent, the unit_price is assumed to be the amount and quantity is
|
|
836
|
+
* inferred to be 1.
|
|
837
|
+
*/
|
|
838
|
+
amount?: number;
|
|
839
|
+
/**
|
|
840
|
+
* Quantity for the charge. Will be multiplied by unit_price to determine the
|
|
841
|
+
* amount and must be specified with unit_price. If specified amount cannot be
|
|
842
|
+
* provided.
|
|
843
|
+
*/
|
|
844
|
+
quantity?: number;
|
|
845
|
+
/**
|
|
846
|
+
* Unit price for the charge. Will be multiplied by quantity to determine the
|
|
847
|
+
* amount and must be specified with quantity. If specified amount cannot be
|
|
848
|
+
* provided.
|
|
849
|
+
*/
|
|
850
|
+
unit_price?: number;
|
|
851
|
+
}
|
|
852
|
+
interface ScheduleItem {
|
|
853
|
+
/**
|
|
854
|
+
* timestamp of the scheduled event
|
|
855
|
+
*/
|
|
856
|
+
timestamp: string;
|
|
857
|
+
/**
|
|
858
|
+
* Amount for the charge. Can be provided instead of unit_price and quantity. If
|
|
859
|
+
* amount is sent, the unit_price is assumed to be the amount and quantity is
|
|
860
|
+
* inferred to be 1.
|
|
861
|
+
*/
|
|
862
|
+
amount?: number;
|
|
863
|
+
/**
|
|
864
|
+
* Quantity for the charge. Will be multiplied by unit_price to determine the
|
|
865
|
+
* amount and must be specified with unit_price. If specified amount cannot be
|
|
866
|
+
* provided.
|
|
867
|
+
*/
|
|
868
|
+
quantity?: number;
|
|
869
|
+
/**
|
|
870
|
+
* Unit price for the charge. Will be multiplied by quantity to determine the
|
|
871
|
+
* amount and must be specified with quantity. If specified amount cannot be
|
|
872
|
+
* provided.
|
|
873
|
+
*/
|
|
874
|
+
unit_price?: number;
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
/**
|
|
878
|
+
* optionally payment gate this commit
|
|
879
|
+
*/
|
|
880
|
+
interface PaymentGateConfig {
|
|
881
|
+
/**
|
|
882
|
+
* Gate access to the commit balance based on successful collection of payment.
|
|
883
|
+
* Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
|
|
884
|
+
* facilitate payment using your own payment integration. Select NONE if you do not
|
|
885
|
+
* wish to payment gate the commit balance.
|
|
886
|
+
*/
|
|
887
|
+
payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
|
|
888
|
+
/**
|
|
889
|
+
* Only applicable if using PRECALCULATED as your tax type.
|
|
890
|
+
*/
|
|
891
|
+
precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
|
|
892
|
+
/**
|
|
893
|
+
* Only applicable if using STRIPE as your payment gate type.
|
|
894
|
+
*/
|
|
895
|
+
stripe_config?: PaymentGateConfig.StripeConfig;
|
|
896
|
+
/**
|
|
897
|
+
* Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
|
|
898
|
+
* not wish Metronome to calculate tax on your behalf. Leaving this field blank
|
|
899
|
+
* will default to NONE.
|
|
900
|
+
*/
|
|
901
|
+
tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'AVALARA' | 'PRECALCULATED';
|
|
902
|
+
}
|
|
903
|
+
namespace PaymentGateConfig {
|
|
904
|
+
/**
|
|
905
|
+
* Only applicable if using PRECALCULATED as your tax type.
|
|
906
|
+
*/
|
|
907
|
+
interface PrecalculatedTaxConfig {
|
|
908
|
+
/**
|
|
909
|
+
* Amount of tax to be applied. This should be in the same currency and
|
|
910
|
+
* denomination as the commit's invoice schedule
|
|
911
|
+
*/
|
|
912
|
+
tax_amount: number;
|
|
913
|
+
/**
|
|
914
|
+
* Name of the tax to be applied. This may be used in an invoice line item
|
|
915
|
+
* description.
|
|
916
|
+
*/
|
|
917
|
+
tax_name?: string;
|
|
918
|
+
}
|
|
919
|
+
/**
|
|
920
|
+
* Only applicable if using STRIPE as your payment gate type.
|
|
921
|
+
*/
|
|
922
|
+
interface StripeConfig {
|
|
923
|
+
/**
|
|
924
|
+
* If left blank, will default to INVOICE
|
|
925
|
+
*/
|
|
926
|
+
payment_type: 'INVOICE' | 'PAYMENT_INTENT';
|
|
927
|
+
/**
|
|
928
|
+
* Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
|
|
929
|
+
* your payment type.
|
|
930
|
+
*/
|
|
931
|
+
invoice_metadata?: {
|
|
932
|
+
[key: string]: string;
|
|
933
|
+
};
|
|
934
|
+
/**
|
|
935
|
+
* If true, the payment will be made assuming the customer is present (i.e. on
|
|
936
|
+
* session).
|
|
937
|
+
*
|
|
938
|
+
* If false, the payment will be made assuming the customer is not present (i.e.
|
|
939
|
+
* off session). For cardholders from a country with an e-mandate requirement (e.g.
|
|
940
|
+
* India), the payment may be declined.
|
|
941
|
+
*
|
|
942
|
+
* If left blank, will default to false.
|
|
943
|
+
*/
|
|
944
|
+
on_session_payment?: boolean;
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
interface Credit {
|
|
949
|
+
/**
|
|
950
|
+
* Schedule for distributing the credit to the customer.
|
|
951
|
+
*/
|
|
952
|
+
access_schedule: Credit.AccessSchedule;
|
|
953
|
+
product_id: string;
|
|
954
|
+
/**
|
|
955
|
+
* Which products the credit applies to. If both applicable_product_ids and
|
|
956
|
+
* applicable_product_tags are not provided, the credit applies to all products.
|
|
957
|
+
*/
|
|
958
|
+
applicable_product_ids?: Array<string>;
|
|
959
|
+
/**
|
|
960
|
+
* Which tags the credit applies to. If both applicable_product_ids and
|
|
961
|
+
* applicable_product_tags are not provided, the credit applies to all products.
|
|
962
|
+
*/
|
|
963
|
+
applicable_product_tags?: Array<string>;
|
|
964
|
+
/**
|
|
965
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
966
|
+
*/
|
|
967
|
+
custom_fields?: {
|
|
968
|
+
[key: string]: string;
|
|
969
|
+
};
|
|
970
|
+
/**
|
|
971
|
+
* Used only in UI/API. It is not exposed to end customers.
|
|
972
|
+
*/
|
|
973
|
+
description?: string;
|
|
974
|
+
/**
|
|
975
|
+
* Optional configuration for credit hierarchy access control
|
|
976
|
+
*/
|
|
977
|
+
hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
|
|
978
|
+
/**
|
|
979
|
+
* displayed on invoices
|
|
980
|
+
*/
|
|
981
|
+
name?: string;
|
|
982
|
+
/**
|
|
983
|
+
* This field's availability is dependent on your client's configuration.
|
|
984
|
+
*/
|
|
985
|
+
netsuite_sales_order_id?: string;
|
|
986
|
+
/**
|
|
987
|
+
* If multiple credits are applicable, the one with the lower priority will apply
|
|
988
|
+
* first.
|
|
989
|
+
*/
|
|
990
|
+
priority?: number;
|
|
991
|
+
rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
|
|
992
|
+
/**
|
|
993
|
+
* List of filters that determine what kind of customer usage draws down a commit
|
|
994
|
+
* or credit. A customer's usage needs to meet the condition of at least one of the
|
|
995
|
+
* specifiers to contribute to a commit's or credit's drawdown. This field cannot
|
|
996
|
+
* be used together with `applicable_product_ids` or `applicable_product_tags`.
|
|
997
|
+
*/
|
|
998
|
+
specifiers?: Array<Shared.CommitSpecifierInput>;
|
|
999
|
+
}
|
|
1000
|
+
namespace Credit {
|
|
1001
|
+
/**
|
|
1002
|
+
* Schedule for distributing the credit to the customer.
|
|
1003
|
+
*/
|
|
1004
|
+
interface AccessSchedule {
|
|
1005
|
+
schedule_items: Array<AccessSchedule.ScheduleItem>;
|
|
1006
|
+
/**
|
|
1007
|
+
* Defaults to USD (cents) if not passed
|
|
1008
|
+
*/
|
|
1009
|
+
credit_type_id?: string;
|
|
1010
|
+
}
|
|
1011
|
+
namespace AccessSchedule {
|
|
1012
|
+
interface ScheduleItem {
|
|
1013
|
+
amount: number;
|
|
1014
|
+
/**
|
|
1015
|
+
* RFC 3339 timestamp (exclusive)
|
|
1016
|
+
*/
|
|
1017
|
+
ending_before: string;
|
|
1018
|
+
/**
|
|
1019
|
+
* RFC 3339 timestamp (inclusive)
|
|
1020
|
+
*/
|
|
1021
|
+
starting_at: string;
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
interface Discount {
|
|
1026
|
+
product_id: string;
|
|
1027
|
+
/**
|
|
1028
|
+
* Must provide either schedule_items or recurring_schedule.
|
|
1029
|
+
*/
|
|
1030
|
+
schedule: Discount.Schedule;
|
|
1031
|
+
/**
|
|
1032
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
1033
|
+
*/
|
|
1034
|
+
custom_fields?: {
|
|
1035
|
+
[key: string]: string;
|
|
1036
|
+
};
|
|
1037
|
+
/**
|
|
1038
|
+
* displayed on invoices
|
|
1039
|
+
*/
|
|
1040
|
+
name?: string;
|
|
1041
|
+
/**
|
|
1042
|
+
* This field's availability is dependent on your client's configuration.
|
|
1043
|
+
*/
|
|
1044
|
+
netsuite_sales_order_id?: string;
|
|
1045
|
+
}
|
|
1046
|
+
namespace Discount {
|
|
1047
|
+
/**
|
|
1048
|
+
* Must provide either schedule_items or recurring_schedule.
|
|
1049
|
+
*/
|
|
1050
|
+
interface Schedule {
|
|
1051
|
+
/**
|
|
1052
|
+
* Defaults to USD (cents) if not passed.
|
|
1053
|
+
*/
|
|
1054
|
+
credit_type_id?: string;
|
|
1055
|
+
/**
|
|
1056
|
+
* This field is only applicable to commit invoice schedules. If true, this
|
|
1057
|
+
* schedule will not generate an invoice.
|
|
1058
|
+
*/
|
|
1059
|
+
do_not_invoice?: boolean;
|
|
1060
|
+
/**
|
|
1061
|
+
* Enter the unit price and quantity for the charge or instead only send the
|
|
1062
|
+
* amount. If amount is sent, the unit price is assumed to be the amount and
|
|
1063
|
+
* quantity is inferred to be 1.
|
|
1064
|
+
*/
|
|
1065
|
+
recurring_schedule?: Schedule.RecurringSchedule;
|
|
1066
|
+
/**
|
|
1067
|
+
* Either provide amount or provide both unit_price and quantity.
|
|
1068
|
+
*/
|
|
1069
|
+
schedule_items?: Array<Schedule.ScheduleItem>;
|
|
1070
|
+
}
|
|
1071
|
+
namespace Schedule {
|
|
1072
|
+
/**
|
|
1073
|
+
* Enter the unit price and quantity for the charge or instead only send the
|
|
1074
|
+
* amount. If amount is sent, the unit price is assumed to be the amount and
|
|
1075
|
+
* quantity is inferred to be 1.
|
|
1076
|
+
*/
|
|
1077
|
+
interface RecurringSchedule {
|
|
1078
|
+
amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH';
|
|
1079
|
+
/**
|
|
1080
|
+
* RFC 3339 timestamp (exclusive).
|
|
1081
|
+
*/
|
|
1082
|
+
ending_before: string;
|
|
1083
|
+
frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL';
|
|
1084
|
+
/**
|
|
1085
|
+
* RFC 3339 timestamp (inclusive).
|
|
1086
|
+
*/
|
|
1087
|
+
starting_at: string;
|
|
1088
|
+
/**
|
|
1089
|
+
* Amount for the charge. Can be provided instead of unit_price and quantity. If
|
|
1090
|
+
* amount is sent, the unit_price is assumed to be the amount and quantity is
|
|
1091
|
+
* inferred to be 1.
|
|
1092
|
+
*/
|
|
1093
|
+
amount?: number;
|
|
1094
|
+
/**
|
|
1095
|
+
* Quantity for the charge. Will be multiplied by unit_price to determine the
|
|
1096
|
+
* amount and must be specified with unit_price. If specified amount cannot be
|
|
1097
|
+
* provided.
|
|
1098
|
+
*/
|
|
1099
|
+
quantity?: number;
|
|
1100
|
+
/**
|
|
1101
|
+
* Unit price for the charge. Will be multiplied by quantity to determine the
|
|
1102
|
+
* amount and must be specified with quantity. If specified amount cannot be
|
|
1103
|
+
* provided.
|
|
1104
|
+
*/
|
|
1105
|
+
unit_price?: number;
|
|
1106
|
+
}
|
|
1107
|
+
interface ScheduleItem {
|
|
1108
|
+
/**
|
|
1109
|
+
* timestamp of the scheduled event
|
|
1110
|
+
*/
|
|
1111
|
+
timestamp: string;
|
|
1112
|
+
/**
|
|
1113
|
+
* Amount for the charge. Can be provided instead of unit_price and quantity. If
|
|
1114
|
+
* amount is sent, the unit_price is assumed to be the amount and quantity is
|
|
1115
|
+
* inferred to be 1.
|
|
1116
|
+
*/
|
|
1117
|
+
amount?: number;
|
|
1118
|
+
/**
|
|
1119
|
+
* Quantity for the charge. Will be multiplied by unit_price to determine the
|
|
1120
|
+
* amount and must be specified with unit_price. If specified amount cannot be
|
|
1121
|
+
* provided.
|
|
1122
|
+
*/
|
|
1123
|
+
quantity?: number;
|
|
1124
|
+
/**
|
|
1125
|
+
* Unit price for the charge. Will be multiplied by quantity to determine the
|
|
1126
|
+
* amount and must be specified with quantity. If specified amount cannot be
|
|
1127
|
+
* provided.
|
|
1128
|
+
*/
|
|
1129
|
+
unit_price?: number;
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
interface HierarchyConfiguration {
|
|
1134
|
+
parent?: HierarchyConfiguration.Parent;
|
|
1135
|
+
parent_behavior?: HierarchyConfiguration.ParentBehavior;
|
|
1136
|
+
/**
|
|
1137
|
+
* Indicates whether the parent should pay for the child's invoice charges
|
|
1138
|
+
*/
|
|
1139
|
+
payer?: 'SELF' | 'PARENT';
|
|
1140
|
+
/**
|
|
1141
|
+
* Indicates the behavior of the child's invoice statements on the parent's
|
|
1142
|
+
* invoices **CONSOLIDATE**: Child's invoice statements will be added to parent's
|
|
1143
|
+
* consolidated invoices **SEPARATE**: Child's invoice statements will appear not
|
|
1144
|
+
* appear on parent's consolidated invoices
|
|
1145
|
+
*/
|
|
1146
|
+
usage_statement_behavior?: 'CONSOLIDATE' | 'SEPARATE';
|
|
1147
|
+
}
|
|
1148
|
+
namespace HierarchyConfiguration {
|
|
1149
|
+
interface Parent {
|
|
1150
|
+
contract_id: string;
|
|
1151
|
+
customer_id: string;
|
|
1152
|
+
}
|
|
1153
|
+
interface ParentBehavior {
|
|
1154
|
+
/**
|
|
1155
|
+
* Indicates the desired behavior of consolidated invoices generated by the parent
|
|
1156
|
+
* in a customer hierarchy **CONCATENATE**: Statements on the invoices of child
|
|
1157
|
+
* customers will be appended to the consolidated invoice **NONE**: Do not generate
|
|
1158
|
+
* consolidated invoices
|
|
1159
|
+
*/
|
|
1160
|
+
invoice_consolidation_type?: 'CONCATENATE' | 'NONE';
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
interface Override {
|
|
1164
|
+
/**
|
|
1165
|
+
* RFC 3339 timestamp indicating when the override will start applying (inclusive)
|
|
1166
|
+
*/
|
|
1167
|
+
starting_at: string;
|
|
1168
|
+
/**
|
|
1169
|
+
* tags identifying products whose rates are being overridden. Cannot be used in
|
|
1170
|
+
* conjunction with override_specifiers.
|
|
1171
|
+
*/
|
|
1172
|
+
applicable_product_tags?: Array<string>;
|
|
1173
|
+
/**
|
|
1174
|
+
* RFC 3339 timestamp indicating when the override will stop applying (exclusive)
|
|
1175
|
+
*/
|
|
1176
|
+
ending_before?: string;
|
|
1177
|
+
entitled?: boolean;
|
|
1178
|
+
/**
|
|
1179
|
+
* Indicates whether the override should only apply to commits. Defaults to
|
|
1180
|
+
* `false`. If `true`, you can specify relevant commits in `override_specifiers` by
|
|
1181
|
+
* passing `commit_ids`. if you do not specify `commit_ids`, then the override will
|
|
1182
|
+
* apply when consuming any prepaid or postpaid commit.
|
|
1183
|
+
*/
|
|
1184
|
+
is_commit_specific?: boolean;
|
|
1185
|
+
/**
|
|
1186
|
+
* Required for MULTIPLIER type. Must be >=0.
|
|
1187
|
+
*/
|
|
1188
|
+
multiplier?: number;
|
|
1189
|
+
/**
|
|
1190
|
+
* Cannot be used in conjunction with product_id or applicable_product_tags. If
|
|
1191
|
+
* provided, the override will apply to all products with the specified specifiers.
|
|
1192
|
+
*/
|
|
1193
|
+
override_specifiers?: Array<Override.OverrideSpecifier>;
|
|
1194
|
+
/**
|
|
1195
|
+
* Required for OVERWRITE type.
|
|
1196
|
+
*/
|
|
1197
|
+
overwrite_rate?: Override.OverwriteRate;
|
|
1198
|
+
/**
|
|
1199
|
+
* Required for EXPLICIT multiplier prioritization scheme and all TIERED overrides.
|
|
1200
|
+
* Under EXPLICIT prioritization, overwrites are prioritized first, and then tiered
|
|
1201
|
+
* and multiplier overrides are prioritized by their priority value (lowest first).
|
|
1202
|
+
* Must be > 0.
|
|
1203
|
+
*/
|
|
1204
|
+
priority?: number;
|
|
1205
|
+
/**
|
|
1206
|
+
* ID of the product whose rate is being overridden. Cannot be used in conjunction
|
|
1207
|
+
* with override_specifiers.
|
|
1208
|
+
*/
|
|
1209
|
+
product_id?: string;
|
|
1210
|
+
/**
|
|
1211
|
+
* Indicates whether the override applies to commit rates or list rates. Can only
|
|
1212
|
+
* be used for overrides that have `is_commit_specific` set to `true`. Defaults to
|
|
1213
|
+
* `"LIST_RATE"`.
|
|
1214
|
+
*/
|
|
1215
|
+
target?: 'COMMIT_RATE' | 'LIST_RATE';
|
|
1216
|
+
/**
|
|
1217
|
+
* Required for TIERED type. Must have at least one tier.
|
|
1218
|
+
*/
|
|
1219
|
+
tiers?: Array<Override.Tier>;
|
|
1220
|
+
/**
|
|
1221
|
+
* Overwrites are prioritized over multipliers and tiered overrides.
|
|
1222
|
+
*/
|
|
1223
|
+
type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED';
|
|
1224
|
+
}
|
|
1225
|
+
namespace Override {
|
|
1226
|
+
interface OverrideSpecifier {
|
|
1227
|
+
billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
1228
|
+
/**
|
|
1229
|
+
* Can only be used for commit specific overrides. Must be used in conjunction with
|
|
1230
|
+
* one of `product_id`, `product_tags`, `pricing_group_values`, or
|
|
1231
|
+
* `presentation_group_values`. If provided, the override will only apply to the
|
|
1232
|
+
* specified commits. If not provided, the override will apply to all commits.
|
|
1233
|
+
*/
|
|
1234
|
+
commit_ids?: Array<string>;
|
|
1235
|
+
/**
|
|
1236
|
+
* A map of group names to values. The override will only apply to line items with
|
|
1237
|
+
* the specified presentation group values.
|
|
1238
|
+
*/
|
|
1239
|
+
presentation_group_values?: {
|
|
1240
|
+
[key: string]: string;
|
|
1241
|
+
};
|
|
1242
|
+
/**
|
|
1243
|
+
* A map of pricing group names to values. The override will only apply to products
|
|
1244
|
+
* with the specified pricing group values.
|
|
1245
|
+
*/
|
|
1246
|
+
pricing_group_values?: {
|
|
1247
|
+
[key: string]: string;
|
|
1248
|
+
};
|
|
1249
|
+
/**
|
|
1250
|
+
* If provided, the override will only apply to the product with the specified ID.
|
|
1251
|
+
*/
|
|
1252
|
+
product_id?: string;
|
|
1253
|
+
/**
|
|
1254
|
+
* If provided, the override will only apply to products with all the specified
|
|
1255
|
+
* tags.
|
|
1256
|
+
*/
|
|
1257
|
+
product_tags?: Array<string>;
|
|
1258
|
+
/**
|
|
1259
|
+
* Can only be used for commit specific overrides. Must be used in conjunction with
|
|
1260
|
+
* one of `product_id`, `product_tags`, `pricing_group_values`, or
|
|
1261
|
+
* `presentation_group_values`. If provided, the override will only apply to
|
|
1262
|
+
* commits created by the specified recurring commit ids.
|
|
1263
|
+
*/
|
|
1264
|
+
recurring_commit_ids?: Array<string>;
|
|
1265
|
+
/**
|
|
1266
|
+
* Can only be used for commit specific overrides. Must be used in conjunction with
|
|
1267
|
+
* one of `product_id`, `product_tags`, `pricing_group_values`, or
|
|
1268
|
+
* `presentation_group_values`. If provided, the override will only apply to
|
|
1269
|
+
* credits created by the specified recurring credit ids.
|
|
1270
|
+
*/
|
|
1271
|
+
recurring_credit_ids?: Array<string>;
|
|
1272
|
+
}
|
|
1273
|
+
/**
|
|
1274
|
+
* Required for OVERWRITE type.
|
|
1275
|
+
*/
|
|
1276
|
+
interface OverwriteRate {
|
|
1277
|
+
rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
|
|
1278
|
+
credit_type_id?: string;
|
|
1279
|
+
/**
|
|
1280
|
+
* Only set for CUSTOM rate_type. This field is interpreted by custom rate
|
|
1281
|
+
* processors.
|
|
1282
|
+
*/
|
|
1283
|
+
custom_rate?: {
|
|
1284
|
+
[key: string]: unknown;
|
|
1285
|
+
};
|
|
1286
|
+
/**
|
|
1287
|
+
* Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
|
|
1288
|
+
* set to true.
|
|
1289
|
+
*/
|
|
1290
|
+
is_prorated?: boolean;
|
|
1291
|
+
/**
|
|
1292
|
+
* Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type,
|
|
1293
|
+
* this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1.
|
|
1294
|
+
*/
|
|
1295
|
+
price?: number;
|
|
1296
|
+
/**
|
|
1297
|
+
* Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
|
|
1298
|
+
*/
|
|
1299
|
+
quantity?: number;
|
|
1300
|
+
/**
|
|
1301
|
+
* Only set for TIERED rate_type.
|
|
1302
|
+
*/
|
|
1303
|
+
tiers?: Array<Shared.Tier>;
|
|
1304
|
+
}
|
|
1305
|
+
interface Tier {
|
|
1306
|
+
multiplier: number;
|
|
1307
|
+
size?: number;
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
interface ProfessionalService {
|
|
1311
|
+
/**
|
|
1312
|
+
* Maximum amount for the term.
|
|
1313
|
+
*/
|
|
1314
|
+
max_amount: number;
|
|
1315
|
+
product_id: string;
|
|
1316
|
+
/**
|
|
1317
|
+
* Quantity for the charge. Will be multiplied by unit_price to determine the
|
|
1318
|
+
* amount.
|
|
1319
|
+
*/
|
|
1320
|
+
quantity: number;
|
|
1321
|
+
/**
|
|
1322
|
+
* Unit price for the charge. Will be multiplied by quantity to determine the
|
|
1323
|
+
* amount and must be specified.
|
|
1324
|
+
*/
|
|
1325
|
+
unit_price: number;
|
|
1326
|
+
/**
|
|
1327
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
1328
|
+
*/
|
|
1329
|
+
custom_fields?: {
|
|
1330
|
+
[key: string]: string;
|
|
1331
|
+
};
|
|
1332
|
+
description?: string;
|
|
1333
|
+
/**
|
|
1334
|
+
* This field's availability is dependent on your client's configuration.
|
|
1335
|
+
*/
|
|
1336
|
+
netsuite_sales_order_id?: string;
|
|
1337
|
+
}
|
|
1338
|
+
interface RecurringCommit {
|
|
1339
|
+
/**
|
|
1340
|
+
* The amount of commit to grant.
|
|
1341
|
+
*/
|
|
1342
|
+
access_amount: RecurringCommit.AccessAmount;
|
|
1343
|
+
/**
|
|
1344
|
+
* Defines the length of the access schedule for each created commit/credit. The
|
|
1345
|
+
* value represents the number of units. Unit defaults to "PERIODS", where the
|
|
1346
|
+
* length of a period is determined by the recurrence_frequency.
|
|
1347
|
+
*/
|
|
1348
|
+
commit_duration: RecurringCommit.CommitDuration;
|
|
1349
|
+
/**
|
|
1350
|
+
* Will be passed down to the individual commits
|
|
1351
|
+
*/
|
|
1352
|
+
priority: number;
|
|
1353
|
+
product_id: string;
|
|
1354
|
+
/**
|
|
1355
|
+
* determines the start time for the first commit
|
|
1356
|
+
*/
|
|
1357
|
+
starting_at: string;
|
|
1358
|
+
/**
|
|
1359
|
+
* Will be passed down to the individual commits
|
|
1360
|
+
*/
|
|
1361
|
+
applicable_product_ids?: Array<string>;
|
|
1362
|
+
/**
|
|
1363
|
+
* Will be passed down to the individual commits
|
|
1364
|
+
*/
|
|
1365
|
+
applicable_product_tags?: Array<string>;
|
|
1366
|
+
/**
|
|
1367
|
+
* Will be passed down to the individual commits
|
|
1368
|
+
*/
|
|
1369
|
+
description?: string;
|
|
1370
|
+
/**
|
|
1371
|
+
* Determines when the contract will stop creating recurring commits. optional
|
|
1372
|
+
*/
|
|
1373
|
+
ending_before?: string;
|
|
1374
|
+
/**
|
|
1375
|
+
* Optional configuration for recurring commit/credit hierarchy access control
|
|
1376
|
+
*/
|
|
1377
|
+
hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
|
|
1378
|
+
/**
|
|
1379
|
+
* The amount the customer should be billed for the commit. Not required.
|
|
1380
|
+
*/
|
|
1381
|
+
invoice_amount?: RecurringCommit.InvoiceAmount;
|
|
1382
|
+
/**
|
|
1383
|
+
* displayed on invoices. will be passed through to the individual commits
|
|
1384
|
+
*/
|
|
1385
|
+
name?: string;
|
|
1386
|
+
/**
|
|
1387
|
+
* Will be passed down to the individual commits
|
|
1388
|
+
*/
|
|
1389
|
+
netsuite_sales_order_id?: string;
|
|
1390
|
+
/**
|
|
1391
|
+
* Determines whether the first and last commit will be prorated. If not provided,
|
|
1392
|
+
* the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
|
|
1393
|
+
*/
|
|
1394
|
+
proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
|
|
1395
|
+
/**
|
|
1396
|
+
* Whether the created commits will use the commit rate or list rate
|
|
1397
|
+
*/
|
|
1398
|
+
rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
|
|
1399
|
+
/**
|
|
1400
|
+
* The frequency at which the recurring commits will be created. If not provided: -
|
|
1401
|
+
* The commits will be created on the usage invoice frequency. If provided: - The
|
|
1402
|
+
* period defined in the duration will correspond to this frequency. - Commits will
|
|
1403
|
+
* be created aligned with the recurring commit's starting_at rather than the usage
|
|
1404
|
+
* invoice dates.
|
|
1405
|
+
*/
|
|
1406
|
+
recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
1407
|
+
/**
|
|
1408
|
+
* Will be passed down to the individual commits. This controls how much of an
|
|
1409
|
+
* individual unexpired commit will roll over upon contract transition. Must be
|
|
1410
|
+
* between 0 and 1.
|
|
1411
|
+
*/
|
|
1412
|
+
rollover_fraction?: number;
|
|
1413
|
+
/**
|
|
1414
|
+
* List of filters that determine what kind of customer usage draws down a commit
|
|
1415
|
+
* or credit. A customer's usage needs to meet the condition of at least one of the
|
|
1416
|
+
* specifiers to contribute to a commit's or credit's drawdown. This field cannot
|
|
1417
|
+
* be used together with `applicable_product_ids` or `applicable_product_tags`.
|
|
1418
|
+
*/
|
|
1419
|
+
specifiers?: Array<Shared.CommitSpecifierInput>;
|
|
1420
|
+
/**
|
|
1421
|
+
* Attach a subscription to the recurring commit/credit.
|
|
1422
|
+
*/
|
|
1423
|
+
subscription_config?: RecurringCommit.SubscriptionConfig;
|
|
1424
|
+
/**
|
|
1425
|
+
* A temporary ID that can be used to reference the recurring commit for commit
|
|
1426
|
+
* specific overrides.
|
|
1427
|
+
*/
|
|
1428
|
+
temporary_id?: string;
|
|
1429
|
+
}
|
|
1430
|
+
namespace RecurringCommit {
|
|
1431
|
+
/**
|
|
1432
|
+
* The amount of commit to grant.
|
|
1433
|
+
*/
|
|
1434
|
+
interface AccessAmount {
|
|
1435
|
+
credit_type_id: string;
|
|
1436
|
+
unit_price: number;
|
|
1437
|
+
/**
|
|
1438
|
+
* This field is required unless a subscription is attached via
|
|
1439
|
+
* `subscription_config`.
|
|
1440
|
+
*/
|
|
1441
|
+
quantity?: number;
|
|
1442
|
+
}
|
|
1443
|
+
/**
|
|
1444
|
+
* Defines the length of the access schedule for each created commit/credit. The
|
|
1445
|
+
* value represents the number of units. Unit defaults to "PERIODS", where the
|
|
1446
|
+
* length of a period is determined by the recurrence_frequency.
|
|
1447
|
+
*/
|
|
1448
|
+
interface CommitDuration {
|
|
1449
|
+
value: number;
|
|
1450
|
+
unit?: 'PERIODS';
|
|
1451
|
+
}
|
|
1452
|
+
/**
|
|
1453
|
+
* The amount the customer should be billed for the commit. Not required.
|
|
1454
|
+
*/
|
|
1455
|
+
interface InvoiceAmount {
|
|
1456
|
+
credit_type_id: string;
|
|
1457
|
+
quantity: number;
|
|
1458
|
+
unit_price: number;
|
|
1459
|
+
}
|
|
1460
|
+
/**
|
|
1461
|
+
* Attach a subscription to the recurring commit/credit.
|
|
1462
|
+
*/
|
|
1463
|
+
interface SubscriptionConfig {
|
|
1464
|
+
apply_seat_increase_config: SubscriptionConfig.ApplySeatIncreaseConfig;
|
|
1465
|
+
/**
|
|
1466
|
+
* ID of the subscription to configure on the recurring commit/credit.
|
|
1467
|
+
*/
|
|
1468
|
+
subscription_id: string;
|
|
1469
|
+
/**
|
|
1470
|
+
* If set to POOLED, allocation added per seat is pooled across the account.
|
|
1471
|
+
*/
|
|
1472
|
+
allocation?: 'INDIVIDUAL' | 'POOLED';
|
|
1473
|
+
}
|
|
1474
|
+
namespace SubscriptionConfig {
|
|
1475
|
+
interface ApplySeatIncreaseConfig {
|
|
1476
|
+
/**
|
|
1477
|
+
* Indicates whether a mid-period seat increase should be prorated.
|
|
1478
|
+
*/
|
|
1479
|
+
is_prorated: boolean;
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1482
|
+
}
|
|
1483
|
+
interface RecurringCredit {
|
|
1484
|
+
/**
|
|
1485
|
+
* The amount of commit to grant.
|
|
1486
|
+
*/
|
|
1487
|
+
access_amount: RecurringCredit.AccessAmount;
|
|
1488
|
+
/**
|
|
1489
|
+
* Defines the length of the access schedule for each created commit/credit. The
|
|
1490
|
+
* value represents the number of units. Unit defaults to "PERIODS", where the
|
|
1491
|
+
* length of a period is determined by the recurrence_frequency.
|
|
1492
|
+
*/
|
|
1493
|
+
commit_duration: RecurringCredit.CommitDuration;
|
|
1494
|
+
/**
|
|
1495
|
+
* Will be passed down to the individual commits
|
|
1496
|
+
*/
|
|
1497
|
+
priority: number;
|
|
1498
|
+
product_id: string;
|
|
1499
|
+
/**
|
|
1500
|
+
* determines the start time for the first commit
|
|
1501
|
+
*/
|
|
1502
|
+
starting_at: string;
|
|
1503
|
+
/**
|
|
1504
|
+
* Will be passed down to the individual commits
|
|
1505
|
+
*/
|
|
1506
|
+
applicable_product_ids?: Array<string>;
|
|
1507
|
+
/**
|
|
1508
|
+
* Will be passed down to the individual commits
|
|
1509
|
+
*/
|
|
1510
|
+
applicable_product_tags?: Array<string>;
|
|
1511
|
+
/**
|
|
1512
|
+
* Will be passed down to the individual commits
|
|
1513
|
+
*/
|
|
1514
|
+
description?: string;
|
|
1515
|
+
/**
|
|
1516
|
+
* Determines when the contract will stop creating recurring commits. optional
|
|
1517
|
+
*/
|
|
1518
|
+
ending_before?: string;
|
|
1519
|
+
/**
|
|
1520
|
+
* Optional configuration for recurring commit/credit hierarchy access control
|
|
1521
|
+
*/
|
|
1522
|
+
hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
|
|
1523
|
+
/**
|
|
1524
|
+
* displayed on invoices. will be passed through to the individual commits
|
|
1525
|
+
*/
|
|
1526
|
+
name?: string;
|
|
1527
|
+
/**
|
|
1528
|
+
* Will be passed down to the individual commits
|
|
1529
|
+
*/
|
|
1530
|
+
netsuite_sales_order_id?: string;
|
|
1531
|
+
/**
|
|
1532
|
+
* Determines whether the first and last commit will be prorated. If not provided,
|
|
1533
|
+
* the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
|
|
1534
|
+
*/
|
|
1535
|
+
proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
|
|
1536
|
+
/**
|
|
1537
|
+
* Whether the created commits will use the commit rate or list rate
|
|
1538
|
+
*/
|
|
1539
|
+
rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
|
|
1540
|
+
/**
|
|
1541
|
+
* The frequency at which the recurring commits will be created. If not provided: -
|
|
1542
|
+
* The commits will be created on the usage invoice frequency. If provided: - The
|
|
1543
|
+
* period defined in the duration will correspond to this frequency. - Commits will
|
|
1544
|
+
* be created aligned with the recurring commit's starting_at rather than the usage
|
|
1545
|
+
* invoice dates.
|
|
1546
|
+
*/
|
|
1547
|
+
recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
1548
|
+
/**
|
|
1549
|
+
* Will be passed down to the individual commits. This controls how much of an
|
|
1550
|
+
* individual unexpired commit will roll over upon contract transition. Must be
|
|
1551
|
+
* between 0 and 1.
|
|
1552
|
+
*/
|
|
1553
|
+
rollover_fraction?: number;
|
|
1554
|
+
/**
|
|
1555
|
+
* List of filters that determine what kind of customer usage draws down a commit
|
|
1556
|
+
* or credit. A customer's usage needs to meet the condition of at least one of the
|
|
1557
|
+
* specifiers to contribute to a commit's or credit's drawdown. This field cannot
|
|
1558
|
+
* be used together with `applicable_product_ids` or `applicable_product_tags`.
|
|
1559
|
+
*/
|
|
1560
|
+
specifiers?: Array<Shared.CommitSpecifierInput>;
|
|
1561
|
+
/**
|
|
1562
|
+
* Attach a subscription to the recurring commit/credit.
|
|
1563
|
+
*/
|
|
1564
|
+
subscription_config?: RecurringCredit.SubscriptionConfig;
|
|
1565
|
+
/**
|
|
1566
|
+
* A temporary ID that can be used to reference the recurring commit for commit
|
|
1567
|
+
* specific overrides.
|
|
1568
|
+
*/
|
|
1569
|
+
temporary_id?: string;
|
|
1570
|
+
}
|
|
1571
|
+
namespace RecurringCredit {
|
|
1572
|
+
/**
|
|
1573
|
+
* The amount of commit to grant.
|
|
1574
|
+
*/
|
|
1575
|
+
interface AccessAmount {
|
|
1576
|
+
credit_type_id: string;
|
|
1577
|
+
unit_price: number;
|
|
1578
|
+
/**
|
|
1579
|
+
* This field is required unless a subscription is attached via
|
|
1580
|
+
* `subscription_config`.
|
|
1581
|
+
*/
|
|
1582
|
+
quantity?: number;
|
|
1583
|
+
}
|
|
1584
|
+
/**
|
|
1585
|
+
* Defines the length of the access schedule for each created commit/credit. The
|
|
1586
|
+
* value represents the number of units. Unit defaults to "PERIODS", where the
|
|
1587
|
+
* length of a period is determined by the recurrence_frequency.
|
|
1588
|
+
*/
|
|
1589
|
+
interface CommitDuration {
|
|
1590
|
+
value: number;
|
|
1591
|
+
unit?: 'PERIODS';
|
|
1592
|
+
}
|
|
1593
|
+
/**
|
|
1594
|
+
* Attach a subscription to the recurring commit/credit.
|
|
1595
|
+
*/
|
|
1596
|
+
interface SubscriptionConfig {
|
|
1597
|
+
apply_seat_increase_config: SubscriptionConfig.ApplySeatIncreaseConfig;
|
|
1598
|
+
/**
|
|
1599
|
+
* ID of the subscription to configure on the recurring commit/credit.
|
|
1600
|
+
*/
|
|
1601
|
+
subscription_id: string;
|
|
1602
|
+
/**
|
|
1603
|
+
* If set to POOLED, allocation added per seat is pooled across the account.
|
|
1604
|
+
*/
|
|
1605
|
+
allocation?: 'INDIVIDUAL' | 'POOLED';
|
|
1606
|
+
}
|
|
1607
|
+
namespace SubscriptionConfig {
|
|
1608
|
+
interface ApplySeatIncreaseConfig {
|
|
1609
|
+
/**
|
|
1610
|
+
* Indicates whether a mid-period seat increase should be prorated.
|
|
1611
|
+
*/
|
|
1612
|
+
is_prorated: boolean;
|
|
1613
|
+
}
|
|
1614
|
+
}
|
|
1615
|
+
}
|
|
1616
|
+
interface ResellerRoyalty {
|
|
1617
|
+
fraction: number;
|
|
1618
|
+
netsuite_reseller_id: string;
|
|
1619
|
+
reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
|
|
1620
|
+
starting_at: string;
|
|
1621
|
+
/**
|
|
1622
|
+
* Must provide at least one of applicable_product_ids or applicable_product_tags.
|
|
1623
|
+
*/
|
|
1624
|
+
applicable_product_ids?: Array<string>;
|
|
1625
|
+
/**
|
|
1626
|
+
* Must provide at least one of applicable_product_ids or applicable_product_tags.
|
|
1627
|
+
*/
|
|
1628
|
+
applicable_product_tags?: Array<string>;
|
|
1629
|
+
aws_options?: ResellerRoyalty.AwsOptions;
|
|
1630
|
+
ending_before?: string;
|
|
1631
|
+
gcp_options?: ResellerRoyalty.GcpOptions;
|
|
1632
|
+
reseller_contract_value?: number;
|
|
1633
|
+
}
|
|
1634
|
+
namespace ResellerRoyalty {
|
|
1635
|
+
interface AwsOptions {
|
|
1636
|
+
aws_account_number?: string;
|
|
1637
|
+
aws_offer_id?: string;
|
|
1638
|
+
aws_payer_reference_id?: string;
|
|
1639
|
+
}
|
|
1640
|
+
interface GcpOptions {
|
|
1641
|
+
gcp_account_id?: string;
|
|
1642
|
+
gcp_offer_id?: string;
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1645
|
+
interface ScheduledCharge {
|
|
1646
|
+
product_id: string;
|
|
1647
|
+
/**
|
|
1648
|
+
* Must provide either schedule_items or recurring_schedule.
|
|
1649
|
+
*/
|
|
1650
|
+
schedule: ScheduledCharge.Schedule;
|
|
1651
|
+
/**
|
|
1652
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
1653
|
+
*/
|
|
1654
|
+
custom_fields?: {
|
|
1655
|
+
[key: string]: string;
|
|
1656
|
+
};
|
|
1657
|
+
/**
|
|
1658
|
+
* displayed on invoices
|
|
1659
|
+
*/
|
|
1660
|
+
name?: string;
|
|
1661
|
+
/**
|
|
1662
|
+
* This field's availability is dependent on your client's configuration.
|
|
1663
|
+
*/
|
|
1664
|
+
netsuite_sales_order_id?: string;
|
|
1665
|
+
}
|
|
1666
|
+
namespace ScheduledCharge {
|
|
1667
|
+
/**
|
|
1668
|
+
* Must provide either schedule_items or recurring_schedule.
|
|
1669
|
+
*/
|
|
1670
|
+
interface Schedule {
|
|
1671
|
+
/**
|
|
1672
|
+
* Defaults to USD (cents) if not passed.
|
|
1673
|
+
*/
|
|
1674
|
+
credit_type_id?: string;
|
|
1675
|
+
/**
|
|
1676
|
+
* This field is only applicable to commit invoice schedules. If true, this
|
|
1677
|
+
* schedule will not generate an invoice.
|
|
1678
|
+
*/
|
|
1679
|
+
do_not_invoice?: boolean;
|
|
1680
|
+
/**
|
|
1681
|
+
* Enter the unit price and quantity for the charge or instead only send the
|
|
1682
|
+
* amount. If amount is sent, the unit price is assumed to be the amount and
|
|
1683
|
+
* quantity is inferred to be 1.
|
|
1684
|
+
*/
|
|
1685
|
+
recurring_schedule?: Schedule.RecurringSchedule;
|
|
1686
|
+
/**
|
|
1687
|
+
* Either provide amount or provide both unit_price and quantity.
|
|
1688
|
+
*/
|
|
1689
|
+
schedule_items?: Array<Schedule.ScheduleItem>;
|
|
1690
|
+
}
|
|
1691
|
+
namespace Schedule {
|
|
1692
|
+
/**
|
|
1693
|
+
* Enter the unit price and quantity for the charge or instead only send the
|
|
1694
|
+
* amount. If amount is sent, the unit price is assumed to be the amount and
|
|
1695
|
+
* quantity is inferred to be 1.
|
|
1696
|
+
*/
|
|
1697
|
+
interface RecurringSchedule {
|
|
1698
|
+
amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH';
|
|
1699
|
+
/**
|
|
1700
|
+
* RFC 3339 timestamp (exclusive).
|
|
1701
|
+
*/
|
|
1702
|
+
ending_before: string;
|
|
1703
|
+
frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL';
|
|
1704
|
+
/**
|
|
1705
|
+
* RFC 3339 timestamp (inclusive).
|
|
1706
|
+
*/
|
|
1707
|
+
starting_at: string;
|
|
1708
|
+
/**
|
|
1709
|
+
* Amount for the charge. Can be provided instead of unit_price and quantity. If
|
|
1710
|
+
* amount is sent, the unit_price is assumed to be the amount and quantity is
|
|
1711
|
+
* inferred to be 1.
|
|
1712
|
+
*/
|
|
1713
|
+
amount?: number;
|
|
1714
|
+
/**
|
|
1715
|
+
* Quantity for the charge. Will be multiplied by unit_price to determine the
|
|
1716
|
+
* amount and must be specified with unit_price. If specified amount cannot be
|
|
1717
|
+
* provided.
|
|
1718
|
+
*/
|
|
1719
|
+
quantity?: number;
|
|
1720
|
+
/**
|
|
1721
|
+
* Unit price for the charge. Will be multiplied by quantity to determine the
|
|
1722
|
+
* amount and must be specified with quantity. If specified amount cannot be
|
|
1723
|
+
* provided.
|
|
1724
|
+
*/
|
|
1725
|
+
unit_price?: number;
|
|
1726
|
+
}
|
|
1727
|
+
interface ScheduleItem {
|
|
1728
|
+
/**
|
|
1729
|
+
* timestamp of the scheduled event
|
|
1730
|
+
*/
|
|
1731
|
+
timestamp: string;
|
|
1732
|
+
/**
|
|
1733
|
+
* Amount for the charge. Can be provided instead of unit_price and quantity. If
|
|
1734
|
+
* amount is sent, the unit_price is assumed to be the amount and quantity is
|
|
1735
|
+
* inferred to be 1.
|
|
1736
|
+
*/
|
|
1737
|
+
amount?: number;
|
|
1738
|
+
/**
|
|
1739
|
+
* Quantity for the charge. Will be multiplied by unit_price to determine the
|
|
1740
|
+
* amount and must be specified with unit_price. If specified amount cannot be
|
|
1741
|
+
* provided.
|
|
1742
|
+
*/
|
|
1743
|
+
quantity?: number;
|
|
1744
|
+
/**
|
|
1745
|
+
* Unit price for the charge. Will be multiplied by quantity to determine the
|
|
1746
|
+
* amount and must be specified with quantity. If specified amount cannot be
|
|
1747
|
+
* provided.
|
|
1748
|
+
*/
|
|
1749
|
+
unit_price?: number;
|
|
1750
|
+
}
|
|
1751
|
+
}
|
|
1752
|
+
}
|
|
1753
|
+
interface Subscription {
|
|
1754
|
+
collection_schedule: 'ADVANCE' | 'ARREARS';
|
|
1755
|
+
proration: Subscription.Proration;
|
|
1756
|
+
subscription_rate: Subscription.SubscriptionRate;
|
|
1757
|
+
/**
|
|
1758
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
1759
|
+
*/
|
|
1760
|
+
custom_fields?: {
|
|
1761
|
+
[key: string]: string;
|
|
1762
|
+
};
|
|
1763
|
+
description?: string;
|
|
1764
|
+
/**
|
|
1765
|
+
* Exclusive end time for the subscription. If not provided, subscription inherits
|
|
1766
|
+
* contract end date.
|
|
1767
|
+
*/
|
|
1768
|
+
ending_before?: string;
|
|
1769
|
+
/**
|
|
1770
|
+
* The initial quantity for the subscription. It must be non-negative value.
|
|
1771
|
+
* Required if quantity_management_mode is QUANTITY_ONLY.
|
|
1772
|
+
*/
|
|
1773
|
+
initial_quantity?: number;
|
|
1774
|
+
name?: string;
|
|
1775
|
+
/**
|
|
1776
|
+
* Determines how the subscription's quantity is controlled. Defaults to
|
|
1777
|
+
* QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
|
|
1778
|
+
* directly on the subscription. `initial_quantity` must be provided with this
|
|
1779
|
+
* option. Compatible with recurring commits/credits that use POOLED allocation.
|
|
1780
|
+
*/
|
|
1781
|
+
quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY';
|
|
1782
|
+
/**
|
|
1783
|
+
* Inclusive start time for the subscription. If not provided, defaults to contract
|
|
1784
|
+
* start date
|
|
1785
|
+
*/
|
|
1786
|
+
starting_at?: string;
|
|
1787
|
+
/**
|
|
1788
|
+
* A temporary ID used to reference the subscription in recurring commit/credit
|
|
1789
|
+
* subscription configs created within the same payload.
|
|
1790
|
+
*/
|
|
1791
|
+
temporary_id?: string;
|
|
1792
|
+
}
|
|
1793
|
+
namespace Subscription {
|
|
1794
|
+
interface Proration {
|
|
1795
|
+
/**
|
|
1796
|
+
* Indicates how mid-period quantity adjustments are invoiced.
|
|
1797
|
+
* **BILL_IMMEDIATELY**: Only available when collection schedule is `ADVANCE`. The
|
|
1798
|
+
* quantity increase will be billed immediately on the scheduled date.
|
|
1799
|
+
* **BILL_ON_NEXT_COLLECTION_DATE**: The quantity increase will be billed for
|
|
1800
|
+
* in-arrears at the end of the period.
|
|
1801
|
+
*/
|
|
1802
|
+
invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE';
|
|
1803
|
+
/**
|
|
1804
|
+
* Indicates if the partial period will be prorated or charged a full amount.
|
|
1805
|
+
*/
|
|
1806
|
+
is_prorated?: boolean;
|
|
1807
|
+
}
|
|
1808
|
+
interface SubscriptionRate {
|
|
1809
|
+
/**
|
|
1810
|
+
* Frequency to bill subscription with. Together with product_id, must match
|
|
1811
|
+
* existing rate on the rate card.
|
|
1812
|
+
*/
|
|
1813
|
+
billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
1814
|
+
/**
|
|
1815
|
+
* Must be subscription type product
|
|
1816
|
+
*/
|
|
1817
|
+
product_id: string;
|
|
1818
|
+
}
|
|
1819
|
+
}
|
|
1820
|
+
interface Transition {
|
|
1821
|
+
from_contract_id: string;
|
|
1822
|
+
/**
|
|
1823
|
+
* This field's available values may vary based on your client's configuration.
|
|
1824
|
+
*/
|
|
1825
|
+
type: 'SUPERSEDE' | 'RENEWAL';
|
|
1826
|
+
future_invoice_behavior?: Transition.FutureInvoiceBehavior;
|
|
1827
|
+
}
|
|
1828
|
+
namespace Transition {
|
|
1829
|
+
interface FutureInvoiceBehavior {
|
|
1830
|
+
/**
|
|
1831
|
+
* Controls whether future trueup invoices are billed or removed. Default behavior
|
|
1832
|
+
* is AS_IS if not specified.
|
|
1833
|
+
*/
|
|
1834
|
+
trueup?: 'REMOVE' | 'AS_IS' | null;
|
|
1835
|
+
}
|
|
1836
|
+
}
|
|
1837
|
+
interface UsageStatementSchedule {
|
|
1838
|
+
frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
1839
|
+
/**
|
|
1840
|
+
* Required when using CUSTOM_DATE. This option lets you set a historical billing
|
|
1841
|
+
* anchor date, aligning future billing cycles with a chosen cadence. For example,
|
|
1842
|
+
* if a contract starts on 2024-09-15 and you set the anchor date to 2024-09-10
|
|
1843
|
+
* with a MONTHLY frequency, the first usage statement will cover 09-15 to 10-10.
|
|
1844
|
+
* Subsequent statements will follow the 10th of each month.
|
|
1845
|
+
*/
|
|
1846
|
+
billing_anchor_date?: string;
|
|
1847
|
+
/**
|
|
1848
|
+
* If not provided, defaults to the first day of the month.
|
|
1849
|
+
*/
|
|
1850
|
+
day?: 'FIRST_OF_MONTH' | 'CONTRACT_START' | 'CUSTOM_DATE';
|
|
1851
|
+
/**
|
|
1852
|
+
* The date Metronome should start generating usage invoices. If unspecified,
|
|
1853
|
+
* contract start date will be used. This is useful to set if you want to import
|
|
1854
|
+
* historical invoices via our 'Create Historical Invoices' API rather than having
|
|
1855
|
+
* Metronome automatically generate them.
|
|
1856
|
+
*/
|
|
1857
|
+
invoice_generation_starting_at?: string;
|
|
1858
|
+
}
|
|
1859
|
+
}
|
|
1860
|
+
export interface ContractRetrieveParams {
|
|
1861
|
+
contract_id: string;
|
|
1862
|
+
customer_id: string;
|
|
1863
|
+
/**
|
|
1864
|
+
* Include the balance of credits and commits in the response. Setting this flag
|
|
1865
|
+
* may cause the query to be slower.
|
|
1866
|
+
*/
|
|
1867
|
+
include_balance?: boolean;
|
|
1868
|
+
/**
|
|
1869
|
+
* Include commit ledgers in the response. Setting this flag may cause the query to
|
|
1870
|
+
* be slower.
|
|
1871
|
+
*/
|
|
1872
|
+
include_ledgers?: boolean;
|
|
1873
|
+
}
|
|
1874
|
+
export interface ContractListParams {
|
|
1875
|
+
customer_id: string;
|
|
1876
|
+
/**
|
|
1877
|
+
* Optional RFC 3339 timestamp. If provided, the response will include only
|
|
1878
|
+
* contracts effective on the provided date. This cannot be provided if the
|
|
1879
|
+
* starting_at filter is provided.
|
|
1880
|
+
*/
|
|
1881
|
+
covering_date?: string;
|
|
1882
|
+
/**
|
|
1883
|
+
* Include archived contracts in the response
|
|
1884
|
+
*/
|
|
1885
|
+
include_archived?: boolean;
|
|
1886
|
+
/**
|
|
1887
|
+
* Include the balance of credits and commits in the response. Setting this flag
|
|
1888
|
+
* may cause the query to be slower.
|
|
1889
|
+
*/
|
|
1890
|
+
include_balance?: boolean;
|
|
1891
|
+
/**
|
|
1892
|
+
* Include commit ledgers in the response. Setting this flag may cause the query to
|
|
1893
|
+
* be slower.
|
|
1894
|
+
*/
|
|
1895
|
+
include_ledgers?: boolean;
|
|
1896
|
+
/**
|
|
1897
|
+
* Optional RFC 3339 timestamp. If provided, the response will include only
|
|
1898
|
+
* contracts where effective_at is on or after the provided date. This cannot be
|
|
1899
|
+
* provided if the covering_date filter is provided.
|
|
1900
|
+
*/
|
|
1901
|
+
starting_at?: string;
|
|
1902
|
+
}
|
|
1903
|
+
export interface ContractAddManualBalanceEntryParams {
|
|
1904
|
+
/**
|
|
1905
|
+
* ID of the balance (commit or credit) to update.
|
|
1906
|
+
*/
|
|
1907
|
+
id: string;
|
|
1908
|
+
/**
|
|
1909
|
+
* Amount to add to the segment. A negative number will draw down from the balance.
|
|
1910
|
+
*/
|
|
1911
|
+
amount: number;
|
|
1912
|
+
/**
|
|
1913
|
+
* ID of the customer whose balance is to be updated.
|
|
1914
|
+
*/
|
|
1915
|
+
customer_id: string;
|
|
1916
|
+
/**
|
|
1917
|
+
* Reason for the manual adjustment. This will be displayed in the ledger.
|
|
1918
|
+
*/
|
|
1919
|
+
reason: string;
|
|
1920
|
+
/**
|
|
1921
|
+
* ID of the segment to update.
|
|
1922
|
+
*/
|
|
1923
|
+
segment_id: string;
|
|
1924
|
+
/**
|
|
1925
|
+
* ID of the contract to update. Leave blank to update a customer level balance.
|
|
1926
|
+
*/
|
|
1927
|
+
contract_id?: string;
|
|
1928
|
+
/**
|
|
1929
|
+
* RFC 3339 timestamp indicating when the manual adjustment takes place. If not
|
|
1930
|
+
* provided, it will default to the start of the segment.
|
|
1931
|
+
*/
|
|
1932
|
+
timestamp?: string;
|
|
1933
|
+
}
|
|
1934
|
+
export interface ContractAmendParams {
|
|
1935
|
+
/**
|
|
1936
|
+
* ID of the contract to amend
|
|
1937
|
+
*/
|
|
1938
|
+
contract_id: string;
|
|
1939
|
+
/**
|
|
1940
|
+
* ID of the customer whose contract is to be amended
|
|
1941
|
+
*/
|
|
1942
|
+
customer_id: string;
|
|
1943
|
+
/**
|
|
1944
|
+
* inclusive start time for the amendment
|
|
1945
|
+
*/
|
|
1946
|
+
starting_at: string;
|
|
1947
|
+
commits?: Array<ContractAmendParams.Commit>;
|
|
1948
|
+
credits?: Array<ContractAmendParams.Credit>;
|
|
1949
|
+
/**
|
|
1950
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
1951
|
+
*/
|
|
1952
|
+
custom_fields?: {
|
|
1953
|
+
[key: string]: string;
|
|
1954
|
+
};
|
|
1955
|
+
/**
|
|
1956
|
+
* This field's availability is dependent on your client's configuration.
|
|
1957
|
+
*/
|
|
1958
|
+
discounts?: Array<ContractAmendParams.Discount>;
|
|
1959
|
+
/**
|
|
1960
|
+
* This field's availability is dependent on your client's configuration.
|
|
1961
|
+
*/
|
|
1962
|
+
netsuite_sales_order_id?: string;
|
|
1963
|
+
overrides?: Array<ContractAmendParams.Override>;
|
|
1964
|
+
/**
|
|
1965
|
+
* This field's availability is dependent on your client's configuration.
|
|
1966
|
+
*/
|
|
1967
|
+
professional_services?: Array<ContractAmendParams.ProfessionalService>;
|
|
1968
|
+
/**
|
|
1969
|
+
* This field's availability is dependent on your client's configuration.
|
|
1970
|
+
*/
|
|
1971
|
+
reseller_royalties?: Array<ContractAmendParams.ResellerRoyalty>;
|
|
1972
|
+
/**
|
|
1973
|
+
* This field's availability is dependent on your client's configuration.
|
|
1974
|
+
*/
|
|
1975
|
+
salesforce_opportunity_id?: string;
|
|
1976
|
+
scheduled_charges?: Array<ContractAmendParams.ScheduledCharge>;
|
|
1977
|
+
/**
|
|
1978
|
+
* This field's availability is dependent on your client's configuration.
|
|
1979
|
+
*/
|
|
1980
|
+
total_contract_value?: number;
|
|
1981
|
+
}
|
|
1982
|
+
export declare namespace ContractAmendParams {
|
|
1983
|
+
interface Commit {
|
|
1984
|
+
product_id: string;
|
|
1985
|
+
type: 'PREPAID' | 'POSTPAID';
|
|
1986
|
+
/**
|
|
1987
|
+
* Required: Schedule for distributing the commit to the customer. For "POSTPAID"
|
|
1988
|
+
* commits only one schedule item is allowed and amount must match invoice_schedule
|
|
1989
|
+
* total.
|
|
1990
|
+
*/
|
|
1991
|
+
access_schedule?: Commit.AccessSchedule;
|
|
1992
|
+
/**
|
|
1993
|
+
* (DEPRECATED) Use access_schedule and invoice_schedule instead.
|
|
1994
|
+
*/
|
|
1995
|
+
amount?: number;
|
|
1996
|
+
/**
|
|
1997
|
+
* Which products the commit applies to. If applicable_product_ids,
|
|
1998
|
+
* applicable_product_tags or specifiers are not provided, the commit applies to
|
|
1999
|
+
* all products.
|
|
2000
|
+
*/
|
|
2001
|
+
applicable_product_ids?: Array<string>;
|
|
2002
|
+
/**
|
|
2003
|
+
* Which tags the commit applies to. If applicable_product_ids,
|
|
2004
|
+
* applicable_product_tags or specifiers are not provided, the commit applies to
|
|
2005
|
+
* all products.
|
|
2006
|
+
*/
|
|
2007
|
+
applicable_product_tags?: Array<string>;
|
|
2008
|
+
/**
|
|
2009
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
2010
|
+
*/
|
|
2011
|
+
custom_fields?: {
|
|
2012
|
+
[key: string]: string;
|
|
2013
|
+
};
|
|
2014
|
+
/**
|
|
2015
|
+
* Used only in UI/API. It is not exposed to end customers.
|
|
2016
|
+
*/
|
|
2017
|
+
description?: string;
|
|
2018
|
+
/**
|
|
2019
|
+
* Optional configuration for commit hierarchy access control
|
|
2020
|
+
*/
|
|
2021
|
+
hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
|
|
2022
|
+
/**
|
|
2023
|
+
* Required for "POSTPAID" commits: the true up invoice will be generated at this
|
|
2024
|
+
* time and only one schedule item is allowed; the total must match access_schedule
|
|
2025
|
+
* amount. Optional for "PREPAID" commits: if not provided, this will be a
|
|
2026
|
+
* "complimentary" commit with no invoice.
|
|
2027
|
+
*/
|
|
2028
|
+
invoice_schedule?: Commit.InvoiceSchedule;
|
|
2029
|
+
/**
|
|
2030
|
+
* displayed on invoices
|
|
2031
|
+
*/
|
|
2032
|
+
name?: string;
|
|
2033
|
+
/**
|
|
2034
|
+
* This field's availability is dependent on your client's configuration.
|
|
2035
|
+
*/
|
|
2036
|
+
netsuite_sales_order_id?: string;
|
|
2037
|
+
/**
|
|
2038
|
+
* optionally payment gate this commit
|
|
2039
|
+
*/
|
|
2040
|
+
payment_gate_config?: Commit.PaymentGateConfig;
|
|
2041
|
+
/**
|
|
2042
|
+
* If multiple commits are applicable, the one with the lower priority will apply
|
|
2043
|
+
* first.
|
|
2044
|
+
*/
|
|
2045
|
+
priority?: number;
|
|
2046
|
+
rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
|
|
2047
|
+
/**
|
|
2048
|
+
* Fraction of unused segments that will be rolled over. Must be between 0 and 1.
|
|
2049
|
+
*/
|
|
2050
|
+
rollover_fraction?: number;
|
|
2051
|
+
/**
|
|
2052
|
+
* List of filters that determine what kind of customer usage draws down a commit
|
|
2053
|
+
* or credit. A customer's usage needs to meet the condition of at least one of the
|
|
2054
|
+
* specifiers to contribute to a commit's or credit's drawdown. This field cannot
|
|
2055
|
+
* be used together with `applicable_product_ids` or `applicable_product_tags`.
|
|
2056
|
+
*/
|
|
2057
|
+
specifiers?: Array<Shared.CommitSpecifierInput>;
|
|
2058
|
+
/**
|
|
2059
|
+
* A temporary ID for the commit that can be used to reference the commit for
|
|
2060
|
+
* commit specific overrides.
|
|
2061
|
+
*/
|
|
2062
|
+
temporary_id?: string;
|
|
2063
|
+
}
|
|
2064
|
+
namespace Commit {
|
|
2065
|
+
/**
|
|
2066
|
+
* Required: Schedule for distributing the commit to the customer. For "POSTPAID"
|
|
2067
|
+
* commits only one schedule item is allowed and amount must match invoice_schedule
|
|
2068
|
+
* total.
|
|
2069
|
+
*/
|
|
2070
|
+
interface AccessSchedule {
|
|
2071
|
+
schedule_items: Array<AccessSchedule.ScheduleItem>;
|
|
2072
|
+
/**
|
|
2073
|
+
* Defaults to USD (cents) if not passed
|
|
2074
|
+
*/
|
|
2075
|
+
credit_type_id?: string;
|
|
2076
|
+
}
|
|
2077
|
+
namespace AccessSchedule {
|
|
2078
|
+
interface ScheduleItem {
|
|
2079
|
+
amount: number;
|
|
2080
|
+
/**
|
|
2081
|
+
* RFC 3339 timestamp (exclusive)
|
|
2082
|
+
*/
|
|
2083
|
+
ending_before: string;
|
|
2084
|
+
/**
|
|
2085
|
+
* RFC 3339 timestamp (inclusive)
|
|
2086
|
+
*/
|
|
2087
|
+
starting_at: string;
|
|
2088
|
+
}
|
|
2089
|
+
}
|
|
2090
|
+
/**
|
|
2091
|
+
* Required for "POSTPAID" commits: the true up invoice will be generated at this
|
|
2092
|
+
* time and only one schedule item is allowed; the total must match access_schedule
|
|
2093
|
+
* amount. Optional for "PREPAID" commits: if not provided, this will be a
|
|
2094
|
+
* "complimentary" commit with no invoice.
|
|
2095
|
+
*/
|
|
2096
|
+
interface InvoiceSchedule {
|
|
2097
|
+
/**
|
|
2098
|
+
* Defaults to USD (cents) if not passed.
|
|
2099
|
+
*/
|
|
2100
|
+
credit_type_id?: string;
|
|
2101
|
+
/**
|
|
2102
|
+
* This field is only applicable to commit invoice schedules. If true, this
|
|
2103
|
+
* schedule will not generate an invoice.
|
|
2104
|
+
*/
|
|
2105
|
+
do_not_invoice?: boolean;
|
|
2106
|
+
/**
|
|
2107
|
+
* Enter the unit price and quantity for the charge or instead only send the
|
|
2108
|
+
* amount. If amount is sent, the unit price is assumed to be the amount and
|
|
2109
|
+
* quantity is inferred to be 1.
|
|
2110
|
+
*/
|
|
2111
|
+
recurring_schedule?: InvoiceSchedule.RecurringSchedule;
|
|
2112
|
+
/**
|
|
2113
|
+
* Either provide amount or provide both unit_price and quantity.
|
|
2114
|
+
*/
|
|
2115
|
+
schedule_items?: Array<InvoiceSchedule.ScheduleItem>;
|
|
2116
|
+
}
|
|
2117
|
+
namespace InvoiceSchedule {
|
|
2118
|
+
/**
|
|
2119
|
+
* Enter the unit price and quantity for the charge or instead only send the
|
|
2120
|
+
* amount. If amount is sent, the unit price is assumed to be the amount and
|
|
2121
|
+
* quantity is inferred to be 1.
|
|
2122
|
+
*/
|
|
2123
|
+
interface RecurringSchedule {
|
|
2124
|
+
amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH';
|
|
2125
|
+
/**
|
|
2126
|
+
* RFC 3339 timestamp (exclusive).
|
|
2127
|
+
*/
|
|
2128
|
+
ending_before: string;
|
|
2129
|
+
frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL';
|
|
2130
|
+
/**
|
|
2131
|
+
* RFC 3339 timestamp (inclusive).
|
|
2132
|
+
*/
|
|
2133
|
+
starting_at: string;
|
|
2134
|
+
/**
|
|
2135
|
+
* Amount for the charge. Can be provided instead of unit_price and quantity. If
|
|
2136
|
+
* amount is sent, the unit_price is assumed to be the amount and quantity is
|
|
2137
|
+
* inferred to be 1.
|
|
2138
|
+
*/
|
|
2139
|
+
amount?: number;
|
|
2140
|
+
/**
|
|
2141
|
+
* Quantity for the charge. Will be multiplied by unit_price to determine the
|
|
2142
|
+
* amount and must be specified with unit_price. If specified amount cannot be
|
|
2143
|
+
* provided.
|
|
2144
|
+
*/
|
|
2145
|
+
quantity?: number;
|
|
2146
|
+
/**
|
|
2147
|
+
* Unit price for the charge. Will be multiplied by quantity to determine the
|
|
2148
|
+
* amount and must be specified with quantity. If specified amount cannot be
|
|
2149
|
+
* provided.
|
|
2150
|
+
*/
|
|
2151
|
+
unit_price?: number;
|
|
2152
|
+
}
|
|
2153
|
+
interface ScheduleItem {
|
|
2154
|
+
/**
|
|
2155
|
+
* timestamp of the scheduled event
|
|
2156
|
+
*/
|
|
2157
|
+
timestamp: string;
|
|
2158
|
+
/**
|
|
2159
|
+
* Amount for the charge. Can be provided instead of unit_price and quantity. If
|
|
2160
|
+
* amount is sent, the unit_price is assumed to be the amount and quantity is
|
|
2161
|
+
* inferred to be 1.
|
|
2162
|
+
*/
|
|
2163
|
+
amount?: number;
|
|
2164
|
+
/**
|
|
2165
|
+
* Quantity for the charge. Will be multiplied by unit_price to determine the
|
|
2166
|
+
* amount and must be specified with unit_price. If specified amount cannot be
|
|
2167
|
+
* provided.
|
|
2168
|
+
*/
|
|
2169
|
+
quantity?: number;
|
|
2170
|
+
/**
|
|
2171
|
+
* Unit price for the charge. Will be multiplied by quantity to determine the
|
|
2172
|
+
* amount and must be specified with quantity. If specified amount cannot be
|
|
2173
|
+
* provided.
|
|
2174
|
+
*/
|
|
2175
|
+
unit_price?: number;
|
|
2176
|
+
}
|
|
2177
|
+
}
|
|
2178
|
+
/**
|
|
2179
|
+
* optionally payment gate this commit
|
|
2180
|
+
*/
|
|
2181
|
+
interface PaymentGateConfig {
|
|
2182
|
+
/**
|
|
2183
|
+
* Gate access to the commit balance based on successful collection of payment.
|
|
2184
|
+
* Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
|
|
2185
|
+
* facilitate payment using your own payment integration. Select NONE if you do not
|
|
2186
|
+
* wish to payment gate the commit balance.
|
|
2187
|
+
*/
|
|
2188
|
+
payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
|
|
2189
|
+
/**
|
|
2190
|
+
* Only applicable if using PRECALCULATED as your tax type.
|
|
2191
|
+
*/
|
|
2192
|
+
precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
|
|
2193
|
+
/**
|
|
2194
|
+
* Only applicable if using STRIPE as your payment gate type.
|
|
2195
|
+
*/
|
|
2196
|
+
stripe_config?: PaymentGateConfig.StripeConfig;
|
|
2197
|
+
/**
|
|
2198
|
+
* Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
|
|
2199
|
+
* not wish Metronome to calculate tax on your behalf. Leaving this field blank
|
|
2200
|
+
* will default to NONE.
|
|
2201
|
+
*/
|
|
2202
|
+
tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'AVALARA' | 'PRECALCULATED';
|
|
2203
|
+
}
|
|
2204
|
+
namespace PaymentGateConfig {
|
|
2205
|
+
/**
|
|
2206
|
+
* Only applicable if using PRECALCULATED as your tax type.
|
|
2207
|
+
*/
|
|
2208
|
+
interface PrecalculatedTaxConfig {
|
|
2209
|
+
/**
|
|
2210
|
+
* Amount of tax to be applied. This should be in the same currency and
|
|
2211
|
+
* denomination as the commit's invoice schedule
|
|
2212
|
+
*/
|
|
2213
|
+
tax_amount: number;
|
|
2214
|
+
/**
|
|
2215
|
+
* Name of the tax to be applied. This may be used in an invoice line item
|
|
2216
|
+
* description.
|
|
2217
|
+
*/
|
|
2218
|
+
tax_name?: string;
|
|
2219
|
+
}
|
|
2220
|
+
/**
|
|
2221
|
+
* Only applicable if using STRIPE as your payment gate type.
|
|
2222
|
+
*/
|
|
2223
|
+
interface StripeConfig {
|
|
2224
|
+
/**
|
|
2225
|
+
* If left blank, will default to INVOICE
|
|
2226
|
+
*/
|
|
2227
|
+
payment_type: 'INVOICE' | 'PAYMENT_INTENT';
|
|
2228
|
+
/**
|
|
2229
|
+
* Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
|
|
2230
|
+
* your payment type.
|
|
2231
|
+
*/
|
|
2232
|
+
invoice_metadata?: {
|
|
2233
|
+
[key: string]: string;
|
|
2234
|
+
};
|
|
2235
|
+
/**
|
|
2236
|
+
* If true, the payment will be made assuming the customer is present (i.e. on
|
|
2237
|
+
* session).
|
|
2238
|
+
*
|
|
2239
|
+
* If false, the payment will be made assuming the customer is not present (i.e.
|
|
2240
|
+
* off session). For cardholders from a country with an e-mandate requirement (e.g.
|
|
2241
|
+
* India), the payment may be declined.
|
|
2242
|
+
*
|
|
2243
|
+
* If left blank, will default to false.
|
|
2244
|
+
*/
|
|
2245
|
+
on_session_payment?: boolean;
|
|
2246
|
+
}
|
|
2247
|
+
}
|
|
2248
|
+
}
|
|
2249
|
+
interface Credit {
|
|
2250
|
+
/**
|
|
2251
|
+
* Schedule for distributing the credit to the customer.
|
|
2252
|
+
*/
|
|
2253
|
+
access_schedule: Credit.AccessSchedule;
|
|
2254
|
+
product_id: string;
|
|
2255
|
+
/**
|
|
2256
|
+
* Which products the credit applies to. If both applicable_product_ids and
|
|
2257
|
+
* applicable_product_tags are not provided, the credit applies to all products.
|
|
2258
|
+
*/
|
|
2259
|
+
applicable_product_ids?: Array<string>;
|
|
2260
|
+
/**
|
|
2261
|
+
* Which tags the credit applies to. If both applicable_product_ids and
|
|
2262
|
+
* applicable_product_tags are not provided, the credit applies to all products.
|
|
2263
|
+
*/
|
|
2264
|
+
applicable_product_tags?: Array<string>;
|
|
2265
|
+
/**
|
|
2266
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
2267
|
+
*/
|
|
2268
|
+
custom_fields?: {
|
|
2269
|
+
[key: string]: string;
|
|
2270
|
+
};
|
|
2271
|
+
/**
|
|
2272
|
+
* Used only in UI/API. It is not exposed to end customers.
|
|
2273
|
+
*/
|
|
2274
|
+
description?: string;
|
|
2275
|
+
/**
|
|
2276
|
+
* Optional configuration for credit hierarchy access control
|
|
2277
|
+
*/
|
|
2278
|
+
hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
|
|
2279
|
+
/**
|
|
2280
|
+
* displayed on invoices
|
|
2281
|
+
*/
|
|
2282
|
+
name?: string;
|
|
2283
|
+
/**
|
|
2284
|
+
* This field's availability is dependent on your client's configuration.
|
|
2285
|
+
*/
|
|
2286
|
+
netsuite_sales_order_id?: string;
|
|
2287
|
+
/**
|
|
2288
|
+
* If multiple credits are applicable, the one with the lower priority will apply
|
|
2289
|
+
* first.
|
|
2290
|
+
*/
|
|
2291
|
+
priority?: number;
|
|
2292
|
+
rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
|
|
2293
|
+
/**
|
|
2294
|
+
* List of filters that determine what kind of customer usage draws down a commit
|
|
2295
|
+
* or credit. A customer's usage needs to meet the condition of at least one of the
|
|
2296
|
+
* specifiers to contribute to a commit's or credit's drawdown. This field cannot
|
|
2297
|
+
* be used together with `applicable_product_ids` or `applicable_product_tags`.
|
|
2298
|
+
*/
|
|
2299
|
+
specifiers?: Array<Shared.CommitSpecifierInput>;
|
|
2300
|
+
}
|
|
2301
|
+
namespace Credit {
|
|
2302
|
+
/**
|
|
2303
|
+
* Schedule for distributing the credit to the customer.
|
|
2304
|
+
*/
|
|
2305
|
+
interface AccessSchedule {
|
|
2306
|
+
schedule_items: Array<AccessSchedule.ScheduleItem>;
|
|
2307
|
+
/**
|
|
2308
|
+
* Defaults to USD (cents) if not passed
|
|
2309
|
+
*/
|
|
2310
|
+
credit_type_id?: string;
|
|
2311
|
+
}
|
|
2312
|
+
namespace AccessSchedule {
|
|
2313
|
+
interface ScheduleItem {
|
|
2314
|
+
amount: number;
|
|
2315
|
+
/**
|
|
2316
|
+
* RFC 3339 timestamp (exclusive)
|
|
2317
|
+
*/
|
|
2318
|
+
ending_before: string;
|
|
2319
|
+
/**
|
|
2320
|
+
* RFC 3339 timestamp (inclusive)
|
|
2321
|
+
*/
|
|
2322
|
+
starting_at: string;
|
|
2323
|
+
}
|
|
2324
|
+
}
|
|
2325
|
+
}
|
|
2326
|
+
interface Discount {
|
|
2327
|
+
product_id: string;
|
|
2328
|
+
/**
|
|
2329
|
+
* Must provide either schedule_items or recurring_schedule.
|
|
2330
|
+
*/
|
|
2331
|
+
schedule: Discount.Schedule;
|
|
2332
|
+
/**
|
|
2333
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
2334
|
+
*/
|
|
2335
|
+
custom_fields?: {
|
|
2336
|
+
[key: string]: string;
|
|
2337
|
+
};
|
|
2338
|
+
/**
|
|
2339
|
+
* displayed on invoices
|
|
2340
|
+
*/
|
|
2341
|
+
name?: string;
|
|
2342
|
+
/**
|
|
2343
|
+
* This field's availability is dependent on your client's configuration.
|
|
2344
|
+
*/
|
|
2345
|
+
netsuite_sales_order_id?: string;
|
|
2346
|
+
}
|
|
2347
|
+
namespace Discount {
|
|
2348
|
+
/**
|
|
2349
|
+
* Must provide either schedule_items or recurring_schedule.
|
|
2350
|
+
*/
|
|
2351
|
+
interface Schedule {
|
|
2352
|
+
/**
|
|
2353
|
+
* Defaults to USD (cents) if not passed.
|
|
2354
|
+
*/
|
|
2355
|
+
credit_type_id?: string;
|
|
2356
|
+
/**
|
|
2357
|
+
* This field is only applicable to commit invoice schedules. If true, this
|
|
2358
|
+
* schedule will not generate an invoice.
|
|
2359
|
+
*/
|
|
2360
|
+
do_not_invoice?: boolean;
|
|
2361
|
+
/**
|
|
2362
|
+
* Enter the unit price and quantity for the charge or instead only send the
|
|
2363
|
+
* amount. If amount is sent, the unit price is assumed to be the amount and
|
|
2364
|
+
* quantity is inferred to be 1.
|
|
2365
|
+
*/
|
|
2366
|
+
recurring_schedule?: Schedule.RecurringSchedule;
|
|
2367
|
+
/**
|
|
2368
|
+
* Either provide amount or provide both unit_price and quantity.
|
|
2369
|
+
*/
|
|
2370
|
+
schedule_items?: Array<Schedule.ScheduleItem>;
|
|
2371
|
+
}
|
|
2372
|
+
namespace Schedule {
|
|
2373
|
+
/**
|
|
2374
|
+
* Enter the unit price and quantity for the charge or instead only send the
|
|
2375
|
+
* amount. If amount is sent, the unit price is assumed to be the amount and
|
|
2376
|
+
* quantity is inferred to be 1.
|
|
2377
|
+
*/
|
|
2378
|
+
interface RecurringSchedule {
|
|
2379
|
+
amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH';
|
|
2380
|
+
/**
|
|
2381
|
+
* RFC 3339 timestamp (exclusive).
|
|
2382
|
+
*/
|
|
2383
|
+
ending_before: string;
|
|
2384
|
+
frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL';
|
|
2385
|
+
/**
|
|
2386
|
+
* RFC 3339 timestamp (inclusive).
|
|
2387
|
+
*/
|
|
2388
|
+
starting_at: string;
|
|
2389
|
+
/**
|
|
2390
|
+
* Amount for the charge. Can be provided instead of unit_price and quantity. If
|
|
2391
|
+
* amount is sent, the unit_price is assumed to be the amount and quantity is
|
|
2392
|
+
* inferred to be 1.
|
|
2393
|
+
*/
|
|
2394
|
+
amount?: number;
|
|
2395
|
+
/**
|
|
2396
|
+
* Quantity for the charge. Will be multiplied by unit_price to determine the
|
|
2397
|
+
* amount and must be specified with unit_price. If specified amount cannot be
|
|
2398
|
+
* provided.
|
|
2399
|
+
*/
|
|
2400
|
+
quantity?: number;
|
|
2401
|
+
/**
|
|
2402
|
+
* Unit price for the charge. Will be multiplied by quantity to determine the
|
|
2403
|
+
* amount and must be specified with quantity. If specified amount cannot be
|
|
2404
|
+
* provided.
|
|
2405
|
+
*/
|
|
2406
|
+
unit_price?: number;
|
|
2407
|
+
}
|
|
2408
|
+
interface ScheduleItem {
|
|
2409
|
+
/**
|
|
2410
|
+
* timestamp of the scheduled event
|
|
2411
|
+
*/
|
|
2412
|
+
timestamp: string;
|
|
2413
|
+
/**
|
|
2414
|
+
* Amount for the charge. Can be provided instead of unit_price and quantity. If
|
|
2415
|
+
* amount is sent, the unit_price is assumed to be the amount and quantity is
|
|
2416
|
+
* inferred to be 1.
|
|
2417
|
+
*/
|
|
2418
|
+
amount?: number;
|
|
2419
|
+
/**
|
|
2420
|
+
* Quantity for the charge. Will be multiplied by unit_price to determine the
|
|
2421
|
+
* amount and must be specified with unit_price. If specified amount cannot be
|
|
2422
|
+
* provided.
|
|
2423
|
+
*/
|
|
2424
|
+
quantity?: number;
|
|
2425
|
+
/**
|
|
2426
|
+
* Unit price for the charge. Will be multiplied by quantity to determine the
|
|
2427
|
+
* amount and must be specified with quantity. If specified amount cannot be
|
|
2428
|
+
* provided.
|
|
2429
|
+
*/
|
|
2430
|
+
unit_price?: number;
|
|
2431
|
+
}
|
|
2432
|
+
}
|
|
2433
|
+
}
|
|
2434
|
+
interface Override {
|
|
2435
|
+
/**
|
|
2436
|
+
* RFC 3339 timestamp indicating when the override will start applying (inclusive)
|
|
2437
|
+
*/
|
|
2438
|
+
starting_at: string;
|
|
2439
|
+
/**
|
|
2440
|
+
* tags identifying products whose rates are being overridden. Cannot be used in
|
|
2441
|
+
* conjunction with override_specifiers.
|
|
2442
|
+
*/
|
|
2443
|
+
applicable_product_tags?: Array<string>;
|
|
2444
|
+
/**
|
|
2445
|
+
* RFC 3339 timestamp indicating when the override will stop applying (exclusive)
|
|
2446
|
+
*/
|
|
2447
|
+
ending_before?: string;
|
|
2448
|
+
entitled?: boolean;
|
|
2449
|
+
/**
|
|
2450
|
+
* Indicates whether the override should only apply to commits. Defaults to
|
|
2451
|
+
* `false`. If `true`, you can specify relevant commits in `override_specifiers` by
|
|
2452
|
+
* passing `commit_ids`. if you do not specify `commit_ids`, then the override will
|
|
2453
|
+
* apply when consuming any prepaid or postpaid commit.
|
|
2454
|
+
*/
|
|
2455
|
+
is_commit_specific?: boolean;
|
|
2456
|
+
/**
|
|
2457
|
+
* Required for MULTIPLIER type. Must be >=0.
|
|
2458
|
+
*/
|
|
2459
|
+
multiplier?: number;
|
|
2460
|
+
/**
|
|
2461
|
+
* Cannot be used in conjunction with product_id or applicable_product_tags. If
|
|
2462
|
+
* provided, the override will apply to all products with the specified specifiers.
|
|
2463
|
+
*/
|
|
2464
|
+
override_specifiers?: Array<Override.OverrideSpecifier>;
|
|
2465
|
+
/**
|
|
2466
|
+
* Required for OVERWRITE type.
|
|
2467
|
+
*/
|
|
2468
|
+
overwrite_rate?: Override.OverwriteRate;
|
|
2469
|
+
/**
|
|
2470
|
+
* Required for EXPLICIT multiplier prioritization scheme and all TIERED overrides.
|
|
2471
|
+
* Under EXPLICIT prioritization, overwrites are prioritized first, and then tiered
|
|
2472
|
+
* and multiplier overrides are prioritized by their priority value (lowest first).
|
|
2473
|
+
* Must be > 0.
|
|
2474
|
+
*/
|
|
2475
|
+
priority?: number;
|
|
2476
|
+
/**
|
|
2477
|
+
* ID of the product whose rate is being overridden. Cannot be used in conjunction
|
|
2478
|
+
* with override_specifiers.
|
|
2479
|
+
*/
|
|
2480
|
+
product_id?: string;
|
|
2481
|
+
/**
|
|
2482
|
+
* Indicates whether the override applies to commit rates or list rates. Can only
|
|
2483
|
+
* be used for overrides that have `is_commit_specific` set to `true`. Defaults to
|
|
2484
|
+
* `"LIST_RATE"`.
|
|
2485
|
+
*/
|
|
2486
|
+
target?: 'COMMIT_RATE' | 'LIST_RATE';
|
|
2487
|
+
/**
|
|
2488
|
+
* Required for TIERED type. Must have at least one tier.
|
|
2489
|
+
*/
|
|
2490
|
+
tiers?: Array<Override.Tier>;
|
|
2491
|
+
/**
|
|
2492
|
+
* Overwrites are prioritized over multipliers and tiered overrides.
|
|
2493
|
+
*/
|
|
2494
|
+
type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED';
|
|
2495
|
+
}
|
|
2496
|
+
namespace Override {
|
|
2497
|
+
interface OverrideSpecifier {
|
|
2498
|
+
billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
2499
|
+
/**
|
|
2500
|
+
* Can only be used for commit specific overrides. Must be used in conjunction with
|
|
2501
|
+
* one of `product_id`, `product_tags`, `pricing_group_values`, or
|
|
2502
|
+
* `presentation_group_values`. If provided, the override will only apply to the
|
|
2503
|
+
* specified commits. If not provided, the override will apply to all commits.
|
|
2504
|
+
*/
|
|
2505
|
+
commit_ids?: Array<string>;
|
|
2506
|
+
/**
|
|
2507
|
+
* A map of group names to values. The override will only apply to line items with
|
|
2508
|
+
* the specified presentation group values.
|
|
2509
|
+
*/
|
|
2510
|
+
presentation_group_values?: {
|
|
2511
|
+
[key: string]: string;
|
|
2512
|
+
};
|
|
2513
|
+
/**
|
|
2514
|
+
* A map of pricing group names to values. The override will only apply to products
|
|
2515
|
+
* with the specified pricing group values.
|
|
2516
|
+
*/
|
|
2517
|
+
pricing_group_values?: {
|
|
2518
|
+
[key: string]: string;
|
|
2519
|
+
};
|
|
2520
|
+
/**
|
|
2521
|
+
* If provided, the override will only apply to the product with the specified ID.
|
|
2522
|
+
*/
|
|
2523
|
+
product_id?: string;
|
|
2524
|
+
/**
|
|
2525
|
+
* If provided, the override will only apply to products with all the specified
|
|
2526
|
+
* tags.
|
|
2527
|
+
*/
|
|
2528
|
+
product_tags?: Array<string>;
|
|
2529
|
+
/**
|
|
2530
|
+
* Can only be used for commit specific overrides. Must be used in conjunction with
|
|
2531
|
+
* one of `product_id`, `product_tags`, `pricing_group_values`, or
|
|
2532
|
+
* `presentation_group_values`. If provided, the override will only apply to
|
|
2533
|
+
* commits created by the specified recurring commit ids.
|
|
2534
|
+
*/
|
|
2535
|
+
recurring_commit_ids?: Array<string>;
|
|
2536
|
+
/**
|
|
2537
|
+
* Can only be used for commit specific overrides. Must be used in conjunction with
|
|
2538
|
+
* one of `product_id`, `product_tags`, `pricing_group_values`, or
|
|
2539
|
+
* `presentation_group_values`. If provided, the override will only apply to
|
|
2540
|
+
* credits created by the specified recurring credit ids.
|
|
2541
|
+
*/
|
|
2542
|
+
recurring_credit_ids?: Array<string>;
|
|
2543
|
+
}
|
|
2544
|
+
/**
|
|
2545
|
+
* Required for OVERWRITE type.
|
|
2546
|
+
*/
|
|
2547
|
+
interface OverwriteRate {
|
|
2548
|
+
rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
|
|
2549
|
+
credit_type_id?: string;
|
|
2550
|
+
/**
|
|
2551
|
+
* Only set for CUSTOM rate_type. This field is interpreted by custom rate
|
|
2552
|
+
* processors.
|
|
2553
|
+
*/
|
|
2554
|
+
custom_rate?: {
|
|
2555
|
+
[key: string]: unknown;
|
|
2556
|
+
};
|
|
2557
|
+
/**
|
|
2558
|
+
* Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
|
|
2559
|
+
* set to true.
|
|
2560
|
+
*/
|
|
2561
|
+
is_prorated?: boolean;
|
|
2562
|
+
/**
|
|
2563
|
+
* Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type,
|
|
2564
|
+
* this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1.
|
|
2565
|
+
*/
|
|
2566
|
+
price?: number;
|
|
2567
|
+
/**
|
|
2568
|
+
* Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
|
|
2569
|
+
*/
|
|
2570
|
+
quantity?: number;
|
|
2571
|
+
/**
|
|
2572
|
+
* Only set for TIERED rate_type.
|
|
2573
|
+
*/
|
|
2574
|
+
tiers?: Array<Shared.Tier>;
|
|
2575
|
+
}
|
|
2576
|
+
interface Tier {
|
|
2577
|
+
multiplier: number;
|
|
2578
|
+
size?: number;
|
|
2579
|
+
}
|
|
2580
|
+
}
|
|
2581
|
+
interface ProfessionalService {
|
|
2582
|
+
/**
|
|
2583
|
+
* Maximum amount for the term.
|
|
2584
|
+
*/
|
|
2585
|
+
max_amount: number;
|
|
2586
|
+
product_id: string;
|
|
2587
|
+
/**
|
|
2588
|
+
* Quantity for the charge. Will be multiplied by unit_price to determine the
|
|
2589
|
+
* amount.
|
|
2590
|
+
*/
|
|
2591
|
+
quantity: number;
|
|
2592
|
+
/**
|
|
2593
|
+
* Unit price for the charge. Will be multiplied by quantity to determine the
|
|
2594
|
+
* amount and must be specified.
|
|
2595
|
+
*/
|
|
2596
|
+
unit_price: number;
|
|
2597
|
+
/**
|
|
2598
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
2599
|
+
*/
|
|
2600
|
+
custom_fields?: {
|
|
2601
|
+
[key: string]: string;
|
|
2602
|
+
};
|
|
2603
|
+
description?: string;
|
|
2604
|
+
/**
|
|
2605
|
+
* This field's availability is dependent on your client's configuration.
|
|
2606
|
+
*/
|
|
2607
|
+
netsuite_sales_order_id?: string;
|
|
2608
|
+
}
|
|
2609
|
+
interface ResellerRoyalty {
|
|
2610
|
+
reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
|
|
2611
|
+
/**
|
|
2612
|
+
* Must provide at least one of applicable_product_ids or applicable_product_tags.
|
|
2613
|
+
*/
|
|
2614
|
+
applicable_product_ids?: Array<string>;
|
|
2615
|
+
/**
|
|
2616
|
+
* Must provide at least one of applicable_product_ids or applicable_product_tags.
|
|
2617
|
+
*/
|
|
2618
|
+
applicable_product_tags?: Array<string>;
|
|
2619
|
+
aws_options?: ResellerRoyalty.AwsOptions;
|
|
2620
|
+
/**
|
|
2621
|
+
* Use null to indicate that the existing end timestamp should be removed.
|
|
2622
|
+
*/
|
|
2623
|
+
ending_before?: string | null;
|
|
2624
|
+
fraction?: number;
|
|
2625
|
+
gcp_options?: ResellerRoyalty.GcpOptions;
|
|
2626
|
+
netsuite_reseller_id?: string;
|
|
2627
|
+
reseller_contract_value?: number;
|
|
2628
|
+
starting_at?: string;
|
|
2629
|
+
}
|
|
2630
|
+
namespace ResellerRoyalty {
|
|
2631
|
+
interface AwsOptions {
|
|
2632
|
+
aws_account_number?: string;
|
|
2633
|
+
aws_offer_id?: string;
|
|
2634
|
+
aws_payer_reference_id?: string;
|
|
2635
|
+
}
|
|
2636
|
+
interface GcpOptions {
|
|
2637
|
+
gcp_account_id?: string;
|
|
2638
|
+
gcp_offer_id?: string;
|
|
2639
|
+
}
|
|
2640
|
+
}
|
|
2641
|
+
interface ScheduledCharge {
|
|
2642
|
+
product_id: string;
|
|
2643
|
+
/**
|
|
2644
|
+
* Must provide either schedule_items or recurring_schedule.
|
|
2645
|
+
*/
|
|
2646
|
+
schedule: ScheduledCharge.Schedule;
|
|
2647
|
+
/**
|
|
2648
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
2649
|
+
*/
|
|
2650
|
+
custom_fields?: {
|
|
2651
|
+
[key: string]: string;
|
|
2652
|
+
};
|
|
2653
|
+
/**
|
|
2654
|
+
* displayed on invoices
|
|
2655
|
+
*/
|
|
2656
|
+
name?: string;
|
|
2657
|
+
/**
|
|
2658
|
+
* This field's availability is dependent on your client's configuration.
|
|
2659
|
+
*/
|
|
2660
|
+
netsuite_sales_order_id?: string;
|
|
2661
|
+
}
|
|
2662
|
+
namespace ScheduledCharge {
|
|
2663
|
+
/**
|
|
2664
|
+
* Must provide either schedule_items or recurring_schedule.
|
|
2665
|
+
*/
|
|
2666
|
+
interface Schedule {
|
|
2667
|
+
/**
|
|
2668
|
+
* Defaults to USD (cents) if not passed.
|
|
2669
|
+
*/
|
|
2670
|
+
credit_type_id?: string;
|
|
2671
|
+
/**
|
|
2672
|
+
* This field is only applicable to commit invoice schedules. If true, this
|
|
2673
|
+
* schedule will not generate an invoice.
|
|
2674
|
+
*/
|
|
2675
|
+
do_not_invoice?: boolean;
|
|
2676
|
+
/**
|
|
2677
|
+
* Enter the unit price and quantity for the charge or instead only send the
|
|
2678
|
+
* amount. If amount is sent, the unit price is assumed to be the amount and
|
|
2679
|
+
* quantity is inferred to be 1.
|
|
2680
|
+
*/
|
|
2681
|
+
recurring_schedule?: Schedule.RecurringSchedule;
|
|
2682
|
+
/**
|
|
2683
|
+
* Either provide amount or provide both unit_price and quantity.
|
|
2684
|
+
*/
|
|
2685
|
+
schedule_items?: Array<Schedule.ScheduleItem>;
|
|
2686
|
+
}
|
|
2687
|
+
namespace Schedule {
|
|
2688
|
+
/**
|
|
2689
|
+
* Enter the unit price and quantity for the charge or instead only send the
|
|
2690
|
+
* amount. If amount is sent, the unit price is assumed to be the amount and
|
|
2691
|
+
* quantity is inferred to be 1.
|
|
2692
|
+
*/
|
|
2693
|
+
interface RecurringSchedule {
|
|
2694
|
+
amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH';
|
|
2695
|
+
/**
|
|
2696
|
+
* RFC 3339 timestamp (exclusive).
|
|
2697
|
+
*/
|
|
2698
|
+
ending_before: string;
|
|
2699
|
+
frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL';
|
|
2700
|
+
/**
|
|
2701
|
+
* RFC 3339 timestamp (inclusive).
|
|
2702
|
+
*/
|
|
2703
|
+
starting_at: string;
|
|
2704
|
+
/**
|
|
2705
|
+
* Amount for the charge. Can be provided instead of unit_price and quantity. If
|
|
2706
|
+
* amount is sent, the unit_price is assumed to be the amount and quantity is
|
|
2707
|
+
* inferred to be 1.
|
|
2708
|
+
*/
|
|
2709
|
+
amount?: number;
|
|
2710
|
+
/**
|
|
2711
|
+
* Quantity for the charge. Will be multiplied by unit_price to determine the
|
|
2712
|
+
* amount and must be specified with unit_price. If specified amount cannot be
|
|
2713
|
+
* provided.
|
|
2714
|
+
*/
|
|
2715
|
+
quantity?: number;
|
|
2716
|
+
/**
|
|
2717
|
+
* Unit price for the charge. Will be multiplied by quantity to determine the
|
|
2718
|
+
* amount and must be specified with quantity. If specified amount cannot be
|
|
2719
|
+
* provided.
|
|
2720
|
+
*/
|
|
2721
|
+
unit_price?: number;
|
|
2722
|
+
}
|
|
2723
|
+
interface ScheduleItem {
|
|
2724
|
+
/**
|
|
2725
|
+
* timestamp of the scheduled event
|
|
2726
|
+
*/
|
|
2727
|
+
timestamp: string;
|
|
2728
|
+
/**
|
|
2729
|
+
* Amount for the charge. Can be provided instead of unit_price and quantity. If
|
|
2730
|
+
* amount is sent, the unit_price is assumed to be the amount and quantity is
|
|
2731
|
+
* inferred to be 1.
|
|
2732
|
+
*/
|
|
2733
|
+
amount?: number;
|
|
2734
|
+
/**
|
|
2735
|
+
* Quantity for the charge. Will be multiplied by unit_price to determine the
|
|
2736
|
+
* amount and must be specified with unit_price. If specified amount cannot be
|
|
2737
|
+
* provided.
|
|
2738
|
+
*/
|
|
2739
|
+
quantity?: number;
|
|
2740
|
+
/**
|
|
2741
|
+
* Unit price for the charge. Will be multiplied by quantity to determine the
|
|
2742
|
+
* amount and must be specified with quantity. If specified amount cannot be
|
|
2743
|
+
* provided.
|
|
2744
|
+
*/
|
|
2745
|
+
unit_price?: number;
|
|
2746
|
+
}
|
|
2747
|
+
}
|
|
2748
|
+
}
|
|
2749
|
+
}
|
|
2750
|
+
export interface ContractArchiveParams {
|
|
2751
|
+
/**
|
|
2752
|
+
* ID of the contract to archive
|
|
2753
|
+
*/
|
|
2754
|
+
contract_id: string;
|
|
2755
|
+
/**
|
|
2756
|
+
* ID of the customer whose contract is to be archived
|
|
2757
|
+
*/
|
|
2758
|
+
customer_id: string;
|
|
2759
|
+
/**
|
|
2760
|
+
* If false, the existing finalized invoices will remain after the contract is
|
|
2761
|
+
* archived.
|
|
2762
|
+
*/
|
|
2763
|
+
void_invoices: boolean;
|
|
2764
|
+
}
|
|
2765
|
+
export interface ContractCreateHistoricalInvoicesParams {
|
|
2766
|
+
invoices: Array<ContractCreateHistoricalInvoicesParams.Invoice>;
|
|
2767
|
+
preview: boolean;
|
|
2768
|
+
}
|
|
2769
|
+
export declare namespace ContractCreateHistoricalInvoicesParams {
|
|
2770
|
+
interface Invoice {
|
|
2771
|
+
contract_id: string;
|
|
2772
|
+
credit_type_id: string;
|
|
2773
|
+
customer_id: string;
|
|
2774
|
+
exclusive_end_date: string;
|
|
2775
|
+
inclusive_start_date: string;
|
|
2776
|
+
issue_date: string;
|
|
2777
|
+
usage_line_items: Array<Invoice.UsageLineItem>;
|
|
2778
|
+
/**
|
|
2779
|
+
* This field's availability is dependent on your client's configuration.
|
|
2780
|
+
*/
|
|
2781
|
+
billable_status?: 'billable' | 'unbillable';
|
|
2782
|
+
breakdown_granularity?: 'HOUR' | 'DAY';
|
|
2783
|
+
/**
|
|
2784
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
2785
|
+
*/
|
|
2786
|
+
custom_fields?: {
|
|
2787
|
+
[key: string]: string;
|
|
2788
|
+
};
|
|
2789
|
+
}
|
|
2790
|
+
namespace Invoice {
|
|
2791
|
+
interface UsageLineItem {
|
|
2792
|
+
exclusive_end_date: string;
|
|
2793
|
+
inclusive_start_date: string;
|
|
2794
|
+
product_id: string;
|
|
2795
|
+
presentation_group_values?: {
|
|
2796
|
+
[key: string]: string;
|
|
2797
|
+
};
|
|
2798
|
+
pricing_group_values?: {
|
|
2799
|
+
[key: string]: string;
|
|
2800
|
+
};
|
|
2801
|
+
quantity?: number;
|
|
2802
|
+
subtotals_with_quantity?: Array<UsageLineItem.SubtotalsWithQuantity>;
|
|
2803
|
+
}
|
|
2804
|
+
namespace UsageLineItem {
|
|
2805
|
+
interface SubtotalsWithQuantity {
|
|
2806
|
+
exclusive_end_date: string;
|
|
2807
|
+
inclusive_start_date: string;
|
|
2808
|
+
quantity: number;
|
|
2809
|
+
}
|
|
2810
|
+
}
|
|
2811
|
+
}
|
|
2812
|
+
}
|
|
2813
|
+
export interface ContractListBalancesParams extends BodyCursorPageParams {
|
|
2814
|
+
customer_id: string;
|
|
2815
|
+
id?: string;
|
|
2816
|
+
/**
|
|
2817
|
+
* Return only balances that have access schedules that "cover" the provided date
|
|
2818
|
+
*/
|
|
2819
|
+
covering_date?: string;
|
|
2820
|
+
/**
|
|
2821
|
+
* Include only balances that have any access before the provided date (exclusive)
|
|
2822
|
+
*/
|
|
2823
|
+
effective_before?: string;
|
|
2824
|
+
/**
|
|
2825
|
+
* Include archived credits and credits from archived contracts.
|
|
2826
|
+
*/
|
|
2827
|
+
include_archived?: boolean;
|
|
2828
|
+
/**
|
|
2829
|
+
* Include the balance of credits and commits in the response. Setting this flag
|
|
2830
|
+
* may cause the query to be slower.
|
|
2831
|
+
*/
|
|
2832
|
+
include_balance?: boolean;
|
|
2833
|
+
/**
|
|
2834
|
+
* Include balances on the contract level.
|
|
2835
|
+
*/
|
|
2836
|
+
include_contract_balances?: boolean;
|
|
2837
|
+
/**
|
|
2838
|
+
* Include ledgers in the response. Setting this flag may cause the query to be
|
|
2839
|
+
* slower.
|
|
2840
|
+
*/
|
|
2841
|
+
include_ledgers?: boolean;
|
|
2842
|
+
/**
|
|
2843
|
+
* Include only balances that have any access on or after the provided date
|
|
2844
|
+
*/
|
|
2845
|
+
starting_at?: string;
|
|
2846
|
+
}
|
|
2847
|
+
export interface ContractRetrieveRateScheduleParams {
|
|
2848
|
+
/**
|
|
2849
|
+
* Body param: ID of the contract to get the rate schedule for.
|
|
2850
|
+
*/
|
|
2851
|
+
contract_id: string;
|
|
2852
|
+
/**
|
|
2853
|
+
* Body param: ID of the customer for whose contract to get the rate schedule for.
|
|
2854
|
+
*/
|
|
2855
|
+
customer_id: string;
|
|
2856
|
+
/**
|
|
2857
|
+
* Query param: Max number of results that should be returned
|
|
2858
|
+
*/
|
|
2859
|
+
limit?: number;
|
|
2860
|
+
/**
|
|
2861
|
+
* Query param: Cursor that indicates where the next page of results should start.
|
|
2862
|
+
*/
|
|
2863
|
+
next_page?: string;
|
|
2864
|
+
/**
|
|
2865
|
+
* Body param: optional timestamp which overlaps with the returned rate schedule
|
|
2866
|
+
* segments. When not specified, the current timestamp will be used.
|
|
2867
|
+
*/
|
|
2868
|
+
at?: string;
|
|
2869
|
+
/**
|
|
2870
|
+
* Body param: List of rate selectors, rates matching ANY of the selectors will be
|
|
2871
|
+
* included in the response. Passing no selectors will result in all rates being
|
|
2872
|
+
* returned.
|
|
2873
|
+
*/
|
|
2874
|
+
selectors?: Array<ContractRetrieveRateScheduleParams.Selector>;
|
|
2875
|
+
}
|
|
2876
|
+
export declare namespace ContractRetrieveRateScheduleParams {
|
|
2877
|
+
interface Selector {
|
|
2878
|
+
/**
|
|
2879
|
+
* Subscription rates matching the billing frequency will be included in the
|
|
2880
|
+
* response.
|
|
2881
|
+
*/
|
|
2882
|
+
billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
2883
|
+
/**
|
|
2884
|
+
* List of pricing group key value pairs, rates containing the matching key / value
|
|
2885
|
+
* pairs will be included in the response.
|
|
2886
|
+
*/
|
|
2887
|
+
partial_pricing_group_values?: {
|
|
2888
|
+
[key: string]: string;
|
|
2889
|
+
};
|
|
2890
|
+
/**
|
|
2891
|
+
* List of pricing group key value pairs, rates matching all of the key / value
|
|
2892
|
+
* pairs will be included in the response.
|
|
2893
|
+
*/
|
|
2894
|
+
pricing_group_values?: {
|
|
2895
|
+
[key: string]: string;
|
|
2896
|
+
};
|
|
2897
|
+
/**
|
|
2898
|
+
* Rates matching the product id will be included in the response.
|
|
2899
|
+
*/
|
|
2900
|
+
product_id?: string;
|
|
2901
|
+
/**
|
|
2902
|
+
* List of product tags, rates matching any of the tags will be included in the
|
|
2903
|
+
* response.
|
|
2904
|
+
*/
|
|
2905
|
+
product_tags?: Array<string>;
|
|
2906
|
+
}
|
|
2907
|
+
}
|
|
2908
|
+
export interface ContractRetrieveSubscriptionQuantityHistoryParams {
|
|
2909
|
+
contract_id: string;
|
|
2910
|
+
customer_id: string;
|
|
2911
|
+
subscription_id: string;
|
|
2912
|
+
}
|
|
2913
|
+
export interface ContractScheduleProServicesInvoiceParams {
|
|
2914
|
+
contract_id: string;
|
|
2915
|
+
customer_id: string;
|
|
2916
|
+
/**
|
|
2917
|
+
* The date the invoice is issued
|
|
2918
|
+
*/
|
|
2919
|
+
issued_at: string;
|
|
2920
|
+
/**
|
|
2921
|
+
* Each line requires an amount or both unit_price and quantity.
|
|
2922
|
+
*/
|
|
2923
|
+
line_items: Array<ContractScheduleProServicesInvoiceParams.LineItem>;
|
|
2924
|
+
/**
|
|
2925
|
+
* The end date of the invoice header in Netsuite
|
|
2926
|
+
*/
|
|
2927
|
+
netsuite_invoice_header_end?: string;
|
|
2928
|
+
/**
|
|
2929
|
+
* The start date of the invoice header in Netsuite
|
|
2930
|
+
*/
|
|
2931
|
+
netsuite_invoice_header_start?: string;
|
|
2932
|
+
}
|
|
2933
|
+
export declare namespace ContractScheduleProServicesInvoiceParams {
|
|
2934
|
+
/**
|
|
2935
|
+
* Describes the line item for a professional service charge on an invoice.
|
|
2936
|
+
*/
|
|
2937
|
+
interface LineItem {
|
|
2938
|
+
professional_service_id: string;
|
|
2939
|
+
/**
|
|
2940
|
+
* If the professional_service_id was added on an amendment, this is required.
|
|
2941
|
+
*/
|
|
2942
|
+
amendment_id?: string;
|
|
2943
|
+
/**
|
|
2944
|
+
* Amount for the term on the new invoice.
|
|
2945
|
+
*/
|
|
2946
|
+
amount?: number;
|
|
2947
|
+
/**
|
|
2948
|
+
* For client use.
|
|
2949
|
+
*/
|
|
2950
|
+
metadata?: string;
|
|
2951
|
+
/**
|
|
2952
|
+
* The end date for the billing period on the invoice.
|
|
2953
|
+
*/
|
|
2954
|
+
netsuite_invoice_billing_end?: string;
|
|
2955
|
+
/**
|
|
2956
|
+
* The start date for the billing period on the invoice.
|
|
2957
|
+
*/
|
|
2958
|
+
netsuite_invoice_billing_start?: string;
|
|
2959
|
+
/**
|
|
2960
|
+
* Quantity for the charge. Will be multiplied by unit_price to determine the
|
|
2961
|
+
* amount.
|
|
2962
|
+
*/
|
|
2963
|
+
quantity?: number;
|
|
2964
|
+
/**
|
|
2965
|
+
* If specified, this overrides the unit price on the pro service term. Must also
|
|
2966
|
+
* provide quantity (but not amount) if providing unit_price.
|
|
2967
|
+
*/
|
|
2968
|
+
unit_price?: number;
|
|
2969
|
+
}
|
|
2970
|
+
}
|
|
2971
|
+
export interface ContractSetUsageFilterParams {
|
|
2972
|
+
contract_id: string;
|
|
2973
|
+
customer_id: string;
|
|
2974
|
+
group_key: string;
|
|
2975
|
+
group_values: Array<string>;
|
|
2976
|
+
starting_at: string;
|
|
2977
|
+
}
|
|
2978
|
+
export interface ContractUpdateEndDateParams {
|
|
2979
|
+
/**
|
|
2980
|
+
* ID of the contract to update
|
|
2981
|
+
*/
|
|
2982
|
+
contract_id: string;
|
|
2983
|
+
/**
|
|
2984
|
+
* ID of the customer whose contract is to be updated
|
|
2985
|
+
*/
|
|
2986
|
+
customer_id: string;
|
|
2987
|
+
/**
|
|
2988
|
+
* If true, allows setting the contract end date earlier than the end_timestamp of
|
|
2989
|
+
* existing finalized invoices. Finalized invoices will be unchanged; if you want
|
|
2990
|
+
* to incorporate the new end date, you can void and regenerate finalized usage
|
|
2991
|
+
* invoices. Defaults to true.
|
|
2992
|
+
*/
|
|
2993
|
+
allow_ending_before_finalized_invoice?: boolean;
|
|
2994
|
+
/**
|
|
2995
|
+
* RFC 3339 timestamp indicating when the contract will end (exclusive). If not
|
|
2996
|
+
* provided, the contract will be updated to be open-ended.
|
|
2997
|
+
*/
|
|
2998
|
+
ending_before?: string;
|
|
2999
|
+
}
|
|
3000
|
+
export declare namespace Contracts {
|
|
3001
|
+
export { type ContractCreateResponse as ContractCreateResponse, type ContractRetrieveResponse as ContractRetrieveResponse, type ContractListResponse as ContractListResponse, type ContractAmendResponse as ContractAmendResponse, type ContractArchiveResponse as ContractArchiveResponse, type ContractCreateHistoricalInvoicesResponse as ContractCreateHistoricalInvoicesResponse, type ContractListBalancesResponse as ContractListBalancesResponse, type ContractRetrieveRateScheduleResponse as ContractRetrieveRateScheduleResponse, type ContractRetrieveSubscriptionQuantityHistoryResponse as ContractRetrieveSubscriptionQuantityHistoryResponse, type ContractScheduleProServicesInvoiceResponse as ContractScheduleProServicesInvoiceResponse, type ContractUpdateEndDateResponse as ContractUpdateEndDateResponse, type ContractListBalancesResponsesBodyCursorPage as ContractListBalancesResponsesBodyCursorPage, type ContractCreateParams as ContractCreateParams, type ContractRetrieveParams as ContractRetrieveParams, type ContractListParams as ContractListParams, type ContractAddManualBalanceEntryParams as ContractAddManualBalanceEntryParams, type ContractAmendParams as ContractAmendParams, type ContractArchiveParams as ContractArchiveParams, type ContractCreateHistoricalInvoicesParams as ContractCreateHistoricalInvoicesParams, type ContractListBalancesParams as ContractListBalancesParams, type ContractRetrieveRateScheduleParams as ContractRetrieveRateScheduleParams, type ContractRetrieveSubscriptionQuantityHistoryParams as ContractRetrieveSubscriptionQuantityHistoryParams, type ContractScheduleProServicesInvoiceParams as ContractScheduleProServicesInvoiceParams, type ContractSetUsageFilterParams as ContractSetUsageFilterParams, type ContractUpdateEndDateParams as ContractUpdateEndDateParams, };
|
|
3002
|
+
export { Products as Products, type ProductListItemState as ProductListItemState, type QuantityConversion as QuantityConversion, type QuantityRounding as QuantityRounding, type ProductCreateResponse as ProductCreateResponse, type ProductRetrieveResponse as ProductRetrieveResponse, type ProductUpdateResponse as ProductUpdateResponse, type ProductListResponse as ProductListResponse, type ProductArchiveResponse as ProductArchiveResponse, type ProductListResponsesCursorPage as ProductListResponsesCursorPage, type ProductCreateParams as ProductCreateParams, type ProductRetrieveParams as ProductRetrieveParams, type ProductUpdateParams as ProductUpdateParams, type ProductListParams as ProductListParams, type ProductArchiveParams as ProductArchiveParams, };
|
|
3003
|
+
export { RateCards as RateCards, type RateCardCreateResponse as RateCardCreateResponse, type RateCardRetrieveResponse as RateCardRetrieveResponse, type RateCardUpdateResponse as RateCardUpdateResponse, type RateCardListResponse as RateCardListResponse, type RateCardArchiveResponse as RateCardArchiveResponse, type RateCardRetrieveRateScheduleResponse as RateCardRetrieveRateScheduleResponse, type RateCardListResponsesCursorPage as RateCardListResponsesCursorPage, type RateCardCreateParams as RateCardCreateParams, type RateCardRetrieveParams as RateCardRetrieveParams, type RateCardUpdateParams as RateCardUpdateParams, type RateCardListParams as RateCardListParams, type RateCardArchiveParams as RateCardArchiveParams, type RateCardRetrieveRateScheduleParams as RateCardRetrieveRateScheduleParams, };
|
|
3004
|
+
export { NamedSchedules as NamedSchedules, type NamedScheduleRetrieveResponse as NamedScheduleRetrieveResponse, type NamedScheduleRetrieveParams as NamedScheduleRetrieveParams, type NamedScheduleUpdateParams as NamedScheduleUpdateParams, };
|
|
3005
|
+
}
|
|
3006
|
+
//# sourceMappingURL=contracts.d.mts.map
|