@metronome/sdk 0.3.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +113 -28
- package/README.md +123 -51
- package/api-promise.d.mts +2 -0
- package/api-promise.d.mts.map +1 -0
- package/api-promise.d.ts +2 -0
- package/api-promise.d.ts.map +1 -0
- package/api-promise.js +6 -0
- package/api-promise.js.map +1 -0
- package/api-promise.mjs +2 -0
- package/api-promise.mjs.map +1 -0
- package/bin/cli +46 -0
- package/bin/migration-config.json +6 -0
- package/client.d.mts +232 -0
- package/client.d.mts.map +1 -0
- package/client.d.ts +232 -0
- package/client.d.ts.map +1 -0
- package/client.js +464 -0
- package/client.js.map +1 -0
- package/client.mjs +460 -0
- package/client.mjs.map +1 -0
- package/core/api-promise.d.mts +46 -0
- package/core/api-promise.d.mts.map +1 -0
- package/core/api-promise.d.ts +46 -0
- package/core/api-promise.d.ts.map +1 -0
- package/core/api-promise.js +74 -0
- package/core/api-promise.js.map +1 -0
- package/core/api-promise.mjs +70 -0
- package/core/api-promise.mjs.map +1 -0
- package/core/error.d.mts +46 -0
- package/core/error.d.mts.map +1 -0
- package/core/error.d.ts +46 -0
- package/core/error.d.ts.map +1 -0
- package/core/error.js +113 -0
- package/core/error.js.map +1 -0
- package/core/error.mjs +97 -0
- package/core/error.mjs.map +1 -0
- package/core/pagination.d.mts +137 -0
- package/core/pagination.d.mts.map +1 -0
- package/core/pagination.d.ts +137 -0
- package/core/pagination.d.ts.map +1 -0
- package/core/pagination.js +158 -0
- package/core/pagination.js.map +1 -0
- package/core/pagination.mjs +150 -0
- package/core/pagination.mjs.map +1 -0
- package/core/resource.d.mts +6 -0
- package/core/resource.d.mts.map +1 -0
- package/core/resource.d.ts +6 -0
- package/core/resource.d.ts.map +1 -0
- package/core/resource.js +11 -0
- package/core/resource.js.map +1 -0
- package/core/resource.mjs +7 -0
- package/core/resource.mjs.map +1 -0
- package/core/uploads.d.mts +3 -0
- package/core/uploads.d.mts.map +1 -0
- package/core/uploads.d.ts +3 -0
- package/core/uploads.d.ts.map +1 -0
- package/core/uploads.js +6 -0
- package/core/uploads.js.map +1 -0
- package/core/uploads.mjs +2 -0
- package/core/uploads.mjs.map +1 -0
- package/error.d.mts +2 -0
- package/error.d.mts.map +1 -0
- package/error.d.ts +1 -46
- package/error.d.ts.map +1 -1
- package/error.js +3 -110
- package/error.js.map +1 -1
- package/error.mjs +1 -96
- package/error.mjs.map +1 -1
- package/index.d.mts +7 -144
- package/index.d.mts.map +1 -0
- package/index.d.ts +6 -143
- package/index.d.ts.map +1 -1
- package/index.js +14 -120
- package/index.js.map +1 -1
- package/index.mjs +6 -93
- package/index.mjs.map +1 -1
- package/internal/builtin-types.d.mts +73 -0
- package/internal/builtin-types.d.mts.map +1 -0
- package/internal/builtin-types.d.ts +73 -0
- package/internal/builtin-types.d.ts.map +1 -0
- package/internal/builtin-types.js +4 -0
- package/internal/builtin-types.js.map +1 -0
- package/internal/builtin-types.mjs +3 -0
- package/internal/builtin-types.mjs.map +1 -0
- package/internal/detect-platform.d.mts +15 -0
- package/internal/detect-platform.d.mts.map +1 -0
- package/internal/detect-platform.d.ts +15 -0
- package/internal/detect-platform.d.ts.map +1 -0
- package/internal/detect-platform.js +162 -0
- package/internal/detect-platform.js.map +1 -0
- package/internal/detect-platform.mjs +157 -0
- package/internal/detect-platform.mjs.map +1 -0
- package/internal/errors.d.mts +3 -0
- package/internal/errors.d.mts.map +1 -0
- package/internal/errors.d.ts +3 -0
- package/internal/errors.d.ts.map +1 -0
- package/internal/errors.js +41 -0
- package/internal/errors.js.map +1 -0
- package/internal/errors.mjs +36 -0
- package/internal/errors.mjs.map +1 -0
- package/internal/headers.d.mts +26 -0
- package/internal/headers.d.mts.map +1 -0
- package/internal/headers.d.ts +26 -0
- package/internal/headers.d.ts.map +1 -0
- package/internal/headers.js +120 -0
- package/internal/headers.js.map +1 -0
- package/internal/headers.mjs +112 -0
- package/internal/headers.mjs.map +1 -0
- package/internal/parse.d.mts +12 -0
- package/internal/parse.d.mts.map +1 -0
- package/internal/parse.d.ts +12 -0
- package/internal/parse.d.ts.map +1 -0
- package/internal/parse.js +35 -0
- package/internal/parse.js.map +1 -0
- package/internal/parse.mjs +32 -0
- package/internal/parse.mjs.map +1 -0
- package/internal/qs/formats.d.mts +7 -0
- package/internal/qs/formats.d.mts.map +1 -0
- package/internal/qs/formats.d.ts +1 -0
- package/internal/qs/formats.d.ts.map +1 -1
- package/internal/qs/formats.js +4 -2
- package/internal/qs/formats.js.map +1 -1
- package/internal/qs/formats.mjs +2 -1
- package/internal/qs/formats.mjs.map +1 -1
- package/internal/qs/index.d.mts +10 -0
- package/internal/qs/index.d.mts.map +1 -0
- package/internal/qs/index.d.ts.map +1 -1
- package/internal/qs/stringify.d.mts +3 -0
- package/internal/qs/stringify.d.mts.map +1 -0
- package/internal/qs/stringify.d.ts.map +1 -1
- package/internal/qs/stringify.js +16 -19
- package/internal/qs/stringify.js.map +1 -1
- package/internal/qs/stringify.mjs +17 -19
- package/internal/qs/stringify.mjs.map +1 -1
- package/internal/qs/types.d.mts +57 -0
- package/internal/qs/types.d.mts.map +1 -0
- package/internal/qs/utils.d.mts +15 -0
- package/internal/qs/utils.d.mts.map +1 -0
- package/internal/qs/utils.d.ts +1 -0
- package/internal/qs/utils.d.ts.map +1 -1
- package/internal/qs/utils.js +22 -21
- package/internal/qs/utils.js.map +1 -1
- package/internal/qs/utils.mjs +12 -12
- package/internal/qs/utils.mjs.map +1 -1
- package/internal/request-options.d.mts +75 -0
- package/internal/request-options.d.mts.map +1 -0
- package/internal/request-options.d.ts +75 -0
- package/internal/request-options.d.ts.map +1 -0
- package/internal/request-options.js +14 -0
- package/internal/request-options.js.map +1 -0
- package/internal/request-options.mjs +10 -0
- package/internal/request-options.mjs.map +1 -0
- package/internal/shim-types.d.mts +17 -0
- package/internal/shim-types.d.mts.map +1 -0
- package/internal/shim-types.d.ts +17 -0
- package/internal/shim-types.d.ts.map +1 -0
- package/internal/shim-types.js +4 -0
- package/internal/shim-types.js.map +1 -0
- package/internal/shim-types.mjs +3 -0
- package/internal/shim-types.mjs.map +1 -0
- package/internal/shims.d.mts +20 -0
- package/internal/shims.d.mts.map +1 -0
- package/internal/shims.d.ts +20 -0
- package/internal/shims.d.ts.map +1 -0
- package/internal/shims.js +92 -0
- package/internal/shims.js.map +1 -0
- package/internal/shims.mjs +85 -0
- package/internal/shims.mjs.map +1 -0
- package/internal/to-file.d.mts +45 -0
- package/internal/to-file.d.mts.map +1 -0
- package/internal/to-file.d.ts +45 -0
- package/internal/to-file.d.ts.map +1 -0
- package/internal/to-file.js +91 -0
- package/internal/to-file.js.map +1 -0
- package/internal/to-file.mjs +88 -0
- package/internal/to-file.mjs.map +1 -0
- package/internal/tslib.js +81 -0
- package/internal/tslib.mjs +17 -0
- package/internal/types.d.mts +69 -0
- package/internal/types.d.mts.map +1 -0
- package/internal/types.d.ts +69 -0
- package/internal/types.d.ts.map +1 -0
- package/internal/types.js +4 -0
- package/internal/types.js.map +1 -0
- package/internal/types.mjs +3 -0
- package/internal/types.mjs.map +1 -0
- package/internal/uploads.d.mts +42 -0
- package/internal/uploads.d.mts.map +1 -0
- package/internal/uploads.d.ts +42 -0
- package/internal/uploads.d.ts.map +1 -0
- package/internal/uploads.js +141 -0
- package/internal/uploads.js.map +1 -0
- package/internal/uploads.mjs +131 -0
- package/internal/uploads.mjs.map +1 -0
- package/internal/utils/base64.d.mts +3 -0
- package/internal/utils/base64.d.mts.map +1 -0
- package/internal/utils/base64.d.ts +3 -0
- package/internal/utils/base64.d.ts.map +1 -0
- package/internal/utils/base64.js +38 -0
- package/internal/utils/base64.js.map +1 -0
- package/internal/utils/base64.mjs +33 -0
- package/internal/utils/base64.mjs.map +1 -0
- package/internal/utils/bytes.d.mts +4 -0
- package/internal/utils/bytes.d.mts.map +1 -0
- package/internal/utils/bytes.d.ts +4 -0
- package/internal/utils/bytes.d.ts.map +1 -0
- package/internal/utils/bytes.js +31 -0
- package/internal/utils/bytes.js.map +1 -0
- package/internal/utils/bytes.mjs +26 -0
- package/internal/utils/bytes.mjs.map +1 -0
- package/internal/utils/env.d.mts +9 -0
- package/internal/utils/env.d.mts.map +1 -0
- package/internal/utils/env.d.ts +9 -0
- package/internal/utils/env.d.ts.map +1 -0
- package/internal/utils/env.js +22 -0
- package/internal/utils/env.js.map +1 -0
- package/internal/utils/env.mjs +18 -0
- package/internal/utils/env.mjs.map +1 -0
- package/internal/utils/log.d.mts +37 -0
- package/internal/utils/log.d.mts.map +1 -0
- package/internal/utils/log.d.ts +37 -0
- package/internal/utils/log.d.ts.map +1 -0
- package/internal/utils/log.js +85 -0
- package/internal/utils/log.js.map +1 -0
- package/internal/utils/log.mjs +79 -0
- package/internal/utils/log.mjs.map +1 -0
- package/internal/utils/path.d.mts +15 -0
- package/internal/utils/path.d.mts.map +1 -0
- package/internal/utils/path.d.ts +15 -0
- package/internal/utils/path.d.ts.map +1 -0
- package/internal/utils/path.js +79 -0
- package/internal/utils/path.js.map +1 -0
- package/internal/utils/path.mjs +74 -0
- package/internal/utils/path.mjs.map +1 -0
- package/internal/utils/sleep.d.mts +2 -0
- package/internal/utils/sleep.d.mts.map +1 -0
- package/internal/utils/sleep.d.ts +2 -0
- package/internal/utils/sleep.d.ts.map +1 -0
- package/internal/utils/sleep.js +7 -0
- package/internal/utils/sleep.js.map +1 -0
- package/internal/utils/sleep.mjs +3 -0
- package/internal/utils/sleep.mjs.map +1 -0
- package/internal/utils/uuid.d.mts +5 -0
- package/internal/utils/uuid.d.mts.map +1 -0
- package/internal/utils/uuid.d.ts +5 -0
- package/internal/utils/uuid.d.ts.map +1 -0
- package/internal/utils/uuid.js +19 -0
- package/internal/utils/uuid.js.map +1 -0
- package/internal/utils/uuid.mjs +15 -0
- package/internal/utils/uuid.mjs.map +1 -0
- package/internal/utils/values.d.mts +18 -0
- package/internal/utils/values.d.mts.map +1 -0
- package/internal/utils/values.d.ts +18 -0
- package/internal/utils/values.d.ts.map +1 -0
- package/internal/utils/values.js +112 -0
- package/internal/utils/values.js.map +1 -0
- package/internal/utils/values.mjs +94 -0
- package/internal/utils/values.mjs.map +1 -0
- package/internal/utils.d.mts +7 -0
- package/internal/utils.d.mts.map +1 -0
- package/internal/utils.d.ts +7 -0
- package/internal/utils.d.ts.map +1 -0
- package/internal/utils.js +11 -0
- package/internal/utils.js.map +1 -0
- package/internal/utils.mjs +8 -0
- package/internal/utils.mjs.map +1 -0
- package/package.json +113 -64
- package/pagination.d.mts +2 -0
- package/pagination.d.mts.map +1 -0
- package/pagination.d.ts +1 -36
- package/pagination.d.ts.map +1 -1
- package/pagination.js +3 -40
- package/pagination.js.map +1 -1
- package/pagination.mjs +1 -38
- package/pagination.mjs.map +1 -1
- package/resource.d.mts +2 -0
- package/resource.d.mts.map +1 -0
- package/resource.d.ts +1 -5
- package/resource.d.ts.map +1 -1
- package/resource.js +3 -8
- package/resource.js.map +1 -1
- package/resource.mjs +1 -6
- package/resource.mjs.map +1 -1
- package/resources/index.d.mts +5 -0
- package/resources/index.d.mts.map +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +2 -15
- package/resources/index.js.map +1 -1
- package/resources/shared.d.mts +2363 -0
- package/resources/shared.d.mts.map +1 -0
- package/resources/shared.d.ts +1470 -465
- package/resources/shared.d.ts.map +1 -1
- package/resources/v1/alerts.d.mts +207 -0
- package/resources/v1/alerts.d.mts.map +1 -0
- package/resources/v1/alerts.d.ts +107 -32
- package/resources/v1/alerts.d.ts.map +1 -1
- package/resources/v1/alerts.js +74 -3
- package/resources/v1/alerts.js.map +1 -1
- package/resources/v1/alerts.mjs +74 -3
- package/resources/v1/alerts.mjs.map +1 -1
- package/resources/v1/audit-logs.d.mts +108 -0
- package/resources/v1/audit-logs.d.mts.map +1 -0
- package/resources/v1/audit-logs.d.ts +45 -12
- package/resources/v1/audit-logs.d.ts.map +1 -1
- package/resources/v1/audit-logs.js +53 -12
- package/resources/v1/audit-logs.js.map +1 -1
- package/resources/v1/audit-logs.mjs +52 -10
- package/resources/v1/audit-logs.mjs.map +1 -1
- package/resources/v1/billable-metrics.d.mts +293 -0
- package/resources/v1/billable-metrics.d.mts.map +1 -0
- package/resources/v1/billable-metrics.d.ts +70 -15
- package/resources/v1/billable-metrics.d.ts.map +1 -1
- package/resources/v1/billable-metrics.js +70 -16
- package/resources/v1/billable-metrics.js.map +1 -1
- package/resources/v1/billable-metrics.mjs +69 -14
- package/resources/v1/billable-metrics.mjs.map +1 -1
- package/resources/v1/contracts/contracts.d.mts +3006 -0
- package/resources/v1/contracts/contracts.d.mts.map +1 -0
- package/resources/v1/contracts/contracts.d.ts +428 -1299
- package/resources/v1/contracts/contracts.d.ts.map +1 -1
- package/resources/v1/contracts/contracts.js +269 -50
- package/resources/v1/contracts/contracts.js.map +1 -1
- package/resources/v1/contracts/contracts.mjs +267 -26
- package/resources/v1/contracts/contracts.mjs.map +1 -1
- package/resources/v1/contracts/index.d.mts +5 -0
- package/resources/v1/contracts/index.d.mts.map +1 -0
- package/resources/v1/contracts/index.d.ts +3 -3
- package/resources/v1/contracts/index.d.ts.map +1 -1
- package/resources/v1/contracts/index.js +1 -3
- package/resources/v1/contracts/index.js.map +1 -1
- package/resources/v1/contracts/index.mjs +2 -2
- package/resources/v1/contracts/index.mjs.map +1 -1
- package/resources/v1/contracts/named-schedules.d.mts +82 -0
- package/resources/v1/contracts/named-schedules.d.mts.map +1 -0
- package/resources/v1/contracts/named-schedules.d.ts +5 -4
- package/resources/v1/contracts/named-schedules.d.ts.map +1 -1
- package/resources/v1/contracts/named-schedules.js +3 -2
- package/resources/v1/contracts/named-schedules.js.map +1 -1
- package/resources/v1/contracts/named-schedules.mjs +3 -2
- package/resources/v1/contracts/named-schedules.mjs.map +1 -1
- package/resources/v1/contracts/products.d.mts +502 -0
- package/resources/v1/contracts/products.d.mts.map +1 -0
- package/resources/v1/contracts/products.d.ts +44 -17
- package/resources/v1/contracts/products.d.ts.map +1 -1
- package/resources/v1/contracts/products.js +41 -17
- package/resources/v1/contracts/products.js.map +1 -1
- package/resources/v1/contracts/products.mjs +40 -15
- package/resources/v1/contracts/products.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/index.d.mts +5 -0
- package/resources/v1/contracts/rate-cards/index.d.mts.map +1 -0
- package/resources/v1/contracts/rate-cards/index.d.ts +2 -2
- package/resources/v1/contracts/rate-cards/index.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/index.js +1 -3
- package/resources/v1/contracts/rate-cards/index.js.map +1 -1
- package/resources/v1/contracts/rate-cards/index.mjs +2 -2
- package/resources/v1/contracts/rate-cards/index.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.d.mts +94 -0
- package/resources/v1/contracts/rate-cards/named-schedules.d.mts.map +1 -0
- package/resources/v1/contracts/rate-cards/named-schedules.d.ts +5 -4
- package/resources/v1/contracts/rate-cards/named-schedules.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.js +3 -2
- package/resources/v1/contracts/rate-cards/named-schedules.js.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.mjs +3 -2
- package/resources/v1/contracts/rate-cards/named-schedules.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.d.mts +85 -0
- package/resources/v1/contracts/rate-cards/product-orders.d.mts.map +1 -0
- package/resources/v1/contracts/rate-cards/product-orders.d.ts +12 -6
- package/resources/v1/contracts/rate-cards/product-orders.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.js +8 -3
- package/resources/v1/contracts/rate-cards/product-orders.js.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.mjs +8 -3
- package/resources/v1/contracts/rate-cards/product-orders.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.d.mts +452 -0
- package/resources/v1/contracts/rate-cards/rate-cards.d.mts.map +1 -0
- package/resources/v1/contracts/rate-cards/rate-cards.d.ts +134 -41
- package/resources/v1/contracts/rate-cards/rate-cards.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.js +127 -47
- package/resources/v1/contracts/rate-cards/rate-cards.js.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.mjs +123 -20
- package/resources/v1/contracts/rate-cards/rate-cards.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.d.mts +382 -0
- package/resources/v1/contracts/rate-cards/rates.d.mts.map +1 -0
- package/resources/v1/contracts/rate-cards/rates.d.ts +25 -82
- package/resources/v1/contracts/rate-cards/rates.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.js +13 -9
- package/resources/v1/contracts/rate-cards/rates.js.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.mjs +12 -7
- package/resources/v1/contracts/rate-cards/rates.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards.d.mts +2 -0
- package/resources/v1/contracts/rate-cards.d.mts.map +1 -0
- package/resources/v1/contracts/rate-cards.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards.js +2 -15
- package/resources/v1/contracts/rate-cards.js.map +1 -1
- package/resources/v1/contracts.d.mts +2 -0
- package/resources/v1/contracts.d.mts.map +1 -0
- package/resources/v1/contracts.d.ts.map +1 -1
- package/resources/v1/contracts.js +2 -15
- package/resources/v1/contracts.js.map +1 -1
- package/resources/v1/credit-grants.d.mts +505 -0
- package/resources/v1/credit-grants.d.mts.map +1 -0
- package/resources/v1/credit-grants.d.ts +73 -74
- package/resources/v1/credit-grants.d.ts.map +1 -1
- package/resources/v1/credit-grants.js +52 -18
- package/resources/v1/credit-grants.js.map +1 -1
- package/resources/v1/credit-grants.mjs +51 -16
- package/resources/v1/credit-grants.mjs.map +1 -1
- package/resources/v1/custom-fields.d.mts +151 -0
- package/resources/v1/custom-fields.d.mts.map +1 -0
- package/resources/v1/custom-fields.d.ts +69 -38
- package/resources/v1/custom-fields.d.ts.map +1 -1
- package/resources/v1/custom-fields.js +66 -22
- package/resources/v1/custom-fields.js.map +1 -1
- package/resources/v1/custom-fields.mjs +66 -22
- package/resources/v1/custom-fields.mjs.map +1 -1
- package/resources/v1/customers/alerts.d.mts +309 -0
- package/resources/v1/customers/alerts.d.mts.map +1 -0
- package/resources/v1/customers/alerts.d.ts +176 -50
- package/resources/v1/customers/alerts.d.ts.map +1 -1
- package/resources/v1/customers/alerts.js +131 -10
- package/resources/v1/customers/alerts.js.map +1 -1
- package/resources/v1/customers/alerts.mjs +131 -10
- package/resources/v1/customers/alerts.mjs.map +1 -1
- package/resources/v1/customers/billing-config.d.mts +125 -0
- package/resources/v1/customers/billing-config.d.mts.map +1 -0
- package/resources/v1/customers/billing-config.d.ts +8 -7
- package/resources/v1/customers/billing-config.d.ts.map +1 -1
- package/resources/v1/customers/billing-config.js +8 -6
- package/resources/v1/customers/billing-config.js.map +1 -1
- package/resources/v1/customers/billing-config.mjs +8 -6
- package/resources/v1/customers/billing-config.mjs.map +1 -1
- package/resources/v1/customers/commits.d.mts +456 -0
- package/resources/v1/customers/commits.d.mts.map +1 -0
- package/resources/v1/customers/commits.d.ts +139 -47
- package/resources/v1/customers/commits.d.ts.map +1 -1
- package/resources/v1/customers/commits.js +131 -12
- package/resources/v1/customers/commits.js.map +1 -1
- package/resources/v1/customers/commits.mjs +131 -12
- package/resources/v1/customers/commits.mjs.map +1 -1
- package/resources/v1/customers/credits.d.mts +310 -0
- package/resources/v1/customers/credits.d.mts.map +1 -0
- package/resources/v1/customers/credits.d.ts +124 -46
- package/resources/v1/customers/credits.d.ts.map +1 -1
- package/resources/v1/customers/credits.js +116 -11
- package/resources/v1/customers/credits.js.map +1 -1
- package/resources/v1/customers/credits.mjs +116 -11
- package/resources/v1/customers/credits.mjs.map +1 -1
- package/resources/v1/customers/customers.d.mts +819 -0
- package/resources/v1/customers/customers.d.mts.map +1 -0
- package/resources/v1/customers/customers.d.ts +319 -55
- package/resources/v1/customers/customers.d.ts.map +1 -1
- package/resources/v1/customers/customers.js +220 -76
- package/resources/v1/customers/customers.js.map +1 -1
- package/resources/v1/customers/customers.mjs +213 -44
- package/resources/v1/customers/customers.mjs.map +1 -1
- package/resources/v1/customers/index.d.mts +9 -0
- package/resources/v1/customers/index.d.mts.map +1 -0
- package/resources/v1/customers/index.d.ts +6 -6
- package/resources/v1/customers/index.d.ts.map +1 -1
- package/resources/v1/customers/index.js +1 -8
- package/resources/v1/customers/index.js.map +1 -1
- package/resources/v1/customers/index.mjs +3 -3
- package/resources/v1/customers/index.mjs.map +1 -1
- package/resources/v1/customers/invoices.d.mts +825 -0
- package/resources/v1/customers/invoices.d.mts.map +1 -0
- package/resources/v1/customers/invoices.d.ts +309 -25
- package/resources/v1/customers/invoices.d.ts.map +1 -1
- package/resources/v1/customers/invoices.js +180 -22
- package/resources/v1/customers/invoices.js.map +1 -1
- package/resources/v1/customers/invoices.mjs +179 -19
- package/resources/v1/customers/invoices.mjs.map +1 -1
- package/resources/v1/customers/named-schedules.d.mts +82 -0
- package/resources/v1/customers/named-schedules.d.mts.map +1 -0
- package/resources/v1/customers/named-schedules.d.ts +5 -4
- package/resources/v1/customers/named-schedules.d.ts.map +1 -1
- package/resources/v1/customers/named-schedules.js +3 -2
- package/resources/v1/customers/named-schedules.js.map +1 -1
- package/resources/v1/customers/named-schedules.mjs +3 -2
- package/resources/v1/customers/named-schedules.mjs.map +1 -1
- package/resources/v1/customers/plans.d.mts +281 -0
- package/resources/v1/customers/plans.d.mts.map +1 -0
- package/resources/v1/customers/plans.d.ts +14 -12
- package/resources/v1/customers/plans.d.ts.map +1 -1
- package/resources/v1/customers/plans.js +8 -15
- package/resources/v1/customers/plans.js.map +1 -1
- package/resources/v1/customers/plans.mjs +7 -12
- package/resources/v1/customers/plans.mjs.map +1 -1
- package/resources/v1/customers.d.mts +2 -0
- package/resources/v1/customers.d.mts.map +1 -0
- package/resources/v1/customers.d.ts.map +1 -1
- package/resources/v1/customers.js +2 -15
- package/resources/v1/customers.js.map +1 -1
- package/resources/v1/dashboards.d.mts +133 -0
- package/resources/v1/dashboards.d.mts.map +1 -0
- package/resources/v1/dashboards.d.ts +33 -6
- package/resources/v1/dashboards.d.ts.map +1 -1
- package/resources/v1/dashboards.js +30 -4
- package/resources/v1/dashboards.js.map +1 -1
- package/resources/v1/dashboards.mjs +30 -4
- package/resources/v1/dashboards.mjs.map +1 -1
- package/resources/v1/index.d.mts +16 -0
- package/resources/v1/index.d.mts.map +1 -0
- package/resources/v1/index.d.ts +10 -9
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js +3 -12
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs +8 -7
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/invoices.d.mts +83 -0
- package/resources/v1/invoices.d.mts.map +1 -0
- package/resources/v1/invoices.d.ts +28 -6
- package/resources/v1/invoices.d.ts.map +1 -1
- package/resources/v1/invoices.js +24 -3
- package/resources/v1/invoices.js.map +1 -1
- package/resources/v1/invoices.mjs +24 -3
- package/resources/v1/invoices.mjs.map +1 -1
- package/resources/v1/payments.d.mts +116 -0
- package/resources/v1/payments.d.mts.map +1 -0
- package/resources/v1/payments.d.ts +116 -0
- package/resources/v1/payments.d.ts.map +1 -0
- package/resources/v1/payments.js +71 -0
- package/resources/v1/payments.js.map +1 -0
- package/resources/v1/payments.mjs +67 -0
- package/resources/v1/payments.mjs.map +1 -0
- package/resources/v1/plans.d.mts +240 -0
- package/resources/v1/plans.d.mts.map +1 -0
- package/resources/v1/plans.d.ts +24 -15
- package/resources/v1/plans.d.ts.map +1 -1
- package/resources/v1/plans.js +19 -26
- package/resources/v1/plans.js.map +1 -1
- package/resources/v1/plans.mjs +18 -22
- package/resources/v1/plans.mjs.map +1 -1
- package/resources/v1/pricing-units.d.mts +34 -0
- package/resources/v1/pricing-units.d.mts.map +1 -0
- package/resources/v1/pricing-units.d.ts +12 -9
- package/resources/v1/pricing-units.d.ts.map +1 -1
- package/resources/v1/pricing-units.js +20 -12
- package/resources/v1/pricing-units.js.map +1 -1
- package/resources/v1/pricing-units.mjs +19 -10
- package/resources/v1/pricing-units.mjs.map +1 -1
- package/resources/v1/services.d.mts +33 -0
- package/resources/v1/services.d.mts.map +1 -0
- package/resources/v1/services.d.ts +10 -7
- package/resources/v1/services.d.ts.map +1 -1
- package/resources/v1/services.js +7 -5
- package/resources/v1/services.js.map +1 -1
- package/resources/v1/services.mjs +7 -5
- package/resources/v1/services.mjs.map +1 -1
- package/resources/v1/usage.d.mts +490 -0
- package/resources/v1/usage.d.mts.map +1 -0
- package/resources/v1/usage.d.ts +223 -58
- package/resources/v1/usage.d.ts.map +1 -1
- package/resources/v1/usage.js +214 -26
- package/resources/v1/usage.js.map +1 -1
- package/resources/v1/usage.mjs +213 -24
- package/resources/v1/usage.mjs.map +1 -1
- package/resources/v1/v1.d.mts +62 -0
- package/resources/v1/v1.d.mts.map +1 -0
- package/resources/v1/v1.d.ts +19 -15
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js +19 -48
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs +12 -19
- package/resources/v1/v1.mjs.map +1 -1
- package/resources/v1.d.mts +2 -0
- package/resources/v1.d.mts.map +1 -0
- package/resources/v1.d.ts.map +1 -1
- package/resources/v1.js +2 -15
- package/resources/v1.js.map +1 -1
- package/resources/v2/contracts.d.mts +2900 -0
- package/resources/v2/contracts.d.mts.map +1 -0
- package/resources/v2/contracts.d.ts +399 -3830
- package/resources/v2/contracts.d.ts.map +1 -1
- package/resources/v2/contracts.js +102 -12
- package/resources/v2/contracts.js.map +1 -1
- package/resources/v2/contracts.mjs +102 -12
- package/resources/v2/contracts.mjs.map +1 -1
- package/resources/v2/index.d.mts +3 -0
- package/resources/v2/index.d.mts.map +1 -0
- package/resources/v2/index.d.ts.map +1 -1
- package/resources/v2/v2.d.mts +10 -0
- package/resources/v2/v2.d.mts.map +1 -0
- package/resources/v2/v2.d.ts +1 -1
- package/resources/v2/v2.d.ts.map +1 -1
- package/resources/v2/v2.js +3 -25
- package/resources/v2/v2.js.map +1 -1
- package/resources/v2/v2.mjs +1 -1
- package/resources/v2.d.mts +2 -0
- package/resources/v2.d.mts.map +1 -0
- package/resources/v2.d.ts.map +1 -1
- package/resources/v2.js +2 -15
- package/resources/v2.js.map +1 -1
- package/resources/webhooks.d.mts +22 -0
- package/resources/webhooks.d.mts.map +1 -0
- package/resources/webhooks.d.ts +1 -1
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js +3 -3
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs +1 -1
- package/resources/webhooks.mjs.map +1 -1
- package/resources.d.mts +2 -0
- package/resources.d.mts.map +1 -0
- package/resources.d.ts.map +1 -1
- package/resources.js +2 -15
- package/resources.js.map +1 -1
- package/src/api-promise.ts +2 -0
- package/src/client.ts +809 -0
- package/src/core/README.md +3 -0
- package/src/core/api-promise.ts +92 -0
- package/src/core/error.ts +130 -0
- package/src/core/pagination.ts +319 -0
- package/src/core/resource.ts +11 -0
- package/src/core/uploads.ts +2 -0
- package/src/error.ts +2 -130
- package/src/index.ts +6 -221
- package/src/internal/README.md +3 -0
- package/src/internal/builtin-types.ts +93 -0
- package/src/internal/detect-platform.ts +196 -0
- package/src/internal/errors.ts +33 -0
- package/src/internal/headers.ts +144 -0
- package/src/internal/parse.ts +50 -0
- package/src/internal/qs/formats.ts +3 -2
- package/src/internal/qs/index.ts +3 -3
- package/src/internal/qs/stringify.ts +18 -21
- package/src/internal/qs/utils.ts +16 -16
- package/src/internal/request-options.ts +91 -0
- package/src/internal/shim-types.ts +26 -0
- package/src/internal/shims.ts +107 -0
- package/src/internal/to-file.ts +154 -0
- package/src/internal/types.ts +95 -0
- package/src/internal/uploads.ts +187 -0
- package/src/internal/utils/base64.ts +40 -0
- package/src/internal/utils/bytes.ts +32 -0
- package/src/internal/utils/env.ts +18 -0
- package/src/internal/utils/log.ts +126 -0
- package/src/internal/utils/path.ts +88 -0
- package/src/internal/utils/sleep.ts +3 -0
- package/src/internal/utils/uuid.ts +17 -0
- package/src/internal/utils/values.ts +105 -0
- package/src/internal/utils.ts +8 -0
- package/src/pagination.ts +2 -82
- package/src/resource.ts +2 -11
- package/src/resources/index.ts +4 -4
- package/src/resources/shared.ts +1921 -506
- package/src/resources/v1/alerts.ts +108 -33
- package/src/resources/v1/audit-logs.ts +48 -26
- package/src/resources/v1/billable-metrics.ts +79 -34
- package/src/resources/v1/contracts/contracts.ts +490 -1632
- package/src/resources/v1/contracts/index.ts +7 -6
- package/src/resources/v1/contracts/named-schedules.ts +8 -6
- package/src/resources/v1/contracts/products.ts +50 -38
- package/src/resources/v1/contracts/rate-cards/index.ts +6 -6
- package/src/resources/v1/contracts/rate-cards/named-schedules.ts +8 -6
- package/src/resources/v1/contracts/rate-cards/product-orders.ts +13 -10
- package/src/resources/v1/contracts/rate-cards/rate-cards.ts +145 -72
- package/src/resources/v1/contracts/rate-cards/rates.ts +28 -98
- package/src/resources/v1/contracts/rate-cards.ts +1 -1
- package/src/resources/v1/contracts.ts +1 -1
- package/src/resources/v1/credit-grants.ts +100 -112
- package/src/resources/v1/custom-fields.ts +106 -74
- package/src/resources/v1/customers/alerts.ts +195 -55
- package/src/resources/v1/customers/billing-config.ts +27 -13
- package/src/resources/v1/customers/commits.ts +146 -54
- package/src/resources/v1/customers/credits.ts +131 -53
- package/src/resources/v1/customers/customers.ts +407 -115
- package/src/resources/v1/customers/index.ts +20 -18
- package/src/resources/v1/customers/invoices.ts +343 -42
- package/src/resources/v1/customers/named-schedules.ts +8 -6
- package/src/resources/v1/customers/plans.ts +24 -22
- package/src/resources/v1/customers.ts +1 -1
- package/src/resources/v1/dashboards.ts +34 -7
- package/src/resources/v1/index.ts +43 -25
- package/src/resources/v1/invoices.ts +28 -9
- package/src/resources/v1/payments.ts +170 -0
- package/src/resources/v1/plans.ts +42 -43
- package/src/resources/v1/pricing-units.ts +15 -23
- package/src/resources/v1/services.ts +10 -7
- package/src/resources/v1/usage.ts +247 -73
- package/src/resources/v1/v1.ts +78 -49
- package/src/resources/v1.ts +1 -1
- package/src/resources/v2/contracts.ts +469 -4930
- package/src/resources/v2/index.ts +2 -2
- package/src/resources/v2/v2.ts +3 -3
- package/src/resources/v2.ts +1 -1
- package/src/resources/webhooks.ts +2 -2
- package/src/resources.ts +1 -1
- package/src/tsconfig.json +2 -2
- package/src/uploads.ts +2 -255
- package/src/version.ts +1 -1
- package/uploads.d.mts +2 -0
- package/uploads.d.mts.map +1 -0
- package/uploads.d.ts +1 -74
- package/uploads.d.ts.map +1 -1
- package/uploads.js +3 -168
- package/uploads.js.map +1 -1
- package/uploads.mjs +1 -157
- package/uploads.mjs.map +1 -1
- package/version.d.mts +2 -0
- package/version.d.mts.map +1 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/_shims/MultipartBody.d.ts +0 -9
- package/_shims/MultipartBody.d.ts.map +0 -1
- package/_shims/MultipartBody.js +0 -16
- package/_shims/MultipartBody.js.map +0 -1
- package/_shims/MultipartBody.mjs +0 -12
- package/_shims/MultipartBody.mjs.map +0 -1
- package/_shims/README.md +0 -46
- package/_shims/auto/runtime-bun.d.ts +0 -5
- package/_shims/auto/runtime-bun.d.ts.map +0 -1
- package/_shims/auto/runtime-bun.js +0 -21
- package/_shims/auto/runtime-bun.js.map +0 -1
- package/_shims/auto/runtime-bun.mjs +0 -2
- package/_shims/auto/runtime-bun.mjs.map +0 -1
- package/_shims/auto/runtime-node.d.ts +0 -5
- package/_shims/auto/runtime-node.d.ts.map +0 -1
- package/_shims/auto/runtime-node.js +0 -21
- package/_shims/auto/runtime-node.js.map +0 -1
- package/_shims/auto/runtime-node.mjs +0 -2
- package/_shims/auto/runtime-node.mjs.map +0 -1
- package/_shims/auto/runtime.d.ts +0 -5
- package/_shims/auto/runtime.d.ts.map +0 -1
- package/_shims/auto/runtime.js +0 -21
- package/_shims/auto/runtime.js.map +0 -1
- package/_shims/auto/runtime.mjs +0 -2
- package/_shims/auto/runtime.mjs.map +0 -1
- package/_shims/auto/types-node.d.ts +0 -5
- package/_shims/auto/types-node.d.ts.map +0 -1
- package/_shims/auto/types-node.js +0 -21
- package/_shims/auto/types-node.js.map +0 -1
- package/_shims/auto/types-node.mjs +0 -2
- package/_shims/auto/types-node.mjs.map +0 -1
- package/_shims/auto/types.d.ts +0 -101
- package/_shims/auto/types.js +0 -3
- package/_shims/auto/types.mjs +0 -3
- package/_shims/bun-runtime.d.ts +0 -6
- package/_shims/bun-runtime.d.ts.map +0 -1
- package/_shims/bun-runtime.js +0 -14
- package/_shims/bun-runtime.js.map +0 -1
- package/_shims/bun-runtime.mjs +0 -10
- package/_shims/bun-runtime.mjs.map +0 -1
- package/_shims/index.d.ts +0 -83
- package/_shims/index.js +0 -17
- package/_shims/index.mjs +0 -11
- package/_shims/manual-types.d.ts +0 -12
- package/_shims/manual-types.js +0 -3
- package/_shims/manual-types.mjs +0 -3
- package/_shims/node-runtime.d.ts +0 -3
- package/_shims/node-runtime.d.ts.map +0 -1
- package/_shims/node-runtime.js +0 -89
- package/_shims/node-runtime.js.map +0 -1
- package/_shims/node-runtime.mjs +0 -56
- package/_shims/node-runtime.mjs.map +0 -1
- package/_shims/node-types.d.ts +0 -42
- package/_shims/node-types.js +0 -3
- package/_shims/node-types.mjs +0 -3
- package/_shims/registry.d.ts +0 -37
- package/_shims/registry.d.ts.map +0 -1
- package/_shims/registry.js +0 -41
- package/_shims/registry.js.map +0 -1
- package/_shims/registry.mjs +0 -37
- package/_shims/registry.mjs.map +0 -1
- package/_shims/web-runtime.d.ts +0 -5
- package/_shims/web-runtime.d.ts.map +0 -1
- package/_shims/web-runtime.js +0 -78
- package/_shims/web-runtime.js.map +0 -1
- package/_shims/web-runtime.mjs +0 -71
- package/_shims/web-runtime.mjs.map +0 -1
- package/_shims/web-types.d.ts +0 -83
- package/_shims/web-types.js +0 -3
- package/_shims/web-types.mjs +0 -3
- package/core.d.ts +0 -255
- package/core.d.ts.map +0 -1
- package/core.js +0 -924
- package/core.js.map +0 -1
- package/core.mjs +0 -892
- package/core.mjs.map +0 -1
- package/shims/node.d.ts +0 -30
- package/shims/node.d.ts.map +0 -1
- package/shims/node.js +0 -31
- package/shims/node.js.map +0 -1
- package/shims/node.mjs +0 -5
- package/shims/node.mjs.map +0 -1
- package/shims/web.d.ts +0 -26
- package/shims/web.d.ts.map +0 -1
- package/shims/web.js +0 -31
- package/shims/web.js.map +0 -1
- package/shims/web.mjs +0 -5
- package/shims/web.mjs.map +0 -1
- package/src/_shims/MultipartBody.ts +0 -9
- package/src/_shims/README.md +0 -46
- package/src/_shims/auto/runtime-bun.ts +0 -4
- package/src/_shims/auto/runtime-node.ts +0 -4
- package/src/_shims/auto/runtime.ts +0 -4
- package/src/_shims/auto/types-node.ts +0 -4
- package/src/_shims/auto/types.d.ts +0 -101
- package/src/_shims/auto/types.js +0 -3
- package/src/_shims/auto/types.mjs +0 -3
- package/src/_shims/bun-runtime.ts +0 -14
- package/src/_shims/index.d.ts +0 -83
- package/src/_shims/index.js +0 -17
- package/src/_shims/index.mjs +0 -11
- package/src/_shims/manual-types.d.ts +0 -12
- package/src/_shims/manual-types.js +0 -3
- package/src/_shims/manual-types.mjs +0 -3
- package/src/_shims/node-runtime.ts +0 -81
- package/src/_shims/node-types.d.ts +0 -42
- package/src/_shims/node-types.js +0 -3
- package/src/_shims/node-types.mjs +0 -3
- package/src/_shims/registry.ts +0 -67
- package/src/_shims/web-runtime.ts +0 -103
- package/src/_shims/web-types.d.ts +0 -83
- package/src/_shims/web-types.js +0 -3
- package/src/_shims/web-types.mjs +0 -3
- package/src/core.ts +0 -1236
- package/src/shims/node.ts +0 -50
- package/src/shims/web.ts +0 -50
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
6
|
-
import * as NamedSchedulesAPI from "./named-schedules.js";
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import * as Shared from '../../shared';
|
|
5
|
+
import * as NamedSchedulesAPI from './named-schedules';
|
|
7
6
|
import {
|
|
8
7
|
NamedScheduleRetrieveParams,
|
|
9
8
|
NamedScheduleRetrieveResponse,
|
|
10
9
|
NamedScheduleUpdateParams,
|
|
11
10
|
NamedSchedules,
|
|
12
|
-
} from
|
|
13
|
-
import * as ProductsAPI from
|
|
11
|
+
} from './named-schedules';
|
|
12
|
+
import * as ProductsAPI from './products';
|
|
14
13
|
import {
|
|
15
14
|
ProductArchiveParams,
|
|
16
15
|
ProductArchiveResponse,
|
|
@@ -27,9 +26,9 @@ import {
|
|
|
27
26
|
Products,
|
|
28
27
|
QuantityConversion,
|
|
29
28
|
QuantityRounding,
|
|
30
|
-
} from
|
|
31
|
-
import * as InvoicesAPI from
|
|
32
|
-
import * as RateCardsAPI from
|
|
29
|
+
} from './products';
|
|
30
|
+
import * as InvoicesAPI from '../customers/invoices';
|
|
31
|
+
import * as RateCardsAPI from './rate-cards/rate-cards';
|
|
33
32
|
import {
|
|
34
33
|
RateCardArchiveParams,
|
|
35
34
|
RateCardArchiveResponse,
|
|
@@ -45,7 +44,11 @@ import {
|
|
|
45
44
|
RateCardUpdateParams,
|
|
46
45
|
RateCardUpdateResponse,
|
|
47
46
|
RateCards,
|
|
48
|
-
} from
|
|
47
|
+
} from './rate-cards/rate-cards';
|
|
48
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
49
|
+
import { BodyCursorPage, type BodyCursorPageParams, PagePromise } from '../../../core/pagination';
|
|
50
|
+
import { buildHeaders } from '../../../internal/headers';
|
|
51
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
49
52
|
|
|
50
53
|
export class Contracts extends APIResource {
|
|
51
54
|
products: ProductsAPI.Products = new ProductsAPI.Products(this._client);
|
|
@@ -53,7 +56,129 @@ export class Contracts extends APIResource {
|
|
|
53
56
|
namedSchedules: NamedSchedulesAPI.NamedSchedules = new NamedSchedulesAPI.NamedSchedules(this._client);
|
|
54
57
|
|
|
55
58
|
/**
|
|
56
|
-
*
|
|
59
|
+
* Contracts define a customer's products, pricing, discounts, access duration, and
|
|
60
|
+
* billing configuration. Contracts serve as the central billing agreement for both
|
|
61
|
+
* PLG and Enterprise customers, you can automatically customers access to your
|
|
62
|
+
* products and services directly from your product or CRM.
|
|
63
|
+
*
|
|
64
|
+
* ### Use this endpoint to:
|
|
65
|
+
*
|
|
66
|
+
* - PLG onboarding: Automatically provision new self-serve customers with
|
|
67
|
+
* contracts when they sign up.
|
|
68
|
+
* - Enterprise sales: Push negotiated contracts from Salesforce with custom
|
|
69
|
+
* pricing and commitments
|
|
70
|
+
* - Promotional pricing: Implement time-limited discounts and free trials through
|
|
71
|
+
* overrides
|
|
72
|
+
*
|
|
73
|
+
* ### Key components:
|
|
74
|
+
*
|
|
75
|
+
* #### Contract Term and Billing Schedule
|
|
76
|
+
*
|
|
77
|
+
* - Set contract duration using `starting_at` and `ending_before` fields. PLG
|
|
78
|
+
* contracts typically use perpetual agreements (no end date), while Enterprise
|
|
79
|
+
* contracts have fixed end dates which can be edited over time in the case of
|
|
80
|
+
* co-term upsells.
|
|
81
|
+
*
|
|
82
|
+
* #### Rate Card
|
|
83
|
+
*
|
|
84
|
+
* If you are offering usage based pricing, you can set a rate card for the
|
|
85
|
+
* contract to reference through `rate_card_id` or `rate_card_alias`. The rate card
|
|
86
|
+
* is a store of all of your usage based products and their centralized pricing.
|
|
87
|
+
* Any new products or price changes on the rate card can be set to automatically
|
|
88
|
+
* propagate to all associated contracts - this ensures consistent pricing and
|
|
89
|
+
* product launches flow to contracts without manual updates and migrations. The
|
|
90
|
+
* `usage_statement_schedule` determines the cadence on which Metronome will
|
|
91
|
+
* finalize a usage invoice for the customer. This defaults to monthly on the 1st,
|
|
92
|
+
* with options for custom dates, quarterly, or annual cadences. Note: Most usage
|
|
93
|
+
* based billing companies align usage statements to be evaluated aligned to the
|
|
94
|
+
* first of the month. Read more about
|
|
95
|
+
* [Rate Cards](https://docs.metronome.com/pricing-packaging/create-manage-rate-cards/).
|
|
96
|
+
*
|
|
97
|
+
* #### Overrides and discounts
|
|
98
|
+
*
|
|
99
|
+
* Customize pricing on the contract through time-bounded overrides that can target
|
|
100
|
+
* specific products, product families, or complex usage scenarios. Overrides
|
|
101
|
+
* enable two key capabilities:
|
|
102
|
+
*
|
|
103
|
+
* - Discounts: Apply percentage discounts, fixed rate reductions, or
|
|
104
|
+
* quantity-based pricing tiers
|
|
105
|
+
* - Entitlements: Provide special pricing or access to specific products for
|
|
106
|
+
* negotiated deals
|
|
107
|
+
*
|
|
108
|
+
* Read more about
|
|
109
|
+
* [Contract Overrides](https://docs.metronome.com/manage-product-access/add-contract-override/).
|
|
110
|
+
*
|
|
111
|
+
* #### Commits and Credits
|
|
112
|
+
*
|
|
113
|
+
* Using commits, configure prepaid or postpaid spending commitments where
|
|
114
|
+
* customers promise to spend a certain amount over the contract period paid in
|
|
115
|
+
* advance or in arrears. Use credits to provide free spending allowances. Under
|
|
116
|
+
* the hood these are the same mechanisms, however, credits are typically offered
|
|
117
|
+
* for free (SLA or promotional) or as a part of an allotment associated with a
|
|
118
|
+
* Subscription.
|
|
119
|
+
*
|
|
120
|
+
* In Metronome, you can set commits and credits to only be applicable for a subset
|
|
121
|
+
* of usage. Use `applicable_product_ids` or `applicable_product_tags` to create
|
|
122
|
+
* product or product-family specific commits or credits, or you can build complex
|
|
123
|
+
* boolean logic specifiers to target usage based on pricing and presentation group
|
|
124
|
+
* values using `override_specifiers`.
|
|
125
|
+
*
|
|
126
|
+
* These objects can also also be configured to have a recurrence schedule to
|
|
127
|
+
* easily model customer packaging which includes recurring monthly or quarterly
|
|
128
|
+
* allotments.
|
|
129
|
+
*
|
|
130
|
+
* Commits support rollover settings (`rollover_fraction`) to transfer unused
|
|
131
|
+
* balances between contract periods, either entirely or as a percentage.
|
|
132
|
+
*
|
|
133
|
+
* Read more about
|
|
134
|
+
* [Credits and Commits](https://docs.metronome.com/pricing-packaging/apply-credits-commits/).
|
|
135
|
+
*
|
|
136
|
+
* #### Subscriptions
|
|
137
|
+
*
|
|
138
|
+
* You can add a fixed recurring charge to a contract, like monthly licenses or
|
|
139
|
+
* seat-based fees, using the subscription charge. Subscription charges are defined
|
|
140
|
+
* on your rate card and you can select which subscription is applicable to add to
|
|
141
|
+
* each contract. When you add a subscription to a contract you need to:
|
|
142
|
+
*
|
|
143
|
+
* - Define whether the subscription is paid for in-advance or in-arrears
|
|
144
|
+
* (`collection_schedule`)
|
|
145
|
+
* - Define the proration behavior (`proration`)
|
|
146
|
+
* - Specify an initial quantity (`initial_quantity`)
|
|
147
|
+
* - Define which subscription rate on the rate card should be used
|
|
148
|
+
* (`subscription_rate`)
|
|
149
|
+
*
|
|
150
|
+
* Read more about
|
|
151
|
+
* [Subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/).
|
|
152
|
+
*
|
|
153
|
+
* #### Scheduled Charges
|
|
154
|
+
*
|
|
155
|
+
* Set up one-time, recurring, or entirely custom charges that occur on specific
|
|
156
|
+
* dates, separate from usage-based billing or commitments. These can be used to
|
|
157
|
+
* model non-recurring platform charges or professional services.
|
|
158
|
+
*
|
|
159
|
+
* #### Threshold Billing
|
|
160
|
+
*
|
|
161
|
+
* Metronome allows you to configure automatic billing triggers when customers
|
|
162
|
+
* reach spending thresholds to prevent fraud and manage risk. You can use
|
|
163
|
+
* `spend_threshold_configuration` to trigger an invoice to cover current charges
|
|
164
|
+
* whenever the threshold is reached or you can ensure the customer maintains a
|
|
165
|
+
* minimum prepaid balance using the `prepaid_balance_configuration`.
|
|
166
|
+
*
|
|
167
|
+
* Read more about
|
|
168
|
+
* [Spend Threshold](https://docs.metronome.com/manage-product-access/spend-thresholds/)
|
|
169
|
+
* and
|
|
170
|
+
* [Prepaid Balance Thresholds](https://docs.metronome.com/manage-product-access/prepaid-balance-thresholds/).
|
|
171
|
+
*
|
|
172
|
+
* ### Usage guidelines:
|
|
173
|
+
*
|
|
174
|
+
* - You can always
|
|
175
|
+
* [Edit Contracts](https://docs.metronome.com/manage-product-access/edit-contract/)
|
|
176
|
+
* after it has been created, using the `editContract` endpoint. Metronome keeps
|
|
177
|
+
* track of all edits, both in the audit log and over the `getEditHistory`
|
|
178
|
+
* endpoint.
|
|
179
|
+
* - Customers in Metronome can have multiple concurrent contracts at one time. Use
|
|
180
|
+
* `usage_filters` to route the correct usage to each contract.
|
|
181
|
+
* [Read more about usage filters](https://docs.metronome.com/manage-product-access/provision-customer/#create-a-usage-filter).
|
|
57
182
|
*
|
|
58
183
|
* @example
|
|
59
184
|
* ```ts
|
|
@@ -68,7 +193,7 @@ export class Contracts extends APIResource {
|
|
|
68
193
|
* });
|
|
69
194
|
* ```
|
|
70
195
|
*/
|
|
71
|
-
create(body: ContractCreateParams, options?:
|
|
196
|
+
create(body: ContractCreateParams, options?: RequestOptions): APIPromise<ContractCreateResponse> {
|
|
72
197
|
return this._client.post('/v1/contracts/create', { body, ...options });
|
|
73
198
|
}
|
|
74
199
|
|
|
@@ -84,16 +209,18 @@ export class Contracts extends APIResource {
|
|
|
84
209
|
* });
|
|
85
210
|
* ```
|
|
86
211
|
*/
|
|
87
|
-
retrieve(
|
|
88
|
-
body: ContractRetrieveParams,
|
|
89
|
-
options?: Core.RequestOptions,
|
|
90
|
-
): Core.APIPromise<ContractRetrieveResponse> {
|
|
212
|
+
retrieve(body: ContractRetrieveParams, options?: RequestOptions): APIPromise<ContractRetrieveResponse> {
|
|
91
213
|
return this._client.post('/v1/contracts/get', { body, ...options });
|
|
92
214
|
}
|
|
93
215
|
|
|
94
216
|
/**
|
|
95
|
-
*
|
|
96
|
-
*
|
|
217
|
+
* Retrieves all contracts for a specific customer, including pricing, terms,
|
|
218
|
+
* credits, and commitments. Use this to view a customer's contract history and
|
|
219
|
+
* current agreements for billing management. Returns contract details with
|
|
220
|
+
* optional ledgers and balance information.
|
|
221
|
+
*
|
|
222
|
+
* ⚠️ Note: This is the legacy v1 endpoint - new integrations should use the v2
|
|
223
|
+
* endpoint for enhanced features.
|
|
97
224
|
*
|
|
98
225
|
* @example
|
|
99
226
|
* ```ts
|
|
@@ -102,12 +229,29 @@ export class Contracts extends APIResource {
|
|
|
102
229
|
* });
|
|
103
230
|
* ```
|
|
104
231
|
*/
|
|
105
|
-
list(body: ContractListParams, options?:
|
|
232
|
+
list(body: ContractListParams, options?: RequestOptions): APIPromise<ContractListResponse> {
|
|
106
233
|
return this._client.post('/v1/contracts/list', { body, ...options });
|
|
107
234
|
}
|
|
108
235
|
|
|
109
236
|
/**
|
|
110
|
-
*
|
|
237
|
+
* Manually adjust the available balance on a commit or credit. This entry is
|
|
238
|
+
* appended to the commit ledger as a new event. Optionally include a description
|
|
239
|
+
* that provides the reasoning for the entry.
|
|
240
|
+
*
|
|
241
|
+
* ### Use this endpoint to:
|
|
242
|
+
*
|
|
243
|
+
* - Address incorrect usage burn-down caused by malformed usage or invalid config
|
|
244
|
+
* - Decrease available balance to account for outages where usage may have not
|
|
245
|
+
* been tracked or sent to Metronome
|
|
246
|
+
* - Issue credits to customers in the form of increased balance on existing commit
|
|
247
|
+
* or credit
|
|
248
|
+
*
|
|
249
|
+
* ### Usage guidelines:
|
|
250
|
+
*
|
|
251
|
+
* Manual ledger entries can be extremely useful for resolving discrepancies in
|
|
252
|
+
* Metronome. However, most corrections to inaccurate billings can be modified
|
|
253
|
+
* upstream of the commit, whether that is via contract editing, rate editing, or
|
|
254
|
+
* other actions that cause an invoice to be recalculated.
|
|
111
255
|
*
|
|
112
256
|
* @example
|
|
113
257
|
* ```ts
|
|
@@ -123,18 +267,18 @@ export class Contracts extends APIResource {
|
|
|
123
267
|
*/
|
|
124
268
|
addManualBalanceEntry(
|
|
125
269
|
body: ContractAddManualBalanceEntryParams,
|
|
126
|
-
options?:
|
|
127
|
-
):
|
|
270
|
+
options?: RequestOptions,
|
|
271
|
+
): APIPromise<void> {
|
|
128
272
|
return this._client.post('/v1/contracts/addManualBalanceLedgerEntry', {
|
|
129
273
|
body,
|
|
130
274
|
...options,
|
|
131
|
-
headers: { Accept: '*/*',
|
|
275
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
132
276
|
});
|
|
133
277
|
}
|
|
134
278
|
|
|
135
279
|
/**
|
|
136
280
|
* Amendments will be replaced by Contract editing. New clients should implement
|
|
137
|
-
* using the editContract endpoint. Read more about the migration to contract
|
|
281
|
+
* using the `editContract` endpoint. Read more about the migration to contract
|
|
138
282
|
* editing [here](https://docs.metronome.com/migrate-amendments-to-edits/) and
|
|
139
283
|
* reach out to your Metronome representative for more details. Once contract
|
|
140
284
|
* editing is enabled, access to this endpoint will be removed.
|
|
@@ -148,12 +292,31 @@ export class Contracts extends APIResource {
|
|
|
148
292
|
* });
|
|
149
293
|
* ```
|
|
150
294
|
*/
|
|
151
|
-
amend(body: ContractAmendParams, options?:
|
|
295
|
+
amend(body: ContractAmendParams, options?: RequestOptions): APIPromise<ContractAmendResponse> {
|
|
152
296
|
return this._client.post('/v1/contracts/amend', { body, ...options });
|
|
153
297
|
}
|
|
154
298
|
|
|
155
299
|
/**
|
|
156
|
-
*
|
|
300
|
+
* Permanently end and archive a contract along with all its terms. Any draft
|
|
301
|
+
* invoices will be canceled, and all upcoming scheduled invoices will be
|
|
302
|
+
* voided–also all finalized invoices can optionally be voided. Use this in the
|
|
303
|
+
* event a contract was incorrectly created and needed to be removed from a
|
|
304
|
+
* customer.
|
|
305
|
+
*
|
|
306
|
+
* #### Impact on commits and credits:
|
|
307
|
+
*
|
|
308
|
+
* When archiving a contract, all associated commits and credits are also archived.
|
|
309
|
+
* For prepaid commits with active segments, Metronome automatically generates
|
|
310
|
+
* expiration ledger entries to close out any remaining balances, ensuring accurate
|
|
311
|
+
* accounting of unused prepaid amounts. These ledger entries will appear in the
|
|
312
|
+
* commit's transaction history with type `PREPAID_COMMIT_EXPIRATION`.
|
|
313
|
+
*
|
|
314
|
+
* #### Archived contract visibility:
|
|
315
|
+
*
|
|
316
|
+
* Archived contracts remain accessible for historical reporting and audit
|
|
317
|
+
* purposes. They can be retrieved using the `ListContracts` endpoint by setting
|
|
318
|
+
* the `include_archived` parameter to `true` or in the Metronome UI when the "Show
|
|
319
|
+
* archived" option is enabled.
|
|
157
320
|
*
|
|
158
321
|
* @example
|
|
159
322
|
* ```ts
|
|
@@ -164,15 +327,16 @@ export class Contracts extends APIResource {
|
|
|
164
327
|
* });
|
|
165
328
|
* ```
|
|
166
329
|
*/
|
|
167
|
-
archive(
|
|
168
|
-
body: ContractArchiveParams,
|
|
169
|
-
options?: Core.RequestOptions,
|
|
170
|
-
): Core.APIPromise<ContractArchiveResponse> {
|
|
330
|
+
archive(body: ContractArchiveParams, options?: RequestOptions): APIPromise<ContractArchiveResponse> {
|
|
171
331
|
return this._client.post('/v1/contracts/archive', { body, ...options });
|
|
172
332
|
}
|
|
173
333
|
|
|
174
334
|
/**
|
|
175
|
-
*
|
|
335
|
+
* Create historical usage invoices for past billing periods on specific contracts.
|
|
336
|
+
* Use this endpoint to generate retroactive invoices with custom usage line items,
|
|
337
|
+
* quantities, and date ranges. Supports preview mode to validate invoice data
|
|
338
|
+
* before creation. Ideal for billing migrations or correcting past billing
|
|
339
|
+
* periods.
|
|
176
340
|
*
|
|
177
341
|
* @example
|
|
178
342
|
* ```ts
|
|
@@ -205,32 +369,80 @@ export class Contracts extends APIResource {
|
|
|
205
369
|
*/
|
|
206
370
|
createHistoricalInvoices(
|
|
207
371
|
body: ContractCreateHistoricalInvoicesParams,
|
|
208
|
-
options?:
|
|
209
|
-
):
|
|
372
|
+
options?: RequestOptions,
|
|
373
|
+
): APIPromise<ContractCreateHistoricalInvoicesResponse> {
|
|
210
374
|
return this._client.post('/v1/contracts/createHistoricalInvoices', { body, ...options });
|
|
211
375
|
}
|
|
212
376
|
|
|
213
377
|
/**
|
|
214
|
-
*
|
|
378
|
+
* Retrieve a comprehensive view of all available balances (commits and credits)
|
|
379
|
+
* for a customer. This endpoint provides real-time visibility into prepaid funds,
|
|
380
|
+
* postpaid commitments, promotional credits, and other balance types that can
|
|
381
|
+
* offset usage charges, helping you build transparent billing experiences.
|
|
382
|
+
*
|
|
383
|
+
* ### Use this endpoint to:
|
|
384
|
+
*
|
|
385
|
+
* - Display current available balances in customer dashboards
|
|
386
|
+
* - Verify available funds before approving high-usage operations
|
|
387
|
+
* - Generate balance reports for finance teams
|
|
388
|
+
* - Filter balances by contract or date ranges
|
|
389
|
+
*
|
|
390
|
+
* ### Key response fields:
|
|
391
|
+
*
|
|
392
|
+
* An array of balance objects (all credits and commits) containing:
|
|
393
|
+
*
|
|
394
|
+
* - Balance details: Current available amount for each commit or credit
|
|
395
|
+
* - Metadata: Product associations, priorities, applicable date ranges
|
|
396
|
+
* - Optional ledger entries: Detailed transaction history (if
|
|
397
|
+
* `include_ledgers=true`)
|
|
398
|
+
* - Balance calculations: Including pending transactions and future-dated entries
|
|
399
|
+
* - Custom fields: Any additional metadata attached to balances
|
|
400
|
+
*
|
|
401
|
+
* ### Usage guidelines:
|
|
402
|
+
*
|
|
403
|
+
* - Date filtering: Use `effective_before` to include only balances with access
|
|
404
|
+
* before a specific date (exclusive)
|
|
405
|
+
* - Set `include_balance=true` for calculated balance amounts on each commit or
|
|
406
|
+
* credit
|
|
407
|
+
* - Set `include_ledgers=true` for full transaction history
|
|
408
|
+
* - Set `include_contract_balances = true` to see contract level balances
|
|
409
|
+
* - Balance logic: Reflects currently accessible amounts, excluding expired/future
|
|
410
|
+
* segments
|
|
411
|
+
* - Manual adjustments: Includes all manual ledger entries, even future-dated ones
|
|
215
412
|
*
|
|
216
413
|
* @example
|
|
217
414
|
* ```ts
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
*
|
|
415
|
+
* // Automatically fetches more pages as needed.
|
|
416
|
+
* for await (const contractListBalancesResponse of client.v1.contracts.listBalances(
|
|
417
|
+
* {
|
|
418
|
+
* customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
|
|
419
|
+
* id: '6162d87b-e5db-4a33-b7f2-76ce6ead4e85',
|
|
420
|
+
* include_ledgers: true,
|
|
421
|
+
* },
|
|
422
|
+
* )) {
|
|
423
|
+
* // ...
|
|
424
|
+
* }
|
|
223
425
|
* ```
|
|
224
426
|
*/
|
|
225
427
|
listBalances(
|
|
226
428
|
body: ContractListBalancesParams,
|
|
227
|
-
options?:
|
|
228
|
-
):
|
|
229
|
-
return this._client.
|
|
429
|
+
options?: RequestOptions,
|
|
430
|
+
): PagePromise<ContractListBalancesResponsesBodyCursorPage, ContractListBalancesResponse> {
|
|
431
|
+
return this._client.getAPIList(
|
|
432
|
+
'/v1/contracts/customerBalances/list',
|
|
433
|
+
BodyCursorPage<ContractListBalancesResponse>,
|
|
434
|
+
{ body, method: 'post', ...options },
|
|
435
|
+
);
|
|
230
436
|
}
|
|
231
437
|
|
|
232
438
|
/**
|
|
233
|
-
*
|
|
439
|
+
* For a specific customer and contract, get the rates at a specific point in time.
|
|
440
|
+
* This endpoint takes the contract's rate card into consideration, including
|
|
441
|
+
* scheduled changes. It also takes into account overrides on the contract.
|
|
442
|
+
*
|
|
443
|
+
* For example, if you want to show your customer a summary of the prices they are
|
|
444
|
+
* paying, inclusive of any negotiated discounts or promotions, use this endpoint.
|
|
445
|
+
* This endpoint only returns rates that are entitled.
|
|
234
446
|
*
|
|
235
447
|
* @example
|
|
236
448
|
* ```ts
|
|
@@ -253,8 +465,8 @@ export class Contracts extends APIResource {
|
|
|
253
465
|
*/
|
|
254
466
|
retrieveRateSchedule(
|
|
255
467
|
params: ContractRetrieveRateScheduleParams,
|
|
256
|
-
options?:
|
|
257
|
-
):
|
|
468
|
+
options?: RequestOptions,
|
|
469
|
+
): APIPromise<ContractRetrieveRateScheduleResponse> {
|
|
258
470
|
const { limit, next_page, ...body } = params;
|
|
259
471
|
return this._client.post('/v1/contracts/getContractRateSchedule', {
|
|
260
472
|
query: { limit, next_page },
|
|
@@ -264,8 +476,16 @@ export class Contracts extends APIResource {
|
|
|
264
476
|
}
|
|
265
477
|
|
|
266
478
|
/**
|
|
267
|
-
*
|
|
268
|
-
*
|
|
479
|
+
* Get the history of subscription quantities and prices over time for a given
|
|
480
|
+
* `subscription_id`. This endpoint can be used to power an in-product experience
|
|
481
|
+
* where you show a customer their historical changes to seat count. Future changes
|
|
482
|
+
* are not included in this endpoint - use the `getContract` endpoint to view the
|
|
483
|
+
* future scheduled changes to a subscription's quantity.
|
|
484
|
+
*
|
|
485
|
+
* Subscriptions are used to model fixed recurring fees as well as seat-based
|
|
486
|
+
* recurring fees. To model changes to the number of seats in Metronome, you can
|
|
487
|
+
* increment or decrement the quantity on a subscription at any point in the past
|
|
488
|
+
* or future.
|
|
269
489
|
*
|
|
270
490
|
* @example
|
|
271
491
|
* ```ts
|
|
@@ -282,8 +502,8 @@ export class Contracts extends APIResource {
|
|
|
282
502
|
*/
|
|
283
503
|
retrieveSubscriptionQuantityHistory(
|
|
284
504
|
body: ContractRetrieveSubscriptionQuantityHistoryParams,
|
|
285
|
-
options?:
|
|
286
|
-
):
|
|
505
|
+
options?: RequestOptions,
|
|
506
|
+
): APIPromise<ContractRetrieveSubscriptionQuantityHistoryResponse> {
|
|
287
507
|
return this._client.post('/v1/contracts/getSubscriptionQuantityHistory', { body, ...options });
|
|
288
508
|
}
|
|
289
509
|
|
|
@@ -299,995 +519,97 @@ export class Contracts extends APIResource {
|
|
|
299
519
|
* customer_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
300
520
|
* issued_at: '2019-12-27T18:11:19.117Z',
|
|
301
521
|
* line_items: [
|
|
302
|
-
* {
|
|
303
|
-
* professional_service_id:
|
|
304
|
-
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
305
|
-
* },
|
|
306
|
-
* ],
|
|
307
|
-
* });
|
|
308
|
-
* ```
|
|
309
|
-
*/
|
|
310
|
-
scheduleProServicesInvoice(
|
|
311
|
-
body: ContractScheduleProServicesInvoiceParams,
|
|
312
|
-
options?:
|
|
313
|
-
):
|
|
314
|
-
return this._client.post('/v1/contracts/scheduleProServicesInvoice', { body, ...options });
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
/**
|
|
318
|
-
* Set usage filter for a contract
|
|
319
|
-
*
|
|
320
|
-
* @example
|
|
321
|
-
* ```ts
|
|
322
|
-
* await client.v1.contracts.setUsageFilter({
|
|
323
|
-
* contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
324
|
-
* customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
|
|
325
|
-
* group_key: 'business_subscription_id',
|
|
326
|
-
* group_values: ['ID-1', 'ID-2'],
|
|
327
|
-
* starting_at: '2020-01-01T00:00:00.000Z',
|
|
328
|
-
* });
|
|
329
|
-
* ```
|
|
330
|
-
*/
|
|
331
|
-
setUsageFilter(body: ContractSetUsageFilterParams, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
332
|
-
return this._client.post('/v1/contracts/setUsageFilter', {
|
|
333
|
-
body,
|
|
334
|
-
...options,
|
|
335
|
-
headers: { Accept: '*/*', ...options?.headers },
|
|
336
|
-
});
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
/**
|
|
340
|
-
* Update the end date of a contract
|
|
341
|
-
*
|
|
342
|
-
* @example
|
|
343
|
-
* ```ts
|
|
344
|
-
* const response = await client.v1.contracts.updateEndDate({
|
|
345
|
-
* contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
346
|
-
* customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
|
|
347
|
-
* ending_before: '2020-01-01T00:00:00.000Z',
|
|
348
|
-
* });
|
|
349
|
-
* ```
|
|
350
|
-
*/
|
|
351
|
-
updateEndDate(
|
|
352
|
-
body: ContractUpdateEndDateParams,
|
|
353
|
-
options?: Core.RequestOptions,
|
|
354
|
-
): Core.APIPromise<ContractUpdateEndDateResponse> {
|
|
355
|
-
return this._client.post('/v1/contracts/updateEndDate', { body, ...options });
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
export interface ContractCreateResponse {
|
|
360
|
-
data: Shared.ID;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
export interface ContractRetrieveResponse {
|
|
364
|
-
data: ContractRetrieveResponse.Data;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
export namespace ContractRetrieveResponse {
|
|
368
|
-
export interface Data {
|
|
369
|
-
id: string;
|
|
370
|
-
|
|
371
|
-
amendments: Array<Data.Amendment>;
|
|
372
|
-
|
|
373
|
-
current: Shared.ContractWithoutAmendments;
|
|
374
|
-
|
|
375
|
-
customer_id: string;
|
|
376
|
-
|
|
377
|
-
initial: Shared.ContractWithoutAmendments;
|
|
378
|
-
|
|
379
|
-
/**
|
|
380
|
-
* RFC 3339 timestamp indicating when the contract was archived. If not returned,
|
|
381
|
-
* the contract is not archived.
|
|
382
|
-
*/
|
|
383
|
-
archived_at?: string;
|
|
384
|
-
|
|
385
|
-
custom_fields?: { [key: string]: string };
|
|
386
|
-
|
|
387
|
-
/**
|
|
388
|
-
* The billing provider configuration associated with a contract.
|
|
389
|
-
*/
|
|
390
|
-
customer_billing_provider_configuration?: Data.CustomerBillingProviderConfiguration;
|
|
391
|
-
|
|
392
|
-
prepaid_balance_threshold_configuration?: Data.PrepaidBalanceThresholdConfiguration;
|
|
393
|
-
|
|
394
|
-
/**
|
|
395
|
-
* Priority of the contract.
|
|
396
|
-
*/
|
|
397
|
-
priority?: number;
|
|
398
|
-
|
|
399
|
-
/**
|
|
400
|
-
* Determines which scheduled and commit charges to consolidate onto the Contract's
|
|
401
|
-
* usage invoice. The charge's `timestamp` must match the usage invoice's
|
|
402
|
-
* `ending_before` date for consolidation to occur. This field cannot be modified
|
|
403
|
-
* after a Contract has been created. If this field is omitted, charges will appear
|
|
404
|
-
* on a separate invoice from usage charges.
|
|
405
|
-
*/
|
|
406
|
-
scheduled_charges_on_usage_invoices?: 'ALL';
|
|
407
|
-
|
|
408
|
-
spend_threshold_configuration?: Data.SpendThresholdConfiguration;
|
|
409
|
-
|
|
410
|
-
/**
|
|
411
|
-
* List of subscriptions on the contract.
|
|
412
|
-
*/
|
|
413
|
-
subscriptions?: Array<Data.Subscription>;
|
|
414
|
-
|
|
415
|
-
/**
|
|
416
|
-
* Prevents the creation of duplicates. If a request to create a record is made
|
|
417
|
-
* with a previously used uniqueness key, a new record will not be created and the
|
|
418
|
-
* request will fail with a 409 error.
|
|
419
|
-
*/
|
|
420
|
-
uniqueness_key?: string;
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
export namespace Data {
|
|
424
|
-
export interface Amendment {
|
|
425
|
-
id: string;
|
|
426
|
-
|
|
427
|
-
commits: Array<Shared.Commit>;
|
|
428
|
-
|
|
429
|
-
created_at: string;
|
|
430
|
-
|
|
431
|
-
created_by: string;
|
|
432
|
-
|
|
433
|
-
overrides: Array<Shared.Override>;
|
|
434
|
-
|
|
435
|
-
scheduled_charges: Array<Shared.ScheduledCharge>;
|
|
436
|
-
|
|
437
|
-
starting_at: string;
|
|
438
|
-
|
|
439
|
-
credits?: Array<Shared.Credit>;
|
|
440
|
-
|
|
441
|
-
/**
|
|
442
|
-
* This field's availability is dependent on your client's configuration.
|
|
443
|
-
*/
|
|
444
|
-
discounts?: Array<Shared.Discount>;
|
|
445
|
-
|
|
446
|
-
/**
|
|
447
|
-
* This field's availability is dependent on your client's configuration.
|
|
448
|
-
*/
|
|
449
|
-
netsuite_sales_order_id?: string;
|
|
450
|
-
|
|
451
|
-
/**
|
|
452
|
-
* This field's availability is dependent on your client's configuration.
|
|
453
|
-
*/
|
|
454
|
-
professional_services?: Array<Shared.ProService>;
|
|
455
|
-
|
|
456
|
-
/**
|
|
457
|
-
* This field's availability is dependent on your client's configuration.
|
|
458
|
-
*/
|
|
459
|
-
reseller_royalties?: Array<Amendment.ResellerRoyalty>;
|
|
460
|
-
|
|
461
|
-
/**
|
|
462
|
-
* This field's availability is dependent on your client's configuration.
|
|
463
|
-
*/
|
|
464
|
-
salesforce_opportunity_id?: string;
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
export namespace Amendment {
|
|
468
|
-
export interface ResellerRoyalty {
|
|
469
|
-
reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
|
|
470
|
-
|
|
471
|
-
aws_account_number?: string;
|
|
472
|
-
|
|
473
|
-
aws_offer_id?: string;
|
|
474
|
-
|
|
475
|
-
aws_payer_reference_id?: string;
|
|
476
|
-
|
|
477
|
-
ending_before?: string | null;
|
|
478
|
-
|
|
479
|
-
fraction?: number;
|
|
480
|
-
|
|
481
|
-
gcp_account_id?: string;
|
|
482
|
-
|
|
483
|
-
gcp_offer_id?: string;
|
|
484
|
-
|
|
485
|
-
netsuite_reseller_id?: string;
|
|
486
|
-
|
|
487
|
-
reseller_contract_value?: number;
|
|
488
|
-
|
|
489
|
-
starting_at?: string;
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
/**
|
|
494
|
-
* The billing provider configuration associated with a contract.
|
|
495
|
-
*/
|
|
496
|
-
export interface CustomerBillingProviderConfiguration {
|
|
497
|
-
billing_provider:
|
|
498
|
-
| 'aws_marketplace'
|
|
499
|
-
| 'stripe'
|
|
500
|
-
| 'netsuite'
|
|
501
|
-
| 'custom'
|
|
502
|
-
| 'azure_marketplace'
|
|
503
|
-
| 'quickbooks_online'
|
|
504
|
-
| 'workday'
|
|
505
|
-
| 'gcp_marketplace';
|
|
506
|
-
|
|
507
|
-
delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
|
|
508
|
-
|
|
509
|
-
id?: string;
|
|
510
|
-
|
|
511
|
-
/**
|
|
512
|
-
* Configuration for the billing provider. The structure of this object is specific
|
|
513
|
-
* to the billing provider.
|
|
514
|
-
*/
|
|
515
|
-
configuration?: { [key: string]: unknown };
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
export interface PrepaidBalanceThresholdConfiguration {
|
|
519
|
-
commit: PrepaidBalanceThresholdConfiguration.Commit;
|
|
520
|
-
|
|
521
|
-
/**
|
|
522
|
-
* When set to false, the contract will not be evaluated against the
|
|
523
|
-
* threshold_amount. Toggling to true will result an immediate evaluation,
|
|
524
|
-
* regardless of prior state.
|
|
525
|
-
*/
|
|
526
|
-
is_enabled: boolean;
|
|
527
|
-
|
|
528
|
-
payment_gate_config: PrepaidBalanceThresholdConfiguration.PaymentGateConfig;
|
|
529
|
-
|
|
530
|
-
/**
|
|
531
|
-
* Specify the amount the balance should be recharged to.
|
|
532
|
-
*/
|
|
533
|
-
recharge_to_amount: number;
|
|
534
|
-
|
|
535
|
-
/**
|
|
536
|
-
* Specify the threshold amount for the contract. Each time the contract's prepaid
|
|
537
|
-
* balance lowers to this amount, a threshold charge will be initiated.
|
|
538
|
-
*/
|
|
539
|
-
threshold_amount: number;
|
|
540
|
-
|
|
541
|
-
/**
|
|
542
|
-
* If provided, the threshold, recharge-to amount, and the resulting threshold
|
|
543
|
-
* commit amount will be in terms of this credit type instead of the fiat currency.
|
|
544
|
-
*/
|
|
545
|
-
custom_credit_type_id?: string;
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
export namespace PrepaidBalanceThresholdConfiguration {
|
|
549
|
-
export interface Commit {
|
|
550
|
-
/**
|
|
551
|
-
* The commit product that will be used to generate the line item for commit
|
|
552
|
-
* payment.
|
|
553
|
-
*/
|
|
554
|
-
product_id: string;
|
|
555
|
-
|
|
556
|
-
/**
|
|
557
|
-
* Which products the threshold commit applies to. If applicable_product_ids,
|
|
558
|
-
* applicable_product_tags or specifiers are not provided, the commit applies to
|
|
559
|
-
* all products.
|
|
560
|
-
*/
|
|
561
|
-
applicable_product_ids?: Array<string>;
|
|
562
|
-
|
|
563
|
-
/**
|
|
564
|
-
* Which tags the threshold commit applies to. If applicable_product_ids,
|
|
565
|
-
* applicable_product_tags or specifiers are not provided, the commit applies to
|
|
566
|
-
* all products.
|
|
567
|
-
*/
|
|
568
|
-
applicable_product_tags?: Array<string>;
|
|
569
|
-
|
|
570
|
-
description?: string;
|
|
571
|
-
|
|
572
|
-
/**
|
|
573
|
-
* Specify the name of the line item for the threshold charge. If left blank, it
|
|
574
|
-
* will default to the commit product name.
|
|
575
|
-
*/
|
|
576
|
-
name?: string;
|
|
577
|
-
|
|
578
|
-
/**
|
|
579
|
-
* List of filters that determine what kind of customer usage draws down a commit
|
|
580
|
-
* or credit. A customer's usage needs to meet the condition of at least one of the
|
|
581
|
-
* specifiers to contribute to a commit's or credit's drawdown. This field cannot
|
|
582
|
-
* be used together with `applicable_product_ids` or `applicable_product_tags`.
|
|
583
|
-
*/
|
|
584
|
-
specifiers?: Array<Commit.Specifier>;
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
export namespace Commit {
|
|
588
|
-
export interface Specifier {
|
|
589
|
-
presentation_group_values?: { [key: string]: string };
|
|
590
|
-
|
|
591
|
-
pricing_group_values?: { [key: string]: string };
|
|
592
|
-
|
|
593
|
-
/**
|
|
594
|
-
* If provided, the specifier will only apply to the product with the specified ID.
|
|
595
|
-
*/
|
|
596
|
-
product_id?: string;
|
|
597
|
-
|
|
598
|
-
/**
|
|
599
|
-
* If provided, the specifier will only apply to products with all the specified
|
|
600
|
-
* tags.
|
|
601
|
-
*/
|
|
602
|
-
product_tags?: Array<string>;
|
|
603
|
-
}
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
export interface PaymentGateConfig {
|
|
607
|
-
/**
|
|
608
|
-
* Gate access to the commit balance based on successful collection of payment.
|
|
609
|
-
* Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
|
|
610
|
-
* facilitate payment using your own payment integration. Select NONE if you do not
|
|
611
|
-
* wish to payment gate the commit balance.
|
|
612
|
-
*/
|
|
613
|
-
payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
|
|
614
|
-
|
|
615
|
-
/**
|
|
616
|
-
* Only applicable if using PRECALCULATED as your tax type.
|
|
617
|
-
*/
|
|
618
|
-
precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
|
|
619
|
-
|
|
620
|
-
/**
|
|
621
|
-
* Only applicable if using STRIPE as your payment gate type.
|
|
622
|
-
*/
|
|
623
|
-
stripe_config?: PaymentGateConfig.StripeConfig;
|
|
624
|
-
|
|
625
|
-
/**
|
|
626
|
-
* Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
|
|
627
|
-
* not wish Metronome to calculate tax on your behalf. Leaving this field blank
|
|
628
|
-
* will default to NONE.
|
|
629
|
-
*/
|
|
630
|
-
tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
export namespace PaymentGateConfig {
|
|
634
|
-
/**
|
|
635
|
-
* Only applicable if using PRECALCULATED as your tax type.
|
|
636
|
-
*/
|
|
637
|
-
export interface PrecalculatedTaxConfig {
|
|
638
|
-
/**
|
|
639
|
-
* Amount of tax to be applied. This should be in the same currency and
|
|
640
|
-
* denomination as the commit's invoice schedule
|
|
641
|
-
*/
|
|
642
|
-
tax_amount: number;
|
|
643
|
-
|
|
644
|
-
/**
|
|
645
|
-
* Name of the tax to be applied. This may be used in an invoice line item
|
|
646
|
-
* description.
|
|
647
|
-
*/
|
|
648
|
-
tax_name?: string;
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
/**
|
|
652
|
-
* Only applicable if using STRIPE as your payment gate type.
|
|
653
|
-
*/
|
|
654
|
-
export interface StripeConfig {
|
|
655
|
-
/**
|
|
656
|
-
* If left blank, will default to INVOICE
|
|
657
|
-
*/
|
|
658
|
-
payment_type: 'INVOICE' | 'PAYMENT_INTENT';
|
|
659
|
-
|
|
660
|
-
/**
|
|
661
|
-
* Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
|
|
662
|
-
* your payment type.
|
|
663
|
-
*/
|
|
664
|
-
invoice_metadata?: { [key: string]: string };
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
export interface SpendThresholdConfiguration {
|
|
670
|
-
commit: SpendThresholdConfiguration.Commit;
|
|
671
|
-
|
|
672
|
-
/**
|
|
673
|
-
* When set to false, the contract will not be evaluated against the
|
|
674
|
-
* threshold_amount. Toggling to true will result an immediate evaluation,
|
|
675
|
-
* regardless of prior state.
|
|
676
|
-
*/
|
|
677
|
-
is_enabled: boolean;
|
|
678
|
-
|
|
679
|
-
payment_gate_config: SpendThresholdConfiguration.PaymentGateConfig;
|
|
680
|
-
|
|
681
|
-
/**
|
|
682
|
-
* Specify the threshold amount for the contract. Each time the contract's usage
|
|
683
|
-
* hits this amount, a threshold charge will be initiated.
|
|
684
|
-
*/
|
|
685
|
-
threshold_amount: number;
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
export namespace SpendThresholdConfiguration {
|
|
689
|
-
export interface Commit {
|
|
690
|
-
/**
|
|
691
|
-
* The commit product that will be used to generate the line item for commit
|
|
692
|
-
* payment.
|
|
693
|
-
*/
|
|
694
|
-
product_id: string;
|
|
695
|
-
|
|
696
|
-
description?: string;
|
|
697
|
-
|
|
698
|
-
/**
|
|
699
|
-
* Specify the name of the line item for the threshold charge. If left blank, it
|
|
700
|
-
* will default to the commit product name.
|
|
701
|
-
*/
|
|
702
|
-
name?: string;
|
|
703
|
-
}
|
|
704
|
-
|
|
705
|
-
export interface PaymentGateConfig {
|
|
706
|
-
/**
|
|
707
|
-
* Gate access to the commit balance based on successful collection of payment.
|
|
708
|
-
* Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
|
|
709
|
-
* facilitate payment using your own payment integration. Select NONE if you do not
|
|
710
|
-
* wish to payment gate the commit balance.
|
|
711
|
-
*/
|
|
712
|
-
payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
|
|
713
|
-
|
|
714
|
-
/**
|
|
715
|
-
* Only applicable if using PRECALCULATED as your tax type.
|
|
716
|
-
*/
|
|
717
|
-
precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
|
|
718
|
-
|
|
719
|
-
/**
|
|
720
|
-
* Only applicable if using STRIPE as your payment gate type.
|
|
721
|
-
*/
|
|
722
|
-
stripe_config?: PaymentGateConfig.StripeConfig;
|
|
723
|
-
|
|
724
|
-
/**
|
|
725
|
-
* Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
|
|
726
|
-
* not wish Metronome to calculate tax on your behalf. Leaving this field blank
|
|
727
|
-
* will default to NONE.
|
|
728
|
-
*/
|
|
729
|
-
tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
|
|
730
|
-
}
|
|
731
|
-
|
|
732
|
-
export namespace PaymentGateConfig {
|
|
733
|
-
/**
|
|
734
|
-
* Only applicable if using PRECALCULATED as your tax type.
|
|
735
|
-
*/
|
|
736
|
-
export interface PrecalculatedTaxConfig {
|
|
737
|
-
/**
|
|
738
|
-
* Amount of tax to be applied. This should be in the same currency and
|
|
739
|
-
* denomination as the commit's invoice schedule
|
|
740
|
-
*/
|
|
741
|
-
tax_amount: number;
|
|
742
|
-
|
|
743
|
-
/**
|
|
744
|
-
* Name of the tax to be applied. This may be used in an invoice line item
|
|
745
|
-
* description.
|
|
746
|
-
*/
|
|
747
|
-
tax_name?: string;
|
|
748
|
-
}
|
|
749
|
-
|
|
750
|
-
/**
|
|
751
|
-
* Only applicable if using STRIPE as your payment gate type.
|
|
752
|
-
*/
|
|
753
|
-
export interface StripeConfig {
|
|
754
|
-
/**
|
|
755
|
-
* If left blank, will default to INVOICE
|
|
756
|
-
*/
|
|
757
|
-
payment_type: 'INVOICE' | 'PAYMENT_INTENT';
|
|
758
|
-
|
|
759
|
-
/**
|
|
760
|
-
* Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
|
|
761
|
-
* your payment type.
|
|
762
|
-
*/
|
|
763
|
-
invoice_metadata?: { [key: string]: string };
|
|
764
|
-
}
|
|
765
|
-
}
|
|
766
|
-
}
|
|
767
|
-
|
|
768
|
-
export interface Subscription {
|
|
769
|
-
collection_schedule: 'ADVANCE' | 'ARREARS';
|
|
770
|
-
|
|
771
|
-
proration: Subscription.Proration;
|
|
772
|
-
|
|
773
|
-
/**
|
|
774
|
-
* List of quantity schedule items for the subscription. Only includes the current
|
|
775
|
-
* quantity and future quantity changes.
|
|
776
|
-
*/
|
|
777
|
-
quantity_schedule: Array<Subscription.QuantitySchedule>;
|
|
778
|
-
|
|
779
|
-
starting_at: string;
|
|
780
|
-
|
|
781
|
-
subscription_rate: Subscription.SubscriptionRate;
|
|
782
|
-
|
|
783
|
-
id?: string;
|
|
784
|
-
|
|
785
|
-
custom_fields?: { [key: string]: string };
|
|
786
|
-
|
|
787
|
-
description?: string;
|
|
788
|
-
|
|
789
|
-
ending_before?: string;
|
|
790
|
-
|
|
791
|
-
fiat_credit_type_id?: string;
|
|
792
|
-
|
|
793
|
-
name?: string;
|
|
794
|
-
}
|
|
795
|
-
|
|
796
|
-
export namespace Subscription {
|
|
797
|
-
export interface Proration {
|
|
798
|
-
invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE';
|
|
799
|
-
|
|
800
|
-
is_prorated: boolean;
|
|
801
|
-
}
|
|
802
|
-
|
|
803
|
-
export interface QuantitySchedule {
|
|
804
|
-
quantity: number;
|
|
805
|
-
|
|
806
|
-
starting_at: string;
|
|
807
|
-
|
|
808
|
-
ending_before?: string;
|
|
809
|
-
}
|
|
810
|
-
|
|
811
|
-
export interface SubscriptionRate {
|
|
812
|
-
billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
813
|
-
|
|
814
|
-
product: SubscriptionRate.Product;
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
export namespace SubscriptionRate {
|
|
818
|
-
export interface Product {
|
|
819
|
-
id: string;
|
|
820
|
-
|
|
821
|
-
name: string;
|
|
822
|
-
}
|
|
823
|
-
}
|
|
824
|
-
}
|
|
825
|
-
}
|
|
826
|
-
}
|
|
827
|
-
|
|
828
|
-
export interface ContractListResponse {
|
|
829
|
-
data: Array<ContractListResponse.Data>;
|
|
830
|
-
}
|
|
831
|
-
|
|
832
|
-
export namespace ContractListResponse {
|
|
833
|
-
export interface Data {
|
|
834
|
-
id: string;
|
|
835
|
-
|
|
836
|
-
amendments: Array<Data.Amendment>;
|
|
837
|
-
|
|
838
|
-
current: Shared.ContractWithoutAmendments;
|
|
839
|
-
|
|
840
|
-
customer_id: string;
|
|
841
|
-
|
|
842
|
-
initial: Shared.ContractWithoutAmendments;
|
|
843
|
-
|
|
844
|
-
/**
|
|
845
|
-
* RFC 3339 timestamp indicating when the contract was archived. If not returned,
|
|
846
|
-
* the contract is not archived.
|
|
847
|
-
*/
|
|
848
|
-
archived_at?: string;
|
|
849
|
-
|
|
850
|
-
custom_fields?: { [key: string]: string };
|
|
851
|
-
|
|
852
|
-
/**
|
|
853
|
-
* The billing provider configuration associated with a contract.
|
|
854
|
-
*/
|
|
855
|
-
customer_billing_provider_configuration?: Data.CustomerBillingProviderConfiguration;
|
|
856
|
-
|
|
857
|
-
prepaid_balance_threshold_configuration?: Data.PrepaidBalanceThresholdConfiguration;
|
|
858
|
-
|
|
859
|
-
/**
|
|
860
|
-
* Priority of the contract.
|
|
861
|
-
*/
|
|
862
|
-
priority?: number;
|
|
863
|
-
|
|
864
|
-
/**
|
|
865
|
-
* Determines which scheduled and commit charges to consolidate onto the Contract's
|
|
866
|
-
* usage invoice. The charge's `timestamp` must match the usage invoice's
|
|
867
|
-
* `ending_before` date for consolidation to occur. This field cannot be modified
|
|
868
|
-
* after a Contract has been created. If this field is omitted, charges will appear
|
|
869
|
-
* on a separate invoice from usage charges.
|
|
870
|
-
*/
|
|
871
|
-
scheduled_charges_on_usage_invoices?: 'ALL';
|
|
872
|
-
|
|
873
|
-
spend_threshold_configuration?: Data.SpendThresholdConfiguration;
|
|
874
|
-
|
|
875
|
-
/**
|
|
876
|
-
* List of subscriptions on the contract.
|
|
877
|
-
*/
|
|
878
|
-
subscriptions?: Array<Data.Subscription>;
|
|
879
|
-
|
|
880
|
-
/**
|
|
881
|
-
* Prevents the creation of duplicates. If a request to create a record is made
|
|
882
|
-
* with a previously used uniqueness key, a new record will not be created and the
|
|
883
|
-
* request will fail with a 409 error.
|
|
884
|
-
*/
|
|
885
|
-
uniqueness_key?: string;
|
|
886
|
-
}
|
|
887
|
-
|
|
888
|
-
export namespace Data {
|
|
889
|
-
export interface Amendment {
|
|
890
|
-
id: string;
|
|
891
|
-
|
|
892
|
-
commits: Array<Shared.Commit>;
|
|
893
|
-
|
|
894
|
-
created_at: string;
|
|
895
|
-
|
|
896
|
-
created_by: string;
|
|
897
|
-
|
|
898
|
-
overrides: Array<Shared.Override>;
|
|
899
|
-
|
|
900
|
-
scheduled_charges: Array<Shared.ScheduledCharge>;
|
|
901
|
-
|
|
902
|
-
starting_at: string;
|
|
903
|
-
|
|
904
|
-
credits?: Array<Shared.Credit>;
|
|
905
|
-
|
|
906
|
-
/**
|
|
907
|
-
* This field's availability is dependent on your client's configuration.
|
|
908
|
-
*/
|
|
909
|
-
discounts?: Array<Shared.Discount>;
|
|
910
|
-
|
|
911
|
-
/**
|
|
912
|
-
* This field's availability is dependent on your client's configuration.
|
|
913
|
-
*/
|
|
914
|
-
netsuite_sales_order_id?: string;
|
|
915
|
-
|
|
916
|
-
/**
|
|
917
|
-
* This field's availability is dependent on your client's configuration.
|
|
918
|
-
*/
|
|
919
|
-
professional_services?: Array<Shared.ProService>;
|
|
920
|
-
|
|
921
|
-
/**
|
|
922
|
-
* This field's availability is dependent on your client's configuration.
|
|
923
|
-
*/
|
|
924
|
-
reseller_royalties?: Array<Amendment.ResellerRoyalty>;
|
|
925
|
-
|
|
926
|
-
/**
|
|
927
|
-
* This field's availability is dependent on your client's configuration.
|
|
928
|
-
*/
|
|
929
|
-
salesforce_opportunity_id?: string;
|
|
930
|
-
}
|
|
931
|
-
|
|
932
|
-
export namespace Amendment {
|
|
933
|
-
export interface ResellerRoyalty {
|
|
934
|
-
reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
|
|
935
|
-
|
|
936
|
-
aws_account_number?: string;
|
|
937
|
-
|
|
938
|
-
aws_offer_id?: string;
|
|
939
|
-
|
|
940
|
-
aws_payer_reference_id?: string;
|
|
941
|
-
|
|
942
|
-
ending_before?: string | null;
|
|
943
|
-
|
|
944
|
-
fraction?: number;
|
|
945
|
-
|
|
946
|
-
gcp_account_id?: string;
|
|
947
|
-
|
|
948
|
-
gcp_offer_id?: string;
|
|
949
|
-
|
|
950
|
-
netsuite_reseller_id?: string;
|
|
951
|
-
|
|
952
|
-
reseller_contract_value?: number;
|
|
953
|
-
|
|
954
|
-
starting_at?: string;
|
|
955
|
-
}
|
|
956
|
-
}
|
|
957
|
-
|
|
958
|
-
/**
|
|
959
|
-
* The billing provider configuration associated with a contract.
|
|
960
|
-
*/
|
|
961
|
-
export interface CustomerBillingProviderConfiguration {
|
|
962
|
-
billing_provider:
|
|
963
|
-
| 'aws_marketplace'
|
|
964
|
-
| 'stripe'
|
|
965
|
-
| 'netsuite'
|
|
966
|
-
| 'custom'
|
|
967
|
-
| 'azure_marketplace'
|
|
968
|
-
| 'quickbooks_online'
|
|
969
|
-
| 'workday'
|
|
970
|
-
| 'gcp_marketplace';
|
|
971
|
-
|
|
972
|
-
delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
|
|
973
|
-
|
|
974
|
-
id?: string;
|
|
975
|
-
|
|
976
|
-
/**
|
|
977
|
-
* Configuration for the billing provider. The structure of this object is specific
|
|
978
|
-
* to the billing provider.
|
|
979
|
-
*/
|
|
980
|
-
configuration?: { [key: string]: unknown };
|
|
981
|
-
}
|
|
982
|
-
|
|
983
|
-
export interface PrepaidBalanceThresholdConfiguration {
|
|
984
|
-
commit: PrepaidBalanceThresholdConfiguration.Commit;
|
|
985
|
-
|
|
986
|
-
/**
|
|
987
|
-
* When set to false, the contract will not be evaluated against the
|
|
988
|
-
* threshold_amount. Toggling to true will result an immediate evaluation,
|
|
989
|
-
* regardless of prior state.
|
|
990
|
-
*/
|
|
991
|
-
is_enabled: boolean;
|
|
992
|
-
|
|
993
|
-
payment_gate_config: PrepaidBalanceThresholdConfiguration.PaymentGateConfig;
|
|
994
|
-
|
|
995
|
-
/**
|
|
996
|
-
* Specify the amount the balance should be recharged to.
|
|
997
|
-
*/
|
|
998
|
-
recharge_to_amount: number;
|
|
999
|
-
|
|
1000
|
-
/**
|
|
1001
|
-
* Specify the threshold amount for the contract. Each time the contract's prepaid
|
|
1002
|
-
* balance lowers to this amount, a threshold charge will be initiated.
|
|
1003
|
-
*/
|
|
1004
|
-
threshold_amount: number;
|
|
1005
|
-
|
|
1006
|
-
/**
|
|
1007
|
-
* If provided, the threshold, recharge-to amount, and the resulting threshold
|
|
1008
|
-
* commit amount will be in terms of this credit type instead of the fiat currency.
|
|
1009
|
-
*/
|
|
1010
|
-
custom_credit_type_id?: string;
|
|
1011
|
-
}
|
|
1012
|
-
|
|
1013
|
-
export namespace PrepaidBalanceThresholdConfiguration {
|
|
1014
|
-
export interface Commit {
|
|
1015
|
-
/**
|
|
1016
|
-
* The commit product that will be used to generate the line item for commit
|
|
1017
|
-
* payment.
|
|
1018
|
-
*/
|
|
1019
|
-
product_id: string;
|
|
1020
|
-
|
|
1021
|
-
/**
|
|
1022
|
-
* Which products the threshold commit applies to. If applicable_product_ids,
|
|
1023
|
-
* applicable_product_tags or specifiers are not provided, the commit applies to
|
|
1024
|
-
* all products.
|
|
1025
|
-
*/
|
|
1026
|
-
applicable_product_ids?: Array<string>;
|
|
1027
|
-
|
|
1028
|
-
/**
|
|
1029
|
-
* Which tags the threshold commit applies to. If applicable_product_ids,
|
|
1030
|
-
* applicable_product_tags or specifiers are not provided, the commit applies to
|
|
1031
|
-
* all products.
|
|
1032
|
-
*/
|
|
1033
|
-
applicable_product_tags?: Array<string>;
|
|
1034
|
-
|
|
1035
|
-
description?: string;
|
|
1036
|
-
|
|
1037
|
-
/**
|
|
1038
|
-
* Specify the name of the line item for the threshold charge. If left blank, it
|
|
1039
|
-
* will default to the commit product name.
|
|
1040
|
-
*/
|
|
1041
|
-
name?: string;
|
|
1042
|
-
|
|
1043
|
-
/**
|
|
1044
|
-
* List of filters that determine what kind of customer usage draws down a commit
|
|
1045
|
-
* or credit. A customer's usage needs to meet the condition of at least one of the
|
|
1046
|
-
* specifiers to contribute to a commit's or credit's drawdown. This field cannot
|
|
1047
|
-
* be used together with `applicable_product_ids` or `applicable_product_tags`.
|
|
1048
|
-
*/
|
|
1049
|
-
specifiers?: Array<Commit.Specifier>;
|
|
1050
|
-
}
|
|
1051
|
-
|
|
1052
|
-
export namespace Commit {
|
|
1053
|
-
export interface Specifier {
|
|
1054
|
-
presentation_group_values?: { [key: string]: string };
|
|
1055
|
-
|
|
1056
|
-
pricing_group_values?: { [key: string]: string };
|
|
1057
|
-
|
|
1058
|
-
/**
|
|
1059
|
-
* If provided, the specifier will only apply to the product with the specified ID.
|
|
1060
|
-
*/
|
|
1061
|
-
product_id?: string;
|
|
1062
|
-
|
|
1063
|
-
/**
|
|
1064
|
-
* If provided, the specifier will only apply to products with all the specified
|
|
1065
|
-
* tags.
|
|
1066
|
-
*/
|
|
1067
|
-
product_tags?: Array<string>;
|
|
1068
|
-
}
|
|
1069
|
-
}
|
|
1070
|
-
|
|
1071
|
-
export interface PaymentGateConfig {
|
|
1072
|
-
/**
|
|
1073
|
-
* Gate access to the commit balance based on successful collection of payment.
|
|
1074
|
-
* Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
|
|
1075
|
-
* facilitate payment using your own payment integration. Select NONE if you do not
|
|
1076
|
-
* wish to payment gate the commit balance.
|
|
1077
|
-
*/
|
|
1078
|
-
payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
|
|
1079
|
-
|
|
1080
|
-
/**
|
|
1081
|
-
* Only applicable if using PRECALCULATED as your tax type.
|
|
1082
|
-
*/
|
|
1083
|
-
precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
|
|
1084
|
-
|
|
1085
|
-
/**
|
|
1086
|
-
* Only applicable if using STRIPE as your payment gate type.
|
|
1087
|
-
*/
|
|
1088
|
-
stripe_config?: PaymentGateConfig.StripeConfig;
|
|
1089
|
-
|
|
1090
|
-
/**
|
|
1091
|
-
* Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
|
|
1092
|
-
* not wish Metronome to calculate tax on your behalf. Leaving this field blank
|
|
1093
|
-
* will default to NONE.
|
|
1094
|
-
*/
|
|
1095
|
-
tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
|
|
1096
|
-
}
|
|
1097
|
-
|
|
1098
|
-
export namespace PaymentGateConfig {
|
|
1099
|
-
/**
|
|
1100
|
-
* Only applicable if using PRECALCULATED as your tax type.
|
|
1101
|
-
*/
|
|
1102
|
-
export interface PrecalculatedTaxConfig {
|
|
1103
|
-
/**
|
|
1104
|
-
* Amount of tax to be applied. This should be in the same currency and
|
|
1105
|
-
* denomination as the commit's invoice schedule
|
|
1106
|
-
*/
|
|
1107
|
-
tax_amount: number;
|
|
1108
|
-
|
|
1109
|
-
/**
|
|
1110
|
-
* Name of the tax to be applied. This may be used in an invoice line item
|
|
1111
|
-
* description.
|
|
1112
|
-
*/
|
|
1113
|
-
tax_name?: string;
|
|
1114
|
-
}
|
|
1115
|
-
|
|
1116
|
-
/**
|
|
1117
|
-
* Only applicable if using STRIPE as your payment gate type.
|
|
1118
|
-
*/
|
|
1119
|
-
export interface StripeConfig {
|
|
1120
|
-
/**
|
|
1121
|
-
* If left blank, will default to INVOICE
|
|
1122
|
-
*/
|
|
1123
|
-
payment_type: 'INVOICE' | 'PAYMENT_INTENT';
|
|
1124
|
-
|
|
1125
|
-
/**
|
|
1126
|
-
* Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
|
|
1127
|
-
* your payment type.
|
|
1128
|
-
*/
|
|
1129
|
-
invoice_metadata?: { [key: string]: string };
|
|
1130
|
-
}
|
|
1131
|
-
}
|
|
1132
|
-
}
|
|
1133
|
-
|
|
1134
|
-
export interface SpendThresholdConfiguration {
|
|
1135
|
-
commit: SpendThresholdConfiguration.Commit;
|
|
1136
|
-
|
|
1137
|
-
/**
|
|
1138
|
-
* When set to false, the contract will not be evaluated against the
|
|
1139
|
-
* threshold_amount. Toggling to true will result an immediate evaluation,
|
|
1140
|
-
* regardless of prior state.
|
|
1141
|
-
*/
|
|
1142
|
-
is_enabled: boolean;
|
|
1143
|
-
|
|
1144
|
-
payment_gate_config: SpendThresholdConfiguration.PaymentGateConfig;
|
|
1145
|
-
|
|
1146
|
-
/**
|
|
1147
|
-
* Specify the threshold amount for the contract. Each time the contract's usage
|
|
1148
|
-
* hits this amount, a threshold charge will be initiated.
|
|
1149
|
-
*/
|
|
1150
|
-
threshold_amount: number;
|
|
1151
|
-
}
|
|
1152
|
-
|
|
1153
|
-
export namespace SpendThresholdConfiguration {
|
|
1154
|
-
export interface Commit {
|
|
1155
|
-
/**
|
|
1156
|
-
* The commit product that will be used to generate the line item for commit
|
|
1157
|
-
* payment.
|
|
1158
|
-
*/
|
|
1159
|
-
product_id: string;
|
|
1160
|
-
|
|
1161
|
-
description?: string;
|
|
1162
|
-
|
|
1163
|
-
/**
|
|
1164
|
-
* Specify the name of the line item for the threshold charge. If left blank, it
|
|
1165
|
-
* will default to the commit product name.
|
|
1166
|
-
*/
|
|
1167
|
-
name?: string;
|
|
1168
|
-
}
|
|
1169
|
-
|
|
1170
|
-
export interface PaymentGateConfig {
|
|
1171
|
-
/**
|
|
1172
|
-
* Gate access to the commit balance based on successful collection of payment.
|
|
1173
|
-
* Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
|
|
1174
|
-
* facilitate payment using your own payment integration. Select NONE if you do not
|
|
1175
|
-
* wish to payment gate the commit balance.
|
|
1176
|
-
*/
|
|
1177
|
-
payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
|
|
1178
|
-
|
|
1179
|
-
/**
|
|
1180
|
-
* Only applicable if using PRECALCULATED as your tax type.
|
|
1181
|
-
*/
|
|
1182
|
-
precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
|
|
1183
|
-
|
|
1184
|
-
/**
|
|
1185
|
-
* Only applicable if using STRIPE as your payment gate type.
|
|
1186
|
-
*/
|
|
1187
|
-
stripe_config?: PaymentGateConfig.StripeConfig;
|
|
1188
|
-
|
|
1189
|
-
/**
|
|
1190
|
-
* Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
|
|
1191
|
-
* not wish Metronome to calculate tax on your behalf. Leaving this field blank
|
|
1192
|
-
* will default to NONE.
|
|
1193
|
-
*/
|
|
1194
|
-
tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
|
|
1195
|
-
}
|
|
1196
|
-
|
|
1197
|
-
export namespace PaymentGateConfig {
|
|
1198
|
-
/**
|
|
1199
|
-
* Only applicable if using PRECALCULATED as your tax type.
|
|
1200
|
-
*/
|
|
1201
|
-
export interface PrecalculatedTaxConfig {
|
|
1202
|
-
/**
|
|
1203
|
-
* Amount of tax to be applied. This should be in the same currency and
|
|
1204
|
-
* denomination as the commit's invoice schedule
|
|
1205
|
-
*/
|
|
1206
|
-
tax_amount: number;
|
|
1207
|
-
|
|
1208
|
-
/**
|
|
1209
|
-
* Name of the tax to be applied. This may be used in an invoice line item
|
|
1210
|
-
* description.
|
|
1211
|
-
*/
|
|
1212
|
-
tax_name?: string;
|
|
1213
|
-
}
|
|
1214
|
-
|
|
1215
|
-
/**
|
|
1216
|
-
* Only applicable if using STRIPE as your payment gate type.
|
|
1217
|
-
*/
|
|
1218
|
-
export interface StripeConfig {
|
|
1219
|
-
/**
|
|
1220
|
-
* If left blank, will default to INVOICE
|
|
1221
|
-
*/
|
|
1222
|
-
payment_type: 'INVOICE' | 'PAYMENT_INTENT';
|
|
1223
|
-
|
|
1224
|
-
/**
|
|
1225
|
-
* Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
|
|
1226
|
-
* your payment type.
|
|
1227
|
-
*/
|
|
1228
|
-
invoice_metadata?: { [key: string]: string };
|
|
1229
|
-
}
|
|
1230
|
-
}
|
|
1231
|
-
}
|
|
1232
|
-
|
|
1233
|
-
export interface Subscription {
|
|
1234
|
-
collection_schedule: 'ADVANCE' | 'ARREARS';
|
|
1235
|
-
|
|
1236
|
-
proration: Subscription.Proration;
|
|
1237
|
-
|
|
1238
|
-
/**
|
|
1239
|
-
* List of quantity schedule items for the subscription. Only includes the current
|
|
1240
|
-
* quantity and future quantity changes.
|
|
1241
|
-
*/
|
|
1242
|
-
quantity_schedule: Array<Subscription.QuantitySchedule>;
|
|
1243
|
-
|
|
1244
|
-
starting_at: string;
|
|
1245
|
-
|
|
1246
|
-
subscription_rate: Subscription.SubscriptionRate;
|
|
1247
|
-
|
|
1248
|
-
id?: string;
|
|
1249
|
-
|
|
1250
|
-
custom_fields?: { [key: string]: string };
|
|
1251
|
-
|
|
1252
|
-
description?: string;
|
|
1253
|
-
|
|
1254
|
-
ending_before?: string;
|
|
1255
|
-
|
|
1256
|
-
fiat_credit_type_id?: string;
|
|
1257
|
-
|
|
1258
|
-
name?: string;
|
|
1259
|
-
}
|
|
1260
|
-
|
|
1261
|
-
export namespace Subscription {
|
|
1262
|
-
export interface Proration {
|
|
1263
|
-
invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE';
|
|
1264
|
-
|
|
1265
|
-
is_prorated: boolean;
|
|
1266
|
-
}
|
|
1267
|
-
|
|
1268
|
-
export interface QuantitySchedule {
|
|
1269
|
-
quantity: number;
|
|
522
|
+
* {
|
|
523
|
+
* professional_service_id:
|
|
524
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
525
|
+
* },
|
|
526
|
+
* ],
|
|
527
|
+
* });
|
|
528
|
+
* ```
|
|
529
|
+
*/
|
|
530
|
+
scheduleProServicesInvoice(
|
|
531
|
+
body: ContractScheduleProServicesInvoiceParams,
|
|
532
|
+
options?: RequestOptions,
|
|
533
|
+
): APIPromise<ContractScheduleProServicesInvoiceResponse> {
|
|
534
|
+
return this._client.post('/v1/contracts/scheduleProServicesInvoice', { body, ...options });
|
|
535
|
+
}
|
|
1270
536
|
|
|
1271
|
-
|
|
537
|
+
/**
|
|
538
|
+
* If a customer has multiple contracts with overlapping rates, the usage filter
|
|
539
|
+
* routes usage to the appropriate contract based on a predefined group key.
|
|
540
|
+
*
|
|
541
|
+
* As an example, imagine you have a customer associated with two projects. Each
|
|
542
|
+
* project is associated with its own contract. You can create a usage filter with
|
|
543
|
+
* group key `project_id` on each contract, and route usage for `project_1` to the
|
|
544
|
+
* first contract and `project_2` to the second contract.
|
|
545
|
+
*
|
|
546
|
+
* ### Use this endpoint to:
|
|
547
|
+
*
|
|
548
|
+
* - Support enterprise contracting scenarios where multiple contracts are
|
|
549
|
+
* associated to the same customer with the same rates.
|
|
550
|
+
* - Update the usage filter associated with the contract over time.
|
|
551
|
+
*
|
|
552
|
+
* ### Usage guidelines:
|
|
553
|
+
*
|
|
554
|
+
* To use usage filters, the `group_key` must be defined on the billable metrics
|
|
555
|
+
* underlying the rate card on the contracts.
|
|
556
|
+
*
|
|
557
|
+
* @example
|
|
558
|
+
* ```ts
|
|
559
|
+
* await client.v1.contracts.setUsageFilter({
|
|
560
|
+
* contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
561
|
+
* customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
|
|
562
|
+
* group_key: 'business_subscription_id',
|
|
563
|
+
* group_values: ['ID-1', 'ID-2'],
|
|
564
|
+
* starting_at: '2020-01-01T00:00:00.000Z',
|
|
565
|
+
* });
|
|
566
|
+
* ```
|
|
567
|
+
*/
|
|
568
|
+
setUsageFilter(body: ContractSetUsageFilterParams, options?: RequestOptions): APIPromise<void> {
|
|
569
|
+
return this._client.post('/v1/contracts/setUsageFilter', {
|
|
570
|
+
body,
|
|
571
|
+
...options,
|
|
572
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
573
|
+
});
|
|
574
|
+
}
|
|
1272
575
|
|
|
1273
|
-
|
|
1274
|
-
|
|
576
|
+
/**
|
|
577
|
+
* Update or add an end date to a contract. Ending a contract early will impact
|
|
578
|
+
* draft usage statements, truncate any terms, and remove upcoming scheduled
|
|
579
|
+
* invoices. Moving the date into the future will only extend the contract length.
|
|
580
|
+
* Terms and scheduled invoices are not extended. In-advance subscriptions will not
|
|
581
|
+
* be extended. Use this if a contract's end date has changed or if a perpetual
|
|
582
|
+
* contract ends.
|
|
583
|
+
*
|
|
584
|
+
* @example
|
|
585
|
+
* ```ts
|
|
586
|
+
* const response = await client.v1.contracts.updateEndDate({
|
|
587
|
+
* contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
588
|
+
* customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
|
|
589
|
+
* ending_before: '2020-01-01T00:00:00.000Z',
|
|
590
|
+
* });
|
|
591
|
+
* ```
|
|
592
|
+
*/
|
|
593
|
+
updateEndDate(
|
|
594
|
+
body: ContractUpdateEndDateParams,
|
|
595
|
+
options?: RequestOptions,
|
|
596
|
+
): APIPromise<ContractUpdateEndDateResponse> {
|
|
597
|
+
return this._client.post('/v1/contracts/updateEndDate', { body, ...options });
|
|
598
|
+
}
|
|
599
|
+
}
|
|
1275
600
|
|
|
1276
|
-
|
|
1277
|
-
billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
601
|
+
export type ContractListBalancesResponsesBodyCursorPage = BodyCursorPage<ContractListBalancesResponse>;
|
|
1278
602
|
|
|
1279
|
-
|
|
1280
|
-
|
|
603
|
+
export interface ContractCreateResponse {
|
|
604
|
+
data: Shared.ID;
|
|
605
|
+
}
|
|
1281
606
|
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
607
|
+
export interface ContractRetrieveResponse {
|
|
608
|
+
data: Shared.Contract;
|
|
609
|
+
}
|
|
1285
610
|
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
}
|
|
1289
|
-
}
|
|
1290
|
-
}
|
|
611
|
+
export interface ContractListResponse {
|
|
612
|
+
data: Array<Shared.Contract>;
|
|
1291
613
|
}
|
|
1292
614
|
|
|
1293
615
|
export interface ContractAmendResponse {
|
|
@@ -1302,11 +624,7 @@ export interface ContractCreateHistoricalInvoicesResponse {
|
|
|
1302
624
|
data: Array<InvoicesAPI.Invoice>;
|
|
1303
625
|
}
|
|
1304
626
|
|
|
1305
|
-
export
|
|
1306
|
-
data: Array<Shared.Commit | Shared.Credit>;
|
|
1307
|
-
|
|
1308
|
-
next_page: string | null;
|
|
1309
|
-
}
|
|
627
|
+
export type ContractListBalancesResponse = Shared.Commit | Shared.Credit;
|
|
1310
628
|
|
|
1311
629
|
export interface ContractRetrieveRateScheduleResponse {
|
|
1312
630
|
data: Array<ContractRetrieveRateScheduleResponse.Data>;
|
|
@@ -1320,6 +638,9 @@ export namespace ContractRetrieveRateScheduleResponse {
|
|
|
1320
638
|
|
|
1321
639
|
list_rate: Shared.Rate;
|
|
1322
640
|
|
|
641
|
+
/**
|
|
642
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
643
|
+
*/
|
|
1323
644
|
product_custom_fields: { [key: string]: string };
|
|
1324
645
|
|
|
1325
646
|
product_id: string;
|
|
@@ -1338,7 +659,7 @@ export namespace ContractRetrieveRateScheduleResponse {
|
|
|
1338
659
|
* A distinct rate on the rate card. You can choose to use this rate rather than
|
|
1339
660
|
* list rate when consuming a credit or commit.
|
|
1340
661
|
*/
|
|
1341
|
-
commit_rate?:
|
|
662
|
+
commit_rate?: Shared.CommitRate;
|
|
1342
663
|
|
|
1343
664
|
ending_before?: string;
|
|
1344
665
|
|
|
@@ -1346,26 +667,6 @@ export namespace ContractRetrieveRateScheduleResponse {
|
|
|
1346
667
|
|
|
1347
668
|
pricing_group_values?: { [key: string]: string };
|
|
1348
669
|
}
|
|
1349
|
-
|
|
1350
|
-
export namespace Data {
|
|
1351
|
-
/**
|
|
1352
|
-
* A distinct rate on the rate card. You can choose to use this rate rather than
|
|
1353
|
-
* list rate when consuming a credit or commit.
|
|
1354
|
-
*/
|
|
1355
|
-
export interface CommitRate {
|
|
1356
|
-
rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
|
|
1357
|
-
|
|
1358
|
-
/**
|
|
1359
|
-
* Commit rate price. For FLAT rate_type, this must be >=0.
|
|
1360
|
-
*/
|
|
1361
|
-
price?: number;
|
|
1362
|
-
|
|
1363
|
-
/**
|
|
1364
|
-
* Only set for TIERED rate_type.
|
|
1365
|
-
*/
|
|
1366
|
-
tiers?: Array<Shared.Tier>;
|
|
1367
|
-
}
|
|
1368
|
-
}
|
|
1369
670
|
}
|
|
1370
671
|
|
|
1371
672
|
export interface ContractRetrieveSubscriptionQuantityHistoryResponse {
|
|
@@ -1426,6 +727,9 @@ export interface ContractCreateParams {
|
|
|
1426
727
|
|
|
1427
728
|
credits?: Array<ContractCreateParams.Credit>;
|
|
1428
729
|
|
|
730
|
+
/**
|
|
731
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
732
|
+
*/
|
|
1429
733
|
custom_fields?: { [key: string]: string };
|
|
1430
734
|
|
|
1431
735
|
/**
|
|
@@ -1459,7 +763,7 @@ export interface ContractCreateParams {
|
|
|
1459
763
|
|
|
1460
764
|
overrides?: Array<ContractCreateParams.Override>;
|
|
1461
765
|
|
|
1462
|
-
prepaid_balance_threshold_configuration?:
|
|
766
|
+
prepaid_balance_threshold_configuration?: Shared.PrepaidBalanceThresholdConfiguration;
|
|
1463
767
|
|
|
1464
768
|
/**
|
|
1465
769
|
* Priority of the contract.
|
|
@@ -1504,7 +808,7 @@ export interface ContractCreateParams {
|
|
|
1504
808
|
*/
|
|
1505
809
|
scheduled_charges_on_usage_invoices?: 'ALL';
|
|
1506
810
|
|
|
1507
|
-
spend_threshold_configuration?:
|
|
811
|
+
spend_threshold_configuration?: Shared.SpendThresholdConfiguration;
|
|
1508
812
|
|
|
1509
813
|
/**
|
|
1510
814
|
* Optional list of
|
|
@@ -1587,6 +891,9 @@ export namespace ContractCreateParams {
|
|
|
1587
891
|
*/
|
|
1588
892
|
applicable_product_tags?: Array<string>;
|
|
1589
893
|
|
|
894
|
+
/**
|
|
895
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
896
|
+
*/
|
|
1590
897
|
custom_fields?: { [key: string]: string };
|
|
1591
898
|
|
|
1592
899
|
/**
|
|
@@ -1597,7 +904,7 @@ export namespace ContractCreateParams {
|
|
|
1597
904
|
/**
|
|
1598
905
|
* Optional configuration for commit hierarchy access control
|
|
1599
906
|
*/
|
|
1600
|
-
hierarchy_configuration?:
|
|
907
|
+
hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
|
|
1601
908
|
|
|
1602
909
|
/**
|
|
1603
910
|
* Required for "POSTPAID" commits: the true up invoice will be generated at this
|
|
@@ -1641,7 +948,7 @@ export namespace ContractCreateParams {
|
|
|
1641
948
|
* specifiers to contribute to a commit's or credit's drawdown. This field cannot
|
|
1642
949
|
* be used together with `applicable_product_ids` or `applicable_product_tags`.
|
|
1643
950
|
*/
|
|
1644
|
-
specifiers?: Array<
|
|
951
|
+
specifiers?: Array<Shared.CommitSpecifierInput>;
|
|
1645
952
|
|
|
1646
953
|
/**
|
|
1647
954
|
* A temporary ID for the commit that can be used to reference the commit for
|
|
@@ -1681,32 +988,6 @@ export namespace ContractCreateParams {
|
|
|
1681
988
|
}
|
|
1682
989
|
}
|
|
1683
990
|
|
|
1684
|
-
/**
|
|
1685
|
-
* Optional configuration for commit hierarchy access control
|
|
1686
|
-
*/
|
|
1687
|
-
export interface HierarchyConfiguration {
|
|
1688
|
-
child_access:
|
|
1689
|
-
| HierarchyConfiguration.CommitHierarchyChildAccessAll
|
|
1690
|
-
| HierarchyConfiguration.CommitHierarchyChildAccessNone
|
|
1691
|
-
| HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
|
|
1692
|
-
}
|
|
1693
|
-
|
|
1694
|
-
export namespace HierarchyConfiguration {
|
|
1695
|
-
export interface CommitHierarchyChildAccessAll {
|
|
1696
|
-
type: 'ALL';
|
|
1697
|
-
}
|
|
1698
|
-
|
|
1699
|
-
export interface CommitHierarchyChildAccessNone {
|
|
1700
|
-
type: 'NONE';
|
|
1701
|
-
}
|
|
1702
|
-
|
|
1703
|
-
export interface CommitHierarchyChildAccessContractIDs {
|
|
1704
|
-
contract_ids: Array<string>;
|
|
1705
|
-
|
|
1706
|
-
type: 'CONTRACT_IDS';
|
|
1707
|
-
}
|
|
1708
|
-
}
|
|
1709
|
-
|
|
1710
991
|
/**
|
|
1711
992
|
* Required for "POSTPAID" commits: the true up invoice will be generated at this
|
|
1712
993
|
* time and only one schedule item is allowed; the total must match access_schedule
|
|
@@ -1837,7 +1118,7 @@ export namespace ContractCreateParams {
|
|
|
1837
1118
|
* not wish Metronome to calculate tax on your behalf. Leaving this field blank
|
|
1838
1119
|
* will default to NONE.
|
|
1839
1120
|
*/
|
|
1840
|
-
tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
|
|
1121
|
+
tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'AVALARA' | 'PRECALCULATED';
|
|
1841
1122
|
}
|
|
1842
1123
|
|
|
1843
1124
|
export namespace PaymentGateConfig {
|
|
@@ -1886,23 +1167,6 @@ export namespace ContractCreateParams {
|
|
|
1886
1167
|
on_session_payment?: boolean;
|
|
1887
1168
|
}
|
|
1888
1169
|
}
|
|
1889
|
-
|
|
1890
|
-
export interface Specifier {
|
|
1891
|
-
presentation_group_values?: { [key: string]: string };
|
|
1892
|
-
|
|
1893
|
-
pricing_group_values?: { [key: string]: string };
|
|
1894
|
-
|
|
1895
|
-
/**
|
|
1896
|
-
* If provided, the specifier will only apply to the product with the specified ID.
|
|
1897
|
-
*/
|
|
1898
|
-
product_id?: string;
|
|
1899
|
-
|
|
1900
|
-
/**
|
|
1901
|
-
* If provided, the specifier will only apply to products with all the specified
|
|
1902
|
-
* tags.
|
|
1903
|
-
*/
|
|
1904
|
-
product_tags?: Array<string>;
|
|
1905
|
-
}
|
|
1906
1170
|
}
|
|
1907
1171
|
|
|
1908
1172
|
export interface Credit {
|
|
@@ -1925,6 +1189,9 @@ export namespace ContractCreateParams {
|
|
|
1925
1189
|
*/
|
|
1926
1190
|
applicable_product_tags?: Array<string>;
|
|
1927
1191
|
|
|
1192
|
+
/**
|
|
1193
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
1194
|
+
*/
|
|
1928
1195
|
custom_fields?: { [key: string]: string };
|
|
1929
1196
|
|
|
1930
1197
|
/**
|
|
@@ -1935,7 +1202,7 @@ export namespace ContractCreateParams {
|
|
|
1935
1202
|
/**
|
|
1936
1203
|
* Optional configuration for credit hierarchy access control
|
|
1937
1204
|
*/
|
|
1938
|
-
hierarchy_configuration?:
|
|
1205
|
+
hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
|
|
1939
1206
|
|
|
1940
1207
|
/**
|
|
1941
1208
|
* displayed on invoices
|
|
@@ -1961,7 +1228,7 @@ export namespace ContractCreateParams {
|
|
|
1961
1228
|
* specifiers to contribute to a commit's or credit's drawdown. This field cannot
|
|
1962
1229
|
* be used together with `applicable_product_ids` or `applicable_product_tags`.
|
|
1963
1230
|
*/
|
|
1964
|
-
specifiers?: Array<
|
|
1231
|
+
specifiers?: Array<Shared.CommitSpecifierInput>;
|
|
1965
1232
|
}
|
|
1966
1233
|
|
|
1967
1234
|
export namespace Credit {
|
|
@@ -1992,49 +1259,6 @@ export namespace ContractCreateParams {
|
|
|
1992
1259
|
starting_at: string;
|
|
1993
1260
|
}
|
|
1994
1261
|
}
|
|
1995
|
-
|
|
1996
|
-
/**
|
|
1997
|
-
* Optional configuration for credit hierarchy access control
|
|
1998
|
-
*/
|
|
1999
|
-
export interface HierarchyConfiguration {
|
|
2000
|
-
child_access:
|
|
2001
|
-
| HierarchyConfiguration.CommitHierarchyChildAccessAll
|
|
2002
|
-
| HierarchyConfiguration.CommitHierarchyChildAccessNone
|
|
2003
|
-
| HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
|
|
2004
|
-
}
|
|
2005
|
-
|
|
2006
|
-
export namespace HierarchyConfiguration {
|
|
2007
|
-
export interface CommitHierarchyChildAccessAll {
|
|
2008
|
-
type: 'ALL';
|
|
2009
|
-
}
|
|
2010
|
-
|
|
2011
|
-
export interface CommitHierarchyChildAccessNone {
|
|
2012
|
-
type: 'NONE';
|
|
2013
|
-
}
|
|
2014
|
-
|
|
2015
|
-
export interface CommitHierarchyChildAccessContractIDs {
|
|
2016
|
-
contract_ids: Array<string>;
|
|
2017
|
-
|
|
2018
|
-
type: 'CONTRACT_IDS';
|
|
2019
|
-
}
|
|
2020
|
-
}
|
|
2021
|
-
|
|
2022
|
-
export interface Specifier {
|
|
2023
|
-
presentation_group_values?: { [key: string]: string };
|
|
2024
|
-
|
|
2025
|
-
pricing_group_values?: { [key: string]: string };
|
|
2026
|
-
|
|
2027
|
-
/**
|
|
2028
|
-
* If provided, the specifier will only apply to the product with the specified ID.
|
|
2029
|
-
*/
|
|
2030
|
-
product_id?: string;
|
|
2031
|
-
|
|
2032
|
-
/**
|
|
2033
|
-
* If provided, the specifier will only apply to products with all the specified
|
|
2034
|
-
* tags.
|
|
2035
|
-
*/
|
|
2036
|
-
product_tags?: Array<string>;
|
|
2037
|
-
}
|
|
2038
1262
|
}
|
|
2039
1263
|
|
|
2040
1264
|
export interface Discount {
|
|
@@ -2045,6 +1269,9 @@ export namespace ContractCreateParams {
|
|
|
2045
1269
|
*/
|
|
2046
1270
|
schedule: Discount.Schedule;
|
|
2047
1271
|
|
|
1272
|
+
/**
|
|
1273
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
1274
|
+
*/
|
|
2048
1275
|
custom_fields?: { [key: string]: string };
|
|
2049
1276
|
|
|
2050
1277
|
/**
|
|
@@ -2161,7 +1388,22 @@ export namespace ContractCreateParams {
|
|
|
2161
1388
|
}
|
|
2162
1389
|
|
|
2163
1390
|
export interface HierarchyConfiguration {
|
|
2164
|
-
parent
|
|
1391
|
+
parent?: HierarchyConfiguration.Parent;
|
|
1392
|
+
|
|
1393
|
+
parent_behavior?: HierarchyConfiguration.ParentBehavior;
|
|
1394
|
+
|
|
1395
|
+
/**
|
|
1396
|
+
* Indicates whether the parent should pay for the child's invoice charges
|
|
1397
|
+
*/
|
|
1398
|
+
payer?: 'SELF' | 'PARENT';
|
|
1399
|
+
|
|
1400
|
+
/**
|
|
1401
|
+
* Indicates the behavior of the child's invoice statements on the parent's
|
|
1402
|
+
* invoices **CONSOLIDATE**: Child's invoice statements will be added to parent's
|
|
1403
|
+
* consolidated invoices **SEPARATE**: Child's invoice statements will appear not
|
|
1404
|
+
* appear on parent's consolidated invoices
|
|
1405
|
+
*/
|
|
1406
|
+
usage_statement_behavior?: 'CONSOLIDATE' | 'SEPARATE';
|
|
2165
1407
|
}
|
|
2166
1408
|
|
|
2167
1409
|
export namespace HierarchyConfiguration {
|
|
@@ -2170,6 +1412,16 @@ export namespace ContractCreateParams {
|
|
|
2170
1412
|
|
|
2171
1413
|
customer_id: string;
|
|
2172
1414
|
}
|
|
1415
|
+
|
|
1416
|
+
export interface ParentBehavior {
|
|
1417
|
+
/**
|
|
1418
|
+
* Indicates the desired behavior of consolidated invoices generated by the parent
|
|
1419
|
+
* in a customer hierarchy **CONCATENATE**: Statements on the invoices of child
|
|
1420
|
+
* customers will be appended to the consolidated invoice **NONE**: Do not generate
|
|
1421
|
+
* consolidated invoices
|
|
1422
|
+
*/
|
|
1423
|
+
invoice_consolidation_type?: 'CONCATENATE' | 'NONE';
|
|
1424
|
+
}
|
|
2173
1425
|
}
|
|
2174
1426
|
|
|
2175
1427
|
export interface Override {
|
|
@@ -2253,8 +1505,8 @@ export namespace ContractCreateParams {
|
|
|
2253
1505
|
|
|
2254
1506
|
/**
|
|
2255
1507
|
* Can only be used for commit specific overrides. Must be used in conjunction with
|
|
2256
|
-
* one of product_id
|
|
2257
|
-
* presentation_group_values
|
|
1508
|
+
* one of `product_id`, `product_tags`, `pricing_group_values`, or
|
|
1509
|
+
* `presentation_group_values`. If provided, the override will only apply to the
|
|
2258
1510
|
* specified commits. If not provided, the override will apply to all commits.
|
|
2259
1511
|
*/
|
|
2260
1512
|
commit_ids?: Array<string>;
|
|
@@ -2284,17 +1536,17 @@ export namespace ContractCreateParams {
|
|
|
2284
1536
|
|
|
2285
1537
|
/**
|
|
2286
1538
|
* Can only be used for commit specific overrides. Must be used in conjunction with
|
|
2287
|
-
* one of product_id
|
|
2288
|
-
* presentation_group_values
|
|
2289
|
-
* created by the specified recurring commit ids.
|
|
1539
|
+
* one of `product_id`, `product_tags`, `pricing_group_values`, or
|
|
1540
|
+
* `presentation_group_values`. If provided, the override will only apply to
|
|
1541
|
+
* commits created by the specified recurring commit ids.
|
|
2290
1542
|
*/
|
|
2291
1543
|
recurring_commit_ids?: Array<string>;
|
|
2292
1544
|
|
|
2293
1545
|
/**
|
|
2294
1546
|
* Can only be used for commit specific overrides. Must be used in conjunction with
|
|
2295
|
-
* one of product_id
|
|
2296
|
-
* presentation_group_values
|
|
2297
|
-
* created by the specified recurring credit ids.
|
|
1547
|
+
* one of `product_id`, `product_tags`, `pricing_group_values`, or
|
|
1548
|
+
* `presentation_group_values`. If provided, the override will only apply to
|
|
1549
|
+
* credits created by the specified recurring credit ids.
|
|
2298
1550
|
*/
|
|
2299
1551
|
recurring_credit_ids?: Array<string>;
|
|
2300
1552
|
}
|
|
@@ -2325,172 +1577,21 @@ export namespace ContractCreateParams {
|
|
|
2325
1577
|
*/
|
|
2326
1578
|
price?: number;
|
|
2327
1579
|
|
|
2328
|
-
/**
|
|
2329
|
-
* Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
|
|
2330
|
-
*/
|
|
2331
|
-
quantity?: number;
|
|
2332
|
-
|
|
2333
|
-
/**
|
|
2334
|
-
* Only set for TIERED rate_type.
|
|
2335
|
-
*/
|
|
2336
|
-
tiers?: Array<Shared.Tier>;
|
|
2337
|
-
}
|
|
2338
|
-
|
|
2339
|
-
export interface Tier {
|
|
2340
|
-
multiplier: number;
|
|
2341
|
-
|
|
2342
|
-
size?: number;
|
|
2343
|
-
}
|
|
2344
|
-
}
|
|
2345
|
-
|
|
2346
|
-
export interface PrepaidBalanceThresholdConfiguration {
|
|
2347
|
-
commit: PrepaidBalanceThresholdConfiguration.Commit;
|
|
2348
|
-
|
|
2349
|
-
/**
|
|
2350
|
-
* When set to false, the contract will not be evaluated against the
|
|
2351
|
-
* threshold_amount. Toggling to true will result an immediate evaluation,
|
|
2352
|
-
* regardless of prior state.
|
|
2353
|
-
*/
|
|
2354
|
-
is_enabled: boolean;
|
|
2355
|
-
|
|
2356
|
-
payment_gate_config: PrepaidBalanceThresholdConfiguration.PaymentGateConfig;
|
|
2357
|
-
|
|
2358
|
-
/**
|
|
2359
|
-
* Specify the amount the balance should be recharged to.
|
|
2360
|
-
*/
|
|
2361
|
-
recharge_to_amount: number;
|
|
2362
|
-
|
|
2363
|
-
/**
|
|
2364
|
-
* Specify the threshold amount for the contract. Each time the contract's prepaid
|
|
2365
|
-
* balance lowers to this amount, a threshold charge will be initiated.
|
|
2366
|
-
*/
|
|
2367
|
-
threshold_amount: number;
|
|
2368
|
-
|
|
2369
|
-
/**
|
|
2370
|
-
* If provided, the threshold, recharge-to amount, and the resulting threshold
|
|
2371
|
-
* commit amount will be in terms of this credit type instead of the fiat currency.
|
|
2372
|
-
*/
|
|
2373
|
-
custom_credit_type_id?: string;
|
|
2374
|
-
}
|
|
2375
|
-
|
|
2376
|
-
export namespace PrepaidBalanceThresholdConfiguration {
|
|
2377
|
-
export interface Commit {
|
|
2378
|
-
/**
|
|
2379
|
-
* The commit product that will be used to generate the line item for commit
|
|
2380
|
-
* payment.
|
|
2381
|
-
*/
|
|
2382
|
-
product_id: string;
|
|
2383
|
-
|
|
2384
|
-
/**
|
|
2385
|
-
* Which products the threshold commit applies to. If applicable_product_ids,
|
|
2386
|
-
* applicable_product_tags or specifiers are not provided, the commit applies to
|
|
2387
|
-
* all products.
|
|
2388
|
-
*/
|
|
2389
|
-
applicable_product_ids?: Array<string>;
|
|
2390
|
-
|
|
2391
|
-
/**
|
|
2392
|
-
* Which tags the threshold commit applies to. If applicable_product_ids,
|
|
2393
|
-
* applicable_product_tags or specifiers are not provided, the commit applies to
|
|
2394
|
-
* all products.
|
|
2395
|
-
*/
|
|
2396
|
-
applicable_product_tags?: Array<string>;
|
|
2397
|
-
|
|
2398
|
-
description?: string;
|
|
2399
|
-
|
|
2400
|
-
/**
|
|
2401
|
-
* Specify the name of the line item for the threshold charge. If left blank, it
|
|
2402
|
-
* will default to the commit product name.
|
|
2403
|
-
*/
|
|
2404
|
-
name?: string;
|
|
2405
|
-
|
|
2406
|
-
/**
|
|
2407
|
-
* List of filters that determine what kind of customer usage draws down a commit
|
|
2408
|
-
* or credit. A customer's usage needs to meet the condition of at least one of the
|
|
2409
|
-
* specifiers to contribute to a commit's or credit's drawdown. This field cannot
|
|
2410
|
-
* be used together with `applicable_product_ids` or `applicable_product_tags`.
|
|
2411
|
-
*/
|
|
2412
|
-
specifiers?: Array<Commit.Specifier>;
|
|
2413
|
-
}
|
|
2414
|
-
|
|
2415
|
-
export namespace Commit {
|
|
2416
|
-
export interface Specifier {
|
|
2417
|
-
presentation_group_values?: { [key: string]: string };
|
|
2418
|
-
|
|
2419
|
-
pricing_group_values?: { [key: string]: string };
|
|
2420
|
-
|
|
2421
|
-
/**
|
|
2422
|
-
* If provided, the specifier will only apply to the product with the specified ID.
|
|
2423
|
-
*/
|
|
2424
|
-
product_id?: string;
|
|
2425
|
-
|
|
2426
|
-
/**
|
|
2427
|
-
* If provided, the specifier will only apply to products with all the specified
|
|
2428
|
-
* tags.
|
|
2429
|
-
*/
|
|
2430
|
-
product_tags?: Array<string>;
|
|
2431
|
-
}
|
|
2432
|
-
}
|
|
2433
|
-
|
|
2434
|
-
export interface PaymentGateConfig {
|
|
2435
|
-
/**
|
|
2436
|
-
* Gate access to the commit balance based on successful collection of payment.
|
|
2437
|
-
* Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
|
|
2438
|
-
* facilitate payment using your own payment integration. Select NONE if you do not
|
|
2439
|
-
* wish to payment gate the commit balance.
|
|
2440
|
-
*/
|
|
2441
|
-
payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
|
|
2442
|
-
|
|
2443
|
-
/**
|
|
2444
|
-
* Only applicable if using PRECALCULATED as your tax type.
|
|
2445
|
-
*/
|
|
2446
|
-
precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
|
|
2447
|
-
|
|
2448
|
-
/**
|
|
2449
|
-
* Only applicable if using STRIPE as your payment gate type.
|
|
2450
|
-
*/
|
|
2451
|
-
stripe_config?: PaymentGateConfig.StripeConfig;
|
|
2452
|
-
|
|
2453
|
-
/**
|
|
2454
|
-
* Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
|
|
2455
|
-
* not wish Metronome to calculate tax on your behalf. Leaving this field blank
|
|
2456
|
-
* will default to NONE.
|
|
2457
|
-
*/
|
|
2458
|
-
tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
|
|
2459
|
-
}
|
|
2460
|
-
|
|
2461
|
-
export namespace PaymentGateConfig {
|
|
2462
|
-
/**
|
|
2463
|
-
* Only applicable if using PRECALCULATED as your tax type.
|
|
2464
|
-
*/
|
|
2465
|
-
export interface PrecalculatedTaxConfig {
|
|
2466
|
-
/**
|
|
2467
|
-
* Amount of tax to be applied. This should be in the same currency and
|
|
2468
|
-
* denomination as the commit's invoice schedule
|
|
2469
|
-
*/
|
|
2470
|
-
tax_amount: number;
|
|
2471
|
-
|
|
2472
|
-
/**
|
|
2473
|
-
* Name of the tax to be applied. This may be used in an invoice line item
|
|
2474
|
-
* description.
|
|
2475
|
-
*/
|
|
2476
|
-
tax_name?: string;
|
|
2477
|
-
}
|
|
1580
|
+
/**
|
|
1581
|
+
* Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
|
|
1582
|
+
*/
|
|
1583
|
+
quantity?: number;
|
|
2478
1584
|
|
|
2479
1585
|
/**
|
|
2480
|
-
* Only
|
|
1586
|
+
* Only set for TIERED rate_type.
|
|
2481
1587
|
*/
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
* If left blank, will default to INVOICE
|
|
2485
|
-
*/
|
|
2486
|
-
payment_type: 'INVOICE' | 'PAYMENT_INTENT';
|
|
1588
|
+
tiers?: Array<Shared.Tier>;
|
|
1589
|
+
}
|
|
2487
1590
|
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
invoice_metadata?: { [key: string]: string };
|
|
2493
|
-
}
|
|
1591
|
+
export interface Tier {
|
|
1592
|
+
multiplier: number;
|
|
1593
|
+
|
|
1594
|
+
size?: number;
|
|
2494
1595
|
}
|
|
2495
1596
|
}
|
|
2496
1597
|
|
|
@@ -2514,6 +1615,9 @@ export namespace ContractCreateParams {
|
|
|
2514
1615
|
*/
|
|
2515
1616
|
unit_price: number;
|
|
2516
1617
|
|
|
1618
|
+
/**
|
|
1619
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
1620
|
+
*/
|
|
2517
1621
|
custom_fields?: { [key: string]: string };
|
|
2518
1622
|
|
|
2519
1623
|
description?: string;
|
|
@@ -2572,7 +1676,7 @@ export namespace ContractCreateParams {
|
|
|
2572
1676
|
/**
|
|
2573
1677
|
* Optional configuration for recurring commit/credit hierarchy access control
|
|
2574
1678
|
*/
|
|
2575
|
-
hierarchy_configuration?:
|
|
1679
|
+
hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
|
|
2576
1680
|
|
|
2577
1681
|
/**
|
|
2578
1682
|
* The amount the customer should be billed for the commit. Not required.
|
|
@@ -2622,7 +1726,7 @@ export namespace ContractCreateParams {
|
|
|
2622
1726
|
* specifiers to contribute to a commit's or credit's drawdown. This field cannot
|
|
2623
1727
|
* be used together with `applicable_product_ids` or `applicable_product_tags`.
|
|
2624
1728
|
*/
|
|
2625
|
-
specifiers?: Array<
|
|
1729
|
+
specifiers?: Array<Shared.CommitSpecifierInput>;
|
|
2626
1730
|
|
|
2627
1731
|
/**
|
|
2628
1732
|
* Attach a subscription to the recurring commit/credit.
|
|
@@ -2663,32 +1767,6 @@ export namespace ContractCreateParams {
|
|
|
2663
1767
|
unit?: 'PERIODS';
|
|
2664
1768
|
}
|
|
2665
1769
|
|
|
2666
|
-
/**
|
|
2667
|
-
* Optional configuration for recurring commit/credit hierarchy access control
|
|
2668
|
-
*/
|
|
2669
|
-
export interface HierarchyConfiguration {
|
|
2670
|
-
child_access:
|
|
2671
|
-
| HierarchyConfiguration.CommitHierarchyChildAccessAll
|
|
2672
|
-
| HierarchyConfiguration.CommitHierarchyChildAccessNone
|
|
2673
|
-
| HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
|
|
2674
|
-
}
|
|
2675
|
-
|
|
2676
|
-
export namespace HierarchyConfiguration {
|
|
2677
|
-
export interface CommitHierarchyChildAccessAll {
|
|
2678
|
-
type: 'ALL';
|
|
2679
|
-
}
|
|
2680
|
-
|
|
2681
|
-
export interface CommitHierarchyChildAccessNone {
|
|
2682
|
-
type: 'NONE';
|
|
2683
|
-
}
|
|
2684
|
-
|
|
2685
|
-
export interface CommitHierarchyChildAccessContractIDs {
|
|
2686
|
-
contract_ids: Array<string>;
|
|
2687
|
-
|
|
2688
|
-
type: 'CONTRACT_IDS';
|
|
2689
|
-
}
|
|
2690
|
-
}
|
|
2691
|
-
|
|
2692
1770
|
/**
|
|
2693
1771
|
* The amount the customer should be billed for the commit. Not required.
|
|
2694
1772
|
*/
|
|
@@ -2700,23 +1778,6 @@ export namespace ContractCreateParams {
|
|
|
2700
1778
|
unit_price: number;
|
|
2701
1779
|
}
|
|
2702
1780
|
|
|
2703
|
-
export interface Specifier {
|
|
2704
|
-
presentation_group_values?: { [key: string]: string };
|
|
2705
|
-
|
|
2706
|
-
pricing_group_values?: { [key: string]: string };
|
|
2707
|
-
|
|
2708
|
-
/**
|
|
2709
|
-
* If provided, the specifier will only apply to the product with the specified ID.
|
|
2710
|
-
*/
|
|
2711
|
-
product_id?: string;
|
|
2712
|
-
|
|
2713
|
-
/**
|
|
2714
|
-
* If provided, the specifier will only apply to products with all the specified
|
|
2715
|
-
* tags.
|
|
2716
|
-
*/
|
|
2717
|
-
product_tags?: Array<string>;
|
|
2718
|
-
}
|
|
2719
|
-
|
|
2720
1781
|
/**
|
|
2721
1782
|
* Attach a subscription to the recurring commit/credit.
|
|
2722
1783
|
*/
|
|
@@ -2731,7 +1792,7 @@ export namespace ContractCreateParams {
|
|
|
2731
1792
|
/**
|
|
2732
1793
|
* If set to POOLED, allocation added per seat is pooled across the account.
|
|
2733
1794
|
*/
|
|
2734
|
-
allocation?: 'POOLED';
|
|
1795
|
+
allocation?: 'INDIVIDUAL' | 'POOLED';
|
|
2735
1796
|
}
|
|
2736
1797
|
|
|
2737
1798
|
export namespace SubscriptionConfig {
|
|
@@ -2792,7 +1853,7 @@ export namespace ContractCreateParams {
|
|
|
2792
1853
|
/**
|
|
2793
1854
|
* Optional configuration for recurring commit/credit hierarchy access control
|
|
2794
1855
|
*/
|
|
2795
|
-
hierarchy_configuration?:
|
|
1856
|
+
hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
|
|
2796
1857
|
|
|
2797
1858
|
/**
|
|
2798
1859
|
* displayed on invoices. will be passed through to the individual commits
|
|
@@ -2837,7 +1898,7 @@ export namespace ContractCreateParams {
|
|
|
2837
1898
|
* specifiers to contribute to a commit's or credit's drawdown. This field cannot
|
|
2838
1899
|
* be used together with `applicable_product_ids` or `applicable_product_tags`.
|
|
2839
1900
|
*/
|
|
2840
|
-
specifiers?: Array<
|
|
1901
|
+
specifiers?: Array<Shared.CommitSpecifierInput>;
|
|
2841
1902
|
|
|
2842
1903
|
/**
|
|
2843
1904
|
* Attach a subscription to the recurring commit/credit.
|
|
@@ -2878,49 +1939,6 @@ export namespace ContractCreateParams {
|
|
|
2878
1939
|
unit?: 'PERIODS';
|
|
2879
1940
|
}
|
|
2880
1941
|
|
|
2881
|
-
/**
|
|
2882
|
-
* Optional configuration for recurring commit/credit hierarchy access control
|
|
2883
|
-
*/
|
|
2884
|
-
export interface HierarchyConfiguration {
|
|
2885
|
-
child_access:
|
|
2886
|
-
| HierarchyConfiguration.CommitHierarchyChildAccessAll
|
|
2887
|
-
| HierarchyConfiguration.CommitHierarchyChildAccessNone
|
|
2888
|
-
| HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
|
|
2889
|
-
}
|
|
2890
|
-
|
|
2891
|
-
export namespace HierarchyConfiguration {
|
|
2892
|
-
export interface CommitHierarchyChildAccessAll {
|
|
2893
|
-
type: 'ALL';
|
|
2894
|
-
}
|
|
2895
|
-
|
|
2896
|
-
export interface CommitHierarchyChildAccessNone {
|
|
2897
|
-
type: 'NONE';
|
|
2898
|
-
}
|
|
2899
|
-
|
|
2900
|
-
export interface CommitHierarchyChildAccessContractIDs {
|
|
2901
|
-
contract_ids: Array<string>;
|
|
2902
|
-
|
|
2903
|
-
type: 'CONTRACT_IDS';
|
|
2904
|
-
}
|
|
2905
|
-
}
|
|
2906
|
-
|
|
2907
|
-
export interface Specifier {
|
|
2908
|
-
presentation_group_values?: { [key: string]: string };
|
|
2909
|
-
|
|
2910
|
-
pricing_group_values?: { [key: string]: string };
|
|
2911
|
-
|
|
2912
|
-
/**
|
|
2913
|
-
* If provided, the specifier will only apply to the product with the specified ID.
|
|
2914
|
-
*/
|
|
2915
|
-
product_id?: string;
|
|
2916
|
-
|
|
2917
|
-
/**
|
|
2918
|
-
* If provided, the specifier will only apply to products with all the specified
|
|
2919
|
-
* tags.
|
|
2920
|
-
*/
|
|
2921
|
-
product_tags?: Array<string>;
|
|
2922
|
-
}
|
|
2923
|
-
|
|
2924
1942
|
/**
|
|
2925
1943
|
* Attach a subscription to the recurring commit/credit.
|
|
2926
1944
|
*/
|
|
@@ -2935,7 +1953,7 @@ export namespace ContractCreateParams {
|
|
|
2935
1953
|
/**
|
|
2936
1954
|
* If set to POOLED, allocation added per seat is pooled across the account.
|
|
2937
1955
|
*/
|
|
2938
|
-
allocation?: 'POOLED';
|
|
1956
|
+
allocation?: 'INDIVIDUAL' | 'POOLED';
|
|
2939
1957
|
}
|
|
2940
1958
|
|
|
2941
1959
|
export namespace SubscriptionConfig {
|
|
@@ -3000,6 +2018,9 @@ export namespace ContractCreateParams {
|
|
|
3000
2018
|
*/
|
|
3001
2019
|
schedule: ScheduledCharge.Schedule;
|
|
3002
2020
|
|
|
2021
|
+
/**
|
|
2022
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
2023
|
+
*/
|
|
3003
2024
|
custom_fields?: { [key: string]: string };
|
|
3004
2025
|
|
|
3005
2026
|
/**
|
|
@@ -3115,117 +2136,16 @@ export namespace ContractCreateParams {
|
|
|
3115
2136
|
}
|
|
3116
2137
|
}
|
|
3117
2138
|
|
|
3118
|
-
export interface SpendThresholdConfiguration {
|
|
3119
|
-
commit: SpendThresholdConfiguration.Commit;
|
|
3120
|
-
|
|
3121
|
-
/**
|
|
3122
|
-
* When set to false, the contract will not be evaluated against the
|
|
3123
|
-
* threshold_amount. Toggling to true will result an immediate evaluation,
|
|
3124
|
-
* regardless of prior state.
|
|
3125
|
-
*/
|
|
3126
|
-
is_enabled: boolean;
|
|
3127
|
-
|
|
3128
|
-
payment_gate_config: SpendThresholdConfiguration.PaymentGateConfig;
|
|
3129
|
-
|
|
3130
|
-
/**
|
|
3131
|
-
* Specify the threshold amount for the contract. Each time the contract's usage
|
|
3132
|
-
* hits this amount, a threshold charge will be initiated.
|
|
3133
|
-
*/
|
|
3134
|
-
threshold_amount: number;
|
|
3135
|
-
}
|
|
3136
|
-
|
|
3137
|
-
export namespace SpendThresholdConfiguration {
|
|
3138
|
-
export interface Commit {
|
|
3139
|
-
/**
|
|
3140
|
-
* The commit product that will be used to generate the line item for commit
|
|
3141
|
-
* payment.
|
|
3142
|
-
*/
|
|
3143
|
-
product_id: string;
|
|
3144
|
-
|
|
3145
|
-
description?: string;
|
|
3146
|
-
|
|
3147
|
-
/**
|
|
3148
|
-
* Specify the name of the line item for the threshold charge. If left blank, it
|
|
3149
|
-
* will default to the commit product name.
|
|
3150
|
-
*/
|
|
3151
|
-
name?: string;
|
|
3152
|
-
}
|
|
3153
|
-
|
|
3154
|
-
export interface PaymentGateConfig {
|
|
3155
|
-
/**
|
|
3156
|
-
* Gate access to the commit balance based on successful collection of payment.
|
|
3157
|
-
* Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
|
|
3158
|
-
* facilitate payment using your own payment integration. Select NONE if you do not
|
|
3159
|
-
* wish to payment gate the commit balance.
|
|
3160
|
-
*/
|
|
3161
|
-
payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
|
|
3162
|
-
|
|
3163
|
-
/**
|
|
3164
|
-
* Only applicable if using PRECALCULATED as your tax type.
|
|
3165
|
-
*/
|
|
3166
|
-
precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
|
|
3167
|
-
|
|
3168
|
-
/**
|
|
3169
|
-
* Only applicable if using STRIPE as your payment gate type.
|
|
3170
|
-
*/
|
|
3171
|
-
stripe_config?: PaymentGateConfig.StripeConfig;
|
|
3172
|
-
|
|
3173
|
-
/**
|
|
3174
|
-
* Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
|
|
3175
|
-
* not wish Metronome to calculate tax on your behalf. Leaving this field blank
|
|
3176
|
-
* will default to NONE.
|
|
3177
|
-
*/
|
|
3178
|
-
tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
|
|
3179
|
-
}
|
|
3180
|
-
|
|
3181
|
-
export namespace PaymentGateConfig {
|
|
3182
|
-
/**
|
|
3183
|
-
* Only applicable if using PRECALCULATED as your tax type.
|
|
3184
|
-
*/
|
|
3185
|
-
export interface PrecalculatedTaxConfig {
|
|
3186
|
-
/**
|
|
3187
|
-
* Amount of tax to be applied. This should be in the same currency and
|
|
3188
|
-
* denomination as the commit's invoice schedule
|
|
3189
|
-
*/
|
|
3190
|
-
tax_amount: number;
|
|
3191
|
-
|
|
3192
|
-
/**
|
|
3193
|
-
* Name of the tax to be applied. This may be used in an invoice line item
|
|
3194
|
-
* description.
|
|
3195
|
-
*/
|
|
3196
|
-
tax_name?: string;
|
|
3197
|
-
}
|
|
3198
|
-
|
|
3199
|
-
/**
|
|
3200
|
-
* Only applicable if using STRIPE as your payment gate type.
|
|
3201
|
-
*/
|
|
3202
|
-
export interface StripeConfig {
|
|
3203
|
-
/**
|
|
3204
|
-
* If left blank, will default to INVOICE
|
|
3205
|
-
*/
|
|
3206
|
-
payment_type: 'INVOICE' | 'PAYMENT_INTENT';
|
|
3207
|
-
|
|
3208
|
-
/**
|
|
3209
|
-
* Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
|
|
3210
|
-
* your payment type.
|
|
3211
|
-
*/
|
|
3212
|
-
invoice_metadata?: { [key: string]: string };
|
|
3213
|
-
}
|
|
3214
|
-
}
|
|
3215
|
-
}
|
|
3216
|
-
|
|
3217
2139
|
export interface Subscription {
|
|
3218
2140
|
collection_schedule: 'ADVANCE' | 'ARREARS';
|
|
3219
2141
|
|
|
3220
|
-
/**
|
|
3221
|
-
* The initial quantity for the subscription. It must be non-negative value.
|
|
3222
|
-
*/
|
|
3223
|
-
initial_quantity: number;
|
|
3224
|
-
|
|
3225
2142
|
proration: Subscription.Proration;
|
|
3226
2143
|
|
|
3227
2144
|
subscription_rate: Subscription.SubscriptionRate;
|
|
3228
2145
|
|
|
2146
|
+
/**
|
|
2147
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
2148
|
+
*/
|
|
3229
2149
|
custom_fields?: { [key: string]: string };
|
|
3230
2150
|
|
|
3231
2151
|
description?: string;
|
|
@@ -3236,8 +2156,22 @@ export namespace ContractCreateParams {
|
|
|
3236
2156
|
*/
|
|
3237
2157
|
ending_before?: string;
|
|
3238
2158
|
|
|
2159
|
+
/**
|
|
2160
|
+
* The initial quantity for the subscription. It must be non-negative value.
|
|
2161
|
+
* Required if quantity_management_mode is QUANTITY_ONLY.
|
|
2162
|
+
*/
|
|
2163
|
+
initial_quantity?: number;
|
|
2164
|
+
|
|
3239
2165
|
name?: string;
|
|
3240
2166
|
|
|
2167
|
+
/**
|
|
2168
|
+
* Determines how the subscription's quantity is controlled. Defaults to
|
|
2169
|
+
* QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
|
|
2170
|
+
* directly on the subscription. `initial_quantity` must be provided with this
|
|
2171
|
+
* option. Compatible with recurring commits/credits that use POOLED allocation.
|
|
2172
|
+
*/
|
|
2173
|
+
quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY';
|
|
2174
|
+
|
|
3241
2175
|
/**
|
|
3242
2176
|
* Inclusive start time for the subscription. If not provided, defaults to contract
|
|
3243
2177
|
* start date
|
|
@@ -3441,6 +2375,9 @@ export interface ContractAmendParams {
|
|
|
3441
2375
|
|
|
3442
2376
|
credits?: Array<ContractAmendParams.Credit>;
|
|
3443
2377
|
|
|
2378
|
+
/**
|
|
2379
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
2380
|
+
*/
|
|
3444
2381
|
custom_fields?: { [key: string]: string };
|
|
3445
2382
|
|
|
3446
2383
|
/**
|
|
@@ -3510,6 +2447,9 @@ export namespace ContractAmendParams {
|
|
|
3510
2447
|
*/
|
|
3511
2448
|
applicable_product_tags?: Array<string>;
|
|
3512
2449
|
|
|
2450
|
+
/**
|
|
2451
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
2452
|
+
*/
|
|
3513
2453
|
custom_fields?: { [key: string]: string };
|
|
3514
2454
|
|
|
3515
2455
|
/**
|
|
@@ -3520,7 +2460,7 @@ export namespace ContractAmendParams {
|
|
|
3520
2460
|
/**
|
|
3521
2461
|
* Optional configuration for commit hierarchy access control
|
|
3522
2462
|
*/
|
|
3523
|
-
hierarchy_configuration?:
|
|
2463
|
+
hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
|
|
3524
2464
|
|
|
3525
2465
|
/**
|
|
3526
2466
|
* Required for "POSTPAID" commits: the true up invoice will be generated at this
|
|
@@ -3564,7 +2504,7 @@ export namespace ContractAmendParams {
|
|
|
3564
2504
|
* specifiers to contribute to a commit's or credit's drawdown. This field cannot
|
|
3565
2505
|
* be used together with `applicable_product_ids` or `applicable_product_tags`.
|
|
3566
2506
|
*/
|
|
3567
|
-
specifiers?: Array<
|
|
2507
|
+
specifiers?: Array<Shared.CommitSpecifierInput>;
|
|
3568
2508
|
|
|
3569
2509
|
/**
|
|
3570
2510
|
* A temporary ID for the commit that can be used to reference the commit for
|
|
@@ -3604,32 +2544,6 @@ export namespace ContractAmendParams {
|
|
|
3604
2544
|
}
|
|
3605
2545
|
}
|
|
3606
2546
|
|
|
3607
|
-
/**
|
|
3608
|
-
* Optional configuration for commit hierarchy access control
|
|
3609
|
-
*/
|
|
3610
|
-
export interface HierarchyConfiguration {
|
|
3611
|
-
child_access:
|
|
3612
|
-
| HierarchyConfiguration.CommitHierarchyChildAccessAll
|
|
3613
|
-
| HierarchyConfiguration.CommitHierarchyChildAccessNone
|
|
3614
|
-
| HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
|
|
3615
|
-
}
|
|
3616
|
-
|
|
3617
|
-
export namespace HierarchyConfiguration {
|
|
3618
|
-
export interface CommitHierarchyChildAccessAll {
|
|
3619
|
-
type: 'ALL';
|
|
3620
|
-
}
|
|
3621
|
-
|
|
3622
|
-
export interface CommitHierarchyChildAccessNone {
|
|
3623
|
-
type: 'NONE';
|
|
3624
|
-
}
|
|
3625
|
-
|
|
3626
|
-
export interface CommitHierarchyChildAccessContractIDs {
|
|
3627
|
-
contract_ids: Array<string>;
|
|
3628
|
-
|
|
3629
|
-
type: 'CONTRACT_IDS';
|
|
3630
|
-
}
|
|
3631
|
-
}
|
|
3632
|
-
|
|
3633
2547
|
/**
|
|
3634
2548
|
* Required for "POSTPAID" commits: the true up invoice will be generated at this
|
|
3635
2549
|
* time and only one schedule item is allowed; the total must match access_schedule
|
|
@@ -3760,7 +2674,7 @@ export namespace ContractAmendParams {
|
|
|
3760
2674
|
* not wish Metronome to calculate tax on your behalf. Leaving this field blank
|
|
3761
2675
|
* will default to NONE.
|
|
3762
2676
|
*/
|
|
3763
|
-
tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
|
|
2677
|
+
tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'AVALARA' | 'PRECALCULATED';
|
|
3764
2678
|
}
|
|
3765
2679
|
|
|
3766
2680
|
export namespace PaymentGateConfig {
|
|
@@ -3809,23 +2723,6 @@ export namespace ContractAmendParams {
|
|
|
3809
2723
|
on_session_payment?: boolean;
|
|
3810
2724
|
}
|
|
3811
2725
|
}
|
|
3812
|
-
|
|
3813
|
-
export interface Specifier {
|
|
3814
|
-
presentation_group_values?: { [key: string]: string };
|
|
3815
|
-
|
|
3816
|
-
pricing_group_values?: { [key: string]: string };
|
|
3817
|
-
|
|
3818
|
-
/**
|
|
3819
|
-
* If provided, the specifier will only apply to the product with the specified ID.
|
|
3820
|
-
*/
|
|
3821
|
-
product_id?: string;
|
|
3822
|
-
|
|
3823
|
-
/**
|
|
3824
|
-
* If provided, the specifier will only apply to products with all the specified
|
|
3825
|
-
* tags.
|
|
3826
|
-
*/
|
|
3827
|
-
product_tags?: Array<string>;
|
|
3828
|
-
}
|
|
3829
2726
|
}
|
|
3830
2727
|
|
|
3831
2728
|
export interface Credit {
|
|
@@ -3848,6 +2745,9 @@ export namespace ContractAmendParams {
|
|
|
3848
2745
|
*/
|
|
3849
2746
|
applicable_product_tags?: Array<string>;
|
|
3850
2747
|
|
|
2748
|
+
/**
|
|
2749
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
2750
|
+
*/
|
|
3851
2751
|
custom_fields?: { [key: string]: string };
|
|
3852
2752
|
|
|
3853
2753
|
/**
|
|
@@ -3858,7 +2758,7 @@ export namespace ContractAmendParams {
|
|
|
3858
2758
|
/**
|
|
3859
2759
|
* Optional configuration for credit hierarchy access control
|
|
3860
2760
|
*/
|
|
3861
|
-
hierarchy_configuration?:
|
|
2761
|
+
hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
|
|
3862
2762
|
|
|
3863
2763
|
/**
|
|
3864
2764
|
* displayed on invoices
|
|
@@ -3884,7 +2784,7 @@ export namespace ContractAmendParams {
|
|
|
3884
2784
|
* specifiers to contribute to a commit's or credit's drawdown. This field cannot
|
|
3885
2785
|
* be used together with `applicable_product_ids` or `applicable_product_tags`.
|
|
3886
2786
|
*/
|
|
3887
|
-
specifiers?: Array<
|
|
2787
|
+
specifiers?: Array<Shared.CommitSpecifierInput>;
|
|
3888
2788
|
}
|
|
3889
2789
|
|
|
3890
2790
|
export namespace Credit {
|
|
@@ -3915,49 +2815,6 @@ export namespace ContractAmendParams {
|
|
|
3915
2815
|
starting_at: string;
|
|
3916
2816
|
}
|
|
3917
2817
|
}
|
|
3918
|
-
|
|
3919
|
-
/**
|
|
3920
|
-
* Optional configuration for credit hierarchy access control
|
|
3921
|
-
*/
|
|
3922
|
-
export interface HierarchyConfiguration {
|
|
3923
|
-
child_access:
|
|
3924
|
-
| HierarchyConfiguration.CommitHierarchyChildAccessAll
|
|
3925
|
-
| HierarchyConfiguration.CommitHierarchyChildAccessNone
|
|
3926
|
-
| HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
|
|
3927
|
-
}
|
|
3928
|
-
|
|
3929
|
-
export namespace HierarchyConfiguration {
|
|
3930
|
-
export interface CommitHierarchyChildAccessAll {
|
|
3931
|
-
type: 'ALL';
|
|
3932
|
-
}
|
|
3933
|
-
|
|
3934
|
-
export interface CommitHierarchyChildAccessNone {
|
|
3935
|
-
type: 'NONE';
|
|
3936
|
-
}
|
|
3937
|
-
|
|
3938
|
-
export interface CommitHierarchyChildAccessContractIDs {
|
|
3939
|
-
contract_ids: Array<string>;
|
|
3940
|
-
|
|
3941
|
-
type: 'CONTRACT_IDS';
|
|
3942
|
-
}
|
|
3943
|
-
}
|
|
3944
|
-
|
|
3945
|
-
export interface Specifier {
|
|
3946
|
-
presentation_group_values?: { [key: string]: string };
|
|
3947
|
-
|
|
3948
|
-
pricing_group_values?: { [key: string]: string };
|
|
3949
|
-
|
|
3950
|
-
/**
|
|
3951
|
-
* If provided, the specifier will only apply to the product with the specified ID.
|
|
3952
|
-
*/
|
|
3953
|
-
product_id?: string;
|
|
3954
|
-
|
|
3955
|
-
/**
|
|
3956
|
-
* If provided, the specifier will only apply to products with all the specified
|
|
3957
|
-
* tags.
|
|
3958
|
-
*/
|
|
3959
|
-
product_tags?: Array<string>;
|
|
3960
|
-
}
|
|
3961
2818
|
}
|
|
3962
2819
|
|
|
3963
2820
|
export interface Discount {
|
|
@@ -3968,6 +2825,9 @@ export namespace ContractAmendParams {
|
|
|
3968
2825
|
*/
|
|
3969
2826
|
schedule: Discount.Schedule;
|
|
3970
2827
|
|
|
2828
|
+
/**
|
|
2829
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
2830
|
+
*/
|
|
3971
2831
|
custom_fields?: { [key: string]: string };
|
|
3972
2832
|
|
|
3973
2833
|
/**
|
|
@@ -4164,8 +3024,8 @@ export namespace ContractAmendParams {
|
|
|
4164
3024
|
|
|
4165
3025
|
/**
|
|
4166
3026
|
* Can only be used for commit specific overrides. Must be used in conjunction with
|
|
4167
|
-
* one of product_id
|
|
4168
|
-
* presentation_group_values
|
|
3027
|
+
* one of `product_id`, `product_tags`, `pricing_group_values`, or
|
|
3028
|
+
* `presentation_group_values`. If provided, the override will only apply to the
|
|
4169
3029
|
* specified commits. If not provided, the override will apply to all commits.
|
|
4170
3030
|
*/
|
|
4171
3031
|
commit_ids?: Array<string>;
|
|
@@ -4195,17 +3055,17 @@ export namespace ContractAmendParams {
|
|
|
4195
3055
|
|
|
4196
3056
|
/**
|
|
4197
3057
|
* Can only be used for commit specific overrides. Must be used in conjunction with
|
|
4198
|
-
* one of product_id
|
|
4199
|
-
* presentation_group_values
|
|
4200
|
-
* created by the specified recurring commit ids.
|
|
3058
|
+
* one of `product_id`, `product_tags`, `pricing_group_values`, or
|
|
3059
|
+
* `presentation_group_values`. If provided, the override will only apply to
|
|
3060
|
+
* commits created by the specified recurring commit ids.
|
|
4201
3061
|
*/
|
|
4202
3062
|
recurring_commit_ids?: Array<string>;
|
|
4203
3063
|
|
|
4204
3064
|
/**
|
|
4205
3065
|
* Can only be used for commit specific overrides. Must be used in conjunction with
|
|
4206
|
-
* one of product_id
|
|
4207
|
-
* presentation_group_values
|
|
4208
|
-
* created by the specified recurring credit ids.
|
|
3066
|
+
* one of `product_id`, `product_tags`, `pricing_group_values`, or
|
|
3067
|
+
* `presentation_group_values`. If provided, the override will only apply to
|
|
3068
|
+
* credits created by the specified recurring credit ids.
|
|
4209
3069
|
*/
|
|
4210
3070
|
recurring_credit_ids?: Array<string>;
|
|
4211
3071
|
}
|
|
@@ -4274,6 +3134,9 @@ export namespace ContractAmendParams {
|
|
|
4274
3134
|
*/
|
|
4275
3135
|
unit_price: number;
|
|
4276
3136
|
|
|
3137
|
+
/**
|
|
3138
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
3139
|
+
*/
|
|
4277
3140
|
custom_fields?: { [key: string]: string };
|
|
4278
3141
|
|
|
4279
3142
|
description?: string;
|
|
@@ -4339,6 +3202,9 @@ export namespace ContractAmendParams {
|
|
|
4339
3202
|
*/
|
|
4340
3203
|
schedule: ScheduledCharge.Schedule;
|
|
4341
3204
|
|
|
3205
|
+
/**
|
|
3206
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
3207
|
+
*/
|
|
4342
3208
|
custom_fields?: { [key: string]: string };
|
|
4343
3209
|
|
|
4344
3210
|
/**
|
|
@@ -4502,6 +3368,9 @@ export namespace ContractCreateHistoricalInvoicesParams {
|
|
|
4502
3368
|
|
|
4503
3369
|
breakdown_granularity?: 'HOUR' | 'DAY';
|
|
4504
3370
|
|
|
3371
|
+
/**
|
|
3372
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
3373
|
+
*/
|
|
4505
3374
|
custom_fields?: { [key: string]: string };
|
|
4506
3375
|
}
|
|
4507
3376
|
|
|
@@ -4534,7 +3403,7 @@ export namespace ContractCreateHistoricalInvoicesParams {
|
|
|
4534
3403
|
}
|
|
4535
3404
|
}
|
|
4536
3405
|
|
|
4537
|
-
export interface ContractListBalancesParams {
|
|
3406
|
+
export interface ContractListBalancesParams extends BodyCursorPageParams {
|
|
4538
3407
|
customer_id: string;
|
|
4539
3408
|
|
|
4540
3409
|
id?: string;
|
|
@@ -4571,16 +3440,6 @@ export interface ContractListBalancesParams {
|
|
|
4571
3440
|
*/
|
|
4572
3441
|
include_ledgers?: boolean;
|
|
4573
3442
|
|
|
4574
|
-
/**
|
|
4575
|
-
* The maximum number of commits to return. Defaults to 25.
|
|
4576
|
-
*/
|
|
4577
|
-
limit?: number;
|
|
4578
|
-
|
|
4579
|
-
/**
|
|
4580
|
-
* The next page token from a previous response.
|
|
4581
|
-
*/
|
|
4582
|
-
next_page?: string;
|
|
4583
|
-
|
|
4584
3443
|
/**
|
|
4585
3444
|
* Include only balances that have any access on or after the provided date
|
|
4586
3445
|
*/
|
|
@@ -4774,9 +3633,7 @@ export interface ContractUpdateEndDateParams {
|
|
|
4774
3633
|
}
|
|
4775
3634
|
|
|
4776
3635
|
Contracts.Products = Products;
|
|
4777
|
-
Contracts.ProductListResponsesCursorPage = ProductListResponsesCursorPage;
|
|
4778
3636
|
Contracts.RateCards = RateCards;
|
|
4779
|
-
Contracts.RateCardListResponsesCursorPage = RateCardListResponsesCursorPage;
|
|
4780
3637
|
Contracts.NamedSchedules = NamedSchedules;
|
|
4781
3638
|
|
|
4782
3639
|
export declare namespace Contracts {
|
|
@@ -4792,6 +3649,7 @@ export declare namespace Contracts {
|
|
|
4792
3649
|
type ContractRetrieveSubscriptionQuantityHistoryResponse as ContractRetrieveSubscriptionQuantityHistoryResponse,
|
|
4793
3650
|
type ContractScheduleProServicesInvoiceResponse as ContractScheduleProServicesInvoiceResponse,
|
|
4794
3651
|
type ContractUpdateEndDateResponse as ContractUpdateEndDateResponse,
|
|
3652
|
+
type ContractListBalancesResponsesBodyCursorPage as ContractListBalancesResponsesBodyCursorPage,
|
|
4795
3653
|
type ContractCreateParams as ContractCreateParams,
|
|
4796
3654
|
type ContractRetrieveParams as ContractRetrieveParams,
|
|
4797
3655
|
type ContractListParams as ContractListParams,
|
|
@@ -4817,7 +3675,7 @@ export declare namespace Contracts {
|
|
|
4817
3675
|
type ProductUpdateResponse as ProductUpdateResponse,
|
|
4818
3676
|
type ProductListResponse as ProductListResponse,
|
|
4819
3677
|
type ProductArchiveResponse as ProductArchiveResponse,
|
|
4820
|
-
ProductListResponsesCursorPage as ProductListResponsesCursorPage,
|
|
3678
|
+
type ProductListResponsesCursorPage as ProductListResponsesCursorPage,
|
|
4821
3679
|
type ProductCreateParams as ProductCreateParams,
|
|
4822
3680
|
type ProductRetrieveParams as ProductRetrieveParams,
|
|
4823
3681
|
type ProductUpdateParams as ProductUpdateParams,
|
|
@@ -4833,7 +3691,7 @@ export declare namespace Contracts {
|
|
|
4833
3691
|
type RateCardListResponse as RateCardListResponse,
|
|
4834
3692
|
type RateCardArchiveResponse as RateCardArchiveResponse,
|
|
4835
3693
|
type RateCardRetrieveRateScheduleResponse as RateCardRetrieveRateScheduleResponse,
|
|
4836
|
-
RateCardListResponsesCursorPage as RateCardListResponsesCursorPage,
|
|
3694
|
+
type RateCardListResponsesCursorPage as RateCardListResponsesCursorPage,
|
|
4837
3695
|
type RateCardCreateParams as RateCardCreateParams,
|
|
4838
3696
|
type RateCardRetrieveParams as RateCardRetrieveParams,
|
|
4839
3697
|
type RateCardUpdateParams as RateCardUpdateParams,
|