diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2ba3df23..9a5af48e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,12 +7,17 @@ on: - 'integrated/**' - 'stl-preview-head/**' - 'stl-preview-base/**' + pull_request: + branches-ignore: + - 'stl-preview-head/**' + - 'stl-preview-base/**' jobs: lint: timeout-minutes: 10 name: lint runs-on: ${{ github.repository == 'stainless-sdks/orb-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - uses: actions/checkout@v4 @@ -31,6 +36,7 @@ jobs: timeout-minutes: 5 name: build runs-on: ${{ github.repository == 'stainless-sdks/orb-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork permissions: contents: read id-token: write @@ -66,6 +72,7 @@ jobs: timeout-minutes: 10 name: test runs-on: ${{ github.repository == 'stainless-sdks/orb-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - uses: actions/checkout@v4 diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 32dbe0e2..affd1ab3 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "5.0.0" + ".": "5.1.0" } diff --git a/.stats.yml b/.stats.yml index 645b4c0b..9450f45c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 116 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-c2a4808c828c8288c5c8dfe2fdfa51d4d7c1bcc33cacc6b859d0cf4b35ce95cc.yml -openapi_spec_hash: a2b5a1bfabbd03dd1b411791576eb502 -config_hash: 3c3524be9607afb24d2139ce26ce5389 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-612316c13276a207f56e2e2c7bbc68f4bb73de85e3661595a23f23d9ccc80276.yml +openapi_spec_hash: 6e125f05e40521ec485edf6e15beec2e +config_hash: 8c9a47f104c777e2a1e8f3fad15c093b diff --git a/CHANGELOG.md b/CHANGELOG.md index a3021d0e..2cd1c7a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,44 @@ # Changelog +## 5.1.0 (2025-07-17) + +Full Changelog: [v5.0.0...v5.1.0](https://github.com/orbcorp/orb-node/compare/v5.0.0...v5.1.0) + +### Features + +* **api:** api update ([5f861b0](https://github.com/orbcorp/orb-node/commit/5f861b076256a7172ff83a2adee978632324665b)) +* **api:** api update ([1939793](https://github.com/orbcorp/orb-node/commit/19397931ab0cfc5a7582995af8027117878047ea)) +* **api:** api update ([54fb67f](https://github.com/orbcorp/orb-node/commit/54fb67f3f221e4d10f388540e2181bc3f2048780)) +* **api:** api update ([b4f8f97](https://github.com/orbcorp/orb-node/commit/b4f8f973a593a4d09e46035dca03475ac39b834c)) +* **api:** api update ([ecfef87](https://github.com/orbcorp/orb-node/commit/ecfef87e64aaaf582ee484eb6a55d3c016c33d49)) +* **api:** api update ([fc96b5b](https://github.com/orbcorp/orb-node/commit/fc96b5bb78c87225c26e9d02fd42b473daf6cb8c)) +* **api:** api update ([44d2c02](https://github.com/orbcorp/orb-node/commit/44d2c02d887d0e09c32d3a7738de8b31c8421b1c)) +* **api:** api update ([81496fc](https://github.com/orbcorp/orb-node/commit/81496fc6baf0b872a705372289effad7992fb025)) +* **api:** api update ([63e9ce1](https://github.com/orbcorp/orb-node/commit/63e9ce18c1f8ed120cf360fcc58931f8ed9e7e7a)) +* **client:** add support for endpoint-specific base URLs ([0e61c32](https://github.com/orbcorp/orb-node/commit/0e61c325001e2ce26b26b2a5f70658d8e91a4458)) + + +### Bug Fixes + +* **ci:** release-doctor — report correct token name ([d9bddc1](https://github.com/orbcorp/orb-node/commit/d9bddc13b51bb6854ef04e86da16300dd9a86606)) +* **client:** don't send `Content-Type` for bodyless methods ([33ba457](https://github.com/orbcorp/orb-node/commit/33ba457255b066c8ee465be2e0fb63c3956de9cc)) +* publish script — handle NPM errors correctly ([1678c34](https://github.com/orbcorp/orb-node/commit/1678c342b2abf1d2fc88e4e253b3c5ac7df4d9a0)) + + +### Chores + +* **ci:** enable for pull requests ([77a5b1e](https://github.com/orbcorp/orb-node/commit/77a5b1e22b94ce2c0a27bb2b4fb14359a4203ca4)) +* **ci:** only run for pushes and fork pull requests ([5b3d838](https://github.com/orbcorp/orb-node/commit/5b3d838882117c0c23284a0c9f9c2bb2c4add313)) +* **internal:** bump test timeout ([d89af51](https://github.com/orbcorp/orb-node/commit/d89af5103034c83a7b52b1a87f2bada06d118d66)) +* **internal:** make base APIResource abstract ([9a95185](https://github.com/orbcorp/orb-node/commit/9a95185ee2c315169985d08e5696ef4dd38a3e2b)) +* make some internal functions async ([c7e0dab](https://github.com/orbcorp/orb-node/commit/c7e0dab4ae701fa809d524fd9171d17359832fba)) +* mention unit type in timeout docs ([132b903](https://github.com/orbcorp/orb-node/commit/132b90306594db72d0c447402ce231e287e7908e)) + + +### Refactors + +* **types:** replace Record with mapped types ([509fcfb](https://github.com/orbcorp/orb-node/commit/509fcfb895402525e2d6ce1d6e8ca994ead496a8)) + ## 5.0.0 (2025-06-09) Full Changelog: [v4.74.0...v5.0.0](https://github.com/orbcorp/orb-node/compare/v4.74.0...v5.0.0) diff --git a/bin/check-release-environment b/bin/check-release-environment index 0077335b..e4b6d58e 100644 --- a/bin/check-release-environment +++ b/bin/check-release-environment @@ -3,7 +3,7 @@ errors=() if [ -z "${NPM_TOKEN}" ]; then - errors+=("The ORB_NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets") + errors+=("The NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets") fi lenErrors=${#errors[@]} diff --git a/bin/publish-npm b/bin/publish-npm index 2505deca..fa2243d2 100644 --- a/bin/publish-npm +++ b/bin/publish-npm @@ -7,15 +7,35 @@ npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN" yarn build cd dist +# Get package name and version from package.json +PACKAGE_NAME="$(jq -r -e '.name' ./package.json)" +VERSION="$(jq -r -e '.version' ./package.json)" + # Get latest version from npm # -# If the package doesn't exist, yarn will return -# {"type":"error","data":"Received invalid response from npm."} -# where .data.version doesn't exist so LAST_VERSION will be an empty string. -LAST_VERSION="$(yarn info --json 2> /dev/null | jq -r '.data.version')" - -# Get current version from package.json -VERSION="$(node -p "require('./package.json').version")" +# If the package doesn't exist, npm will return: +# { +# "error": { +# "code": "E404", +# "summary": "Unpublished on 2025-06-05T09:54:53.528Z", +# "detail": "'the_package' is not in this registry..." +# } +# } +NPM_INFO="$(npm view "$PACKAGE_NAME" version --json 2>/dev/null || true)" + +# Check if we got an E404 error +if echo "$NPM_INFO" | jq -e '.error.code == "E404"' > /dev/null 2>&1; then + # Package doesn't exist yet, no last version + LAST_VERSION="" +elif echo "$NPM_INFO" | jq -e '.error' > /dev/null 2>&1; then + # Report other errors + echo "ERROR: npm returned unexpected data:" + echo "$NPM_INFO" + exit 1 +else + # Success - get the version + LAST_VERSION=$(echo "$NPM_INFO" | jq -r '.') # strip quotes +fi # Check if current version is pre-release (e.g. alpha / beta / rc) CURRENT_IS_PRERELEASE=false diff --git a/package.json b/package.json index 8ba0ddf9..2ddf281a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "orb-billing", - "version": "5.0.0", + "version": "5.1.0", "description": "The official TypeScript library for the Orb API", "author": "Orb ", "types": "dist/index.d.ts", diff --git a/scripts/build b/scripts/build index 1ada5a8a..00b0d511 100755 --- a/scripts/build +++ b/scripts/build @@ -28,7 +28,7 @@ fi node scripts/utils/make-dist-package-json.cjs > dist/package.json # build to .js/.mjs/.d.ts files -npm exec tsc-multi +./node_modules/.bin/tsc-multi # copy over handwritten .js/.mjs/.d.ts files cp src/_shims/*.{d.ts,js,mjs,md} dist/_shims cp src/_shims/auto/*.{d.ts,js,mjs} dist/_shims/auto diff --git a/scripts/test b/scripts/test index 2049e31b..15ab9e80 100755 --- a/scripts/test +++ b/scripts/test @@ -53,4 +53,4 @@ else fi echo "==> Running tests" -./node_modules/.bin/jest "$@" +./node_modules/.bin/jest --testTimeout=60000 "$@" diff --git a/src/core.ts b/src/core.ts index ef9b57bc..7a4f4852 100644 --- a/src/core.ts +++ b/src/core.ts @@ -170,6 +170,7 @@ export class APIPromise extends Promise { export abstract class APIClient { baseURL: string; + #baseURLOverridden: boolean; maxRetries: number; timeout: number; httpAgent: Agent | undefined; @@ -179,18 +180,21 @@ export abstract class APIClient { constructor({ baseURL, + baseURLOverridden, maxRetries = 2, timeout = 60000, // 1 minute httpAgent, fetch: overriddenFetch, }: { baseURL: string; + baseURLOverridden: boolean; maxRetries?: number | undefined; timeout: number | undefined; httpAgent: Agent | undefined; fetch: Fetch | undefined; }) { this.baseURL = baseURL; + this.#baseURLOverridden = baseURLOverridden; this.maxRetries = validatePositiveInteger('maxRetries', maxRetries); this.timeout = validatePositiveInteger('timeout', timeout); this.httpAgent = httpAgent; @@ -213,7 +217,7 @@ export abstract class APIClient { protected defaultHeaders(opts: FinalRequestOptions): Headers { return { Accept: 'application/json', - 'Content-Type': 'application/json', + ...(['head', 'get'].includes(opts.method) ? {} : { 'Content-Type': 'application/json' }), 'User-Agent': this.getUserAgent(), ...getPlatformHeaders(), ...this.authHeaders(opts), @@ -295,12 +299,12 @@ export abstract class APIClient { return null; } - buildRequest( + async buildRequest( inputOptions: FinalRequestOptions, { retryCount = 0 }: { retryCount?: number } = {}, - ): { req: RequestInit; url: string; timeout: number } { + ): Promise<{ req: RequestInit; url: string; timeout: number }> { const options = { ...inputOptions }; - const { method, path, query, headers: headers = {} } = options; + const { method, path, query, defaultBaseURL, headers: headers = {} } = options; const body = ArrayBuffer.isView(options.body) || (options.__binaryRequest && typeof options.body === 'string') ? @@ -310,7 +314,7 @@ export abstract class APIClient { : null; const contentLength = this.calculateContentLength(body); - const url = this.buildURL(path!, query); + const url = this.buildURL(path!, query, defaultBaseURL); if ('timeout' in options) validatePositiveInteger('timeout', options.timeout); options.timeout = options.timeout ?? this.timeout; const httpAgent = options.httpAgent ?? this.httpAgent ?? getDefaultAgent(url); @@ -446,7 +450,9 @@ export abstract class APIClient { await this.prepareOptions(options); - const { req, url, timeout } = this.buildRequest(options, { retryCount: maxRetries - retriesRemaining }); + const { req, url, timeout } = await this.buildRequest(options, { + retryCount: maxRetries - retriesRemaining, + }); await this.prepareRequest(req, { url, options }); @@ -503,11 +509,12 @@ export abstract class APIClient { return new PagePromise(this, request, Page); } - buildURL(path: string, query: Req | null | undefined): string { + buildURL(path: string, query: Req | null | undefined, defaultBaseURL?: string | undefined): string { + const baseURL = (!this.#baseURLOverridden && defaultBaseURL) || this.baseURL; const url = isAbsoluteURL(path) ? new URL(path) - : new URL(this.baseURL + (this.baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path)); + : new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path)); const defaultQuery = this.defaultQuery(); if (!isEmptyObj(defaultQuery)) { @@ -792,6 +799,7 @@ export type RequestOptions< query?: Req | undefined; body?: Req | null | undefined; headers?: Headers | undefined; + defaultBaseURL?: string | undefined; maxRetries?: number; stream?: boolean | undefined; @@ -813,6 +821,7 @@ const requestOptionsKeys: KeysEnum = { query: true, body: true, headers: true, + defaultBaseURL: true, maxRetries: true, stream: true, diff --git a/src/index.ts b/src/index.ts index 493e394a..36cbde95 100644 --- a/src/index.ts +++ b/src/index.ts @@ -208,6 +208,8 @@ export interface ClientOptions { * * Note that request timeouts are retried by default, so in a worst-case scenario you may wait * much longer than this timeout before the promise succeeds or fails. + * + * @unit milliseconds */ timeout?: number | undefined; @@ -295,6 +297,7 @@ export class Orb extends Core.APIClient { super({ baseURL: options.baseURL!, + baseURLOverridden: baseURL ? baseURL !== 'https://api.withorb.com/v1' : false, timeout: options.timeout ?? 60000 /* 1 minute */, httpAgent: options.httpAgent, maxRetries: options.maxRetries, @@ -326,6 +329,13 @@ export class Orb extends Core.APIClient { dimensionalPriceGroups: API.DimensionalPriceGroups = new API.DimensionalPriceGroups(this); subscriptionChanges: API.SubscriptionChanges = new API.SubscriptionChanges(this); + /** + * Check whether the base URL is set to its default. + */ + #baseURLOverridden(): boolean { + return this.baseURL !== 'https://api.withorb.com/v1'; + } + protected override defaultQuery(): Core.DefaultQuery | undefined { return this._options.defaultQuery; } diff --git a/src/resource.ts b/src/resource.ts index 42de2e41..63351db5 100644 --- a/src/resource.ts +++ b/src/resource.ts @@ -2,7 +2,7 @@ import type { Orb } from './index'; -export class APIResource { +export abstract class APIResource { protected _client: Orb; constructor(client: Orb) { diff --git a/src/resources/credit-notes.ts b/src/resources/credit-notes.ts index bbbb2a17..1b2467ea 100644 --- a/src/resources/credit-notes.ts +++ b/src/resources/credit-notes.ts @@ -11,6 +11,31 @@ export class CreditNotes extends APIResource { /** * This endpoint is used to create a single * [`Credit Note`](/invoicing/credit-notes). + * + * The credit note service period configuration supports two explicit modes: + * + * 1. Global service periods: Specify start_date and end_date at the credit note + * level. These dates will be applied to all line items uniformly. + * + * 2. Individual service periods: Specify start_date and end_date for each line + * item. When using this mode, ALL line items must have individual periods + * specified. + * + * 3. Default behavior: If no service periods are specified (neither global nor + * individual), the original invoice line item service periods will be used. + * + * Note: Mixing global and individual service periods in the same request is not + * allowed to prevent confusion. + * + * Service period dates are normalized to the start of the day in the customer's + * timezone to ensure consistent handling across different timezones. + * + * Date Format: Use start_date and end_date with format "YYYY-MM-DD" (e.g., + * "2023-09-22") to match other Orb APIs like /v1/invoice_line_items. + * + * Note: Both start_date and end_date are inclusive - the service period will cover + * both the start date and end date completely (from start of start_date to end of + * end_date). */ create(body: CreditNoteCreateParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post('/credit_notes', { body, ...options }); @@ -53,10 +78,26 @@ export interface CreditNoteCreateParams { */ reason: 'duplicate' | 'fraudulent' | 'order_change' | 'product_unsatisfactory'; + /** + * A date string to specify the global credit note service period end date in the + * customer's timezone. This will be applied to all line items that don't have + * their own individual service periods specified. If not provided, line items will + * use their original invoice line item service periods. This date is inclusive. + */ + end_date?: string | null; + /** * An optional memo to attach to the credit note. */ memo?: string | null; + + /** + * A date string to specify the global credit note service period start date in the + * customer's timezone. This will be applied to all line items that don't have + * their own individual service periods specified. If not provided, line items will + * use their original invoice line item service periods. This date is inclusive. + */ + start_date?: string | null; } export namespace CreditNoteCreateParams { @@ -70,6 +111,23 @@ export namespace CreditNoteCreateParams { * The ID of the line item to credit. */ invoice_line_item_id: string; + + /** + * A date string to specify this line item's credit note service period end date in + * the customer's timezone. If provided, this will be used for this specific line + * item. If not provided, will use the global end_date if available, otherwise + * defaults to the original invoice line item's end date. This date is inclusive. + */ + end_date?: string | null; + + /** + * A date string to specify this line item's credit note service period start date + * in the customer's timezone. If provided, this will be used for this specific + * line item. If not provided, will use the global start_date if available, + * otherwise defaults to the original invoice line item's start date. This date is + * inclusive. + */ + start_date?: string | null; } } diff --git a/src/resources/customers/costs.ts b/src/resources/customers/costs.ts index 0ab9e1a0..b7a76c00 100644 --- a/src/resources/customers/costs.ts +++ b/src/resources/customers/costs.ts @@ -60,17 +60,17 @@ export class Costs extends APIResource { * * A customer that uses a few API calls a day but has a minimum commitment might * exhibit the following pattern for their subtotal and total in the first few days - * of the month. Here, we assume that each API call is $2.50, the customer's plan - * has a monthly minimum of $50 for this price, and that the subscription's billing - * period bounds are aligned to the first of the month: + * of the month. Here, we assume that each API call is \$2.50, the customer's plan + * has a monthly minimum of \$50 for this price, and that the subscription's + * billing period bounds are aligned to the first of the month: * * | timeframe_start | timeframe_end | Cumulative usage | Subtotal | Total (incl. commitment) | * | --------------- | ------------- | ---------------- | -------- | ------------------------ | - * | 2023-02-01 | 2023-02-02 | 9 | $22.50 | $50.00 | - * | 2023-02-01 | 2023-02-03 | 19 | $47.50 | $50.00 | - * | 2023-02-01 | 2023-02-04 | 20 | $50.00 | $50.00 | - * | 2023-02-01 | 2023-02-05 | 28 | $70.00 | $70.00 | - * | 2023-02-01 | 2023-02-06 | 36 | $90.00 | $90.00 | + * | 2023-02-01 | 2023-02-02 | 9 | \$22.50 | \$50.00 | + * | 2023-02-01 | 2023-02-03 | 19 | \$47.50 | \$50.00 | + * | 2023-02-01 | 2023-02-04 | 20 | \$50.00 | \$50.00 | + * | 2023-02-01 | 2023-02-05 | 28 | \$70.00 | \$70.00 | + * | 2023-02-01 | 2023-02-06 | 36 | \$90.00 | \$90.00 | * * ### Periodic values * @@ -196,17 +196,17 @@ export class Costs extends APIResource { * * A customer that uses a few API calls a day but has a minimum commitment might * exhibit the following pattern for their subtotal and total in the first few days - * of the month. Here, we assume that each API call is $2.50, the customer's plan - * has a monthly minimum of $50 for this price, and that the subscription's billing - * period bounds are aligned to the first of the month: + * of the month. Here, we assume that each API call is \$2.50, the customer's plan + * has a monthly minimum of \$50 for this price, and that the subscription's + * billing period bounds are aligned to the first of the month: * * | timeframe_start | timeframe_end | Cumulative usage | Subtotal | Total (incl. commitment) | * | --------------- | ------------- | ---------------- | -------- | ------------------------ | - * | 2023-02-01 | 2023-02-02 | 9 | $22.50 | $50.00 | - * | 2023-02-01 | 2023-02-03 | 19 | $47.50 | $50.00 | - * | 2023-02-01 | 2023-02-04 | 20 | $50.00 | $50.00 | - * | 2023-02-01 | 2023-02-05 | 28 | $70.00 | $70.00 | - * | 2023-02-01 | 2023-02-06 | 36 | $90.00 | $90.00 | + * | 2023-02-01 | 2023-02-02 | 9 | \$22.50 | \$50.00 | + * | 2023-02-01 | 2023-02-03 | 19 | \$47.50 | \$50.00 | + * | 2023-02-01 | 2023-02-04 | 20 | \$50.00 | \$50.00 | + * | 2023-02-01 | 2023-02-05 | 28 | \$70.00 | \$70.00 | + * | 2023-02-01 | 2023-02-06 | 36 | \$90.00 | \$90.00 | * * ### Periodic values * diff --git a/src/resources/customers/credits/ledger.ts b/src/resources/customers/credits/ledger.ts index 1a24ae4f..d2dbc33e 100644 --- a/src/resources/customers/credits/ledger.ts +++ b/src/resources/customers/credits/ledger.ts @@ -46,8 +46,8 @@ export class Ledger extends APIResource { * deductions take place from a non-expiring credit block. * * If there are multiple blocks with the same expiration date, Orb will deduct from - * the block with the _lower cost basis_ first (e.g. trial credits with a $0 cost - * basis before paid credits with a $5.00 cost basis). + * the block with the _lower cost basis_ first (e.g. trial credits with a \$0 cost + * basis before paid credits with a \$5.00 cost basis). * * It's also possible for a single usage event's deduction to _span_ credit blocks. * In this case, Orb will deduct from the next block, ending at the credit block @@ -395,8 +395,8 @@ export class Ledger extends APIResource { * deductions take place from a non-expiring credit block. * * If there are multiple blocks with the same expiration date, Orb will deduct from - * the block with the _lower cost basis_ first (e.g. trial credits with a $0 cost - * basis before paid credits with a $5.00 cost basis). + * the block with the _lower cost basis_ first (e.g. trial credits with a \$0 cost + * basis before paid credits with a \$5.00 cost basis). * * It's also possible for a single usage event's deduction to _span_ credit blocks. * In this case, Orb will deduct from the next block, ending at the credit block @@ -505,7 +505,7 @@ export interface AmendmentLedgerEntry { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; starting_balance: number; } @@ -539,7 +539,7 @@ export interface CreditBlockExpiryLedgerEntry { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; starting_balance: number; } @@ -573,7 +573,7 @@ export interface DecrementLedgerEntry { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; starting_balance: number; @@ -613,7 +613,7 @@ export interface ExpirationChangeLedgerEntry { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; new_block_expiry_date: string | null; @@ -649,7 +649,7 @@ export interface IncrementLedgerEntry { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; starting_balance: number; @@ -688,7 +688,7 @@ export interface VoidInitiatedLedgerEntry { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; new_block_expiry_date: string; @@ -728,7 +728,7 @@ export interface VoidLedgerEntry { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; starting_balance: number; @@ -872,7 +872,7 @@ export declare namespace LedgerCreateEntryParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * Can only be specified when entry_type=increment. How much, in the customer's @@ -902,6 +902,13 @@ export declare namespace LedgerCreateEntryParams { */ net_terms: number; + /** + * An ISO 8601 format date that denotes when this invoice should be dated in the + * customer's timezone. If not provided, the invoice date will default to the + * credit block's effective date. + */ + invoice_date?: (string & {}) | (string & {}) | null; + /** * An optional memo to display on the invoice. */ @@ -942,17 +949,12 @@ export declare namespace LedgerCreateEntryParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface AddExpirationChangeCreditLedgerEntryRequestParams { entry_type: 'expiration_change'; - /** - * An ISO 8601 format date that identifies the origination credit block to expire - */ - expiry_date: string | null; - /** * A future date (specified in YYYY-MM-DD format) used for expiration change, * denoting when credits transferred (as part of a partial block expiration) should @@ -985,12 +987,17 @@ export declare namespace LedgerCreateEntryParams { */ description?: string | null; + /** + * An ISO 8601 format date that identifies the origination credit block to expire + */ + expiry_date?: string | null; + /** * User-specified key/value pairs for the resource. Individual keys can be removed * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface AddVoidCreditLedgerEntryRequestParams { @@ -1025,7 +1032,7 @@ export declare namespace LedgerCreateEntryParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * Can only be specified when `entry_type=void`. The reason for the void. @@ -1065,7 +1072,7 @@ export declare namespace LedgerCreateEntryParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } } @@ -1123,7 +1130,7 @@ export declare namespace LedgerCreateEntryByExternalIDParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * Can only be specified when entry_type=increment. How much, in the customer's @@ -1153,6 +1160,13 @@ export declare namespace LedgerCreateEntryByExternalIDParams { */ net_terms: number; + /** + * An ISO 8601 format date that denotes when this invoice should be dated in the + * customer's timezone. If not provided, the invoice date will default to the + * credit block's effective date. + */ + invoice_date?: (string & {}) | (string & {}) | null; + /** * An optional memo to display on the invoice. */ @@ -1193,17 +1207,12 @@ export declare namespace LedgerCreateEntryByExternalIDParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface AddExpirationChangeCreditLedgerEntryRequestParams { entry_type: 'expiration_change'; - /** - * An ISO 8601 format date that identifies the origination credit block to expire - */ - expiry_date: string | null; - /** * A future date (specified in YYYY-MM-DD format) used for expiration change, * denoting when credits transferred (as part of a partial block expiration) should @@ -1236,12 +1245,17 @@ export declare namespace LedgerCreateEntryByExternalIDParams { */ description?: string | null; + /** + * An ISO 8601 format date that identifies the origination credit block to expire + */ + expiry_date?: string | null; + /** * User-specified key/value pairs for the resource. Individual keys can be removed * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface AddVoidCreditLedgerEntryRequestParams { @@ -1276,7 +1290,7 @@ export declare namespace LedgerCreateEntryByExternalIDParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * Can only be specified when `entry_type=void`. The reason for the void. @@ -1316,7 +1330,7 @@ export declare namespace LedgerCreateEntryByExternalIDParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } } diff --git a/src/resources/customers/customers.ts b/src/resources/customers/customers.ts index 8d6586a2..52309f77 100644 --- a/src/resources/customers/customers.ts +++ b/src/resources/customers/customers.ts @@ -273,7 +273,7 @@ export interface Customer { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; /** * The full name of the customer @@ -546,7 +546,7 @@ export interface CustomerCreateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * This is used for creating charges or invoices in an external system via Orb. @@ -731,7 +731,7 @@ export interface CustomerUpdateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * The full name of the customer @@ -928,7 +928,7 @@ export interface CustomerUpdateByExternalIDParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * The full name of the customer diff --git a/src/resources/dimensional-price-groups/dimensional-price-groups.ts b/src/resources/dimensional-price-groups/dimensional-price-groups.ts index aca2e1fa..189d7c2c 100644 --- a/src/resources/dimensional-price-groups/dimensional-price-groups.ts +++ b/src/resources/dimensional-price-groups/dimensional-price-groups.ts @@ -94,7 +94,7 @@ export interface DimensionalPriceGroup { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; /** * The name of the dimensional price group @@ -125,7 +125,7 @@ export interface DimensionalPriceGroupCreateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface DimensionalPriceGroupListParams extends PageParams {} diff --git a/src/resources/events/backfills.ts b/src/resources/events/backfills.ts index 77449333..7a6f6ed3 100644 --- a/src/resources/events/backfills.ts +++ b/src/resources/events/backfills.ts @@ -384,14 +384,14 @@ export interface BackfillRevertResponse { export interface BackfillCreateParams { /** * The (exclusive) end of the usage timeframe affected by this backfill. By - * default, Orb allows backfills up to 10 days in duration at a time. Reach out to + * default, Orb allows backfills up to 31 days in duration at a time. Reach out to * discuss extending this limit and your use case. */ timeframe_end: string; /** * The (inclusive) start of the usage timeframe affected by this backfill. By - * default, Orb allows backfills up to 10 days in duration at a time. Reach out to + * default, Orb allows backfills up to 31 days in duration at a time. Reach out to * discuss extending this limit and your use case. */ timeframe_start: string; diff --git a/src/resources/events/events.ts b/src/resources/events/events.ts index b1899870..1b9221b0 100644 --- a/src/resources/events/events.ts +++ b/src/resources/events/events.ts @@ -451,7 +451,7 @@ export namespace EventSearchResponse { * A dictionary of custom properties. Values in this dictionary must be numeric, * boolean, or strings. Nested dictionaries are disallowed. */ - properties: Record; + properties: { [key: string]: unknown }; /** * An ISO 8601 format date with no timezone offset (i.e. UTC). This should @@ -472,7 +472,7 @@ export interface EventUpdateParams { * A dictionary of custom properties. Values in this dictionary must be numeric, * boolean, or strings. Nested dictionaries are disallowed. */ - properties: Record; + properties: { [key: string]: unknown }; /** * An ISO 8601 format date with no timezone offset (i.e. UTC). This should @@ -530,7 +530,7 @@ export namespace EventIngestParams { * A dictionary of custom properties. Values in this dictionary must be numeric, * boolean, or strings. Nested dictionaries are disallowed. */ - properties: Record; + properties: { [key: string]: unknown }; /** * An ISO 8601 format date with no timezone offset (i.e. UTC). This should diff --git a/src/resources/invoice-line-items.ts b/src/resources/invoice-line-items.ts index 6d0f452c..153faf70 100644 --- a/src/resources/invoice-line-items.ts +++ b/src/resources/invoice-line-items.ts @@ -53,6 +53,9 @@ export interface InvoiceLineItemCreateResponse { */ credits_applied: string; + /** + * @deprecated This field is deprecated in favor of `adjustments` + */ discount: Shared.Discount | null; /** diff --git a/src/resources/invoices.ts b/src/resources/invoices.ts index e1c83dfd..d0887ed8 100644 --- a/src/resources/invoices.ts +++ b/src/resources/invoices.ts @@ -131,7 +131,7 @@ export class Invoices extends APIResource { * * If the associated invoice has used the customer balance to change the amount * due, the customer balance operation will be reverted. For example, if the - * invoice used $10 of customer balance, that amount will be added back to the + * invoice used \$10 of customer balance, that amount will be added back to the * customer balance upon voiding. * * If the invoice was used to purchase a credit block, but the invoice is not yet @@ -358,7 +358,7 @@ export interface InvoiceFetchUpcomingResponse { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; minimum: Shared.Minimum | null; @@ -575,6 +575,9 @@ export namespace InvoiceFetchUpcomingResponse { */ credits_applied: string; + /** + * @deprecated This field is deprecated in favor of `adjustments` + */ discount: Shared.Discount | null; /** @@ -754,7 +757,7 @@ export interface InvoiceCreateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * When true, this invoice will be submitted for issuance upon creation. When @@ -800,7 +803,7 @@ export interface InvoiceUpdateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface InvoiceListParams extends PageParams { diff --git a/src/resources/items.ts b/src/resources/items.ts index dd90085c..06a4eec7 100644 --- a/src/resources/items.ts +++ b/src/resources/items.ts @@ -71,7 +71,7 @@ export interface Item { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; name: string; } @@ -102,7 +102,7 @@ export interface ItemCreateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface ItemUpdateParams { @@ -113,7 +113,7 @@ export interface ItemUpdateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; name?: string | null; } diff --git a/src/resources/metrics.ts b/src/resources/metrics.ts index dae7856d..47662568 100644 --- a/src/resources/metrics.ts +++ b/src/resources/metrics.ts @@ -83,7 +83,7 @@ export interface BillableMetric { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; name: string; @@ -116,7 +116,7 @@ export interface MetricCreateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface MetricUpdateParams { @@ -125,7 +125,7 @@ export interface MetricUpdateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface MetricListParams extends PageParams { diff --git a/src/resources/plans/external-plan-id.ts b/src/resources/plans/external-plan-id.ts index 395a2044..e936d0f7 100644 --- a/src/resources/plans/external-plan-id.ts +++ b/src/resources/plans/external-plan-id.ts @@ -55,7 +55,7 @@ export interface ExternalPlanIDUpdateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export declare namespace ExternalPlanID { diff --git a/src/resources/plans/plans.ts b/src/resources/plans/plans.ts index c80a6428..2c3c1c79 100644 --- a/src/resources/plans/plans.ts +++ b/src/resources/plans/plans.ts @@ -152,7 +152,7 @@ export interface Plan { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; /** * @deprecated @@ -265,36 +265,13 @@ export interface PlanCreateParams { * Prices for this plan. If the plan has phases, this includes prices across all * phases of the plan. */ - prices: Array< - | Shared.NewPlanUnitPrice - | Shared.NewPlanPackagePrice - | Shared.NewPlanMatrixPrice - | Shared.NewPlanTieredPrice - | Shared.NewPlanTieredBPSPrice - | Shared.NewPlanBPSPrice - | Shared.NewPlanBulkBPSPrice - | Shared.NewPlanBulkPrice - | Shared.NewPlanThresholdTotalAmountPrice - | Shared.NewPlanTieredPackagePrice - | Shared.NewPlanTieredWithMinimumPrice - | Shared.NewPlanUnitWithPercentPrice - | Shared.NewPlanPackageWithAllocationPrice - | Shared.NewPlanTierWithProrationPrice - | Shared.NewPlanUnitWithProrationPrice - | Shared.NewPlanGroupedAllocationPrice - | Shared.NewPlanGroupedWithProratedMinimumPrice - | Shared.NewPlanGroupedWithMeteredMinimumPrice - | Shared.NewPlanMatrixWithDisplayNamePrice - | Shared.NewPlanBulkWithProrationPrice - | Shared.NewPlanGroupedTieredPackagePrice - | Shared.NewPlanMaxGroupTieredPackagePrice - | Shared.NewPlanScalableMatrixWithUnitPricingPrice - | Shared.NewPlanScalableMatrixWithTieredPricingPrice - | Shared.NewPlanCumulativeGroupedBulkPrice - | Shared.NewPlanTieredPackageWithMinimumPrice - | Shared.NewPlanMatrixWithAllocationPrice - | Shared.NewPlanGroupedTieredPrice - >; + prices: Array; + + /** + * Adjustments for this plan. If the plan has phases, this includes adjustments + * across all phases of the plan. + */ + adjustments?: Array | null; /** * Free-form text which is available on the invoice PDF and the Orb invoice portal. @@ -308,7 +285,7 @@ export interface PlanCreateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * The net terms determines the difference between the invoice date and the issue @@ -317,6 +294,12 @@ export interface PlanCreateParams { */ net_terms?: number | null; + /** + * Configuration of pre-defined phases, each with their own prices and adjustments. + * Leave unspecified for plans with a single phase. + */ + plan_phases?: Array | null; + /** * The status of the plan to create (either active or draft). If not specified, * this defaults to active. @@ -324,6 +307,91 @@ export interface PlanCreateParams { status?: 'active' | 'draft'; } +export namespace PlanCreateParams { + export interface Price { + /** + * The allocation price to add to the plan. + */ + allocation_price?: Shared.NewAllocationPrice | null; + + /** + * The phase to add this price to. + */ + plan_phase_order?: number | null; + + /** + * The price to add to the plan + */ + price?: + | Shared.NewPlanUnitPrice + | Shared.NewPlanPackagePrice + | Shared.NewPlanMatrixPrice + | Shared.NewPlanTieredPrice + | Shared.NewPlanTieredBPSPrice + | Shared.NewPlanBPSPrice + | Shared.NewPlanBulkBPSPrice + | Shared.NewPlanBulkPrice + | Shared.NewPlanThresholdTotalAmountPrice + | Shared.NewPlanTieredPackagePrice + | Shared.NewPlanTieredWithMinimumPrice + | Shared.NewPlanUnitWithPercentPrice + | Shared.NewPlanPackageWithAllocationPrice + | Shared.NewPlanTierWithProrationPrice + | Shared.NewPlanUnitWithProrationPrice + | Shared.NewPlanGroupedAllocationPrice + | Shared.NewPlanGroupedWithProratedMinimumPrice + | Shared.NewPlanGroupedWithMeteredMinimumPrice + | Shared.NewPlanMatrixWithDisplayNamePrice + | Shared.NewPlanBulkWithProrationPrice + | Shared.NewPlanGroupedTieredPackagePrice + | Shared.NewPlanMaxGroupTieredPackagePrice + | Shared.NewPlanScalableMatrixWithUnitPricingPrice + | Shared.NewPlanScalableMatrixWithTieredPricingPrice + | Shared.NewPlanCumulativeGroupedBulkPrice + | Shared.NewPlanTieredPackageWithMinimumPrice + | Shared.NewPlanMatrixWithAllocationPrice + | Shared.NewPlanGroupedTieredPrice + | null; + } + + export interface Adjustment { + /** + * The definition of a new adjustment to create and add to the plan. + */ + adjustment: + | Shared.NewPercentageDiscount + | Shared.NewUsageDiscount + | Shared.NewAmountDiscount + | Shared.NewMinimum + | Shared.NewMaximum; + + /** + * The phase to add this adjustment to. + */ + plan_phase_order?: number | null; + } + + export interface PlanPhase { + /** + * Determines the ordering of the phase in a plan's lifecycle. 1 = first phase. + */ + order: number; + + /** + * Align billing cycle day with phase start date. + */ + align_billing_with_phase_start_date?: boolean | null; + + /** + * How many terms of length `duration_unit` this phase is active for. If null, this + * phase is evergreen and active indefinitely + */ + duration?: number | null; + + duration_unit?: 'daily' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | null; + } +} + export interface PlanUpdateParams { /** * An optional user-defined ID for this plan resource, used throughout the system @@ -337,7 +405,7 @@ export interface PlanUpdateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface PlanListParams extends PageParams { diff --git a/src/resources/prices/external-price-id.ts b/src/resources/prices/external-price-id.ts index e335203c..89246196 100644 --- a/src/resources/prices/external-price-id.ts +++ b/src/resources/prices/external-price-id.ts @@ -34,7 +34,7 @@ export interface ExternalPriceIDUpdateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export declare namespace ExternalPriceID { diff --git a/src/resources/prices/prices.ts b/src/resources/prices/prices.ts index be947d79..76f5e564 100644 --- a/src/resources/prices/prices.ts +++ b/src/resources/prices/prices.ts @@ -203,6 +203,11 @@ export namespace PriceEvaluateMultipleResponse { */ price_groups: Array; + /** + * The external ID of the price + */ + external_price_id?: string | null; + /** * The index of the inline price */ @@ -231,6 +236,11 @@ export namespace PriceEvaluatePreviewEventsResponse { */ price_groups: Array; + /** + * The external ID of the price + */ + external_price_id?: string | null; + /** * The index of the inline price */ @@ -359,7 +369,7 @@ export declare namespace PriceCreateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingPackagePrice { @@ -447,7 +457,7 @@ export declare namespace PriceCreateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingMatrixPrice { @@ -535,7 +545,7 @@ export declare namespace PriceCreateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingMatrixWithAllocationPrice { @@ -623,7 +633,7 @@ export declare namespace PriceCreateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingTieredPrice { @@ -711,7 +721,7 @@ export declare namespace PriceCreateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingTieredBPSPrice { @@ -799,7 +809,7 @@ export declare namespace PriceCreateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingBPSPrice { @@ -887,7 +897,7 @@ export declare namespace PriceCreateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingBulkBPSPrice { @@ -975,7 +985,7 @@ export declare namespace PriceCreateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingBulkPrice { @@ -1063,7 +1073,7 @@ export declare namespace PriceCreateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingThresholdTotalAmountPrice { @@ -1089,7 +1099,7 @@ export declare namespace PriceCreateParams { */ name: string; - threshold_total_amount_config: Record; + threshold_total_amount_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -1151,7 +1161,7 @@ export declare namespace PriceCreateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingTieredPackagePrice { @@ -1177,7 +1187,7 @@ export declare namespace PriceCreateParams { */ name: string; - tiered_package_config: Record; + tiered_package_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -1239,7 +1249,7 @@ export declare namespace PriceCreateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingGroupedTieredPrice { @@ -1253,7 +1263,7 @@ export declare namespace PriceCreateParams { */ currency: string; - grouped_tiered_config: Record; + grouped_tiered_config: { [key: string]: unknown }; /** * The id of the item the price will be associated with. @@ -1327,7 +1337,7 @@ export declare namespace PriceCreateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingMaxGroupTieredPackagePrice { @@ -1346,7 +1356,7 @@ export declare namespace PriceCreateParams { */ item_id: string; - max_group_tiered_package_config: Record; + max_group_tiered_package_config: { [key: string]: unknown }; model_type: 'max_group_tiered_package'; @@ -1415,7 +1425,7 @@ export declare namespace PriceCreateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingTieredWithMinimumPrice { @@ -1441,7 +1451,7 @@ export declare namespace PriceCreateParams { */ name: string; - tiered_with_minimum_config: Record; + tiered_with_minimum_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -1503,7 +1513,7 @@ export declare namespace PriceCreateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingPackageWithAllocationPrice { @@ -1529,7 +1539,7 @@ export declare namespace PriceCreateParams { */ name: string; - package_with_allocation_config: Record; + package_with_allocation_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -1591,7 +1601,7 @@ export declare namespace PriceCreateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingTieredPackageWithMinimumPrice { @@ -1617,7 +1627,7 @@ export declare namespace PriceCreateParams { */ name: string; - tiered_package_with_minimum_config: Record; + tiered_package_with_minimum_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -1679,7 +1689,7 @@ export declare namespace PriceCreateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingUnitWithPercentPrice { @@ -1705,7 +1715,7 @@ export declare namespace PriceCreateParams { */ name: string; - unit_with_percent_config: Record; + unit_with_percent_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -1767,7 +1777,7 @@ export declare namespace PriceCreateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingTieredWithProrationPrice { @@ -1793,7 +1803,7 @@ export declare namespace PriceCreateParams { */ name: string; - tiered_with_proration_config: Record; + tiered_with_proration_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -1855,7 +1865,7 @@ export declare namespace PriceCreateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingUnitWithProrationPrice { @@ -1881,7 +1891,7 @@ export declare namespace PriceCreateParams { */ name: string; - unit_with_proration_config: Record; + unit_with_proration_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -1943,7 +1953,7 @@ export declare namespace PriceCreateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingGroupedAllocationPrice { @@ -1957,7 +1967,7 @@ export declare namespace PriceCreateParams { */ currency: string; - grouped_allocation_config: Record; + grouped_allocation_config: { [key: string]: unknown }; /** * The id of the item the price will be associated with. @@ -2031,7 +2041,7 @@ export declare namespace PriceCreateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingGroupedWithProratedMinimumPrice { @@ -2045,7 +2055,7 @@ export declare namespace PriceCreateParams { */ currency: string; - grouped_with_prorated_minimum_config: Record; + grouped_with_prorated_minimum_config: { [key: string]: unknown }; /** * The id of the item the price will be associated with. @@ -2119,7 +2129,7 @@ export declare namespace PriceCreateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingGroupedWithMeteredMinimumPrice { @@ -2133,7 +2143,7 @@ export declare namespace PriceCreateParams { */ currency: string; - grouped_with_metered_minimum_config: Record; + grouped_with_metered_minimum_config: { [key: string]: unknown }; /** * The id of the item the price will be associated with. @@ -2207,7 +2217,7 @@ export declare namespace PriceCreateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingMatrixWithDisplayNamePrice { @@ -2226,7 +2236,7 @@ export declare namespace PriceCreateParams { */ item_id: string; - matrix_with_display_name_config: Record; + matrix_with_display_name_config: { [key: string]: unknown }; model_type: 'matrix_with_display_name'; @@ -2295,11 +2305,11 @@ export declare namespace PriceCreateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingBulkWithProrationPrice { - bulk_with_proration_config: Record; + bulk_with_proration_config: { [key: string]: unknown }; /** * The cadence to bill for this price on. @@ -2383,7 +2393,7 @@ export declare namespace PriceCreateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingGroupedTieredPackagePrice { @@ -2397,7 +2407,7 @@ export declare namespace PriceCreateParams { */ currency: string; - grouped_tiered_package_config: Record; + grouped_tiered_package_config: { [key: string]: unknown }; /** * The id of the item the price will be associated with. @@ -2471,7 +2481,7 @@ export declare namespace PriceCreateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingScalableMatrixWithUnitPricingPrice { @@ -2497,7 +2507,7 @@ export declare namespace PriceCreateParams { */ name: string; - scalable_matrix_with_unit_pricing_config: Record; + scalable_matrix_with_unit_pricing_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -2559,7 +2569,7 @@ export declare namespace PriceCreateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingScalableMatrixWithTieredPricingPrice { @@ -2585,7 +2595,7 @@ export declare namespace PriceCreateParams { */ name: string; - scalable_matrix_with_tiered_pricing_config: Record; + scalable_matrix_with_tiered_pricing_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -2647,7 +2657,7 @@ export declare namespace PriceCreateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingCumulativeGroupedBulkPrice { @@ -2656,7 +2666,7 @@ export declare namespace PriceCreateParams { */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - cumulative_grouped_bulk_config: Record; + cumulative_grouped_bulk_config: { [key: string]: unknown }; /** * An ISO 4217 currency string for which this price is billed in. @@ -2735,7 +2745,7 @@ export declare namespace PriceCreateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } } @@ -2745,7 +2755,7 @@ export interface PriceUpdateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface PriceListParams extends PageParams {} @@ -2815,6 +2825,11 @@ export interface PriceEvaluateMultipleParams { export namespace PriceEvaluateMultipleParams { export interface PriceEvaluation { + /** + * The external ID of a price to evaluate that exists in your Orb account. + */ + external_price_id?: string | null; + /** * A boolean * [computed property](/extensibility/advanced-metrics#computed-properties) used to @@ -2914,7 +2929,7 @@ export namespace PriceEvaluatePreviewEventsParams { * A dictionary of custom properties. Values in this dictionary must be numeric, * boolean, or strings. Nested dictionaries are disallowed. */ - properties: Record; + properties: { [key: string]: unknown }; /** * An ISO 8601 format date with no timezone offset (i.e. UTC). This should @@ -2936,6 +2951,11 @@ export namespace PriceEvaluatePreviewEventsParams { } export interface PriceEvaluation { + /** + * The external ID of a price to evaluate that exists in your Orb account. + */ + external_price_id?: string | null; + /** * A boolean * [computed property](/extensibility/advanced-metrics#computed-properties) used to diff --git a/src/resources/shared.ts b/src/resources/shared.ts index 15dbe2e1..75c28477 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -412,6 +412,16 @@ export namespace CreditNote { * Any line item discounts from the invoice's line item. */ discounts?: Array; + + /** + * The end time of the service period for this credit note line item. + */ + end_time_exclusive?: string | null; + + /** + * The start time of the service period for this credit note line item. + */ + start_time_inclusive?: string | null; } export namespace LineItem { @@ -1012,7 +1022,7 @@ export interface Invoice { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; minimum: Minimum | null; @@ -1224,6 +1234,9 @@ export namespace Invoice { */ credits_applied: string; + /** + * @deprecated This field is deprecated in favor of `adjustments` + */ discount: Shared.Discount | null; /** @@ -1566,6 +1579,12 @@ export interface MonetaryAmountDiscountAdjustment { * The reason for the adjustment. */ reason: string | null; + + /** + * The adjustment id this adjustment replaces. This adjustment will take the place + * of the replaced adjustment in plan version migrations. + */ + replaces_adjustment_id: string | null; } export interface MonetaryMaximumAdjustment { @@ -1604,6 +1623,12 @@ export interface MonetaryMaximumAdjustment { * The reason for the adjustment. */ reason: string | null; + + /** + * The adjustment id this adjustment replaces. This adjustment will take the place + * of the replaced adjustment in plan version migrations. + */ + replaces_adjustment_id: string | null; } export interface MonetaryMinimumAdjustment { @@ -1647,6 +1672,12 @@ export interface MonetaryMinimumAdjustment { * The reason for the adjustment. */ reason: string | null; + + /** + * The adjustment id this adjustment replaces. This adjustment will take the place + * of the replaced adjustment in plan version migrations. + */ + replaces_adjustment_id: string | null; } export interface MonetaryPercentageDiscountAdjustment { @@ -1685,6 +1716,12 @@ export interface MonetaryPercentageDiscountAdjustment { * The reason for the adjustment. */ reason: string | null; + + /** + * The adjustment id this adjustment replaces. This adjustment will take the place + * of the replaced adjustment in plan version migrations. + */ + replaces_adjustment_id: string | null; } export interface MonetaryUsageDiscountAdjustment { @@ -1718,6 +1755,12 @@ export interface MonetaryUsageDiscountAdjustment { */ reason: string | null; + /** + * The adjustment id this adjustment replaces. This adjustment will take the place + * of the replaced adjustment in plan version migrations. + */ + replaces_adjustment_id: string | null; + /** * The number of usage units by which to discount the price this adjustment applies * to in a given billing period. @@ -1734,7 +1777,7 @@ export interface NewAllocationPrice { /** * The cadence at which to allocate the amount to the customer. */ - cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; + cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual'; /** * An ISO 4217 currency string or a custom pricing unit identifier in which to bill @@ -1911,7 +1954,7 @@ export interface NewFloatingBPSPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingBulkBPSPrice { @@ -1999,7 +2042,7 @@ export interface NewFloatingBulkBPSPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingBulkPrice { @@ -2087,11 +2130,11 @@ export interface NewFloatingBulkPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingBulkWithProrationPrice { - bulk_with_proration_config: Record; + bulk_with_proration_config: { [key: string]: unknown }; /** * The cadence to bill for this price on. @@ -2175,7 +2218,7 @@ export interface NewFloatingBulkWithProrationPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingCumulativeGroupedBulkPrice { @@ -2184,7 +2227,7 @@ export interface NewFloatingCumulativeGroupedBulkPrice { */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - cumulative_grouped_bulk_config: Record; + cumulative_grouped_bulk_config: { [key: string]: unknown }; /** * An ISO 4217 currency string for which this price is billed in. @@ -2263,7 +2306,7 @@ export interface NewFloatingCumulativeGroupedBulkPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingGroupedAllocationPrice { @@ -2277,7 +2320,7 @@ export interface NewFloatingGroupedAllocationPrice { */ currency: string; - grouped_allocation_config: Record; + grouped_allocation_config: { [key: string]: unknown }; /** * The id of the item the price will be associated with. @@ -2351,7 +2394,7 @@ export interface NewFloatingGroupedAllocationPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingGroupedTieredPackagePrice { @@ -2365,7 +2408,7 @@ export interface NewFloatingGroupedTieredPackagePrice { */ currency: string; - grouped_tiered_package_config: Record; + grouped_tiered_package_config: { [key: string]: unknown }; /** * The id of the item the price will be associated with. @@ -2439,7 +2482,7 @@ export interface NewFloatingGroupedTieredPackagePrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingGroupedTieredPrice { @@ -2453,7 +2496,7 @@ export interface NewFloatingGroupedTieredPrice { */ currency: string; - grouped_tiered_config: Record; + grouped_tiered_config: { [key: string]: unknown }; /** * The id of the item the price will be associated with. @@ -2527,7 +2570,7 @@ export interface NewFloatingGroupedTieredPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingGroupedWithMeteredMinimumPrice { @@ -2541,7 +2584,7 @@ export interface NewFloatingGroupedWithMeteredMinimumPrice { */ currency: string; - grouped_with_metered_minimum_config: Record; + grouped_with_metered_minimum_config: { [key: string]: unknown }; /** * The id of the item the price will be associated with. @@ -2615,7 +2658,7 @@ export interface NewFloatingGroupedWithMeteredMinimumPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingGroupedWithProratedMinimumPrice { @@ -2629,7 +2672,7 @@ export interface NewFloatingGroupedWithProratedMinimumPrice { */ currency: string; - grouped_with_prorated_minimum_config: Record; + grouped_with_prorated_minimum_config: { [key: string]: unknown }; /** * The id of the item the price will be associated with. @@ -2703,7 +2746,7 @@ export interface NewFloatingGroupedWithProratedMinimumPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingMatrixPrice { @@ -2791,7 +2834,7 @@ export interface NewFloatingMatrixPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingMatrixWithAllocationPrice { @@ -2879,7 +2922,7 @@ export interface NewFloatingMatrixWithAllocationPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingMatrixWithDisplayNamePrice { @@ -2898,7 +2941,7 @@ export interface NewFloatingMatrixWithDisplayNamePrice { */ item_id: string; - matrix_with_display_name_config: Record; + matrix_with_display_name_config: { [key: string]: unknown }; model_type: 'matrix_with_display_name'; @@ -2967,7 +3010,7 @@ export interface NewFloatingMatrixWithDisplayNamePrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingMaxGroupTieredPackagePrice { @@ -2986,7 +3029,7 @@ export interface NewFloatingMaxGroupTieredPackagePrice { */ item_id: string; - max_group_tiered_package_config: Record; + max_group_tiered_package_config: { [key: string]: unknown }; model_type: 'max_group_tiered_package'; @@ -3055,7 +3098,7 @@ export interface NewFloatingMaxGroupTieredPackagePrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingPackagePrice { @@ -3143,7 +3186,7 @@ export interface NewFloatingPackagePrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingPackageWithAllocationPrice { @@ -3169,7 +3212,7 @@ export interface NewFloatingPackageWithAllocationPrice { */ name: string; - package_with_allocation_config: Record; + package_with_allocation_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -3231,7 +3274,7 @@ export interface NewFloatingPackageWithAllocationPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingScalableMatrixWithTieredPricingPrice { @@ -3257,7 +3300,7 @@ export interface NewFloatingScalableMatrixWithTieredPricingPrice { */ name: string; - scalable_matrix_with_tiered_pricing_config: Record; + scalable_matrix_with_tiered_pricing_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -3319,7 +3362,7 @@ export interface NewFloatingScalableMatrixWithTieredPricingPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingScalableMatrixWithUnitPricingPrice { @@ -3345,7 +3388,7 @@ export interface NewFloatingScalableMatrixWithUnitPricingPrice { */ name: string; - scalable_matrix_with_unit_pricing_config: Record; + scalable_matrix_with_unit_pricing_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -3407,7 +3450,7 @@ export interface NewFloatingScalableMatrixWithUnitPricingPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingThresholdTotalAmountPrice { @@ -3433,7 +3476,7 @@ export interface NewFloatingThresholdTotalAmountPrice { */ name: string; - threshold_total_amount_config: Record; + threshold_total_amount_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -3495,7 +3538,7 @@ export interface NewFloatingThresholdTotalAmountPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingTieredBPSPrice { @@ -3583,7 +3626,7 @@ export interface NewFloatingTieredBPSPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingTieredPackagePrice { @@ -3609,7 +3652,7 @@ export interface NewFloatingTieredPackagePrice { */ name: string; - tiered_package_config: Record; + tiered_package_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -3671,7 +3714,7 @@ export interface NewFloatingTieredPackagePrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingTieredPackageWithMinimumPrice { @@ -3697,7 +3740,7 @@ export interface NewFloatingTieredPackageWithMinimumPrice { */ name: string; - tiered_package_with_minimum_config: Record; + tiered_package_with_minimum_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -3759,7 +3802,7 @@ export interface NewFloatingTieredPackageWithMinimumPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingTieredPrice { @@ -3847,7 +3890,7 @@ export interface NewFloatingTieredPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingTieredWithMinimumPrice { @@ -3873,7 +3916,7 @@ export interface NewFloatingTieredWithMinimumPrice { */ name: string; - tiered_with_minimum_config: Record; + tiered_with_minimum_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -3935,7 +3978,7 @@ export interface NewFloatingTieredWithMinimumPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingTieredWithProrationPrice { @@ -3961,7 +4004,7 @@ export interface NewFloatingTieredWithProrationPrice { */ name: string; - tiered_with_proration_config: Record; + tiered_with_proration_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -4023,7 +4066,7 @@ export interface NewFloatingTieredWithProrationPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingUnitPrice { @@ -4111,7 +4154,7 @@ export interface NewFloatingUnitPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingUnitWithPercentPrice { @@ -4137,7 +4180,7 @@ export interface NewFloatingUnitWithPercentPrice { */ name: string; - unit_with_percent_config: Record; + unit_with_percent_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -4199,7 +4242,7 @@ export interface NewFloatingUnitWithPercentPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewFloatingUnitWithProrationPrice { @@ -4225,7 +4268,7 @@ export interface NewFloatingUnitWithProrationPrice { */ name: string; - unit_with_proration_config: Record; + unit_with_proration_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -4287,7 +4330,7 @@ export interface NewFloatingUnitWithProrationPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; } export interface NewMaximum { @@ -4507,7 +4550,13 @@ export interface NewPlanBPSPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; + + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; } export interface NewPlanBulkBPSPrice { @@ -4596,7 +4645,13 @@ export interface NewPlanBulkBPSPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; + + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; } export interface NewPlanBulkPrice { @@ -4685,11 +4740,17 @@ export interface NewPlanBulkPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; + + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; } export interface NewPlanBulkWithProrationPrice { - bulk_with_proration_config: Record; + bulk_with_proration_config: { [key: string]: unknown }; /** * The cadence to bill for this price on. @@ -4774,7 +4835,13 @@ export interface NewPlanBulkWithProrationPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; + + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; } export interface NewPlanCumulativeGroupedBulkPrice { @@ -4783,7 +4850,7 @@ export interface NewPlanCumulativeGroupedBulkPrice { */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - cumulative_grouped_bulk_config: Record; + cumulative_grouped_bulk_config: { [key: string]: unknown }; /** * The id of the item the price will be associated with. @@ -4863,7 +4930,13 @@ export interface NewPlanCumulativeGroupedBulkPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; + + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; } export interface NewPlanGroupedAllocationPrice { @@ -4872,7 +4945,7 @@ export interface NewPlanGroupedAllocationPrice { */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - grouped_allocation_config: Record; + grouped_allocation_config: { [key: string]: unknown }; /** * The id of the item the price will be associated with. @@ -4952,7 +5025,13 @@ export interface NewPlanGroupedAllocationPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; + + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; } export interface NewPlanGroupedTieredPackagePrice { @@ -4961,7 +5040,7 @@ export interface NewPlanGroupedTieredPackagePrice { */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - grouped_tiered_package_config: Record; + grouped_tiered_package_config: { [key: string]: unknown }; /** * The id of the item the price will be associated with. @@ -5041,7 +5120,13 @@ export interface NewPlanGroupedTieredPackagePrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; + + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; } export interface NewPlanGroupedTieredPrice { @@ -5050,7 +5135,7 @@ export interface NewPlanGroupedTieredPrice { */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - grouped_tiered_config: Record; + grouped_tiered_config: { [key: string]: unknown }; /** * The id of the item the price will be associated with. @@ -5130,7 +5215,13 @@ export interface NewPlanGroupedTieredPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; + + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; } export interface NewPlanGroupedWithMeteredMinimumPrice { @@ -5139,7 +5230,7 @@ export interface NewPlanGroupedWithMeteredMinimumPrice { */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - grouped_with_metered_minimum_config: Record; + grouped_with_metered_minimum_config: { [key: string]: unknown }; /** * The id of the item the price will be associated with. @@ -5219,7 +5310,13 @@ export interface NewPlanGroupedWithMeteredMinimumPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; + + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; } export interface NewPlanGroupedWithProratedMinimumPrice { @@ -5228,7 +5325,7 @@ export interface NewPlanGroupedWithProratedMinimumPrice { */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - grouped_with_prorated_minimum_config: Record; + grouped_with_prorated_minimum_config: { [key: string]: unknown }; /** * The id of the item the price will be associated with. @@ -5308,7 +5405,13 @@ export interface NewPlanGroupedWithProratedMinimumPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; + + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; } export interface NewPlanMatrixPrice { @@ -5397,7 +5500,13 @@ export interface NewPlanMatrixPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; + + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; } export interface NewPlanMatrixWithAllocationPrice { @@ -5486,7 +5595,13 @@ export interface NewPlanMatrixWithAllocationPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; + + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; } export interface NewPlanMatrixWithDisplayNamePrice { @@ -5500,7 +5615,7 @@ export interface NewPlanMatrixWithDisplayNamePrice { */ item_id: string; - matrix_with_display_name_config: Record; + matrix_with_display_name_config: { [key: string]: unknown }; model_type: 'matrix_with_display_name'; @@ -5575,7 +5690,13 @@ export interface NewPlanMatrixWithDisplayNamePrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; + + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; } export interface NewPlanMaxGroupTieredPackagePrice { @@ -5589,7 +5710,7 @@ export interface NewPlanMaxGroupTieredPackagePrice { */ item_id: string; - max_group_tiered_package_config: Record; + max_group_tiered_package_config: { [key: string]: unknown }; model_type: 'max_group_tiered_package'; @@ -5664,7 +5785,13 @@ export interface NewPlanMaxGroupTieredPackagePrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; + + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; } export interface NewPlanPackagePrice { @@ -5753,7 +5880,13 @@ export interface NewPlanPackagePrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; + + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; } export interface NewPlanPackageWithAllocationPrice { @@ -5774,7 +5907,7 @@ export interface NewPlanPackageWithAllocationPrice { */ name: string; - package_with_allocation_config: Record; + package_with_allocation_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -5842,7 +5975,13 @@ export interface NewPlanPackageWithAllocationPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; + + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; } export interface NewPlanScalableMatrixWithTieredPricingPrice { @@ -5863,7 +6002,7 @@ export interface NewPlanScalableMatrixWithTieredPricingPrice { */ name: string; - scalable_matrix_with_tiered_pricing_config: Record; + scalable_matrix_with_tiered_pricing_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -5931,7 +6070,13 @@ export interface NewPlanScalableMatrixWithTieredPricingPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; + + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; } export interface NewPlanScalableMatrixWithUnitPricingPrice { @@ -5952,7 +6097,7 @@ export interface NewPlanScalableMatrixWithUnitPricingPrice { */ name: string; - scalable_matrix_with_unit_pricing_config: Record; + scalable_matrix_with_unit_pricing_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -6020,7 +6165,13 @@ export interface NewPlanScalableMatrixWithUnitPricingPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; + + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; } export interface NewPlanThresholdTotalAmountPrice { @@ -6041,7 +6192,7 @@ export interface NewPlanThresholdTotalAmountPrice { */ name: string; - threshold_total_amount_config: Record; + threshold_total_amount_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -6109,7 +6260,13 @@ export interface NewPlanThresholdTotalAmountPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; + + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; } export interface NewPlanTierWithProrationPrice { @@ -6130,7 +6287,7 @@ export interface NewPlanTierWithProrationPrice { */ name: string; - tiered_with_proration_config: Record; + tiered_with_proration_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -6198,7 +6355,13 @@ export interface NewPlanTierWithProrationPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; + + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; } export interface NewPlanTieredBPSPrice { @@ -6287,7 +6450,13 @@ export interface NewPlanTieredBPSPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; + + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; } export interface NewPlanTieredPackagePrice { @@ -6308,7 +6477,7 @@ export interface NewPlanTieredPackagePrice { */ name: string; - tiered_package_config: Record; + tiered_package_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -6376,7 +6545,13 @@ export interface NewPlanTieredPackagePrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; + + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; } export interface NewPlanTieredPackageWithMinimumPrice { @@ -6397,7 +6572,7 @@ export interface NewPlanTieredPackageWithMinimumPrice { */ name: string; - tiered_package_with_minimum_config: Record; + tiered_package_with_minimum_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -6465,7 +6640,13 @@ export interface NewPlanTieredPackageWithMinimumPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; + + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; } export interface NewPlanTieredPrice { @@ -6554,7 +6735,13 @@ export interface NewPlanTieredPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; + + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; } export interface NewPlanTieredWithMinimumPrice { @@ -6575,7 +6762,7 @@ export interface NewPlanTieredWithMinimumPrice { */ name: string; - tiered_with_minimum_config: Record; + tiered_with_minimum_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -6643,7 +6830,13 @@ export interface NewPlanTieredWithMinimumPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; + + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; } export interface NewPlanUnitPrice { @@ -6732,7 +6925,13 @@ export interface NewPlanUnitPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; + + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; } export interface NewPlanUnitWithPercentPrice { @@ -6753,7 +6952,7 @@ export interface NewPlanUnitWithPercentPrice { */ name: string; - unit_with_percent_config: Record; + unit_with_percent_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -6821,7 +7020,13 @@ export interface NewPlanUnitWithPercentPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; + + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; } export interface NewPlanUnitWithProrationPrice { @@ -6842,7 +7047,7 @@ export interface NewPlanUnitWithProrationPrice { */ name: string; - unit_with_proration_config: Record; + unit_with_proration_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -6910,7 +7115,13 @@ export interface NewPlanUnitWithProrationPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; + + /** + * A transient ID that can be used to reference this price when adding adjustments + * in the same API call. + */ + reference_id?: string | null; } export interface NewUsageDiscount { @@ -7105,6 +7316,12 @@ export interface PlanPhaseAmountDiscountAdjustment { * The reason for the adjustment. */ reason: string | null; + + /** + * The adjustment id this adjustment replaces. This adjustment will take the place + * of the replaced adjustment in plan version migrations. + */ + replaces_adjustment_id: string | null; } export interface PlanPhaseMaximumAdjustment { @@ -7143,6 +7360,12 @@ export interface PlanPhaseMaximumAdjustment { * The reason for the adjustment. */ reason: string | null; + + /** + * The adjustment id this adjustment replaces. This adjustment will take the place + * of the replaced adjustment in plan version migrations. + */ + replaces_adjustment_id: string | null; } export interface PlanPhaseMinimumAdjustment { @@ -7186,6 +7409,12 @@ export interface PlanPhaseMinimumAdjustment { * The reason for the adjustment. */ reason: string | null; + + /** + * The adjustment id this adjustment replaces. This adjustment will take the place + * of the replaced adjustment in plan version migrations. + */ + replaces_adjustment_id: string | null; } export interface PlanPhasePercentageDiscountAdjustment { @@ -7224,6 +7453,12 @@ export interface PlanPhasePercentageDiscountAdjustment { * The reason for the adjustment. */ reason: string | null; + + /** + * The adjustment id this adjustment replaces. This adjustment will take the place + * of the replaced adjustment in plan version migrations. + */ + replaces_adjustment_id: string | null; } export interface PlanPhaseUsageDiscountAdjustment { @@ -7257,6 +7492,12 @@ export interface PlanPhaseUsageDiscountAdjustment { */ reason: string | null; + /** + * The adjustment id this adjustment replaces. This adjustment will take the place + * of the replaced adjustment in plan version migrations. + */ + replaces_adjustment_id: string | null; + /** * The number of usage units by which to discount the price this adjustment applies * to in a given billing period. @@ -7355,7 +7596,7 @@ export namespace Price { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; /** * @deprecated @@ -7375,6 +7616,12 @@ export namespace Price { price_type: 'usage_price' | 'fixed_price'; + /** + * The price id this price replaces. This price will take the place of the replaced + * price in plan version migrations. + */ + replaces_price_id: string | null; + unit_config: Shared.UnitConfig; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; @@ -7428,7 +7675,7 @@ export namespace Price { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; /** * @deprecated @@ -7450,6 +7697,12 @@ export namespace Price { price_type: 'usage_price' | 'fixed_price'; + /** + * The price id this price replaces. This price will take the place of the replaced + * price in plan version migrations. + */ + replaces_price_id: string | null; + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; } @@ -7503,7 +7756,7 @@ export namespace Price { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; /** * @deprecated @@ -7523,6 +7776,12 @@ export namespace Price { price_type: 'usage_price' | 'fixed_price'; + /** + * The price id this price replaces. This price will take the place of the replaced + * price in plan version migrations. + */ + replaces_price_id: string | null; + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; } @@ -7574,7 +7833,7 @@ export namespace Price { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; /** * @deprecated @@ -7594,6 +7853,12 @@ export namespace Price { price_type: 'usage_price' | 'fixed_price'; + /** + * The price id this price replaces. This price will take the place of the replaced + * price in plan version migrations. + */ + replaces_price_id: string | null; + tiered_config: Shared.TieredConfig; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; @@ -7647,7 +7912,7 @@ export namespace Price { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; /** * @deprecated @@ -7667,6 +7932,12 @@ export namespace Price { price_type: 'usage_price' | 'fixed_price'; + /** + * The price id this price replaces. This price will take the place of the replaced + * price in plan version migrations. + */ + replaces_price_id: string | null; + tiered_bps_config: Shared.TieredBPSConfig; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; @@ -7722,7 +7993,7 @@ export namespace Price { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; /** * @deprecated @@ -7742,6 +8013,12 @@ export namespace Price { price_type: 'usage_price' | 'fixed_price'; + /** + * The price id this price replaces. This price will take the place of the replaced + * price in plan version migrations. + */ + replaces_price_id: string | null; + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; } @@ -7795,7 +8072,7 @@ export namespace Price { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; /** * @deprecated @@ -7815,6 +8092,12 @@ export namespace Price { price_type: 'usage_price' | 'fixed_price'; + /** + * The price id this price replaces. This price will take the place of the replaced + * price in plan version migrations. + */ + replaces_price_id: string | null; + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; } @@ -7868,7 +8151,7 @@ export namespace Price { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; /** * @deprecated @@ -7888,6 +8171,12 @@ export namespace Price { price_type: 'usage_price' | 'fixed_price'; + /** + * The price id this price replaces. This price will take the place of the replaced + * price in plan version migrations. + */ + replaces_price_id: string | null; + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; } @@ -7939,7 +8228,7 @@ export namespace Price { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; /** * @deprecated @@ -7959,7 +8248,13 @@ export namespace Price { price_type: 'usage_price' | 'fixed_price'; - threshold_total_amount_config: Record; + /** + * The price id this price replaces. This price will take the place of the replaced + * price in plan version migrations. + */ + replaces_price_id: string | null; + + threshold_total_amount_config: { [key: string]: unknown }; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; } @@ -8012,7 +8307,7 @@ export namespace Price { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; /** * @deprecated @@ -8032,7 +8327,13 @@ export namespace Price { price_type: 'usage_price' | 'fixed_price'; - tiered_package_config: Record; + /** + * The price id this price replaces. This price will take the place of the replaced + * price in plan version migrations. + */ + replaces_price_id: string | null; + + tiered_package_config: { [key: string]: unknown }; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; } @@ -8065,7 +8366,7 @@ export namespace Price { fixed_price_quantity: number | null; - grouped_tiered_config: Record; + grouped_tiered_config: { [key: string]: unknown }; invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; @@ -8087,7 +8388,7 @@ export namespace Price { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; /** * @deprecated @@ -8107,6 +8408,12 @@ export namespace Price { price_type: 'usage_price' | 'fixed_price'; + /** + * The price id this price replaces. This price will take the place of the replaced + * price in plan version migrations. + */ + replaces_price_id: string | null; + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; } @@ -8158,7 +8465,7 @@ export namespace Price { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; /** * @deprecated @@ -8178,7 +8485,13 @@ export namespace Price { price_type: 'usage_price' | 'fixed_price'; - tiered_with_minimum_config: Record; + /** + * The price id this price replaces. This price will take the place of the replaced + * price in plan version migrations. + */ + replaces_price_id: string | null; + + tiered_with_minimum_config: { [key: string]: unknown }; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; } @@ -8231,7 +8544,7 @@ export namespace Price { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; /** * @deprecated @@ -8251,7 +8564,13 @@ export namespace Price { price_type: 'usage_price' | 'fixed_price'; - tiered_package_with_minimum_config: Record; + /** + * The price id this price replaces. This price will take the place of the replaced + * price in plan version migrations. + */ + replaces_price_id: string | null; + + tiered_package_with_minimum_config: { [key: string]: unknown }; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; } @@ -8304,7 +8623,7 @@ export namespace Price { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; /** * @deprecated @@ -8320,12 +8639,18 @@ export namespace Price { name: string; - package_with_allocation_config: Record; + package_with_allocation_config: { [key: string]: unknown }; plan_phase_order: number | null; price_type: 'usage_price' | 'fixed_price'; + /** + * The price id this price replaces. This price will take the place of the replaced + * price in plan version migrations. + */ + replaces_price_id: string | null; + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; } @@ -8377,7 +8702,7 @@ export namespace Price { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; /** * @deprecated @@ -8397,7 +8722,13 @@ export namespace Price { price_type: 'usage_price' | 'fixed_price'; - unit_with_percent_config: Record; + /** + * The price id this price replaces. This price will take the place of the replaced + * price in plan version migrations. + */ + replaces_price_id: string | null; + + unit_with_percent_config: { [key: string]: unknown }; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; } @@ -8452,7 +8783,7 @@ export namespace Price { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; /** * @deprecated @@ -8472,6 +8803,12 @@ export namespace Price { price_type: 'usage_price' | 'fixed_price'; + /** + * The price id this price replaces. This price will take the place of the replaced + * price in plan version migrations. + */ + replaces_price_id: string | null; + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; } @@ -8523,7 +8860,7 @@ export namespace Price { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; /** * @deprecated @@ -8543,7 +8880,13 @@ export namespace Price { price_type: 'usage_price' | 'fixed_price'; - tiered_with_proration_config: Record; + /** + * The price id this price replaces. This price will take the place of the replaced + * price in plan version migrations. + */ + replaces_price_id: string | null; + + tiered_with_proration_config: { [key: string]: unknown }; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; } @@ -8596,7 +8939,7 @@ export namespace Price { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; /** * @deprecated @@ -8616,7 +8959,13 @@ export namespace Price { price_type: 'usage_price' | 'fixed_price'; - unit_with_proration_config: Record; + /** + * The price id this price replaces. This price will take the place of the replaced + * price in plan version migrations. + */ + replaces_price_id: string | null; + + unit_with_proration_config: { [key: string]: unknown }; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; } @@ -8649,7 +8998,7 @@ export namespace Price { fixed_price_quantity: number | null; - grouped_allocation_config: Record; + grouped_allocation_config: { [key: string]: unknown }; invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; @@ -8671,7 +9020,7 @@ export namespace Price { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; /** * @deprecated @@ -8691,6 +9040,12 @@ export namespace Price { price_type: 'usage_price' | 'fixed_price'; + /** + * The price id this price replaces. This price will take the place of the replaced + * price in plan version migrations. + */ + replaces_price_id: string | null; + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; } @@ -8722,7 +9077,7 @@ export namespace Price { fixed_price_quantity: number | null; - grouped_with_prorated_minimum_config: Record; + grouped_with_prorated_minimum_config: { [key: string]: unknown }; invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; @@ -8744,7 +9099,7 @@ export namespace Price { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; /** * @deprecated @@ -8764,6 +9119,12 @@ export namespace Price { price_type: 'usage_price' | 'fixed_price'; + /** + * The price id this price replaces. This price will take the place of the replaced + * price in plan version migrations. + */ + replaces_price_id: string | null; + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; } @@ -8795,7 +9156,7 @@ export namespace Price { fixed_price_quantity: number | null; - grouped_with_metered_minimum_config: Record; + grouped_with_metered_minimum_config: { [key: string]: unknown }; invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; @@ -8817,7 +9178,7 @@ export namespace Price { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; /** * @deprecated @@ -8837,6 +9198,12 @@ export namespace Price { price_type: 'usage_price' | 'fixed_price'; + /** + * The price id this price replaces. This price will take the place of the replaced + * price in plan version migrations. + */ + replaces_price_id: string | null; + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; } @@ -8872,7 +9239,7 @@ export namespace Price { item: Shared.ItemSlim; - matrix_with_display_name_config: Record; + matrix_with_display_name_config: { [key: string]: unknown }; /** * @deprecated @@ -8890,7 +9257,7 @@ export namespace Price { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; /** * @deprecated @@ -8910,6 +9277,12 @@ export namespace Price { price_type: 'usage_price' | 'fixed_price'; + /** + * The price id this price replaces. This price will take the place of the replaced + * price in plan version migrations. + */ + replaces_price_id: string | null; + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; } @@ -8920,7 +9293,7 @@ export namespace Price { billing_cycle_configuration: Shared.BillingCycleConfiguration; - bulk_with_proration_config: Record; + bulk_with_proration_config: { [key: string]: unknown }; cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom'; @@ -8963,7 +9336,7 @@ export namespace Price { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; /** * @deprecated @@ -8983,6 +9356,12 @@ export namespace Price { price_type: 'usage_price' | 'fixed_price'; + /** + * The price id this price replaces. This price will take the place of the replaced + * price in plan version migrations. + */ + replaces_price_id: string | null; + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; } @@ -9014,7 +9393,7 @@ export namespace Price { fixed_price_quantity: number | null; - grouped_tiered_package_config: Record; + grouped_tiered_package_config: { [key: string]: unknown }; invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; @@ -9036,7 +9415,7 @@ export namespace Price { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; /** * @deprecated @@ -9056,6 +9435,12 @@ export namespace Price { price_type: 'usage_price' | 'fixed_price'; + /** + * The price id this price replaces. This price will take the place of the replaced + * price in plan version migrations. + */ + replaces_price_id: string | null; + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; } @@ -9091,7 +9476,7 @@ export namespace Price { item: Shared.ItemSlim; - max_group_tiered_package_config: Record; + max_group_tiered_package_config: { [key: string]: unknown }; /** * @deprecated @@ -9109,7 +9494,7 @@ export namespace Price { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; /** * @deprecated @@ -9129,6 +9514,12 @@ export namespace Price { price_type: 'usage_price' | 'fixed_price'; + /** + * The price id this price replaces. This price will take the place of the replaced + * price in plan version migrations. + */ + replaces_price_id: string | null; + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; } @@ -9180,7 +9571,7 @@ export namespace Price { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; /** * @deprecated @@ -9200,7 +9591,13 @@ export namespace Price { price_type: 'usage_price' | 'fixed_price'; - scalable_matrix_with_unit_pricing_config: Record; + /** + * The price id this price replaces. This price will take the place of the replaced + * price in plan version migrations. + */ + replaces_price_id: string | null; + + scalable_matrix_with_unit_pricing_config: { [key: string]: unknown }; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; } @@ -9253,7 +9650,7 @@ export namespace Price { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; /** * @deprecated @@ -9273,7 +9670,13 @@ export namespace Price { price_type: 'usage_price' | 'fixed_price'; - scalable_matrix_with_tiered_pricing_config: Record; + /** + * The price id this price replaces. This price will take the place of the replaced + * price in plan version migrations. + */ + replaces_price_id: string | null; + + scalable_matrix_with_tiered_pricing_config: { [key: string]: unknown }; dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; } @@ -9295,7 +9698,7 @@ export namespace Price { credit_allocation: Shared.Allocation | null; - cumulative_grouped_bulk_config: Record; + cumulative_grouped_bulk_config: { [key: string]: unknown }; currency: string; @@ -9328,7 +9731,7 @@ export namespace Price { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; /** * @deprecated @@ -9348,6 +9751,12 @@ export namespace Price { price_type: 'usage_price' | 'fixed_price'; + /** + * The price id this price replaces. This price will take the place of the replaced + * price in plan version migrations. + */ + replaces_price_id: string | null; + dimensional_price_configuration?: Shared.DimensionalPriceConfiguration | null; } } diff --git a/src/resources/subscription-changes.ts b/src/resources/subscription-changes.ts index ced31e7e..668da6a0 100644 --- a/src/resources/subscription-changes.ts +++ b/src/resources/subscription-changes.ts @@ -142,7 +142,7 @@ export interface MutatedSubscription { /** * @deprecated The discount intervals for this subscription sorted by the - * start_date. + * start_date. This field is deprecated in favor of `adjustment_intervals`. */ discount_intervals: Array< Shared.AmountDiscountInterval | Shared.PercentageDiscountInterval | Shared.UsageDiscountInterval @@ -159,7 +159,7 @@ export interface MutatedSubscription { /** * @deprecated The maximum intervals for this subscription sorted by the - * start_date. + * start_date. This field is deprecated in favor of `adjustment_intervals`. */ maximum_intervals: Array; @@ -169,11 +169,11 @@ export interface MutatedSubscription { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; /** * @deprecated The minimum intervals for this subscription sorted by the - * start_date. + * start_date. This field is deprecated in favor of `adjustment_intervals`. */ minimum_intervals: Array; diff --git a/src/resources/subscriptions.ts b/src/resources/subscriptions.ts index ed91bd8f..3059daa4 100644 --- a/src/resources/subscriptions.ts +++ b/src/resources/subscriptions.ts @@ -267,7 +267,7 @@ export class Subscriptions extends APIResource { * is hit. To enable threshold billing, pass in an `invoicing_threshold`, which is * specified in the subscription's invoicing currency, when creating a * subscription. E.g. pass in `10.00` to issue an invoice when usage amounts hit - * $10.00 for a subscription that invoices in USD. + * \$10.00 for a subscription that invoices in USD. */ create( body: SubscriptionCreateParams, @@ -1178,7 +1178,7 @@ export interface NewSubscriptionBPSPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * A transient ID that can be used to reference this price when adding adjustments @@ -1273,7 +1273,7 @@ export interface NewSubscriptionBulkBPSPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * A transient ID that can be used to reference this price when adding adjustments @@ -1368,7 +1368,7 @@ export interface NewSubscriptionBulkPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * A transient ID that can be used to reference this price when adding adjustments @@ -1378,7 +1378,7 @@ export interface NewSubscriptionBulkPrice { } export interface NewSubscriptionBulkWithProrationPrice { - bulk_with_proration_config: Record; + bulk_with_proration_config: { [key: string]: unknown }; /** * The cadence to bill for this price on. @@ -1463,7 +1463,7 @@ export interface NewSubscriptionBulkWithProrationPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * A transient ID that can be used to reference this price when adding adjustments @@ -1478,7 +1478,7 @@ export interface NewSubscriptionCumulativeGroupedBulkPrice { */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - cumulative_grouped_bulk_config: Record; + cumulative_grouped_bulk_config: { [key: string]: unknown }; /** * The id of the item the price will be associated with. @@ -1558,7 +1558,7 @@ export interface NewSubscriptionCumulativeGroupedBulkPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * A transient ID that can be used to reference this price when adding adjustments @@ -1573,7 +1573,7 @@ export interface NewSubscriptionGroupedAllocationPrice { */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - grouped_allocation_config: Record; + grouped_allocation_config: { [key: string]: unknown }; /** * The id of the item the price will be associated with. @@ -1653,7 +1653,7 @@ export interface NewSubscriptionGroupedAllocationPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * A transient ID that can be used to reference this price when adding adjustments @@ -1668,7 +1668,7 @@ export interface NewSubscriptionGroupedTieredPackagePrice { */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - grouped_tiered_package_config: Record; + grouped_tiered_package_config: { [key: string]: unknown }; /** * The id of the item the price will be associated with. @@ -1748,7 +1748,7 @@ export interface NewSubscriptionGroupedTieredPackagePrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * A transient ID that can be used to reference this price when adding adjustments @@ -1763,7 +1763,7 @@ export interface NewSubscriptionGroupedTieredPrice { */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - grouped_tiered_config: Record; + grouped_tiered_config: { [key: string]: unknown }; /** * The id of the item the price will be associated with. @@ -1843,7 +1843,7 @@ export interface NewSubscriptionGroupedTieredPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * A transient ID that can be used to reference this price when adding adjustments @@ -1858,7 +1858,7 @@ export interface NewSubscriptionGroupedWithMeteredMinimumPrice { */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - grouped_with_metered_minimum_config: Record; + grouped_with_metered_minimum_config: { [key: string]: unknown }; /** * The id of the item the price will be associated with. @@ -1938,7 +1938,7 @@ export interface NewSubscriptionGroupedWithMeteredMinimumPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * A transient ID that can be used to reference this price when adding adjustments @@ -1953,7 +1953,7 @@ export interface NewSubscriptionGroupedWithProratedMinimumPrice { */ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom'; - grouped_with_prorated_minimum_config: Record; + grouped_with_prorated_minimum_config: { [key: string]: unknown }; /** * The id of the item the price will be associated with. @@ -2033,7 +2033,7 @@ export interface NewSubscriptionGroupedWithProratedMinimumPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * A transient ID that can be used to reference this price when adding adjustments @@ -2128,7 +2128,7 @@ export interface NewSubscriptionMatrixPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * A transient ID that can be used to reference this price when adding adjustments @@ -2223,7 +2223,7 @@ export interface NewSubscriptionMatrixWithAllocationPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * A transient ID that can be used to reference this price when adding adjustments @@ -2243,7 +2243,7 @@ export interface NewSubscriptionMatrixWithDisplayNamePrice { */ item_id: string; - matrix_with_display_name_config: Record; + matrix_with_display_name_config: { [key: string]: unknown }; model_type: 'matrix_with_display_name'; @@ -2318,7 +2318,7 @@ export interface NewSubscriptionMatrixWithDisplayNamePrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * A transient ID that can be used to reference this price when adding adjustments @@ -2338,7 +2338,7 @@ export interface NewSubscriptionMaxGroupTieredPackagePrice { */ item_id: string; - max_group_tiered_package_config: Record; + max_group_tiered_package_config: { [key: string]: unknown }; model_type: 'max_group_tiered_package'; @@ -2413,7 +2413,7 @@ export interface NewSubscriptionMaxGroupTieredPackagePrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * A transient ID that can be used to reference this price when adding adjustments @@ -2508,7 +2508,7 @@ export interface NewSubscriptionPackagePrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * A transient ID that can be used to reference this price when adding adjustments @@ -2535,7 +2535,7 @@ export interface NewSubscriptionPackageWithAllocationPrice { */ name: string; - package_with_allocation_config: Record; + package_with_allocation_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -2603,7 +2603,7 @@ export interface NewSubscriptionPackageWithAllocationPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * A transient ID that can be used to reference this price when adding adjustments @@ -2630,7 +2630,7 @@ export interface NewSubscriptionScalableMatrixWithTieredPricingPrice { */ name: string; - scalable_matrix_with_tiered_pricing_config: Record; + scalable_matrix_with_tiered_pricing_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -2698,7 +2698,7 @@ export interface NewSubscriptionScalableMatrixWithTieredPricingPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * A transient ID that can be used to reference this price when adding adjustments @@ -2725,7 +2725,7 @@ export interface NewSubscriptionScalableMatrixWithUnitPricingPrice { */ name: string; - scalable_matrix_with_unit_pricing_config: Record; + scalable_matrix_with_unit_pricing_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -2793,7 +2793,7 @@ export interface NewSubscriptionScalableMatrixWithUnitPricingPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * A transient ID that can be used to reference this price when adding adjustments @@ -2820,7 +2820,7 @@ export interface NewSubscriptionThresholdTotalAmountPrice { */ name: string; - threshold_total_amount_config: Record; + threshold_total_amount_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -2888,7 +2888,7 @@ export interface NewSubscriptionThresholdTotalAmountPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * A transient ID that can be used to reference this price when adding adjustments @@ -2915,7 +2915,7 @@ export interface NewSubscriptionTierWithProrationPrice { */ name: string; - tiered_with_proration_config: Record; + tiered_with_proration_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -2983,7 +2983,7 @@ export interface NewSubscriptionTierWithProrationPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * A transient ID that can be used to reference this price when adding adjustments @@ -3078,7 +3078,7 @@ export interface NewSubscriptionTieredBPSPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * A transient ID that can be used to reference this price when adding adjustments @@ -3105,7 +3105,7 @@ export interface NewSubscriptionTieredPackagePrice { */ name: string; - tiered_package_config: Record; + tiered_package_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -3173,7 +3173,7 @@ export interface NewSubscriptionTieredPackagePrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * A transient ID that can be used to reference this price when adding adjustments @@ -3200,7 +3200,7 @@ export interface NewSubscriptionTieredPackageWithMinimumPrice { */ name: string; - tiered_package_with_minimum_config: Record; + tiered_package_with_minimum_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -3268,7 +3268,7 @@ export interface NewSubscriptionTieredPackageWithMinimumPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * A transient ID that can be used to reference this price when adding adjustments @@ -3363,7 +3363,7 @@ export interface NewSubscriptionTieredPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * A transient ID that can be used to reference this price when adding adjustments @@ -3390,7 +3390,7 @@ export interface NewSubscriptionTieredWithMinimumPrice { */ name: string; - tiered_with_minimum_config: Record; + tiered_with_minimum_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -3458,7 +3458,7 @@ export interface NewSubscriptionTieredWithMinimumPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * A transient ID that can be used to reference this price when adding adjustments @@ -3553,7 +3553,7 @@ export interface NewSubscriptionUnitPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * A transient ID that can be used to reference this price when adding adjustments @@ -3580,7 +3580,7 @@ export interface NewSubscriptionUnitWithPercentPrice { */ name: string; - unit_with_percent_config: Record; + unit_with_percent_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -3648,7 +3648,7 @@ export interface NewSubscriptionUnitWithPercentPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * A transient ID that can be used to reference this price when adding adjustments @@ -3675,7 +3675,7 @@ export interface NewSubscriptionUnitWithProrationPrice { */ name: string; - unit_with_proration_config: Record; + unit_with_proration_config: { [key: string]: unknown }; /** * The id of the billable metric for the price. Only needed if the price is @@ -3743,7 +3743,7 @@ export interface NewSubscriptionUnitWithProrationPrice { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * A transient ID that can be used to reference this price when adding adjustments @@ -3851,7 +3851,7 @@ export interface Subscription { /** * @deprecated The discount intervals for this subscription sorted by the - * start_date. + * start_date. This field is deprecated in favor of `adjustment_intervals`. */ discount_intervals: Array< Shared.AmountDiscountInterval | Shared.PercentageDiscountInterval | Shared.UsageDiscountInterval @@ -3868,7 +3868,7 @@ export interface Subscription { /** * @deprecated The maximum intervals for this subscription sorted by the - * start_date. + * start_date. This field is deprecated in favor of `adjustment_intervals`. */ maximum_intervals: Array; @@ -3878,11 +3878,11 @@ export interface Subscription { * `null`, and the entire metadata mapping can be cleared by setting `metadata` to * `null`. */ - metadata: Record; + metadata: { [key: string]: string }; /** * @deprecated The minimum intervals for this subscription sorted by the - * start_date. + * start_date. This field is deprecated in favor of `adjustment_intervals`. */ minimum_intervals: Array; @@ -4140,7 +4140,7 @@ export interface SubscriptionCreateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * The name to use for the subscription. If not specified, the plan name will be @@ -4483,7 +4483,7 @@ export interface SubscriptionUpdateParams { * by setting the value to `null`, and the entire metadata mapping can be cleared * by setting `metadata` to `null`. */ - metadata?: Record | null; + metadata?: { [key: string]: string | null } | null; /** * Determines the difference between the invoice issue date for subscription @@ -4832,8 +4832,8 @@ export namespace SubscriptionPriceIntervalsParams { billing_cycle_day?: number | null; /** - * The updated end date of this price interval. If not specified, the start date - * will not be updated. + * The updated end date of this price interval. If not specified, the end date will + * not be updated. */ end_date?: (string & {}) | Shared.BillingCycleRelativeDate | null; @@ -4890,8 +4890,8 @@ export namespace SubscriptionPriceIntervalsParams { adjustment_interval_id: string; /** - * The updated end date of this adjustment interval. If not specified, the start - * date will not be updated. + * The updated end date of this adjustment interval. If not specified, the end date + * will not be updated. */ end_date?: (string & {}) | Shared.BillingCycleRelativeDate | null; diff --git a/src/version.ts b/src/version.ts index e156b0ea..0d43855f 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '5.0.0'; // x-release-please-version +export const VERSION = '5.1.0'; // x-release-please-version diff --git a/tests/api-resources/beta/beta.test.ts b/tests/api-resources/beta/beta.test.ts index 3b257ca2..d4a8c772 100644 --- a/tests/api-resources/beta/beta.test.ts +++ b/tests/api-resources/beta/beta.test.ts @@ -74,6 +74,7 @@ describe('resource beta', () => { invoice_grouping_key: 'x', invoicing_cycle_configuration: { duration: 0, duration_unit: 'day' }, metadata: { foo: 'string' }, + reference_id: 'reference_id', }, }, ], @@ -132,6 +133,7 @@ describe('resource beta', () => { invoice_grouping_key: 'x', invoicing_cycle_configuration: { duration: 0, duration_unit: 'day' }, metadata: { foo: 'string' }, + reference_id: 'reference_id', }, }, ], diff --git a/tests/api-resources/beta/external-plan-id.test.ts b/tests/api-resources/beta/external-plan-id.test.ts index 1ccb0fed..a24646de 100644 --- a/tests/api-resources/beta/external-plan-id.test.ts +++ b/tests/api-resources/beta/external-plan-id.test.ts @@ -74,6 +74,7 @@ describe('resource externalPlanId', () => { invoice_grouping_key: 'x', invoicing_cycle_configuration: { duration: 0, duration_unit: 'day' }, metadata: { foo: 'string' }, + reference_id: 'reference_id', }, }, ], @@ -132,6 +133,7 @@ describe('resource externalPlanId', () => { invoice_grouping_key: 'x', invoicing_cycle_configuration: { duration: 0, duration_unit: 'day' }, metadata: { foo: 'string' }, + reference_id: 'reference_id', }, }, ], diff --git a/tests/api-resources/credit-notes.test.ts b/tests/api-resources/credit-notes.test.ts index 3bc948e5..7e54ca07 100644 --- a/tests/api-resources/credit-notes.test.ts +++ b/tests/api-resources/credit-notes.test.ts @@ -25,9 +25,18 @@ describe('resource creditNotes', () => { test('create: required and optional params', async () => { const response = await client.creditNotes.create({ - line_items: [{ amount: 'amount', invoice_line_item_id: '4khy3nwzktxv7' }], + line_items: [ + { + amount: 'amount', + invoice_line_item_id: '4khy3nwzktxv7', + end_date: '2023-09-22', + start_date: '2023-09-22', + }, + ], reason: 'duplicate', + end_date: '2023-09-22', memo: 'An optional memo for my credit note.', + start_date: '2023-09-22', }); }); diff --git a/tests/api-resources/customers/credits/ledger.test.ts b/tests/api-resources/customers/credits/ledger.test.ts index ac1b9e84..035945e5 100644 --- a/tests/api-resources/customers/credits/ledger.test.ts +++ b/tests/api-resources/customers/credits/ledger.test.ts @@ -74,6 +74,7 @@ describe('resource ledger', () => { invoice_settings: { auto_collection: true, net_terms: 0, + invoice_date: '2019-12-27', memo: 'memo', require_successful_payment: true, }, @@ -107,6 +108,7 @@ describe('resource ledger', () => { invoice_settings: { auto_collection: true, net_terms: 0, + invoice_date: '2019-12-27', memo: 'memo', require_successful_payment: true, }, diff --git a/tests/api-resources/plans/plans.test.ts b/tests/api-resources/plans/plans.test.ts index 81624574..8e0a1d9e 100644 --- a/tests/api-resources/plans/plans.test.ts +++ b/tests/api-resources/plans/plans.test.ts @@ -10,19 +10,7 @@ const client = new Orb({ describe('resource plans', () => { test('create: only required params', async () => { - const responsePromise = client.plans.create({ - currency: 'currency', - name: 'name', - prices: [ - { - cadence: 'annual', - item_id: 'item_id', - model_type: 'unit', - name: 'Annual fee', - unit_config: { unit_amount: 'unit_amount' }, - }, - ], - }); + const responsePromise = client.plans.create({ currency: 'currency', name: 'name', prices: [{}] }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -38,36 +26,66 @@ describe('resource plans', () => { name: 'name', prices: [ { - cadence: 'annual', - item_id: 'item_id', - model_type: 'unit', - name: 'Annual fee', - unit_config: { unit_amount: 'unit_amount' }, - billable_metric_id: 'billable_metric_id', - billed_in_advance: true, - billing_cycle_configuration: { duration: 0, duration_unit: 'day' }, - conversion_rate: 0, - conversion_rate_config: { - conversion_rate_type: 'unit', + allocation_price: { + amount: '10.00', + cadence: 'monthly', + currency: 'USD', + custom_expiration: { duration: 0, duration_unit: 'day' }, + expires_at_end_of_cadence: true, + }, + plan_phase_order: 0, + price: { + cadence: 'annual', + item_id: 'item_id', + model_type: 'unit', + name: 'Annual fee', unit_config: { unit_amount: 'unit_amount' }, + billable_metric_id: 'billable_metric_id', + billed_in_advance: true, + billing_cycle_configuration: { duration: 0, duration_unit: 'day' }, + conversion_rate: 0, + conversion_rate_config: { + conversion_rate_type: 'unit', + unit_config: { unit_amount: 'unit_amount' }, + }, + currency: 'currency', + dimensional_price_configuration: { + dimension_values: ['string'], + dimensional_price_group_id: 'dimensional_price_group_id', + external_dimensional_price_group_id: 'external_dimensional_price_group_id', + }, + external_price_id: 'external_price_id', + fixed_price_quantity: 0, + invoice_grouping_key: 'x', + invoicing_cycle_configuration: { duration: 0, duration_unit: 'day' }, + metadata: { foo: 'string' }, + reference_id: 'reference_id', }, - currency: 'currency', - dimensional_price_configuration: { - dimension_values: ['string'], - dimensional_price_group_id: 'dimensional_price_group_id', - external_dimensional_price_group_id: 'external_dimensional_price_group_id', + }, + ], + adjustments: [ + { + adjustment: { + adjustment_type: 'percentage_discount', + percentage_discount: 0, + applies_to_all: true, + applies_to_item_ids: ['item_1', 'item_2'], + applies_to_price_ids: ['price_1', 'price_2'], + currency: 'currency', + filters: [{ field: 'price_id', operator: 'includes', values: ['string'] }], + is_invoice_level: true, + price_type: 'usage', }, - external_price_id: 'external_price_id', - fixed_price_quantity: 0, - invoice_grouping_key: 'x', - invoicing_cycle_configuration: { duration: 0, duration_unit: 'day' }, - metadata: { foo: 'string' }, + plan_phase_order: 0, }, ], default_invoice_memo: 'default_invoice_memo', external_plan_id: 'external_plan_id', metadata: { foo: 'string' }, net_terms: 0, + plan_phases: [ + { order: 0, align_billing_with_phase_start_date: true, duration: 1, duration_unit: 'daily' }, + ], status: 'active', }); }); diff --git a/tests/api-resources/prices/prices.test.ts b/tests/api-resources/prices/prices.test.ts index 3e5d0c53..1b457bc9 100644 --- a/tests/api-resources/prices/prices.test.ts +++ b/tests/api-resources/prices/prices.test.ts @@ -134,6 +134,7 @@ describe('resource prices', () => { external_customer_id: 'external_customer_id', price_evaluations: [ { + external_price_id: 'external_price_id', filter: "my_numeric_property > 100 AND my_other_property = 'bar'", grouping_keys: ["case when my_event_type = 'foo' then true else false end"], price: { @@ -199,6 +200,7 @@ describe('resource prices', () => { external_customer_id: 'external_customer_id', price_evaluations: [ { + external_price_id: 'external_price_id', filter: "my_numeric_property > 100 AND my_other_property = 'bar'", grouping_keys: ["case when my_event_type = 'foo' then true else false end"], price: { diff --git a/tests/index.test.ts b/tests/index.test.ts index 8041812b..50751dc5 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -26,13 +26,13 @@ describe('instantiate client', () => { apiKey: 'My API Key', }); - test('they are used in the request', () => { - const { req } = client.buildRequest({ path: '/foo', method: 'post' }); + test('they are used in the request', async () => { + const { req } = await client.buildRequest({ path: '/foo', method: 'post' }); expect((req.headers as Headers)['x-my-default-header']).toEqual('2'); }); - test('can ignore `undefined` and leave the default', () => { - const { req } = client.buildRequest({ + test('can ignore `undefined` and leave the default', async () => { + const { req } = await client.buildRequest({ path: '/foo', method: 'post', headers: { 'X-My-Default-Header': undefined }, @@ -40,8 +40,8 @@ describe('instantiate client', () => { expect((req.headers as Headers)['x-my-default-header']).toEqual('2'); }); - test('can be removed with `null`', () => { - const { req } = client.buildRequest({ + test('can be removed with `null`', async () => { + const { req } = await client.buildRequest({ path: '/foo', method: 'post', headers: { 'X-My-Default-Header': null }, @@ -177,6 +177,28 @@ describe('instantiate client', () => { const client = new Orb({ apiKey: 'My API Key' }); expect(client.baseURL).toEqual('https://api.withorb.com/v1'); }); + + test('in request options', () => { + const client = new Orb({ apiKey: 'My API Key' }); + expect(client.buildURL('/foo', null, 'http://localhost:5000/option')).toEqual( + 'http://localhost:5000/option/foo', + ); + }); + + test('in request options overridden by client options', () => { + const client = new Orb({ apiKey: 'My API Key', baseURL: 'http://localhost:5000/client' }); + expect(client.buildURL('/foo', null, 'http://localhost:5000/option')).toEqual( + 'http://localhost:5000/client/foo', + ); + }); + + test('in request options overridden by env variable', () => { + process.env['ORB_BASE_URL'] = 'http://localhost:5000/env'; + const client = new Orb({ apiKey: 'My API Key' }); + expect(client.buildURL('/foo', null, 'http://localhost:5000/option')).toEqual( + 'http://localhost:5000/env/foo', + ); + }); }); test('maxRetries option is correctly set', () => { @@ -217,20 +239,20 @@ describe('request building', () => { const client = new Orb({ apiKey: 'My API Key' }); describe('Content-Length', () => { - test('handles multi-byte characters', () => { - const { req } = client.buildRequest({ path: '/foo', method: 'post', body: { value: '—' } }); + test('handles multi-byte characters', async () => { + const { req } = await client.buildRequest({ path: '/foo', method: 'post', body: { value: '—' } }); expect((req.headers as Record)['content-length']).toEqual('20'); }); - test('handles standard characters', () => { - const { req } = client.buildRequest({ path: '/foo', method: 'post', body: { value: 'hello' } }); + test('handles standard characters', async () => { + const { req } = await client.buildRequest({ path: '/foo', method: 'post', body: { value: 'hello' } }); expect((req.headers as Record)['content-length']).toEqual('22'); }); }); describe('custom headers', () => { - test('handles undefined', () => { - const { req } = client.buildRequest({ + test('handles undefined', async () => { + const { req } = await client.buildRequest({ path: '/foo', method: 'post', body: { value: 'hello' },