From ed314636e08ca6002585211a9814bb60522fc614 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 18 May 2026 21:19:04 +0000
Subject: [PATCH 01/19] fix(typescript): upgrade tsc-multi so that it works
with Node 26
---
package.json | 2 +-
packages/mcp-server/package.json | 2 +-
packages/mcp-server/yarn.lock | 6 +++---
yarn.lock | 6 +++---
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/package.json b/package.json
index 40c2e5d9..32ab4337 100644
--- a/package.json
+++ b/package.json
@@ -43,7 +43,7 @@
"publint": "^0.2.12",
"ts-jest": "^29.1.0",
"ts-node": "^10.5.0",
- "tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.9/tsc-multi.tgz",
+ "tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.11/tsc-multi.tgz",
"tsconfig-paths": "^4.0.0",
"tslib": "^2.8.1",
"typescript": "5.8.3",
diff --git a/packages/mcp-server/package.json b/packages/mcp-server/package.json
index acdd02d8..07b9adf8 100644
--- a/packages/mcp-server/package.json
+++ b/packages/mcp-server/package.json
@@ -74,7 +74,7 @@
"ts-jest": "^29.1.0",
"ts-morph": "^19.0.0",
"ts-node": "^10.5.0",
- "tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.9/tsc-multi.tgz",
+ "tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.11/tsc-multi.tgz",
"tsconfig-paths": "^4.0.0"
},
"imports": {
diff --git a/packages/mcp-server/yarn.lock b/packages/mcp-server/yarn.lock
index c7e37692..c6b17b02 100644
--- a/packages/mcp-server/yarn.lock
+++ b/packages/mcp-server/yarn.lock
@@ -3921,9 +3921,9 @@ ts-node@^10.5.0:
v8-compile-cache-lib "^3.0.1"
yn "3.1.1"
-"tsc-multi@https://github.com/stainless-api/tsc-multi/releases/download/v1.1.9/tsc-multi.tgz":
- version "1.1.9"
- resolved "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.9/tsc-multi.tgz#777f6f5d9e26bf0e94e5170990dd3a841d6707cd"
+"tsc-multi@https://github.com/stainless-api/tsc-multi/releases/download/v1.1.11/tsc-multi.tgz":
+ version "1.1.11"
+ resolved "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.11/tsc-multi.tgz#010247051be13b55abdc98f787c017285149f4f2"
dependencies:
debug "^4.3.7"
fast-glob "^3.3.2"
diff --git a/yarn.lock b/yarn.lock
index 18e7cbdc..00842e32 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -3192,9 +3192,9 @@ ts-node@^10.5.0:
v8-compile-cache-lib "^3.0.0"
yn "3.1.1"
-"tsc-multi@https://github.com/stainless-api/tsc-multi/releases/download/v1.1.9/tsc-multi.tgz":
- version "1.1.9"
- resolved "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.9/tsc-multi.tgz#777f6f5d9e26bf0e94e5170990dd3a841d6707cd"
+"tsc-multi@https://github.com/stainless-api/tsc-multi/releases/download/v1.1.11/tsc-multi.tgz":
+ version "1.1.11"
+ resolved "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.11/tsc-multi.tgz#010247051be13b55abdc98f787c017285149f4f2"
dependencies:
debug "^4.3.7"
fast-glob "^3.3.2"
From 03d217925dad440f11f078606bd6387ed97371cb Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 20 May 2026 13:55:29 +0000
Subject: [PATCH 02/19] feat: [orch-1860] remove all deprecated `/payments/*`
endpoints from API
---
.stats.yml | 8 +-
api.md | 15 --
packages/mcp-server/src/code-tool-worker.ts | 3 -
packages/mcp-server/src/local-docs-search.ts | 142 --------------
packages/mcp-server/src/methods.ts | 18 --
src/resources/v1/index.ts | 11 --
src/resources/v1/payments.ts | 187 -------------------
src/resources/v1/v1.ts | 26 ---
tests/api-resources/v1/payments.test.ts | 76 --------
9 files changed, 4 insertions(+), 482 deletions(-)
delete mode 100644 src/resources/v1/payments.ts
delete mode 100644 tests/api-resources/v1/payments.test.ts
diff --git a/.stats.yml b/.stats.yml
index 7309c957..f2a6308a 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 118
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome/metronome-f7e0e0ddfc48af411be9cceb4ff2f2902fd49e10a0e37375e291c2a06a6ddf6d.yml
-openapi_spec_hash: 51a0820e0399b218d44af30e9e0cb2da
-config_hash: e73a5fed3fb2fc458b2cd21b1e3e7b91
+configured_endpoints: 115
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome/metronome-1fc23246733b95562c50db7e71b6b4478dc9d0ffb5c5c4904fb23c54101b0147.yml
+openapi_spec_hash: 256a59fd7250f134f04834b7c036dd79
+config_hash: 6bd82f310398d5d47bcfeb8d7ed150b3
diff --git a/api.md b/api.md
index 2f79a8dc..b27e18f4 100644
--- a/api.md
+++ b/api.md
@@ -481,21 +481,6 @@ Methods:
- client.v1.packages.archive({ ...params }) -> PackageArchiveResponse
- client.v1.packages.listContractsOnPackage({ ...params }) -> PackageListContractsOnPackageResponsesCursorPage
-## Payments
-
-Types:
-
-- Payment
-- PaymentStatus
-- PaymentAttemptResponse
-- PaymentCancelResponse
-
-Methods:
-
-- client.v1.payments.list({ ...params }) -> PaymentsBodyCursorPage
-- client.v1.payments.attempt({ ...params }) -> PaymentAttemptResponse
-- client.v1.payments.cancel({ ...params }) -> PaymentCancelResponse
-
## Settings
Types:
diff --git a/packages/mcp-server/src/code-tool-worker.ts b/packages/mcp-server/src/code-tool-worker.ts
index 8a07a063..591a4f5e 100644
--- a/packages/mcp-server/src/code-tool-worker.ts
+++ b/packages/mcp-server/src/code-tool-worker.ts
@@ -220,9 +220,6 @@ const fuse = new Fuse(
'client.v1.packages.list',
'client.v1.packages.listContractsOnPackage',
'client.v1.packages.retrieve',
- 'client.v1.payments.attempt',
- 'client.v1.payments.cancel',
- 'client.v1.payments.list',
'client.v1.settings.upsertAvalaraCredentials',
'client.v1.settings.billingProviders.create',
'client.v1.settings.billingProviders.list',
diff --git a/packages/mcp-server/src/local-docs-search.ts b/packages/mcp-server/src/local-docs-search.ts
index 8ea6df46..5a164718 100644
--- a/packages/mcp-server/src/local-docs-search.ts
+++ b/packages/mcp-server/src/local-docs-search.ts
@@ -5726,148 +5726,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
},
},
},
- {
- name: 'list',
- endpoint: '/v1/payments/list',
- httpMethod: 'post',
- summary: 'List payments for an invoice',
- description: 'Fetch all payment attempts for the given invoice.\n',
- stainlessPath: '(resource) v1.payments > (method) list',
- qualified: 'client.v1.payments.list',
- params: [
- 'customer_id: string;',
- 'invoice_id: string;',
- 'limit?: number;',
- 'next_page?: string;',
- "statuses?: 'pending' | 'requires_intervention' | 'paid' | 'canceled'[];",
- ],
- response:
- "{ id: string; amount?: number; amount_paid?: number; contract_id?: string; created_at?: string; customer_id?: string; error_message?: string; fiat_credit_type?: { id: string; name: string; }; invoice_id?: string; payment_gateway?: { stripe: { payment_intent_id: string; error?: object; payment_method_id?: string; }; type: 'stripe'; }; revenue_system_payments?: { revenue_system_provider: string; sync_status: string; error_message?: string; revenue_system_external_payment_id?: string; }[]; status?: 'pending' | 'requires_intervention' | 'paid' | 'canceled'; updated_at?: string; }",
- markdown:
- "## list\n\n`client.v1.payments.list(customer_id: string, invoice_id: string, limit?: number, next_page?: string, statuses?: 'pending' | 'requires_intervention' | 'paid' | 'canceled'[]): { id: string; amount?: number; amount_paid?: number; contract_id?: string; created_at?: string; customer_id?: string; error_message?: string; fiat_credit_type?: credit_type_data; invoice_id?: string; payment_gateway?: object; revenue_system_payments?: object[]; status?: payment_status; updated_at?: string; }`\n\n**post** `/v1/payments/list`\n\nFetch all payment attempts for the given invoice.\n\n\n### Parameters\n\n- `customer_id: string`\n\n- `invoice_id: string`\n\n- `limit?: number`\n The maximum number of payments to return. Defaults to 25.\n\n- `next_page?: string`\n The next page token from a previous response.\n\n- `statuses?: 'pending' | 'requires_intervention' | 'paid' | 'canceled'[]`\n\n### Returns\n\n- `{ id: string; amount?: number; amount_paid?: number; contract_id?: string; created_at?: string; customer_id?: string; error_message?: string; fiat_credit_type?: { id: string; name: string; }; invoice_id?: string; payment_gateway?: { stripe: { payment_intent_id: string; error?: object; payment_method_id?: string; }; type: 'stripe'; }; revenue_system_payments?: { revenue_system_provider: string; sync_status: string; error_message?: string; revenue_system_external_payment_id?: string; }[]; status?: 'pending' | 'requires_intervention' | 'paid' | 'canceled'; updated_at?: string; }`\n\n - `id: string`\n - `amount?: number`\n - `amount_paid?: number`\n - `contract_id?: string`\n - `created_at?: string`\n - `customer_id?: string`\n - `error_message?: string`\n - `fiat_credit_type?: { id: string; name: string; }`\n - `invoice_id?: string`\n - `payment_gateway?: { stripe: { payment_intent_id: string; error?: { code?: string; decline_code?: string; type?: string; }; payment_method_id?: string; }; type: 'stripe'; }`\n - `revenue_system_payments?: { revenue_system_provider: string; sync_status: string; error_message?: string; revenue_system_external_payment_id?: string; }[]`\n - `status?: 'pending' | 'requires_intervention' | 'paid' | 'canceled'`\n - `updated_at?: string`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\n// Automatically fetches more pages as needed.\nfor await (const payment of client.v1.payments.list({ customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d', invoice_id: '6162d87b-e5db-4a33-b7f2-76ce6ead4e85' })) {\n console.log(payment);\n}\n```",
- perLanguage: {
- typescript: {
- method: 'client.v1.payments.list',
- example:
- "import Metronome from '@metronome/sdk';\n\nconst client = new Metronome({\n bearerToken: process.env['METRONOME_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const payment of client.v1.payments.list({\n customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',\n invoice_id: '6162d87b-e5db-4a33-b7f2-76ce6ead4e85',\n statuses: ['pending', 'requires_intervention'],\n})) {\n console.log(payment.id);\n}",
- },
- python: {
- method: 'v1.payments.list',
- example:
- 'import os\nfrom metronome import Metronome\n\nclient = Metronome(\n bearer_token=os.environ.get("METRONOME_BEARER_TOKEN"), # This is the default and can be omitted\n)\npage = client.v1.payments.list(\n customer_id="13117714-3f05-48e5-a6e9-a66093f13b4d",\n invoice_id="6162d87b-e5db-4a33-b7f2-76ce6ead4e85",\n statuses=["pending", "requires_intervention"],\n)\npage = page.data[0]\nprint(page.id)',
- },
- java: {
- method: 'v1().payments().list',
- example:
- 'package com.metronome.api.example;\n\nimport com.metronome.api.client.MetronomeClient;\nimport com.metronome.api.client.okhttp.MetronomeOkHttpClient;\nimport com.metronome.api.models.v1.payments.PaymentListPage;\nimport com.metronome.api.models.v1.payments.PaymentListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n MetronomeClient client = MetronomeOkHttpClient.fromEnv();\n\n PaymentListParams params = PaymentListParams.builder()\n .customerId("13117714-3f05-48e5-a6e9-a66093f13b4d")\n .invoiceId("6162d87b-e5db-4a33-b7f2-76ce6ead4e85")\n .build();\n PaymentListPage page = client.v1().payments().list(params);\n }\n}',
- },
- go: {
- method: 'client.V1.Payments.List',
- example:
- 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Metronome-Industries/metronome-go"\n\t"github.com/Metronome-Industries/metronome-go/option"\n)\n\nfunc main() {\n\tclient := metronome.NewClient(\n\t\toption.WithBearerToken("My Bearer Token"),\n\t)\n\tpage, err := client.V1.Payments.List(context.TODO(), metronome.V1PaymentListParams{\n\t\tCustomerID: "13117714-3f05-48e5-a6e9-a66093f13b4d",\n\t\tInvoiceID: "6162d87b-e5db-4a33-b7f2-76ce6ead4e85",\n\t\tStatuses: []metronome.PaymentStatus{metronome.PaymentStatusPending, metronome.PaymentStatusRequiresIntervention},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
- },
- ruby: {
- method: 'v1.payments.list',
- example:
- 'require "metronome_sdk"\n\nmetronome = MetronomeSDK::Client.new(bearer_token: "My Bearer Token")\n\npage = metronome.v1.payments.list(\n customer_id: "13117714-3f05-48e5-a6e9-a66093f13b4d",\n invoice_id: "6162d87b-e5db-4a33-b7f2-76ce6ead4e85"\n)\n\nputs(page)',
- },
- http: {
- example:
- 'curl https://api.metronome.com/v1/payments/list \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $METRONOME_BEARER_TOKEN" \\\n -d \'{\n "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d",\n "invoice_id": "6162d87b-e5db-4a33-b7f2-76ce6ead4e85",\n "statuses": [\n "pending",\n "requires_intervention"\n ]\n }\'',
- },
- },
- },
- {
- name: 'attempt',
- endpoint: '/v1/payments/attempt',
- httpMethod: 'post',
- summary: 'Attempt payment for an invoice',
- description:
- "Trigger a new attempt by canceling any existing attempts for this invoice and creating a new Payment. This will trigger another attempt to charge the Customer's configured Payment Gateway. \nPayment can only be attempted if all of the following are true:\n - The Metronome Invoice is finalized\n - PLG Invoicing is configured for the Customer\n - You cannot attempt payments for invoices that have already been `paid` or `voided`.\n\nAttempting to payment on an ineligible Invoice or Customer will result in a `400` response.\n",
- stainlessPath: '(resource) v1.payments > (method) attempt',
- qualified: 'client.v1.payments.attempt',
- params: ['customer_id: string;', 'invoice_id: string;'],
- response:
- '{ data: { id: string; amount?: number; amount_paid?: number; contract_id?: string; created_at?: string; customer_id?: string; error_message?: string; fiat_credit_type?: credit_type_data; invoice_id?: string; payment_gateway?: object; revenue_system_payments?: object[]; status?: payment_status; updated_at?: string; }; }',
- markdown:
- "## attempt\n\n`client.v1.payments.attempt(customer_id: string, invoice_id: string): { data: payment; }`\n\n**post** `/v1/payments/attempt`\n\nTrigger a new attempt by canceling any existing attempts for this invoice and creating a new Payment. This will trigger another attempt to charge the Customer's configured Payment Gateway. \nPayment can only be attempted if all of the following are true:\n - The Metronome Invoice is finalized\n - PLG Invoicing is configured for the Customer\n - You cannot attempt payments for invoices that have already been `paid` or `voided`.\n\nAttempting to payment on an ineligible Invoice or Customer will result in a `400` response.\n\n\n### Parameters\n\n- `customer_id: string`\n\n- `invoice_id: string`\n\n### Returns\n\n- `{ data: { id: string; amount?: number; amount_paid?: number; contract_id?: string; created_at?: string; customer_id?: string; error_message?: string; fiat_credit_type?: credit_type_data; invoice_id?: string; payment_gateway?: object; revenue_system_payments?: object[]; status?: payment_status; updated_at?: string; }; }`\n\n - `data: { id: string; amount?: number; amount_paid?: number; contract_id?: string; created_at?: string; customer_id?: string; error_message?: string; fiat_credit_type?: { id: string; name: string; }; invoice_id?: string; payment_gateway?: { stripe: { payment_intent_id: string; error?: object; payment_method_id?: string; }; type: 'stripe'; }; revenue_system_payments?: { revenue_system_provider: string; sync_status: string; error_message?: string; revenue_system_external_payment_id?: string; }[]; status?: 'pending' | 'requires_intervention' | 'paid' | 'canceled'; updated_at?: string; }`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst response = await client.v1.payments.attempt({ customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d', invoice_id: '6162d87b-e5db-4a33-b7f2-76ce6ead4e85' });\n\nconsole.log(response);\n```",
- perLanguage: {
- typescript: {
- method: 'client.v1.payments.attempt',
- example:
- "import Metronome from '@metronome/sdk';\n\nconst client = new Metronome({\n bearerToken: process.env['METRONOME_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst response = await client.v1.payments.attempt({\n customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',\n invoice_id: '6162d87b-e5db-4a33-b7f2-76ce6ead4e85',\n});\n\nconsole.log(response.data);",
- },
- python: {
- method: 'v1.payments.attempt',
- example:
- 'import os\nfrom metronome import Metronome\n\nclient = Metronome(\n bearer_token=os.environ.get("METRONOME_BEARER_TOKEN"), # This is the default and can be omitted\n)\nresponse = client.v1.payments.attempt(\n customer_id="13117714-3f05-48e5-a6e9-a66093f13b4d",\n invoice_id="6162d87b-e5db-4a33-b7f2-76ce6ead4e85",\n)\nprint(response.data)',
- },
- java: {
- method: 'v1().payments().attempt',
- example:
- 'package com.metronome.api.example;\n\nimport com.metronome.api.client.MetronomeClient;\nimport com.metronome.api.client.okhttp.MetronomeOkHttpClient;\nimport com.metronome.api.models.v1.payments.PaymentAttemptParams;\nimport com.metronome.api.models.v1.payments.PaymentAttemptResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n MetronomeClient client = MetronomeOkHttpClient.fromEnv();\n\n PaymentAttemptParams params = PaymentAttemptParams.builder()\n .customerId("13117714-3f05-48e5-a6e9-a66093f13b4d")\n .invoiceId("6162d87b-e5db-4a33-b7f2-76ce6ead4e85")\n .build();\n PaymentAttemptResponse response = client.v1().payments().attempt(params);\n }\n}',
- },
- go: {
- method: 'client.V1.Payments.Attempt',
- example:
- 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Metronome-Industries/metronome-go"\n\t"github.com/Metronome-Industries/metronome-go/option"\n)\n\nfunc main() {\n\tclient := metronome.NewClient(\n\t\toption.WithBearerToken("My Bearer Token"),\n\t)\n\tresponse, err := client.V1.Payments.Attempt(context.TODO(), metronome.V1PaymentAttemptParams{\n\t\tCustomerID: "13117714-3f05-48e5-a6e9-a66093f13b4d",\n\t\tInvoiceID: "6162d87b-e5db-4a33-b7f2-76ce6ead4e85",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Data)\n}\n',
- },
- ruby: {
- method: 'v1.payments.attempt',
- example:
- 'require "metronome_sdk"\n\nmetronome = MetronomeSDK::Client.new(bearer_token: "My Bearer Token")\n\nresponse = metronome.v1.payments.attempt(\n customer_id: "13117714-3f05-48e5-a6e9-a66093f13b4d",\n invoice_id: "6162d87b-e5db-4a33-b7f2-76ce6ead4e85"\n)\n\nputs(response)',
- },
- http: {
- example:
- 'curl https://api.metronome.com/v1/payments/attempt \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $METRONOME_BEARER_TOKEN" \\\n -d \'{\n "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d",\n "invoice_id": "6162d87b-e5db-4a33-b7f2-76ce6ead4e85"\n }\'',
- },
- },
- },
- {
- name: 'cancel',
- endpoint: '/v1/payments/cancel',
- httpMethod: 'post',
- summary: 'Cancel a payment for an invoice',
- description: 'Cancel an existing payment attempt for an invoice.\n',
- stainlessPath: '(resource) v1.payments > (method) cancel',
- qualified: 'client.v1.payments.cancel',
- params: ['customer_id: string;', 'invoice_id: string;'],
- response:
- '{ data: { id: string; amount?: number; amount_paid?: number; contract_id?: string; created_at?: string; customer_id?: string; error_message?: string; fiat_credit_type?: credit_type_data; invoice_id?: string; payment_gateway?: object; revenue_system_payments?: object[]; status?: payment_status; updated_at?: string; }; }',
- markdown:
- "## cancel\n\n`client.v1.payments.cancel(customer_id: string, invoice_id: string): { data: payment; }`\n\n**post** `/v1/payments/cancel`\n\nCancel an existing payment attempt for an invoice.\n\n\n### Parameters\n\n- `customer_id: string`\n\n- `invoice_id: string`\n\n### Returns\n\n- `{ data: { id: string; amount?: number; amount_paid?: number; contract_id?: string; created_at?: string; customer_id?: string; error_message?: string; fiat_credit_type?: credit_type_data; invoice_id?: string; payment_gateway?: object; revenue_system_payments?: object[]; status?: payment_status; updated_at?: string; }; }`\n\n - `data: { id: string; amount?: number; amount_paid?: number; contract_id?: string; created_at?: string; customer_id?: string; error_message?: string; fiat_credit_type?: { id: string; name: string; }; invoice_id?: string; payment_gateway?: { stripe: { payment_intent_id: string; error?: object; payment_method_id?: string; }; type: 'stripe'; }; revenue_system_payments?: { revenue_system_provider: string; sync_status: string; error_message?: string; revenue_system_external_payment_id?: string; }[]; status?: 'pending' | 'requires_intervention' | 'paid' | 'canceled'; updated_at?: string; }`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst response = await client.v1.payments.cancel({ customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d', invoice_id: '6162d87b-e5db-4a33-b7f2-76ce6ead4e85' });\n\nconsole.log(response);\n```",
- perLanguage: {
- typescript: {
- method: 'client.v1.payments.cancel',
- example:
- "import Metronome from '@metronome/sdk';\n\nconst client = new Metronome({\n bearerToken: process.env['METRONOME_BEARER_TOKEN'], // This is the default and can be omitted\n});\n\nconst response = await client.v1.payments.cancel({\n customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',\n invoice_id: '6162d87b-e5db-4a33-b7f2-76ce6ead4e85',\n});\n\nconsole.log(response.data);",
- },
- python: {
- method: 'v1.payments.cancel',
- example:
- 'import os\nfrom metronome import Metronome\n\nclient = Metronome(\n bearer_token=os.environ.get("METRONOME_BEARER_TOKEN"), # This is the default and can be omitted\n)\nresponse = client.v1.payments.cancel(\n customer_id="13117714-3f05-48e5-a6e9-a66093f13b4d",\n invoice_id="6162d87b-e5db-4a33-b7f2-76ce6ead4e85",\n)\nprint(response.data)',
- },
- java: {
- method: 'v1().payments().cancel',
- example:
- 'package com.metronome.api.example;\n\nimport com.metronome.api.client.MetronomeClient;\nimport com.metronome.api.client.okhttp.MetronomeOkHttpClient;\nimport com.metronome.api.models.v1.payments.PaymentCancelParams;\nimport com.metronome.api.models.v1.payments.PaymentCancelResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n MetronomeClient client = MetronomeOkHttpClient.fromEnv();\n\n PaymentCancelParams params = PaymentCancelParams.builder()\n .customerId("13117714-3f05-48e5-a6e9-a66093f13b4d")\n .invoiceId("6162d87b-e5db-4a33-b7f2-76ce6ead4e85")\n .build();\n PaymentCancelResponse response = client.v1().payments().cancel(params);\n }\n}',
- },
- go: {
- method: 'client.V1.Payments.Cancel',
- example:
- 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Metronome-Industries/metronome-go"\n\t"github.com/Metronome-Industries/metronome-go/option"\n)\n\nfunc main() {\n\tclient := metronome.NewClient(\n\t\toption.WithBearerToken("My Bearer Token"),\n\t)\n\tresponse, err := client.V1.Payments.Cancel(context.TODO(), metronome.V1PaymentCancelParams{\n\t\tCustomerID: "13117714-3f05-48e5-a6e9-a66093f13b4d",\n\t\tInvoiceID: "6162d87b-e5db-4a33-b7f2-76ce6ead4e85",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Data)\n}\n',
- },
- ruby: {
- method: 'v1.payments.cancel',
- example:
- 'require "metronome_sdk"\n\nmetronome = MetronomeSDK::Client.new(bearer_token: "My Bearer Token")\n\nresponse = metronome.v1.payments.cancel(\n customer_id: "13117714-3f05-48e5-a6e9-a66093f13b4d",\n invoice_id: "6162d87b-e5db-4a33-b7f2-76ce6ead4e85"\n)\n\nputs(response)',
- },
- http: {
- example:
- 'curl https://api.metronome.com/v1/payments/cancel \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $METRONOME_BEARER_TOKEN" \\\n -d \'{\n "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d",\n "invoice_id": "6162d87b-e5db-4a33-b7f2-76ce6ead4e85"\n }\'',
- },
- },
- },
{
name: 'upsert_avalara_credentials',
endpoint: '/v1/upsertAvalaraCredentials',
diff --git a/packages/mcp-server/src/methods.ts b/packages/mcp-server/src/methods.ts
index 92c9086c..d7591ea6 100644
--- a/packages/mcp-server/src/methods.ts
+++ b/packages/mcp-server/src/methods.ts
@@ -682,24 +682,6 @@ export const sdkMethods: SdkMethod[] = [
httpMethod: 'post',
httpPath: '/v1/packages/listContractsOnPackage',
},
- {
- clientCallName: 'client.v1.payments.list',
- fullyQualifiedName: 'v1.payments.list',
- httpMethod: 'post',
- httpPath: '/v1/payments/list',
- },
- {
- clientCallName: 'client.v1.payments.attempt',
- fullyQualifiedName: 'v1.payments.attempt',
- httpMethod: 'post',
- httpPath: '/v1/payments/attempt',
- },
- {
- clientCallName: 'client.v1.payments.cancel',
- fullyQualifiedName: 'v1.payments.cancel',
- httpMethod: 'post',
- httpPath: '/v1/payments/cancel',
- },
{
clientCallName: 'client.v1.settings.upsertAvalaraCredentials',
fullyQualifiedName: 'v1.settings.upsertAvalaraCredentials',
diff --git a/src/resources/v1/index.ts b/src/resources/v1/index.ts
index 988ca5bc..02d664b6 100644
--- a/src/resources/v1/index.ts
+++ b/src/resources/v1/index.ts
@@ -143,17 +143,6 @@ export {
type PackageListResponsesCursorPage,
type PackageListContractsOnPackageResponsesCursorPage,
} from './packages';
-export {
- Payments,
- type Payment,
- type PaymentStatus,
- type PaymentAttemptResponse,
- type PaymentCancelResponse,
- type PaymentListParams,
- type PaymentAttemptParams,
- type PaymentCancelParams,
- type PaymentsBodyCursorPage,
-} from './payments';
export {
Plans,
type PlanDetail,
diff --git a/src/resources/v1/payments.ts b/src/resources/v1/payments.ts
deleted file mode 100644
index 1bb38048..00000000
--- a/src/resources/v1/payments.ts
+++ /dev/null
@@ -1,187 +0,0 @@
-// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-import { APIResource } from '../../core/resource';
-import * as Shared from '../shared';
-import { APIPromise } from '../../core/api-promise';
-import { BodyCursorPage, type BodyCursorPageParams, PagePromise } from '../../core/pagination';
-import { RequestOptions } from '../../internal/request-options';
-
-export class Payments extends APIResource {
- /**
- * Fetch all payment attempts for the given invoice.
- *
- * @example
- * ```ts
- * // Automatically fetches more pages as needed.
- * for await (const payment of client.v1.payments.list({
- * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
- * invoice_id: '6162d87b-e5db-4a33-b7f2-76ce6ead4e85',
- * statuses: ['pending', 'requires_intervention'],
- * })) {
- * // ...
- * }
- * ```
- */
- list(body: PaymentListParams, options?: RequestOptions): PagePromise {
- return this._client.getAPIList('/v1/payments/list', BodyCursorPage, {
- body,
- method: 'post',
- ...options,
- });
- }
-
- /**
- * Trigger a new attempt by canceling any existing attempts for this invoice and
- * creating a new Payment. This will trigger another attempt to charge the
- * Customer's configured Payment Gateway. Payment can only be attempted if all of
- * the following are true:
- *
- * - The Metronome Invoice is finalized
- * - PLG Invoicing is configured for the Customer
- * - You cannot attempt payments for invoices that have already been `paid` or
- * `voided`.
- *
- * Attempting to payment on an ineligible Invoice or Customer will result in a
- * `400` response.
- *
- * @example
- * ```ts
- * const response = await client.v1.payments.attempt({
- * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
- * invoice_id: '6162d87b-e5db-4a33-b7f2-76ce6ead4e85',
- * });
- * ```
- */
- attempt(body: PaymentAttemptParams, options?: RequestOptions): APIPromise {
- return this._client.post('/v1/payments/attempt', { body, ...options });
- }
-
- /**
- * Cancel an existing payment attempt for an invoice.
- *
- * @example
- * ```ts
- * const response = await client.v1.payments.cancel({
- * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
- * invoice_id: '6162d87b-e5db-4a33-b7f2-76ce6ead4e85',
- * });
- * ```
- */
- cancel(body: PaymentCancelParams, options?: RequestOptions): APIPromise {
- return this._client.post('/v1/payments/cancel', { body, ...options });
- }
-}
-
-export type PaymentsBodyCursorPage = BodyCursorPage;
-
-export interface Payment {
- id: string;
-
- amount?: number;
-
- amount_paid?: number;
-
- contract_id?: string;
-
- created_at?: string;
-
- customer_id?: string;
-
- error_message?: string;
-
- fiat_credit_type?: Shared.CreditTypeData;
-
- invoice_id?: string;
-
- payment_gateway?: Payment.PaymentGateway;
-
- revenue_system_payments?: Array;
-
- status?: PaymentStatus;
-
- updated_at?: string;
-}
-
-export namespace Payment {
- export interface PaymentGateway {
- stripe: PaymentGateway.Stripe;
-
- type: 'stripe';
- }
-
- export namespace PaymentGateway {
- export interface Stripe {
- payment_intent_id: string;
-
- error?: Stripe.Error;
-
- payment_method_id?: string;
- }
-
- export namespace Stripe {
- export interface Error {
- code?: string;
-
- decline_code?: string;
-
- type?: string;
- }
- }
- }
-
- export interface RevenueSystemPayment {
- revenue_system_provider: string;
-
- sync_status: string;
-
- /**
- * The error message from the revenue system, if available.
- */
- error_message?: string;
-
- revenue_system_external_payment_id?: string;
- }
-}
-
-export type PaymentStatus = 'pending' | 'requires_intervention' | 'paid' | 'canceled';
-
-export interface PaymentAttemptResponse {
- data: Payment;
-}
-
-export interface PaymentCancelResponse {
- data: Payment;
-}
-
-export interface PaymentListParams extends BodyCursorPageParams {
- customer_id: string;
-
- invoice_id: string;
-
- statuses?: Array;
-}
-
-export interface PaymentAttemptParams {
- customer_id: string;
-
- invoice_id: string;
-}
-
-export interface PaymentCancelParams {
- customer_id: string;
-
- invoice_id: string;
-}
-
-export declare namespace Payments {
- export {
- type Payment as Payment,
- type PaymentStatus as PaymentStatus,
- type PaymentAttemptResponse as PaymentAttemptResponse,
- type PaymentCancelResponse as PaymentCancelResponse,
- type PaymentsBodyCursorPage as PaymentsBodyCursorPage,
- type PaymentListParams as PaymentListParams,
- type PaymentAttemptParams as PaymentAttemptParams,
- type PaymentCancelParams as PaymentCancelParams,
- };
-}
diff --git a/src/resources/v1/v1.ts b/src/resources/v1/v1.ts
index 3c0a1584..0e7c3e9c 100644
--- a/src/resources/v1/v1.ts
+++ b/src/resources/v1/v1.ts
@@ -85,18 +85,6 @@ import {
PackageRetrieveResponse,
Packages,
} from './packages';
-import * as PaymentsAPI from './payments';
-import {
- Payment,
- PaymentAttemptParams,
- PaymentAttemptResponse,
- PaymentCancelParams,
- PaymentCancelResponse,
- PaymentListParams,
- PaymentStatus,
- Payments,
- PaymentsBodyCursorPage,
-} from './payments';
import * as PlansAPI from './plans';
import {
PlanDetail,
@@ -222,7 +210,6 @@ export class V1 extends APIResource {
invoices: InvoicesAPI.Invoices = new InvoicesAPI.Invoices(this._client);
contracts: ContractsAPI.Contracts = new ContractsAPI.Contracts(this._client);
packages: PackagesAPI.Packages = new PackagesAPI.Packages(this._client);
- payments: PaymentsAPI.Payments = new PaymentsAPI.Payments(this._client);
settings: SettingsAPI.Settings = new SettingsAPI.Settings(this._client);
}
@@ -240,7 +227,6 @@ V1.Services = Services;
V1.Invoices = Invoices;
V1.Contracts = Contracts;
V1.Packages = Packages;
-V1.Payments = Payments;
V1.Settings = Settings;
export declare namespace V1 {
@@ -435,18 +421,6 @@ export declare namespace V1 {
type PackageListContractsOnPackageParams as PackageListContractsOnPackageParams,
};
- export {
- Payments as Payments,
- type Payment as Payment,
- type PaymentStatus as PaymentStatus,
- type PaymentAttemptResponse as PaymentAttemptResponse,
- type PaymentCancelResponse as PaymentCancelResponse,
- type PaymentsBodyCursorPage as PaymentsBodyCursorPage,
- type PaymentListParams as PaymentListParams,
- type PaymentAttemptParams as PaymentAttemptParams,
- type PaymentCancelParams as PaymentCancelParams,
- };
-
export {
Settings as Settings,
type SettingUpsertAvalaraCredentialsResponse as SettingUpsertAvalaraCredentialsResponse,
diff --git a/tests/api-resources/v1/payments.test.ts b/tests/api-resources/v1/payments.test.ts
deleted file mode 100644
index d8261853..00000000
--- a/tests/api-resources/v1/payments.test.ts
+++ /dev/null
@@ -1,76 +0,0 @@
-// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-import Metronome from '@metronome/sdk';
-
-const client = new Metronome({
- bearerToken: 'My Bearer Token',
- baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
-});
-
-describe('resource payments', () => {
- test('list: only required params', async () => {
- const responsePromise = client.v1.payments.list({
- customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
- invoice_id: '6162d87b-e5db-4a33-b7f2-76ce6ead4e85',
- });
- const rawResponse = await responsePromise.asResponse();
- expect(rawResponse).toBeInstanceOf(Response);
- const response = await responsePromise;
- expect(response).not.toBeInstanceOf(Response);
- const dataAndResponse = await responsePromise.withResponse();
- expect(dataAndResponse.data).toBe(response);
- expect(dataAndResponse.response).toBe(rawResponse);
- });
-
- test('list: required and optional params', async () => {
- const response = await client.v1.payments.list({
- customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
- invoice_id: '6162d87b-e5db-4a33-b7f2-76ce6ead4e85',
- limit: 1,
- next_page: 'next_page',
- statuses: ['pending', 'requires_intervention'],
- });
- });
-
- test('attempt: only required params', async () => {
- const responsePromise = client.v1.payments.attempt({
- customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
- invoice_id: '6162d87b-e5db-4a33-b7f2-76ce6ead4e85',
- });
- const rawResponse = await responsePromise.asResponse();
- expect(rawResponse).toBeInstanceOf(Response);
- const response = await responsePromise;
- expect(response).not.toBeInstanceOf(Response);
- const dataAndResponse = await responsePromise.withResponse();
- expect(dataAndResponse.data).toBe(response);
- expect(dataAndResponse.response).toBe(rawResponse);
- });
-
- test('attempt: required and optional params', async () => {
- const response = await client.v1.payments.attempt({
- customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
- invoice_id: '6162d87b-e5db-4a33-b7f2-76ce6ead4e85',
- });
- });
-
- test('cancel: only required params', async () => {
- const responsePromise = client.v1.payments.cancel({
- customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
- invoice_id: '6162d87b-e5db-4a33-b7f2-76ce6ead4e85',
- });
- const rawResponse = await responsePromise.asResponse();
- expect(rawResponse).toBeInstanceOf(Response);
- const response = await responsePromise;
- expect(response).not.toBeInstanceOf(Response);
- const dataAndResponse = await responsePromise.withResponse();
- expect(dataAndResponse.data).toBe(response);
- expect(dataAndResponse.response).toBe(rawResponse);
- });
-
- test('cancel: required and optional params', async () => {
- const response = await client.v1.payments.cancel({
- customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
- invoice_id: '6162d87b-e5db-4a33-b7f2-76ce6ead4e85',
- });
- });
-});
From d2ddd8d5425c2995322d4fa541a2fd7f8a093256 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 20 May 2026 18:41:43 +0000
Subject: [PATCH 03/19] codegen metadata
---
.stats.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index f2a6308a..7744a605 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 115
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome/metronome-1fc23246733b95562c50db7e71b6b4478dc9d0ffb5c5c4904fb23c54101b0147.yml
-openapi_spec_hash: 256a59fd7250f134f04834b7c036dd79
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome/metronome-dbd50ef98db74bd1f0b3814f18c7e2f7f74ffd21d7762bcd158bee768161d835.yml
+openapi_spec_hash: 778a62840be80a2e38e5424396d01c3f
config_hash: 6bd82f310398d5d47bcfeb8d7ed150b3
From 0c80dcaf8a0746625d06724cc362ae862a2da889 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 20 May 2026 19:14:43 +0000
Subject: [PATCH 04/19] codegen metadata
---
.stats.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 7744a605..899b10c7 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 115
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome/metronome-dbd50ef98db74bd1f0b3814f18c7e2f7f74ffd21d7762bcd158bee768161d835.yml
-openapi_spec_hash: 778a62840be80a2e38e5424396d01c3f
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome/metronome-36fc8156378a98fc77059087db964cc19562c3287d51294b51d70312512cff93.yml
+openapi_spec_hash: 3cfe456438dd6d9414eba0cf349da362
config_hash: 6bd82f310398d5d47bcfeb8d7ed150b3
From 0be3ebe5ba6f7457e66951ffbf84cc9c65a0332b Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 21 May 2026 19:17:04 +0000
Subject: [PATCH 05/19] codegen metadata
---
.stats.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 899b10c7..b2c39047 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 115
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome/metronome-36fc8156378a98fc77059087db964cc19562c3287d51294b51d70312512cff93.yml
-openapi_spec_hash: 3cfe456438dd6d9414eba0cf349da362
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome/metronome-e9e81f7f7a20b3a60767f578675f373a57565b2c3e80c4639a37be65d78d16a9.yml
+openapi_spec_hash: 8c5de2c6ae92fb5f39b0d566824e528b
config_hash: 6bd82f310398d5d47bcfeb8d7ed150b3
From 0348e047fa9153b78e02de320ab078bb6c957dec Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 22 May 2026 17:38:50 +0000
Subject: [PATCH 06/19] codegen metadata
---
.stats.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index b2c39047..6148c216 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 115
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome/metronome-e9e81f7f7a20b3a60767f578675f373a57565b2c3e80c4639a37be65d78d16a9.yml
-openapi_spec_hash: 8c5de2c6ae92fb5f39b0d566824e528b
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome/metronome-09ff569441680e6d58fe1e436a86ffd69296ca1ff17b6d18a21d14ad0351a5bc.yml
+openapi_spec_hash: b615c300a8a481edcc1ca75a8a62ccc9
config_hash: 6bd82f310398d5d47bcfeb8d7ed150b3
From d72d55502c804fe7914316926ee9c3e914f7a2e1 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 22 May 2026 20:49:44 +0000
Subject: [PATCH 07/19] codegen metadata
---
.stats.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 6148c216..2675c5fe 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 115
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome/metronome-09ff569441680e6d58fe1e436a86ffd69296ca1ff17b6d18a21d14ad0351a5bc.yml
-openapi_spec_hash: b615c300a8a481edcc1ca75a8a62ccc9
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome/metronome-cb4da5f78bd75feeb79a9b4e7b8543c9313babf98e83199985e8722038e3ed2d.yml
+openapi_spec_hash: 3da0a14a0764d78c475d601b026ab419
config_hash: 6bd82f310398d5d47bcfeb8d7ed150b3
From fc920c36a4cb7262cf70ae3b895b4e129b4a2f8b Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 22 May 2026 22:59:44 +0000
Subject: [PATCH 08/19] feat: nikku-orch-1723-update-create-contract
---
.stats.yml | 4 +-
packages/mcp-server/src/local-docs-search.ts | 70 ++---
src/resources/shared.ts | 242 ++++++++++++++++++
src/resources/v1/contracts/contracts.ts | 64 +++++
src/resources/v1/packages.ts | 85 +++++-
src/resources/v2/contracts.ts | 141 ++++++++++
.../v1/contracts/contracts.test.ts | 26 +-
tests/api-resources/v1/packages.test.ts | 24 +-
tests/api-resources/v2/contracts.test.ts | 36 ++-
9 files changed, 645 insertions(+), 47 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 2675c5fe..ec86c937 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 115
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome/metronome-cb4da5f78bd75feeb79a9b4e7b8543c9313babf98e83199985e8722038e3ed2d.yml
-openapi_spec_hash: 3da0a14a0764d78c475d601b026ab419
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome/metronome-78581b862a542a362a59fb6561b0bc245fa73b9e3b7f2cdb8ec1327043f56b7a.yml
+openapi_spec_hash: 27c21b4c41612ca9923c07a90f47c07e
config_hash: 6bd82f310398d5d47bcfeb8d7ed150b3
diff --git a/packages/mcp-server/src/local-docs-search.ts b/packages/mcp-server/src/local-docs-search.ts
index 5a164718..852a540b 100644
--- a/packages/mcp-server/src/local-docs-search.ts
+++ b/packages/mcp-server/src/local-docs-search.ts
@@ -67,9 +67,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [
'include_ledgers?: boolean;',
],
response:
- "{ data: { id: string; commits: object[]; created_at: string; created_by: string; customer_id: string; overrides: object[]; scheduled_charges: scheduled_charge[]; starting_at: string; transitions: object[]; usage_filter: object[]; usage_statement_schedule: object; archived_at?: string; credits?: object[]; custom_fields?: object; customer_billing_provider_configuration?: object; discounts?: discount[]; ending_before?: string; has_more?: object; hierarchy_configuration?: object | object; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration_v2; priority?: number; professional_services?: pro_service[]; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; reseller_royalties?: object[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration_v2; subscriptions?: object[]; total_contract_value?: number; uniqueness_key?: string; }; }",
+ "{ data: { id: string; commits: object[]; created_at: string; created_by: string; customer_id: string; overrides: object[]; scheduled_charges: scheduled_charge[]; starting_at: string; transitions: object[]; usage_filter: object[]; usage_statement_schedule: object; archived_at?: string; credits?: object[]; custom_fields?: object; customer_billing_provider_configuration?: object; discounts?: discount[]; ending_before?: string; has_more?: object; hierarchy_configuration?: object | object; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration_v2; priority?: number; professional_services?: pro_service[]; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; reseller_royalties?: object[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration_v2; spend_trackers?: object[]; subscriptions?: object[]; total_contract_value?: number; uniqueness_key?: string; }; }",
markdown:
- "## retrieve\n\n`client.v2.contracts.retrieve(contract_id: string, customer_id: string, as_of_date?: string, include_balance?: boolean, include_ledgers?: boolean): { data: contract_v2; }`\n\n**post** `/v2/contracts/get`\n\nGets the details for a specific contract, including contract term, rate card information, credits and commits, and more. \n\n### Use this endpoint to: \n- Check the duration of a customer's current contract\n- Get details on contract terms, including access schedule amounts for commitments and credits\n- Understand the state of a contract at a past time. As you can evolve the terms of a contract over time through editing, use the `as_of_date` parameter to view the full contract configuration as of that point in time. \n\n### Usage guidelines: \n- Optionally, use the `include_balance` and `include_ledger` fields to include balances and ledgers in the credit and commit responses. Using these fields will cause the query to be slower.\n\n\n### Parameters\n\n- `contract_id: string`\n\n- `customer_id: string`\n\n- `as_of_date?: string`\n Optional RFC 3339 timestamp. Return the contract as of this date. Cannot be used with include_ledgers parameter.\n\n- `include_balance?: boolean`\n Include the balance of credits and commits in the response. Setting this flag may cause the query to be slower.\n\n- `include_ledgers?: boolean`\n Include commit/credit ledgers in the response. Setting this flag may cause the query to be slower. Cannot be used with as_of_date parameter.\n\n### Returns\n\n- `{ data: { id: string; commits: object[]; created_at: string; created_by: string; customer_id: string; overrides: object[]; scheduled_charges: scheduled_charge[]; starting_at: string; transitions: object[]; usage_filter: object[]; usage_statement_schedule: object; archived_at?: string; credits?: object[]; custom_fields?: object; customer_billing_provider_configuration?: object; discounts?: discount[]; ending_before?: string; has_more?: object; hierarchy_configuration?: object | object; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration_v2; priority?: number; professional_services?: pro_service[]; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; reseller_royalties?: object[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration_v2; subscriptions?: object[]; total_contract_value?: number; uniqueness_key?: string; }; }`\n\n - `data: { id: string; commits: { id: string; created_at: string; product: { id: string; name: string; }; type: 'PREPAID' | 'POSTPAID'; access_schedule?: object; applicable_contract_ids?: string[]; applicable_product_ids?: string[]; applicable_product_tags?: string[]; archived_at?: string; balance?: number; contract?: { id: string; }; custom_fields?: object; description?: string; hierarchy_configuration?: object; invoice_contract?: { id: string; }; invoice_schedule?: object; ledger?: { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_SEGMENT_START'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_ROLLOVER'; } | { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_EXPIRATION'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_CANCELED'; contract_id?: string; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_CREDITED'; contract_id?: string; } | { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT'; } | { amount: number; timestamp: string; type: 'POSTPAID_COMMIT_INITIAL_BALANCE'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'POSTPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'POSTPAID_COMMIT_ROLLOVER'; } | { amount: number; invoice_id: string; timestamp: string; type: 'POSTPAID_COMMIT_TRUEUP'; contract_id?: string; } | { amount: number; reason: string; timestamp: string; type: 'PREPAID_COMMIT_MANUAL'; } | { amount: number; reason: string; timestamp: string; type: 'POSTPAID_COMMIT_MANUAL'; } | { amount: number; timestamp: string; type: 'POSTPAID_COMMIT_EXPIRATION'; }[]; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurring_commit_id?: string; rolled_over_from?: { commit_id: string; contract_id: string; }; rollover_fraction?: number; salesforce_opportunity_id?: string; specifiers?: object[]; subscription_config?: object; }[]; created_at: string; created_by: string; customer_id: string; overrides: { id: string; created_at: string; starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; override_tiers?: object[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type?: credit_type_data; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: tier[]; }; priority?: number; product?: { id: string; name: string; }; target?: 'COMMIT_RATE' | 'LIST_RATE'; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]; scheduled_charges: { id: string; product: object; schedule: schedule_point_in_time; archived_at?: string; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]; starting_at: string; transitions: { from_contract_id: string; to_contract_id: string; type: 'SUPERSEDE' | 'RENEWAL'; }[]; usage_filter: { group_key: string; group_values: string[]; starting_at: string; ending_before?: string; }[]; usage_statement_schedule: { billing_anchor_date: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; }; archived_at?: string; credits?: { id: string; product: { id: string; name: string; }; type: 'CREDIT'; access_schedule?: object; applicable_contract_ids?: string[]; applicable_product_ids?: string[]; applicable_product_tags?: string[]; archived_at?: string; balance?: number; contract?: { id: string; }; created_at?: string; custom_fields?: object; description?: string; hierarchy_configuration?: object; ledger?: { amount: number; segment_id: string; timestamp: string; type: 'CREDIT_SEGMENT_START'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'CREDIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; segment_id: string; timestamp: string; type: 'CREDIT_EXPIRATION'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'CREDIT_CANCELED'; contract_id?: string; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'CREDIT_CREDITED'; contract_id?: string; } | { amount: number; reason: string; timestamp: string; type: 'CREDIT_MANUAL'; } | { amount: number; segment_id: string; timestamp: string; type: 'CREDIT_SEAT_BASED_ADJUSTMENT'; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'CREDIT_ROLLOVER'; }[]; name?: string; netsuite_sales_order_id?: string; priority?: number; recurring_credit_id?: string; rolled_over_from?: { contract_id: string; credit_id: string; }; salesforce_opportunity_id?: string; specifiers?: object[]; subscription_config?: object; }[]; custom_fields?: object; customer_billing_provider_configuration?: { id: string; billing_provider: string; delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }; discounts?: { id: string; product: object; schedule: schedule_point_in_time; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]; ending_before?: string; has_more?: { commits: boolean; credits: boolean; }; hierarchy_configuration?: { children: { contract_id: string; customer_id: string; }[]; parent_behavior?: { invoice_consolidation_type?: 'CONCATENATE' | 'NONE'; }; } | { parent: { contract_id: string; customer_id: string; }; payer?: 'SELF' | 'PARENT'; usage_statement_behavior?: 'CONSOLIDATE' | 'SEPARATE'; }; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config_v2; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; }; priority?: number; professional_services?: { id: string; max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[]; rate_card_id?: string; recurring_commits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; contract?: { id: string; }; description?: string; ending_before?: string; hierarchy_configuration?: object; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: object; }[]; recurring_credits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; contract?: { id: string; }; description?: string; ending_before?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: object; }[]; reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; segments: { fraction: number; netsuite_reseller_id: string; reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; ending_before?: string; gcp_account_id?: string; gcp_offer_id?: string; reseller_contract_value?: number; }[]; }[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config_v2; threshold_amount: number; discount_configuration?: object; }; subscriptions?: { billing_periods: { current?: object; next?: object; previous?: object; }; collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated: boolean; }; quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY'; quantity_schedule: { quantity: number; starting_at: string; ending_before?: string; }[]; starting_at: string; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product: object; }; id?: string; custom_fields?: object; description?: string; ending_before?: string; fiat_credit_type_id?: string; name?: string; seat_config?: { seat_group_key: string; }; }[]; total_contract_value?: number; uniqueness_key?: string; }`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst contract = await client.v2.contracts.retrieve({ contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc', customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d' });\n\nconsole.log(contract);\n```",
+ "## retrieve\n\n`client.v2.contracts.retrieve(contract_id: string, customer_id: string, as_of_date?: string, include_balance?: boolean, include_ledgers?: boolean): { data: contract_v2; }`\n\n**post** `/v2/contracts/get`\n\nGets the details for a specific contract, including contract term, rate card information, credits and commits, and more. \n\n### Use this endpoint to: \n- Check the duration of a customer's current contract\n- Get details on contract terms, including access schedule amounts for commitments and credits\n- Understand the state of a contract at a past time. As you can evolve the terms of a contract over time through editing, use the `as_of_date` parameter to view the full contract configuration as of that point in time. \n\n### Usage guidelines: \n- Optionally, use the `include_balance` and `include_ledger` fields to include balances and ledgers in the credit and commit responses. Using these fields will cause the query to be slower.\n\n\n### Parameters\n\n- `contract_id: string`\n\n- `customer_id: string`\n\n- `as_of_date?: string`\n Optional RFC 3339 timestamp. Return the contract as of this date. Cannot be used with include_ledgers parameter.\n\n- `include_balance?: boolean`\n Include the balance of credits and commits in the response. Setting this flag may cause the query to be slower.\n\n- `include_ledgers?: boolean`\n Include commit/credit ledgers in the response. Setting this flag may cause the query to be slower. Cannot be used with as_of_date parameter.\n\n### Returns\n\n- `{ data: { id: string; commits: object[]; created_at: string; created_by: string; customer_id: string; overrides: object[]; scheduled_charges: scheduled_charge[]; starting_at: string; transitions: object[]; usage_filter: object[]; usage_statement_schedule: object; archived_at?: string; credits?: object[]; custom_fields?: object; customer_billing_provider_configuration?: object; discounts?: discount[]; ending_before?: string; has_more?: object; hierarchy_configuration?: object | object; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration_v2; priority?: number; professional_services?: pro_service[]; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; reseller_royalties?: object[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration_v2; spend_trackers?: object[]; subscriptions?: object[]; total_contract_value?: number; uniqueness_key?: string; }; }`\n\n - `data: { id: string; commits: { id: string; created_at: string; product: { id: string; name: string; }; type: 'PREPAID' | 'POSTPAID'; access_schedule?: object; applicable_contract_ids?: string[]; applicable_product_ids?: string[]; applicable_product_tags?: string[]; archived_at?: string; balance?: number; contract?: { id: string; }; custom_fields?: object; description?: string; hierarchy_configuration?: object; invoice_contract?: { id: string; }; invoice_schedule?: object; ledger?: { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_SEGMENT_START'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_ROLLOVER'; } | { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_EXPIRATION'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_CANCELED'; contract_id?: string; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_CREDITED'; contract_id?: string; } | { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT'; } | { amount: number; timestamp: string; type: 'POSTPAID_COMMIT_INITIAL_BALANCE'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'POSTPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'POSTPAID_COMMIT_ROLLOVER'; } | { amount: number; invoice_id: string; timestamp: string; type: 'POSTPAID_COMMIT_TRUEUP'; contract_id?: string; } | { amount: number; reason: string; timestamp: string; type: 'PREPAID_COMMIT_MANUAL'; } | { amount: number; reason: string; timestamp: string; type: 'POSTPAID_COMMIT_MANUAL'; } | { amount: number; timestamp: string; type: 'POSTPAID_COMMIT_EXPIRATION'; }[]; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurring_commit_id?: string; rolled_over_from?: { commit_id: string; contract_id: string; }; rollover_fraction?: number; salesforce_opportunity_id?: string; specifiers?: object[]; spend_tracker_attributes?: { counts_as_discounted: boolean; }; subscription_config?: object; }[]; created_at: string; created_by: string; customer_id: string; overrides: { id: string; created_at: string; starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; override_tiers?: object[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type?: credit_type_data; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: tier[]; }; priority?: number; product?: { id: string; name: string; }; target?: 'COMMIT_RATE' | 'LIST_RATE'; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]; scheduled_charges: { id: string; product: object; schedule: schedule_point_in_time; archived_at?: string; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]; starting_at: string; transitions: { from_contract_id: string; to_contract_id: string; type: 'SUPERSEDE' | 'RENEWAL'; }[]; usage_filter: { group_key: string; group_values: string[]; starting_at: string; ending_before?: string; }[]; usage_statement_schedule: { billing_anchor_date: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; }; archived_at?: string; credits?: { id: string; product: { id: string; name: string; }; type: 'CREDIT'; access_schedule?: object; applicable_contract_ids?: string[]; applicable_product_ids?: string[]; applicable_product_tags?: string[]; archived_at?: string; balance?: number; contract?: { id: string; }; created_at?: string; custom_fields?: object; description?: string; hierarchy_configuration?: object; ledger?: { amount: number; segment_id: string; timestamp: string; type: 'CREDIT_SEGMENT_START'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'CREDIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; segment_id: string; timestamp: string; type: 'CREDIT_EXPIRATION'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'CREDIT_CANCELED'; contract_id?: string; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'CREDIT_CREDITED'; contract_id?: string; } | { amount: number; reason: string; timestamp: string; type: 'CREDIT_MANUAL'; } | { amount: number; segment_id: string; timestamp: string; type: 'CREDIT_SEAT_BASED_ADJUSTMENT'; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'CREDIT_ROLLOVER'; }[]; name?: string; netsuite_sales_order_id?: string; priority?: number; recurring_credit_id?: string; rolled_over_from?: { contract_id: string; credit_id: string; }; salesforce_opportunity_id?: string; specifiers?: object[]; subscription_config?: object; }[]; custom_fields?: object; customer_billing_provider_configuration?: { id: string; billing_provider: string; delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }; discounts?: { id: string; product: object; schedule: schedule_point_in_time; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]; ending_before?: string; has_more?: { commits: boolean; credits: boolean; }; hierarchy_configuration?: { children: { contract_id: string; customer_id: string; }[]; parent_behavior?: { invoice_consolidation_type?: 'CONCATENATE' | 'NONE'; }; } | { parent: { contract_id: string; customer_id: string; }; payer?: 'SELF' | 'PARENT'; usage_statement_behavior?: 'CONSOLIDATE' | 'SEPARATE'; }; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config_v2; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; }; priority?: number; professional_services?: { id: string; max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[]; rate_card_id?: string; recurring_commits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; contract?: { id: string; }; description?: string; ending_before?: string; hierarchy_configuration?: object; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: object; }[]; recurring_credits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; contract?: { id: string; }; description?: string; ending_before?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: object; }[]; reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; segments: { fraction: number; netsuite_reseller_id: string; reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; ending_before?: string; gcp_account_id?: string; gcp_offer_id?: string; reseller_contract_value?: number; }[]; }[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config_v2; threshold_amount: number; discount_configuration?: object; }; spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; accumulated_spend?: { amount: number; period_ending_before: string; period_starting_at: string; }; }[]; subscriptions?: { billing_periods: { current?: object; next?: object; previous?: object; }; collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated: boolean; }; quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY'; quantity_schedule: { quantity: number; starting_at: string; ending_before?: string; }[]; starting_at: string; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product: object; }; id?: string; custom_fields?: object; description?: string; ending_before?: string; fiat_credit_type_id?: string; name?: string; seat_config?: { seat_group_key: string; }; }[]; total_contract_value?: number; uniqueness_key?: string; }`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst contract = await client.v2.contracts.retrieve({ contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc', customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d' });\n\nconsole.log(contract);\n```",
perLanguage: {
typescript: {
method: 'client.v2.contracts.retrieve',
@@ -120,9 +120,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [
'starting_at?: string;',
],
response:
- "{ data: { id: string; commits: object[]; created_at: string; created_by: string; customer_id: string; overrides: object[]; scheduled_charges: scheduled_charge[]; starting_at: string; transitions: object[]; usage_filter: object[]; usage_statement_schedule: object; archived_at?: string; credits?: object[]; custom_fields?: object; customer_billing_provider_configuration?: object; discounts?: discount[]; ending_before?: string; has_more?: object; hierarchy_configuration?: object | object; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration_v2; priority?: number; professional_services?: pro_service[]; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; reseller_royalties?: object[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration_v2; subscriptions?: object[]; total_contract_value?: number; uniqueness_key?: string; }[]; }",
+ "{ data: { id: string; commits: object[]; created_at: string; created_by: string; customer_id: string; overrides: object[]; scheduled_charges: scheduled_charge[]; starting_at: string; transitions: object[]; usage_filter: object[]; usage_statement_schedule: object; archived_at?: string; credits?: object[]; custom_fields?: object; customer_billing_provider_configuration?: object; discounts?: discount[]; ending_before?: string; has_more?: object; hierarchy_configuration?: object | object; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration_v2; priority?: number; professional_services?: pro_service[]; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; reseller_royalties?: object[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration_v2; spend_trackers?: object[]; subscriptions?: object[]; total_contract_value?: number; uniqueness_key?: string; }[]; }",
markdown:
- "## list\n\n`client.v2.contracts.list(customer_id: string, covering_date?: string, include_archived?: boolean, include_balance?: boolean, include_ledgers?: boolean, starting_at?: string): { data: contract_v2[]; }`\n\n**post** `/v2/contracts/list`\n\nFor a given customer, lists all of their contracts in chronological order. \n\n### Use this endpoint to:\n- Check if a customer is provisioned with any contract, and at which tier\n- Check the duration and terms of a customer's current contract\n- Power a page in your end customer experience that shows the customer's history of tiers (e.g. this customer started out on the Pro Plan, then downgraded to the Starter plan).\n\n### Usage guidelines:\nUse the `starting_at`, `covering_date`, and `include_archived` parameters to filter the list of returned contracts. For example, to list only currently active contracts, pass `covering_date` equal to the current time.\n\n\n### Parameters\n\n- `customer_id: string`\n\n- `covering_date?: string`\n Optional RFC 3339 timestamp. Only include contracts active on the provided date. This cannot be provided if starting_at filter is provided.\n\n- `include_archived?: boolean`\n Include archived contracts in the response.\n\n- `include_balance?: boolean`\n Include the balance of credits and commits in the response. Setting this flag may cause the response to be slower.\n\n- `include_ledgers?: boolean`\n Include commit/credit ledgers in the response. Setting this flag may cause the response to be slower.\n\n- `starting_at?: string`\n Optional RFC 3339 timestamp. Only include contracts that started on or after this date. This cannot be provided if covering_date filter is provided.\n\n### Returns\n\n- `{ data: { id: string; commits: object[]; created_at: string; created_by: string; customer_id: string; overrides: object[]; scheduled_charges: scheduled_charge[]; starting_at: string; transitions: object[]; usage_filter: object[]; usage_statement_schedule: object; archived_at?: string; credits?: object[]; custom_fields?: object; customer_billing_provider_configuration?: object; discounts?: discount[]; ending_before?: string; has_more?: object; hierarchy_configuration?: object | object; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration_v2; priority?: number; professional_services?: pro_service[]; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; reseller_royalties?: object[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration_v2; subscriptions?: object[]; total_contract_value?: number; uniqueness_key?: string; }[]; }`\n\n - `data: { id: string; commits: { id: string; created_at: string; product: { id: string; name: string; }; type: 'PREPAID' | 'POSTPAID'; access_schedule?: object; applicable_contract_ids?: string[]; applicable_product_ids?: string[]; applicable_product_tags?: string[]; archived_at?: string; balance?: number; contract?: { id: string; }; custom_fields?: object; description?: string; hierarchy_configuration?: object; invoice_contract?: { id: string; }; invoice_schedule?: object; ledger?: { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_SEGMENT_START'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_ROLLOVER'; } | { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_EXPIRATION'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_CANCELED'; contract_id?: string; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_CREDITED'; contract_id?: string; } | { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT'; } | { amount: number; timestamp: string; type: 'POSTPAID_COMMIT_INITIAL_BALANCE'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'POSTPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'POSTPAID_COMMIT_ROLLOVER'; } | { amount: number; invoice_id: string; timestamp: string; type: 'POSTPAID_COMMIT_TRUEUP'; contract_id?: string; } | { amount: number; reason: string; timestamp: string; type: 'PREPAID_COMMIT_MANUAL'; } | { amount: number; reason: string; timestamp: string; type: 'POSTPAID_COMMIT_MANUAL'; } | { amount: number; timestamp: string; type: 'POSTPAID_COMMIT_EXPIRATION'; }[]; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurring_commit_id?: string; rolled_over_from?: { commit_id: string; contract_id: string; }; rollover_fraction?: number; salesforce_opportunity_id?: string; specifiers?: object[]; subscription_config?: object; }[]; created_at: string; created_by: string; customer_id: string; overrides: { id: string; created_at: string; starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; override_tiers?: object[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type?: credit_type_data; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: tier[]; }; priority?: number; product?: { id: string; name: string; }; target?: 'COMMIT_RATE' | 'LIST_RATE'; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]; scheduled_charges: { id: string; product: object; schedule: schedule_point_in_time; archived_at?: string; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]; starting_at: string; transitions: { from_contract_id: string; to_contract_id: string; type: 'SUPERSEDE' | 'RENEWAL'; }[]; usage_filter: { group_key: string; group_values: string[]; starting_at: string; ending_before?: string; }[]; usage_statement_schedule: { billing_anchor_date: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; }; archived_at?: string; credits?: { id: string; product: { id: string; name: string; }; type: 'CREDIT'; access_schedule?: object; applicable_contract_ids?: string[]; applicable_product_ids?: string[]; applicable_product_tags?: string[]; archived_at?: string; balance?: number; contract?: { id: string; }; created_at?: string; custom_fields?: object; description?: string; hierarchy_configuration?: object; ledger?: { amount: number; segment_id: string; timestamp: string; type: 'CREDIT_SEGMENT_START'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'CREDIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; segment_id: string; timestamp: string; type: 'CREDIT_EXPIRATION'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'CREDIT_CANCELED'; contract_id?: string; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'CREDIT_CREDITED'; contract_id?: string; } | { amount: number; reason: string; timestamp: string; type: 'CREDIT_MANUAL'; } | { amount: number; segment_id: string; timestamp: string; type: 'CREDIT_SEAT_BASED_ADJUSTMENT'; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'CREDIT_ROLLOVER'; }[]; name?: string; netsuite_sales_order_id?: string; priority?: number; recurring_credit_id?: string; rolled_over_from?: { contract_id: string; credit_id: string; }; salesforce_opportunity_id?: string; specifiers?: object[]; subscription_config?: object; }[]; custom_fields?: object; customer_billing_provider_configuration?: { id: string; billing_provider: string; delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }; discounts?: { id: string; product: object; schedule: schedule_point_in_time; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]; ending_before?: string; has_more?: { commits: boolean; credits: boolean; }; hierarchy_configuration?: { children: { contract_id: string; customer_id: string; }[]; parent_behavior?: { invoice_consolidation_type?: 'CONCATENATE' | 'NONE'; }; } | { parent: { contract_id: string; customer_id: string; }; payer?: 'SELF' | 'PARENT'; usage_statement_behavior?: 'CONSOLIDATE' | 'SEPARATE'; }; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config_v2; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; }; priority?: number; professional_services?: { id: string; max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[]; rate_card_id?: string; recurring_commits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; contract?: { id: string; }; description?: string; ending_before?: string; hierarchy_configuration?: object; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: object; }[]; recurring_credits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; contract?: { id: string; }; description?: string; ending_before?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: object; }[]; reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; segments: { fraction: number; netsuite_reseller_id: string; reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; ending_before?: string; gcp_account_id?: string; gcp_offer_id?: string; reseller_contract_value?: number; }[]; }[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config_v2; threshold_amount: number; discount_configuration?: object; }; subscriptions?: { billing_periods: { current?: object; next?: object; previous?: object; }; collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated: boolean; }; quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY'; quantity_schedule: { quantity: number; starting_at: string; ending_before?: string; }[]; starting_at: string; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product: object; }; id?: string; custom_fields?: object; description?: string; ending_before?: string; fiat_credit_type_id?: string; name?: string; seat_config?: { seat_group_key: string; }; }[]; total_contract_value?: number; uniqueness_key?: string; }[]`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst contracts = await client.v2.contracts.list({ customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d' });\n\nconsole.log(contracts);\n```",
+ "## list\n\n`client.v2.contracts.list(customer_id: string, covering_date?: string, include_archived?: boolean, include_balance?: boolean, include_ledgers?: boolean, starting_at?: string): { data: contract_v2[]; }`\n\n**post** `/v2/contracts/list`\n\nFor a given customer, lists all of their contracts in chronological order. \n\n### Use this endpoint to:\n- Check if a customer is provisioned with any contract, and at which tier\n- Check the duration and terms of a customer's current contract\n- Power a page in your end customer experience that shows the customer's history of tiers (e.g. this customer started out on the Pro Plan, then downgraded to the Starter plan).\n\n### Usage guidelines:\nUse the `starting_at`, `covering_date`, and `include_archived` parameters to filter the list of returned contracts. For example, to list only currently active contracts, pass `covering_date` equal to the current time.\n\n\n### Parameters\n\n- `customer_id: string`\n\n- `covering_date?: string`\n Optional RFC 3339 timestamp. Only include contracts active on the provided date. This cannot be provided if starting_at filter is provided.\n\n- `include_archived?: boolean`\n Include archived contracts in the response.\n\n- `include_balance?: boolean`\n Include the balance of credits and commits in the response. Setting this flag may cause the response to be slower.\n\n- `include_ledgers?: boolean`\n Include commit/credit ledgers in the response. Setting this flag may cause the response to be slower.\n\n- `starting_at?: string`\n Optional RFC 3339 timestamp. Only include contracts that started on or after this date. This cannot be provided if covering_date filter is provided.\n\n### Returns\n\n- `{ data: { id: string; commits: object[]; created_at: string; created_by: string; customer_id: string; overrides: object[]; scheduled_charges: scheduled_charge[]; starting_at: string; transitions: object[]; usage_filter: object[]; usage_statement_schedule: object; archived_at?: string; credits?: object[]; custom_fields?: object; customer_billing_provider_configuration?: object; discounts?: discount[]; ending_before?: string; has_more?: object; hierarchy_configuration?: object | object; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration_v2; priority?: number; professional_services?: pro_service[]; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; reseller_royalties?: object[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration_v2; spend_trackers?: object[]; subscriptions?: object[]; total_contract_value?: number; uniqueness_key?: string; }[]; }`\n\n - `data: { id: string; commits: { id: string; created_at: string; product: { id: string; name: string; }; type: 'PREPAID' | 'POSTPAID'; access_schedule?: object; applicable_contract_ids?: string[]; applicable_product_ids?: string[]; applicable_product_tags?: string[]; archived_at?: string; balance?: number; contract?: { id: string; }; custom_fields?: object; description?: string; hierarchy_configuration?: object; invoice_contract?: { id: string; }; invoice_schedule?: object; ledger?: { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_SEGMENT_START'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_ROLLOVER'; } | { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_EXPIRATION'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_CANCELED'; contract_id?: string; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_CREDITED'; contract_id?: string; } | { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT'; } | { amount: number; timestamp: string; type: 'POSTPAID_COMMIT_INITIAL_BALANCE'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'POSTPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'POSTPAID_COMMIT_ROLLOVER'; } | { amount: number; invoice_id: string; timestamp: string; type: 'POSTPAID_COMMIT_TRUEUP'; contract_id?: string; } | { amount: number; reason: string; timestamp: string; type: 'PREPAID_COMMIT_MANUAL'; } | { amount: number; reason: string; timestamp: string; type: 'POSTPAID_COMMIT_MANUAL'; } | { amount: number; timestamp: string; type: 'POSTPAID_COMMIT_EXPIRATION'; }[]; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurring_commit_id?: string; rolled_over_from?: { commit_id: string; contract_id: string; }; rollover_fraction?: number; salesforce_opportunity_id?: string; specifiers?: object[]; spend_tracker_attributes?: { counts_as_discounted: boolean; }; subscription_config?: object; }[]; created_at: string; created_by: string; customer_id: string; overrides: { id: string; created_at: string; starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; override_tiers?: object[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type?: credit_type_data; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: tier[]; }; priority?: number; product?: { id: string; name: string; }; target?: 'COMMIT_RATE' | 'LIST_RATE'; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]; scheduled_charges: { id: string; product: object; schedule: schedule_point_in_time; archived_at?: string; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]; starting_at: string; transitions: { from_contract_id: string; to_contract_id: string; type: 'SUPERSEDE' | 'RENEWAL'; }[]; usage_filter: { group_key: string; group_values: string[]; starting_at: string; ending_before?: string; }[]; usage_statement_schedule: { billing_anchor_date: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; }; archived_at?: string; credits?: { id: string; product: { id: string; name: string; }; type: 'CREDIT'; access_schedule?: object; applicable_contract_ids?: string[]; applicable_product_ids?: string[]; applicable_product_tags?: string[]; archived_at?: string; balance?: number; contract?: { id: string; }; created_at?: string; custom_fields?: object; description?: string; hierarchy_configuration?: object; ledger?: { amount: number; segment_id: string; timestamp: string; type: 'CREDIT_SEGMENT_START'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'CREDIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; segment_id: string; timestamp: string; type: 'CREDIT_EXPIRATION'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'CREDIT_CANCELED'; contract_id?: string; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'CREDIT_CREDITED'; contract_id?: string; } | { amount: number; reason: string; timestamp: string; type: 'CREDIT_MANUAL'; } | { amount: number; segment_id: string; timestamp: string; type: 'CREDIT_SEAT_BASED_ADJUSTMENT'; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'CREDIT_ROLLOVER'; }[]; name?: string; netsuite_sales_order_id?: string; priority?: number; recurring_credit_id?: string; rolled_over_from?: { contract_id: string; credit_id: string; }; salesforce_opportunity_id?: string; specifiers?: object[]; subscription_config?: object; }[]; custom_fields?: object; customer_billing_provider_configuration?: { id: string; billing_provider: string; delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }; discounts?: { id: string; product: object; schedule: schedule_point_in_time; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]; ending_before?: string; has_more?: { commits: boolean; credits: boolean; }; hierarchy_configuration?: { children: { contract_id: string; customer_id: string; }[]; parent_behavior?: { invoice_consolidation_type?: 'CONCATENATE' | 'NONE'; }; } | { parent: { contract_id: string; customer_id: string; }; payer?: 'SELF' | 'PARENT'; usage_statement_behavior?: 'CONSOLIDATE' | 'SEPARATE'; }; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config_v2; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; }; priority?: number; professional_services?: { id: string; max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[]; rate_card_id?: string; recurring_commits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; contract?: { id: string; }; description?: string; ending_before?: string; hierarchy_configuration?: object; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: object; }[]; recurring_credits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; contract?: { id: string; }; description?: string; ending_before?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: object; }[]; reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; segments: { fraction: number; netsuite_reseller_id: string; reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; ending_before?: string; gcp_account_id?: string; gcp_offer_id?: string; reseller_contract_value?: number; }[]; }[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config_v2; threshold_amount: number; discount_configuration?: object; }; spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; accumulated_spend?: { amount: number; period_ending_before: string; period_starting_at: string; }; }[]; subscriptions?: { billing_periods: { current?: object; next?: object; previous?: object; }; collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated: boolean; }; quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY'; quantity_schedule: { quantity: number; starting_at: string; ending_before?: string; }[]; starting_at: string; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product: object; }; id?: string; custom_fields?: object; description?: string; ending_before?: string; fiat_credit_type_id?: string; name?: string; seat_config?: { seat_group_key: string; }; }[]; total_contract_value?: number; uniqueness_key?: string; }[]`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst contracts = await client.v2.contracts.list({ customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d' });\n\nconsole.log(contracts);\n```",
perLanguage: {
typescript: {
method: 'client.v2.contracts.list',
@@ -168,23 +168,25 @@ const EMBEDDED_METHODS: MethodEntry[] = [
'contract_id: string;',
'customer_id: string;',
"add_billing_provider_configuration_update?: { billing_provider_configuration: { billing_provider?: string; billing_provider_configuration_id?: string; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }; schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }; };",
- "add_commits?: { product_id: string; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; amount?: number; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; on_session_payment?: boolean; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; temporary_id?: string; }[];",
+ "add_commits?: { product_id: string; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; amount?: number; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; on_session_payment?: boolean; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; spend_tracker_attributes?: { counts_as_discounted: boolean; }; temporary_id?: string; }[];",
"add_credits?: { access_schedule: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[];",
"add_discounts?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[];",
"add_overrides?: { starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: { price: number; size?: number; }[]; }; priority?: number; product_id?: string; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[];",
- "add_prepaid_balance_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; }; };",
+ "add_prepaid_balance_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; };",
'add_professional_services?: { max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[];',
"add_recurring_commits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'POOLED' | 'INDIVIDUAL'; }; temporary_id?: string; }[];",
"add_recurring_credits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'POOLED' | 'INDIVIDUAL'; }; temporary_id?: string; }[];",
"add_reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_options?: { aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; }; ending_before?: string; fraction?: number; gcp_options?: { gcp_account_id?: string; gcp_offer_id?: string; }; netsuite_reseller_id?: string; reseller_contract_value?: number; starting_at?: string; }[];",
"add_revenue_system_configuration_update?: { revenue_system_configuration: { delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; provider?: 'netsuite'; revenue_system_configuration_id?: string; }; schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }; };",
"add_scheduled_charges?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[];",
- "add_spend_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount: number; discount_configuration?: { payment_fraction: number; }; };",
+ "add_spend_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount: number; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; };",
+ "add_spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[];",
"add_subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated?: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product_id: string; }; custom_fields?: object; description?: string; ending_before?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { initial_seat_ids: string[]; seat_group_key: string; initial_unassigned_seats?: number; }; starting_at?: string; temporary_id?: string; }[];",
'allow_contract_ending_before_finalized_invoice?: boolean;',
'archive_commits?: { id: string; }[];',
'archive_credits?: { id: string; }[];',
'archive_scheduled_charges?: { id: string; }[];',
+ 'archive_spend_trackers?: string[];',
'remove_overrides?: { id: string; }[];',
'uniqueness_key?: string;',
"update_commits?: { commit_id: string; access_schedule?: { add_schedule_items?: { amount: number; ending_before: string; starting_at: string; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; ending_before?: string; starting_at?: string; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_schedule?: { add_schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; quantity?: number; timestamp?: string; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; rollover_fraction?: number; }[];",
@@ -192,16 +194,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [
'update_contract_name?: string;',
"update_credits?: { credit_id: string; access_schedule?: { add_schedule_items?: { amount: number; ending_before: string; starting_at: string; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; ending_before?: string; starting_at?: string; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; rollover_fraction?: number; }[];",
'update_net_payment_terms_days?: number;',
- "update_prepaid_balance_threshold_configuration?: { commit?: { description?: string; name?: string; priority?: number; product_id?: string; }; custom_credit_type_id?: string; discount_configuration?: { payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount?: number; threshold_amount?: number; };",
+ "update_prepaid_balance_threshold_configuration?: { commit?: { description?: string; name?: string; priority?: number; product_id?: string; }; custom_credit_type_id?: string; discount_configuration?: { cap?: { amount: number; spend_tracker_alias: string; }; payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount?: number; threshold_amount?: number; };",
"update_recurring_commits?: { recurring_commit_id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; invoice_amount?: { quantity?: number; unit_price?: number; }; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[];",
"update_recurring_credits?: { recurring_credit_id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[];",
'update_scheduled_charges?: { scheduled_charge_id: string; invoice_schedule?: { add_schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; quantity?: number; timestamp?: string; unit_price?: number; }[]; }; netsuite_sales_order_id?: string; }[];',
- "update_spend_threshold_configuration?: { commit?: { description?: string; name?: string; priority?: number; product_id?: string; }; discount_configuration?: { payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount?: number; };",
+ "update_spend_threshold_configuration?: { commit?: { description?: string; name?: string; priority?: number; product_id?: string; }; discount_configuration?: { cap?: { amount: number; spend_tracker_alias: string; }; payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount?: number; };",
"update_subscriptions?: { subscription_id: string; ending_before?: string; quantity_management_mode_update?: { quantity_management_mode: 'SEAT_BASED'; seat_config: { seat_group_key: string; }; }; quantity_updates?: { starting_at: string; quantity?: number; quantity_delta?: number; }[]; seat_updates?: { add_seat_ids?: { seat_ids: string[]; starting_at: string; }[]; add_unassigned_seats?: { quantity: number; starting_at: string; }[]; remove_seat_ids?: { seat_ids: string[]; starting_at: string; }[]; remove_unassigned_seats?: { quantity: number; starting_at: string; }[]; }; }[];",
],
response: '{ data: { id: string; }; }',
markdown:
- "## edit\n\n`client.v2.contracts.edit(contract_id: string, customer_id: string, add_billing_provider_configuration_update?: { billing_provider_configuration: { billing_provider?: string; billing_provider_configuration_id?: string; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }; schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }; }, add_commits?: { product_id: string; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: object[]; credit_type_id?: string; }; amount?: number; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: object; invoice_schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; name?: string; netsuite_sales_order_id?: string; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: object[]; temporary_id?: string; }[], add_credits?: { access_schedule: { schedule_items: object[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: object[]; }[], add_discounts?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[], add_overrides?: { starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: tier[]; }; priority?: number; product_id?: string; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[], add_prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config_v2; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; }, add_professional_services?: { max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[], add_recurring_commits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: object; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { apply_seat_increase_config: object; subscription_id: string; allocation?: 'POOLED' | 'INDIVIDUAL'; }; temporary_id?: string; }[], add_recurring_credits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { apply_seat_increase_config: object; subscription_id: string; allocation?: 'POOLED' | 'INDIVIDUAL'; }; temporary_id?: string; }[], add_reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_options?: { aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; }; ending_before?: string; fraction?: number; gcp_options?: { gcp_account_id?: string; gcp_offer_id?: string; }; netsuite_reseller_id?: string; reseller_contract_value?: number; starting_at?: string; }[], add_revenue_system_configuration_update?: { revenue_system_configuration: { delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; provider?: 'netsuite'; revenue_system_configuration_id?: string; }; schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }; }, add_scheduled_charges?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[], add_spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config_v2; threshold_amount: number; discount_configuration?: object; }, add_subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated?: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product_id: string; }; custom_fields?: object; description?: string; ending_before?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { initial_seat_ids: string[]; seat_group_key: string; initial_unassigned_seats?: number; }; starting_at?: string; temporary_id?: string; }[], allow_contract_ending_before_finalized_invoice?: boolean, archive_commits?: { id: string; }[], archive_credits?: { id: string; }[], archive_scheduled_charges?: { id: string; }[], remove_overrides?: { id: string; }[], uniqueness_key?: string, update_commits?: { commit_id: string; access_schedule?: { add_schedule_items?: object[]; remove_schedule_items?: object[]; update_schedule_items?: object[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: object; invoice_schedule?: { add_schedule_items?: object[]; remove_schedule_items?: object[]; update_schedule_items?: object[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; rollover_fraction?: number; }[], update_contract_end_date?: string, update_contract_name?: string, update_credits?: { credit_id: string; access_schedule?: { add_schedule_items?: object[]; remove_schedule_items?: object[]; update_schedule_items?: object[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; rollover_fraction?: number; }[], update_net_payment_terms_days?: number, update_prepaid_balance_threshold_configuration?: { commit?: object; custom_credit_type_id?: string; discount_configuration?: { payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: object; recharge_to_amount?: number; threshold_amount?: number; }, update_recurring_commits?: { recurring_commit_id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; invoice_amount?: { quantity?: number; unit_price?: number; }; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[], update_recurring_credits?: { recurring_credit_id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[], update_scheduled_charges?: { scheduled_charge_id: string; invoice_schedule?: { add_schedule_items?: object[]; remove_schedule_items?: object[]; update_schedule_items?: object[]; }; netsuite_sales_order_id?: string; }[], update_spend_threshold_configuration?: { commit?: object; discount_configuration?: { payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: object; threshold_amount?: number; }, update_subscriptions?: { subscription_id: string; ending_before?: string; quantity_management_mode_update?: { quantity_management_mode: 'SEAT_BASED'; seat_config: object; }; quantity_updates?: { starting_at: string; quantity?: number; quantity_delta?: number; }[]; seat_updates?: { add_seat_ids?: object[]; add_unassigned_seats?: object[]; remove_seat_ids?: object[]; remove_unassigned_seats?: object[]; }; }[]): { data: id; }`\n\n**post** `/v2/contracts/edit`\n\nThe ability to edit a contract helps you react quickly to the needs of your customers and your business.\n\n### Use this endpoint to:\n- Encode mid-term commitment and discount changes\n- Fix configuration mistakes and easily roll back packaging changes\n\n### Key response fields:\n- The `id` of the edit\n- Complete edit details. For example, if you edited the contract to add new overrides and credits, you will receive the IDs of those overrides and credits in the response.\n\n### Usage guidelines:\n- When you edit a contract, any draft invoices update immediately to reflect that edit. Finalized invoices remain unchanged - you must void and regenerate them in the UI or API to reflect the edit.\n- Contract editing must be enabled to use this endpoint. Reach out to your Metronome representative to learn more.\n\n\n### Parameters\n\n- `contract_id: string`\n ID of the contract being edited\n\n- `customer_id: string`\n ID of the customer whose contract is being edited\n\n- `add_billing_provider_configuration_update?: { billing_provider_configuration: { billing_provider?: string; billing_provider_configuration_id?: string; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }; schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }; }`\n Update the billing provider configuration on the contract. Currently only supports adding a billing provider configuration to a contract that does not already have one.\n - `billing_provider_configuration: { billing_provider?: string; billing_provider_configuration_id?: string; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }`\n - `schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }`\n Indicates when the billing provider will be active on the contract. Any charges accrued during the schedule will be billed to the indicated billing provider.\n\n- `add_commits?: { product_id: string; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; amount?: number; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; on_session_payment?: boolean; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; temporary_id?: string; }[]`\n\n- `add_credits?: { access_schedule: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]`\n\n- `add_discounts?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]`\n\n- `add_overrides?: { starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: { price: number; size?: number; }[]; }; priority?: number; product_id?: string; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]`\n\n- `add_prepaid_balance_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; }; }`\n - `commit: { product_id: string; description?: string; name?: string; priority?: number; }`\n - `is_enabled: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `recharge_to_amount: number`\n Specify the amount the balance should be recharged to.\n - `threshold_amount: number`\n Specify the threshold amount for the contract. Each time the contract's balance lowers to this amount, a threshold charge will be initiated.\n - `custom_credit_type_id?: string`\n If provided, the threshold, recharge-to amount, and the resulting threshold commit amount will be in terms of this credit type instead of the fiat currency.\n - `discount_configuration?: { payment_fraction: number; }`\n\n- `add_professional_services?: { max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[]`\n This field's availability is dependent on your client's configuration.\n\n- `add_recurring_commits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'POOLED' | 'INDIVIDUAL'; }; temporary_id?: string; }[]`\n\n- `add_recurring_credits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'POOLED' | 'INDIVIDUAL'; }; temporary_id?: string; }[]`\n\n- `add_reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_options?: { aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; }; ending_before?: string; fraction?: number; gcp_options?: { gcp_account_id?: string; gcp_offer_id?: string; }; netsuite_reseller_id?: string; reseller_contract_value?: number; starting_at?: string; }[]`\n\n- `add_revenue_system_configuration_update?: { revenue_system_configuration: { delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; provider?: 'netsuite'; revenue_system_configuration_id?: string; }; schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }; }`\n Update the revenue system configuration on the contract. Currently only supports adding a revenue system configuration to a contract that does not already have one.\n - `revenue_system_configuration: { delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; provider?: 'netsuite'; revenue_system_configuration_id?: string; }`\n - `schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }`\n\n- `add_scheduled_charges?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]`\n\n- `add_spend_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount: number; discount_configuration?: { payment_fraction: number; }; }`\n - `commit: { product_id: string; description?: string; name?: string; priority?: number; }`\n - `is_enabled: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `threshold_amount: number`\n Specify the threshold amount for the contract. Each time the contract's usage hits this amount, a threshold charge will be initiated.\n - `discount_configuration?: { payment_fraction: number; }`\n\n- `add_subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated?: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product_id: string; }; custom_fields?: object; description?: string; ending_before?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { initial_seat_ids: string[]; seat_group_key: string; initial_unassigned_seats?: number; }; starting_at?: string; temporary_id?: string; }[]`\n Optional list of [subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/) to add to the contract.\n\n- `allow_contract_ending_before_finalized_invoice?: boolean`\n If true, allows setting the contract end date earlier than the end_timestamp of existing finalized invoices. Finalized invoices will be unchanged; if you want to incorporate the new end date, you can void and regenerate finalized usage invoices. Defaults to true.\n\n- `archive_commits?: { id: string; }[]`\n IDs of commits to archive\n\n- `archive_credits?: { id: string; }[]`\n IDs of credits to archive\n\n- `archive_scheduled_charges?: { id: string; }[]`\n IDs of scheduled charges to archive\n\n- `remove_overrides?: { id: string; }[]`\n IDs of overrides to remove\n\n- `uniqueness_key?: string`\n Optional uniqueness key to prevent duplicate contract edits.\n\n- `update_commits?: { commit_id: string; access_schedule?: { add_schedule_items?: { amount: number; ending_before: string; starting_at: string; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; ending_before?: string; starting_at?: string; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_schedule?: { add_schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; quantity?: number; timestamp?: string; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; rollover_fraction?: number; }[]`\n\n- `update_contract_end_date?: string`\n RFC 3339 timestamp indicating when the contract will end (exclusive).\n\n- `update_contract_name?: string`\n Value to update the contract name to. If not provided, the contract name will remain unchanged.\n\n- `update_credits?: { credit_id: string; access_schedule?: { add_schedule_items?: { amount: number; ending_before: string; starting_at: string; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; ending_before?: string; starting_at?: string; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; rollover_fraction?: number; }[]`\n\n- `update_net_payment_terms_days?: number`\n Number of days after issuance of invoice after which the invoice is due (e.g. Net 30).\n\n- `update_prepaid_balance_threshold_configuration?: { commit?: { description?: string; name?: string; priority?: number; product_id?: string; }; custom_credit_type_id?: string; discount_configuration?: { payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount?: number; threshold_amount?: number; }`\n - `commit?: { description?: string; name?: string; priority?: number; product_id?: string; }`\n - `custom_credit_type_id?: string`\n If provided, the threshold, recharge-to amount, and the resulting threshold commit amount will be in terms of this credit type instead of the fiat currency.\n - `discount_configuration?: { payment_fraction?: number; }`\n - `is_enabled?: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `recharge_to_amount?: number`\n Specify the amount the balance should be recharged to.\n - `threshold_amount?: number`\n Specify the threshold amount for the contract. Each time the contract's balance lowers to this amount, a threshold charge will be initiated.\n\n- `update_recurring_commits?: { recurring_commit_id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; invoice_amount?: { quantity?: number; unit_price?: number; }; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[]`\n Edits to these recurring commits will only affect commits whose access schedules has not started. Expired commits, and commits with an active access schedule will remain unchanged.\n\n- `update_recurring_credits?: { recurring_credit_id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[]`\n Edits to these recurring credits will only affect credits whose access schedules has not started. Expired credits, and credits with an active access schedule will remain unchanged.\n\n- `update_scheduled_charges?: { scheduled_charge_id: string; invoice_schedule?: { add_schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; quantity?: number; timestamp?: string; unit_price?: number; }[]; }; netsuite_sales_order_id?: string; }[]`\n\n- `update_spend_threshold_configuration?: { commit?: { description?: string; name?: string; priority?: number; product_id?: string; }; discount_configuration?: { payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount?: number; }`\n - `commit?: { description?: string; name?: string; priority?: number; product_id?: string; }`\n - `discount_configuration?: { payment_fraction?: number; }`\n - `is_enabled?: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `threshold_amount?: number`\n Specify the threshold amount for the contract. Each time the contract's usage hits this amount, a threshold charge will be initiated.\n\n- `update_subscriptions?: { subscription_id: string; ending_before?: string; quantity_management_mode_update?: { quantity_management_mode: 'SEAT_BASED'; seat_config: { seat_group_key: string; }; }; quantity_updates?: { starting_at: string; quantity?: number; quantity_delta?: number; }[]; seat_updates?: { add_seat_ids?: { seat_ids: string[]; starting_at: string; }[]; add_unassigned_seats?: { quantity: number; starting_at: string; }[]; remove_seat_ids?: { seat_ids: string[]; starting_at: string; }[]; remove_unassigned_seats?: { quantity: number; starting_at: string; }[]; }; }[]`\n Optional list of subscriptions to update.\n\n### Returns\n\n- `{ data: { id: string; }; }`\n\n - `data: { id: string; }`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst response = await client.v2.contracts.edit({ contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc', customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d' });\n\nconsole.log(response);\n```",
+ "## edit\n\n`client.v2.contracts.edit(contract_id: string, customer_id: string, add_billing_provider_configuration_update?: { billing_provider_configuration: { billing_provider?: string; billing_provider_configuration_id?: string; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }; schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }; }, add_commits?: { product_id: string; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: object[]; credit_type_id?: string; }; amount?: number; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: object; invoice_schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; name?: string; netsuite_sales_order_id?: string; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: object[]; spend_tracker_attributes?: { counts_as_discounted: boolean; }; temporary_id?: string; }[], add_credits?: { access_schedule: { schedule_items: object[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: object[]; }[], add_discounts?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[], add_overrides?: { starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: tier[]; }; priority?: number; product_id?: string; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[], add_prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config_v2; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; }, add_professional_services?: { max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[], add_recurring_commits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: object; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { apply_seat_increase_config: object; subscription_id: string; allocation?: 'POOLED' | 'INDIVIDUAL'; }; temporary_id?: string; }[], add_recurring_credits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { apply_seat_increase_config: object; subscription_id: string; allocation?: 'POOLED' | 'INDIVIDUAL'; }; temporary_id?: string; }[], add_reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_options?: { aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; }; ending_before?: string; fraction?: number; gcp_options?: { gcp_account_id?: string; gcp_offer_id?: string; }; netsuite_reseller_id?: string; reseller_contract_value?: number; starting_at?: string; }[], add_revenue_system_configuration_update?: { revenue_system_configuration: { delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; provider?: 'netsuite'; revenue_system_configuration_id?: string; }; schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }; }, add_scheduled_charges?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[], add_spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config_v2; threshold_amount: number; discount_configuration?: object; }, add_spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[], add_subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated?: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product_id: string; }; custom_fields?: object; description?: string; ending_before?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { initial_seat_ids: string[]; seat_group_key: string; initial_unassigned_seats?: number; }; starting_at?: string; temporary_id?: string; }[], allow_contract_ending_before_finalized_invoice?: boolean, archive_commits?: { id: string; }[], archive_credits?: { id: string; }[], archive_scheduled_charges?: { id: string; }[], archive_spend_trackers?: string[], remove_overrides?: { id: string; }[], uniqueness_key?: string, update_commits?: { commit_id: string; access_schedule?: { add_schedule_items?: object[]; remove_schedule_items?: object[]; update_schedule_items?: object[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: object; invoice_schedule?: { add_schedule_items?: object[]; remove_schedule_items?: object[]; update_schedule_items?: object[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; rollover_fraction?: number; }[], update_contract_end_date?: string, update_contract_name?: string, update_credits?: { credit_id: string; access_schedule?: { add_schedule_items?: object[]; remove_schedule_items?: object[]; update_schedule_items?: object[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; rollover_fraction?: number; }[], update_net_payment_terms_days?: number, update_prepaid_balance_threshold_configuration?: { commit?: object; custom_credit_type_id?: string; discount_configuration?: { cap?: object; payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: object; recharge_to_amount?: number; threshold_amount?: number; }, update_recurring_commits?: { recurring_commit_id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; invoice_amount?: { quantity?: number; unit_price?: number; }; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[], update_recurring_credits?: { recurring_credit_id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[], update_scheduled_charges?: { scheduled_charge_id: string; invoice_schedule?: { add_schedule_items?: object[]; remove_schedule_items?: object[]; update_schedule_items?: object[]; }; netsuite_sales_order_id?: string; }[], update_spend_threshold_configuration?: { commit?: object; discount_configuration?: { cap?: object; payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: object; threshold_amount?: number; }, update_subscriptions?: { subscription_id: string; ending_before?: string; quantity_management_mode_update?: { quantity_management_mode: 'SEAT_BASED'; seat_config: object; }; quantity_updates?: { starting_at: string; quantity?: number; quantity_delta?: number; }[]; seat_updates?: { add_seat_ids?: object[]; add_unassigned_seats?: object[]; remove_seat_ids?: object[]; remove_unassigned_seats?: object[]; }; }[]): { data: id; }`\n\n**post** `/v2/contracts/edit`\n\nThe ability to edit a contract helps you react quickly to the needs of your customers and your business.\n\n### Use this endpoint to:\n- Encode mid-term commitment and discount changes\n- Fix configuration mistakes and easily roll back packaging changes\n\n### Key response fields:\n- The `id` of the edit\n- Complete edit details. For example, if you edited the contract to add new overrides and credits, you will receive the IDs of those overrides and credits in the response.\n\n### Usage guidelines:\n- When you edit a contract, any draft invoices update immediately to reflect that edit. Finalized invoices remain unchanged - you must void and regenerate them in the UI or API to reflect the edit.\n- Contract editing must be enabled to use this endpoint. Reach out to your Metronome representative to learn more.\n\n\n### Parameters\n\n- `contract_id: string`\n ID of the contract being edited\n\n- `customer_id: string`\n ID of the customer whose contract is being edited\n\n- `add_billing_provider_configuration_update?: { billing_provider_configuration: { billing_provider?: string; billing_provider_configuration_id?: string; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }; schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }; }`\n Update the billing provider configuration on the contract. Currently only supports adding a billing provider configuration to a contract that does not already have one.\n - `billing_provider_configuration: { billing_provider?: string; billing_provider_configuration_id?: string; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }`\n - `schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }`\n Indicates when the billing provider will be active on the contract. Any charges accrued during the schedule will be billed to the indicated billing provider.\n\n- `add_commits?: { product_id: string; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; amount?: number; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; on_session_payment?: boolean; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; spend_tracker_attributes?: { counts_as_discounted: boolean; }; temporary_id?: string; }[]`\n\n- `add_credits?: { access_schedule: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]`\n\n- `add_discounts?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]`\n\n- `add_overrides?: { starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: { price: number; size?: number; }[]; }; priority?: number; product_id?: string; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]`\n\n- `add_prepaid_balance_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; }`\n - `commit: { product_id: string; description?: string; name?: string; priority?: number; }`\n - `is_enabled: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `recharge_to_amount: number`\n Specify the amount the balance should be recharged to.\n - `threshold_amount: number`\n Specify the threshold amount for the contract. Each time the contract's balance lowers to this amount, a threshold charge will be initiated.\n - `custom_credit_type_id?: string`\n If provided, the threshold, recharge-to amount, and the resulting threshold commit amount will be in terms of this credit type instead of the fiat currency.\n - `discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }`\n\n- `add_professional_services?: { max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[]`\n This field's availability is dependent on your client's configuration.\n\n- `add_recurring_commits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'POOLED' | 'INDIVIDUAL'; }; temporary_id?: string; }[]`\n\n- `add_recurring_credits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'POOLED' | 'INDIVIDUAL'; }; temporary_id?: string; }[]`\n\n- `add_reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_options?: { aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; }; ending_before?: string; fraction?: number; gcp_options?: { gcp_account_id?: string; gcp_offer_id?: string; }; netsuite_reseller_id?: string; reseller_contract_value?: number; starting_at?: string; }[]`\n\n- `add_revenue_system_configuration_update?: { revenue_system_configuration: { delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; provider?: 'netsuite'; revenue_system_configuration_id?: string; }; schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }; }`\n Update the revenue system configuration on the contract. Currently only supports adding a revenue system configuration to a contract that does not already have one.\n - `revenue_system_configuration: { delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; provider?: 'netsuite'; revenue_system_configuration_id?: string; }`\n - `schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }`\n\n- `add_scheduled_charges?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]`\n\n- `add_spend_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount: number; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; }`\n - `commit: { product_id: string; description?: string; name?: string; priority?: number; }`\n - `is_enabled: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `threshold_amount: number`\n Specify the threshold amount for the contract. Each time the contract's usage hits this amount, a threshold charge will be initiated.\n - `discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }`\n\n- `add_spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[]`\n Spend trackers to add to this contract. Aliases must be unique within a contract.\n\n- `add_subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated?: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product_id: string; }; custom_fields?: object; description?: string; ending_before?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { initial_seat_ids: string[]; seat_group_key: string; initial_unassigned_seats?: number; }; starting_at?: string; temporary_id?: string; }[]`\n Optional list of [subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/) to add to the contract.\n\n- `allow_contract_ending_before_finalized_invoice?: boolean`\n If true, allows setting the contract end date earlier than the end_timestamp of existing finalized invoices. Finalized invoices will be unchanged; if you want to incorporate the new end date, you can void and regenerate finalized usage invoices. Defaults to true.\n\n- `archive_commits?: { id: string; }[]`\n IDs of commits to archive\n\n- `archive_credits?: { id: string; }[]`\n IDs of credits to archive\n\n- `archive_scheduled_charges?: { id: string; }[]`\n IDs of scheduled charges to archive\n\n- `archive_spend_trackers?: string[]`\n Aliases of spend trackers to archive.\n\n- `remove_overrides?: { id: string; }[]`\n IDs of overrides to remove\n\n- `uniqueness_key?: string`\n Optional uniqueness key to prevent duplicate contract edits.\n\n- `update_commits?: { commit_id: string; access_schedule?: { add_schedule_items?: { amount: number; ending_before: string; starting_at: string; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; ending_before?: string; starting_at?: string; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_schedule?: { add_schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; quantity?: number; timestamp?: string; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; rollover_fraction?: number; }[]`\n\n- `update_contract_end_date?: string`\n RFC 3339 timestamp indicating when the contract will end (exclusive).\n\n- `update_contract_name?: string`\n Value to update the contract name to. If not provided, the contract name will remain unchanged.\n\n- `update_credits?: { credit_id: string; access_schedule?: { add_schedule_items?: { amount: number; ending_before: string; starting_at: string; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; ending_before?: string; starting_at?: string; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; rollover_fraction?: number; }[]`\n\n- `update_net_payment_terms_days?: number`\n Number of days after issuance of invoice after which the invoice is due (e.g. Net 30).\n\n- `update_prepaid_balance_threshold_configuration?: { commit?: { description?: string; name?: string; priority?: number; product_id?: string; }; custom_credit_type_id?: string; discount_configuration?: { cap?: { amount: number; spend_tracker_alias: string; }; payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount?: number; threshold_amount?: number; }`\n - `commit?: { description?: string; name?: string; priority?: number; product_id?: string; }`\n - `custom_credit_type_id?: string`\n If provided, the threshold, recharge-to amount, and the resulting threshold commit amount will be in terms of this credit type instead of the fiat currency.\n - `discount_configuration?: { cap?: { amount: number; spend_tracker_alias: string; }; payment_fraction?: number; }`\n - `is_enabled?: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `recharge_to_amount?: number`\n Specify the amount the balance should be recharged to.\n - `threshold_amount?: number`\n Specify the threshold amount for the contract. Each time the contract's balance lowers to this amount, a threshold charge will be initiated.\n\n- `update_recurring_commits?: { recurring_commit_id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; invoice_amount?: { quantity?: number; unit_price?: number; }; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[]`\n Edits to these recurring commits will only affect commits whose access schedules has not started. Expired commits, and commits with an active access schedule will remain unchanged.\n\n- `update_recurring_credits?: { recurring_credit_id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[]`\n Edits to these recurring credits will only affect credits whose access schedules has not started. Expired credits, and credits with an active access schedule will remain unchanged.\n\n- `update_scheduled_charges?: { scheduled_charge_id: string; invoice_schedule?: { add_schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; quantity?: number; timestamp?: string; unit_price?: number; }[]; }; netsuite_sales_order_id?: string; }[]`\n\n- `update_spend_threshold_configuration?: { commit?: { description?: string; name?: string; priority?: number; product_id?: string; }; discount_configuration?: { cap?: { amount: number; spend_tracker_alias: string; }; payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount?: number; }`\n - `commit?: { description?: string; name?: string; priority?: number; product_id?: string; }`\n - `discount_configuration?: { cap?: { amount: number; spend_tracker_alias: string; }; payment_fraction?: number; }`\n - `is_enabled?: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `threshold_amount?: number`\n Specify the threshold amount for the contract. Each time the contract's usage hits this amount, a threshold charge will be initiated.\n\n- `update_subscriptions?: { subscription_id: string; ending_before?: string; quantity_management_mode_update?: { quantity_management_mode: 'SEAT_BASED'; seat_config: { seat_group_key: string; }; }; quantity_updates?: { starting_at: string; quantity?: number; quantity_delta?: number; }[]; seat_updates?: { add_seat_ids?: { seat_ids: string[]; starting_at: string; }[]; add_unassigned_seats?: { quantity: number; starting_at: string; }[]; remove_seat_ids?: { seat_ids: string[]; starting_at: string; }[]; remove_unassigned_seats?: { quantity: number; starting_at: string; }[]; }; }[]`\n Optional list of subscriptions to update.\n\n### Returns\n\n- `{ data: { id: string; }; }`\n\n - `data: { id: string; }`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst response = await client.v2.contracts.edit({ contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc', customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d' });\n\nconsole.log(response);\n```",
perLanguage: {
typescript: {
method: 'client.v2.contracts.edit',
@@ -247,7 +249,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
response:
'{ data: { id: string; add_commits?: object[]; add_credits?: object[]; add_discounts?: discount[]; add_overrides?: object[]; add_prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration_v2; add_pro_services?: pro_service[]; add_recurring_commits?: object[]; add_recurring_credits?: object[]; add_reseller_royalties?: object[]; add_scheduled_charges?: object[]; add_spend_threshold_configuration?: spend_threshold_configuration_v2; add_subscriptions?: object[]; add_usage_filters?: object[]; archive_commits?: object[]; archive_credits?: object[]; archive_scheduled_charges?: object[]; remove_overrides?: object[]; timestamp?: string; uniqueness_key?: string; update_commits?: object[]; update_contract_end_date?: string; update_contract_name?: string; update_credits?: object[]; update_discounts?: object[]; update_prepaid_balance_threshold_configuration?: object; update_recurring_commits?: object[]; update_recurring_credits?: object[]; update_refund_invoices?: object[]; update_scheduled_charges?: object[]; update_spend_threshold_configuration?: object; update_subscriptions?: object[]; }[]; }',
markdown:
- "## get_edit_history\n\n`client.v2.contracts.getEditHistory(contract_id: string, customer_id: string): { data: object[]; }`\n\n**post** `/v2/contracts/getEditHistory`\n\nList all the edits made to a contract over time. In Metronome, you can edit a contract at any point after it's created to fix mistakes or reflect changes in terms. Metronome stores a full history of all edits that were ever made to a contract, whether through the UI, `editContract` endpoint, or other endpoints like `updateContractEndDate`. \n\n### Use this endpoint to: \n- Understand what changes were made to a contract, when, and by who\n\n### Key response fields: \n- An array of every edit ever made to the contract\n- Details on each individual edit - for example showing that in one edit, a user added two discounts and incremented a subscription quantity.\n\n\n### Parameters\n\n- `contract_id: string`\n\n- `customer_id: string`\n\n### Returns\n\n- `{ data: { id: string; add_commits?: { id: string; product: object; type: 'PREPAID' | 'POSTPAID'; access_schedule?: schedule_duration; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: commit_hierarchy_configuration; invoice_schedule?: object; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; salesforce_opportunity_id?: string; specifiers?: commit_specifier_input[]; }[]; add_credits?: { id: string; product: object; type: 'CREDIT'; access_schedule?: schedule_duration; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: commit_hierarchy_configuration; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; salesforce_opportunity_id?: string; specifiers?: commit_specifier_input[]; }[]; add_discounts?: object[]; add_overrides?: { id: string; created_at: string; starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: object[]; override_tiers?: override_tier[]; overwrite_rate?: object; priority?: number; product?: object; target?: 'COMMIT_RATE' | 'LIST_RATE'; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]; add_prepaid_balance_threshold_configuration?: object; add_pro_services?: object[]; add_recurring_commits?: { id: string; access_amount: object; commit_duration: object; priority: number; product: object; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; contract?: object; description?: string; ending_before?: string; hierarchy_configuration?: commit_hierarchy_configuration; invoice_amount?: object; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: commit_specifier[]; subscription_config?: recurring_commit_subscription_config; }[]; add_recurring_credits?: { id: string; access_amount: object; commit_duration: object; priority: number; product: object; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; contract?: object; description?: string; ending_before?: string; hierarchy_configuration?: commit_hierarchy_configuration; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: commit_specifier[]; subscription_config?: recurring_commit_subscription_config; }[]; add_reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; ending_before?: string; fraction?: number; gcp_account_id?: string; gcp_offer_id?: string; netsuite_reseller_id?: string; reseller_contract_value?: number; starting_at?: string; }[]; add_scheduled_charges?: { id: string; product: object; schedule: schedule_point_in_time; name?: string; netsuite_sales_order_id?: string; }[]; add_spend_threshold_configuration?: object; add_subscriptions?: { billing_periods: object; collection_schedule: 'ADVANCE' | 'ARREARS'; proration: object; quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY'; quantity_schedule: object[]; starting_at: string; subscription_rate: object; id?: string; custom_fields?: object; description?: string; ending_before?: string; fiat_credit_type_id?: string; name?: string; seat_config?: object; }[]; add_usage_filters?: { group_key: string; group_values: string[]; starting_at: string; ending_before?: string; }[]; archive_commits?: { id: string; }[]; archive_credits?: { id: string; }[]; archive_scheduled_charges?: { id: string; }[]; remove_overrides?: { id: string; }[]; timestamp?: string; uniqueness_key?: string; update_commits?: { id: string; access_schedule?: object; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: commit_hierarchy_configuration; invoice_schedule?: object; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: commit_specifier_input[]; }[]; update_contract_end_date?: string; update_contract_name?: string; update_credits?: { id: string; access_schedule?: object; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: commit_hierarchy_configuration; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; rollover_fraction?: number; specifiers?: commit_specifier_input[]; }[]; update_discounts?: { id: string; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; schedule?: object; }[]; update_prepaid_balance_threshold_configuration?: { commit?: update_base_threshold_commit; custom_credit_type_id?: string; discount_configuration?: object; is_enabled?: boolean; payment_gate_config?: payment_gate_config_v2; recharge_to_amount?: number; threshold_amount?: number; }; update_recurring_commits?: { id: string; access_amount?: object; ending_before?: string; invoice_amount?: object; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[]; update_recurring_credits?: { id: string; access_amount?: object; ending_before?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[]; update_refund_invoices?: { date: string; invoice_id: string; }[]; update_scheduled_charges?: { id: string; invoice_schedule?: object; name?: string; netsuite_sales_order_id?: string; }[]; update_spend_threshold_configuration?: { commit?: update_base_threshold_commit; discount_configuration?: object; is_enabled?: boolean; payment_gate_config?: payment_gate_config_v2; threshold_amount?: number; }; update_subscriptions?: { id: string; ending_before?: string; quantity_updates?: object[]; seat_updates?: object; }[]; }[]; }`\n\n - `data: { id: string; add_commits?: { id: string; product: { id: string; name: string; }; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: object[]; credit_type?: credit_type_data; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: { child_access: object | object | object; }; invoice_schedule?: { credit_type?: object; do_not_invoice?: boolean; schedule_items?: { id: string; timestamp: string; amount?: number; invoice_id?: string; quantity?: number; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; salesforce_opportunity_id?: string; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]; add_credits?: { id: string; product: { id: string; name: string; }; type: 'CREDIT'; access_schedule?: { schedule_items: object[]; credit_type?: credit_type_data; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: { child_access: object | object | object; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; salesforce_opportunity_id?: string; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]; add_discounts?: { id: string; product: { id: string; name: string; }; schedule: object; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]; add_overrides?: { id: string; created_at: string; starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; override_tiers?: { multiplier: number; size?: number; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type?: object; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: object[]; }; priority?: number; product?: { id: string; name: string; }; target?: 'COMMIT_RATE' | 'LIST_RATE'; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]; add_prepaid_balance_threshold_configuration?: { commit: object; is_enabled: boolean; payment_gate_config: object; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; }; }; add_pro_services?: { id: string; max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[]; add_recurring_commits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; contract?: { id: string; }; description?: string; ending_before?: string; hierarchy_configuration?: { child_access: object | object | object; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { allocation: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config: object; subscription_id: string; }; }[]; add_recurring_credits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; contract?: { id: string; }; description?: string; ending_before?: string; hierarchy_configuration?: { child_access: object | object | object; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { allocation: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config: object; subscription_id: string; }; }[]; add_reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; ending_before?: string; fraction?: number; gcp_account_id?: string; gcp_offer_id?: string; netsuite_reseller_id?: string; reseller_contract_value?: number; starting_at?: string; }[]; add_scheduled_charges?: { id: string; product: { id: string; name: string; }; schedule: { credit_type?: credit_type_data; do_not_invoice?: boolean; schedule_items?: object[]; }; name?: string; netsuite_sales_order_id?: string; }[]; add_spend_threshold_configuration?: { commit: object; is_enabled: boolean; payment_gate_config: object; threshold_amount: number; discount_configuration?: { payment_fraction: number; }; }; add_subscriptions?: { billing_periods: { current?: { ending_before: string; starting_at: string; }; next?: { ending_before: string; starting_at: string; }; previous?: { ending_before: string; starting_at: string; }; }; collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated: boolean; }; quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY'; quantity_schedule: { quantity: number; starting_at: string; ending_before?: string; }[]; starting_at: string; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product: { id: string; name: string; }; }; id?: string; custom_fields?: object; description?: string; ending_before?: string; fiat_credit_type_id?: string; name?: string; seat_config?: { seat_group_key: string; }; }[]; add_usage_filters?: { group_key: string; group_values: string[]; starting_at: string; ending_before?: string; }[]; archive_commits?: { id: string; }[]; archive_credits?: { id: string; }[]; archive_scheduled_charges?: { id: string; }[]; remove_overrides?: { id: string; }[]; timestamp?: string; uniqueness_key?: string; update_commits?: { id: string; access_schedule?: { add_schedule_items?: { amount: number; ending_before: string; starting_at: string; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; ending_before?: string; starting_at?: string; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: { child_access: object | object | object; }; invoice_schedule?: { add_schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; quantity?: number; timestamp?: string; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]; update_contract_end_date?: string; update_contract_name?: string; update_credits?: { id: string; access_schedule?: { add_schedule_items?: { amount: number; ending_before: string; starting_at: string; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; ending_before?: string; starting_at?: string; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: { child_access: object | object | object; }; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]; update_discounts?: { id: string; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; }[]; update_prepaid_balance_threshold_configuration?: { commit?: { description?: string; name?: string; priority?: number; product_id?: string; }; custom_credit_type_id?: string; discount_configuration?: { payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount?: number; threshold_amount?: number; }; update_recurring_commits?: { id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; invoice_amount?: { quantity?: number; unit_price?: number; }; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[]; update_recurring_credits?: { id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[]; update_refund_invoices?: { date: string; invoice_id: string; }[]; update_scheduled_charges?: { id: string; invoice_schedule?: { add_schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; quantity?: number; timestamp?: string; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; }[]; update_spend_threshold_configuration?: { commit?: { description?: string; name?: string; priority?: number; product_id?: string; }; discount_configuration?: { payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount?: number; }; update_subscriptions?: { id: string; ending_before?: string; quantity_updates?: { starting_at: string; quantity?: number; quantity_delta?: number; }[]; seat_updates?: { add_seat_ids?: { seat_ids: string[]; starting_at: string; }[]; add_unassigned_seats?: { quantity: number; starting_at: string; }[]; remove_seat_ids?: { seat_ids: string[]; starting_at: string; }[]; remove_unassigned_seats?: { quantity: number; starting_at: string; }[]; }; }[]; }[]`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst response = await client.v2.contracts.getEditHistory({ contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc', customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d' });\n\nconsole.log(response);\n```",
+ "## get_edit_history\n\n`client.v2.contracts.getEditHistory(contract_id: string, customer_id: string): { data: object[]; }`\n\n**post** `/v2/contracts/getEditHistory`\n\nList all the edits made to a contract over time. In Metronome, you can edit a contract at any point after it's created to fix mistakes or reflect changes in terms. Metronome stores a full history of all edits that were ever made to a contract, whether through the UI, `editContract` endpoint, or other endpoints like `updateContractEndDate`. \n\n### Use this endpoint to: \n- Understand what changes were made to a contract, when, and by who\n\n### Key response fields: \n- An array of every edit ever made to the contract\n- Details on each individual edit - for example showing that in one edit, a user added two discounts and incremented a subscription quantity.\n\n\n### Parameters\n\n- `contract_id: string`\n\n- `customer_id: string`\n\n### Returns\n\n- `{ data: { id: string; add_commits?: { id: string; product: object; type: 'PREPAID' | 'POSTPAID'; access_schedule?: schedule_duration; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: commit_hierarchy_configuration; invoice_schedule?: object; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; salesforce_opportunity_id?: string; specifiers?: commit_specifier_input[]; }[]; add_credits?: { id: string; product: object; type: 'CREDIT'; access_schedule?: schedule_duration; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: commit_hierarchy_configuration; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; salesforce_opportunity_id?: string; specifiers?: commit_specifier_input[]; }[]; add_discounts?: object[]; add_overrides?: { id: string; created_at: string; starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: object[]; override_tiers?: override_tier[]; overwrite_rate?: object; priority?: number; product?: object; target?: 'COMMIT_RATE' | 'LIST_RATE'; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]; add_prepaid_balance_threshold_configuration?: object; add_pro_services?: object[]; add_recurring_commits?: { id: string; access_amount: object; commit_duration: object; priority: number; product: object; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; contract?: object; description?: string; ending_before?: string; hierarchy_configuration?: commit_hierarchy_configuration; invoice_amount?: object; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: commit_specifier[]; subscription_config?: recurring_commit_subscription_config; }[]; add_recurring_credits?: { id: string; access_amount: object; commit_duration: object; priority: number; product: object; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; contract?: object; description?: string; ending_before?: string; hierarchy_configuration?: commit_hierarchy_configuration; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: commit_specifier[]; subscription_config?: recurring_commit_subscription_config; }[]; add_reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; ending_before?: string; fraction?: number; gcp_account_id?: string; gcp_offer_id?: string; netsuite_reseller_id?: string; reseller_contract_value?: number; starting_at?: string; }[]; add_scheduled_charges?: { id: string; product: object; schedule: schedule_point_in_time; name?: string; netsuite_sales_order_id?: string; }[]; add_spend_threshold_configuration?: object; add_subscriptions?: { billing_periods: object; collection_schedule: 'ADVANCE' | 'ARREARS'; proration: object; quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY'; quantity_schedule: object[]; starting_at: string; subscription_rate: object; id?: string; custom_fields?: object; description?: string; ending_before?: string; fiat_credit_type_id?: string; name?: string; seat_config?: object; }[]; add_usage_filters?: { group_key: string; group_values: string[]; starting_at: string; ending_before?: string; }[]; archive_commits?: { id: string; }[]; archive_credits?: { id: string; }[]; archive_scheduled_charges?: { id: string; }[]; remove_overrides?: { id: string; }[]; timestamp?: string; uniqueness_key?: string; update_commits?: { id: string; access_schedule?: object; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: commit_hierarchy_configuration; invoice_schedule?: object; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: commit_specifier_input[]; }[]; update_contract_end_date?: string; update_contract_name?: string; update_credits?: { id: string; access_schedule?: object; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: commit_hierarchy_configuration; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; rollover_fraction?: number; specifiers?: commit_specifier_input[]; }[]; update_discounts?: { id: string; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; schedule?: object; }[]; update_prepaid_balance_threshold_configuration?: { commit?: update_base_threshold_commit; custom_credit_type_id?: string; discount_configuration?: object; is_enabled?: boolean; payment_gate_config?: payment_gate_config_v2; recharge_to_amount?: number; threshold_amount?: number; }; update_recurring_commits?: { id: string; access_amount?: object; ending_before?: string; invoice_amount?: object; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[]; update_recurring_credits?: { id: string; access_amount?: object; ending_before?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[]; update_refund_invoices?: { date: string; invoice_id: string; }[]; update_scheduled_charges?: { id: string; invoice_schedule?: object; name?: string; netsuite_sales_order_id?: string; }[]; update_spend_threshold_configuration?: { commit?: update_base_threshold_commit; discount_configuration?: object; is_enabled?: boolean; payment_gate_config?: payment_gate_config_v2; threshold_amount?: number; }; update_subscriptions?: { id: string; ending_before?: string; quantity_updates?: object[]; seat_updates?: object; }[]; }[]; }`\n\n - `data: { id: string; add_commits?: { id: string; product: { id: string; name: string; }; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: object[]; credit_type?: credit_type_data; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: { child_access: object | object | object; }; invoice_schedule?: { credit_type?: object; do_not_invoice?: boolean; schedule_items?: { id: string; timestamp: string; amount?: number; invoice_id?: string; quantity?: number; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; salesforce_opportunity_id?: string; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]; add_credits?: { id: string; product: { id: string; name: string; }; type: 'CREDIT'; access_schedule?: { schedule_items: object[]; credit_type?: credit_type_data; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: { child_access: object | object | object; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; salesforce_opportunity_id?: string; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]; add_discounts?: { id: string; product: { id: string; name: string; }; schedule: object; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]; add_overrides?: { id: string; created_at: string; starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; override_tiers?: { multiplier: number; size?: number; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type?: object; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: object[]; }; priority?: number; product?: { id: string; name: string; }; target?: 'COMMIT_RATE' | 'LIST_RATE'; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]; add_prepaid_balance_threshold_configuration?: { commit: object; is_enabled: boolean; payment_gate_config: object; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; cap?: object; }; }; add_pro_services?: { id: string; max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[]; add_recurring_commits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; contract?: { id: string; }; description?: string; ending_before?: string; hierarchy_configuration?: { child_access: object | object | object; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { allocation: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config: object; subscription_id: string; }; }[]; add_recurring_credits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; contract?: { id: string; }; description?: string; ending_before?: string; hierarchy_configuration?: { child_access: object | object | object; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { allocation: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config: object; subscription_id: string; }; }[]; add_reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; ending_before?: string; fraction?: number; gcp_account_id?: string; gcp_offer_id?: string; netsuite_reseller_id?: string; reseller_contract_value?: number; starting_at?: string; }[]; add_scheduled_charges?: { id: string; product: { id: string; name: string; }; schedule: { credit_type?: credit_type_data; do_not_invoice?: boolean; schedule_items?: object[]; }; name?: string; netsuite_sales_order_id?: string; }[]; add_spend_threshold_configuration?: { commit: object; is_enabled: boolean; payment_gate_config: object; threshold_amount: number; discount_configuration?: { payment_fraction: number; cap?: object; }; }; add_subscriptions?: { billing_periods: { current?: { ending_before: string; starting_at: string; }; next?: { ending_before: string; starting_at: string; }; previous?: { ending_before: string; starting_at: string; }; }; collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated: boolean; }; quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY'; quantity_schedule: { quantity: number; starting_at: string; ending_before?: string; }[]; starting_at: string; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product: { id: string; name: string; }; }; id?: string; custom_fields?: object; description?: string; ending_before?: string; fiat_credit_type_id?: string; name?: string; seat_config?: { seat_group_key: string; }; }[]; add_usage_filters?: { group_key: string; group_values: string[]; starting_at: string; ending_before?: string; }[]; archive_commits?: { id: string; }[]; archive_credits?: { id: string; }[]; archive_scheduled_charges?: { id: string; }[]; remove_overrides?: { id: string; }[]; timestamp?: string; uniqueness_key?: string; update_commits?: { id: string; access_schedule?: { add_schedule_items?: { amount: number; ending_before: string; starting_at: string; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; ending_before?: string; starting_at?: string; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: { child_access: object | object | object; }; invoice_schedule?: { add_schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; quantity?: number; timestamp?: string; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]; update_contract_end_date?: string; update_contract_name?: string; update_credits?: { id: string; access_schedule?: { add_schedule_items?: { amount: number; ending_before: string; starting_at: string; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; ending_before?: string; starting_at?: string; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: { child_access: object | object | object; }; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]; update_discounts?: { id: string; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; }[]; update_prepaid_balance_threshold_configuration?: { commit?: { description?: string; name?: string; priority?: number; product_id?: string; }; custom_credit_type_id?: string; discount_configuration?: { cap?: { amount: number; spend_tracker_alias: string; }; payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount?: number; threshold_amount?: number; }; update_recurring_commits?: { id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; invoice_amount?: { quantity?: number; unit_price?: number; }; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[]; update_recurring_credits?: { id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[]; update_refund_invoices?: { date: string; invoice_id: string; }[]; update_scheduled_charges?: { id: string; invoice_schedule?: { add_schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; quantity?: number; timestamp?: string; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; }[]; update_spend_threshold_configuration?: { commit?: { description?: string; name?: string; priority?: number; product_id?: string; }; discount_configuration?: { cap?: { amount: number; spend_tracker_alias: string; }; payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount?: number; }; update_subscriptions?: { id: string; ending_before?: string; quantity_updates?: { starting_at: string; quantity?: number; quantity_delta?: number; }[]; seat_updates?: { add_seat_ids?: { seat_ids: string[]; starting_at: string; }[]; add_unassigned_seats?: { quantity: number; starting_at: string; }[]; remove_seat_ids?: { seat_ids: string[]; starting_at: string; }[]; remove_unassigned_seats?: { quantity: number; starting_at: string; }[]; }; }[]; }[]`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst response = await client.v2.contracts.getEditHistory({ contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc', customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d' });\n\nconsole.log(response);\n```",
perLanguage: {
typescript: {
method: 'client.v2.contracts.getEditHistory',
@@ -2390,9 +2392,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [
'starting_at?: string;',
],
response:
- "{ id: string; created_at: string; product: object; type: 'PREPAID' | 'POSTPAID'; access_schedule?: schedule_duration; amount?: number; applicable_contract_ids?: string[]; applicable_product_ids?: string[]; applicable_product_tags?: string[]; archived_at?: string; balance?: number; contract?: object; custom_fields?: object; description?: string; hierarchy_configuration?: commit_hierarchy_configuration; invoice_contract?: object; invoice_schedule?: schedule_point_in_time; ledger?: object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurring_commit_id?: string; rolled_over_from?: object; rollover_fraction?: number; salesforce_opportunity_id?: string; specifiers?: commit_specifier[]; subscription_config?: object; uniqueness_key?: string; }",
+ "{ id: string; created_at: string; product: object; type: 'PREPAID' | 'POSTPAID'; access_schedule?: schedule_duration; amount?: number; applicable_contract_ids?: string[]; applicable_product_ids?: string[]; applicable_product_tags?: string[]; archived_at?: string; balance?: number; contract?: object; custom_fields?: object; description?: string; hierarchy_configuration?: commit_hierarchy_configuration; invoice_contract?: object; invoice_schedule?: schedule_point_in_time; ledger?: object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurring_commit_id?: string; rolled_over_from?: object; rollover_fraction?: number; salesforce_opportunity_id?: string; specifiers?: commit_specifier[]; spend_tracker_attributes?: object; subscription_config?: object; uniqueness_key?: string; }",
markdown:
- "## list\n\n`client.v1.customers.commits.list(customer_id: string, commit_id?: string, covering_date?: string, effective_before?: string, include_archived?: boolean, include_balance?: boolean, include_contract_commits?: boolean, include_ledgers?: boolean, limit?: number, next_page?: string, starting_at?: string): { id: string; created_at: string; product: object; type: 'PREPAID' | 'POSTPAID'; access_schedule?: schedule_duration; amount?: number; applicable_contract_ids?: string[]; applicable_product_ids?: string[]; applicable_product_tags?: string[]; archived_at?: string; balance?: number; contract?: object; custom_fields?: object; description?: string; hierarchy_configuration?: commit_hierarchy_configuration; invoice_contract?: object; invoice_schedule?: schedule_point_in_time; ledger?: object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurring_commit_id?: string; rolled_over_from?: object; rollover_fraction?: number; salesforce_opportunity_id?: string; specifiers?: commit_specifier[]; subscription_config?: object; uniqueness_key?: string; }`\n\n**post** `/v1/contracts/customerCommits/list`\n\nRetrieve all commit agreements for a customer, including both prepaid and postpaid commitments. This endpoint provides comprehensive visibility into contractual spending obligations, enabling you to track commitment utilization and manage customer contracts effectively.\n\n### Use this endpoint to:\n- Display commitment balances and utilization in customer dashboards\n- Track prepaid commitment drawdown and remaining balances\n- Monitor postpaid commitment progress toward minimum thresholds\n- Build commitment tracking and forecasting tools\n- Show commitment history with optional ledger details\n- Manage rollover balances between contract periods\n\n### Key response fields:\nAn array of Commit objects containing:\n- Commit type: PREPAID (pay upfront) or POSTPAID (pay at true-up)\n- Rate type: COMMIT_RATE (discounted) or LIST_RATE (standard pricing)\n- Access schedule: When commitment funds become available\n- Invoice schedule: When the customer is billed\n- Product targeting: Which product(s) usage is eligible to draw from this commit\n- Optional ledger entries: Transaction history (if `include_ledgers=true`)\n- Balance information: Current available amount (if `include_balance=true`)\n- Rollover settings: Fraction of unused amount that carries forward\n\n### Usage guidelines:\n- Pagination: Results limited to 25 commits per page; use 'next_page' for more\n- Date filtering options:\n - `covering_date`: Commits active on a specific date\n - `starting_at`: Commits with access on/after a date\n - `effective_before`: Commits with access before a date (exclusive)\n- Scope options:\n - `include_contract_commits`: Include contract-level commits (not just customer-level)\n - `include_archived`: Include archived commits and commits from archived contracts\n- Performance considerations:\n - include_ledgers: Adds detailed transaction history (slower)\n - include_balance: Adds current balance calculation (slower)\n- Optional filtering: Use commit_id to retrieve a specific commit\n\n\n### Parameters\n\n- `customer_id: string`\n\n- `commit_id?: string`\n\n- `covering_date?: string`\n Include only commits that have access schedules that \"cover\" the provided date\n\n- `effective_before?: string`\n Include only commits that have any access before the provided date (exclusive)\n\n- `include_archived?: boolean`\n Include archived commits and commits from archived contracts.\n\n- `include_balance?: boolean`\n Include the balance in the response. Setting this flag may cause the query to be slower.\n\n- `include_contract_commits?: boolean`\n Include commits on the contract level.\n\n- `include_ledgers?: boolean`\n Include commit ledgers in the response. Setting this flag may cause the query to be slower.\n\n- `limit?: number`\n The maximum number of commits to return. Defaults to 25.\n\n- `next_page?: string`\n The next page token from a previous response.\n\n- `starting_at?: string`\n Include only commits that have any access on or after the provided date\n\n### Returns\n\n- `{ id: string; created_at: string; product: { id: string; name: string; }; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: object[]; credit_type?: credit_type_data; }; amount?: number; applicable_contract_ids?: string[]; applicable_product_ids?: string[]; applicable_product_tags?: string[]; archived_at?: string; balance?: number; contract?: { id: string; }; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: object | object | object; }; invoice_contract?: { id: string; }; invoice_schedule?: { credit_type?: credit_type_data; do_not_invoice?: boolean; schedule_items?: object[]; }; ledger?: { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_SEGMENT_START'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_ROLLOVER'; } | { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_EXPIRATION'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_CANCELED'; contract_id?: string; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_CREDITED'; contract_id?: string; } | { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT'; } | { amount: number; timestamp: string; type: 'POSTPAID_COMMIT_INITIAL_BALANCE'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'POSTPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'POSTPAID_COMMIT_ROLLOVER'; } | { amount: number; invoice_id: string; timestamp: string; type: 'POSTPAID_COMMIT_TRUEUP'; contract_id?: string; } | { amount: number; reason: string; timestamp: string; type: 'PREPAID_COMMIT_MANUAL'; } | { amount: number; reason: string; timestamp: string; type: 'POSTPAID_COMMIT_MANUAL'; } | { amount: number; timestamp: string; type: 'POSTPAID_COMMIT_EXPIRATION'; }[]; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurring_commit_id?: string; rolled_over_from?: { commit_id: string; contract_id: string; }; rollover_fraction?: number; salesforce_opportunity_id?: string; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { allocation?: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config?: { is_prorated: boolean; }; subscription_id?: string; }; uniqueness_key?: string; }`\n\n - `id: string`\n - `created_at: string`\n - `product: { id: string; name: string; }`\n - `type: 'PREPAID' | 'POSTPAID'`\n - `access_schedule?: { schedule_items: { id: string; amount: number; ending_before: string; starting_at: string; }[]; credit_type?: { id: string; name: string; }; }`\n - `amount?: number`\n - `applicable_contract_ids?: string[]`\n - `applicable_product_ids?: string[]`\n - `applicable_product_tags?: string[]`\n - `archived_at?: string`\n - `balance?: number`\n - `contract?: { id: string; }`\n - `custom_fields?: object`\n - `description?: string`\n - `hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }`\n - `invoice_contract?: { id: string; }`\n - `invoice_schedule?: { credit_type?: { id: string; name: string; }; do_not_invoice?: boolean; schedule_items?: { id: string; amount: number; quantity: number; timestamp: string; unit_price: number; invoice_id?: string; }[]; }`\n - `ledger?: { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_SEGMENT_START'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_ROLLOVER'; } | { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_EXPIRATION'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_CANCELED'; contract_id?: string; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_CREDITED'; contract_id?: string; } | { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT'; } | { amount: number; timestamp: string; type: 'POSTPAID_COMMIT_INITIAL_BALANCE'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'POSTPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'POSTPAID_COMMIT_ROLLOVER'; } | { amount: number; invoice_id: string; timestamp: string; type: 'POSTPAID_COMMIT_TRUEUP'; contract_id?: string; } | { amount: number; reason: string; timestamp: string; type: 'PREPAID_COMMIT_MANUAL'; } | { amount: number; reason: string; timestamp: string; type: 'POSTPAID_COMMIT_MANUAL'; } | { amount: number; timestamp: string; type: 'POSTPAID_COMMIT_EXPIRATION'; }[]`\n - `name?: string`\n - `netsuite_sales_order_id?: string`\n - `priority?: number`\n - `rate_type?: 'COMMIT_RATE' | 'LIST_RATE'`\n - `recurring_commit_id?: string`\n - `rolled_over_from?: { commit_id: string; contract_id: string; }`\n - `rollover_fraction?: number`\n - `salesforce_opportunity_id?: string`\n - `specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]`\n - `subscription_config?: { allocation?: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config?: { is_prorated: boolean; }; subscription_id?: string; }`\n - `uniqueness_key?: string`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\n// Automatically fetches more pages as needed.\nfor await (const commit of client.v1.customers.commits.list({ customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d' })) {\n console.log(commit);\n}\n```",
+ "## list\n\n`client.v1.customers.commits.list(customer_id: string, commit_id?: string, covering_date?: string, effective_before?: string, include_archived?: boolean, include_balance?: boolean, include_contract_commits?: boolean, include_ledgers?: boolean, limit?: number, next_page?: string, starting_at?: string): { id: string; created_at: string; product: object; type: 'PREPAID' | 'POSTPAID'; access_schedule?: schedule_duration; amount?: number; applicable_contract_ids?: string[]; applicable_product_ids?: string[]; applicable_product_tags?: string[]; archived_at?: string; balance?: number; contract?: object; custom_fields?: object; description?: string; hierarchy_configuration?: commit_hierarchy_configuration; invoice_contract?: object; invoice_schedule?: schedule_point_in_time; ledger?: object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurring_commit_id?: string; rolled_over_from?: object; rollover_fraction?: number; salesforce_opportunity_id?: string; specifiers?: commit_specifier[]; spend_tracker_attributes?: object; subscription_config?: object; uniqueness_key?: string; }`\n\n**post** `/v1/contracts/customerCommits/list`\n\nRetrieve all commit agreements for a customer, including both prepaid and postpaid commitments. This endpoint provides comprehensive visibility into contractual spending obligations, enabling you to track commitment utilization and manage customer contracts effectively.\n\n### Use this endpoint to:\n- Display commitment balances and utilization in customer dashboards\n- Track prepaid commitment drawdown and remaining balances\n- Monitor postpaid commitment progress toward minimum thresholds\n- Build commitment tracking and forecasting tools\n- Show commitment history with optional ledger details\n- Manage rollover balances between contract periods\n\n### Key response fields:\nAn array of Commit objects containing:\n- Commit type: PREPAID (pay upfront) or POSTPAID (pay at true-up)\n- Rate type: COMMIT_RATE (discounted) or LIST_RATE (standard pricing)\n- Access schedule: When commitment funds become available\n- Invoice schedule: When the customer is billed\n- Product targeting: Which product(s) usage is eligible to draw from this commit\n- Optional ledger entries: Transaction history (if `include_ledgers=true`)\n- Balance information: Current available amount (if `include_balance=true`)\n- Rollover settings: Fraction of unused amount that carries forward\n\n### Usage guidelines:\n- Pagination: Results limited to 25 commits per page; use 'next_page' for more\n- Date filtering options:\n - `covering_date`: Commits active on a specific date\n - `starting_at`: Commits with access on/after a date\n - `effective_before`: Commits with access before a date (exclusive)\n- Scope options:\n - `include_contract_commits`: Include contract-level commits (not just customer-level)\n - `include_archived`: Include archived commits and commits from archived contracts\n- Performance considerations:\n - include_ledgers: Adds detailed transaction history (slower)\n - include_balance: Adds current balance calculation (slower)\n- Optional filtering: Use commit_id to retrieve a specific commit\n\n\n### Parameters\n\n- `customer_id: string`\n\n- `commit_id?: string`\n\n- `covering_date?: string`\n Include only commits that have access schedules that \"cover\" the provided date\n\n- `effective_before?: string`\n Include only commits that have any access before the provided date (exclusive)\n\n- `include_archived?: boolean`\n Include archived commits and commits from archived contracts.\n\n- `include_balance?: boolean`\n Include the balance in the response. Setting this flag may cause the query to be slower.\n\n- `include_contract_commits?: boolean`\n Include commits on the contract level.\n\n- `include_ledgers?: boolean`\n Include commit ledgers in the response. Setting this flag may cause the query to be slower.\n\n- `limit?: number`\n The maximum number of commits to return. Defaults to 25.\n\n- `next_page?: string`\n The next page token from a previous response.\n\n- `starting_at?: string`\n Include only commits that have any access on or after the provided date\n\n### Returns\n\n- `{ id: string; created_at: string; product: { id: string; name: string; }; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: object[]; credit_type?: credit_type_data; }; amount?: number; applicable_contract_ids?: string[]; applicable_product_ids?: string[]; applicable_product_tags?: string[]; archived_at?: string; balance?: number; contract?: { id: string; }; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: object | object | object; }; invoice_contract?: { id: string; }; invoice_schedule?: { credit_type?: credit_type_data; do_not_invoice?: boolean; schedule_items?: object[]; }; ledger?: { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_SEGMENT_START'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_ROLLOVER'; } | { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_EXPIRATION'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_CANCELED'; contract_id?: string; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_CREDITED'; contract_id?: string; } | { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT'; } | { amount: number; timestamp: string; type: 'POSTPAID_COMMIT_INITIAL_BALANCE'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'POSTPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'POSTPAID_COMMIT_ROLLOVER'; } | { amount: number; invoice_id: string; timestamp: string; type: 'POSTPAID_COMMIT_TRUEUP'; contract_id?: string; } | { amount: number; reason: string; timestamp: string; type: 'PREPAID_COMMIT_MANUAL'; } | { amount: number; reason: string; timestamp: string; type: 'POSTPAID_COMMIT_MANUAL'; } | { amount: number; timestamp: string; type: 'POSTPAID_COMMIT_EXPIRATION'; }[]; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurring_commit_id?: string; rolled_over_from?: { commit_id: string; contract_id: string; }; rollover_fraction?: number; salesforce_opportunity_id?: string; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; spend_tracker_attributes?: { counts_as_discounted: boolean; }; subscription_config?: { allocation?: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config?: { is_prorated: boolean; }; subscription_id?: string; }; uniqueness_key?: string; }`\n\n - `id: string`\n - `created_at: string`\n - `product: { id: string; name: string; }`\n - `type: 'PREPAID' | 'POSTPAID'`\n - `access_schedule?: { schedule_items: { id: string; amount: number; ending_before: string; starting_at: string; }[]; credit_type?: { id: string; name: string; }; }`\n - `amount?: number`\n - `applicable_contract_ids?: string[]`\n - `applicable_product_ids?: string[]`\n - `applicable_product_tags?: string[]`\n - `archived_at?: string`\n - `balance?: number`\n - `contract?: { id: string; }`\n - `custom_fields?: object`\n - `description?: string`\n - `hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }`\n - `invoice_contract?: { id: string; }`\n - `invoice_schedule?: { credit_type?: { id: string; name: string; }; do_not_invoice?: boolean; schedule_items?: { id: string; amount: number; quantity: number; timestamp: string; unit_price: number; invoice_id?: string; }[]; }`\n - `ledger?: { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_SEGMENT_START'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_ROLLOVER'; } | { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_EXPIRATION'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_CANCELED'; contract_id?: string; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_CREDITED'; contract_id?: string; } | { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT'; } | { amount: number; timestamp: string; type: 'POSTPAID_COMMIT_INITIAL_BALANCE'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'POSTPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'POSTPAID_COMMIT_ROLLOVER'; } | { amount: number; invoice_id: string; timestamp: string; type: 'POSTPAID_COMMIT_TRUEUP'; contract_id?: string; } | { amount: number; reason: string; timestamp: string; type: 'PREPAID_COMMIT_MANUAL'; } | { amount: number; reason: string; timestamp: string; type: 'POSTPAID_COMMIT_MANUAL'; } | { amount: number; timestamp: string; type: 'POSTPAID_COMMIT_EXPIRATION'; }[]`\n - `name?: string`\n - `netsuite_sales_order_id?: string`\n - `priority?: number`\n - `rate_type?: 'COMMIT_RATE' | 'LIST_RATE'`\n - `recurring_commit_id?: string`\n - `rolled_over_from?: { commit_id: string; contract_id: string; }`\n - `rollover_fraction?: number`\n - `salesforce_opportunity_id?: string`\n - `specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]`\n - `spend_tracker_attributes?: { counts_as_discounted: boolean; }`\n - `subscription_config?: { allocation?: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config?: { is_prorated: boolean; }; subscription_id?: string; }`\n - `uniqueness_key?: string`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\n// Automatically fetches more pages as needed.\nfor await (const commit of client.v1.customers.commits.list({ customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d' })) {\n console.log(commit);\n}\n```",
perLanguage: {
typescript: {
method: 'client.v1.customers.commits.list',
@@ -3669,9 +3671,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [
'include_ledgers?: boolean;',
],
response:
- "{ data: { id: string; amendments: object[]; current: contract_without_amendments; customer_id: string; initial: contract_without_amendments; archived_at?: string; custom_fields?: object; customer_billing_provider_configuration?: object; package_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; subscriptions?: subscription[]; uniqueness_key?: string; }; }",
+ "{ data: { id: string; amendments: object[]; current: contract_without_amendments; customer_id: string; initial: contract_without_amendments; archived_at?: string; custom_fields?: object; customer_billing_provider_configuration?: object; package_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; spend_trackers?: object[]; subscriptions?: subscription[]; uniqueness_key?: string; }; }",
markdown:
- "## retrieve\n\n`client.v1.contracts.retrieve(contract_id: string, customer_id: string, include_balance?: boolean, include_ledgers?: boolean): { data: contract; }`\n\n**post** `/v1/contracts/get`\n\nThis is the v1 endpoint to get a contract. New clients should implement using the v2 endpoint.\n\n\n### Parameters\n\n- `contract_id: string`\n\n- `customer_id: string`\n\n- `include_balance?: boolean`\n Include the balance of credits and commits in the response. Setting this flag may cause the query to be slower.\n\n- `include_ledgers?: boolean`\n Include commit ledgers in the response. Setting this flag may cause the query to be slower.\n\n### Returns\n\n- `{ data: { id: string; amendments: object[]; current: contract_without_amendments; customer_id: string; initial: contract_without_amendments; archived_at?: string; custom_fields?: object; customer_billing_provider_configuration?: object; package_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; subscriptions?: subscription[]; uniqueness_key?: string; }; }`\n\n - `data: { id: string; amendments: { id: string; commits: object[]; created_at: string; created_by: string; overrides: object[]; scheduled_charges: object[]; starting_at: string; credits?: object[]; discounts?: object[]; netsuite_sales_order_id?: string; professional_services?: object[]; reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; ending_before?: string; fraction?: number; gcp_account_id?: string; gcp_offer_id?: string; netsuite_reseller_id?: string; reseller_contract_value?: number; starting_at?: string; }[]; salesforce_opportunity_id?: string; }[]; current: { commits: commit[]; created_at: string; created_by: string; overrides: override[]; scheduled_charges: scheduled_charge[]; starting_at: string; transitions: object[]; usage_statement_schedule: object; credits?: credit[]; discounts?: discount[]; ending_before?: string; hierarchy_configuration?: hierarchy_configuration; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; professional_services?: pro_service[]; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; reseller_royalties?: object[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; total_contract_value?: number; usage_filter?: object; }; customer_id: string; initial: { commits: commit[]; created_at: string; created_by: string; overrides: override[]; scheduled_charges: scheduled_charge[]; starting_at: string; transitions: object[]; usage_statement_schedule: object; credits?: credit[]; discounts?: discount[]; ending_before?: string; hierarchy_configuration?: hierarchy_configuration; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; professional_services?: pro_service[]; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; reseller_royalties?: object[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; total_contract_value?: number; usage_filter?: object; }; archived_at?: string; custom_fields?: object; customer_billing_provider_configuration?: { archived_at: string; billing_provider: string; delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; id?: string; configuration?: object; }; package_id?: string; prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; }; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; threshold_amount: number; discount_configuration?: object; }; subscriptions?: { billing_periods: object; collection_schedule: 'ADVANCE' | 'ARREARS'; proration: object; quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY'; quantity_schedule: object[]; starting_at: string; subscription_rate: object; id?: string; custom_fields?: object; description?: string; ending_before?: string; fiat_credit_type_id?: string; name?: string; seat_config?: object; }[]; uniqueness_key?: string; }`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst contract = await client.v1.contracts.retrieve({ contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc', customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d' });\n\nconsole.log(contract);\n```",
+ "## retrieve\n\n`client.v1.contracts.retrieve(contract_id: string, customer_id: string, include_balance?: boolean, include_ledgers?: boolean): { data: contract; }`\n\n**post** `/v1/contracts/get`\n\nThis is the v1 endpoint to get a contract. New clients should implement using the v2 endpoint.\n\n\n### Parameters\n\n- `contract_id: string`\n\n- `customer_id: string`\n\n- `include_balance?: boolean`\n Include the balance of credits and commits in the response. Setting this flag may cause the query to be slower.\n\n- `include_ledgers?: boolean`\n Include commit ledgers in the response. Setting this flag may cause the query to be slower.\n\n### Returns\n\n- `{ data: { id: string; amendments: object[]; current: contract_without_amendments; customer_id: string; initial: contract_without_amendments; archived_at?: string; custom_fields?: object; customer_billing_provider_configuration?: object; package_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; spend_trackers?: object[]; subscriptions?: subscription[]; uniqueness_key?: string; }; }`\n\n - `data: { id: string; amendments: { id: string; commits: object[]; created_at: string; created_by: string; overrides: object[]; scheduled_charges: object[]; starting_at: string; credits?: object[]; discounts?: object[]; netsuite_sales_order_id?: string; professional_services?: object[]; reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; ending_before?: string; fraction?: number; gcp_account_id?: string; gcp_offer_id?: string; netsuite_reseller_id?: string; reseller_contract_value?: number; starting_at?: string; }[]; salesforce_opportunity_id?: string; }[]; current: { commits: commit[]; created_at: string; created_by: string; overrides: override[]; scheduled_charges: scheduled_charge[]; starting_at: string; transitions: object[]; usage_statement_schedule: object; credits?: credit[]; discounts?: discount[]; ending_before?: string; hierarchy_configuration?: hierarchy_configuration; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; professional_services?: pro_service[]; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; reseller_royalties?: object[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; spend_trackers?: object[]; total_contract_value?: number; usage_filter?: object; }; customer_id: string; initial: { commits: commit[]; created_at: string; created_by: string; overrides: override[]; scheduled_charges: scheduled_charge[]; starting_at: string; transitions: object[]; usage_statement_schedule: object; credits?: credit[]; discounts?: discount[]; ending_before?: string; hierarchy_configuration?: hierarchy_configuration; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; professional_services?: pro_service[]; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; reseller_royalties?: object[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; spend_trackers?: object[]; total_contract_value?: number; usage_filter?: object; }; archived_at?: string; custom_fields?: object; customer_billing_provider_configuration?: { archived_at: string; billing_provider: string; delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; id?: string; configuration?: object; }; package_id?: string; prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; }; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; threshold_amount: number; discount_configuration?: object; }; spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; accumulated_spend?: { amount: number; period_ending_before: string; period_starting_at: string; }; }[]; subscriptions?: { billing_periods: object; collection_schedule: 'ADVANCE' | 'ARREARS'; proration: object; quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY'; quantity_schedule: object[]; starting_at: string; subscription_rate: object; id?: string; custom_fields?: object; description?: string; ending_before?: string; fiat_credit_type_id?: string; name?: string; seat_config?: object; }[]; uniqueness_key?: string; }`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst contract = await client.v1.contracts.retrieve({ contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc', customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d' });\n\nconsole.log(contract);\n```",
perLanguage: {
typescript: {
method: 'client.v1.contracts.retrieve',
@@ -3722,9 +3724,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [
'starting_at?: string;',
],
response:
- "{ data: { id: string; amendments: object[]; current: contract_without_amendments; customer_id: string; initial: contract_without_amendments; archived_at?: string; custom_fields?: object; customer_billing_provider_configuration?: object; package_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; subscriptions?: subscription[]; uniqueness_key?: string; }[]; }",
+ "{ data: { id: string; amendments: object[]; current: contract_without_amendments; customer_id: string; initial: contract_without_amendments; archived_at?: string; custom_fields?: object; customer_billing_provider_configuration?: object; package_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; spend_trackers?: object[]; subscriptions?: subscription[]; uniqueness_key?: string; }[]; }",
markdown:
- "## list\n\n`client.v1.contracts.list(customer_id: string, covering_date?: string, include_archived?: boolean, include_balance?: boolean, include_ledgers?: boolean, starting_at?: string): { data: contract[]; }`\n\n**post** `/v1/contracts/list`\n\nRetrieves all contracts for a specific customer, including pricing, terms, credits, and commitments. Use this to view a customer's contract history and current agreements for billing management. Returns contract details with optional ledgers and balance information. \n\n⚠️ Note: This is the legacy v1 endpoint - new integrations should use the v2 endpoint for enhanced features.\n\n\n### Parameters\n\n- `customer_id: string`\n\n- `covering_date?: string`\n Optional RFC 3339 timestamp. If provided, the response will include only contracts effective on the provided date. This cannot be provided if the starting_at filter is provided.\n\n- `include_archived?: boolean`\n Include archived contracts in the response\n\n- `include_balance?: boolean`\n Include the balance of credits and commits in the response. Setting this flag may cause the query to be slower.\n\n- `include_ledgers?: boolean`\n Include commit ledgers in the response. Setting this flag may cause the query to be slower.\n\n- `starting_at?: string`\n Optional RFC 3339 timestamp. If provided, the response will include only contracts where effective_at is on or after the provided date. This cannot be provided if the covering_date filter is provided.\n\n### Returns\n\n- `{ data: { id: string; amendments: object[]; current: contract_without_amendments; customer_id: string; initial: contract_without_amendments; archived_at?: string; custom_fields?: object; customer_billing_provider_configuration?: object; package_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; subscriptions?: subscription[]; uniqueness_key?: string; }[]; }`\n\n - `data: { id: string; amendments: { id: string; commits: object[]; created_at: string; created_by: string; overrides: object[]; scheduled_charges: object[]; starting_at: string; credits?: object[]; discounts?: object[]; netsuite_sales_order_id?: string; professional_services?: object[]; reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; ending_before?: string; fraction?: number; gcp_account_id?: string; gcp_offer_id?: string; netsuite_reseller_id?: string; reseller_contract_value?: number; starting_at?: string; }[]; salesforce_opportunity_id?: string; }[]; current: { commits: commit[]; created_at: string; created_by: string; overrides: override[]; scheduled_charges: scheduled_charge[]; starting_at: string; transitions: object[]; usage_statement_schedule: object; credits?: credit[]; discounts?: discount[]; ending_before?: string; hierarchy_configuration?: hierarchy_configuration; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; professional_services?: pro_service[]; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; reseller_royalties?: object[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; total_contract_value?: number; usage_filter?: object; }; customer_id: string; initial: { commits: commit[]; created_at: string; created_by: string; overrides: override[]; scheduled_charges: scheduled_charge[]; starting_at: string; transitions: object[]; usage_statement_schedule: object; credits?: credit[]; discounts?: discount[]; ending_before?: string; hierarchy_configuration?: hierarchy_configuration; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; professional_services?: pro_service[]; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; reseller_royalties?: object[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; total_contract_value?: number; usage_filter?: object; }; archived_at?: string; custom_fields?: object; customer_billing_provider_configuration?: { archived_at: string; billing_provider: string; delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; id?: string; configuration?: object; }; package_id?: string; prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; }; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; threshold_amount: number; discount_configuration?: object; }; subscriptions?: { billing_periods: object; collection_schedule: 'ADVANCE' | 'ARREARS'; proration: object; quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY'; quantity_schedule: object[]; starting_at: string; subscription_rate: object; id?: string; custom_fields?: object; description?: string; ending_before?: string; fiat_credit_type_id?: string; name?: string; seat_config?: object; }[]; uniqueness_key?: string; }[]`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst contracts = await client.v1.contracts.list({ customer_id: '9b85c1c1-5238-4f2a-a409-61412905e1e1' });\n\nconsole.log(contracts);\n```",
+ "## list\n\n`client.v1.contracts.list(customer_id: string, covering_date?: string, include_archived?: boolean, include_balance?: boolean, include_ledgers?: boolean, starting_at?: string): { data: contract[]; }`\n\n**post** `/v1/contracts/list`\n\nRetrieves all contracts for a specific customer, including pricing, terms, credits, and commitments. Use this to view a customer's contract history and current agreements for billing management. Returns contract details with optional ledgers and balance information. \n\n⚠️ Note: This is the legacy v1 endpoint - new integrations should use the v2 endpoint for enhanced features.\n\n\n### Parameters\n\n- `customer_id: string`\n\n- `covering_date?: string`\n Optional RFC 3339 timestamp. If provided, the response will include only contracts effective on the provided date. This cannot be provided if the starting_at filter is provided.\n\n- `include_archived?: boolean`\n Include archived contracts in the response\n\n- `include_balance?: boolean`\n Include the balance of credits and commits in the response. Setting this flag may cause the query to be slower.\n\n- `include_ledgers?: boolean`\n Include commit ledgers in the response. Setting this flag may cause the query to be slower.\n\n- `starting_at?: string`\n Optional RFC 3339 timestamp. If provided, the response will include only contracts where effective_at is on or after the provided date. This cannot be provided if the covering_date filter is provided.\n\n### Returns\n\n- `{ data: { id: string; amendments: object[]; current: contract_without_amendments; customer_id: string; initial: contract_without_amendments; archived_at?: string; custom_fields?: object; customer_billing_provider_configuration?: object; package_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; spend_trackers?: object[]; subscriptions?: subscription[]; uniqueness_key?: string; }[]; }`\n\n - `data: { id: string; amendments: { id: string; commits: object[]; created_at: string; created_by: string; overrides: object[]; scheduled_charges: object[]; starting_at: string; credits?: object[]; discounts?: object[]; netsuite_sales_order_id?: string; professional_services?: object[]; reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; ending_before?: string; fraction?: number; gcp_account_id?: string; gcp_offer_id?: string; netsuite_reseller_id?: string; reseller_contract_value?: number; starting_at?: string; }[]; salesforce_opportunity_id?: string; }[]; current: { commits: commit[]; created_at: string; created_by: string; overrides: override[]; scheduled_charges: scheduled_charge[]; starting_at: string; transitions: object[]; usage_statement_schedule: object; credits?: credit[]; discounts?: discount[]; ending_before?: string; hierarchy_configuration?: hierarchy_configuration; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; professional_services?: pro_service[]; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; reseller_royalties?: object[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; spend_trackers?: object[]; total_contract_value?: number; usage_filter?: object; }; customer_id: string; initial: { commits: commit[]; created_at: string; created_by: string; overrides: override[]; scheduled_charges: scheduled_charge[]; starting_at: string; transitions: object[]; usage_statement_schedule: object; credits?: credit[]; discounts?: discount[]; ending_before?: string; hierarchy_configuration?: hierarchy_configuration; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; professional_services?: pro_service[]; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; reseller_royalties?: object[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; spend_trackers?: object[]; total_contract_value?: number; usage_filter?: object; }; archived_at?: string; custom_fields?: object; customer_billing_provider_configuration?: { archived_at: string; billing_provider: string; delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; id?: string; configuration?: object; }; package_id?: string; prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; }; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; threshold_amount: number; discount_configuration?: object; }; spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; accumulated_spend?: { amount: number; period_ending_before: string; period_starting_at: string; }; }[]; subscriptions?: { billing_periods: object; collection_schedule: 'ADVANCE' | 'ARREARS'; proration: object; quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY'; quantity_schedule: object[]; starting_at: string; subscription_rate: object; id?: string; custom_fields?: object; description?: string; ending_before?: string; fiat_credit_type_id?: string; name?: string; seat_config?: object; }[]; uniqueness_key?: string; }[]`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst contracts = await client.v1.contracts.list({ customer_id: '9b85c1c1-5238-4f2a-a409-61412905e1e1' });\n\nconsole.log(contracts);\n```",
perLanguage: {
typescript: {
method: 'client.v1.contracts.list',
@@ -3770,7 +3772,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
'customer_id: string;',
'starting_at: string;',
"billing_provider_configuration?: { billing_provider?: 'aws_marketplace' | 'azure_marketplace' | 'gcp_marketplace' | 'stripe' | 'netsuite'; billing_provider_configuration_id?: string; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; };",
- "commits?: { product_id: string; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; amount?: number; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; temporary_id?: string; }[];",
+ "commits?: { product_id: string; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; amount?: number; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; spend_tracker_attributes?: { counts_as_discounted: boolean; }; temporary_id?: string; }[];",
"credits?: { access_schedule: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[];",
'custom_fields?: object;',
"discounts?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[];",
@@ -3783,7 +3785,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
"overrides?: { starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: { price: number; size?: number; }[]; }; priority?: number; product_id?: string; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[];",
'package_alias?: string;',
'package_id?: string;',
- "prepaid_balance_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; }; };",
+ "prepaid_balance_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; };",
'professional_services?: { max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[];',
'rate_card_alias?: string;',
'rate_card_id?: string;',
@@ -3794,7 +3796,8 @@ const EMBEDDED_METHODS: MethodEntry[] = [
'salesforce_opportunity_id?: string;',
"scheduled_charges?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[];",
"scheduled_charges_on_usage_invoices?: 'ALL';",
- "spend_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount: number; discount_configuration?: { payment_fraction: number; }; };",
+ "spend_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount: number; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; };",
+ "spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[];",
"subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated?: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product_id: string; }; custom_fields?: object; description?: string; ending_before?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { initial_seat_ids: string[]; seat_group_key: string; initial_unassigned_seats?: number; }; starting_at?: string; temporary_id?: string; }[];",
'total_contract_value?: number;',
"transition?: { from_contract_id: string; type: 'SUPERSEDE' | 'RENEWAL'; future_invoice_behavior?: { trueup?: 'REMOVE' | 'AS_IS'; }; };",
@@ -3804,7 +3807,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
],
response: '{ data: { id: string; }; }',
markdown:
- "## create\n\n`client.v1.contracts.create(customer_id: string, starting_at: string, billing_provider_configuration?: { billing_provider?: 'aws_marketplace' | 'azure_marketplace' | 'gcp_marketplace' | 'stripe' | 'netsuite'; billing_provider_configuration_id?: string; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }, commits?: { product_id: string; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: object[]; credit_type_id?: string; }; amount?: number; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: object; invoice_schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: object[]; temporary_id?: string; }[], credits?: { access_schedule: { schedule_items: object[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: object[]; }[], custom_fields?: object, discounts?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[], ending_before?: string, hierarchy_configuration?: { parent?: { contract_id: string; customer_id: string; }; parent_behavior?: { invoice_consolidation_type?: 'CONCATENATE' | 'NONE'; }; payer?: 'SELF' | 'PARENT'; usage_statement_behavior?: 'CONSOLIDATE' | 'SEPARATE'; }, multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT', name?: string, net_payment_terms_days?: number, netsuite_sales_order_id?: string, overrides?: { starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: tier[]; }; priority?: number; product_id?: string; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[], package_alias?: string, package_id?: string, prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; }, professional_services?: { max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[], rate_card_alias?: string, rate_card_id?: string, recurring_commits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: object; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { apply_seat_increase_config: object; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[], recurring_credits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { apply_seat_increase_config: object; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[], reseller_royalties?: { fraction: number; netsuite_reseller_id: string; reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_options?: { aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; }; ending_before?: string; gcp_options?: { gcp_account_id?: string; gcp_offer_id?: string; }; reseller_contract_value?: number; }[], revenue_system_configuration?: { delivery_method?: 'direct_to_billing_provider'; provider?: 'netsuite'; revenue_system_configuration_id?: string; }, salesforce_opportunity_id?: string, scheduled_charges?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[], scheduled_charges_on_usage_invoices?: 'ALL', spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; threshold_amount: number; discount_configuration?: object; }, subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated?: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product_id: string; }; custom_fields?: object; description?: string; ending_before?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { initial_seat_ids: string[]; seat_group_key: string; initial_unassigned_seats?: number; }; starting_at?: string; temporary_id?: string; }[], total_contract_value?: number, transition?: { from_contract_id: string; type: 'SUPERSEDE' | 'RENEWAL'; future_invoice_behavior?: { trueup?: 'REMOVE' | 'AS_IS'; }; }, uniqueness_key?: string, usage_filter?: { group_key: string; group_values: string[]; starting_at?: string; }, usage_statement_schedule?: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; billing_anchor_date?: string; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START' | 'CUSTOM_DATE'; invoice_generation_starting_at?: string; }): { data: id; }`\n\n**post** `/v1/contracts/create`\n\nContracts define a customer's products, pricing, discounts, access duration, and billing configuration. Contracts serve as the central billing agreement for both PLG and Enterprise customers. You can automatically grant customers access to your products and services directly from your product or CRM.\n\n### Use this endpoint to:\n- PLG onboarding: Automatically provision new self-serve customers with contracts when they sign up.\n- Enterprise sales: Push negotiated contracts from Salesforce with custom pricing and commitments\n- Promotional pricing: Implement time-limited discounts and free trials through overrides\n\n### Key components:\n#### Contract Term and Billing Schedule\n- Set contract duration using `starting_at` and `ending_before` fields. PLG contracts typically use perpetual agreements (no end date), while Enterprise contracts have fixed end dates which can be edited over time in the case of co-term upsells.\n\n#### Rate Card\nIf you are offering usage based pricing, you can set a rate card for the contract to reference through `rate_card_id` or `rate_card_alias`. The rate card is a store of all of your usage based products and their centralized pricing. Any new products or price changes on the rate card can be set to automatically propagate to all associated contracts - this ensures consistent pricing and product launches flow to contracts without manual updates and migrations. The `usage_statement_schedule` determines the cadence on which Metronome will finalize a usage invoice for the customer. This defaults to monthly on the 1st, with options for custom dates, quarterly, or annual cadences. Note: Most usage based billing companies align usage statements to be evaluated aligned to the first of the month.\nRead more about [Rate Cards](https://docs.metronome.com/pricing-packaging/create-manage-rate-cards/).\n\n#### Overrides and discounts\nCustomize pricing on the contract through time-bounded overrides that can target specific products, product families, or complex usage scenarios. Overrides enable two key capabilities:\n- Discounts: Apply percentage discounts, fixed rate reductions, or quantity-based pricing tiers\n- Entitlements: Provide special pricing or access to specific products for negotiated deals\n\nRead more about [Contract Overrides](https://docs.metronome.com/manage-product-access/add-contract-override/).\n\n#### Commits and Credits\nUsing commits, configure prepaid or postpaid spending commitments where customers promise to spend a certain amount over the contract period paid in advance or in arrears. Use credits to provide free spending allowances. Under the hood these are the same mechanisms, however, credits are typically offered for free (SLA or promotional) or as a part of an allotment associated with a Subscription.\n\nIn Metronome, you can set commits and credits to only be applicable for a subset of usage. Use `applicable_product_ids` or `applicable_product_tags` to create product or product-family specific commits or credits, or you can build complex boolean logic specifiers to target usage based on pricing and presentation group values using `override_specifiers`.\n\nThese objects can also also be configured to have a recurrence schedule to easily model customer packaging which includes recurring monthly or quarterly allotments.\n\nCommits support rollover settings (`rollover_fraction`) to transfer unused balances between contract periods, either entirely or as a percentage.\n\nRead more about [Credits and Commits](https://docs.metronome.com/pricing-packaging/apply-credits-commits/).\n\n#### Subscriptions\nYou can add a fixed recurring charge to a contract, like monthly licenses or seat-based fees, using the subscription charge. Subscription charges are defined on your rate card and you can select which subscription is applicable to add to each contract. When you add a subscription to a contract you need to:\n- Define whether the subscription is paid for in-advance or in-arrears (`collection_schedule`)\n- Define the proration behavior (`proration`)\n- Specify an initial quantity (`initial_quantity`)\n- Define which subscription rate on the rate card should be used (`subscription_rate`)\n\nRead more about [Subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/).\n\n#### Scheduled Charges\nSet up one-time, recurring, or entirely custom charges that occur on specific dates, separate from usage-based billing or commitments. These can be used to model non-recurring platform charges or professional services.\n\n#### Threshold Billing\nMetronome allows you to configure automatic billing triggers when customers reach spending thresholds to prevent fraud and manage risk. You can use `spend_threshold_configuration` to trigger an invoice to cover current charges whenever the threshold is reached or you can ensure the customer maintains a minimum prepaid balance using the `prepaid_balance_configuration`.\n\nRead more about [Spend Threshold](https://docs.metronome.com/manage-product-access/spend-thresholds/) and [Prepaid Balance Thresholds](https://docs.metronome.com/manage-product-access/prepaid-balance-thresholds/).\n\n### Usage guidelines:\n- You can always [Edit Contracts](https://docs.metronome.com/manage-product-access/edit-contract/) after it has been created, using the `editContract` endpoint. Metronome keeps track of all edits, both in the audit log and over the `getEditHistory` endpoint.\n- Customers in Metronome can have multiple concurrent contracts at one time. Use `usage_filters` to route the correct usage to each contract. [Read more about usage filters](https://docs.metronome.com/manage-product-access/provision-customer/#create-a-usage-filter).\n\n\n### Parameters\n\n- `customer_id: string`\n\n- `starting_at: string`\n inclusive contract start time\n\n- `billing_provider_configuration?: { billing_provider?: 'aws_marketplace' | 'azure_marketplace' | 'gcp_marketplace' | 'stripe' | 'netsuite'; billing_provider_configuration_id?: string; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }`\n The billing provider configuration associated with a contract. Provide either an ID or the provider and delivery method.\n - `billing_provider?: 'aws_marketplace' | 'azure_marketplace' | 'gcp_marketplace' | 'stripe' | 'netsuite'`\n Do not specify if using billing_provider_configuration_id.\n - `billing_provider_configuration_id?: string`\n The Metronome ID of the billing provider configuration. Use when a customer has multiple configurations with the same billing provider and delivery method. Otherwise, specify the billing_provider and delivery_method.\n - `delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'`\n Do not specify if using billing_provider_configuration_id.\n\n- `commits?: { product_id: string; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; amount?: number; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; temporary_id?: string; }[]`\n\n- `credits?: { access_schedule: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]`\n\n- `custom_fields?: object`\n Custom fields to be added eg. { \"key1\": \"value1\", \"key2\": \"value2\" }\n\n- `discounts?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]`\n This field's availability is dependent on your client's configuration.\n\n- `ending_before?: string`\n exclusive contract end time\n\n- `hierarchy_configuration?: { parent?: { contract_id: string; customer_id: string; }; parent_behavior?: { invoice_consolidation_type?: 'CONCATENATE' | 'NONE'; }; payer?: 'SELF' | 'PARENT'; usage_statement_behavior?: 'CONSOLIDATE' | 'SEPARATE'; }`\n - `parent?: { contract_id: string; customer_id: string; }`\n - `parent_behavior?: { invoice_consolidation_type?: 'CONCATENATE' | 'NONE'; }`\n - `payer?: 'SELF' | 'PARENT'`\n Indicates which customer should pay for the child's invoice charges\n\n**SELF**: The child pays for its own invoice charges\n\n**PARENT**: The parent pays for the child's invoice charges\n - `usage_statement_behavior?: 'CONSOLIDATE' | 'SEPARATE'`\n Indicates the behavior of the child's invoice statements on the parent's invoices.\n\n**CONSOLIDATE**: Child's invoice statements will be added to parent's consolidated invoices\n\n**SEPARATE**: Child's invoice statements will appear not appear on parent's consolidated invoices\n\n- `multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'`\n Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list prices automatically. EXPLICIT prioritization requires specifying priorities for each multiplier; the one with the lowest priority value will be prioritized first. If tiered overrides are used, prioritization must be explicit.\n\n- `name?: string`\n\n- `net_payment_terms_days?: number`\n\n- `netsuite_sales_order_id?: string`\n This field's availability is dependent on your client's configuration.\n\n- `overrides?: { starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: { price: number; size?: number; }[]; }; priority?: number; product_id?: string; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]`\n\n- `package_alias?: string`\n Selects the package linked to the specified alias as of the contract's start date. Mutually exclusive with package_id.\n\n- `package_id?: string`\n If provided, provisions a customer on a package instead of creating a traditional contract. When specified, only customer_id, starting_at, package_id, uniqueness_key, transition, and custom_fields are allowed.\n\n- `prepaid_balance_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; }; }`\n - `commit: { product_id: string; description?: string; name?: string; priority?: number; }`\n - `is_enabled: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `recharge_to_amount: number`\n Specify the amount the balance should be recharged to.\n - `threshold_amount: number`\n Specify the threshold amount for the contract. Each time the contract's prepaid balance lowers to this amount, a threshold charge will be initiated.\n - `custom_credit_type_id?: string`\n If provided, the threshold, recharge-to amount, and the resulting threshold commit amount will be in terms of this credit type instead of the fiat currency.\n - `discount_configuration?: { payment_fraction: number; }`\n\n- `professional_services?: { max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[]`\n This field's availability is dependent on your client's configuration.\n\n- `rate_card_alias?: string`\n Selects the rate card linked to the specified alias as of the contract's start date.\n\n- `rate_card_id?: string`\n\n- `recurring_commits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[]`\n\n- `recurring_credits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[]`\n\n- `reseller_royalties?: { fraction: number; netsuite_reseller_id: string; reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_options?: { aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; }; ending_before?: string; gcp_options?: { gcp_account_id?: string; gcp_offer_id?: string; }; reseller_contract_value?: number; }[]`\n This field's availability is dependent on your client's configuration.\n\n- `revenue_system_configuration?: { delivery_method?: 'direct_to_billing_provider'; provider?: 'netsuite'; revenue_system_configuration_id?: string; }`\n The revenue system configuration associated with a contract. Provide either an ID or the provider and delivery method.\n - `delivery_method?: 'direct_to_billing_provider'`\n How revenue recognition records should be delivered to the revenue system. Do not specify if using revenue_system_configuration_id.\n - `provider?: 'netsuite'`\n The system that is providing services for revenue recognition. Do not specify if using revenue_system_configuration_id.\n - `revenue_system_configuration_id?: string`\n The Metronome ID of the revenue system configuration. Use when a customer has multiple configurations with the same provider and delivery method. Otherwise, specify the provider and delivery_method.\n\n- `salesforce_opportunity_id?: string`\n This field's availability is dependent on your client's configuration.\n\n- `scheduled_charges?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]`\n\n- `scheduled_charges_on_usage_invoices?: 'ALL'`\n Determines which scheduled and commit charges to consolidate onto the Contract's usage invoice. The charge's `timestamp` must match the usage invoice's `ending_before` date for consolidation to occur. This field cannot be modified after a Contract has been created. If this field is omitted, charges will appear on a separate invoice from usage charges.\n\n- `spend_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount: number; discount_configuration?: { payment_fraction: number; }; }`\n - `commit: { product_id: string; description?: string; name?: string; priority?: number; }`\n - `is_enabled: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `threshold_amount: number`\n Specify the threshold amount for the contract. Each time the contract's usage hits this amount, a threshold charge will be initiated.\n - `discount_configuration?: { payment_fraction: number; }`\n\n- `subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated?: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product_id: string; }; custom_fields?: object; description?: string; ending_before?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { initial_seat_ids: string[]; seat_group_key: string; initial_unassigned_seats?: number; }; starting_at?: string; temporary_id?: string; }[]`\n Optional list of [subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/) to add to the contract.\n\n- `total_contract_value?: number`\n This field's availability is dependent on your client's configuration.\n\n- `transition?: { from_contract_id: string; type: 'SUPERSEDE' | 'RENEWAL'; future_invoice_behavior?: { trueup?: 'REMOVE' | 'AS_IS'; }; }`\n - `from_contract_id: string`\n - `type: 'SUPERSEDE' | 'RENEWAL'`\n This field's available values may vary based on your client's configuration.\n - `future_invoice_behavior?: { trueup?: 'REMOVE' | 'AS_IS'; }`\n\n- `uniqueness_key?: string`\n Prevents the creation of duplicates. If a request to create a record is made with a previously used uniqueness key, a new record will not be created and the request will fail with a 409 error.\n\n- `usage_filter?: { group_key: string; group_values: string[]; starting_at?: string; }`\n - `group_key: string`\n - `group_values: string[]`\n - `starting_at?: string`\n\n- `usage_statement_schedule?: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; billing_anchor_date?: string; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START' | 'CUSTOM_DATE'; invoice_generation_starting_at?: string; }`\n - `frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'`\n - `billing_anchor_date?: string`\n Required when using CUSTOM_DATE. This option lets you set a historical billing anchor date, aligning future billing cycles with a chosen cadence. For example, if a contract starts on 2024-09-15 and you set the anchor date to 2024-09-10 with a MONTHLY frequency, the first usage statement will cover 09-15 to 10-10. Subsequent statements will follow the 10th of each month.\n - `day?: 'FIRST_OF_MONTH' | 'CONTRACT_START' | 'CUSTOM_DATE'`\n If not provided, defaults to the first day of the month.\n - `invoice_generation_starting_at?: string`\n The date Metronome should start generating usage invoices. If unspecified, contract start date will be used. This is useful to set if you want to import historical invoices via our 'Create Historical Invoices' API rather than having Metronome automatically generate them.\n\n### Returns\n\n- `{ data: { id: string; }; }`\n\n - `data: { id: string; }`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst contract = await client.v1.contracts.create({ customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d', starting_at: '2020-01-01T00:00:00.000Z' });\n\nconsole.log(contract);\n```",
+ "## create\n\n`client.v1.contracts.create(customer_id: string, starting_at: string, billing_provider_configuration?: { billing_provider?: 'aws_marketplace' | 'azure_marketplace' | 'gcp_marketplace' | 'stripe' | 'netsuite'; billing_provider_configuration_id?: string; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }, commits?: { product_id: string; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: object[]; credit_type_id?: string; }; amount?: number; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: object; invoice_schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: object[]; spend_tracker_attributes?: { counts_as_discounted: boolean; }; temporary_id?: string; }[], credits?: { access_schedule: { schedule_items: object[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: object[]; }[], custom_fields?: object, discounts?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[], ending_before?: string, hierarchy_configuration?: { parent?: { contract_id: string; customer_id: string; }; parent_behavior?: { invoice_consolidation_type?: 'CONCATENATE' | 'NONE'; }; payer?: 'SELF' | 'PARENT'; usage_statement_behavior?: 'CONSOLIDATE' | 'SEPARATE'; }, multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT', name?: string, net_payment_terms_days?: number, netsuite_sales_order_id?: string, overrides?: { starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: tier[]; }; priority?: number; product_id?: string; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[], package_alias?: string, package_id?: string, prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; }, professional_services?: { max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[], rate_card_alias?: string, rate_card_id?: string, recurring_commits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: object; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { apply_seat_increase_config: object; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[], recurring_credits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { apply_seat_increase_config: object; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[], reseller_royalties?: { fraction: number; netsuite_reseller_id: string; reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_options?: { aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; }; ending_before?: string; gcp_options?: { gcp_account_id?: string; gcp_offer_id?: string; }; reseller_contract_value?: number; }[], revenue_system_configuration?: { delivery_method?: 'direct_to_billing_provider'; provider?: 'netsuite'; revenue_system_configuration_id?: string; }, salesforce_opportunity_id?: string, scheduled_charges?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[], scheduled_charges_on_usage_invoices?: 'ALL', spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; threshold_amount: number; discount_configuration?: object; }, spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[], subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated?: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product_id: string; }; custom_fields?: object; description?: string; ending_before?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { initial_seat_ids: string[]; seat_group_key: string; initial_unassigned_seats?: number; }; starting_at?: string; temporary_id?: string; }[], total_contract_value?: number, transition?: { from_contract_id: string; type: 'SUPERSEDE' | 'RENEWAL'; future_invoice_behavior?: { trueup?: 'REMOVE' | 'AS_IS'; }; }, uniqueness_key?: string, usage_filter?: { group_key: string; group_values: string[]; starting_at?: string; }, usage_statement_schedule?: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; billing_anchor_date?: string; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START' | 'CUSTOM_DATE'; invoice_generation_starting_at?: string; }): { data: id; }`\n\n**post** `/v1/contracts/create`\n\nContracts define a customer's products, pricing, discounts, access duration, and billing configuration. Contracts serve as the central billing agreement for both PLG and Enterprise customers. You can automatically grant customers access to your products and services directly from your product or CRM.\n\n### Use this endpoint to:\n- PLG onboarding: Automatically provision new self-serve customers with contracts when they sign up.\n- Enterprise sales: Push negotiated contracts from Salesforce with custom pricing and commitments\n- Promotional pricing: Implement time-limited discounts and free trials through overrides\n\n### Key components:\n#### Contract Term and Billing Schedule\n- Set contract duration using `starting_at` and `ending_before` fields. PLG contracts typically use perpetual agreements (no end date), while Enterprise contracts have fixed end dates which can be edited over time in the case of co-term upsells.\n\n#### Rate Card\nIf you are offering usage based pricing, you can set a rate card for the contract to reference through `rate_card_id` or `rate_card_alias`. The rate card is a store of all of your usage based products and their centralized pricing. Any new products or price changes on the rate card can be set to automatically propagate to all associated contracts - this ensures consistent pricing and product launches flow to contracts without manual updates and migrations. The `usage_statement_schedule` determines the cadence on which Metronome will finalize a usage invoice for the customer. This defaults to monthly on the 1st, with options for custom dates, quarterly, or annual cadences. Note: Most usage based billing companies align usage statements to be evaluated aligned to the first of the month.\nRead more about [Rate Cards](https://docs.metronome.com/pricing-packaging/create-manage-rate-cards/).\n\n#### Overrides and discounts\nCustomize pricing on the contract through time-bounded overrides that can target specific products, product families, or complex usage scenarios. Overrides enable two key capabilities:\n- Discounts: Apply percentage discounts, fixed rate reductions, or quantity-based pricing tiers\n- Entitlements: Provide special pricing or access to specific products for negotiated deals\n\nRead more about [Contract Overrides](https://docs.metronome.com/manage-product-access/add-contract-override/).\n\n#### Commits and Credits\nUsing commits, configure prepaid or postpaid spending commitments where customers promise to spend a certain amount over the contract period paid in advance or in arrears. Use credits to provide free spending allowances. Under the hood these are the same mechanisms, however, credits are typically offered for free (SLA or promotional) or as a part of an allotment associated with a Subscription.\n\nIn Metronome, you can set commits and credits to only be applicable for a subset of usage. Use `applicable_product_ids` or `applicable_product_tags` to create product or product-family specific commits or credits, or you can build complex boolean logic specifiers to target usage based on pricing and presentation group values using `override_specifiers`.\n\nThese objects can also also be configured to have a recurrence schedule to easily model customer packaging which includes recurring monthly or quarterly allotments.\n\nCommits support rollover settings (`rollover_fraction`) to transfer unused balances between contract periods, either entirely or as a percentage.\n\nRead more about [Credits and Commits](https://docs.metronome.com/pricing-packaging/apply-credits-commits/).\n\n#### Subscriptions\nYou can add a fixed recurring charge to a contract, like monthly licenses or seat-based fees, using the subscription charge. Subscription charges are defined on your rate card and you can select which subscription is applicable to add to each contract. When you add a subscription to a contract you need to:\n- Define whether the subscription is paid for in-advance or in-arrears (`collection_schedule`)\n- Define the proration behavior (`proration`)\n- Specify an initial quantity (`initial_quantity`)\n- Define which subscription rate on the rate card should be used (`subscription_rate`)\n\nRead more about [Subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/).\n\n#### Scheduled Charges\nSet up one-time, recurring, or entirely custom charges that occur on specific dates, separate from usage-based billing or commitments. These can be used to model non-recurring platform charges or professional services.\n\n#### Threshold Billing\nMetronome allows you to configure automatic billing triggers when customers reach spending thresholds to prevent fraud and manage risk. You can use `spend_threshold_configuration` to trigger an invoice to cover current charges whenever the threshold is reached or you can ensure the customer maintains a minimum prepaid balance using the `prepaid_balance_configuration`.\n\nRead more about [Spend Threshold](https://docs.metronome.com/manage-product-access/spend-thresholds/) and [Prepaid Balance Thresholds](https://docs.metronome.com/manage-product-access/prepaid-balance-thresholds/).\n\n### Usage guidelines:\n- You can always [Edit Contracts](https://docs.metronome.com/manage-product-access/edit-contract/) after it has been created, using the `editContract` endpoint. Metronome keeps track of all edits, both in the audit log and over the `getEditHistory` endpoint.\n- Customers in Metronome can have multiple concurrent contracts at one time. Use `usage_filters` to route the correct usage to each contract. [Read more about usage filters](https://docs.metronome.com/manage-product-access/provision-customer/#create-a-usage-filter).\n\n\n### Parameters\n\n- `customer_id: string`\n\n- `starting_at: string`\n inclusive contract start time\n\n- `billing_provider_configuration?: { billing_provider?: 'aws_marketplace' | 'azure_marketplace' | 'gcp_marketplace' | 'stripe' | 'netsuite'; billing_provider_configuration_id?: string; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }`\n The billing provider configuration associated with a contract. Provide either an ID or the provider and delivery method.\n - `billing_provider?: 'aws_marketplace' | 'azure_marketplace' | 'gcp_marketplace' | 'stripe' | 'netsuite'`\n Do not specify if using billing_provider_configuration_id.\n - `billing_provider_configuration_id?: string`\n The Metronome ID of the billing provider configuration. Use when a customer has multiple configurations with the same billing provider and delivery method. Otherwise, specify the billing_provider and delivery_method.\n - `delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'`\n Do not specify if using billing_provider_configuration_id.\n\n- `commits?: { product_id: string; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; amount?: number; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; spend_tracker_attributes?: { counts_as_discounted: boolean; }; temporary_id?: string; }[]`\n\n- `credits?: { access_schedule: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]`\n\n- `custom_fields?: object`\n Custom fields to be added eg. { \"key1\": \"value1\", \"key2\": \"value2\" }\n\n- `discounts?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]`\n This field's availability is dependent on your client's configuration.\n\n- `ending_before?: string`\n exclusive contract end time\n\n- `hierarchy_configuration?: { parent?: { contract_id: string; customer_id: string; }; parent_behavior?: { invoice_consolidation_type?: 'CONCATENATE' | 'NONE'; }; payer?: 'SELF' | 'PARENT'; usage_statement_behavior?: 'CONSOLIDATE' | 'SEPARATE'; }`\n - `parent?: { contract_id: string; customer_id: string; }`\n - `parent_behavior?: { invoice_consolidation_type?: 'CONCATENATE' | 'NONE'; }`\n - `payer?: 'SELF' | 'PARENT'`\n Indicates which customer should pay for the child's invoice charges\n\n**SELF**: The child pays for its own invoice charges\n\n**PARENT**: The parent pays for the child's invoice charges\n - `usage_statement_behavior?: 'CONSOLIDATE' | 'SEPARATE'`\n Indicates the behavior of the child's invoice statements on the parent's invoices.\n\n**CONSOLIDATE**: Child's invoice statements will be added to parent's consolidated invoices\n\n**SEPARATE**: Child's invoice statements will appear not appear on parent's consolidated invoices\n\n- `multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'`\n Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list prices automatically. EXPLICIT prioritization requires specifying priorities for each multiplier; the one with the lowest priority value will be prioritized first. If tiered overrides are used, prioritization must be explicit.\n\n- `name?: string`\n\n- `net_payment_terms_days?: number`\n\n- `netsuite_sales_order_id?: string`\n This field's availability is dependent on your client's configuration.\n\n- `overrides?: { starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: { price: number; size?: number; }[]; }; priority?: number; product_id?: string; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]`\n\n- `package_alias?: string`\n Selects the package linked to the specified alias as of the contract's start date. Mutually exclusive with package_id.\n\n- `package_id?: string`\n If provided, provisions a customer on a package instead of creating a traditional contract. When specified, only customer_id, starting_at, package_id, uniqueness_key, transition, and custom_fields are allowed.\n\n- `prepaid_balance_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; }`\n - `commit: { product_id: string; description?: string; name?: string; priority?: number; }`\n - `is_enabled: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `recharge_to_amount: number`\n Specify the amount the balance should be recharged to.\n - `threshold_amount: number`\n Specify the threshold amount for the contract. Each time the contract's prepaid balance lowers to this amount, a threshold charge will be initiated.\n - `custom_credit_type_id?: string`\n If provided, the threshold, recharge-to amount, and the resulting threshold commit amount will be in terms of this credit type instead of the fiat currency.\n - `discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }`\n\n- `professional_services?: { max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[]`\n This field's availability is dependent on your client's configuration.\n\n- `rate_card_alias?: string`\n Selects the rate card linked to the specified alias as of the contract's start date.\n\n- `rate_card_id?: string`\n\n- `recurring_commits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[]`\n\n- `recurring_credits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[]`\n\n- `reseller_royalties?: { fraction: number; netsuite_reseller_id: string; reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_options?: { aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; }; ending_before?: string; gcp_options?: { gcp_account_id?: string; gcp_offer_id?: string; }; reseller_contract_value?: number; }[]`\n This field's availability is dependent on your client's configuration.\n\n- `revenue_system_configuration?: { delivery_method?: 'direct_to_billing_provider'; provider?: 'netsuite'; revenue_system_configuration_id?: string; }`\n The revenue system configuration associated with a contract. Provide either an ID or the provider and delivery method.\n - `delivery_method?: 'direct_to_billing_provider'`\n How revenue recognition records should be delivered to the revenue system. Do not specify if using revenue_system_configuration_id.\n - `provider?: 'netsuite'`\n The system that is providing services for revenue recognition. Do not specify if using revenue_system_configuration_id.\n - `revenue_system_configuration_id?: string`\n The Metronome ID of the revenue system configuration. Use when a customer has multiple configurations with the same provider and delivery method. Otherwise, specify the provider and delivery_method.\n\n- `salesforce_opportunity_id?: string`\n This field's availability is dependent on your client's configuration.\n\n- `scheduled_charges?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]`\n\n- `scheduled_charges_on_usage_invoices?: 'ALL'`\n Determines which scheduled and commit charges to consolidate onto the Contract's usage invoice. The charge's `timestamp` must match the usage invoice's `ending_before` date for consolidation to occur. This field cannot be modified after a Contract has been created. If this field is omitted, charges will appear on a separate invoice from usage charges.\n\n- `spend_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount: number; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; }`\n - `commit: { product_id: string; description?: string; name?: string; priority?: number; }`\n - `is_enabled: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `threshold_amount: number`\n Specify the threshold amount for the contract. Each time the contract's usage hits this amount, a threshold charge will be initiated.\n - `discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }`\n\n- `spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[]`\n Spend trackers to attach to this contract. Aliases must be unique within a contract.\n\n- `subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated?: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product_id: string; }; custom_fields?: object; description?: string; ending_before?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { initial_seat_ids: string[]; seat_group_key: string; initial_unassigned_seats?: number; }; starting_at?: string; temporary_id?: string; }[]`\n Optional list of [subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/) to add to the contract.\n\n- `total_contract_value?: number`\n This field's availability is dependent on your client's configuration.\n\n- `transition?: { from_contract_id: string; type: 'SUPERSEDE' | 'RENEWAL'; future_invoice_behavior?: { trueup?: 'REMOVE' | 'AS_IS'; }; }`\n - `from_contract_id: string`\n - `type: 'SUPERSEDE' | 'RENEWAL'`\n This field's available values may vary based on your client's configuration.\n - `future_invoice_behavior?: { trueup?: 'REMOVE' | 'AS_IS'; }`\n\n- `uniqueness_key?: string`\n Prevents the creation of duplicates. If a request to create a record is made with a previously used uniqueness key, a new record will not be created and the request will fail with a 409 error.\n\n- `usage_filter?: { group_key: string; group_values: string[]; starting_at?: string; }`\n - `group_key: string`\n - `group_values: string[]`\n - `starting_at?: string`\n\n- `usage_statement_schedule?: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; billing_anchor_date?: string; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START' | 'CUSTOM_DATE'; invoice_generation_starting_at?: string; }`\n - `frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'`\n - `billing_anchor_date?: string`\n Required when using CUSTOM_DATE. This option lets you set a historical billing anchor date, aligning future billing cycles with a chosen cadence. For example, if a contract starts on 2024-09-15 and you set the anchor date to 2024-09-10 with a MONTHLY frequency, the first usage statement will cover 09-15 to 10-10. Subsequent statements will follow the 10th of each month.\n - `day?: 'FIRST_OF_MONTH' | 'CONTRACT_START' | 'CUSTOM_DATE'`\n If not provided, defaults to the first day of the month.\n - `invoice_generation_starting_at?: string`\n The date Metronome should start generating usage invoices. If unspecified, contract start date will be used. This is useful to set if you want to import historical invoices via our 'Create Historical Invoices' API rather than having Metronome automatically generate them.\n\n### Returns\n\n- `{ data: { id: string; }; }`\n\n - `data: { id: string; }`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst contract = await client.v1.contracts.create({ customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d', starting_at: '2020-01-01T00:00:00.000Z' });\n\nconsole.log(contract);\n```",
perLanguage: {
typescript: {
method: 'client.v1.contracts.create',
@@ -3850,7 +3853,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
'contract_id: string;',
'customer_id: string;',
'starting_at: string;',
- "commits?: { product_id: string; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; amount?: number; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; temporary_id?: string; }[];",
+ "commits?: { product_id: string; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; amount?: number; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; spend_tracker_attributes?: { counts_as_discounted: boolean; }; temporary_id?: string; }[];",
"credits?: { access_schedule: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[];",
'custom_fields?: object;',
"discounts?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[];",
@@ -3864,7 +3867,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
],
response: '{ data: { id: string; }; }',
markdown:
- "## amend\n\n`client.v1.contracts.amend(contract_id: string, customer_id: string, starting_at: string, commits?: { product_id: string; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: object[]; credit_type_id?: string; }; amount?: number; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: object; invoice_schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: object[]; temporary_id?: string; }[], credits?: { access_schedule: { schedule_items: object[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: object[]; }[], custom_fields?: object, discounts?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[], netsuite_sales_order_id?: string, overrides?: { starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: tier[]; }; priority?: number; product_id?: string; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[], professional_services?: { max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[], reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_options?: { aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; }; ending_before?: string; fraction?: number; gcp_options?: { gcp_account_id?: string; gcp_offer_id?: string; }; netsuite_reseller_id?: string; reseller_contract_value?: number; starting_at?: string; }[], salesforce_opportunity_id?: string, scheduled_charges?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[], total_contract_value?: number): { data: id; }`\n\n**post** `/v1/contracts/amend`\n\nAmendments will be replaced by Contract editing. New clients should implement using the `editContract` endpoint. Read more about the migration to contract editing [here](/guides/implement-metronome/migrate-amendments-to-edits/) and reach out to your Metronome representative for more details. Once contract editing is enabled, access to this endpoint will be removed.\n\n\n### Parameters\n\n- `contract_id: string`\n ID of the contract to amend\n\n- `customer_id: string`\n ID of the customer whose contract is to be amended\n\n- `starting_at: string`\n inclusive start time for the amendment\n\n- `commits?: { product_id: string; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; amount?: number; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; temporary_id?: string; }[]`\n\n- `credits?: { access_schedule: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]`\n\n- `custom_fields?: object`\n Custom fields to be added eg. { \"key1\": \"value1\", \"key2\": \"value2\" }\n\n- `discounts?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]`\n This field's availability is dependent on your client's configuration.\n\n- `netsuite_sales_order_id?: string`\n This field's availability is dependent on your client's configuration.\n\n- `overrides?: { starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: { price: number; size?: number; }[]; }; priority?: number; product_id?: string; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]`\n\n- `professional_services?: { max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[]`\n This field's availability is dependent on your client's configuration.\n\n- `reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_options?: { aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; }; ending_before?: string; fraction?: number; gcp_options?: { gcp_account_id?: string; gcp_offer_id?: string; }; netsuite_reseller_id?: string; reseller_contract_value?: number; starting_at?: string; }[]`\n This field's availability is dependent on your client's configuration.\n\n- `salesforce_opportunity_id?: string`\n This field's availability is dependent on your client's configuration.\n\n- `scheduled_charges?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]`\n\n- `total_contract_value?: number`\n This field's availability is dependent on your client's configuration.\n\n### Returns\n\n- `{ data: { id: string; }; }`\n\n - `data: { id: string; }`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst response = await client.v1.contracts.amend({\n contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',\n customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',\n starting_at: '2020-01-01T00:00:00.000Z',\n});\n\nconsole.log(response);\n```",
+ "## amend\n\n`client.v1.contracts.amend(contract_id: string, customer_id: string, starting_at: string, commits?: { product_id: string; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: object[]; credit_type_id?: string; }; amount?: number; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: object; invoice_schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: object[]; spend_tracker_attributes?: { counts_as_discounted: boolean; }; temporary_id?: string; }[], credits?: { access_schedule: { schedule_items: object[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: object[]; }[], custom_fields?: object, discounts?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[], netsuite_sales_order_id?: string, overrides?: { starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: tier[]; }; priority?: number; product_id?: string; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[], professional_services?: { max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[], reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_options?: { aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; }; ending_before?: string; fraction?: number; gcp_options?: { gcp_account_id?: string; gcp_offer_id?: string; }; netsuite_reseller_id?: string; reseller_contract_value?: number; starting_at?: string; }[], salesforce_opportunity_id?: string, scheduled_charges?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[], total_contract_value?: number): { data: id; }`\n\n**post** `/v1/contracts/amend`\n\nAmendments will be replaced by Contract editing. New clients should implement using the `editContract` endpoint. Read more about the migration to contract editing [here](/guides/implement-metronome/migrate-amendments-to-edits/) and reach out to your Metronome representative for more details. Once contract editing is enabled, access to this endpoint will be removed.\n\n\n### Parameters\n\n- `contract_id: string`\n ID of the contract to amend\n\n- `customer_id: string`\n ID of the customer whose contract is to be amended\n\n- `starting_at: string`\n inclusive start time for the amendment\n\n- `commits?: { product_id: string; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; amount?: number; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; spend_tracker_attributes?: { counts_as_discounted: boolean; }; temporary_id?: string; }[]`\n\n- `credits?: { access_schedule: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]`\n\n- `custom_fields?: object`\n Custom fields to be added eg. { \"key1\": \"value1\", \"key2\": \"value2\" }\n\n- `discounts?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]`\n This field's availability is dependent on your client's configuration.\n\n- `netsuite_sales_order_id?: string`\n This field's availability is dependent on your client's configuration.\n\n- `overrides?: { starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: { price: number; size?: number; }[]; }; priority?: number; product_id?: string; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]`\n\n- `professional_services?: { max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[]`\n This field's availability is dependent on your client's configuration.\n\n- `reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_options?: { aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; }; ending_before?: string; fraction?: number; gcp_options?: { gcp_account_id?: string; gcp_offer_id?: string; }; netsuite_reseller_id?: string; reseller_contract_value?: number; starting_at?: string; }[]`\n This field's availability is dependent on your client's configuration.\n\n- `salesforce_opportunity_id?: string`\n This field's availability is dependent on your client's configuration.\n\n- `scheduled_charges?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]`\n\n- `total_contract_value?: number`\n This field's availability is dependent on your client's configuration.\n\n### Returns\n\n- `{ data: { id: string; }; }`\n\n - `data: { id: string; }`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst response = await client.v1.contracts.amend({\n contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',\n customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',\n starting_at: '2020-01-01T00:00:00.000Z',\n});\n\nconsole.log(response);\n```",
perLanguage: {
typescript: {
method: 'client.v1.contracts.amend',
@@ -4173,7 +4176,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
],
response: 'object | object',
markdown:
- "## list_balances\n\n`client.v1.contracts.listBalances(customer_id: string, id?: string, covering_date?: string, effective_before?: string, exclude_zero_balances?: boolean, include_archived?: boolean, include_balance?: boolean, include_contract_balances?: boolean, include_ledgers?: boolean, limit?: number, next_page?: string, starting_at?: string): object | object`\n\n**post** `/v1/contracts/customerBalances/list`\n\nRetrieve a comprehensive view of all available balances (commits and credits) for a customer. This endpoint provides real-time visibility into prepaid funds, postpaid commitments, promotional credits, and other balance types that can offset usage charges, helping you build transparent billing experiences.\n\n### Use this endpoint to:\n- Display current available balances in customer dashboards\n- Verify available funds before approving high-usage operations\n- Generate balance reports for finance teams\n- Filter balances by contract or date ranges\n\n### Key response fields:\nAn array of balance objects (all credits and commits) containing:\n\n- Balance details: Current available amount for each commit or credit\n- Metadata: Product associations, priorities, applicable date ranges\n- Optional ledger entries: Detailed transaction history (if `include_ledgers=true`)\n- Balance calculations: Including pending transactions and future-dated entries\n- Custom fields: Any additional metadata attached to balances\n\n### Usage guidelines:\n- Use the [getNetBalance](https://docs.metronome.com/api-reference/credits-and-commits/get-the-net-balance-of-a-customer) endpoint to retrieve a single combined current balance\n- Date filtering: Use `effective_before` to include only balances with access before a specific date (exclusive)\n- Set `include_balance=true` for calculated balance amounts on each commit or credit\n- Set `include_ledgers=true` for full transaction history\n- Set `include_contract_balances = true` to see contract level balances\n- Balance logic: Reflects currently accessible amounts, excluding expired/future segments\n- Manual adjustments: Includes all manual ledger entries, even future-dated ones\n\n\n### Parameters\n\n- `customer_id: string`\n\n- `id?: string`\n\n- `covering_date?: string`\n Return only balances that have access schedules that \"cover\" the provided date\n\n- `effective_before?: string`\n Include only balances that have any access before the provided date (exclusive)\n\n- `exclude_zero_balances?: boolean`\n Exclude balances with zero amounts from the response.\n\n- `include_archived?: boolean`\n Include archived credits and credits from archived contracts.\n\n- `include_balance?: boolean`\n Include the balance of credits and commits in the response. Setting this flag may cause the query to be slower.\n\n- `include_contract_balances?: boolean`\n Include balances on the contract level.\n\n- `include_ledgers?: boolean`\n Include ledgers in the response. Setting this flag may cause the query to be slower.\n\n- `limit?: number`\n The maximum number of commits to return. Defaults to 25.\n\n- `next_page?: string`\n The next page token from a previous response.\n\n- `starting_at?: string`\n Include only balances that have any access on or after the provided date\n\n### Returns\n\n- `{ id: string; created_at: string; product: { id: string; name: string; }; type: 'PREPAID' | 'POSTPAID'; access_schedule?: object; amount?: number; applicable_contract_ids?: string[]; applicable_product_ids?: string[]; applicable_product_tags?: string[]; archived_at?: string; balance?: number; contract?: { id: string; }; custom_fields?: object; description?: string; hierarchy_configuration?: object; invoice_contract?: { id: string; }; invoice_schedule?: object; ledger?: { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_SEGMENT_START'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_ROLLOVER'; } | { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_EXPIRATION'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_CANCELED'; contract_id?: string; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_CREDITED'; contract_id?: string; } | { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT'; } | { amount: number; timestamp: string; type: 'POSTPAID_COMMIT_INITIAL_BALANCE'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'POSTPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'POSTPAID_COMMIT_ROLLOVER'; } | { amount: number; invoice_id: string; timestamp: string; type: 'POSTPAID_COMMIT_TRUEUP'; contract_id?: string; } | { amount: number; reason: string; timestamp: string; type: 'PREPAID_COMMIT_MANUAL'; } | { amount: number; reason: string; timestamp: string; type: 'POSTPAID_COMMIT_MANUAL'; } | { amount: number; timestamp: string; type: 'POSTPAID_COMMIT_EXPIRATION'; }[]; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurring_commit_id?: string; rolled_over_from?: { commit_id: string; contract_id: string; }; rollover_fraction?: number; salesforce_opportunity_id?: string; specifiers?: object[]; subscription_config?: { allocation?: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config?: object; subscription_id?: string; }; uniqueness_key?: string; } | { id: string; product: { id: string; name: string; }; type: 'CREDIT'; access_schedule?: object; applicable_contract_ids?: string[]; applicable_product_ids?: string[]; applicable_product_tags?: string[]; balance?: number; contract?: { id: string; }; custom_fields?: object; description?: string; hierarchy_configuration?: object; ledger?: { amount: number; segment_id: string; timestamp: string; type: 'CREDIT_SEGMENT_START'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'CREDIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; segment_id: string; timestamp: string; type: 'CREDIT_EXPIRATION'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'CREDIT_CANCELED'; contract_id?: string; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'CREDIT_CREDITED'; contract_id?: string; } | { amount: number; reason: string; timestamp: string; type: 'CREDIT_MANUAL'; } | { amount: number; segment_id: string; timestamp: string; type: 'CREDIT_SEAT_BASED_ADJUSTMENT'; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'CREDIT_ROLLOVER'; }[]; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurring_credit_id?: string; rolled_over_from?: { contract_id: string; credit_id: string; }; salesforce_opportunity_id?: string; specifiers?: object[]; subscription_config?: { allocation?: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config?: object; subscription_id?: string; }; uniqueness_key?: string; }`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\n// Automatically fetches more pages as needed.\nfor await (const contractListBalancesResponse of client.v1.contracts.listBalances({ customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d' })) {\n console.log(contractListBalancesResponse);\n}\n```",
+ "## list_balances\n\n`client.v1.contracts.listBalances(customer_id: string, id?: string, covering_date?: string, effective_before?: string, exclude_zero_balances?: boolean, include_archived?: boolean, include_balance?: boolean, include_contract_balances?: boolean, include_ledgers?: boolean, limit?: number, next_page?: string, starting_at?: string): object | object`\n\n**post** `/v1/contracts/customerBalances/list`\n\nRetrieve a comprehensive view of all available balances (commits and credits) for a customer. This endpoint provides real-time visibility into prepaid funds, postpaid commitments, promotional credits, and other balance types that can offset usage charges, helping you build transparent billing experiences.\n\n### Use this endpoint to:\n- Display current available balances in customer dashboards\n- Verify available funds before approving high-usage operations\n- Generate balance reports for finance teams\n- Filter balances by contract or date ranges\n\n### Key response fields:\nAn array of balance objects (all credits and commits) containing:\n\n- Balance details: Current available amount for each commit or credit\n- Metadata: Product associations, priorities, applicable date ranges\n- Optional ledger entries: Detailed transaction history (if `include_ledgers=true`)\n- Balance calculations: Including pending transactions and future-dated entries\n- Custom fields: Any additional metadata attached to balances\n\n### Usage guidelines:\n- Use the [getNetBalance](https://docs.metronome.com/api-reference/credits-and-commits/get-the-net-balance-of-a-customer) endpoint to retrieve a single combined current balance\n- Date filtering: Use `effective_before` to include only balances with access before a specific date (exclusive)\n- Set `include_balance=true` for calculated balance amounts on each commit or credit\n- Set `include_ledgers=true` for full transaction history\n- Set `include_contract_balances = true` to see contract level balances\n- Balance logic: Reflects currently accessible amounts, excluding expired/future segments\n- Manual adjustments: Includes all manual ledger entries, even future-dated ones\n\n\n### Parameters\n\n- `customer_id: string`\n\n- `id?: string`\n\n- `covering_date?: string`\n Return only balances that have access schedules that \"cover\" the provided date\n\n- `effective_before?: string`\n Include only balances that have any access before the provided date (exclusive)\n\n- `exclude_zero_balances?: boolean`\n Exclude balances with zero amounts from the response.\n\n- `include_archived?: boolean`\n Include archived credits and credits from archived contracts.\n\n- `include_balance?: boolean`\n Include the balance of credits and commits in the response. Setting this flag may cause the query to be slower.\n\n- `include_contract_balances?: boolean`\n Include balances on the contract level.\n\n- `include_ledgers?: boolean`\n Include ledgers in the response. Setting this flag may cause the query to be slower.\n\n- `limit?: number`\n The maximum number of commits to return. Defaults to 25.\n\n- `next_page?: string`\n The next page token from a previous response.\n\n- `starting_at?: string`\n Include only balances that have any access on or after the provided date\n\n### Returns\n\n- `{ id: string; created_at: string; product: { id: string; name: string; }; type: 'PREPAID' | 'POSTPAID'; access_schedule?: object; amount?: number; applicable_contract_ids?: string[]; applicable_product_ids?: string[]; applicable_product_tags?: string[]; archived_at?: string; balance?: number; contract?: { id: string; }; custom_fields?: object; description?: string; hierarchy_configuration?: object; invoice_contract?: { id: string; }; invoice_schedule?: object; ledger?: { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_SEGMENT_START'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_ROLLOVER'; } | { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_EXPIRATION'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_CANCELED'; contract_id?: string; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_CREDITED'; contract_id?: string; } | { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT'; } | { amount: number; timestamp: string; type: 'POSTPAID_COMMIT_INITIAL_BALANCE'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'POSTPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'POSTPAID_COMMIT_ROLLOVER'; } | { amount: number; invoice_id: string; timestamp: string; type: 'POSTPAID_COMMIT_TRUEUP'; contract_id?: string; } | { amount: number; reason: string; timestamp: string; type: 'PREPAID_COMMIT_MANUAL'; } | { amount: number; reason: string; timestamp: string; type: 'POSTPAID_COMMIT_MANUAL'; } | { amount: number; timestamp: string; type: 'POSTPAID_COMMIT_EXPIRATION'; }[]; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurring_commit_id?: string; rolled_over_from?: { commit_id: string; contract_id: string; }; rollover_fraction?: number; salesforce_opportunity_id?: string; specifiers?: object[]; spend_tracker_attributes?: { counts_as_discounted: boolean; }; subscription_config?: { allocation?: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config?: object; subscription_id?: string; }; uniqueness_key?: string; } | { id: string; product: { id: string; name: string; }; type: 'CREDIT'; access_schedule?: object; applicable_contract_ids?: string[]; applicable_product_ids?: string[]; applicable_product_tags?: string[]; balance?: number; contract?: { id: string; }; custom_fields?: object; description?: string; hierarchy_configuration?: object; ledger?: { amount: number; segment_id: string; timestamp: string; type: 'CREDIT_SEGMENT_START'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'CREDIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; segment_id: string; timestamp: string; type: 'CREDIT_EXPIRATION'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'CREDIT_CANCELED'; contract_id?: string; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'CREDIT_CREDITED'; contract_id?: string; } | { amount: number; reason: string; timestamp: string; type: 'CREDIT_MANUAL'; } | { amount: number; segment_id: string; timestamp: string; type: 'CREDIT_SEAT_BASED_ADJUSTMENT'; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'CREDIT_ROLLOVER'; }[]; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurring_credit_id?: string; rolled_over_from?: { contract_id: string; credit_id: string; }; salesforce_opportunity_id?: string; specifiers?: object[]; subscription_config?: { allocation?: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config?: object; subscription_id?: string; }; uniqueness_key?: string; }`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\n// Automatically fetches more pages as needed.\nfor await (const contractListBalancesResponse of client.v1.contracts.listBalances({ customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d' })) {\n console.log(contractListBalancesResponse);\n}\n```",
perLanguage: {
typescript: {
method: 'client.v1.contracts.listBalances',
@@ -5485,21 +5488,22 @@ const EMBEDDED_METHODS: MethodEntry[] = [
"multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT';",
'net_payment_terms_days?: number;',
"overrides?: { override_specifiers: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: { price: number; size?: number; }[]; }; priority?: number; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[];",
- "prepaid_balance_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; }; };",
+ "prepaid_balance_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; };",
'rate_card_alias?: string;',
'rate_card_id?: string;',
"recurring_commits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[];",
"recurring_credits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[];",
"scheduled_charges?: { product_id: string; schedule: { schedule_items: { date_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; quantity: number; unit_price: number; }[]; credit_type_id?: string; }; custom_fields?: object; name?: string; }[];",
"scheduled_charges_on_usage_invoices?: 'ALL';",
- "spend_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount: number; discount_configuration?: { payment_fraction: number; }; };",
+ "spend_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount: number; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; };",
+ "spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[];",
"subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated?: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product_id: string; }; custom_fields?: object; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { seat_group_key: string; initial_unassigned_seats?: number; }; starting_at_offset?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; temporary_id?: string; }[];",
'uniqueness_key?: string;',
"usage_statement_schedule?: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START'; invoice_generation_starting_at_offset?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; };",
],
response: '{ data: { id: string; }; }',
markdown:
- "## create\n\n`client.v1.packages.create(name: string, aliases?: { name: string; ending_before?: string; starting_at?: string; }[], billing_provider?: 'aws_marketplace' | 'azure_marketplace' | 'gcp_marketplace' | 'stripe' | 'netsuite', commits?: { access_schedule: { schedule_items: object[]; credit_type_id?: string; }; product_id: string; type: 'PREPAID' | 'POSTPAID'; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; invoice_schedule?: { schedule_items: object[]; credit_type_id?: string; do_not_invoice?: boolean; }; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: object[]; temporary_id?: string; }[], contract_name?: string, credits?: { access_schedule: { schedule_items: object[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; specifiers?: object[]; }[], delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns', duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }, multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT', net_payment_terms_days?: number, overrides?: { override_specifiers: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: tier[]; }; priority?: number; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[], prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; }, rate_card_alias?: string, rate_card_id?: string, recurring_commits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { apply_seat_increase_config: object; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[], recurring_credits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { apply_seat_increase_config: object; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[], scheduled_charges?: { product_id: string; schedule: { schedule_items: object[]; credit_type_id?: string; }; custom_fields?: object; name?: string; }[], scheduled_charges_on_usage_invoices?: 'ALL', spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; threshold_amount: number; discount_configuration?: object; }, subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated?: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product_id: string; }; custom_fields?: object; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { seat_group_key: string; initial_unassigned_seats?: number; }; starting_at_offset?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; temporary_id?: string; }[], uniqueness_key?: string, usage_statement_schedule?: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START'; invoice_generation_starting_at_offset?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; }): { data: id; }`\n\n**post** `/v1/packages/create`\n\nCreate a package that defines a set of reusable, time-relative contract terms that can be used across cohorts of customers. Packages provide an abstraction layer on top of rate cards to provide an easy way to provision customers with standard pricing. \n\n### **Use this endpoint to:**\n- Model standard pay-as-you-go pricing packages that can be easily reused across customers\n- Define standardized contract terms and discounting for sales-led motions\n- Set aliases for the package to facilitate easy package transition. Aliases are human-readable names that you can use in the place of the id of the package when provisioning a customer’s contract. By using an alias, you can easily create a contract and provision a customer by choosing the “Starter Plan” package, without storing the package ID in your internal systems. This is helpful when launching terms for a package, as you can create a new package with the “Starter Plan” alias scheduled to be assigned without updating your provisioning code.\n\n### Key input fields:\n- `starting_at_offset`: Starting date relative to contract start. Generates the `starting_at` date when a contract is provisioned using a package.\n- `duration`: Duration starting from `starting_at_offset`. Generates the `ending_before` date when a contract is provisioned using a package.\n- `date_offset`: Date relative to contract start. Used for point-in-time dates without a duration.\n- `aliases`: Human-readable name to use when provisioning contracts with a package.\n\n### Usage guidelines:\n- Use packages for standard self-serve use cases where customers have consistent terms. For customers with negotiated custom contract terms, use the `createContract` endpoint for maximum flexibility.\n- Billing provider configuration can be set when creating a package by using `billing_provider` and `delivery_method`. To provision a customer successfully with a package, the customer must have one and only one billing provider configuration that matches the billing provider configuration set on the package.\n- A package alias can only be used by one package at a time. If you create a new package with an alias that is already in use by another package, the original package’s alias schedule will be updated. The alias will reference the package to which it was most recently assigned.\n- Terms can only be specified using times relative to the contract start date. Supported granularities are: `days`, `weeks`, `months`, `years`\n- Packages cannot be edited once created. Use the rate card to easily add new rates across all of your customers or make direct edits to a contract after provisioning with a package. Edited contracts will still be associated with the package used during provisioning.\n\n\n### Parameters\n\n- `name: string`\n\n- `aliases?: { name: string; ending_before?: string; starting_at?: string; }[]`\n Reference this alias when creating a contract. If the same alias is assigned to multiple packages, it will reference the package to which it was most recently assigned. It is not exposed to end customers.\n\n- `billing_provider?: 'aws_marketplace' | 'azure_marketplace' | 'gcp_marketplace' | 'stripe' | 'netsuite'`\n\n- `commits?: { access_schedule: { schedule_items: { amount: number; duration: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; }[]; credit_type_id?: string; }; product_id: string; type: 'PREPAID' | 'POSTPAID'; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; invoice_schedule?: { schedule_items: { date_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; quantity: number; unit_price: number; }[]; credit_type_id?: string; do_not_invoice?: boolean; }; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; temporary_id?: string; }[]`\n\n- `contract_name?: string`\n\n- `credits?: { access_schedule: { schedule_items: { amount: number; duration: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; }[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]`\n\n- `delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'`\n\n- `duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }`\n - `unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'`\n - `value: number`\n\n- `multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'`\n Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list prices automatically. EXPLICIT prioritization requires specifying priorities for each multiplier; the one with the lowest priority value will be prioritized first. If tiered overrides are used, prioritization must be explicit.\n\n- `net_payment_terms_days?: number`\n\n- `overrides?: { override_specifiers: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: { price: number; size?: number; }[]; }; priority?: number; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]`\n\n- `prepaid_balance_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; }; }`\n - `commit: { product_id: string; description?: string; name?: string; priority?: number; }`\n - `is_enabled: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `recharge_to_amount: number`\n Specify the amount the balance should be recharged to.\n - `threshold_amount: number`\n Specify the threshold amount for the contract. Each time the contract's prepaid balance lowers to this amount, a threshold charge will be initiated.\n - `custom_credit_type_id?: string`\n If provided, the threshold, recharge-to amount, and the resulting threshold commit amount will be in terms of this credit type instead of the fiat currency.\n - `discount_configuration?: { payment_fraction: number; }`\n\n- `rate_card_alias?: string`\n Selects the rate card linked to the specified alias as of the contract's start date.\n\n- `rate_card_id?: string`\n\n- `recurring_commits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[]`\n\n- `recurring_credits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[]`\n\n- `scheduled_charges?: { product_id: string; schedule: { schedule_items: { date_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; quantity: number; unit_price: number; }[]; credit_type_id?: string; }; custom_fields?: object; name?: string; }[]`\n\n- `scheduled_charges_on_usage_invoices?: 'ALL'`\n Determines which scheduled and commit charges to consolidate onto the Contract's usage invoice. The charge's `timestamp` must match the usage invoice's `ending_before` date for consolidation to occur. This field cannot be modified after a Contract has been created. If this field is omitted, charges will appear on a separate invoice from usage charges.\n\n- `spend_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount: number; discount_configuration?: { payment_fraction: number; }; }`\n - `commit: { product_id: string; description?: string; name?: string; priority?: number; }`\n - `is_enabled: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `threshold_amount: number`\n Specify the threshold amount for the contract. Each time the contract's usage hits this amount, a threshold charge will be initiated.\n - `discount_configuration?: { payment_fraction: number; }`\n\n- `subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated?: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product_id: string; }; custom_fields?: object; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { seat_group_key: string; initial_unassigned_seats?: number; }; starting_at_offset?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; temporary_id?: string; }[]`\n\n- `uniqueness_key?: string`\n Prevents the creation of duplicates. If a request to create a record is made with a previously used uniqueness key, a new record will not be created and the request will fail with a 409 error.\n\n- `usage_statement_schedule?: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START'; invoice_generation_starting_at_offset?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; }`\n - `frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'`\n - `day?: 'FIRST_OF_MONTH' | 'CONTRACT_START'`\n If not provided, defaults to the first day of the month.\n - `invoice_generation_starting_at_offset?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }`\n The offset at which Metronome should start generating usage invoices, relative to the contract start date. If unspecified, contract start date will be used. This is useful to set if you want to import historical invoices via our 'Create Historical Invoices' API rather than having Metronome automatically generate them.\n\n### Returns\n\n- `{ data: { id: string; }; }`\n\n - `data: { id: string; }`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst _package = await client.v1.packages.create({ name: 'My package' });\n\nconsole.log(_package);\n```",
+ "## create\n\n`client.v1.packages.create(name: string, aliases?: { name: string; ending_before?: string; starting_at?: string; }[], billing_provider?: 'aws_marketplace' | 'azure_marketplace' | 'gcp_marketplace' | 'stripe' | 'netsuite', commits?: { access_schedule: { schedule_items: object[]; credit_type_id?: string; }; product_id: string; type: 'PREPAID' | 'POSTPAID'; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; invoice_schedule?: { schedule_items: object[]; credit_type_id?: string; do_not_invoice?: boolean; }; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: object[]; temporary_id?: string; }[], contract_name?: string, credits?: { access_schedule: { schedule_items: object[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; specifiers?: object[]; }[], delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns', duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }, multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT', net_payment_terms_days?: number, overrides?: { override_specifiers: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: tier[]; }; priority?: number; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[], prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; }, rate_card_alias?: string, rate_card_id?: string, recurring_commits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { apply_seat_increase_config: object; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[], recurring_credits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { apply_seat_increase_config: object; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[], scheduled_charges?: { product_id: string; schedule: { schedule_items: object[]; credit_type_id?: string; }; custom_fields?: object; name?: string; }[], scheduled_charges_on_usage_invoices?: 'ALL', spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; threshold_amount: number; discount_configuration?: object; }, spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[], subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated?: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product_id: string; }; custom_fields?: object; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { seat_group_key: string; initial_unassigned_seats?: number; }; starting_at_offset?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; temporary_id?: string; }[], uniqueness_key?: string, usage_statement_schedule?: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START'; invoice_generation_starting_at_offset?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; }): { data: id; }`\n\n**post** `/v1/packages/create`\n\nCreate a package that defines a set of reusable, time-relative contract terms that can be used across cohorts of customers. Packages provide an abstraction layer on top of rate cards to provide an easy way to provision customers with standard pricing. \n\n### **Use this endpoint to:**\n- Model standard pay-as-you-go pricing packages that can be easily reused across customers\n- Define standardized contract terms and discounting for sales-led motions\n- Set aliases for the package to facilitate easy package transition. Aliases are human-readable names that you can use in the place of the id of the package when provisioning a customer’s contract. By using an alias, you can easily create a contract and provision a customer by choosing the “Starter Plan” package, without storing the package ID in your internal systems. This is helpful when launching terms for a package, as you can create a new package with the “Starter Plan” alias scheduled to be assigned without updating your provisioning code.\n\n### Key input fields:\n- `starting_at_offset`: Starting date relative to contract start. Generates the `starting_at` date when a contract is provisioned using a package.\n- `duration`: Duration starting from `starting_at_offset`. Generates the `ending_before` date when a contract is provisioned using a package.\n- `date_offset`: Date relative to contract start. Used for point-in-time dates without a duration.\n- `aliases`: Human-readable name to use when provisioning contracts with a package.\n\n### Usage guidelines:\n- Use packages for standard self-serve use cases where customers have consistent terms. For customers with negotiated custom contract terms, use the `createContract` endpoint for maximum flexibility.\n- Billing provider configuration can be set when creating a package by using `billing_provider` and `delivery_method`. To provision a customer successfully with a package, the customer must have one and only one billing provider configuration that matches the billing provider configuration set on the package.\n- A package alias can only be used by one package at a time. If you create a new package with an alias that is already in use by another package, the original package’s alias schedule will be updated. The alias will reference the package to which it was most recently assigned.\n- Terms can only be specified using times relative to the contract start date. Supported granularities are: `days`, `weeks`, `months`, `years`\n- Packages cannot be edited once created. Use the rate card to easily add new rates across all of your customers or make direct edits to a contract after provisioning with a package. Edited contracts will still be associated with the package used during provisioning.\n\n\n### Parameters\n\n- `name: string`\n\n- `aliases?: { name: string; ending_before?: string; starting_at?: string; }[]`\n Reference this alias when creating a contract. If the same alias is assigned to multiple packages, it will reference the package to which it was most recently assigned. It is not exposed to end customers.\n\n- `billing_provider?: 'aws_marketplace' | 'azure_marketplace' | 'gcp_marketplace' | 'stripe' | 'netsuite'`\n\n- `commits?: { access_schedule: { schedule_items: { amount: number; duration: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; }[]; credit_type_id?: string; }; product_id: string; type: 'PREPAID' | 'POSTPAID'; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; invoice_schedule?: { schedule_items: { date_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; quantity: number; unit_price: number; }[]; credit_type_id?: string; do_not_invoice?: boolean; }; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; temporary_id?: string; }[]`\n\n- `contract_name?: string`\n\n- `credits?: { access_schedule: { schedule_items: { amount: number; duration: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; }[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]`\n\n- `delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'`\n\n- `duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }`\n - `unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'`\n - `value: number`\n\n- `multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'`\n Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list prices automatically. EXPLICIT prioritization requires specifying priorities for each multiplier; the one with the lowest priority value will be prioritized first. If tiered overrides are used, prioritization must be explicit.\n\n- `net_payment_terms_days?: number`\n\n- `overrides?: { override_specifiers: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: { price: number; size?: number; }[]; }; priority?: number; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]`\n\n- `prepaid_balance_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; }`\n - `commit: { product_id: string; description?: string; name?: string; priority?: number; }`\n - `is_enabled: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `recharge_to_amount: number`\n Specify the amount the balance should be recharged to.\n - `threshold_amount: number`\n Specify the threshold amount for the contract. Each time the contract's prepaid balance lowers to this amount, a threshold charge will be initiated.\n - `custom_credit_type_id?: string`\n If provided, the threshold, recharge-to amount, and the resulting threshold commit amount will be in terms of this credit type instead of the fiat currency.\n - `discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }`\n\n- `rate_card_alias?: string`\n Selects the rate card linked to the specified alias as of the contract's start date.\n\n- `rate_card_id?: string`\n\n- `recurring_commits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[]`\n\n- `recurring_credits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[]`\n\n- `scheduled_charges?: { product_id: string; schedule: { schedule_items: { date_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; quantity: number; unit_price: number; }[]; credit_type_id?: string; }; custom_fields?: object; name?: string; }[]`\n\n- `scheduled_charges_on_usage_invoices?: 'ALL'`\n Determines which scheduled and commit charges to consolidate onto the Contract's usage invoice. The charge's `timestamp` must match the usage invoice's `ending_before` date for consolidation to occur. This field cannot be modified after a Contract has been created. If this field is omitted, charges will appear on a separate invoice from usage charges.\n\n- `spend_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount: number; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; }`\n - `commit: { product_id: string; description?: string; name?: string; priority?: number; }`\n - `is_enabled: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `threshold_amount: number`\n Specify the threshold amount for the contract. Each time the contract's usage hits this amount, a threshold charge will be initiated.\n - `discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }`\n\n- `spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[]`\n\n- `subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated?: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product_id: string; }; custom_fields?: object; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { seat_group_key: string; initial_unassigned_seats?: number; }; starting_at_offset?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; temporary_id?: string; }[]`\n\n- `uniqueness_key?: string`\n Prevents the creation of duplicates. If a request to create a record is made with a previously used uniqueness key, a new record will not be created and the request will fail with a 409 error.\n\n- `usage_statement_schedule?: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START'; invoice_generation_starting_at_offset?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; }`\n - `frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'`\n - `day?: 'FIRST_OF_MONTH' | 'CONTRACT_START'`\n If not provided, defaults to the first day of the month.\n - `invoice_generation_starting_at_offset?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }`\n The offset at which Metronome should start generating usage invoices, relative to the contract start date. If unspecified, contract start date will be used. This is useful to set if you want to import historical invoices via our 'Create Historical Invoices' API rather than having Metronome automatically generate them.\n\n### Returns\n\n- `{ data: { id: string; }; }`\n\n - `data: { id: string; }`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst _package = await client.v1.packages.create({ name: 'My package' });\n\nconsole.log(_package);\n```",
perLanguage: {
typescript: {
method: 'client.v1.packages.create',
@@ -5543,9 +5547,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [
qualified: 'client.v1.packages.retrieve',
params: ['package_id: string;'],
response:
- "{ data: { id: string; commits: object[]; created_at: string; created_by: string; overrides: object[]; scheduled_charges: object[]; usage_statement_schedule: object; aliases?: object[]; archived_at?: string; billing_provider?: string; contract_name?: string; credits?: object[]; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; duration?: object; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; subscriptions?: object[]; uniqueness_key?: string; }; }",
+ "{ data: { id: string; commits: object[]; created_at: string; created_by: string; overrides: object[]; scheduled_charges: object[]; usage_statement_schedule: object; aliases?: object[]; archived_at?: string; billing_provider?: string; contract_name?: string; credits?: object[]; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; duration?: object; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; spend_trackers?: object[]; subscriptions?: object[]; uniqueness_key?: string; }; }",
markdown:
- "## retrieve\n\n`client.v1.packages.retrieve(package_id: string): { data: object; }`\n\n**post** `/v1/packages/get`\n\nGets the details for a specific package, including name, aliases, duration, and terms. Use this endpoint to understand a package’s alias schedule, or display a specific package’s details to end customers.\n\n\n### Parameters\n\n- `package_id: string`\n\n### Returns\n\n- `{ data: { id: string; commits: { id: string; product: object; type: 'PREPAID' | 'POSTPAID'; access_schedule?: object; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; invoice_schedule?: object; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: commit_specifier[]; }[]; created_at: string; created_by: string; overrides: { id: string; override_specifiers: object[]; starting_at_offset: object; applicable_product_tags?: string[]; duration?: object; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_tiers?: override_tier[]; overwrite_rate?: overwrite_rate; priority?: number; product?: object; target?: 'COMMIT_RATE' | 'LIST_RATE'; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]; scheduled_charges: { id: string; product: object; schedule: object; custom_fields?: object; description?: string; name?: string; }[]; usage_statement_schedule: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START'; }; aliases?: { name: string; ending_before?: string; starting_at?: string; }[]; archived_at?: string; billing_provider?: string; contract_name?: string; credits?: { id: string; product: object; access_schedule?: object; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; specifiers?: commit_specifier[]; }[]; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; prepaid_balance_threshold_configuration?: object; rate_card_id?: string; recurring_commits?: { id: string; access_amount: object; commit_duration: object; priority: number; product: object; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at_offset: object; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: object; invoice_amount?: object; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: commit_specifier[]; subscription_config?: object; }[]; recurring_credits?: { id: string; access_amount: object; commit_duration: object; priority: number; product: object; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at_offset: object; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: object; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: commit_specifier[]; subscription_config?: object; }[]; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: object; subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: object; subscription_rate: object; id?: string; custom_fields?: object; description?: string; duration?: object; fiat_credit_type_id?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: object; starting_at_offset?: object; }[]; uniqueness_key?: string; }; }`\n\n - `data: { id: string; commits: { id: string; product: { id: string; name: string; }; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { credit_type: object; schedule_items: { id: string; amount: number; duration: object; starting_at_offset: object; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; invoice_schedule?: { credit_type: object; do_not_invoice: boolean; schedule_items: { id: string; date_offset: object; quantity: number; unit_price: number; }[]; }; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]; created_at: string; created_by: string; overrides: { id: string; override_specifiers: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_template_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_template_ids?: string[]; }[]; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_tags?: string[]; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_tiers?: { multiplier: number; size?: number; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type?: credit_type_data; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: tier[]; }; priority?: number; product?: { id: string; name: string; }; target?: 'COMMIT_RATE' | 'LIST_RATE'; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]; scheduled_charges: { id: string; product: { id: string; name: string; }; schedule: { credit_type: object; schedule_items: { id: string; date_offset: object; quantity: number; unit_price: number; }[]; }; custom_fields?: object; description?: string; name?: string; }[]; usage_statement_schedule: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START'; }; aliases?: { name: string; ending_before?: string; starting_at?: string; }[]; archived_at?: string; billing_provider?: string; contract_name?: string; credits?: { id: string; product: { id: string; name: string; }; access_schedule?: { credit_type: object; schedule_items: { id: string; amount: number; duration: object; starting_at_offset: object; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; prepaid_balance_threshold_configuration?: { commit: object; is_enabled: boolean; payment_gate_config: object; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; }; }; rate_card_id?: string; recurring_commits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { allocation: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config: { is_prorated: boolean; }; subscription_template_id: string; }; }[]; recurring_credits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { allocation: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config: { is_prorated: boolean; }; subscription_template_id: string; }; }[]; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: { commit: object; is_enabled: boolean; payment_gate_config: object; threshold_amount: number; discount_configuration?: { payment_fraction: number; }; }; subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product: { id: string; name: string; }; }; id?: string; custom_fields?: object; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; fiat_credit_type_id?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { seat_group_key: string; }; starting_at_offset?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; }[]; uniqueness_key?: string; }`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst _package = await client.v1.packages.retrieve({ package_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc' });\n\nconsole.log(_package);\n```",
+ "## retrieve\n\n`client.v1.packages.retrieve(package_id: string): { data: object; }`\n\n**post** `/v1/packages/get`\n\nGets the details for a specific package, including name, aliases, duration, and terms. Use this endpoint to understand a package’s alias schedule, or display a specific package’s details to end customers.\n\n\n### Parameters\n\n- `package_id: string`\n\n### Returns\n\n- `{ data: { id: string; commits: { id: string; product: object; type: 'PREPAID' | 'POSTPAID'; access_schedule?: object; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; invoice_schedule?: object; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: commit_specifier[]; }[]; created_at: string; created_by: string; overrides: { id: string; override_specifiers: object[]; starting_at_offset: object; applicable_product_tags?: string[]; duration?: object; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_tiers?: override_tier[]; overwrite_rate?: overwrite_rate; priority?: number; product?: object; target?: 'COMMIT_RATE' | 'LIST_RATE'; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]; scheduled_charges: { id: string; product: object; schedule: object; custom_fields?: object; description?: string; name?: string; }[]; usage_statement_schedule: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START'; }; aliases?: { name: string; ending_before?: string; starting_at?: string; }[]; archived_at?: string; billing_provider?: string; contract_name?: string; credits?: { id: string; product: object; access_schedule?: object; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; specifiers?: commit_specifier[]; }[]; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; prepaid_balance_threshold_configuration?: object; rate_card_id?: string; recurring_commits?: { id: string; access_amount: object; commit_duration: object; priority: number; product: object; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at_offset: object; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: object; invoice_amount?: object; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: commit_specifier[]; subscription_config?: object; }[]; recurring_credits?: { id: string; access_amount: object; commit_duration: object; priority: number; product: object; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at_offset: object; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: object; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: commit_specifier[]; subscription_config?: object; }[]; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: object; spend_trackers?: { alias: string; applicable_spend_specifiers: object[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[]; subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: object; subscription_rate: object; id?: string; custom_fields?: object; description?: string; duration?: object; fiat_credit_type_id?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: object; starting_at_offset?: object; }[]; uniqueness_key?: string; }; }`\n\n - `data: { id: string; commits: { id: string; product: { id: string; name: string; }; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { credit_type: object; schedule_items: { id: string; amount: number; duration: object; starting_at_offset: object; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; invoice_schedule?: { credit_type: object; do_not_invoice: boolean; schedule_items: { id: string; date_offset: object; quantity: number; unit_price: number; }[]; }; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]; created_at: string; created_by: string; overrides: { id: string; override_specifiers: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_template_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_template_ids?: string[]; }[]; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_tags?: string[]; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_tiers?: { multiplier: number; size?: number; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type?: credit_type_data; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: tier[]; }; priority?: number; product?: { id: string; name: string; }; target?: 'COMMIT_RATE' | 'LIST_RATE'; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]; scheduled_charges: { id: string; product: { id: string; name: string; }; schedule: { credit_type: object; schedule_items: { id: string; date_offset: object; quantity: number; unit_price: number; }[]; }; custom_fields?: object; description?: string; name?: string; }[]; usage_statement_schedule: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START'; }; aliases?: { name: string; ending_before?: string; starting_at?: string; }[]; archived_at?: string; billing_provider?: string; contract_name?: string; credits?: { id: string; product: { id: string; name: string; }; access_schedule?: { credit_type: object; schedule_items: { id: string; amount: number; duration: object; starting_at_offset: object; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; prepaid_balance_threshold_configuration?: { commit: object; is_enabled: boolean; payment_gate_config: object; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; cap?: object; }; }; rate_card_id?: string; recurring_commits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { allocation: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config: { is_prorated: boolean; }; subscription_template_id: string; }; }[]; recurring_credits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { allocation: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config: { is_prorated: boolean; }; subscription_template_id: string; }; }[]; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: { commit: object; is_enabled: boolean; payment_gate_config: object; threshold_amount: number; discount_configuration?: { payment_fraction: number; cap?: object; }; }; spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[]; subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product: { id: string; name: string; }; }; id?: string; custom_fields?: object; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; fiat_credit_type_id?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { seat_group_key: string; }; starting_at_offset?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; }[]; uniqueness_key?: string; }`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst _package = await client.v1.packages.retrieve({ package_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc' });\n\nconsole.log(_package);\n```",
perLanguage: {
typescript: {
method: 'client.v1.packages.retrieve',
@@ -5593,9 +5597,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [
"archive_filter?: 'ARCHIVED' | 'NOT_ARCHIVED' | 'ALL';",
],
response:
- "{ id: string; commits: object[]; created_at: string; created_by: string; overrides: object[]; scheduled_charges: object[]; usage_statement_schedule: object; aliases?: object[]; archived_at?: string; billing_provider?: string; contract_name?: string; credits?: object[]; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; duration?: object; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; subscriptions?: object[]; uniqueness_key?: string; }",
+ "{ id: string; commits: object[]; created_at: string; created_by: string; overrides: object[]; scheduled_charges: object[]; usage_statement_schedule: object; aliases?: object[]; archived_at?: string; billing_provider?: string; contract_name?: string; credits?: object[]; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; duration?: object; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; spend_trackers?: object[]; subscriptions?: object[]; uniqueness_key?: string; }",
markdown:
- "## list\n\n`client.v1.packages.list(limit?: number, next_page?: string, archive_filter?: 'ARCHIVED' | 'NOT_ARCHIVED' | 'ALL'): { id: string; commits: object[]; created_at: string; created_by: string; overrides: object[]; scheduled_charges: object[]; usage_statement_schedule: object; aliases?: object[]; archived_at?: string; billing_provider?: string; contract_name?: string; credits?: object[]; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; duration?: object; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; subscriptions?: object[]; uniqueness_key?: string; }`\n\n**post** `/v1/packages/list`\n\nLists all packages with details including name, aliases, duration, and terms. To view contracts on a specific package, use the `listContractsOnPackage` endpoint.\n\n\n### Parameters\n\n- `limit?: number`\n The maximum number of packages to return. Defaults to 10.\n\n- `next_page?: string`\n Cursor that indicates where the next page of results should start.\n\n- `archive_filter?: 'ARCHIVED' | 'NOT_ARCHIVED' | 'ALL'`\n Filter packages by archived status. Defaults to NOT_ARCHIVED.\n\n### Returns\n\n- `{ id: string; commits: { id: string; product: { id: string; name: string; }; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { credit_type: credit_type_data; schedule_items: object[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; invoice_schedule?: { credit_type: credit_type_data; do_not_invoice: boolean; schedule_items: object[]; }; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: object[]; }[]; created_at: string; created_by: string; overrides: { id: string; override_specifiers: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_template_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_template_ids?: string[]; }[]; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_tags?: string[]; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_tiers?: object[]; overwrite_rate?: object; priority?: number; product?: { id: string; name: string; }; target?: 'COMMIT_RATE' | 'LIST_RATE'; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]; scheduled_charges: { id: string; product: { id: string; name: string; }; schedule: { credit_type: credit_type_data; schedule_items: object[]; }; custom_fields?: object; description?: string; name?: string; }[]; usage_statement_schedule: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START'; }; aliases?: { name: string; ending_before?: string; starting_at?: string; }[]; archived_at?: string; billing_provider?: string; contract_name?: string; credits?: { id: string; product: { id: string; name: string; }; access_schedule?: { credit_type: credit_type_data; schedule_items: object[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; specifiers?: object[]; }[]; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; }; rate_card_id?: string; recurring_commits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { allocation: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config: object; subscription_template_id: string; }; }[]; recurring_credits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { allocation: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config: object; subscription_template_id: string; }; }[]; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; threshold_amount: number; discount_configuration?: object; }; subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product: object; }; id?: string; custom_fields?: object; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; fiat_credit_type_id?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { seat_group_key: string; }; starting_at_offset?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; }[]; uniqueness_key?: string; }`\n\n - `id: string`\n - `commits: { id: string; product: { id: string; name: string; }; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { credit_type: { id: string; name: string; }; schedule_items: { id: string; amount: number; duration: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; invoice_schedule?: { credit_type: { id: string; name: string; }; do_not_invoice: boolean; schedule_items: { id: string; date_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; quantity: number; unit_price: number; }[]; }; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]`\n - `created_at: string`\n - `created_by: string`\n - `overrides: { id: string; override_specifiers: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_template_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_template_ids?: string[]; }[]; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_tags?: string[]; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_tiers?: { multiplier: number; size?: number; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type?: object; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: object[]; }; priority?: number; product?: { id: string; name: string; }; target?: 'COMMIT_RATE' | 'LIST_RATE'; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]`\n - `scheduled_charges: { id: string; product: { id: string; name: string; }; schedule: { credit_type: { id: string; name: string; }; schedule_items: { id: string; date_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; quantity: number; unit_price: number; }[]; }; custom_fields?: object; description?: string; name?: string; }[]`\n - `usage_statement_schedule: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START'; }`\n - `aliases?: { name: string; ending_before?: string; starting_at?: string; }[]`\n - `archived_at?: string`\n - `billing_provider?: string`\n - `contract_name?: string`\n - `credits?: { id: string; product: { id: string; name: string; }; access_schedule?: { credit_type: { id: string; name: string; }; schedule_items: { id: string; amount: number; duration: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]`\n - `delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'`\n - `duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }`\n - `multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'`\n - `name?: string`\n - `net_payment_terms_days?: number`\n - `prepaid_balance_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; }; }`\n - `rate_card_id?: string`\n - `recurring_commits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { allocation: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config: { is_prorated: boolean; }; subscription_template_id: string; }; }[]`\n - `recurring_credits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { allocation: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config: { is_prorated: boolean; }; subscription_template_id: string; }; }[]`\n - `scheduled_charges_on_usage_invoices?: 'ALL'`\n - `spend_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount: number; discount_configuration?: { payment_fraction: number; }; }`\n - `subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product: { id: string; name: string; }; }; id?: string; custom_fields?: object; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; fiat_credit_type_id?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { seat_group_key: string; }; starting_at_offset?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; }[]`\n - `uniqueness_key?: string`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\n// Automatically fetches more pages as needed.\nfor await (const packageListResponse of client.v1.packages.list()) {\n console.log(packageListResponse);\n}\n```",
+ "## list\n\n`client.v1.packages.list(limit?: number, next_page?: string, archive_filter?: 'ARCHIVED' | 'NOT_ARCHIVED' | 'ALL'): { id: string; commits: object[]; created_at: string; created_by: string; overrides: object[]; scheduled_charges: object[]; usage_statement_schedule: object; aliases?: object[]; archived_at?: string; billing_provider?: string; contract_name?: string; credits?: object[]; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; duration?: object; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; spend_trackers?: object[]; subscriptions?: object[]; uniqueness_key?: string; }`\n\n**post** `/v1/packages/list`\n\nLists all packages with details including name, aliases, duration, and terms. To view contracts on a specific package, use the `listContractsOnPackage` endpoint.\n\n\n### Parameters\n\n- `limit?: number`\n The maximum number of packages to return. Defaults to 10.\n\n- `next_page?: string`\n Cursor that indicates where the next page of results should start.\n\n- `archive_filter?: 'ARCHIVED' | 'NOT_ARCHIVED' | 'ALL'`\n Filter packages by archived status. Defaults to NOT_ARCHIVED.\n\n### Returns\n\n- `{ id: string; commits: { id: string; product: { id: string; name: string; }; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { credit_type: credit_type_data; schedule_items: object[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; invoice_schedule?: { credit_type: credit_type_data; do_not_invoice: boolean; schedule_items: object[]; }; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: object[]; }[]; created_at: string; created_by: string; overrides: { id: string; override_specifiers: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_template_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_template_ids?: string[]; }[]; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_tags?: string[]; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_tiers?: object[]; overwrite_rate?: object; priority?: number; product?: { id: string; name: string; }; target?: 'COMMIT_RATE' | 'LIST_RATE'; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]; scheduled_charges: { id: string; product: { id: string; name: string; }; schedule: { credit_type: credit_type_data; schedule_items: object[]; }; custom_fields?: object; description?: string; name?: string; }[]; usage_statement_schedule: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START'; }; aliases?: { name: string; ending_before?: string; starting_at?: string; }[]; archived_at?: string; billing_provider?: string; contract_name?: string; credits?: { id: string; product: { id: string; name: string; }; access_schedule?: { credit_type: credit_type_data; schedule_items: object[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; specifiers?: object[]; }[]; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; }; rate_card_id?: string; recurring_commits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { allocation: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config: object; subscription_template_id: string; }; }[]; recurring_credits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { allocation: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config: object; subscription_template_id: string; }; }[]; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; threshold_amount: number; discount_configuration?: object; }; spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[]; subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product: object; }; id?: string; custom_fields?: object; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; fiat_credit_type_id?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { seat_group_key: string; }; starting_at_offset?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; }[]; uniqueness_key?: string; }`\n\n - `id: string`\n - `commits: { id: string; product: { id: string; name: string; }; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { credit_type: { id: string; name: string; }; schedule_items: { id: string; amount: number; duration: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; invoice_schedule?: { credit_type: { id: string; name: string; }; do_not_invoice: boolean; schedule_items: { id: string; date_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; quantity: number; unit_price: number; }[]; }; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]`\n - `created_at: string`\n - `created_by: string`\n - `overrides: { id: string; override_specifiers: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_template_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_template_ids?: string[]; }[]; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_tags?: string[]; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_tiers?: { multiplier: number; size?: number; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type?: object; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: object[]; }; priority?: number; product?: { id: string; name: string; }; target?: 'COMMIT_RATE' | 'LIST_RATE'; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]`\n - `scheduled_charges: { id: string; product: { id: string; name: string; }; schedule: { credit_type: { id: string; name: string; }; schedule_items: { id: string; date_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; quantity: number; unit_price: number; }[]; }; custom_fields?: object; description?: string; name?: string; }[]`\n - `usage_statement_schedule: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START'; }`\n - `aliases?: { name: string; ending_before?: string; starting_at?: string; }[]`\n - `archived_at?: string`\n - `billing_provider?: string`\n - `contract_name?: string`\n - `credits?: { id: string; product: { id: string; name: string; }; access_schedule?: { credit_type: { id: string; name: string; }; schedule_items: { id: string; amount: number; duration: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]`\n - `delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'`\n - `duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }`\n - `multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'`\n - `name?: string`\n - `net_payment_terms_days?: number`\n - `prepaid_balance_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; }`\n - `rate_card_id?: string`\n - `recurring_commits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { allocation: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config: { is_prorated: boolean; }; subscription_template_id: string; }; }[]`\n - `recurring_credits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { allocation: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config: { is_prorated: boolean; }; subscription_template_id: string; }; }[]`\n - `scheduled_charges_on_usage_invoices?: 'ALL'`\n - `spend_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount: number; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; }`\n - `spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[]`\n - `subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product: { id: string; name: string; }; }; id?: string; custom_fields?: object; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; fiat_credit_type_id?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { seat_group_key: string; }; starting_at_offset?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; }[]`\n - `uniqueness_key?: string`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\n// Automatically fetches more pages as needed.\nfor await (const packageListResponse of client.v1.packages.list()) {\n console.log(packageListResponse);\n}\n```",
perLanguage: {
typescript: {
method: 'client.v1.packages.list',
@@ -5634,7 +5638,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
httpMethod: 'post',
summary: 'List contracts associated with a package',
description:
- 'For a given package, returns all contract IDs and customer IDs associated with the package over a specific time period. \n\n### Use this endpoint to:\n- Understand which customers are provisioned on a package at any given time for internal cohort management\n- Manage customer migrations to a new package. For example, to migrate all active customers to a new package, call this endpoint, end contracts, and provision customers on a new package.\n\n### **Usage guidelines:**\nUse the **`starting_at`**, **`covering_date`**, and **`include_archived`** parameters to filter the list of returned contracts. For example, to list only currently active contracts, pass **`covering_date`** equal to the current time.\n',
+ 'For a given package, returns all contract IDs and customer IDs associated with the package over a specific time period. \n\n### Use this endpoint to:\n- Understand which customers are provisioned on a package at any given time for internal cohort management\n- Manage customer migrations to a new package. For example, to migrate all active customers to a new package, call this endpoint, end contracts, and provision customers on a new package.\n\n### **Usage guidelines:**\nUse the **`starting_at`**, **`covering_date`**, and **`include_archived`** parameters to filter the list of returned contracts. For example, to list only currently active contracts, pass **`covering_date`** equal to the current time.\n',
stainlessPath: '(resource) v1.packages > (method) list_contracts_on_package',
qualified: 'client.v1.packages.listContractsOnPackage',
params: [
@@ -5648,7 +5652,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
response:
'{ contract_id: string; customer_id: string; starting_at: string; archived_at?: string; ending_before?: string; }',
markdown:
- "## list_contracts_on_package\n\n`client.v1.packages.listContractsOnPackage(package_id: string, limit?: number, next_page?: string, covering_date?: string, include_archived?: boolean, starting_at?: string): { contract_id: string; customer_id: string; starting_at: string; archived_at?: string; ending_before?: string; }`\n\n**post** `/v1/packages/listContractsOnPackage`\n\nFor a given package, returns all contract IDs and customer IDs associated with the package over a specific time period. \n\n### Use this endpoint to:\n- Understand which customers are provisioned on a package at any given time for internal cohort management\n- Manage customer migrations to a new package. For example, to migrate all active customers to a new package, call this endpoint, end contracts, and provision customers on a new package.\n\n### **Usage guidelines:**\nUse the **`starting_at`**, **`covering_date`**, and **`include_archived`** parameters to filter the list of returned contracts. For example, to list only currently active contracts, pass **`covering_date`** equal to the current time.\n\n\n### Parameters\n\n- `package_id: string`\n\n- `limit?: number`\n Max number of results that should be returned\n\n- `next_page?: string`\n Cursor that indicates where the next page of results should start.\n\n- `covering_date?: string`\n Optional RFC 3339 timestamp. Only include contracts active on the provided date. This cannot be provided if starting_at filter is provided.\n\n- `include_archived?: boolean`\n Default false. Determines whether to include archived contracts in the results\n\n- `starting_at?: string`\n Optional RFC 3339 timestamp. Only include contracts that started on or after this date. This cannot be provided if covering_date filter is provided.\n\n### Returns\n\n- `{ contract_id: string; customer_id: string; starting_at: string; archived_at?: string; ending_before?: string; }`\n\n - `contract_id: string`\n - `customer_id: string`\n - `starting_at: string`\n - `archived_at?: string`\n - `ending_before?: string`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\n// Automatically fetches more pages as needed.\nfor await (const packageListContractsOnPackageResponse of client.v1.packages.listContractsOnPackage({ package_id: '13117714-3f05-48e5-a6e9-a66093f13b4d' })) {\n console.log(packageListContractsOnPackageResponse);\n}\n```",
+ "## list_contracts_on_package\n\n`client.v1.packages.listContractsOnPackage(package_id: string, limit?: number, next_page?: string, covering_date?: string, include_archived?: boolean, starting_at?: string): { contract_id: string; customer_id: string; starting_at: string; archived_at?: string; ending_before?: string; }`\n\n**post** `/v1/packages/listContractsOnPackage`\n\nFor a given package, returns all contract IDs and customer IDs associated with the package over a specific time period. \n\n### Use this endpoint to:\n- Understand which customers are provisioned on a package at any given time for internal cohort management\n- Manage customer migrations to a new package. For example, to migrate all active customers to a new package, call this endpoint, end contracts, and provision customers on a new package.\n\n### **Usage guidelines:**\nUse the **`starting_at`**, **`covering_date`**, and **`include_archived`** parameters to filter the list of returned contracts. For example, to list only currently active contracts, pass **`covering_date`** equal to the current time.\n\n\n### Parameters\n\n- `package_id: string`\n\n- `limit?: number`\n Max number of results that should be returned\n\n- `next_page?: string`\n Cursor that indicates where the next page of results should start.\n\n- `covering_date?: string`\n Optional RFC 3339 timestamp. Only include contracts active on the provided date. This cannot be provided if starting_at filter is provided.\n\n- `include_archived?: boolean`\n Default false. Determines whether to include archived contracts in the results\n\n- `starting_at?: string`\n Optional RFC 3339 timestamp. Only include contracts that started on or after this date. This cannot be provided if covering_date filter is provided.\n\n### Returns\n\n- `{ contract_id: string; customer_id: string; starting_at: string; archived_at?: string; ending_before?: string; }`\n\n - `contract_id: string`\n - `customer_id: string`\n - `starting_at: string`\n - `archived_at?: string`\n - `ending_before?: string`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\n// Automatically fetches more pages as needed.\nfor await (const packageListContractsOnPackageResponse of client.v1.packages.listContractsOnPackage({ package_id: '13117714-3f05-48e5-a6e9-a66093f13b4d' })) {\n console.log(packageListContractsOnPackageResponse);\n}\n```",
perLanguage: {
typescript: {
method: 'client.v1.packages.listContractsOnPackage',
diff --git a/src/resources/shared.ts b/src/resources/shared.ts
index 0a185692..067ad624 100644
--- a/src/resources/shared.ts
+++ b/src/resources/shared.ts
@@ -183,6 +183,11 @@ export interface Commit {
*/
specifiers?: Array;
+ /**
+ * Optional attributes controlling how this commit interacts with spend trackers.
+ */
+ spend_tracker_attributes?: Commit.SpendTrackerAttributes;
+
/**
* The subscription configuration for this commit, if it was generated from a
* recurring commit with a subscription attached.
@@ -380,6 +385,17 @@ export namespace Commit {
contract_id: string;
}
+ /**
+ * Optional attributes controlling how this commit interacts with spend trackers.
+ */
+ export interface SpendTrackerAttributes {
+ /**
+ * If true, this commit is included in spend trackers with discounted set to
+ * DISCOUNTED_ONLY
+ */
+ counts_as_discounted: boolean;
+ }
+
/**
* The subscription configuration for this commit, if it was generated from a
* recurring commit with a subscription attached.
@@ -532,6 +548,11 @@ export interface Contract {
spend_threshold_configuration?: SpendThresholdConfiguration;
+ /**
+ * Spend trackers attached to this contract.
+ */
+ spend_trackers?: Array;
+
/**
* List of subscriptions on the contract.
*/
@@ -642,6 +663,39 @@ export namespace Contract {
*/
configuration?: { [key: string]: unknown };
}
+
+ export interface SpendTracker {
+ /**
+ * Human-readable identifier, unique per contract.
+ */
+ alias: string;
+
+ applicable_spend_specifiers: Array;
+
+ credit_type_id: string;
+
+ reset_frequency: 'BILLING_PERIOD';
+
+ accumulated_spend?: SpendTracker.AccumulatedSpend;
+ }
+
+ export namespace SpendTracker {
+ export interface ApplicableSpendSpecifier {
+ sources: Array<'THRESHOLD_RECHARGE' | 'MANUAL'>;
+
+ spend_type: 'COMMIT_PURCHASE';
+
+ discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY';
+ }
+
+ export interface AccumulatedSpend {
+ amount: number;
+
+ period_ending_before: string;
+
+ period_starting_at: string;
+ }
+ }
}
export interface ContractV2 {
@@ -758,6 +812,11 @@ export interface ContractV2 {
spend_threshold_configuration?: SpendThresholdConfigurationV2;
+ /**
+ * Spend trackers attached to this contract.
+ */
+ spend_trackers?: Array;
+
/**
* List of subscriptions on the contract.
*/
@@ -895,6 +954,11 @@ export namespace ContractV2 {
*/
specifiers?: Array;
+ /**
+ * Optional attributes controlling how this commit interacts with spend trackers.
+ */
+ spend_tracker_attributes?: Commit.SpendTrackerAttributes;
+
/**
* Attach a subscription to the recurring commit/credit.
*/
@@ -1082,6 +1146,17 @@ export namespace ContractV2 {
contract_id: string;
}
+
+ /**
+ * Optional attributes controlling how this commit interacts with spend trackers.
+ */
+ export interface SpendTrackerAttributes {
+ /**
+ * If true, this commit is included in spend trackers with discounted set to
+ * DISCOUNTED_ONLY
+ */
+ counts_as_discounted: boolean;
+ }
}
export interface Override {
@@ -1858,6 +1933,39 @@ export namespace ContractV2 {
}
}
+ export interface SpendTracker {
+ /**
+ * Human-readable identifier, unique per contract.
+ */
+ alias: string;
+
+ applicable_spend_specifiers: Array;
+
+ credit_type_id: string;
+
+ reset_frequency: 'BILLING_PERIOD';
+
+ accumulated_spend?: SpendTracker.AccumulatedSpend;
+ }
+
+ export namespace SpendTracker {
+ export interface ApplicableSpendSpecifier {
+ sources: Array<'THRESHOLD_RECHARGE' | 'MANUAL'>;
+
+ spend_type: 'COMMIT_PURCHASE';
+
+ discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY';
+ }
+
+ export interface AccumulatedSpend {
+ amount: number;
+
+ period_ending_before: string;
+
+ period_starting_at: string;
+ }
+ }
+
export interface Subscription {
/**
* Previous, current, and next billing periods for the subscription.
@@ -2058,6 +2166,11 @@ export interface ContractWithoutAmendments {
spend_threshold_configuration?: SpendThresholdConfiguration;
+ /**
+ * Spend trackers attached to this contract.
+ */
+ spend_trackers?: Array;
+
/**
* This field's availability is dependent on your client's configuration.
*/
@@ -2396,6 +2509,39 @@ export namespace ContractWithoutAmendments {
reseller_contract_value?: number;
}
+ export interface SpendTracker {
+ /**
+ * Human-readable identifier, unique per contract.
+ */
+ alias: string;
+
+ applicable_spend_specifiers: Array;
+
+ credit_type_id: string;
+
+ reset_frequency: 'BILLING_PERIOD';
+
+ accumulated_spend?: SpendTracker.AccumulatedSpend;
+ }
+
+ export namespace SpendTracker {
+ export interface ApplicableSpendSpecifier {
+ sources: Array<'THRESHOLD_RECHARGE' | 'MANUAL'>;
+
+ spend_type: 'COMMIT_PURCHASE';
+
+ discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY';
+ }
+
+ export interface AccumulatedSpend {
+ amount: number;
+
+ period_ending_before: string;
+
+ period_starting_at: string;
+ }
+ }
+
export interface UsageFilter {
current: Shared.BaseUsageFilter | null;
@@ -3109,6 +3255,30 @@ export namespace PrepaidBalanceThresholdConfiguration {
* (a 15% discount).
*/
payment_fraction: number;
+
+ /**
+ * If provided, the discount stops applying once the spend tracker has accumulated
+ * this much spend in the billing period.
+ */
+ cap?: DiscountConfiguration.Cap;
+ }
+
+ export namespace DiscountConfiguration {
+ /**
+ * If provided, the discount stops applying once the spend tracker has accumulated
+ * this much spend in the billing period.
+ */
+ export interface Cap {
+ /**
+ * Accumulated spend ceiling above which the discount stops applying.
+ */
+ amount: number;
+
+ /**
+ * Alias of the spend tracker this cap is measured against.
+ */
+ spend_tracker_alias: string;
+ }
}
}
@@ -3178,6 +3348,30 @@ export namespace PrepaidBalanceThresholdConfigurationV2 {
* (a 15% discount).
*/
payment_fraction: number;
+
+ /**
+ * If provided, the discount stops applying once the spend tracker has accumulated
+ * this much spend in the billing period.
+ */
+ cap?: DiscountConfiguration.Cap;
+ }
+
+ export namespace DiscountConfiguration {
+ /**
+ * If provided, the discount stops applying once the spend tracker has accumulated
+ * this much spend in the billing period.
+ */
+ export interface Cap {
+ /**
+ * Accumulated spend ceiling above which the discount stops applying.
+ */
+ amount: number;
+
+ /**
+ * Alias of the spend tracker this cap is measured against.
+ */
+ spend_tracker_alias: string;
+ }
}
}
@@ -3412,6 +3606,30 @@ export namespace SpendThresholdConfiguration {
* (a 15% discount).
*/
payment_fraction: number;
+
+ /**
+ * If provided, the discount stops applying once the spend tracker has accumulated
+ * this much spend in the billing period.
+ */
+ cap?: DiscountConfiguration.Cap;
+ }
+
+ export namespace DiscountConfiguration {
+ /**
+ * If provided, the discount stops applying once the spend tracker has accumulated
+ * this much spend in the billing period.
+ */
+ export interface Cap {
+ /**
+ * Accumulated spend ceiling above which the discount stops applying.
+ */
+ amount: number;
+
+ /**
+ * Alias of the spend tracker this cap is measured against.
+ */
+ spend_tracker_alias: string;
+ }
}
}
@@ -3444,6 +3662,30 @@ export namespace SpendThresholdConfigurationV2 {
* (a 15% discount).
*/
payment_fraction: number;
+
+ /**
+ * If provided, the discount stops applying once the spend tracker has accumulated
+ * this much spend in the billing period.
+ */
+ cap?: DiscountConfiguration.Cap;
+ }
+
+ export namespace DiscountConfiguration {
+ /**
+ * If provided, the discount stops applying once the spend tracker has accumulated
+ * this much spend in the billing period.
+ */
+ export interface Cap {
+ /**
+ * Accumulated spend ceiling above which the discount stops applying.
+ */
+ amount: number;
+
+ /**
+ * Alias of the spend tracker this cap is measured against.
+ */
+ spend_tracker_alias: string;
+ }
}
}
diff --git a/src/resources/v1/contracts/contracts.ts b/src/resources/v1/contracts/contracts.ts
index 51eb9b7d..c4fb03f8 100644
--- a/src/resources/v1/contracts/contracts.ts
+++ b/src/resources/v1/contracts/contracts.ts
@@ -1145,6 +1145,12 @@ export interface ContractCreateParams {
spend_threshold_configuration?: Shared.SpendThresholdConfiguration;
+ /**
+ * Spend trackers to attach to this contract. Aliases must be unique within a
+ * contract.
+ */
+ spend_trackers?: Array;
+
/**
* Optional list of
* [subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/)
@@ -1280,6 +1286,11 @@ export namespace ContractCreateParams {
*/
specifiers?: Array;
+ /**
+ * Optional attributes for spend tracker integration. Immutable after creation.
+ */
+ spend_tracker_attributes?: Commit.SpendTrackerAttributes;
+
/**
* A temporary ID for the commit that can be used to reference the commit for
* commit specific overrides.
@@ -1420,6 +1431,17 @@ export namespace ContractCreateParams {
unit_price?: number;
}
}
+
+ /**
+ * Optional attributes for spend tracker integration. Immutable after creation.
+ */
+ export interface SpendTrackerAttributes {
+ /**
+ * If true, this commit will be included in spend trackers with discounted set to
+ * DISCOUNTED_ONLY
+ */
+ counts_as_discounted: boolean;
+ }
}
export interface Credit {
@@ -2424,6 +2446,32 @@ export namespace ContractCreateParams {
}
}
+ export interface SpendTracker {
+ /**
+ * Human-readable identifier, unique per contract.
+ */
+ alias: string;
+
+ applicable_spend_specifiers: Array;
+
+ credit_type_id: string;
+
+ reset_frequency: 'BILLING_PERIOD';
+ }
+
+ export namespace SpendTracker {
+ export interface ApplicableSpendSpecifier {
+ sources: Array<'THRESHOLD_RECHARGE' | 'MANUAL'>;
+
+ spend_type: 'COMMIT_PURCHASE';
+
+ /**
+ * Filter by whether the spend was discounted. Defaults to ANY if omitted.
+ */
+ discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY';
+ }
+ }
+
export interface Subscription {
collection_schedule: 'ADVANCE' | 'ARREARS';
@@ -2824,6 +2872,11 @@ export namespace ContractAmendParams {
*/
specifiers?: Array;
+ /**
+ * Optional attributes for spend tracker integration. Immutable after creation.
+ */
+ spend_tracker_attributes?: Commit.SpendTrackerAttributes;
+
/**
* A temporary ID for the commit that can be used to reference the commit for
* commit specific overrides.
@@ -2964,6 +3017,17 @@ export namespace ContractAmendParams {
unit_price?: number;
}
}
+
+ /**
+ * Optional attributes for spend tracker integration. Immutable after creation.
+ */
+ export interface SpendTrackerAttributes {
+ /**
+ * If true, this commit will be included in spend trackers with discounted set to
+ * DISCOUNTED_ONLY
+ */
+ counts_as_discounted: boolean;
+ }
}
export interface Credit {
diff --git a/src/resources/v1/packages.ts b/src/resources/v1/packages.ts
index 0ea48656..3adfa86b 100644
--- a/src/resources/v1/packages.ts
+++ b/src/resources/v1/packages.ts
@@ -145,10 +145,9 @@ export class Packages extends APIResource {
*
* ### **Usage guidelines:**
*
- * Use the **`starting_at`**, **`covering_date`**,
- * and **`include_archived`** parameters to filter the list of returned contracts.
- * For example, to list only currently active contracts,
- * pass **`covering_date`** equal to the current time.
+ * Use the **`starting_at`**, **`covering_date`**, and **`include_archived`**
+ * parameters to filter the list of returned contracts. For example, to list only
+ * currently active contracts, pass **`covering_date`** equal to the current time.
*
* @example
* ```ts
@@ -259,6 +258,8 @@ export namespace PackageRetrieveResponse {
spend_threshold_configuration?: Shared.SpendThresholdConfiguration;
+ spend_trackers?: Array;
+
subscriptions?: Array;
/**
@@ -924,6 +925,29 @@ export namespace PackageRetrieveResponse {
}
}
+ export interface SpendTracker {
+ /**
+ * Human-readable identifier, unique per contract.
+ */
+ alias: string;
+
+ applicable_spend_specifiers: Array;
+
+ credit_type_id: string;
+
+ reset_frequency: 'BILLING_PERIOD';
+ }
+
+ export namespace SpendTracker {
+ export interface ApplicableSpendSpecifier {
+ sources: Array<'THRESHOLD_RECHARGE' | 'MANUAL'>;
+
+ spend_type: 'COMMIT_PURCHASE';
+
+ discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY';
+ }
+ }
+
export interface Subscription {
collection_schedule: 'ADVANCE' | 'ARREARS';
@@ -1086,6 +1110,8 @@ export interface PackageListResponse {
spend_threshold_configuration?: Shared.SpendThresholdConfiguration;
+ spend_trackers?: Array;
+
subscriptions?: Array;
/**
@@ -1751,6 +1777,29 @@ export namespace PackageListResponse {
}
}
+ export interface SpendTracker {
+ /**
+ * Human-readable identifier, unique per contract.
+ */
+ alias: string;
+
+ applicable_spend_specifiers: Array;
+
+ credit_type_id: string;
+
+ reset_frequency: 'BILLING_PERIOD';
+ }
+
+ export namespace SpendTracker {
+ export interface ApplicableSpendSpecifier {
+ sources: Array<'THRESHOLD_RECHARGE' | 'MANUAL'>;
+
+ spend_type: 'COMMIT_PURCHASE';
+
+ discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY';
+ }
+ }
+
export interface Subscription {
collection_schedule: 'ADVANCE' | 'ARREARS';
@@ -1917,6 +1966,8 @@ export interface PackageCreateParams {
spend_threshold_configuration?: Shared.SpendThresholdConfiguration;
+ spend_trackers?: Array;
+
subscriptions?: Array;
/**
@@ -2838,6 +2889,32 @@ export namespace PackageCreateParams {
}
}
+ export interface SpendTracker {
+ /**
+ * Human-readable identifier, unique per contract.
+ */
+ alias: string;
+
+ applicable_spend_specifiers: Array;
+
+ credit_type_id: string;
+
+ reset_frequency: 'BILLING_PERIOD';
+ }
+
+ export namespace SpendTracker {
+ export interface ApplicableSpendSpecifier {
+ sources: Array<'THRESHOLD_RECHARGE' | 'MANUAL'>;
+
+ spend_type: 'COMMIT_PURCHASE';
+
+ /**
+ * Filter by whether the spend was discounted. Defaults to ANY if omitted.
+ */
+ discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY';
+ }
+ }
+
export interface Subscription {
collection_schedule: 'ADVANCE' | 'ARREARS';
diff --git a/src/resources/v2/contracts.ts b/src/resources/v2/contracts.ts
index 08abcb36..55db01d4 100644
--- a/src/resources/v2/contracts.ts
+++ b/src/resources/v2/contracts.ts
@@ -1514,6 +1514,11 @@ export namespace ContractGetEditHistoryResponse {
}
export interface DiscountConfiguration {
+ /**
+ * Update the discount cap. Set to null to remove an existing cap.
+ */
+ cap?: DiscountConfiguration.Cap | null;
+
/**
* The fraction of the original amount that the customer pays after applying the
* discount. Set to null to remove the discount fraction. For example, 0.85 means
@@ -1521,6 +1526,23 @@ export namespace ContractGetEditHistoryResponse {
*/
payment_fraction?: number | null;
}
+
+ export namespace DiscountConfiguration {
+ /**
+ * Update the discount cap. Set to null to remove an existing cap.
+ */
+ export interface Cap {
+ /**
+ * Accumulated spend ceiling above which the discount stops applying.
+ */
+ amount: number;
+
+ /**
+ * Alias of the spend tracker this cap is measured against.
+ */
+ spend_tracker_alias: string;
+ }
+ }
}
export interface UpdateRecurringCommit {
@@ -1644,6 +1666,11 @@ export namespace ContractGetEditHistoryResponse {
export namespace UpdateSpendThresholdConfiguration {
export interface DiscountConfiguration {
+ /**
+ * Update the discount cap. Set to null to remove an existing cap.
+ */
+ cap?: DiscountConfiguration.Cap | null;
+
/**
* The fraction of the original amount that the customer pays after applying the
* discount. Set to null to remove the discount fraction. For example, 0.85 means
@@ -1651,6 +1678,23 @@ export namespace ContractGetEditHistoryResponse {
*/
payment_fraction?: number | null;
}
+
+ export namespace DiscountConfiguration {
+ /**
+ * Update the discount cap. Set to null to remove an existing cap.
+ */
+ export interface Cap {
+ /**
+ * Accumulated spend ceiling above which the discount stops applying.
+ */
+ amount: number;
+
+ /**
+ * Alias of the spend tracker this cap is measured against.
+ */
+ spend_tracker_alias: string;
+ }
+ }
}
export interface UpdateSubscription {
@@ -1863,6 +1907,12 @@ export interface ContractEditParams {
add_spend_threshold_configuration?: Shared.SpendThresholdConfigurationV2;
+ /**
+ * Spend trackers to add to this contract. Aliases must be unique within a
+ * contract.
+ */
+ add_spend_trackers?: Array;
+
/**
* Optional list of
* [subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/)
@@ -1893,6 +1943,11 @@ export interface ContractEditParams {
*/
archive_scheduled_charges?: Array;
+ /**
+ * Aliases of spend trackers to archive.
+ */
+ archive_spend_trackers?: Array;
+
/**
* IDs of overrides to remove
*/
@@ -2088,6 +2143,11 @@ export namespace ContractEditParams {
*/
specifiers?: Array;
+ /**
+ * Optional attributes for spend tracker integration. Immutable after creation.
+ */
+ spend_tracker_attributes?: AddCommit.SpendTrackerAttributes;
+
/**
* A temporary ID for the commit that can be used to reference the commit for
* commit specific overrides.
@@ -2302,6 +2362,17 @@ export namespace ContractEditParams {
on_session_payment?: boolean;
}
}
+
+ /**
+ * Optional attributes for spend tracker integration. Immutable after creation.
+ */
+ export interface SpendTrackerAttributes {
+ /**
+ * If true, this commit will be included in spend trackers with discounted set to
+ * DISCOUNTED_ONLY
+ */
+ counts_as_discounted: boolean;
+ }
}
export interface AddCredit {
@@ -3267,6 +3338,32 @@ export namespace ContractEditParams {
}
}
+ export interface AddSpendTracker {
+ /**
+ * Human-readable identifier, unique per contract.
+ */
+ alias: string;
+
+ applicable_spend_specifiers: Array;
+
+ credit_type_id: string;
+
+ reset_frequency: 'BILLING_PERIOD';
+ }
+
+ export namespace AddSpendTracker {
+ export interface ApplicableSpendSpecifier {
+ sources: Array<'THRESHOLD_RECHARGE' | 'MANUAL'>;
+
+ spend_type: 'COMMIT_PURCHASE';
+
+ /**
+ * Filter by whether the spend was discounted. Defaults to ANY if omitted.
+ */
+ discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY';
+ }
+ }
+
export interface AddSubscription {
collection_schedule: 'ADVANCE' | 'ARREARS';
@@ -3645,6 +3742,11 @@ export namespace ContractEditParams {
}
export interface DiscountConfiguration {
+ /**
+ * Update the discount cap. Set to null to remove an existing cap.
+ */
+ cap?: DiscountConfiguration.Cap | null;
+
/**
* The fraction of the original amount that the customer pays after applying the
* discount. Set to null to remove the discount fraction. For example, 0.85 means
@@ -3652,6 +3754,23 @@ export namespace ContractEditParams {
*/
payment_fraction?: number | null;
}
+
+ export namespace DiscountConfiguration {
+ /**
+ * Update the discount cap. Set to null to remove an existing cap.
+ */
+ export interface Cap {
+ /**
+ * Accumulated spend ceiling above which the discount stops applying.
+ */
+ amount: number;
+
+ /**
+ * Alias of the spend tracker this cap is measured against.
+ */
+ spend_tracker_alias: string;
+ }
+ }
}
export interface UpdateRecurringCommit {
@@ -3775,6 +3894,11 @@ export namespace ContractEditParams {
export namespace UpdateSpendThresholdConfiguration {
export interface DiscountConfiguration {
+ /**
+ * Update the discount cap. Set to null to remove an existing cap.
+ */
+ cap?: DiscountConfiguration.Cap | null;
+
/**
* The fraction of the original amount that the customer pays after applying the
* discount. Set to null to remove the discount fraction. For example, 0.85 means
@@ -3782,6 +3906,23 @@ export namespace ContractEditParams {
*/
payment_fraction?: number | null;
}
+
+ export namespace DiscountConfiguration {
+ /**
+ * Update the discount cap. Set to null to remove an existing cap.
+ */
+ export interface Cap {
+ /**
+ * Accumulated spend ceiling above which the discount stops applying.
+ */
+ amount: number;
+
+ /**
+ * Alias of the spend tracker this cap is measured against.
+ */
+ spend_tracker_alias: string;
+ }
+ }
}
export interface UpdateSubscription {
diff --git a/tests/api-resources/v1/contracts/contracts.test.ts b/tests/api-resources/v1/contracts/contracts.test.ts
index c6c9a911..eb7bf60a 100644
--- a/tests/api-resources/v1/contracts/contracts.test.ts
+++ b/tests/api-resources/v1/contracts/contracts.test.ts
@@ -85,6 +85,7 @@ describe('resource contracts', () => {
product_tags: ['string'],
},
],
+ spend_tracker_attributes: { counts_as_discounted: true },
temporary_id: 'temporary_id',
},
],
@@ -232,7 +233,10 @@ describe('resource contracts', () => {
recharge_to_amount: 0,
threshold_amount: 0,
custom_credit_type_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
- discount_configuration: { payment_fraction: 0 },
+ discount_configuration: {
+ payment_fraction: 0,
+ cap: { amount: 0, spend_tracker_alias: 'spend_tracker_alias' },
+ },
},
professional_services: [
{
@@ -400,8 +404,25 @@ describe('resource contracts', () => {
tax_type: 'NONE',
},
threshold_amount: 0,
- discount_configuration: { payment_fraction: 0 },
+ discount_configuration: {
+ payment_fraction: 0,
+ cap: { amount: 0, spend_tracker_alias: 'spend_tracker_alias' },
+ },
},
+ spend_trackers: [
+ {
+ alias: 'alias',
+ applicable_spend_specifiers: [
+ {
+ sources: ['THRESHOLD_RECHARGE'],
+ spend_type: 'COMMIT_PURCHASE',
+ discounted: 'ANY',
+ },
+ ],
+ credit_type_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
+ reset_frequency: 'BILLING_PERIOD',
+ },
+ ],
subscriptions: [
{
collection_schedule: 'ADVANCE',
@@ -595,6 +616,7 @@ describe('resource contracts', () => {
product_tags: ['string'],
},
],
+ spend_tracker_attributes: { counts_as_discounted: true },
temporary_id: 'temporary_id',
},
],
diff --git a/tests/api-resources/v1/packages.test.ts b/tests/api-resources/v1/packages.test.ts
index 41911d46..e741cdf9 100644
--- a/tests/api-resources/v1/packages.test.ts
+++ b/tests/api-resources/v1/packages.test.ts
@@ -172,7 +172,10 @@ describe('resource packages', () => {
recharge_to_amount: 0,
threshold_amount: 0,
custom_credit_type_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
- discount_configuration: { payment_fraction: 0 },
+ discount_configuration: {
+ payment_fraction: 0,
+ cap: { amount: 0, spend_tracker_alias: 'spend_tracker_alias' },
+ },
},
rate_card_alias: 'rate_card_alias',
rate_card_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
@@ -289,8 +292,25 @@ describe('resource packages', () => {
tax_type: 'NONE',
},
threshold_amount: 0,
- discount_configuration: { payment_fraction: 0 },
+ discount_configuration: {
+ payment_fraction: 0,
+ cap: { amount: 0, spend_tracker_alias: 'spend_tracker_alias' },
+ },
},
+ spend_trackers: [
+ {
+ alias: 'alias',
+ applicable_spend_specifiers: [
+ {
+ sources: ['THRESHOLD_RECHARGE'],
+ spend_type: 'COMMIT_PURCHASE',
+ discounted: 'ANY',
+ },
+ ],
+ credit_type_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
+ reset_frequency: 'BILLING_PERIOD',
+ },
+ ],
subscriptions: [
{
collection_schedule: 'ADVANCE',
diff --git a/tests/api-resources/v2/contracts.test.ts b/tests/api-resources/v2/contracts.test.ts
index 91f6d24b..7216f475 100644
--- a/tests/api-resources/v2/contracts.test.ts
+++ b/tests/api-resources/v2/contracts.test.ts
@@ -144,6 +144,7 @@ describe('resource contracts', () => {
product_tags: ['string'],
},
],
+ spend_tracker_attributes: { counts_as_discounted: true },
temporary_id: 'temporary_id',
},
],
@@ -274,7 +275,10 @@ describe('resource contracts', () => {
recharge_to_amount: 0,
threshold_amount: 0,
custom_credit_type_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
- discount_configuration: { payment_fraction: 0 },
+ discount_configuration: {
+ payment_fraction: 0,
+ cap: { amount: 0, spend_tracker_alias: 'spend_tracker_alias' },
+ },
},
add_professional_services: [
{
@@ -441,8 +445,25 @@ describe('resource contracts', () => {
tax_type: 'NONE',
},
threshold_amount: 0,
- discount_configuration: { payment_fraction: 0 },
+ discount_configuration: {
+ payment_fraction: 0,
+ cap: { amount: 0, spend_tracker_alias: 'spend_tracker_alias' },
+ },
},
+ add_spend_trackers: [
+ {
+ alias: 'alias',
+ applicable_spend_specifiers: [
+ {
+ sources: ['THRESHOLD_RECHARGE'],
+ spend_type: 'COMMIT_PURCHASE',
+ discounted: 'ANY',
+ },
+ ],
+ credit_type_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
+ reset_frequency: 'BILLING_PERIOD',
+ },
+ ],
add_subscriptions: [
{
collection_schedule: 'ADVANCE',
@@ -470,6 +491,7 @@ describe('resource contracts', () => {
archive_commits: [{ id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' }],
archive_credits: [{ id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' }],
archive_scheduled_charges: [{ id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' }],
+ archive_spend_trackers: ['string'],
remove_overrides: [{ id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' }],
uniqueness_key: 'x',
update_commits: [
@@ -579,7 +601,10 @@ describe('resource contracts', () => {
],
},
custom_credit_type_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
- discount_configuration: { payment_fraction: 0 },
+ discount_configuration: {
+ cap: { amount: 0, spend_tracker_alias: 'spend_tracker_alias' },
+ payment_fraction: 0,
+ },
is_enabled: true,
payment_gate_config: {
payment_gate_type: 'NONE',
@@ -643,7 +668,10 @@ describe('resource contracts', () => {
priority: 0,
product_id: 'product_id',
},
- discount_configuration: { payment_fraction: 0 },
+ discount_configuration: {
+ cap: { amount: 0, spend_tracker_alias: 'spend_tracker_alias' },
+ payment_fraction: 0,
+ },
is_enabled: true,
payment_gate_config: {
payment_gate_type: 'NONE',
From d1cf9d3336dbb3809fc79e6be2608a0f3632fb56 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 23 May 2026 00:42:06 +0000
Subject: [PATCH 09/19] codegen metadata
---
.stats.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index ec86c937..0fccddc6 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 115
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome/metronome-78581b862a542a362a59fb6561b0bc245fa73b9e3b7f2cdb8ec1327043f56b7a.yml
-openapi_spec_hash: 27c21b4c41612ca9923c07a90f47c07e
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome/metronome-fcb7a1c10f6f0408ab7ac99b43c86814faae0c7ec636b94f04e12437e8297c65.yml
+openapi_spec_hash: 6ed360e256037be0ba403e48e25fd811
config_hash: 6bd82f310398d5d47bcfeb8d7ed150b3
From 07eb0fe97fee540544e5ce3b68109a3345c13854 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 26 May 2026 17:07:37 +0000
Subject: [PATCH 10/19] chore: (internal) Add threshold balance specifier to
contract create & edit, package create and both contract and package
retrievals
---
.stats.yml | 4 +-
packages/mcp-server/src/local-docs-search.ts | 28 +++++------
src/resources/shared.ts | 48 +++++++++++++++++++
src/resources/v2/contracts.ts | 44 +++++++++++++++++
.../v1/contracts/contracts.test.ts | 15 ++++++
tests/api-resources/v1/packages.test.ts | 15 ++++++
tests/api-resources/v2/contracts.test.ts | 30 ++++++++++++
yarn.lock | 6 +--
8 files changed, 171 insertions(+), 19 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 0fccddc6..9a71216e 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 115
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome/metronome-fcb7a1c10f6f0408ab7ac99b43c86814faae0c7ec636b94f04e12437e8297c65.yml
-openapi_spec_hash: 6ed360e256037be0ba403e48e25fd811
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome/metronome-dc7aacadde1a8eae59d0f2744d1701cc00dd1e73051b040308b43870e4c2f776.yml
+openapi_spec_hash: 26eb8219cc5aaf604f24389a88d8c6d2
config_hash: 6bd82f310398d5d47bcfeb8d7ed150b3
diff --git a/packages/mcp-server/src/local-docs-search.ts b/packages/mcp-server/src/local-docs-search.ts
index 852a540b..8eee42e2 100644
--- a/packages/mcp-server/src/local-docs-search.ts
+++ b/packages/mcp-server/src/local-docs-search.ts
@@ -69,7 +69,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
response:
"{ data: { id: string; commits: object[]; created_at: string; created_by: string; customer_id: string; overrides: object[]; scheduled_charges: scheduled_charge[]; starting_at: string; transitions: object[]; usage_filter: object[]; usage_statement_schedule: object; archived_at?: string; credits?: object[]; custom_fields?: object; customer_billing_provider_configuration?: object; discounts?: discount[]; ending_before?: string; has_more?: object; hierarchy_configuration?: object | object; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration_v2; priority?: number; professional_services?: pro_service[]; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; reseller_royalties?: object[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration_v2; spend_trackers?: object[]; subscriptions?: object[]; total_contract_value?: number; uniqueness_key?: string; }; }",
markdown:
- "## retrieve\n\n`client.v2.contracts.retrieve(contract_id: string, customer_id: string, as_of_date?: string, include_balance?: boolean, include_ledgers?: boolean): { data: contract_v2; }`\n\n**post** `/v2/contracts/get`\n\nGets the details for a specific contract, including contract term, rate card information, credits and commits, and more. \n\n### Use this endpoint to: \n- Check the duration of a customer's current contract\n- Get details on contract terms, including access schedule amounts for commitments and credits\n- Understand the state of a contract at a past time. As you can evolve the terms of a contract over time through editing, use the `as_of_date` parameter to view the full contract configuration as of that point in time. \n\n### Usage guidelines: \n- Optionally, use the `include_balance` and `include_ledger` fields to include balances and ledgers in the credit and commit responses. Using these fields will cause the query to be slower.\n\n\n### Parameters\n\n- `contract_id: string`\n\n- `customer_id: string`\n\n- `as_of_date?: string`\n Optional RFC 3339 timestamp. Return the contract as of this date. Cannot be used with include_ledgers parameter.\n\n- `include_balance?: boolean`\n Include the balance of credits and commits in the response. Setting this flag may cause the query to be slower.\n\n- `include_ledgers?: boolean`\n Include commit/credit ledgers in the response. Setting this flag may cause the query to be slower. Cannot be used with as_of_date parameter.\n\n### Returns\n\n- `{ data: { id: string; commits: object[]; created_at: string; created_by: string; customer_id: string; overrides: object[]; scheduled_charges: scheduled_charge[]; starting_at: string; transitions: object[]; usage_filter: object[]; usage_statement_schedule: object; archived_at?: string; credits?: object[]; custom_fields?: object; customer_billing_provider_configuration?: object; discounts?: discount[]; ending_before?: string; has_more?: object; hierarchy_configuration?: object | object; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration_v2; priority?: number; professional_services?: pro_service[]; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; reseller_royalties?: object[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration_v2; spend_trackers?: object[]; subscriptions?: object[]; total_contract_value?: number; uniqueness_key?: string; }; }`\n\n - `data: { id: string; commits: { id: string; created_at: string; product: { id: string; name: string; }; type: 'PREPAID' | 'POSTPAID'; access_schedule?: object; applicable_contract_ids?: string[]; applicable_product_ids?: string[]; applicable_product_tags?: string[]; archived_at?: string; balance?: number; contract?: { id: string; }; custom_fields?: object; description?: string; hierarchy_configuration?: object; invoice_contract?: { id: string; }; invoice_schedule?: object; ledger?: { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_SEGMENT_START'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_ROLLOVER'; } | { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_EXPIRATION'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_CANCELED'; contract_id?: string; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_CREDITED'; contract_id?: string; } | { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT'; } | { amount: number; timestamp: string; type: 'POSTPAID_COMMIT_INITIAL_BALANCE'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'POSTPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'POSTPAID_COMMIT_ROLLOVER'; } | { amount: number; invoice_id: string; timestamp: string; type: 'POSTPAID_COMMIT_TRUEUP'; contract_id?: string; } | { amount: number; reason: string; timestamp: string; type: 'PREPAID_COMMIT_MANUAL'; } | { amount: number; reason: string; timestamp: string; type: 'POSTPAID_COMMIT_MANUAL'; } | { amount: number; timestamp: string; type: 'POSTPAID_COMMIT_EXPIRATION'; }[]; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurring_commit_id?: string; rolled_over_from?: { commit_id: string; contract_id: string; }; rollover_fraction?: number; salesforce_opportunity_id?: string; specifiers?: object[]; spend_tracker_attributes?: { counts_as_discounted: boolean; }; subscription_config?: object; }[]; created_at: string; created_by: string; customer_id: string; overrides: { id: string; created_at: string; starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; override_tiers?: object[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type?: credit_type_data; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: tier[]; }; priority?: number; product?: { id: string; name: string; }; target?: 'COMMIT_RATE' | 'LIST_RATE'; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]; scheduled_charges: { id: string; product: object; schedule: schedule_point_in_time; archived_at?: string; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]; starting_at: string; transitions: { from_contract_id: string; to_contract_id: string; type: 'SUPERSEDE' | 'RENEWAL'; }[]; usage_filter: { group_key: string; group_values: string[]; starting_at: string; ending_before?: string; }[]; usage_statement_schedule: { billing_anchor_date: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; }; archived_at?: string; credits?: { id: string; product: { id: string; name: string; }; type: 'CREDIT'; access_schedule?: object; applicable_contract_ids?: string[]; applicable_product_ids?: string[]; applicable_product_tags?: string[]; archived_at?: string; balance?: number; contract?: { id: string; }; created_at?: string; custom_fields?: object; description?: string; hierarchy_configuration?: object; ledger?: { amount: number; segment_id: string; timestamp: string; type: 'CREDIT_SEGMENT_START'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'CREDIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; segment_id: string; timestamp: string; type: 'CREDIT_EXPIRATION'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'CREDIT_CANCELED'; contract_id?: string; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'CREDIT_CREDITED'; contract_id?: string; } | { amount: number; reason: string; timestamp: string; type: 'CREDIT_MANUAL'; } | { amount: number; segment_id: string; timestamp: string; type: 'CREDIT_SEAT_BASED_ADJUSTMENT'; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'CREDIT_ROLLOVER'; }[]; name?: string; netsuite_sales_order_id?: string; priority?: number; recurring_credit_id?: string; rolled_over_from?: { contract_id: string; credit_id: string; }; salesforce_opportunity_id?: string; specifiers?: object[]; subscription_config?: object; }[]; custom_fields?: object; customer_billing_provider_configuration?: { id: string; billing_provider: string; delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }; discounts?: { id: string; product: object; schedule: schedule_point_in_time; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]; ending_before?: string; has_more?: { commits: boolean; credits: boolean; }; hierarchy_configuration?: { children: { contract_id: string; customer_id: string; }[]; parent_behavior?: { invoice_consolidation_type?: 'CONCATENATE' | 'NONE'; }; } | { parent: { contract_id: string; customer_id: string; }; payer?: 'SELF' | 'PARENT'; usage_statement_behavior?: 'CONSOLIDATE' | 'SEPARATE'; }; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config_v2; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; }; priority?: number; professional_services?: { id: string; max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[]; rate_card_id?: string; recurring_commits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; contract?: { id: string; }; description?: string; ending_before?: string; hierarchy_configuration?: object; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: object; }[]; recurring_credits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; contract?: { id: string; }; description?: string; ending_before?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: object; }[]; reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; segments: { fraction: number; netsuite_reseller_id: string; reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; ending_before?: string; gcp_account_id?: string; gcp_offer_id?: string; reseller_contract_value?: number; }[]; }[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config_v2; threshold_amount: number; discount_configuration?: object; }; spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; accumulated_spend?: { amount: number; period_ending_before: string; period_starting_at: string; }; }[]; subscriptions?: { billing_periods: { current?: object; next?: object; previous?: object; }; collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated: boolean; }; quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY'; quantity_schedule: { quantity: number; starting_at: string; ending_before?: string; }[]; starting_at: string; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product: object; }; id?: string; custom_fields?: object; description?: string; ending_before?: string; fiat_credit_type_id?: string; name?: string; seat_config?: { seat_group_key: string; }; }[]; total_contract_value?: number; uniqueness_key?: string; }`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst contract = await client.v2.contracts.retrieve({ contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc', customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d' });\n\nconsole.log(contract);\n```",
+ "## retrieve\n\n`client.v2.contracts.retrieve(contract_id: string, customer_id: string, as_of_date?: string, include_balance?: boolean, include_ledgers?: boolean): { data: contract_v2; }`\n\n**post** `/v2/contracts/get`\n\nGets the details for a specific contract, including contract term, rate card information, credits and commits, and more. \n\n### Use this endpoint to: \n- Check the duration of a customer's current contract\n- Get details on contract terms, including access schedule amounts for commitments and credits\n- Understand the state of a contract at a past time. As you can evolve the terms of a contract over time through editing, use the `as_of_date` parameter to view the full contract configuration as of that point in time. \n\n### Usage guidelines: \n- Optionally, use the `include_balance` and `include_ledger` fields to include balances and ledgers in the credit and commit responses. Using these fields will cause the query to be slower.\n\n\n### Parameters\n\n- `contract_id: string`\n\n- `customer_id: string`\n\n- `as_of_date?: string`\n Optional RFC 3339 timestamp. Return the contract as of this date. Cannot be used with include_ledgers parameter.\n\n- `include_balance?: boolean`\n Include the balance of credits and commits in the response. Setting this flag may cause the query to be slower.\n\n- `include_ledgers?: boolean`\n Include commit/credit ledgers in the response. Setting this flag may cause the query to be slower. Cannot be used with as_of_date parameter.\n\n### Returns\n\n- `{ data: { id: string; commits: object[]; created_at: string; created_by: string; customer_id: string; overrides: object[]; scheduled_charges: scheduled_charge[]; starting_at: string; transitions: object[]; usage_filter: object[]; usage_statement_schedule: object; archived_at?: string; credits?: object[]; custom_fields?: object; customer_billing_provider_configuration?: object; discounts?: discount[]; ending_before?: string; has_more?: object; hierarchy_configuration?: object | object; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration_v2; priority?: number; professional_services?: pro_service[]; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; reseller_royalties?: object[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration_v2; spend_trackers?: object[]; subscriptions?: object[]; total_contract_value?: number; uniqueness_key?: string; }; }`\n\n - `data: { id: string; commits: { id: string; created_at: string; product: { id: string; name: string; }; type: 'PREPAID' | 'POSTPAID'; access_schedule?: object; applicable_contract_ids?: string[]; applicable_product_ids?: string[]; applicable_product_tags?: string[]; archived_at?: string; balance?: number; contract?: { id: string; }; custom_fields?: object; description?: string; hierarchy_configuration?: object; invoice_contract?: { id: string; }; invoice_schedule?: object; ledger?: { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_SEGMENT_START'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_ROLLOVER'; } | { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_EXPIRATION'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_CANCELED'; contract_id?: string; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_CREDITED'; contract_id?: string; } | { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT'; } | { amount: number; timestamp: string; type: 'POSTPAID_COMMIT_INITIAL_BALANCE'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'POSTPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'POSTPAID_COMMIT_ROLLOVER'; } | { amount: number; invoice_id: string; timestamp: string; type: 'POSTPAID_COMMIT_TRUEUP'; contract_id?: string; } | { amount: number; reason: string; timestamp: string; type: 'PREPAID_COMMIT_MANUAL'; } | { amount: number; reason: string; timestamp: string; type: 'POSTPAID_COMMIT_MANUAL'; } | { amount: number; timestamp: string; type: 'POSTPAID_COMMIT_EXPIRATION'; }[]; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurring_commit_id?: string; rolled_over_from?: { commit_id: string; contract_id: string; }; rollover_fraction?: number; salesforce_opportunity_id?: string; specifiers?: object[]; spend_tracker_attributes?: { counts_as_discounted: boolean; }; subscription_config?: object; }[]; created_at: string; created_by: string; customer_id: string; overrides: { id: string; created_at: string; starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; override_tiers?: object[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type?: credit_type_data; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: tier[]; }; priority?: number; product?: { id: string; name: string; }; target?: 'COMMIT_RATE' | 'LIST_RATE'; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]; scheduled_charges: { id: string; product: object; schedule: schedule_point_in_time; archived_at?: string; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]; starting_at: string; transitions: { from_contract_id: string; to_contract_id: string; type: 'SUPERSEDE' | 'RENEWAL'; }[]; usage_filter: { group_key: string; group_values: string[]; starting_at: string; ending_before?: string; }[]; usage_statement_schedule: { billing_anchor_date: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; }; archived_at?: string; credits?: { id: string; product: { id: string; name: string; }; type: 'CREDIT'; access_schedule?: object; applicable_contract_ids?: string[]; applicable_product_ids?: string[]; applicable_product_tags?: string[]; archived_at?: string; balance?: number; contract?: { id: string; }; created_at?: string; custom_fields?: object; description?: string; hierarchy_configuration?: object; ledger?: { amount: number; segment_id: string; timestamp: string; type: 'CREDIT_SEGMENT_START'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'CREDIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; segment_id: string; timestamp: string; type: 'CREDIT_EXPIRATION'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'CREDIT_CANCELED'; contract_id?: string; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'CREDIT_CREDITED'; contract_id?: string; } | { amount: number; reason: string; timestamp: string; type: 'CREDIT_MANUAL'; } | { amount: number; segment_id: string; timestamp: string; type: 'CREDIT_SEAT_BASED_ADJUSTMENT'; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'CREDIT_ROLLOVER'; }[]; name?: string; netsuite_sales_order_id?: string; priority?: number; recurring_credit_id?: string; rolled_over_from?: { contract_id: string; credit_id: string; }; salesforce_opportunity_id?: string; specifiers?: object[]; subscription_config?: object; }[]; custom_fields?: object; customer_billing_provider_configuration?: { id: string; billing_provider: string; delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }; discounts?: { id: string; product: object; schedule: schedule_point_in_time; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]; ending_before?: string; has_more?: { commits: boolean; credits: boolean; }; hierarchy_configuration?: { children: { contract_id: string; customer_id: string; }[]; parent_behavior?: { invoice_consolidation_type?: 'CONCATENATE' | 'NONE'; }; } | { parent: { contract_id: string; customer_id: string; }; payer?: 'SELF' | 'PARENT'; usage_statement_behavior?: 'CONSOLIDATE' | 'SEPARATE'; }; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config_v2; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; threshold_balance_specifiers?: object[]; }; priority?: number; professional_services?: { id: string; max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[]; rate_card_id?: string; recurring_commits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; contract?: { id: string; }; description?: string; ending_before?: string; hierarchy_configuration?: object; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: object; }[]; recurring_credits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; contract?: { id: string; }; description?: string; ending_before?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: object; }[]; reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; segments: { fraction: number; netsuite_reseller_id: string; reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; ending_before?: string; gcp_account_id?: string; gcp_offer_id?: string; reseller_contract_value?: number; }[]; }[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config_v2; threshold_amount: number; discount_configuration?: object; }; spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; accumulated_spend?: { amount: number; period_ending_before: string; period_starting_at: string; }; }[]; subscriptions?: { billing_periods: { current?: object; next?: object; previous?: object; }; collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated: boolean; }; quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY'; quantity_schedule: { quantity: number; starting_at: string; ending_before?: string; }[]; starting_at: string; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product: object; }; id?: string; custom_fields?: object; description?: string; ending_before?: string; fiat_credit_type_id?: string; name?: string; seat_config?: { seat_group_key: string; }; }[]; total_contract_value?: number; uniqueness_key?: string; }`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst contract = await client.v2.contracts.retrieve({ contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc', customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d' });\n\nconsole.log(contract);\n```",
perLanguage: {
typescript: {
method: 'client.v2.contracts.retrieve',
@@ -122,7 +122,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
response:
"{ data: { id: string; commits: object[]; created_at: string; created_by: string; customer_id: string; overrides: object[]; scheduled_charges: scheduled_charge[]; starting_at: string; transitions: object[]; usage_filter: object[]; usage_statement_schedule: object; archived_at?: string; credits?: object[]; custom_fields?: object; customer_billing_provider_configuration?: object; discounts?: discount[]; ending_before?: string; has_more?: object; hierarchy_configuration?: object | object; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration_v2; priority?: number; professional_services?: pro_service[]; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; reseller_royalties?: object[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration_v2; spend_trackers?: object[]; subscriptions?: object[]; total_contract_value?: number; uniqueness_key?: string; }[]; }",
markdown:
- "## list\n\n`client.v2.contracts.list(customer_id: string, covering_date?: string, include_archived?: boolean, include_balance?: boolean, include_ledgers?: boolean, starting_at?: string): { data: contract_v2[]; }`\n\n**post** `/v2/contracts/list`\n\nFor a given customer, lists all of their contracts in chronological order. \n\n### Use this endpoint to:\n- Check if a customer is provisioned with any contract, and at which tier\n- Check the duration and terms of a customer's current contract\n- Power a page in your end customer experience that shows the customer's history of tiers (e.g. this customer started out on the Pro Plan, then downgraded to the Starter plan).\n\n### Usage guidelines:\nUse the `starting_at`, `covering_date`, and `include_archived` parameters to filter the list of returned contracts. For example, to list only currently active contracts, pass `covering_date` equal to the current time.\n\n\n### Parameters\n\n- `customer_id: string`\n\n- `covering_date?: string`\n Optional RFC 3339 timestamp. Only include contracts active on the provided date. This cannot be provided if starting_at filter is provided.\n\n- `include_archived?: boolean`\n Include archived contracts in the response.\n\n- `include_balance?: boolean`\n Include the balance of credits and commits in the response. Setting this flag may cause the response to be slower.\n\n- `include_ledgers?: boolean`\n Include commit/credit ledgers in the response. Setting this flag may cause the response to be slower.\n\n- `starting_at?: string`\n Optional RFC 3339 timestamp. Only include contracts that started on or after this date. This cannot be provided if covering_date filter is provided.\n\n### Returns\n\n- `{ data: { id: string; commits: object[]; created_at: string; created_by: string; customer_id: string; overrides: object[]; scheduled_charges: scheduled_charge[]; starting_at: string; transitions: object[]; usage_filter: object[]; usage_statement_schedule: object; archived_at?: string; credits?: object[]; custom_fields?: object; customer_billing_provider_configuration?: object; discounts?: discount[]; ending_before?: string; has_more?: object; hierarchy_configuration?: object | object; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration_v2; priority?: number; professional_services?: pro_service[]; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; reseller_royalties?: object[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration_v2; spend_trackers?: object[]; subscriptions?: object[]; total_contract_value?: number; uniqueness_key?: string; }[]; }`\n\n - `data: { id: string; commits: { id: string; created_at: string; product: { id: string; name: string; }; type: 'PREPAID' | 'POSTPAID'; access_schedule?: object; applicable_contract_ids?: string[]; applicable_product_ids?: string[]; applicable_product_tags?: string[]; archived_at?: string; balance?: number; contract?: { id: string; }; custom_fields?: object; description?: string; hierarchy_configuration?: object; invoice_contract?: { id: string; }; invoice_schedule?: object; ledger?: { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_SEGMENT_START'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_ROLLOVER'; } | { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_EXPIRATION'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_CANCELED'; contract_id?: string; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_CREDITED'; contract_id?: string; } | { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT'; } | { amount: number; timestamp: string; type: 'POSTPAID_COMMIT_INITIAL_BALANCE'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'POSTPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'POSTPAID_COMMIT_ROLLOVER'; } | { amount: number; invoice_id: string; timestamp: string; type: 'POSTPAID_COMMIT_TRUEUP'; contract_id?: string; } | { amount: number; reason: string; timestamp: string; type: 'PREPAID_COMMIT_MANUAL'; } | { amount: number; reason: string; timestamp: string; type: 'POSTPAID_COMMIT_MANUAL'; } | { amount: number; timestamp: string; type: 'POSTPAID_COMMIT_EXPIRATION'; }[]; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurring_commit_id?: string; rolled_over_from?: { commit_id: string; contract_id: string; }; rollover_fraction?: number; salesforce_opportunity_id?: string; specifiers?: object[]; spend_tracker_attributes?: { counts_as_discounted: boolean; }; subscription_config?: object; }[]; created_at: string; created_by: string; customer_id: string; overrides: { id: string; created_at: string; starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; override_tiers?: object[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type?: credit_type_data; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: tier[]; }; priority?: number; product?: { id: string; name: string; }; target?: 'COMMIT_RATE' | 'LIST_RATE'; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]; scheduled_charges: { id: string; product: object; schedule: schedule_point_in_time; archived_at?: string; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]; starting_at: string; transitions: { from_contract_id: string; to_contract_id: string; type: 'SUPERSEDE' | 'RENEWAL'; }[]; usage_filter: { group_key: string; group_values: string[]; starting_at: string; ending_before?: string; }[]; usage_statement_schedule: { billing_anchor_date: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; }; archived_at?: string; credits?: { id: string; product: { id: string; name: string; }; type: 'CREDIT'; access_schedule?: object; applicable_contract_ids?: string[]; applicable_product_ids?: string[]; applicable_product_tags?: string[]; archived_at?: string; balance?: number; contract?: { id: string; }; created_at?: string; custom_fields?: object; description?: string; hierarchy_configuration?: object; ledger?: { amount: number; segment_id: string; timestamp: string; type: 'CREDIT_SEGMENT_START'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'CREDIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; segment_id: string; timestamp: string; type: 'CREDIT_EXPIRATION'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'CREDIT_CANCELED'; contract_id?: string; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'CREDIT_CREDITED'; contract_id?: string; } | { amount: number; reason: string; timestamp: string; type: 'CREDIT_MANUAL'; } | { amount: number; segment_id: string; timestamp: string; type: 'CREDIT_SEAT_BASED_ADJUSTMENT'; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'CREDIT_ROLLOVER'; }[]; name?: string; netsuite_sales_order_id?: string; priority?: number; recurring_credit_id?: string; rolled_over_from?: { contract_id: string; credit_id: string; }; salesforce_opportunity_id?: string; specifiers?: object[]; subscription_config?: object; }[]; custom_fields?: object; customer_billing_provider_configuration?: { id: string; billing_provider: string; delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }; discounts?: { id: string; product: object; schedule: schedule_point_in_time; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]; ending_before?: string; has_more?: { commits: boolean; credits: boolean; }; hierarchy_configuration?: { children: { contract_id: string; customer_id: string; }[]; parent_behavior?: { invoice_consolidation_type?: 'CONCATENATE' | 'NONE'; }; } | { parent: { contract_id: string; customer_id: string; }; payer?: 'SELF' | 'PARENT'; usage_statement_behavior?: 'CONSOLIDATE' | 'SEPARATE'; }; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config_v2; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; }; priority?: number; professional_services?: { id: string; max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[]; rate_card_id?: string; recurring_commits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; contract?: { id: string; }; description?: string; ending_before?: string; hierarchy_configuration?: object; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: object; }[]; recurring_credits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; contract?: { id: string; }; description?: string; ending_before?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: object; }[]; reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; segments: { fraction: number; netsuite_reseller_id: string; reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; ending_before?: string; gcp_account_id?: string; gcp_offer_id?: string; reseller_contract_value?: number; }[]; }[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config_v2; threshold_amount: number; discount_configuration?: object; }; spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; accumulated_spend?: { amount: number; period_ending_before: string; period_starting_at: string; }; }[]; subscriptions?: { billing_periods: { current?: object; next?: object; previous?: object; }; collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated: boolean; }; quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY'; quantity_schedule: { quantity: number; starting_at: string; ending_before?: string; }[]; starting_at: string; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product: object; }; id?: string; custom_fields?: object; description?: string; ending_before?: string; fiat_credit_type_id?: string; name?: string; seat_config?: { seat_group_key: string; }; }[]; total_contract_value?: number; uniqueness_key?: string; }[]`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst contracts = await client.v2.contracts.list({ customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d' });\n\nconsole.log(contracts);\n```",
+ "## list\n\n`client.v2.contracts.list(customer_id: string, covering_date?: string, include_archived?: boolean, include_balance?: boolean, include_ledgers?: boolean, starting_at?: string): { data: contract_v2[]; }`\n\n**post** `/v2/contracts/list`\n\nFor a given customer, lists all of their contracts in chronological order. \n\n### Use this endpoint to:\n- Check if a customer is provisioned with any contract, and at which tier\n- Check the duration and terms of a customer's current contract\n- Power a page in your end customer experience that shows the customer's history of tiers (e.g. this customer started out on the Pro Plan, then downgraded to the Starter plan).\n\n### Usage guidelines:\nUse the `starting_at`, `covering_date`, and `include_archived` parameters to filter the list of returned contracts. For example, to list only currently active contracts, pass `covering_date` equal to the current time.\n\n\n### Parameters\n\n- `customer_id: string`\n\n- `covering_date?: string`\n Optional RFC 3339 timestamp. Only include contracts active on the provided date. This cannot be provided if starting_at filter is provided.\n\n- `include_archived?: boolean`\n Include archived contracts in the response.\n\n- `include_balance?: boolean`\n Include the balance of credits and commits in the response. Setting this flag may cause the response to be slower.\n\n- `include_ledgers?: boolean`\n Include commit/credit ledgers in the response. Setting this flag may cause the response to be slower.\n\n- `starting_at?: string`\n Optional RFC 3339 timestamp. Only include contracts that started on or after this date. This cannot be provided if covering_date filter is provided.\n\n### Returns\n\n- `{ data: { id: string; commits: object[]; created_at: string; created_by: string; customer_id: string; overrides: object[]; scheduled_charges: scheduled_charge[]; starting_at: string; transitions: object[]; usage_filter: object[]; usage_statement_schedule: object; archived_at?: string; credits?: object[]; custom_fields?: object; customer_billing_provider_configuration?: object; discounts?: discount[]; ending_before?: string; has_more?: object; hierarchy_configuration?: object | object; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration_v2; priority?: number; professional_services?: pro_service[]; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; reseller_royalties?: object[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration_v2; spend_trackers?: object[]; subscriptions?: object[]; total_contract_value?: number; uniqueness_key?: string; }[]; }`\n\n - `data: { id: string; commits: { id: string; created_at: string; product: { id: string; name: string; }; type: 'PREPAID' | 'POSTPAID'; access_schedule?: object; applicable_contract_ids?: string[]; applicable_product_ids?: string[]; applicable_product_tags?: string[]; archived_at?: string; balance?: number; contract?: { id: string; }; custom_fields?: object; description?: string; hierarchy_configuration?: object; invoice_contract?: { id: string; }; invoice_schedule?: object; ledger?: { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_SEGMENT_START'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_ROLLOVER'; } | { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_EXPIRATION'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_CANCELED'; contract_id?: string; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_CREDITED'; contract_id?: string; } | { amount: number; segment_id: string; timestamp: string; type: 'PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT'; } | { amount: number; timestamp: string; type: 'POSTPAID_COMMIT_INITIAL_BALANCE'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'POSTPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'POSTPAID_COMMIT_ROLLOVER'; } | { amount: number; invoice_id: string; timestamp: string; type: 'POSTPAID_COMMIT_TRUEUP'; contract_id?: string; } | { amount: number; reason: string; timestamp: string; type: 'PREPAID_COMMIT_MANUAL'; } | { amount: number; reason: string; timestamp: string; type: 'POSTPAID_COMMIT_MANUAL'; } | { amount: number; timestamp: string; type: 'POSTPAID_COMMIT_EXPIRATION'; }[]; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurring_commit_id?: string; rolled_over_from?: { commit_id: string; contract_id: string; }; rollover_fraction?: number; salesforce_opportunity_id?: string; specifiers?: object[]; spend_tracker_attributes?: { counts_as_discounted: boolean; }; subscription_config?: object; }[]; created_at: string; created_by: string; customer_id: string; overrides: { id: string; created_at: string; starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; override_tiers?: object[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type?: credit_type_data; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: tier[]; }; priority?: number; product?: { id: string; name: string; }; target?: 'COMMIT_RATE' | 'LIST_RATE'; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]; scheduled_charges: { id: string; product: object; schedule: schedule_point_in_time; archived_at?: string; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]; starting_at: string; transitions: { from_contract_id: string; to_contract_id: string; type: 'SUPERSEDE' | 'RENEWAL'; }[]; usage_filter: { group_key: string; group_values: string[]; starting_at: string; ending_before?: string; }[]; usage_statement_schedule: { billing_anchor_date: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; }; archived_at?: string; credits?: { id: string; product: { id: string; name: string; }; type: 'CREDIT'; access_schedule?: object; applicable_contract_ids?: string[]; applicable_product_ids?: string[]; applicable_product_tags?: string[]; archived_at?: string; balance?: number; contract?: { id: string; }; created_at?: string; custom_fields?: object; description?: string; hierarchy_configuration?: object; ledger?: { amount: number; segment_id: string; timestamp: string; type: 'CREDIT_SEGMENT_START'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'CREDIT_AUTOMATED_INVOICE_DEDUCTION'; contract_id?: string; } | { amount: number; segment_id: string; timestamp: string; type: 'CREDIT_EXPIRATION'; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'CREDIT_CANCELED'; contract_id?: string; } | { amount: number; invoice_id: string; segment_id: string; timestamp: string; type: 'CREDIT_CREDITED'; contract_id?: string; } | { amount: number; reason: string; timestamp: string; type: 'CREDIT_MANUAL'; } | { amount: number; segment_id: string; timestamp: string; type: 'CREDIT_SEAT_BASED_ADJUSTMENT'; } | { amount: number; new_contract_id: string; segment_id: string; timestamp: string; type: 'CREDIT_ROLLOVER'; }[]; name?: string; netsuite_sales_order_id?: string; priority?: number; recurring_credit_id?: string; rolled_over_from?: { contract_id: string; credit_id: string; }; salesforce_opportunity_id?: string; specifiers?: object[]; subscription_config?: object; }[]; custom_fields?: object; customer_billing_provider_configuration?: { id: string; billing_provider: string; delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }; discounts?: { id: string; product: object; schedule: schedule_point_in_time; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]; ending_before?: string; has_more?: { commits: boolean; credits: boolean; }; hierarchy_configuration?: { children: { contract_id: string; customer_id: string; }[]; parent_behavior?: { invoice_consolidation_type?: 'CONCATENATE' | 'NONE'; }; } | { parent: { contract_id: string; customer_id: string; }; payer?: 'SELF' | 'PARENT'; usage_statement_behavior?: 'CONSOLIDATE' | 'SEPARATE'; }; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config_v2; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; threshold_balance_specifiers?: object[]; }; priority?: number; professional_services?: { id: string; max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[]; rate_card_id?: string; recurring_commits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; contract?: { id: string; }; description?: string; ending_before?: string; hierarchy_configuration?: object; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: object; }[]; recurring_credits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; contract?: { id: string; }; description?: string; ending_before?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: object; }[]; reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; segments: { fraction: number; netsuite_reseller_id: string; reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; ending_before?: string; gcp_account_id?: string; gcp_offer_id?: string; reseller_contract_value?: number; }[]; }[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config_v2; threshold_amount: number; discount_configuration?: object; }; spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; accumulated_spend?: { amount: number; period_ending_before: string; period_starting_at: string; }; }[]; subscriptions?: { billing_periods: { current?: object; next?: object; previous?: object; }; collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated: boolean; }; quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY'; quantity_schedule: { quantity: number; starting_at: string; ending_before?: string; }[]; starting_at: string; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product: object; }; id?: string; custom_fields?: object; description?: string; ending_before?: string; fiat_credit_type_id?: string; name?: string; seat_config?: { seat_group_key: string; }; }[]; total_contract_value?: number; uniqueness_key?: string; }[]`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst contracts = await client.v2.contracts.list({ customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d' });\n\nconsole.log(contracts);\n```",
perLanguage: {
typescript: {
method: 'client.v2.contracts.list',
@@ -172,7 +172,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
"add_credits?: { access_schedule: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[];",
"add_discounts?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[];",
"add_overrides?: { starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: { price: number; size?: number; }[]; }; priority?: number; product_id?: string; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[];",
- "add_prepaid_balance_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; };",
+ "add_prepaid_balance_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; threshold_balance_specifiers?: { exclude: { custom_field_filters: object[]; }[]; }[]; };",
'add_professional_services?: { max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[];',
"add_recurring_commits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'POOLED' | 'INDIVIDUAL'; }; temporary_id?: string; }[];",
"add_recurring_credits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'POOLED' | 'INDIVIDUAL'; }; temporary_id?: string; }[];",
@@ -194,7 +194,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
'update_contract_name?: string;',
"update_credits?: { credit_id: string; access_schedule?: { add_schedule_items?: { amount: number; ending_before: string; starting_at: string; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; ending_before?: string; starting_at?: string; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; rollover_fraction?: number; }[];",
'update_net_payment_terms_days?: number;',
- "update_prepaid_balance_threshold_configuration?: { commit?: { description?: string; name?: string; priority?: number; product_id?: string; }; custom_credit_type_id?: string; discount_configuration?: { cap?: { amount: number; spend_tracker_alias: string; }; payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount?: number; threshold_amount?: number; };",
+ "update_prepaid_balance_threshold_configuration?: { commit?: { description?: string; name?: string; priority?: number; product_id?: string; }; custom_credit_type_id?: string; discount_configuration?: { cap?: { amount: number; spend_tracker_alias: string; }; payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount?: number; threshold_amount?: number; threshold_balance_specifiers?: { exclude: { custom_field_filters: { entity: 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit'; key: string; value: string; }[]; }[]; }[]; };",
"update_recurring_commits?: { recurring_commit_id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; invoice_amount?: { quantity?: number; unit_price?: number; }; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[];",
"update_recurring_credits?: { recurring_credit_id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[];",
'update_scheduled_charges?: { scheduled_charge_id: string; invoice_schedule?: { add_schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; quantity?: number; timestamp?: string; unit_price?: number; }[]; }; netsuite_sales_order_id?: string; }[];',
@@ -203,7 +203,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
],
response: '{ data: { id: string; }; }',
markdown:
- "## edit\n\n`client.v2.contracts.edit(contract_id: string, customer_id: string, add_billing_provider_configuration_update?: { billing_provider_configuration: { billing_provider?: string; billing_provider_configuration_id?: string; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }; schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }; }, add_commits?: { product_id: string; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: object[]; credit_type_id?: string; }; amount?: number; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: object; invoice_schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; name?: string; netsuite_sales_order_id?: string; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: object[]; spend_tracker_attributes?: { counts_as_discounted: boolean; }; temporary_id?: string; }[], add_credits?: { access_schedule: { schedule_items: object[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: object[]; }[], add_discounts?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[], add_overrides?: { starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: tier[]; }; priority?: number; product_id?: string; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[], add_prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config_v2; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; }, add_professional_services?: { max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[], add_recurring_commits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: object; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { apply_seat_increase_config: object; subscription_id: string; allocation?: 'POOLED' | 'INDIVIDUAL'; }; temporary_id?: string; }[], add_recurring_credits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { apply_seat_increase_config: object; subscription_id: string; allocation?: 'POOLED' | 'INDIVIDUAL'; }; temporary_id?: string; }[], add_reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_options?: { aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; }; ending_before?: string; fraction?: number; gcp_options?: { gcp_account_id?: string; gcp_offer_id?: string; }; netsuite_reseller_id?: string; reseller_contract_value?: number; starting_at?: string; }[], add_revenue_system_configuration_update?: { revenue_system_configuration: { delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; provider?: 'netsuite'; revenue_system_configuration_id?: string; }; schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }; }, add_scheduled_charges?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[], add_spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config_v2; threshold_amount: number; discount_configuration?: object; }, add_spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[], add_subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated?: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product_id: string; }; custom_fields?: object; description?: string; ending_before?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { initial_seat_ids: string[]; seat_group_key: string; initial_unassigned_seats?: number; }; starting_at?: string; temporary_id?: string; }[], allow_contract_ending_before_finalized_invoice?: boolean, archive_commits?: { id: string; }[], archive_credits?: { id: string; }[], archive_scheduled_charges?: { id: string; }[], archive_spend_trackers?: string[], remove_overrides?: { id: string; }[], uniqueness_key?: string, update_commits?: { commit_id: string; access_schedule?: { add_schedule_items?: object[]; remove_schedule_items?: object[]; update_schedule_items?: object[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: object; invoice_schedule?: { add_schedule_items?: object[]; remove_schedule_items?: object[]; update_schedule_items?: object[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; rollover_fraction?: number; }[], update_contract_end_date?: string, update_contract_name?: string, update_credits?: { credit_id: string; access_schedule?: { add_schedule_items?: object[]; remove_schedule_items?: object[]; update_schedule_items?: object[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; rollover_fraction?: number; }[], update_net_payment_terms_days?: number, update_prepaid_balance_threshold_configuration?: { commit?: object; custom_credit_type_id?: string; discount_configuration?: { cap?: object; payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: object; recharge_to_amount?: number; threshold_amount?: number; }, update_recurring_commits?: { recurring_commit_id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; invoice_amount?: { quantity?: number; unit_price?: number; }; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[], update_recurring_credits?: { recurring_credit_id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[], update_scheduled_charges?: { scheduled_charge_id: string; invoice_schedule?: { add_schedule_items?: object[]; remove_schedule_items?: object[]; update_schedule_items?: object[]; }; netsuite_sales_order_id?: string; }[], update_spend_threshold_configuration?: { commit?: object; discount_configuration?: { cap?: object; payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: object; threshold_amount?: number; }, update_subscriptions?: { subscription_id: string; ending_before?: string; quantity_management_mode_update?: { quantity_management_mode: 'SEAT_BASED'; seat_config: object; }; quantity_updates?: { starting_at: string; quantity?: number; quantity_delta?: number; }[]; seat_updates?: { add_seat_ids?: object[]; add_unassigned_seats?: object[]; remove_seat_ids?: object[]; remove_unassigned_seats?: object[]; }; }[]): { data: id; }`\n\n**post** `/v2/contracts/edit`\n\nThe ability to edit a contract helps you react quickly to the needs of your customers and your business.\n\n### Use this endpoint to:\n- Encode mid-term commitment and discount changes\n- Fix configuration mistakes and easily roll back packaging changes\n\n### Key response fields:\n- The `id` of the edit\n- Complete edit details. For example, if you edited the contract to add new overrides and credits, you will receive the IDs of those overrides and credits in the response.\n\n### Usage guidelines:\n- When you edit a contract, any draft invoices update immediately to reflect that edit. Finalized invoices remain unchanged - you must void and regenerate them in the UI or API to reflect the edit.\n- Contract editing must be enabled to use this endpoint. Reach out to your Metronome representative to learn more.\n\n\n### Parameters\n\n- `contract_id: string`\n ID of the contract being edited\n\n- `customer_id: string`\n ID of the customer whose contract is being edited\n\n- `add_billing_provider_configuration_update?: { billing_provider_configuration: { billing_provider?: string; billing_provider_configuration_id?: string; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }; schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }; }`\n Update the billing provider configuration on the contract. Currently only supports adding a billing provider configuration to a contract that does not already have one.\n - `billing_provider_configuration: { billing_provider?: string; billing_provider_configuration_id?: string; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }`\n - `schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }`\n Indicates when the billing provider will be active on the contract. Any charges accrued during the schedule will be billed to the indicated billing provider.\n\n- `add_commits?: { product_id: string; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; amount?: number; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; on_session_payment?: boolean; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; spend_tracker_attributes?: { counts_as_discounted: boolean; }; temporary_id?: string; }[]`\n\n- `add_credits?: { access_schedule: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]`\n\n- `add_discounts?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]`\n\n- `add_overrides?: { starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: { price: number; size?: number; }[]; }; priority?: number; product_id?: string; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]`\n\n- `add_prepaid_balance_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; }`\n - `commit: { product_id: string; description?: string; name?: string; priority?: number; }`\n - `is_enabled: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `recharge_to_amount: number`\n Specify the amount the balance should be recharged to.\n - `threshold_amount: number`\n Specify the threshold amount for the contract. Each time the contract's balance lowers to this amount, a threshold charge will be initiated.\n - `custom_credit_type_id?: string`\n If provided, the threshold, recharge-to amount, and the resulting threshold commit amount will be in terms of this credit type instead of the fiat currency.\n - `discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }`\n\n- `add_professional_services?: { max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[]`\n This field's availability is dependent on your client's configuration.\n\n- `add_recurring_commits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'POOLED' | 'INDIVIDUAL'; }; temporary_id?: string; }[]`\n\n- `add_recurring_credits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'POOLED' | 'INDIVIDUAL'; }; temporary_id?: string; }[]`\n\n- `add_reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_options?: { aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; }; ending_before?: string; fraction?: number; gcp_options?: { gcp_account_id?: string; gcp_offer_id?: string; }; netsuite_reseller_id?: string; reseller_contract_value?: number; starting_at?: string; }[]`\n\n- `add_revenue_system_configuration_update?: { revenue_system_configuration: { delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; provider?: 'netsuite'; revenue_system_configuration_id?: string; }; schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }; }`\n Update the revenue system configuration on the contract. Currently only supports adding a revenue system configuration to a contract that does not already have one.\n - `revenue_system_configuration: { delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; provider?: 'netsuite'; revenue_system_configuration_id?: string; }`\n - `schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }`\n\n- `add_scheduled_charges?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]`\n\n- `add_spend_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount: number; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; }`\n - `commit: { product_id: string; description?: string; name?: string; priority?: number; }`\n - `is_enabled: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `threshold_amount: number`\n Specify the threshold amount for the contract. Each time the contract's usage hits this amount, a threshold charge will be initiated.\n - `discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }`\n\n- `add_spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[]`\n Spend trackers to add to this contract. Aliases must be unique within a contract.\n\n- `add_subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated?: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product_id: string; }; custom_fields?: object; description?: string; ending_before?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { initial_seat_ids: string[]; seat_group_key: string; initial_unassigned_seats?: number; }; starting_at?: string; temporary_id?: string; }[]`\n Optional list of [subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/) to add to the contract.\n\n- `allow_contract_ending_before_finalized_invoice?: boolean`\n If true, allows setting the contract end date earlier than the end_timestamp of existing finalized invoices. Finalized invoices will be unchanged; if you want to incorporate the new end date, you can void and regenerate finalized usage invoices. Defaults to true.\n\n- `archive_commits?: { id: string; }[]`\n IDs of commits to archive\n\n- `archive_credits?: { id: string; }[]`\n IDs of credits to archive\n\n- `archive_scheduled_charges?: { id: string; }[]`\n IDs of scheduled charges to archive\n\n- `archive_spend_trackers?: string[]`\n Aliases of spend trackers to archive.\n\n- `remove_overrides?: { id: string; }[]`\n IDs of overrides to remove\n\n- `uniqueness_key?: string`\n Optional uniqueness key to prevent duplicate contract edits.\n\n- `update_commits?: { commit_id: string; access_schedule?: { add_schedule_items?: { amount: number; ending_before: string; starting_at: string; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; ending_before?: string; starting_at?: string; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_schedule?: { add_schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; quantity?: number; timestamp?: string; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; rollover_fraction?: number; }[]`\n\n- `update_contract_end_date?: string`\n RFC 3339 timestamp indicating when the contract will end (exclusive).\n\n- `update_contract_name?: string`\n Value to update the contract name to. If not provided, the contract name will remain unchanged.\n\n- `update_credits?: { credit_id: string; access_schedule?: { add_schedule_items?: { amount: number; ending_before: string; starting_at: string; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; ending_before?: string; starting_at?: string; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; rollover_fraction?: number; }[]`\n\n- `update_net_payment_terms_days?: number`\n Number of days after issuance of invoice after which the invoice is due (e.g. Net 30).\n\n- `update_prepaid_balance_threshold_configuration?: { commit?: { description?: string; name?: string; priority?: number; product_id?: string; }; custom_credit_type_id?: string; discount_configuration?: { cap?: { amount: number; spend_tracker_alias: string; }; payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount?: number; threshold_amount?: number; }`\n - `commit?: { description?: string; name?: string; priority?: number; product_id?: string; }`\n - `custom_credit_type_id?: string`\n If provided, the threshold, recharge-to amount, and the resulting threshold commit amount will be in terms of this credit type instead of the fiat currency.\n - `discount_configuration?: { cap?: { amount: number; spend_tracker_alias: string; }; payment_fraction?: number; }`\n - `is_enabled?: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `recharge_to_amount?: number`\n Specify the amount the balance should be recharged to.\n - `threshold_amount?: number`\n Specify the threshold amount for the contract. Each time the contract's balance lowers to this amount, a threshold charge will be initiated.\n\n- `update_recurring_commits?: { recurring_commit_id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; invoice_amount?: { quantity?: number; unit_price?: number; }; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[]`\n Edits to these recurring commits will only affect commits whose access schedules has not started. Expired commits, and commits with an active access schedule will remain unchanged.\n\n- `update_recurring_credits?: { recurring_credit_id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[]`\n Edits to these recurring credits will only affect credits whose access schedules has not started. Expired credits, and credits with an active access schedule will remain unchanged.\n\n- `update_scheduled_charges?: { scheduled_charge_id: string; invoice_schedule?: { add_schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; quantity?: number; timestamp?: string; unit_price?: number; }[]; }; netsuite_sales_order_id?: string; }[]`\n\n- `update_spend_threshold_configuration?: { commit?: { description?: string; name?: string; priority?: number; product_id?: string; }; discount_configuration?: { cap?: { amount: number; spend_tracker_alias: string; }; payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount?: number; }`\n - `commit?: { description?: string; name?: string; priority?: number; product_id?: string; }`\n - `discount_configuration?: { cap?: { amount: number; spend_tracker_alias: string; }; payment_fraction?: number; }`\n - `is_enabled?: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `threshold_amount?: number`\n Specify the threshold amount for the contract. Each time the contract's usage hits this amount, a threshold charge will be initiated.\n\n- `update_subscriptions?: { subscription_id: string; ending_before?: string; quantity_management_mode_update?: { quantity_management_mode: 'SEAT_BASED'; seat_config: { seat_group_key: string; }; }; quantity_updates?: { starting_at: string; quantity?: number; quantity_delta?: number; }[]; seat_updates?: { add_seat_ids?: { seat_ids: string[]; starting_at: string; }[]; add_unassigned_seats?: { quantity: number; starting_at: string; }[]; remove_seat_ids?: { seat_ids: string[]; starting_at: string; }[]; remove_unassigned_seats?: { quantity: number; starting_at: string; }[]; }; }[]`\n Optional list of subscriptions to update.\n\n### Returns\n\n- `{ data: { id: string; }; }`\n\n - `data: { id: string; }`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst response = await client.v2.contracts.edit({ contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc', customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d' });\n\nconsole.log(response);\n```",
+ "## edit\n\n`client.v2.contracts.edit(contract_id: string, customer_id: string, add_billing_provider_configuration_update?: { billing_provider_configuration: { billing_provider?: string; billing_provider_configuration_id?: string; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }; schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }; }, add_commits?: { product_id: string; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: object[]; credit_type_id?: string; }; amount?: number; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: object; invoice_schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; name?: string; netsuite_sales_order_id?: string; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: object[]; spend_tracker_attributes?: { counts_as_discounted: boolean; }; temporary_id?: string; }[], add_credits?: { access_schedule: { schedule_items: object[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: object[]; }[], add_discounts?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[], add_overrides?: { starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: tier[]; }; priority?: number; product_id?: string; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[], add_prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config_v2; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; threshold_balance_specifiers?: object[]; }, add_professional_services?: { max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[], add_recurring_commits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: object; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { apply_seat_increase_config: object; subscription_id: string; allocation?: 'POOLED' | 'INDIVIDUAL'; }; temporary_id?: string; }[], add_recurring_credits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { apply_seat_increase_config: object; subscription_id: string; allocation?: 'POOLED' | 'INDIVIDUAL'; }; temporary_id?: string; }[], add_reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_options?: { aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; }; ending_before?: string; fraction?: number; gcp_options?: { gcp_account_id?: string; gcp_offer_id?: string; }; netsuite_reseller_id?: string; reseller_contract_value?: number; starting_at?: string; }[], add_revenue_system_configuration_update?: { revenue_system_configuration: { delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; provider?: 'netsuite'; revenue_system_configuration_id?: string; }; schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }; }, add_scheduled_charges?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[], add_spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config_v2; threshold_amount: number; discount_configuration?: object; }, add_spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[], add_subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated?: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product_id: string; }; custom_fields?: object; description?: string; ending_before?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { initial_seat_ids: string[]; seat_group_key: string; initial_unassigned_seats?: number; }; starting_at?: string; temporary_id?: string; }[], allow_contract_ending_before_finalized_invoice?: boolean, archive_commits?: { id: string; }[], archive_credits?: { id: string; }[], archive_scheduled_charges?: { id: string; }[], archive_spend_trackers?: string[], remove_overrides?: { id: string; }[], uniqueness_key?: string, update_commits?: { commit_id: string; access_schedule?: { add_schedule_items?: object[]; remove_schedule_items?: object[]; update_schedule_items?: object[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: object; invoice_schedule?: { add_schedule_items?: object[]; remove_schedule_items?: object[]; update_schedule_items?: object[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; rollover_fraction?: number; }[], update_contract_end_date?: string, update_contract_name?: string, update_credits?: { credit_id: string; access_schedule?: { add_schedule_items?: object[]; remove_schedule_items?: object[]; update_schedule_items?: object[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; rollover_fraction?: number; }[], update_net_payment_terms_days?: number, update_prepaid_balance_threshold_configuration?: { commit?: object; custom_credit_type_id?: string; discount_configuration?: { cap?: object; payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: object; recharge_to_amount?: number; threshold_amount?: number; threshold_balance_specifiers?: { exclude: object[]; }[]; }, update_recurring_commits?: { recurring_commit_id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; invoice_amount?: { quantity?: number; unit_price?: number; }; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[], update_recurring_credits?: { recurring_credit_id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[], update_scheduled_charges?: { scheduled_charge_id: string; invoice_schedule?: { add_schedule_items?: object[]; remove_schedule_items?: object[]; update_schedule_items?: object[]; }; netsuite_sales_order_id?: string; }[], update_spend_threshold_configuration?: { commit?: object; discount_configuration?: { cap?: object; payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: object; threshold_amount?: number; }, update_subscriptions?: { subscription_id: string; ending_before?: string; quantity_management_mode_update?: { quantity_management_mode: 'SEAT_BASED'; seat_config: object; }; quantity_updates?: { starting_at: string; quantity?: number; quantity_delta?: number; }[]; seat_updates?: { add_seat_ids?: object[]; add_unassigned_seats?: object[]; remove_seat_ids?: object[]; remove_unassigned_seats?: object[]; }; }[]): { data: id; }`\n\n**post** `/v2/contracts/edit`\n\nThe ability to edit a contract helps you react quickly to the needs of your customers and your business.\n\n### Use this endpoint to:\n- Encode mid-term commitment and discount changes\n- Fix configuration mistakes and easily roll back packaging changes\n\n### Key response fields:\n- The `id` of the edit\n- Complete edit details. For example, if you edited the contract to add new overrides and credits, you will receive the IDs of those overrides and credits in the response.\n\n### Usage guidelines:\n- When you edit a contract, any draft invoices update immediately to reflect that edit. Finalized invoices remain unchanged - you must void and regenerate them in the UI or API to reflect the edit.\n- Contract editing must be enabled to use this endpoint. Reach out to your Metronome representative to learn more.\n\n\n### Parameters\n\n- `contract_id: string`\n ID of the contract being edited\n\n- `customer_id: string`\n ID of the customer whose contract is being edited\n\n- `add_billing_provider_configuration_update?: { billing_provider_configuration: { billing_provider?: string; billing_provider_configuration_id?: string; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }; schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }; }`\n Update the billing provider configuration on the contract. Currently only supports adding a billing provider configuration to a contract that does not already have one.\n - `billing_provider_configuration: { billing_provider?: string; billing_provider_configuration_id?: string; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }`\n - `schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }`\n Indicates when the billing provider will be active on the contract. Any charges accrued during the schedule will be billed to the indicated billing provider.\n\n- `add_commits?: { product_id: string; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; amount?: number; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; on_session_payment?: boolean; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; spend_tracker_attributes?: { counts_as_discounted: boolean; }; temporary_id?: string; }[]`\n\n- `add_credits?: { access_schedule: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]`\n\n- `add_discounts?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]`\n\n- `add_overrides?: { starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: { price: number; size?: number; }[]; }; priority?: number; product_id?: string; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]`\n\n- `add_prepaid_balance_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; threshold_balance_specifiers?: { exclude: { custom_field_filters: object[]; }[]; }[]; }`\n - `commit: { product_id: string; description?: string; name?: string; priority?: number; }`\n - `is_enabled: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `recharge_to_amount: number`\n Specify the amount the balance should be recharged to.\n - `threshold_amount: number`\n Specify the threshold amount for the contract. Each time the contract's balance lowers to this amount, a threshold charge will be initiated.\n - `custom_credit_type_id?: string`\n If provided, the threshold, recharge-to amount, and the resulting threshold commit amount will be in terms of this credit type instead of the fiat currency.\n - `discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }`\n - `threshold_balance_specifiers?: { exclude: { custom_field_filters: { entity: 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit'; key: string; value: string; }[]; }[]; }[]`\n\n- `add_professional_services?: { max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[]`\n This field's availability is dependent on your client's configuration.\n\n- `add_recurring_commits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'POOLED' | 'INDIVIDUAL'; }; temporary_id?: string; }[]`\n\n- `add_recurring_credits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'POOLED' | 'INDIVIDUAL'; }; temporary_id?: string; }[]`\n\n- `add_reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_options?: { aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; }; ending_before?: string; fraction?: number; gcp_options?: { gcp_account_id?: string; gcp_offer_id?: string; }; netsuite_reseller_id?: string; reseller_contract_value?: number; starting_at?: string; }[]`\n\n- `add_revenue_system_configuration_update?: { revenue_system_configuration: { delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; provider?: 'netsuite'; revenue_system_configuration_id?: string; }; schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }; }`\n Update the revenue system configuration on the contract. Currently only supports adding a revenue system configuration to a contract that does not already have one.\n - `revenue_system_configuration: { delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; provider?: 'netsuite'; revenue_system_configuration_id?: string; }`\n - `schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }`\n\n- `add_scheduled_charges?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]`\n\n- `add_spend_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount: number; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; }`\n - `commit: { product_id: string; description?: string; name?: string; priority?: number; }`\n - `is_enabled: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `threshold_amount: number`\n Specify the threshold amount for the contract. Each time the contract's usage hits this amount, a threshold charge will be initiated.\n - `discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }`\n\n- `add_spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[]`\n Spend trackers to add to this contract. Aliases must be unique within a contract.\n\n- `add_subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated?: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product_id: string; }; custom_fields?: object; description?: string; ending_before?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { initial_seat_ids: string[]; seat_group_key: string; initial_unassigned_seats?: number; }; starting_at?: string; temporary_id?: string; }[]`\n Optional list of [subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/) to add to the contract.\n\n- `allow_contract_ending_before_finalized_invoice?: boolean`\n If true, allows setting the contract end date earlier than the end_timestamp of existing finalized invoices. Finalized invoices will be unchanged; if you want to incorporate the new end date, you can void and regenerate finalized usage invoices. Defaults to true.\n\n- `archive_commits?: { id: string; }[]`\n IDs of commits to archive\n\n- `archive_credits?: { id: string; }[]`\n IDs of credits to archive\n\n- `archive_scheduled_charges?: { id: string; }[]`\n IDs of scheduled charges to archive\n\n- `archive_spend_trackers?: string[]`\n Aliases of spend trackers to archive.\n\n- `remove_overrides?: { id: string; }[]`\n IDs of overrides to remove\n\n- `uniqueness_key?: string`\n Optional uniqueness key to prevent duplicate contract edits.\n\n- `update_commits?: { commit_id: string; access_schedule?: { add_schedule_items?: { amount: number; ending_before: string; starting_at: string; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; ending_before?: string; starting_at?: string; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_schedule?: { add_schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; quantity?: number; timestamp?: string; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; rollover_fraction?: number; }[]`\n\n- `update_contract_end_date?: string`\n RFC 3339 timestamp indicating when the contract will end (exclusive).\n\n- `update_contract_name?: string`\n Value to update the contract name to. If not provided, the contract name will remain unchanged.\n\n- `update_credits?: { credit_id: string; access_schedule?: { add_schedule_items?: { amount: number; ending_before: string; starting_at: string; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; ending_before?: string; starting_at?: string; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; rollover_fraction?: number; }[]`\n\n- `update_net_payment_terms_days?: number`\n Number of days after issuance of invoice after which the invoice is due (e.g. Net 30).\n\n- `update_prepaid_balance_threshold_configuration?: { commit?: { description?: string; name?: string; priority?: number; product_id?: string; }; custom_credit_type_id?: string; discount_configuration?: { cap?: { amount: number; spend_tracker_alias: string; }; payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount?: number; threshold_amount?: number; threshold_balance_specifiers?: { exclude: { custom_field_filters: { entity: 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit'; key: string; value: string; }[]; }[]; }[]; }`\n - `commit?: { description?: string; name?: string; priority?: number; product_id?: string; }`\n - `custom_credit_type_id?: string`\n If provided, the threshold, recharge-to amount, and the resulting threshold commit amount will be in terms of this credit type instead of the fiat currency.\n - `discount_configuration?: { cap?: { amount: number; spend_tracker_alias: string; }; payment_fraction?: number; }`\n - `is_enabled?: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `recharge_to_amount?: number`\n Specify the amount the balance should be recharged to.\n - `threshold_amount?: number`\n Specify the threshold amount for the contract. Each time the contract's balance lowers to this amount, a threshold charge will be initiated.\n - `threshold_balance_specifiers?: { exclude: { custom_field_filters: { entity: 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit'; key: string; value: string; }[]; }[]; }[]`\n\n- `update_recurring_commits?: { recurring_commit_id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; invoice_amount?: { quantity?: number; unit_price?: number; }; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[]`\n Edits to these recurring commits will only affect commits whose access schedules has not started. Expired commits, and commits with an active access schedule will remain unchanged.\n\n- `update_recurring_credits?: { recurring_credit_id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[]`\n Edits to these recurring credits will only affect credits whose access schedules has not started. Expired credits, and credits with an active access schedule will remain unchanged.\n\n- `update_scheduled_charges?: { scheduled_charge_id: string; invoice_schedule?: { add_schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; quantity?: number; timestamp?: string; unit_price?: number; }[]; }; netsuite_sales_order_id?: string; }[]`\n\n- `update_spend_threshold_configuration?: { commit?: { description?: string; name?: string; priority?: number; product_id?: string; }; discount_configuration?: { cap?: { amount: number; spend_tracker_alias: string; }; payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount?: number; }`\n - `commit?: { description?: string; name?: string; priority?: number; product_id?: string; }`\n - `discount_configuration?: { cap?: { amount: number; spend_tracker_alias: string; }; payment_fraction?: number; }`\n - `is_enabled?: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `threshold_amount?: number`\n Specify the threshold amount for the contract. Each time the contract's usage hits this amount, a threshold charge will be initiated.\n\n- `update_subscriptions?: { subscription_id: string; ending_before?: string; quantity_management_mode_update?: { quantity_management_mode: 'SEAT_BASED'; seat_config: { seat_group_key: string; }; }; quantity_updates?: { starting_at: string; quantity?: number; quantity_delta?: number; }[]; seat_updates?: { add_seat_ids?: { seat_ids: string[]; starting_at: string; }[]; add_unassigned_seats?: { quantity: number; starting_at: string; }[]; remove_seat_ids?: { seat_ids: string[]; starting_at: string; }[]; remove_unassigned_seats?: { quantity: number; starting_at: string; }[]; }; }[]`\n Optional list of subscriptions to update.\n\n### Returns\n\n- `{ data: { id: string; }; }`\n\n - `data: { id: string; }`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst response = await client.v2.contracts.edit({ contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc', customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d' });\n\nconsole.log(response);\n```",
perLanguage: {
typescript: {
method: 'client.v2.contracts.edit',
@@ -249,7 +249,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
response:
'{ data: { id: string; add_commits?: object[]; add_credits?: object[]; add_discounts?: discount[]; add_overrides?: object[]; add_prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration_v2; add_pro_services?: pro_service[]; add_recurring_commits?: object[]; add_recurring_credits?: object[]; add_reseller_royalties?: object[]; add_scheduled_charges?: object[]; add_spend_threshold_configuration?: spend_threshold_configuration_v2; add_subscriptions?: object[]; add_usage_filters?: object[]; archive_commits?: object[]; archive_credits?: object[]; archive_scheduled_charges?: object[]; remove_overrides?: object[]; timestamp?: string; uniqueness_key?: string; update_commits?: object[]; update_contract_end_date?: string; update_contract_name?: string; update_credits?: object[]; update_discounts?: object[]; update_prepaid_balance_threshold_configuration?: object; update_recurring_commits?: object[]; update_recurring_credits?: object[]; update_refund_invoices?: object[]; update_scheduled_charges?: object[]; update_spend_threshold_configuration?: object; update_subscriptions?: object[]; }[]; }',
markdown:
- "## get_edit_history\n\n`client.v2.contracts.getEditHistory(contract_id: string, customer_id: string): { data: object[]; }`\n\n**post** `/v2/contracts/getEditHistory`\n\nList all the edits made to a contract over time. In Metronome, you can edit a contract at any point after it's created to fix mistakes or reflect changes in terms. Metronome stores a full history of all edits that were ever made to a contract, whether through the UI, `editContract` endpoint, or other endpoints like `updateContractEndDate`. \n\n### Use this endpoint to: \n- Understand what changes were made to a contract, when, and by who\n\n### Key response fields: \n- An array of every edit ever made to the contract\n- Details on each individual edit - for example showing that in one edit, a user added two discounts and incremented a subscription quantity.\n\n\n### Parameters\n\n- `contract_id: string`\n\n- `customer_id: string`\n\n### Returns\n\n- `{ data: { id: string; add_commits?: { id: string; product: object; type: 'PREPAID' | 'POSTPAID'; access_schedule?: schedule_duration; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: commit_hierarchy_configuration; invoice_schedule?: object; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; salesforce_opportunity_id?: string; specifiers?: commit_specifier_input[]; }[]; add_credits?: { id: string; product: object; type: 'CREDIT'; access_schedule?: schedule_duration; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: commit_hierarchy_configuration; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; salesforce_opportunity_id?: string; specifiers?: commit_specifier_input[]; }[]; add_discounts?: object[]; add_overrides?: { id: string; created_at: string; starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: object[]; override_tiers?: override_tier[]; overwrite_rate?: object; priority?: number; product?: object; target?: 'COMMIT_RATE' | 'LIST_RATE'; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]; add_prepaid_balance_threshold_configuration?: object; add_pro_services?: object[]; add_recurring_commits?: { id: string; access_amount: object; commit_duration: object; priority: number; product: object; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; contract?: object; description?: string; ending_before?: string; hierarchy_configuration?: commit_hierarchy_configuration; invoice_amount?: object; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: commit_specifier[]; subscription_config?: recurring_commit_subscription_config; }[]; add_recurring_credits?: { id: string; access_amount: object; commit_duration: object; priority: number; product: object; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; contract?: object; description?: string; ending_before?: string; hierarchy_configuration?: commit_hierarchy_configuration; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: commit_specifier[]; subscription_config?: recurring_commit_subscription_config; }[]; add_reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; ending_before?: string; fraction?: number; gcp_account_id?: string; gcp_offer_id?: string; netsuite_reseller_id?: string; reseller_contract_value?: number; starting_at?: string; }[]; add_scheduled_charges?: { id: string; product: object; schedule: schedule_point_in_time; name?: string; netsuite_sales_order_id?: string; }[]; add_spend_threshold_configuration?: object; add_subscriptions?: { billing_periods: object; collection_schedule: 'ADVANCE' | 'ARREARS'; proration: object; quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY'; quantity_schedule: object[]; starting_at: string; subscription_rate: object; id?: string; custom_fields?: object; description?: string; ending_before?: string; fiat_credit_type_id?: string; name?: string; seat_config?: object; }[]; add_usage_filters?: { group_key: string; group_values: string[]; starting_at: string; ending_before?: string; }[]; archive_commits?: { id: string; }[]; archive_credits?: { id: string; }[]; archive_scheduled_charges?: { id: string; }[]; remove_overrides?: { id: string; }[]; timestamp?: string; uniqueness_key?: string; update_commits?: { id: string; access_schedule?: object; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: commit_hierarchy_configuration; invoice_schedule?: object; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: commit_specifier_input[]; }[]; update_contract_end_date?: string; update_contract_name?: string; update_credits?: { id: string; access_schedule?: object; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: commit_hierarchy_configuration; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; rollover_fraction?: number; specifiers?: commit_specifier_input[]; }[]; update_discounts?: { id: string; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; schedule?: object; }[]; update_prepaid_balance_threshold_configuration?: { commit?: update_base_threshold_commit; custom_credit_type_id?: string; discount_configuration?: object; is_enabled?: boolean; payment_gate_config?: payment_gate_config_v2; recharge_to_amount?: number; threshold_amount?: number; }; update_recurring_commits?: { id: string; access_amount?: object; ending_before?: string; invoice_amount?: object; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[]; update_recurring_credits?: { id: string; access_amount?: object; ending_before?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[]; update_refund_invoices?: { date: string; invoice_id: string; }[]; update_scheduled_charges?: { id: string; invoice_schedule?: object; name?: string; netsuite_sales_order_id?: string; }[]; update_spend_threshold_configuration?: { commit?: update_base_threshold_commit; discount_configuration?: object; is_enabled?: boolean; payment_gate_config?: payment_gate_config_v2; threshold_amount?: number; }; update_subscriptions?: { id: string; ending_before?: string; quantity_updates?: object[]; seat_updates?: object; }[]; }[]; }`\n\n - `data: { id: string; add_commits?: { id: string; product: { id: string; name: string; }; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: object[]; credit_type?: credit_type_data; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: { child_access: object | object | object; }; invoice_schedule?: { credit_type?: object; do_not_invoice?: boolean; schedule_items?: { id: string; timestamp: string; amount?: number; invoice_id?: string; quantity?: number; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; salesforce_opportunity_id?: string; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]; add_credits?: { id: string; product: { id: string; name: string; }; type: 'CREDIT'; access_schedule?: { schedule_items: object[]; credit_type?: credit_type_data; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: { child_access: object | object | object; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; salesforce_opportunity_id?: string; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]; add_discounts?: { id: string; product: { id: string; name: string; }; schedule: object; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]; add_overrides?: { id: string; created_at: string; starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; override_tiers?: { multiplier: number; size?: number; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type?: object; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: object[]; }; priority?: number; product?: { id: string; name: string; }; target?: 'COMMIT_RATE' | 'LIST_RATE'; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]; add_prepaid_balance_threshold_configuration?: { commit: object; is_enabled: boolean; payment_gate_config: object; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; cap?: object; }; }; add_pro_services?: { id: string; max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[]; add_recurring_commits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; contract?: { id: string; }; description?: string; ending_before?: string; hierarchy_configuration?: { child_access: object | object | object; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { allocation: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config: object; subscription_id: string; }; }[]; add_recurring_credits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; contract?: { id: string; }; description?: string; ending_before?: string; hierarchy_configuration?: { child_access: object | object | object; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { allocation: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config: object; subscription_id: string; }; }[]; add_reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; ending_before?: string; fraction?: number; gcp_account_id?: string; gcp_offer_id?: string; netsuite_reseller_id?: string; reseller_contract_value?: number; starting_at?: string; }[]; add_scheduled_charges?: { id: string; product: { id: string; name: string; }; schedule: { credit_type?: credit_type_data; do_not_invoice?: boolean; schedule_items?: object[]; }; name?: string; netsuite_sales_order_id?: string; }[]; add_spend_threshold_configuration?: { commit: object; is_enabled: boolean; payment_gate_config: object; threshold_amount: number; discount_configuration?: { payment_fraction: number; cap?: object; }; }; add_subscriptions?: { billing_periods: { current?: { ending_before: string; starting_at: string; }; next?: { ending_before: string; starting_at: string; }; previous?: { ending_before: string; starting_at: string; }; }; collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated: boolean; }; quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY'; quantity_schedule: { quantity: number; starting_at: string; ending_before?: string; }[]; starting_at: string; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product: { id: string; name: string; }; }; id?: string; custom_fields?: object; description?: string; ending_before?: string; fiat_credit_type_id?: string; name?: string; seat_config?: { seat_group_key: string; }; }[]; add_usage_filters?: { group_key: string; group_values: string[]; starting_at: string; ending_before?: string; }[]; archive_commits?: { id: string; }[]; archive_credits?: { id: string; }[]; archive_scheduled_charges?: { id: string; }[]; remove_overrides?: { id: string; }[]; timestamp?: string; uniqueness_key?: string; update_commits?: { id: string; access_schedule?: { add_schedule_items?: { amount: number; ending_before: string; starting_at: string; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; ending_before?: string; starting_at?: string; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: { child_access: object | object | object; }; invoice_schedule?: { add_schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; quantity?: number; timestamp?: string; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]; update_contract_end_date?: string; update_contract_name?: string; update_credits?: { id: string; access_schedule?: { add_schedule_items?: { amount: number; ending_before: string; starting_at: string; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; ending_before?: string; starting_at?: string; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: { child_access: object | object | object; }; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]; update_discounts?: { id: string; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; }[]; update_prepaid_balance_threshold_configuration?: { commit?: { description?: string; name?: string; priority?: number; product_id?: string; }; custom_credit_type_id?: string; discount_configuration?: { cap?: { amount: number; spend_tracker_alias: string; }; payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount?: number; threshold_amount?: number; }; update_recurring_commits?: { id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; invoice_amount?: { quantity?: number; unit_price?: number; }; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[]; update_recurring_credits?: { id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[]; update_refund_invoices?: { date: string; invoice_id: string; }[]; update_scheduled_charges?: { id: string; invoice_schedule?: { add_schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; quantity?: number; timestamp?: string; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; }[]; update_spend_threshold_configuration?: { commit?: { description?: string; name?: string; priority?: number; product_id?: string; }; discount_configuration?: { cap?: { amount: number; spend_tracker_alias: string; }; payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount?: number; }; update_subscriptions?: { id: string; ending_before?: string; quantity_updates?: { starting_at: string; quantity?: number; quantity_delta?: number; }[]; seat_updates?: { add_seat_ids?: { seat_ids: string[]; starting_at: string; }[]; add_unassigned_seats?: { quantity: number; starting_at: string; }[]; remove_seat_ids?: { seat_ids: string[]; starting_at: string; }[]; remove_unassigned_seats?: { quantity: number; starting_at: string; }[]; }; }[]; }[]`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst response = await client.v2.contracts.getEditHistory({ contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc', customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d' });\n\nconsole.log(response);\n```",
+ "## get_edit_history\n\n`client.v2.contracts.getEditHistory(contract_id: string, customer_id: string): { data: object[]; }`\n\n**post** `/v2/contracts/getEditHistory`\n\nList all the edits made to a contract over time. In Metronome, you can edit a contract at any point after it's created to fix mistakes or reflect changes in terms. Metronome stores a full history of all edits that were ever made to a contract, whether through the UI, `editContract` endpoint, or other endpoints like `updateContractEndDate`. \n\n### Use this endpoint to: \n- Understand what changes were made to a contract, when, and by who\n\n### Key response fields: \n- An array of every edit ever made to the contract\n- Details on each individual edit - for example showing that in one edit, a user added two discounts and incremented a subscription quantity.\n\n\n### Parameters\n\n- `contract_id: string`\n\n- `customer_id: string`\n\n### Returns\n\n- `{ data: { id: string; add_commits?: { id: string; product: object; type: 'PREPAID' | 'POSTPAID'; access_schedule?: schedule_duration; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: commit_hierarchy_configuration; invoice_schedule?: object; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; salesforce_opportunity_id?: string; specifiers?: commit_specifier_input[]; }[]; add_credits?: { id: string; product: object; type: 'CREDIT'; access_schedule?: schedule_duration; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: commit_hierarchy_configuration; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; salesforce_opportunity_id?: string; specifiers?: commit_specifier_input[]; }[]; add_discounts?: object[]; add_overrides?: { id: string; created_at: string; starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: object[]; override_tiers?: override_tier[]; overwrite_rate?: object; priority?: number; product?: object; target?: 'COMMIT_RATE' | 'LIST_RATE'; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]; add_prepaid_balance_threshold_configuration?: object; add_pro_services?: object[]; add_recurring_commits?: { id: string; access_amount: object; commit_duration: object; priority: number; product: object; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; contract?: object; description?: string; ending_before?: string; hierarchy_configuration?: commit_hierarchy_configuration; invoice_amount?: object; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: commit_specifier[]; subscription_config?: recurring_commit_subscription_config; }[]; add_recurring_credits?: { id: string; access_amount: object; commit_duration: object; priority: number; product: object; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; contract?: object; description?: string; ending_before?: string; hierarchy_configuration?: commit_hierarchy_configuration; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: commit_specifier[]; subscription_config?: recurring_commit_subscription_config; }[]; add_reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; ending_before?: string; fraction?: number; gcp_account_id?: string; gcp_offer_id?: string; netsuite_reseller_id?: string; reseller_contract_value?: number; starting_at?: string; }[]; add_scheduled_charges?: { id: string; product: object; schedule: schedule_point_in_time; name?: string; netsuite_sales_order_id?: string; }[]; add_spend_threshold_configuration?: object; add_subscriptions?: { billing_periods: object; collection_schedule: 'ADVANCE' | 'ARREARS'; proration: object; quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY'; quantity_schedule: object[]; starting_at: string; subscription_rate: object; id?: string; custom_fields?: object; description?: string; ending_before?: string; fiat_credit_type_id?: string; name?: string; seat_config?: object; }[]; add_usage_filters?: { group_key: string; group_values: string[]; starting_at: string; ending_before?: string; }[]; archive_commits?: { id: string; }[]; archive_credits?: { id: string; }[]; archive_scheduled_charges?: { id: string; }[]; remove_overrides?: { id: string; }[]; timestamp?: string; uniqueness_key?: string; update_commits?: { id: string; access_schedule?: object; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: commit_hierarchy_configuration; invoice_schedule?: object; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: commit_specifier_input[]; }[]; update_contract_end_date?: string; update_contract_name?: string; update_credits?: { id: string; access_schedule?: object; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: commit_hierarchy_configuration; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; rollover_fraction?: number; specifiers?: commit_specifier_input[]; }[]; update_discounts?: { id: string; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; schedule?: object; }[]; update_prepaid_balance_threshold_configuration?: { commit?: update_base_threshold_commit; custom_credit_type_id?: string; discount_configuration?: object; is_enabled?: boolean; payment_gate_config?: payment_gate_config_v2; recharge_to_amount?: number; threshold_amount?: number; threshold_balance_specifiers?: object[]; }; update_recurring_commits?: { id: string; access_amount?: object; ending_before?: string; invoice_amount?: object; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[]; update_recurring_credits?: { id: string; access_amount?: object; ending_before?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[]; update_refund_invoices?: { date: string; invoice_id: string; }[]; update_scheduled_charges?: { id: string; invoice_schedule?: object; name?: string; netsuite_sales_order_id?: string; }[]; update_spend_threshold_configuration?: { commit?: update_base_threshold_commit; discount_configuration?: object; is_enabled?: boolean; payment_gate_config?: payment_gate_config_v2; threshold_amount?: number; }; update_subscriptions?: { id: string; ending_before?: string; quantity_updates?: object[]; seat_updates?: object; }[]; }[]; }`\n\n - `data: { id: string; add_commits?: { id: string; product: { id: string; name: string; }; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: object[]; credit_type?: credit_type_data; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: { child_access: object | object | object; }; invoice_schedule?: { credit_type?: object; do_not_invoice?: boolean; schedule_items?: { id: string; timestamp: string; amount?: number; invoice_id?: string; quantity?: number; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; salesforce_opportunity_id?: string; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]; add_credits?: { id: string; product: { id: string; name: string; }; type: 'CREDIT'; access_schedule?: { schedule_items: object[]; credit_type?: credit_type_data; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: { child_access: object | object | object; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; salesforce_opportunity_id?: string; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]; add_discounts?: { id: string; product: { id: string; name: string; }; schedule: object; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]; add_overrides?: { id: string; created_at: string; starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; override_tiers?: { multiplier: number; size?: number; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type?: object; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: object[]; }; priority?: number; product?: { id: string; name: string; }; target?: 'COMMIT_RATE' | 'LIST_RATE'; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]; add_prepaid_balance_threshold_configuration?: { commit: object; is_enabled: boolean; payment_gate_config: object; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; cap?: object; }; threshold_balance_specifiers?: { exclude: object[]; }[]; }; add_pro_services?: { id: string; max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[]; add_recurring_commits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; contract?: { id: string; }; description?: string; ending_before?: string; hierarchy_configuration?: { child_access: object | object | object; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { allocation: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config: object; subscription_id: string; }; }[]; add_recurring_credits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; contract?: { id: string; }; description?: string; ending_before?: string; hierarchy_configuration?: { child_access: object | object | object; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { allocation: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config: object; subscription_id: string; }; }[]; add_reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; ending_before?: string; fraction?: number; gcp_account_id?: string; gcp_offer_id?: string; netsuite_reseller_id?: string; reseller_contract_value?: number; starting_at?: string; }[]; add_scheduled_charges?: { id: string; product: { id: string; name: string; }; schedule: { credit_type?: credit_type_data; do_not_invoice?: boolean; schedule_items?: object[]; }; name?: string; netsuite_sales_order_id?: string; }[]; add_spend_threshold_configuration?: { commit: object; is_enabled: boolean; payment_gate_config: object; threshold_amount: number; discount_configuration?: { payment_fraction: number; cap?: object; }; }; add_subscriptions?: { billing_periods: { current?: { ending_before: string; starting_at: string; }; next?: { ending_before: string; starting_at: string; }; previous?: { ending_before: string; starting_at: string; }; }; collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated: boolean; }; quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY'; quantity_schedule: { quantity: number; starting_at: string; ending_before?: string; }[]; starting_at: string; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product: { id: string; name: string; }; }; id?: string; custom_fields?: object; description?: string; ending_before?: string; fiat_credit_type_id?: string; name?: string; seat_config?: { seat_group_key: string; }; }[]; add_usage_filters?: { group_key: string; group_values: string[]; starting_at: string; ending_before?: string; }[]; archive_commits?: { id: string; }[]; archive_credits?: { id: string; }[]; archive_scheduled_charges?: { id: string; }[]; remove_overrides?: { id: string; }[]; timestamp?: string; uniqueness_key?: string; update_commits?: { id: string; access_schedule?: { add_schedule_items?: { amount: number; ending_before: string; starting_at: string; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; ending_before?: string; starting_at?: string; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: { child_access: object | object | object; }; invoice_schedule?: { add_schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; quantity?: number; timestamp?: string; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]; update_contract_end_date?: string; update_contract_name?: string; update_credits?: { id: string; access_schedule?: { add_schedule_items?: { amount: number; ending_before: string; starting_at: string; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; ending_before?: string; starting_at?: string; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: { child_access: object | object | object; }; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]; update_discounts?: { id: string; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; }[]; update_prepaid_balance_threshold_configuration?: { commit?: { description?: string; name?: string; priority?: number; product_id?: string; }; custom_credit_type_id?: string; discount_configuration?: { cap?: { amount: number; spend_tracker_alias: string; }; payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount?: number; threshold_amount?: number; threshold_balance_specifiers?: { exclude: { custom_field_filters: object[]; }[]; }[]; }; update_recurring_commits?: { id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; invoice_amount?: { quantity?: number; unit_price?: number; }; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[]; update_recurring_credits?: { id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[]; update_refund_invoices?: { date: string; invoice_id: string; }[]; update_scheduled_charges?: { id: string; invoice_schedule?: { add_schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; quantity?: number; timestamp?: string; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; }[]; update_spend_threshold_configuration?: { commit?: { description?: string; name?: string; priority?: number; product_id?: string; }; discount_configuration?: { cap?: { amount: number; spend_tracker_alias: string; }; payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount?: number; }; update_subscriptions?: { id: string; ending_before?: string; quantity_updates?: { starting_at: string; quantity?: number; quantity_delta?: number; }[]; seat_updates?: { add_seat_ids?: { seat_ids: string[]; starting_at: string; }[]; add_unassigned_seats?: { quantity: number; starting_at: string; }[]; remove_seat_ids?: { seat_ids: string[]; starting_at: string; }[]; remove_unassigned_seats?: { quantity: number; starting_at: string; }[]; }; }[]; }[]`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst response = await client.v2.contracts.getEditHistory({ contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc', customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d' });\n\nconsole.log(response);\n```",
perLanguage: {
typescript: {
method: 'client.v2.contracts.getEditHistory',
@@ -3673,7 +3673,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
response:
"{ data: { id: string; amendments: object[]; current: contract_without_amendments; customer_id: string; initial: contract_without_amendments; archived_at?: string; custom_fields?: object; customer_billing_provider_configuration?: object; package_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; spend_trackers?: object[]; subscriptions?: subscription[]; uniqueness_key?: string; }; }",
markdown:
- "## retrieve\n\n`client.v1.contracts.retrieve(contract_id: string, customer_id: string, include_balance?: boolean, include_ledgers?: boolean): { data: contract; }`\n\n**post** `/v1/contracts/get`\n\nThis is the v1 endpoint to get a contract. New clients should implement using the v2 endpoint.\n\n\n### Parameters\n\n- `contract_id: string`\n\n- `customer_id: string`\n\n- `include_balance?: boolean`\n Include the balance of credits and commits in the response. Setting this flag may cause the query to be slower.\n\n- `include_ledgers?: boolean`\n Include commit ledgers in the response. Setting this flag may cause the query to be slower.\n\n### Returns\n\n- `{ data: { id: string; amendments: object[]; current: contract_without_amendments; customer_id: string; initial: contract_without_amendments; archived_at?: string; custom_fields?: object; customer_billing_provider_configuration?: object; package_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; spend_trackers?: object[]; subscriptions?: subscription[]; uniqueness_key?: string; }; }`\n\n - `data: { id: string; amendments: { id: string; commits: object[]; created_at: string; created_by: string; overrides: object[]; scheduled_charges: object[]; starting_at: string; credits?: object[]; discounts?: object[]; netsuite_sales_order_id?: string; professional_services?: object[]; reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; ending_before?: string; fraction?: number; gcp_account_id?: string; gcp_offer_id?: string; netsuite_reseller_id?: string; reseller_contract_value?: number; starting_at?: string; }[]; salesforce_opportunity_id?: string; }[]; current: { commits: commit[]; created_at: string; created_by: string; overrides: override[]; scheduled_charges: scheduled_charge[]; starting_at: string; transitions: object[]; usage_statement_schedule: object; credits?: credit[]; discounts?: discount[]; ending_before?: string; hierarchy_configuration?: hierarchy_configuration; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; professional_services?: pro_service[]; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; reseller_royalties?: object[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; spend_trackers?: object[]; total_contract_value?: number; usage_filter?: object; }; customer_id: string; initial: { commits: commit[]; created_at: string; created_by: string; overrides: override[]; scheduled_charges: scheduled_charge[]; starting_at: string; transitions: object[]; usage_statement_schedule: object; credits?: credit[]; discounts?: discount[]; ending_before?: string; hierarchy_configuration?: hierarchy_configuration; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; professional_services?: pro_service[]; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; reseller_royalties?: object[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; spend_trackers?: object[]; total_contract_value?: number; usage_filter?: object; }; archived_at?: string; custom_fields?: object; customer_billing_provider_configuration?: { archived_at: string; billing_provider: string; delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; id?: string; configuration?: object; }; package_id?: string; prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; }; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; threshold_amount: number; discount_configuration?: object; }; spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; accumulated_spend?: { amount: number; period_ending_before: string; period_starting_at: string; }; }[]; subscriptions?: { billing_periods: object; collection_schedule: 'ADVANCE' | 'ARREARS'; proration: object; quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY'; quantity_schedule: object[]; starting_at: string; subscription_rate: object; id?: string; custom_fields?: object; description?: string; ending_before?: string; fiat_credit_type_id?: string; name?: string; seat_config?: object; }[]; uniqueness_key?: string; }`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst contract = await client.v1.contracts.retrieve({ contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc', customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d' });\n\nconsole.log(contract);\n```",
+ "## retrieve\n\n`client.v1.contracts.retrieve(contract_id: string, customer_id: string, include_balance?: boolean, include_ledgers?: boolean): { data: contract; }`\n\n**post** `/v1/contracts/get`\n\nThis is the v1 endpoint to get a contract. New clients should implement using the v2 endpoint.\n\n\n### Parameters\n\n- `contract_id: string`\n\n- `customer_id: string`\n\n- `include_balance?: boolean`\n Include the balance of credits and commits in the response. Setting this flag may cause the query to be slower.\n\n- `include_ledgers?: boolean`\n Include commit ledgers in the response. Setting this flag may cause the query to be slower.\n\n### Returns\n\n- `{ data: { id: string; amendments: object[]; current: contract_without_amendments; customer_id: string; initial: contract_without_amendments; archived_at?: string; custom_fields?: object; customer_billing_provider_configuration?: object; package_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; spend_trackers?: object[]; subscriptions?: subscription[]; uniqueness_key?: string; }; }`\n\n - `data: { id: string; amendments: { id: string; commits: object[]; created_at: string; created_by: string; overrides: object[]; scheduled_charges: object[]; starting_at: string; credits?: object[]; discounts?: object[]; netsuite_sales_order_id?: string; professional_services?: object[]; reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; ending_before?: string; fraction?: number; gcp_account_id?: string; gcp_offer_id?: string; netsuite_reseller_id?: string; reseller_contract_value?: number; starting_at?: string; }[]; salesforce_opportunity_id?: string; }[]; current: { commits: commit[]; created_at: string; created_by: string; overrides: override[]; scheduled_charges: scheduled_charge[]; starting_at: string; transitions: object[]; usage_statement_schedule: object; credits?: credit[]; discounts?: discount[]; ending_before?: string; hierarchy_configuration?: hierarchy_configuration; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; professional_services?: pro_service[]; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; reseller_royalties?: object[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; spend_trackers?: object[]; total_contract_value?: number; usage_filter?: object; }; customer_id: string; initial: { commits: commit[]; created_at: string; created_by: string; overrides: override[]; scheduled_charges: scheduled_charge[]; starting_at: string; transitions: object[]; usage_statement_schedule: object; credits?: credit[]; discounts?: discount[]; ending_before?: string; hierarchy_configuration?: hierarchy_configuration; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; professional_services?: pro_service[]; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; reseller_royalties?: object[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; spend_trackers?: object[]; total_contract_value?: number; usage_filter?: object; }; archived_at?: string; custom_fields?: object; customer_billing_provider_configuration?: { archived_at: string; billing_provider: string; delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; id?: string; configuration?: object; }; package_id?: string; prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; threshold_balance_specifiers?: object[]; }; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; threshold_amount: number; discount_configuration?: object; }; spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; accumulated_spend?: { amount: number; period_ending_before: string; period_starting_at: string; }; }[]; subscriptions?: { billing_periods: object; collection_schedule: 'ADVANCE' | 'ARREARS'; proration: object; quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY'; quantity_schedule: object[]; starting_at: string; subscription_rate: object; id?: string; custom_fields?: object; description?: string; ending_before?: string; fiat_credit_type_id?: string; name?: string; seat_config?: object; }[]; uniqueness_key?: string; }`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst contract = await client.v1.contracts.retrieve({ contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc', customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d' });\n\nconsole.log(contract);\n```",
perLanguage: {
typescript: {
method: 'client.v1.contracts.retrieve',
@@ -3726,7 +3726,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
response:
"{ data: { id: string; amendments: object[]; current: contract_without_amendments; customer_id: string; initial: contract_without_amendments; archived_at?: string; custom_fields?: object; customer_billing_provider_configuration?: object; package_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; spend_trackers?: object[]; subscriptions?: subscription[]; uniqueness_key?: string; }[]; }",
markdown:
- "## list\n\n`client.v1.contracts.list(customer_id: string, covering_date?: string, include_archived?: boolean, include_balance?: boolean, include_ledgers?: boolean, starting_at?: string): { data: contract[]; }`\n\n**post** `/v1/contracts/list`\n\nRetrieves all contracts for a specific customer, including pricing, terms, credits, and commitments. Use this to view a customer's contract history and current agreements for billing management. Returns contract details with optional ledgers and balance information. \n\n⚠️ Note: This is the legacy v1 endpoint - new integrations should use the v2 endpoint for enhanced features.\n\n\n### Parameters\n\n- `customer_id: string`\n\n- `covering_date?: string`\n Optional RFC 3339 timestamp. If provided, the response will include only contracts effective on the provided date. This cannot be provided if the starting_at filter is provided.\n\n- `include_archived?: boolean`\n Include archived contracts in the response\n\n- `include_balance?: boolean`\n Include the balance of credits and commits in the response. Setting this flag may cause the query to be slower.\n\n- `include_ledgers?: boolean`\n Include commit ledgers in the response. Setting this flag may cause the query to be slower.\n\n- `starting_at?: string`\n Optional RFC 3339 timestamp. If provided, the response will include only contracts where effective_at is on or after the provided date. This cannot be provided if the covering_date filter is provided.\n\n### Returns\n\n- `{ data: { id: string; amendments: object[]; current: contract_without_amendments; customer_id: string; initial: contract_without_amendments; archived_at?: string; custom_fields?: object; customer_billing_provider_configuration?: object; package_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; spend_trackers?: object[]; subscriptions?: subscription[]; uniqueness_key?: string; }[]; }`\n\n - `data: { id: string; amendments: { id: string; commits: object[]; created_at: string; created_by: string; overrides: object[]; scheduled_charges: object[]; starting_at: string; credits?: object[]; discounts?: object[]; netsuite_sales_order_id?: string; professional_services?: object[]; reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; ending_before?: string; fraction?: number; gcp_account_id?: string; gcp_offer_id?: string; netsuite_reseller_id?: string; reseller_contract_value?: number; starting_at?: string; }[]; salesforce_opportunity_id?: string; }[]; current: { commits: commit[]; created_at: string; created_by: string; overrides: override[]; scheduled_charges: scheduled_charge[]; starting_at: string; transitions: object[]; usage_statement_schedule: object; credits?: credit[]; discounts?: discount[]; ending_before?: string; hierarchy_configuration?: hierarchy_configuration; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; professional_services?: pro_service[]; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; reseller_royalties?: object[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; spend_trackers?: object[]; total_contract_value?: number; usage_filter?: object; }; customer_id: string; initial: { commits: commit[]; created_at: string; created_by: string; overrides: override[]; scheduled_charges: scheduled_charge[]; starting_at: string; transitions: object[]; usage_statement_schedule: object; credits?: credit[]; discounts?: discount[]; ending_before?: string; hierarchy_configuration?: hierarchy_configuration; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; professional_services?: pro_service[]; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; reseller_royalties?: object[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; spend_trackers?: object[]; total_contract_value?: number; usage_filter?: object; }; archived_at?: string; custom_fields?: object; customer_billing_provider_configuration?: { archived_at: string; billing_provider: string; delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; id?: string; configuration?: object; }; package_id?: string; prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; }; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; threshold_amount: number; discount_configuration?: object; }; spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; accumulated_spend?: { amount: number; period_ending_before: string; period_starting_at: string; }; }[]; subscriptions?: { billing_periods: object; collection_schedule: 'ADVANCE' | 'ARREARS'; proration: object; quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY'; quantity_schedule: object[]; starting_at: string; subscription_rate: object; id?: string; custom_fields?: object; description?: string; ending_before?: string; fiat_credit_type_id?: string; name?: string; seat_config?: object; }[]; uniqueness_key?: string; }[]`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst contracts = await client.v1.contracts.list({ customer_id: '9b85c1c1-5238-4f2a-a409-61412905e1e1' });\n\nconsole.log(contracts);\n```",
+ "## list\n\n`client.v1.contracts.list(customer_id: string, covering_date?: string, include_archived?: boolean, include_balance?: boolean, include_ledgers?: boolean, starting_at?: string): { data: contract[]; }`\n\n**post** `/v1/contracts/list`\n\nRetrieves all contracts for a specific customer, including pricing, terms, credits, and commitments. Use this to view a customer's contract history and current agreements for billing management. Returns contract details with optional ledgers and balance information. \n\n⚠️ Note: This is the legacy v1 endpoint - new integrations should use the v2 endpoint for enhanced features.\n\n\n### Parameters\n\n- `customer_id: string`\n\n- `covering_date?: string`\n Optional RFC 3339 timestamp. If provided, the response will include only contracts effective on the provided date. This cannot be provided if the starting_at filter is provided.\n\n- `include_archived?: boolean`\n Include archived contracts in the response\n\n- `include_balance?: boolean`\n Include the balance of credits and commits in the response. Setting this flag may cause the query to be slower.\n\n- `include_ledgers?: boolean`\n Include commit ledgers in the response. Setting this flag may cause the query to be slower.\n\n- `starting_at?: string`\n Optional RFC 3339 timestamp. If provided, the response will include only contracts where effective_at is on or after the provided date. This cannot be provided if the covering_date filter is provided.\n\n### Returns\n\n- `{ data: { id: string; amendments: object[]; current: contract_without_amendments; customer_id: string; initial: contract_without_amendments; archived_at?: string; custom_fields?: object; customer_billing_provider_configuration?: object; package_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; spend_trackers?: object[]; subscriptions?: subscription[]; uniqueness_key?: string; }[]; }`\n\n - `data: { id: string; amendments: { id: string; commits: object[]; created_at: string; created_by: string; overrides: object[]; scheduled_charges: object[]; starting_at: string; credits?: object[]; discounts?: object[]; netsuite_sales_order_id?: string; professional_services?: object[]; reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; ending_before?: string; fraction?: number; gcp_account_id?: string; gcp_offer_id?: string; netsuite_reseller_id?: string; reseller_contract_value?: number; starting_at?: string; }[]; salesforce_opportunity_id?: string; }[]; current: { commits: commit[]; created_at: string; created_by: string; overrides: override[]; scheduled_charges: scheduled_charge[]; starting_at: string; transitions: object[]; usage_statement_schedule: object; credits?: credit[]; discounts?: discount[]; ending_before?: string; hierarchy_configuration?: hierarchy_configuration; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; professional_services?: pro_service[]; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; reseller_royalties?: object[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; spend_trackers?: object[]; total_contract_value?: number; usage_filter?: object; }; customer_id: string; initial: { commits: commit[]; created_at: string; created_by: string; overrides: override[]; scheduled_charges: scheduled_charge[]; starting_at: string; transitions: object[]; usage_statement_schedule: object; credits?: credit[]; discounts?: discount[]; ending_before?: string; hierarchy_configuration?: hierarchy_configuration; name?: string; net_payment_terms_days?: number; netsuite_sales_order_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; professional_services?: pro_service[]; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; reseller_royalties?: object[]; salesforce_opportunity_id?: string; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; spend_trackers?: object[]; total_contract_value?: number; usage_filter?: object; }; archived_at?: string; custom_fields?: object; customer_billing_provider_configuration?: { archived_at: string; billing_provider: string; delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; id?: string; configuration?: object; }; package_id?: string; prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; threshold_balance_specifiers?: object[]; }; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; threshold_amount: number; discount_configuration?: object; }; spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; accumulated_spend?: { amount: number; period_ending_before: string; period_starting_at: string; }; }[]; subscriptions?: { billing_periods: object; collection_schedule: 'ADVANCE' | 'ARREARS'; proration: object; quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY'; quantity_schedule: object[]; starting_at: string; subscription_rate: object; id?: string; custom_fields?: object; description?: string; ending_before?: string; fiat_credit_type_id?: string; name?: string; seat_config?: object; }[]; uniqueness_key?: string; }[]`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst contracts = await client.v1.contracts.list({ customer_id: '9b85c1c1-5238-4f2a-a409-61412905e1e1' });\n\nconsole.log(contracts);\n```",
perLanguage: {
typescript: {
method: 'client.v1.contracts.list',
@@ -3785,7 +3785,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
"overrides?: { starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: { price: number; size?: number; }[]; }; priority?: number; product_id?: string; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[];",
'package_alias?: string;',
'package_id?: string;',
- "prepaid_balance_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; };",
+ "prepaid_balance_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; threshold_balance_specifiers?: { exclude: { custom_field_filters: object[]; }[]; }[]; };",
'professional_services?: { max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[];',
'rate_card_alias?: string;',
'rate_card_id?: string;',
@@ -3807,7 +3807,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
],
response: '{ data: { id: string; }; }',
markdown:
- "## create\n\n`client.v1.contracts.create(customer_id: string, starting_at: string, billing_provider_configuration?: { billing_provider?: 'aws_marketplace' | 'azure_marketplace' | 'gcp_marketplace' | 'stripe' | 'netsuite'; billing_provider_configuration_id?: string; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }, commits?: { product_id: string; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: object[]; credit_type_id?: string; }; amount?: number; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: object; invoice_schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: object[]; spend_tracker_attributes?: { counts_as_discounted: boolean; }; temporary_id?: string; }[], credits?: { access_schedule: { schedule_items: object[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: object[]; }[], custom_fields?: object, discounts?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[], ending_before?: string, hierarchy_configuration?: { parent?: { contract_id: string; customer_id: string; }; parent_behavior?: { invoice_consolidation_type?: 'CONCATENATE' | 'NONE'; }; payer?: 'SELF' | 'PARENT'; usage_statement_behavior?: 'CONSOLIDATE' | 'SEPARATE'; }, multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT', name?: string, net_payment_terms_days?: number, netsuite_sales_order_id?: string, overrides?: { starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: tier[]; }; priority?: number; product_id?: string; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[], package_alias?: string, package_id?: string, prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; }, professional_services?: { max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[], rate_card_alias?: string, rate_card_id?: string, recurring_commits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: object; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { apply_seat_increase_config: object; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[], recurring_credits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { apply_seat_increase_config: object; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[], reseller_royalties?: { fraction: number; netsuite_reseller_id: string; reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_options?: { aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; }; ending_before?: string; gcp_options?: { gcp_account_id?: string; gcp_offer_id?: string; }; reseller_contract_value?: number; }[], revenue_system_configuration?: { delivery_method?: 'direct_to_billing_provider'; provider?: 'netsuite'; revenue_system_configuration_id?: string; }, salesforce_opportunity_id?: string, scheduled_charges?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[], scheduled_charges_on_usage_invoices?: 'ALL', spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; threshold_amount: number; discount_configuration?: object; }, spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[], subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated?: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product_id: string; }; custom_fields?: object; description?: string; ending_before?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { initial_seat_ids: string[]; seat_group_key: string; initial_unassigned_seats?: number; }; starting_at?: string; temporary_id?: string; }[], total_contract_value?: number, transition?: { from_contract_id: string; type: 'SUPERSEDE' | 'RENEWAL'; future_invoice_behavior?: { trueup?: 'REMOVE' | 'AS_IS'; }; }, uniqueness_key?: string, usage_filter?: { group_key: string; group_values: string[]; starting_at?: string; }, usage_statement_schedule?: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; billing_anchor_date?: string; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START' | 'CUSTOM_DATE'; invoice_generation_starting_at?: string; }): { data: id; }`\n\n**post** `/v1/contracts/create`\n\nContracts define a customer's products, pricing, discounts, access duration, and billing configuration. Contracts serve as the central billing agreement for both PLG and Enterprise customers. You can automatically grant customers access to your products and services directly from your product or CRM.\n\n### Use this endpoint to:\n- PLG onboarding: Automatically provision new self-serve customers with contracts when they sign up.\n- Enterprise sales: Push negotiated contracts from Salesforce with custom pricing and commitments\n- Promotional pricing: Implement time-limited discounts and free trials through overrides\n\n### Key components:\n#### Contract Term and Billing Schedule\n- Set contract duration using `starting_at` and `ending_before` fields. PLG contracts typically use perpetual agreements (no end date), while Enterprise contracts have fixed end dates which can be edited over time in the case of co-term upsells.\n\n#### Rate Card\nIf you are offering usage based pricing, you can set a rate card for the contract to reference through `rate_card_id` or `rate_card_alias`. The rate card is a store of all of your usage based products and their centralized pricing. Any new products or price changes on the rate card can be set to automatically propagate to all associated contracts - this ensures consistent pricing and product launches flow to contracts without manual updates and migrations. The `usage_statement_schedule` determines the cadence on which Metronome will finalize a usage invoice for the customer. This defaults to monthly on the 1st, with options for custom dates, quarterly, or annual cadences. Note: Most usage based billing companies align usage statements to be evaluated aligned to the first of the month.\nRead more about [Rate Cards](https://docs.metronome.com/pricing-packaging/create-manage-rate-cards/).\n\n#### Overrides and discounts\nCustomize pricing on the contract through time-bounded overrides that can target specific products, product families, or complex usage scenarios. Overrides enable two key capabilities:\n- Discounts: Apply percentage discounts, fixed rate reductions, or quantity-based pricing tiers\n- Entitlements: Provide special pricing or access to specific products for negotiated deals\n\nRead more about [Contract Overrides](https://docs.metronome.com/manage-product-access/add-contract-override/).\n\n#### Commits and Credits\nUsing commits, configure prepaid or postpaid spending commitments where customers promise to spend a certain amount over the contract period paid in advance or in arrears. Use credits to provide free spending allowances. Under the hood these are the same mechanisms, however, credits are typically offered for free (SLA or promotional) or as a part of an allotment associated with a Subscription.\n\nIn Metronome, you can set commits and credits to only be applicable for a subset of usage. Use `applicable_product_ids` or `applicable_product_tags` to create product or product-family specific commits or credits, or you can build complex boolean logic specifiers to target usage based on pricing and presentation group values using `override_specifiers`.\n\nThese objects can also also be configured to have a recurrence schedule to easily model customer packaging which includes recurring monthly or quarterly allotments.\n\nCommits support rollover settings (`rollover_fraction`) to transfer unused balances between contract periods, either entirely or as a percentage.\n\nRead more about [Credits and Commits](https://docs.metronome.com/pricing-packaging/apply-credits-commits/).\n\n#### Subscriptions\nYou can add a fixed recurring charge to a contract, like monthly licenses or seat-based fees, using the subscription charge. Subscription charges are defined on your rate card and you can select which subscription is applicable to add to each contract. When you add a subscription to a contract you need to:\n- Define whether the subscription is paid for in-advance or in-arrears (`collection_schedule`)\n- Define the proration behavior (`proration`)\n- Specify an initial quantity (`initial_quantity`)\n- Define which subscription rate on the rate card should be used (`subscription_rate`)\n\nRead more about [Subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/).\n\n#### Scheduled Charges\nSet up one-time, recurring, or entirely custom charges that occur on specific dates, separate from usage-based billing or commitments. These can be used to model non-recurring platform charges or professional services.\n\n#### Threshold Billing\nMetronome allows you to configure automatic billing triggers when customers reach spending thresholds to prevent fraud and manage risk. You can use `spend_threshold_configuration` to trigger an invoice to cover current charges whenever the threshold is reached or you can ensure the customer maintains a minimum prepaid balance using the `prepaid_balance_configuration`.\n\nRead more about [Spend Threshold](https://docs.metronome.com/manage-product-access/spend-thresholds/) and [Prepaid Balance Thresholds](https://docs.metronome.com/manage-product-access/prepaid-balance-thresholds/).\n\n### Usage guidelines:\n- You can always [Edit Contracts](https://docs.metronome.com/manage-product-access/edit-contract/) after it has been created, using the `editContract` endpoint. Metronome keeps track of all edits, both in the audit log and over the `getEditHistory` endpoint.\n- Customers in Metronome can have multiple concurrent contracts at one time. Use `usage_filters` to route the correct usage to each contract. [Read more about usage filters](https://docs.metronome.com/manage-product-access/provision-customer/#create-a-usage-filter).\n\n\n### Parameters\n\n- `customer_id: string`\n\n- `starting_at: string`\n inclusive contract start time\n\n- `billing_provider_configuration?: { billing_provider?: 'aws_marketplace' | 'azure_marketplace' | 'gcp_marketplace' | 'stripe' | 'netsuite'; billing_provider_configuration_id?: string; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }`\n The billing provider configuration associated with a contract. Provide either an ID or the provider and delivery method.\n - `billing_provider?: 'aws_marketplace' | 'azure_marketplace' | 'gcp_marketplace' | 'stripe' | 'netsuite'`\n Do not specify if using billing_provider_configuration_id.\n - `billing_provider_configuration_id?: string`\n The Metronome ID of the billing provider configuration. Use when a customer has multiple configurations with the same billing provider and delivery method. Otherwise, specify the billing_provider and delivery_method.\n - `delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'`\n Do not specify if using billing_provider_configuration_id.\n\n- `commits?: { product_id: string; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; amount?: number; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; spend_tracker_attributes?: { counts_as_discounted: boolean; }; temporary_id?: string; }[]`\n\n- `credits?: { access_schedule: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]`\n\n- `custom_fields?: object`\n Custom fields to be added eg. { \"key1\": \"value1\", \"key2\": \"value2\" }\n\n- `discounts?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]`\n This field's availability is dependent on your client's configuration.\n\n- `ending_before?: string`\n exclusive contract end time\n\n- `hierarchy_configuration?: { parent?: { contract_id: string; customer_id: string; }; parent_behavior?: { invoice_consolidation_type?: 'CONCATENATE' | 'NONE'; }; payer?: 'SELF' | 'PARENT'; usage_statement_behavior?: 'CONSOLIDATE' | 'SEPARATE'; }`\n - `parent?: { contract_id: string; customer_id: string; }`\n - `parent_behavior?: { invoice_consolidation_type?: 'CONCATENATE' | 'NONE'; }`\n - `payer?: 'SELF' | 'PARENT'`\n Indicates which customer should pay for the child's invoice charges\n\n**SELF**: The child pays for its own invoice charges\n\n**PARENT**: The parent pays for the child's invoice charges\n - `usage_statement_behavior?: 'CONSOLIDATE' | 'SEPARATE'`\n Indicates the behavior of the child's invoice statements on the parent's invoices.\n\n**CONSOLIDATE**: Child's invoice statements will be added to parent's consolidated invoices\n\n**SEPARATE**: Child's invoice statements will appear not appear on parent's consolidated invoices\n\n- `multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'`\n Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list prices automatically. EXPLICIT prioritization requires specifying priorities for each multiplier; the one with the lowest priority value will be prioritized first. If tiered overrides are used, prioritization must be explicit.\n\n- `name?: string`\n\n- `net_payment_terms_days?: number`\n\n- `netsuite_sales_order_id?: string`\n This field's availability is dependent on your client's configuration.\n\n- `overrides?: { starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: { price: number; size?: number; }[]; }; priority?: number; product_id?: string; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]`\n\n- `package_alias?: string`\n Selects the package linked to the specified alias as of the contract's start date. Mutually exclusive with package_id.\n\n- `package_id?: string`\n If provided, provisions a customer on a package instead of creating a traditional contract. When specified, only customer_id, starting_at, package_id, uniqueness_key, transition, and custom_fields are allowed.\n\n- `prepaid_balance_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; }`\n - `commit: { product_id: string; description?: string; name?: string; priority?: number; }`\n - `is_enabled: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `recharge_to_amount: number`\n Specify the amount the balance should be recharged to.\n - `threshold_amount: number`\n Specify the threshold amount for the contract. Each time the contract's prepaid balance lowers to this amount, a threshold charge will be initiated.\n - `custom_credit_type_id?: string`\n If provided, the threshold, recharge-to amount, and the resulting threshold commit amount will be in terms of this credit type instead of the fiat currency.\n - `discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }`\n\n- `professional_services?: { max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[]`\n This field's availability is dependent on your client's configuration.\n\n- `rate_card_alias?: string`\n Selects the rate card linked to the specified alias as of the contract's start date.\n\n- `rate_card_id?: string`\n\n- `recurring_commits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[]`\n\n- `recurring_credits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[]`\n\n- `reseller_royalties?: { fraction: number; netsuite_reseller_id: string; reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_options?: { aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; }; ending_before?: string; gcp_options?: { gcp_account_id?: string; gcp_offer_id?: string; }; reseller_contract_value?: number; }[]`\n This field's availability is dependent on your client's configuration.\n\n- `revenue_system_configuration?: { delivery_method?: 'direct_to_billing_provider'; provider?: 'netsuite'; revenue_system_configuration_id?: string; }`\n The revenue system configuration associated with a contract. Provide either an ID or the provider and delivery method.\n - `delivery_method?: 'direct_to_billing_provider'`\n How revenue recognition records should be delivered to the revenue system. Do not specify if using revenue_system_configuration_id.\n - `provider?: 'netsuite'`\n The system that is providing services for revenue recognition. Do not specify if using revenue_system_configuration_id.\n - `revenue_system_configuration_id?: string`\n The Metronome ID of the revenue system configuration. Use when a customer has multiple configurations with the same provider and delivery method. Otherwise, specify the provider and delivery_method.\n\n- `salesforce_opportunity_id?: string`\n This field's availability is dependent on your client's configuration.\n\n- `scheduled_charges?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]`\n\n- `scheduled_charges_on_usage_invoices?: 'ALL'`\n Determines which scheduled and commit charges to consolidate onto the Contract's usage invoice. The charge's `timestamp` must match the usage invoice's `ending_before` date for consolidation to occur. This field cannot be modified after a Contract has been created. If this field is omitted, charges will appear on a separate invoice from usage charges.\n\n- `spend_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount: number; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; }`\n - `commit: { product_id: string; description?: string; name?: string; priority?: number; }`\n - `is_enabled: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `threshold_amount: number`\n Specify the threshold amount for the contract. Each time the contract's usage hits this amount, a threshold charge will be initiated.\n - `discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }`\n\n- `spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[]`\n Spend trackers to attach to this contract. Aliases must be unique within a contract.\n\n- `subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated?: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product_id: string; }; custom_fields?: object; description?: string; ending_before?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { initial_seat_ids: string[]; seat_group_key: string; initial_unassigned_seats?: number; }; starting_at?: string; temporary_id?: string; }[]`\n Optional list of [subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/) to add to the contract.\n\n- `total_contract_value?: number`\n This field's availability is dependent on your client's configuration.\n\n- `transition?: { from_contract_id: string; type: 'SUPERSEDE' | 'RENEWAL'; future_invoice_behavior?: { trueup?: 'REMOVE' | 'AS_IS'; }; }`\n - `from_contract_id: string`\n - `type: 'SUPERSEDE' | 'RENEWAL'`\n This field's available values may vary based on your client's configuration.\n - `future_invoice_behavior?: { trueup?: 'REMOVE' | 'AS_IS'; }`\n\n- `uniqueness_key?: string`\n Prevents the creation of duplicates. If a request to create a record is made with a previously used uniqueness key, a new record will not be created and the request will fail with a 409 error.\n\n- `usage_filter?: { group_key: string; group_values: string[]; starting_at?: string; }`\n - `group_key: string`\n - `group_values: string[]`\n - `starting_at?: string`\n\n- `usage_statement_schedule?: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; billing_anchor_date?: string; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START' | 'CUSTOM_DATE'; invoice_generation_starting_at?: string; }`\n - `frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'`\n - `billing_anchor_date?: string`\n Required when using CUSTOM_DATE. This option lets you set a historical billing anchor date, aligning future billing cycles with a chosen cadence. For example, if a contract starts on 2024-09-15 and you set the anchor date to 2024-09-10 with a MONTHLY frequency, the first usage statement will cover 09-15 to 10-10. Subsequent statements will follow the 10th of each month.\n - `day?: 'FIRST_OF_MONTH' | 'CONTRACT_START' | 'CUSTOM_DATE'`\n If not provided, defaults to the first day of the month.\n - `invoice_generation_starting_at?: string`\n The date Metronome should start generating usage invoices. If unspecified, contract start date will be used. This is useful to set if you want to import historical invoices via our 'Create Historical Invoices' API rather than having Metronome automatically generate them.\n\n### Returns\n\n- `{ data: { id: string; }; }`\n\n - `data: { id: string; }`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst contract = await client.v1.contracts.create({ customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d', starting_at: '2020-01-01T00:00:00.000Z' });\n\nconsole.log(contract);\n```",
+ "## create\n\n`client.v1.contracts.create(customer_id: string, starting_at: string, billing_provider_configuration?: { billing_provider?: 'aws_marketplace' | 'azure_marketplace' | 'gcp_marketplace' | 'stripe' | 'netsuite'; billing_provider_configuration_id?: string; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }, commits?: { product_id: string; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: object[]; credit_type_id?: string; }; amount?: number; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: object; invoice_schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: object[]; spend_tracker_attributes?: { counts_as_discounted: boolean; }; temporary_id?: string; }[], credits?: { access_schedule: { schedule_items: object[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: object[]; }[], custom_fields?: object, discounts?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[], ending_before?: string, hierarchy_configuration?: { parent?: { contract_id: string; customer_id: string; }; parent_behavior?: { invoice_consolidation_type?: 'CONCATENATE' | 'NONE'; }; payer?: 'SELF' | 'PARENT'; usage_statement_behavior?: 'CONSOLIDATE' | 'SEPARATE'; }, multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT', name?: string, net_payment_terms_days?: number, netsuite_sales_order_id?: string, overrides?: { starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: tier[]; }; priority?: number; product_id?: string; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[], package_alias?: string, package_id?: string, prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; threshold_balance_specifiers?: object[]; }, professional_services?: { max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[], rate_card_alias?: string, rate_card_id?: string, recurring_commits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: object; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { apply_seat_increase_config: object; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[], recurring_credits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { apply_seat_increase_config: object; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[], reseller_royalties?: { fraction: number; netsuite_reseller_id: string; reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_options?: { aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; }; ending_before?: string; gcp_options?: { gcp_account_id?: string; gcp_offer_id?: string; }; reseller_contract_value?: number; }[], revenue_system_configuration?: { delivery_method?: 'direct_to_billing_provider'; provider?: 'netsuite'; revenue_system_configuration_id?: string; }, salesforce_opportunity_id?: string, scheduled_charges?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[], scheduled_charges_on_usage_invoices?: 'ALL', spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; threshold_amount: number; discount_configuration?: object; }, spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[], subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated?: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product_id: string; }; custom_fields?: object; description?: string; ending_before?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { initial_seat_ids: string[]; seat_group_key: string; initial_unassigned_seats?: number; }; starting_at?: string; temporary_id?: string; }[], total_contract_value?: number, transition?: { from_contract_id: string; type: 'SUPERSEDE' | 'RENEWAL'; future_invoice_behavior?: { trueup?: 'REMOVE' | 'AS_IS'; }; }, uniqueness_key?: string, usage_filter?: { group_key: string; group_values: string[]; starting_at?: string; }, usage_statement_schedule?: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; billing_anchor_date?: string; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START' | 'CUSTOM_DATE'; invoice_generation_starting_at?: string; }): { data: id; }`\n\n**post** `/v1/contracts/create`\n\nContracts define a customer's products, pricing, discounts, access duration, and billing configuration. Contracts serve as the central billing agreement for both PLG and Enterprise customers. You can automatically grant customers access to your products and services directly from your product or CRM.\n\n### Use this endpoint to:\n- PLG onboarding: Automatically provision new self-serve customers with contracts when they sign up.\n- Enterprise sales: Push negotiated contracts from Salesforce with custom pricing and commitments\n- Promotional pricing: Implement time-limited discounts and free trials through overrides\n\n### Key components:\n#### Contract Term and Billing Schedule\n- Set contract duration using `starting_at` and `ending_before` fields. PLG contracts typically use perpetual agreements (no end date), while Enterprise contracts have fixed end dates which can be edited over time in the case of co-term upsells.\n\n#### Rate Card\nIf you are offering usage based pricing, you can set a rate card for the contract to reference through `rate_card_id` or `rate_card_alias`. The rate card is a store of all of your usage based products and their centralized pricing. Any new products or price changes on the rate card can be set to automatically propagate to all associated contracts - this ensures consistent pricing and product launches flow to contracts without manual updates and migrations. The `usage_statement_schedule` determines the cadence on which Metronome will finalize a usage invoice for the customer. This defaults to monthly on the 1st, with options for custom dates, quarterly, or annual cadences. Note: Most usage based billing companies align usage statements to be evaluated aligned to the first of the month.\nRead more about [Rate Cards](https://docs.metronome.com/pricing-packaging/create-manage-rate-cards/).\n\n#### Overrides and discounts\nCustomize pricing on the contract through time-bounded overrides that can target specific products, product families, or complex usage scenarios. Overrides enable two key capabilities:\n- Discounts: Apply percentage discounts, fixed rate reductions, or quantity-based pricing tiers\n- Entitlements: Provide special pricing or access to specific products for negotiated deals\n\nRead more about [Contract Overrides](https://docs.metronome.com/manage-product-access/add-contract-override/).\n\n#### Commits and Credits\nUsing commits, configure prepaid or postpaid spending commitments where customers promise to spend a certain amount over the contract period paid in advance or in arrears. Use credits to provide free spending allowances. Under the hood these are the same mechanisms, however, credits are typically offered for free (SLA or promotional) or as a part of an allotment associated with a Subscription.\n\nIn Metronome, you can set commits and credits to only be applicable for a subset of usage. Use `applicable_product_ids` or `applicable_product_tags` to create product or product-family specific commits or credits, or you can build complex boolean logic specifiers to target usage based on pricing and presentation group values using `override_specifiers`.\n\nThese objects can also also be configured to have a recurrence schedule to easily model customer packaging which includes recurring monthly or quarterly allotments.\n\nCommits support rollover settings (`rollover_fraction`) to transfer unused balances between contract periods, either entirely or as a percentage.\n\nRead more about [Credits and Commits](https://docs.metronome.com/pricing-packaging/apply-credits-commits/).\n\n#### Subscriptions\nYou can add a fixed recurring charge to a contract, like monthly licenses or seat-based fees, using the subscription charge. Subscription charges are defined on your rate card and you can select which subscription is applicable to add to each contract. When you add a subscription to a contract you need to:\n- Define whether the subscription is paid for in-advance or in-arrears (`collection_schedule`)\n- Define the proration behavior (`proration`)\n- Specify an initial quantity (`initial_quantity`)\n- Define which subscription rate on the rate card should be used (`subscription_rate`)\n\nRead more about [Subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/).\n\n#### Scheduled Charges\nSet up one-time, recurring, or entirely custom charges that occur on specific dates, separate from usage-based billing or commitments. These can be used to model non-recurring platform charges or professional services.\n\n#### Threshold Billing\nMetronome allows you to configure automatic billing triggers when customers reach spending thresholds to prevent fraud and manage risk. You can use `spend_threshold_configuration` to trigger an invoice to cover current charges whenever the threshold is reached or you can ensure the customer maintains a minimum prepaid balance using the `prepaid_balance_configuration`.\n\nRead more about [Spend Threshold](https://docs.metronome.com/manage-product-access/spend-thresholds/) and [Prepaid Balance Thresholds](https://docs.metronome.com/manage-product-access/prepaid-balance-thresholds/).\n\n### Usage guidelines:\n- You can always [Edit Contracts](https://docs.metronome.com/manage-product-access/edit-contract/) after it has been created, using the `editContract` endpoint. Metronome keeps track of all edits, both in the audit log and over the `getEditHistory` endpoint.\n- Customers in Metronome can have multiple concurrent contracts at one time. Use `usage_filters` to route the correct usage to each contract. [Read more about usage filters](https://docs.metronome.com/manage-product-access/provision-customer/#create-a-usage-filter).\n\n\n### Parameters\n\n- `customer_id: string`\n\n- `starting_at: string`\n inclusive contract start time\n\n- `billing_provider_configuration?: { billing_provider?: 'aws_marketplace' | 'azure_marketplace' | 'gcp_marketplace' | 'stripe' | 'netsuite'; billing_provider_configuration_id?: string; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }`\n The billing provider configuration associated with a contract. Provide either an ID or the provider and delivery method.\n - `billing_provider?: 'aws_marketplace' | 'azure_marketplace' | 'gcp_marketplace' | 'stripe' | 'netsuite'`\n Do not specify if using billing_provider_configuration_id.\n - `billing_provider_configuration_id?: string`\n The Metronome ID of the billing provider configuration. Use when a customer has multiple configurations with the same billing provider and delivery method. Otherwise, specify the billing_provider and delivery_method.\n - `delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'`\n Do not specify if using billing_provider_configuration_id.\n\n- `commits?: { product_id: string; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; amount?: number; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; spend_tracker_attributes?: { counts_as_discounted: boolean; }; temporary_id?: string; }[]`\n\n- `credits?: { access_schedule: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]`\n\n- `custom_fields?: object`\n Custom fields to be added eg. { \"key1\": \"value1\", \"key2\": \"value2\" }\n\n- `discounts?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]`\n This field's availability is dependent on your client's configuration.\n\n- `ending_before?: string`\n exclusive contract end time\n\n- `hierarchy_configuration?: { parent?: { contract_id: string; customer_id: string; }; parent_behavior?: { invoice_consolidation_type?: 'CONCATENATE' | 'NONE'; }; payer?: 'SELF' | 'PARENT'; usage_statement_behavior?: 'CONSOLIDATE' | 'SEPARATE'; }`\n - `parent?: { contract_id: string; customer_id: string; }`\n - `parent_behavior?: { invoice_consolidation_type?: 'CONCATENATE' | 'NONE'; }`\n - `payer?: 'SELF' | 'PARENT'`\n Indicates which customer should pay for the child's invoice charges\n\n**SELF**: The child pays for its own invoice charges\n\n**PARENT**: The parent pays for the child's invoice charges\n - `usage_statement_behavior?: 'CONSOLIDATE' | 'SEPARATE'`\n Indicates the behavior of the child's invoice statements on the parent's invoices.\n\n**CONSOLIDATE**: Child's invoice statements will be added to parent's consolidated invoices\n\n**SEPARATE**: Child's invoice statements will appear not appear on parent's consolidated invoices\n\n- `multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'`\n Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list prices automatically. EXPLICIT prioritization requires specifying priorities for each multiplier; the one with the lowest priority value will be prioritized first. If tiered overrides are used, prioritization must be explicit.\n\n- `name?: string`\n\n- `net_payment_terms_days?: number`\n\n- `netsuite_sales_order_id?: string`\n This field's availability is dependent on your client's configuration.\n\n- `overrides?: { starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: { price: number; size?: number; }[]; }; priority?: number; product_id?: string; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]`\n\n- `package_alias?: string`\n Selects the package linked to the specified alias as of the contract's start date. Mutually exclusive with package_id.\n\n- `package_id?: string`\n If provided, provisions a customer on a package instead of creating a traditional contract. When specified, only customer_id, starting_at, package_id, uniqueness_key, transition, and custom_fields are allowed.\n\n- `prepaid_balance_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; threshold_balance_specifiers?: { exclude: { custom_field_filters: object[]; }[]; }[]; }`\n - `commit: { product_id: string; description?: string; name?: string; priority?: number; }`\n - `is_enabled: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `recharge_to_amount: number`\n Specify the amount the balance should be recharged to.\n - `threshold_amount: number`\n Specify the threshold amount for the contract. Each time the contract's prepaid balance lowers to this amount, a threshold charge will be initiated.\n - `custom_credit_type_id?: string`\n If provided, the threshold, recharge-to amount, and the resulting threshold commit amount will be in terms of this credit type instead of the fiat currency.\n - `discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }`\n - `threshold_balance_specifiers?: { exclude: { custom_field_filters: { entity: 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit'; key: string; value: string; }[]; }[]; }[]`\n\n- `professional_services?: { max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[]`\n This field's availability is dependent on your client's configuration.\n\n- `rate_card_alias?: string`\n Selects the rate card linked to the specified alias as of the contract's start date.\n\n- `rate_card_id?: string`\n\n- `recurring_commits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[]`\n\n- `recurring_credits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[]`\n\n- `reseller_royalties?: { fraction: number; netsuite_reseller_id: string; reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_options?: { aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; }; ending_before?: string; gcp_options?: { gcp_account_id?: string; gcp_offer_id?: string; }; reseller_contract_value?: number; }[]`\n This field's availability is dependent on your client's configuration.\n\n- `revenue_system_configuration?: { delivery_method?: 'direct_to_billing_provider'; provider?: 'netsuite'; revenue_system_configuration_id?: string; }`\n The revenue system configuration associated with a contract. Provide either an ID or the provider and delivery method.\n - `delivery_method?: 'direct_to_billing_provider'`\n How revenue recognition records should be delivered to the revenue system. Do not specify if using revenue_system_configuration_id.\n - `provider?: 'netsuite'`\n The system that is providing services for revenue recognition. Do not specify if using revenue_system_configuration_id.\n - `revenue_system_configuration_id?: string`\n The Metronome ID of the revenue system configuration. Use when a customer has multiple configurations with the same provider and delivery method. Otherwise, specify the provider and delivery_method.\n\n- `salesforce_opportunity_id?: string`\n This field's availability is dependent on your client's configuration.\n\n- `scheduled_charges?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]`\n\n- `scheduled_charges_on_usage_invoices?: 'ALL'`\n Determines which scheduled and commit charges to consolidate onto the Contract's usage invoice. The charge's `timestamp` must match the usage invoice's `ending_before` date for consolidation to occur. This field cannot be modified after a Contract has been created. If this field is omitted, charges will appear on a separate invoice from usage charges.\n\n- `spend_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount: number; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; }`\n - `commit: { product_id: string; description?: string; name?: string; priority?: number; }`\n - `is_enabled: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `threshold_amount: number`\n Specify the threshold amount for the contract. Each time the contract's usage hits this amount, a threshold charge will be initiated.\n - `discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }`\n\n- `spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[]`\n Spend trackers to attach to this contract. Aliases must be unique within a contract.\n\n- `subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated?: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product_id: string; }; custom_fields?: object; description?: string; ending_before?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { initial_seat_ids: string[]; seat_group_key: string; initial_unassigned_seats?: number; }; starting_at?: string; temporary_id?: string; }[]`\n Optional list of [subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/) to add to the contract.\n\n- `total_contract_value?: number`\n This field's availability is dependent on your client's configuration.\n\n- `transition?: { from_contract_id: string; type: 'SUPERSEDE' | 'RENEWAL'; future_invoice_behavior?: { trueup?: 'REMOVE' | 'AS_IS'; }; }`\n - `from_contract_id: string`\n - `type: 'SUPERSEDE' | 'RENEWAL'`\n This field's available values may vary based on your client's configuration.\n - `future_invoice_behavior?: { trueup?: 'REMOVE' | 'AS_IS'; }`\n\n- `uniqueness_key?: string`\n Prevents the creation of duplicates. If a request to create a record is made with a previously used uniqueness key, a new record will not be created and the request will fail with a 409 error.\n\n- `usage_filter?: { group_key: string; group_values: string[]; starting_at?: string; }`\n - `group_key: string`\n - `group_values: string[]`\n - `starting_at?: string`\n\n- `usage_statement_schedule?: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; billing_anchor_date?: string; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START' | 'CUSTOM_DATE'; invoice_generation_starting_at?: string; }`\n - `frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'`\n - `billing_anchor_date?: string`\n Required when using CUSTOM_DATE. This option lets you set a historical billing anchor date, aligning future billing cycles with a chosen cadence. For example, if a contract starts on 2024-09-15 and you set the anchor date to 2024-09-10 with a MONTHLY frequency, the first usage statement will cover 09-15 to 10-10. Subsequent statements will follow the 10th of each month.\n - `day?: 'FIRST_OF_MONTH' | 'CONTRACT_START' | 'CUSTOM_DATE'`\n If not provided, defaults to the first day of the month.\n - `invoice_generation_starting_at?: string`\n The date Metronome should start generating usage invoices. If unspecified, contract start date will be used. This is useful to set if you want to import historical invoices via our 'Create Historical Invoices' API rather than having Metronome automatically generate them.\n\n### Returns\n\n- `{ data: { id: string; }; }`\n\n - `data: { id: string; }`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst contract = await client.v1.contracts.create({ customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d', starting_at: '2020-01-01T00:00:00.000Z' });\n\nconsole.log(contract);\n```",
perLanguage: {
typescript: {
method: 'client.v1.contracts.create',
@@ -5488,7 +5488,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
"multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT';",
'net_payment_terms_days?: number;',
"overrides?: { override_specifiers: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: { price: number; size?: number; }[]; }; priority?: number; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[];",
- "prepaid_balance_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; };",
+ "prepaid_balance_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; threshold_balance_specifiers?: { exclude: { custom_field_filters: object[]; }[]; }[]; };",
'rate_card_alias?: string;',
'rate_card_id?: string;',
"recurring_commits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[];",
@@ -5503,7 +5503,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
],
response: '{ data: { id: string; }; }',
markdown:
- "## create\n\n`client.v1.packages.create(name: string, aliases?: { name: string; ending_before?: string; starting_at?: string; }[], billing_provider?: 'aws_marketplace' | 'azure_marketplace' | 'gcp_marketplace' | 'stripe' | 'netsuite', commits?: { access_schedule: { schedule_items: object[]; credit_type_id?: string; }; product_id: string; type: 'PREPAID' | 'POSTPAID'; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; invoice_schedule?: { schedule_items: object[]; credit_type_id?: string; do_not_invoice?: boolean; }; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: object[]; temporary_id?: string; }[], contract_name?: string, credits?: { access_schedule: { schedule_items: object[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; specifiers?: object[]; }[], delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns', duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }, multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT', net_payment_terms_days?: number, overrides?: { override_specifiers: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: tier[]; }; priority?: number; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[], prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; }, rate_card_alias?: string, rate_card_id?: string, recurring_commits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { apply_seat_increase_config: object; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[], recurring_credits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { apply_seat_increase_config: object; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[], scheduled_charges?: { product_id: string; schedule: { schedule_items: object[]; credit_type_id?: string; }; custom_fields?: object; name?: string; }[], scheduled_charges_on_usage_invoices?: 'ALL', spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; threshold_amount: number; discount_configuration?: object; }, spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[], subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated?: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product_id: string; }; custom_fields?: object; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { seat_group_key: string; initial_unassigned_seats?: number; }; starting_at_offset?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; temporary_id?: string; }[], uniqueness_key?: string, usage_statement_schedule?: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START'; invoice_generation_starting_at_offset?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; }): { data: id; }`\n\n**post** `/v1/packages/create`\n\nCreate a package that defines a set of reusable, time-relative contract terms that can be used across cohorts of customers. Packages provide an abstraction layer on top of rate cards to provide an easy way to provision customers with standard pricing. \n\n### **Use this endpoint to:**\n- Model standard pay-as-you-go pricing packages that can be easily reused across customers\n- Define standardized contract terms and discounting for sales-led motions\n- Set aliases for the package to facilitate easy package transition. Aliases are human-readable names that you can use in the place of the id of the package when provisioning a customer’s contract. By using an alias, you can easily create a contract and provision a customer by choosing the “Starter Plan” package, without storing the package ID in your internal systems. This is helpful when launching terms for a package, as you can create a new package with the “Starter Plan” alias scheduled to be assigned without updating your provisioning code.\n\n### Key input fields:\n- `starting_at_offset`: Starting date relative to contract start. Generates the `starting_at` date when a contract is provisioned using a package.\n- `duration`: Duration starting from `starting_at_offset`. Generates the `ending_before` date when a contract is provisioned using a package.\n- `date_offset`: Date relative to contract start. Used for point-in-time dates without a duration.\n- `aliases`: Human-readable name to use when provisioning contracts with a package.\n\n### Usage guidelines:\n- Use packages for standard self-serve use cases where customers have consistent terms. For customers with negotiated custom contract terms, use the `createContract` endpoint for maximum flexibility.\n- Billing provider configuration can be set when creating a package by using `billing_provider` and `delivery_method`. To provision a customer successfully with a package, the customer must have one and only one billing provider configuration that matches the billing provider configuration set on the package.\n- A package alias can only be used by one package at a time. If you create a new package with an alias that is already in use by another package, the original package’s alias schedule will be updated. The alias will reference the package to which it was most recently assigned.\n- Terms can only be specified using times relative to the contract start date. Supported granularities are: `days`, `weeks`, `months`, `years`\n- Packages cannot be edited once created. Use the rate card to easily add new rates across all of your customers or make direct edits to a contract after provisioning with a package. Edited contracts will still be associated with the package used during provisioning.\n\n\n### Parameters\n\n- `name: string`\n\n- `aliases?: { name: string; ending_before?: string; starting_at?: string; }[]`\n Reference this alias when creating a contract. If the same alias is assigned to multiple packages, it will reference the package to which it was most recently assigned. It is not exposed to end customers.\n\n- `billing_provider?: 'aws_marketplace' | 'azure_marketplace' | 'gcp_marketplace' | 'stripe' | 'netsuite'`\n\n- `commits?: { access_schedule: { schedule_items: { amount: number; duration: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; }[]; credit_type_id?: string; }; product_id: string; type: 'PREPAID' | 'POSTPAID'; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; invoice_schedule?: { schedule_items: { date_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; quantity: number; unit_price: number; }[]; credit_type_id?: string; do_not_invoice?: boolean; }; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; temporary_id?: string; }[]`\n\n- `contract_name?: string`\n\n- `credits?: { access_schedule: { schedule_items: { amount: number; duration: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; }[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]`\n\n- `delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'`\n\n- `duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }`\n - `unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'`\n - `value: number`\n\n- `multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'`\n Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list prices automatically. EXPLICIT prioritization requires specifying priorities for each multiplier; the one with the lowest priority value will be prioritized first. If tiered overrides are used, prioritization must be explicit.\n\n- `net_payment_terms_days?: number`\n\n- `overrides?: { override_specifiers: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: { price: number; size?: number; }[]; }; priority?: number; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]`\n\n- `prepaid_balance_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; }`\n - `commit: { product_id: string; description?: string; name?: string; priority?: number; }`\n - `is_enabled: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `recharge_to_amount: number`\n Specify the amount the balance should be recharged to.\n - `threshold_amount: number`\n Specify the threshold amount for the contract. Each time the contract's prepaid balance lowers to this amount, a threshold charge will be initiated.\n - `custom_credit_type_id?: string`\n If provided, the threshold, recharge-to amount, and the resulting threshold commit amount will be in terms of this credit type instead of the fiat currency.\n - `discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }`\n\n- `rate_card_alias?: string`\n Selects the rate card linked to the specified alias as of the contract's start date.\n\n- `rate_card_id?: string`\n\n- `recurring_commits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[]`\n\n- `recurring_credits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[]`\n\n- `scheduled_charges?: { product_id: string; schedule: { schedule_items: { date_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; quantity: number; unit_price: number; }[]; credit_type_id?: string; }; custom_fields?: object; name?: string; }[]`\n\n- `scheduled_charges_on_usage_invoices?: 'ALL'`\n Determines which scheduled and commit charges to consolidate onto the Contract's usage invoice. The charge's `timestamp` must match the usage invoice's `ending_before` date for consolidation to occur. This field cannot be modified after a Contract has been created. If this field is omitted, charges will appear on a separate invoice from usage charges.\n\n- `spend_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount: number; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; }`\n - `commit: { product_id: string; description?: string; name?: string; priority?: number; }`\n - `is_enabled: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `threshold_amount: number`\n Specify the threshold amount for the contract. Each time the contract's usage hits this amount, a threshold charge will be initiated.\n - `discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }`\n\n- `spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[]`\n\n- `subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated?: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product_id: string; }; custom_fields?: object; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { seat_group_key: string; initial_unassigned_seats?: number; }; starting_at_offset?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; temporary_id?: string; }[]`\n\n- `uniqueness_key?: string`\n Prevents the creation of duplicates. If a request to create a record is made with a previously used uniqueness key, a new record will not be created and the request will fail with a 409 error.\n\n- `usage_statement_schedule?: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START'; invoice_generation_starting_at_offset?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; }`\n - `frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'`\n - `day?: 'FIRST_OF_MONTH' | 'CONTRACT_START'`\n If not provided, defaults to the first day of the month.\n - `invoice_generation_starting_at_offset?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }`\n The offset at which Metronome should start generating usage invoices, relative to the contract start date. If unspecified, contract start date will be used. This is useful to set if you want to import historical invoices via our 'Create Historical Invoices' API rather than having Metronome automatically generate them.\n\n### Returns\n\n- `{ data: { id: string; }; }`\n\n - `data: { id: string; }`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst _package = await client.v1.packages.create({ name: 'My package' });\n\nconsole.log(_package);\n```",
+ "## create\n\n`client.v1.packages.create(name: string, aliases?: { name: string; ending_before?: string; starting_at?: string; }[], billing_provider?: 'aws_marketplace' | 'azure_marketplace' | 'gcp_marketplace' | 'stripe' | 'netsuite', commits?: { access_schedule: { schedule_items: object[]; credit_type_id?: string; }; product_id: string; type: 'PREPAID' | 'POSTPAID'; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; invoice_schedule?: { schedule_items: object[]; credit_type_id?: string; do_not_invoice?: boolean; }; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: object[]; temporary_id?: string; }[], contract_name?: string, credits?: { access_schedule: { schedule_items: object[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; specifiers?: object[]; }[], delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns', duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }, multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT', net_payment_terms_days?: number, overrides?: { override_specifiers: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: tier[]; }; priority?: number; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[], prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; threshold_balance_specifiers?: object[]; }, rate_card_alias?: string, rate_card_id?: string, recurring_commits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { apply_seat_increase_config: object; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[], recurring_credits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { apply_seat_increase_config: object; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[], scheduled_charges?: { product_id: string; schedule: { schedule_items: object[]; credit_type_id?: string; }; custom_fields?: object; name?: string; }[], scheduled_charges_on_usage_invoices?: 'ALL', spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; threshold_amount: number; discount_configuration?: object; }, spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[], subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated?: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product_id: string; }; custom_fields?: object; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { seat_group_key: string; initial_unassigned_seats?: number; }; starting_at_offset?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; temporary_id?: string; }[], uniqueness_key?: string, usage_statement_schedule?: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START'; invoice_generation_starting_at_offset?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; }): { data: id; }`\n\n**post** `/v1/packages/create`\n\nCreate a package that defines a set of reusable, time-relative contract terms that can be used across cohorts of customers. Packages provide an abstraction layer on top of rate cards to provide an easy way to provision customers with standard pricing. \n\n### **Use this endpoint to:**\n- Model standard pay-as-you-go pricing packages that can be easily reused across customers\n- Define standardized contract terms and discounting for sales-led motions\n- Set aliases for the package to facilitate easy package transition. Aliases are human-readable names that you can use in the place of the id of the package when provisioning a customer’s contract. By using an alias, you can easily create a contract and provision a customer by choosing the “Starter Plan” package, without storing the package ID in your internal systems. This is helpful when launching terms for a package, as you can create a new package with the “Starter Plan” alias scheduled to be assigned without updating your provisioning code.\n\n### Key input fields:\n- `starting_at_offset`: Starting date relative to contract start. Generates the `starting_at` date when a contract is provisioned using a package.\n- `duration`: Duration starting from `starting_at_offset`. Generates the `ending_before` date when a contract is provisioned using a package.\n- `date_offset`: Date relative to contract start. Used for point-in-time dates without a duration.\n- `aliases`: Human-readable name to use when provisioning contracts with a package.\n\n### Usage guidelines:\n- Use packages for standard self-serve use cases where customers have consistent terms. For customers with negotiated custom contract terms, use the `createContract` endpoint for maximum flexibility.\n- Billing provider configuration can be set when creating a package by using `billing_provider` and `delivery_method`. To provision a customer successfully with a package, the customer must have one and only one billing provider configuration that matches the billing provider configuration set on the package.\n- A package alias can only be used by one package at a time. If you create a new package with an alias that is already in use by another package, the original package’s alias schedule will be updated. The alias will reference the package to which it was most recently assigned.\n- Terms can only be specified using times relative to the contract start date. Supported granularities are: `days`, `weeks`, `months`, `years`\n- Packages cannot be edited once created. Use the rate card to easily add new rates across all of your customers or make direct edits to a contract after provisioning with a package. Edited contracts will still be associated with the package used during provisioning.\n\n\n### Parameters\n\n- `name: string`\n\n- `aliases?: { name: string; ending_before?: string; starting_at?: string; }[]`\n Reference this alias when creating a contract. If the same alias is assigned to multiple packages, it will reference the package to which it was most recently assigned. It is not exposed to end customers.\n\n- `billing_provider?: 'aws_marketplace' | 'azure_marketplace' | 'gcp_marketplace' | 'stripe' | 'netsuite'`\n\n- `commits?: { access_schedule: { schedule_items: { amount: number; duration: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; }[]; credit_type_id?: string; }; product_id: string; type: 'PREPAID' | 'POSTPAID'; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; invoice_schedule?: { schedule_items: { date_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; quantity: number; unit_price: number; }[]; credit_type_id?: string; do_not_invoice?: boolean; }; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; temporary_id?: string; }[]`\n\n- `contract_name?: string`\n\n- `credits?: { access_schedule: { schedule_items: { amount: number; duration: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; }[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]`\n\n- `delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'`\n\n- `duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }`\n - `unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'`\n - `value: number`\n\n- `multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'`\n Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list prices automatically. EXPLICIT prioritization requires specifying priorities for each multiplier; the one with the lowest priority value will be prioritized first. If tiered overrides are used, prioritization must be explicit.\n\n- `net_payment_terms_days?: number`\n\n- `overrides?: { override_specifiers: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: { price: number; size?: number; }[]; }; priority?: number; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]`\n\n- `prepaid_balance_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; threshold_balance_specifiers?: { exclude: { custom_field_filters: object[]; }[]; }[]; }`\n - `commit: { product_id: string; description?: string; name?: string; priority?: number; }`\n - `is_enabled: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `recharge_to_amount: number`\n Specify the amount the balance should be recharged to.\n - `threshold_amount: number`\n Specify the threshold amount for the contract. Each time the contract's prepaid balance lowers to this amount, a threshold charge will be initiated.\n - `custom_credit_type_id?: string`\n If provided, the threshold, recharge-to amount, and the resulting threshold commit amount will be in terms of this credit type instead of the fiat currency.\n - `discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }`\n - `threshold_balance_specifiers?: { exclude: { custom_field_filters: { entity: 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit'; key: string; value: string; }[]; }[]; }[]`\n\n- `rate_card_alias?: string`\n Selects the rate card linked to the specified alias as of the contract's start date.\n\n- `rate_card_id?: string`\n\n- `recurring_commits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[]`\n\n- `recurring_credits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[]`\n\n- `scheduled_charges?: { product_id: string; schedule: { schedule_items: { date_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; quantity: number; unit_price: number; }[]; credit_type_id?: string; }; custom_fields?: object; name?: string; }[]`\n\n- `scheduled_charges_on_usage_invoices?: 'ALL'`\n Determines which scheduled and commit charges to consolidate onto the Contract's usage invoice. The charge's `timestamp` must match the usage invoice's `ending_before` date for consolidation to occur. This field cannot be modified after a Contract has been created. If this field is omitted, charges will appear on a separate invoice from usage charges.\n\n- `spend_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount: number; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; }`\n - `commit: { product_id: string; description?: string; name?: string; priority?: number; }`\n - `is_enabled: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `threshold_amount: number`\n Specify the threshold amount for the contract. Each time the contract's usage hits this amount, a threshold charge will be initiated.\n - `discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }`\n\n- `spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[]`\n\n- `subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated?: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product_id: string; }; custom_fields?: object; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { seat_group_key: string; initial_unassigned_seats?: number; }; starting_at_offset?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; temporary_id?: string; }[]`\n\n- `uniqueness_key?: string`\n Prevents the creation of duplicates. If a request to create a record is made with a previously used uniqueness key, a new record will not be created and the request will fail with a 409 error.\n\n- `usage_statement_schedule?: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START'; invoice_generation_starting_at_offset?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; }`\n - `frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'`\n - `day?: 'FIRST_OF_MONTH' | 'CONTRACT_START'`\n If not provided, defaults to the first day of the month.\n - `invoice_generation_starting_at_offset?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }`\n The offset at which Metronome should start generating usage invoices, relative to the contract start date. If unspecified, contract start date will be used. This is useful to set if you want to import historical invoices via our 'Create Historical Invoices' API rather than having Metronome automatically generate them.\n\n### Returns\n\n- `{ data: { id: string; }; }`\n\n - `data: { id: string; }`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst _package = await client.v1.packages.create({ name: 'My package' });\n\nconsole.log(_package);\n```",
perLanguage: {
typescript: {
method: 'client.v1.packages.create',
@@ -5549,7 +5549,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
response:
"{ data: { id: string; commits: object[]; created_at: string; created_by: string; overrides: object[]; scheduled_charges: object[]; usage_statement_schedule: object; aliases?: object[]; archived_at?: string; billing_provider?: string; contract_name?: string; credits?: object[]; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; duration?: object; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; spend_trackers?: object[]; subscriptions?: object[]; uniqueness_key?: string; }; }",
markdown:
- "## retrieve\n\n`client.v1.packages.retrieve(package_id: string): { data: object; }`\n\n**post** `/v1/packages/get`\n\nGets the details for a specific package, including name, aliases, duration, and terms. Use this endpoint to understand a package’s alias schedule, or display a specific package’s details to end customers.\n\n\n### Parameters\n\n- `package_id: string`\n\n### Returns\n\n- `{ data: { id: string; commits: { id: string; product: object; type: 'PREPAID' | 'POSTPAID'; access_schedule?: object; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; invoice_schedule?: object; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: commit_specifier[]; }[]; created_at: string; created_by: string; overrides: { id: string; override_specifiers: object[]; starting_at_offset: object; applicable_product_tags?: string[]; duration?: object; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_tiers?: override_tier[]; overwrite_rate?: overwrite_rate; priority?: number; product?: object; target?: 'COMMIT_RATE' | 'LIST_RATE'; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]; scheduled_charges: { id: string; product: object; schedule: object; custom_fields?: object; description?: string; name?: string; }[]; usage_statement_schedule: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START'; }; aliases?: { name: string; ending_before?: string; starting_at?: string; }[]; archived_at?: string; billing_provider?: string; contract_name?: string; credits?: { id: string; product: object; access_schedule?: object; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; specifiers?: commit_specifier[]; }[]; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; prepaid_balance_threshold_configuration?: object; rate_card_id?: string; recurring_commits?: { id: string; access_amount: object; commit_duration: object; priority: number; product: object; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at_offset: object; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: object; invoice_amount?: object; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: commit_specifier[]; subscription_config?: object; }[]; recurring_credits?: { id: string; access_amount: object; commit_duration: object; priority: number; product: object; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at_offset: object; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: object; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: commit_specifier[]; subscription_config?: object; }[]; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: object; spend_trackers?: { alias: string; applicable_spend_specifiers: object[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[]; subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: object; subscription_rate: object; id?: string; custom_fields?: object; description?: string; duration?: object; fiat_credit_type_id?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: object; starting_at_offset?: object; }[]; uniqueness_key?: string; }; }`\n\n - `data: { id: string; commits: { id: string; product: { id: string; name: string; }; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { credit_type: object; schedule_items: { id: string; amount: number; duration: object; starting_at_offset: object; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; invoice_schedule?: { credit_type: object; do_not_invoice: boolean; schedule_items: { id: string; date_offset: object; quantity: number; unit_price: number; }[]; }; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]; created_at: string; created_by: string; overrides: { id: string; override_specifiers: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_template_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_template_ids?: string[]; }[]; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_tags?: string[]; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_tiers?: { multiplier: number; size?: number; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type?: credit_type_data; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: tier[]; }; priority?: number; product?: { id: string; name: string; }; target?: 'COMMIT_RATE' | 'LIST_RATE'; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]; scheduled_charges: { id: string; product: { id: string; name: string; }; schedule: { credit_type: object; schedule_items: { id: string; date_offset: object; quantity: number; unit_price: number; }[]; }; custom_fields?: object; description?: string; name?: string; }[]; usage_statement_schedule: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START'; }; aliases?: { name: string; ending_before?: string; starting_at?: string; }[]; archived_at?: string; billing_provider?: string; contract_name?: string; credits?: { id: string; product: { id: string; name: string; }; access_schedule?: { credit_type: object; schedule_items: { id: string; amount: number; duration: object; starting_at_offset: object; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; prepaid_balance_threshold_configuration?: { commit: object; is_enabled: boolean; payment_gate_config: object; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; cap?: object; }; }; rate_card_id?: string; recurring_commits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { allocation: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config: { is_prorated: boolean; }; subscription_template_id: string; }; }[]; recurring_credits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { allocation: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config: { is_prorated: boolean; }; subscription_template_id: string; }; }[]; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: { commit: object; is_enabled: boolean; payment_gate_config: object; threshold_amount: number; discount_configuration?: { payment_fraction: number; cap?: object; }; }; spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[]; subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product: { id: string; name: string; }; }; id?: string; custom_fields?: object; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; fiat_credit_type_id?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { seat_group_key: string; }; starting_at_offset?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; }[]; uniqueness_key?: string; }`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst _package = await client.v1.packages.retrieve({ package_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc' });\n\nconsole.log(_package);\n```",
+ "## retrieve\n\n`client.v1.packages.retrieve(package_id: string): { data: object; }`\n\n**post** `/v1/packages/get`\n\nGets the details for a specific package, including name, aliases, duration, and terms. Use this endpoint to understand a package’s alias schedule, or display a specific package’s details to end customers.\n\n\n### Parameters\n\n- `package_id: string`\n\n### Returns\n\n- `{ data: { id: string; commits: { id: string; product: object; type: 'PREPAID' | 'POSTPAID'; access_schedule?: object; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; invoice_schedule?: object; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: commit_specifier[]; }[]; created_at: string; created_by: string; overrides: { id: string; override_specifiers: object[]; starting_at_offset: object; applicable_product_tags?: string[]; duration?: object; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_tiers?: override_tier[]; overwrite_rate?: overwrite_rate; priority?: number; product?: object; target?: 'COMMIT_RATE' | 'LIST_RATE'; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]; scheduled_charges: { id: string; product: object; schedule: object; custom_fields?: object; description?: string; name?: string; }[]; usage_statement_schedule: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START'; }; aliases?: { name: string; ending_before?: string; starting_at?: string; }[]; archived_at?: string; billing_provider?: string; contract_name?: string; credits?: { id: string; product: object; access_schedule?: object; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; specifiers?: commit_specifier[]; }[]; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; prepaid_balance_threshold_configuration?: object; rate_card_id?: string; recurring_commits?: { id: string; access_amount: object; commit_duration: object; priority: number; product: object; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at_offset: object; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: object; invoice_amount?: object; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: commit_specifier[]; subscription_config?: object; }[]; recurring_credits?: { id: string; access_amount: object; commit_duration: object; priority: number; product: object; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at_offset: object; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: object; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: commit_specifier[]; subscription_config?: object; }[]; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: object; spend_trackers?: { alias: string; applicable_spend_specifiers: object[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[]; subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: object; subscription_rate: object; id?: string; custom_fields?: object; description?: string; duration?: object; fiat_credit_type_id?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: object; starting_at_offset?: object; }[]; uniqueness_key?: string; }; }`\n\n - `data: { id: string; commits: { id: string; product: { id: string; name: string; }; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { credit_type: object; schedule_items: { id: string; amount: number; duration: object; starting_at_offset: object; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; invoice_schedule?: { credit_type: object; do_not_invoice: boolean; schedule_items: { id: string; date_offset: object; quantity: number; unit_price: number; }[]; }; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]; created_at: string; created_by: string; overrides: { id: string; override_specifiers: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_template_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_template_ids?: string[]; }[]; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_tags?: string[]; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_tiers?: { multiplier: number; size?: number; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type?: credit_type_data; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: tier[]; }; priority?: number; product?: { id: string; name: string; }; target?: 'COMMIT_RATE' | 'LIST_RATE'; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]; scheduled_charges: { id: string; product: { id: string; name: string; }; schedule: { credit_type: object; schedule_items: { id: string; date_offset: object; quantity: number; unit_price: number; }[]; }; custom_fields?: object; description?: string; name?: string; }[]; usage_statement_schedule: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START'; }; aliases?: { name: string; ending_before?: string; starting_at?: string; }[]; archived_at?: string; billing_provider?: string; contract_name?: string; credits?: { id: string; product: { id: string; name: string; }; access_schedule?: { credit_type: object; schedule_items: { id: string; amount: number; duration: object; starting_at_offset: object; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; prepaid_balance_threshold_configuration?: { commit: object; is_enabled: boolean; payment_gate_config: object; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; cap?: object; }; threshold_balance_specifiers?: { exclude: object[]; }[]; }; rate_card_id?: string; recurring_commits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { allocation: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config: { is_prorated: boolean; }; subscription_template_id: string; }; }[]; recurring_credits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { allocation: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config: { is_prorated: boolean; }; subscription_template_id: string; }; }[]; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: { commit: object; is_enabled: boolean; payment_gate_config: object; threshold_amount: number; discount_configuration?: { payment_fraction: number; cap?: object; }; }; spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[]; subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product: { id: string; name: string; }; }; id?: string; custom_fields?: object; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; fiat_credit_type_id?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { seat_group_key: string; }; starting_at_offset?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; }[]; uniqueness_key?: string; }`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst _package = await client.v1.packages.retrieve({ package_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc' });\n\nconsole.log(_package);\n```",
perLanguage: {
typescript: {
method: 'client.v1.packages.retrieve',
@@ -5599,7 +5599,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [
response:
"{ id: string; commits: object[]; created_at: string; created_by: string; overrides: object[]; scheduled_charges: object[]; usage_statement_schedule: object; aliases?: object[]; archived_at?: string; billing_provider?: string; contract_name?: string; credits?: object[]; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; duration?: object; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; spend_trackers?: object[]; subscriptions?: object[]; uniqueness_key?: string; }",
markdown:
- "## list\n\n`client.v1.packages.list(limit?: number, next_page?: string, archive_filter?: 'ARCHIVED' | 'NOT_ARCHIVED' | 'ALL'): { id: string; commits: object[]; created_at: string; created_by: string; overrides: object[]; scheduled_charges: object[]; usage_statement_schedule: object; aliases?: object[]; archived_at?: string; billing_provider?: string; contract_name?: string; credits?: object[]; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; duration?: object; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; spend_trackers?: object[]; subscriptions?: object[]; uniqueness_key?: string; }`\n\n**post** `/v1/packages/list`\n\nLists all packages with details including name, aliases, duration, and terms. To view contracts on a specific package, use the `listContractsOnPackage` endpoint.\n\n\n### Parameters\n\n- `limit?: number`\n The maximum number of packages to return. Defaults to 10.\n\n- `next_page?: string`\n Cursor that indicates where the next page of results should start.\n\n- `archive_filter?: 'ARCHIVED' | 'NOT_ARCHIVED' | 'ALL'`\n Filter packages by archived status. Defaults to NOT_ARCHIVED.\n\n### Returns\n\n- `{ id: string; commits: { id: string; product: { id: string; name: string; }; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { credit_type: credit_type_data; schedule_items: object[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; invoice_schedule?: { credit_type: credit_type_data; do_not_invoice: boolean; schedule_items: object[]; }; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: object[]; }[]; created_at: string; created_by: string; overrides: { id: string; override_specifiers: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_template_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_template_ids?: string[]; }[]; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_tags?: string[]; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_tiers?: object[]; overwrite_rate?: object; priority?: number; product?: { id: string; name: string; }; target?: 'COMMIT_RATE' | 'LIST_RATE'; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]; scheduled_charges: { id: string; product: { id: string; name: string; }; schedule: { credit_type: credit_type_data; schedule_items: object[]; }; custom_fields?: object; description?: string; name?: string; }[]; usage_statement_schedule: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START'; }; aliases?: { name: string; ending_before?: string; starting_at?: string; }[]; archived_at?: string; billing_provider?: string; contract_name?: string; credits?: { id: string; product: { id: string; name: string; }; access_schedule?: { credit_type: credit_type_data; schedule_items: object[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; specifiers?: object[]; }[]; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; }; rate_card_id?: string; recurring_commits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { allocation: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config: object; subscription_template_id: string; }; }[]; recurring_credits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { allocation: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config: object; subscription_template_id: string; }; }[]; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; threshold_amount: number; discount_configuration?: object; }; spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[]; subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product: object; }; id?: string; custom_fields?: object; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; fiat_credit_type_id?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { seat_group_key: string; }; starting_at_offset?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; }[]; uniqueness_key?: string; }`\n\n - `id: string`\n - `commits: { id: string; product: { id: string; name: string; }; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { credit_type: { id: string; name: string; }; schedule_items: { id: string; amount: number; duration: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; invoice_schedule?: { credit_type: { id: string; name: string; }; do_not_invoice: boolean; schedule_items: { id: string; date_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; quantity: number; unit_price: number; }[]; }; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]`\n - `created_at: string`\n - `created_by: string`\n - `overrides: { id: string; override_specifiers: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_template_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_template_ids?: string[]; }[]; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_tags?: string[]; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_tiers?: { multiplier: number; size?: number; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type?: object; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: object[]; }; priority?: number; product?: { id: string; name: string; }; target?: 'COMMIT_RATE' | 'LIST_RATE'; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]`\n - `scheduled_charges: { id: string; product: { id: string; name: string; }; schedule: { credit_type: { id: string; name: string; }; schedule_items: { id: string; date_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; quantity: number; unit_price: number; }[]; }; custom_fields?: object; description?: string; name?: string; }[]`\n - `usage_statement_schedule: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START'; }`\n - `aliases?: { name: string; ending_before?: string; starting_at?: string; }[]`\n - `archived_at?: string`\n - `billing_provider?: string`\n - `contract_name?: string`\n - `credits?: { id: string; product: { id: string; name: string; }; access_schedule?: { credit_type: { id: string; name: string; }; schedule_items: { id: string; amount: number; duration: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]`\n - `delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'`\n - `duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }`\n - `multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'`\n - `name?: string`\n - `net_payment_terms_days?: number`\n - `prepaid_balance_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; }`\n - `rate_card_id?: string`\n - `recurring_commits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { allocation: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config: { is_prorated: boolean; }; subscription_template_id: string; }; }[]`\n - `recurring_credits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { allocation: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config: { is_prorated: boolean; }; subscription_template_id: string; }; }[]`\n - `scheduled_charges_on_usage_invoices?: 'ALL'`\n - `spend_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount: number; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; }`\n - `spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[]`\n - `subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product: { id: string; name: string; }; }; id?: string; custom_fields?: object; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; fiat_credit_type_id?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { seat_group_key: string; }; starting_at_offset?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; }[]`\n - `uniqueness_key?: string`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\n// Automatically fetches more pages as needed.\nfor await (const packageListResponse of client.v1.packages.list()) {\n console.log(packageListResponse);\n}\n```",
+ "## list\n\n`client.v1.packages.list(limit?: number, next_page?: string, archive_filter?: 'ARCHIVED' | 'NOT_ARCHIVED' | 'ALL'): { id: string; commits: object[]; created_at: string; created_by: string; overrides: object[]; scheduled_charges: object[]; usage_statement_schedule: object; aliases?: object[]; archived_at?: string; billing_provider?: string; contract_name?: string; credits?: object[]; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; duration?: object; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; spend_trackers?: object[]; subscriptions?: object[]; uniqueness_key?: string; }`\n\n**post** `/v1/packages/list`\n\nLists all packages with details including name, aliases, duration, and terms. To view contracts on a specific package, use the `listContractsOnPackage` endpoint.\n\n\n### Parameters\n\n- `limit?: number`\n The maximum number of packages to return. Defaults to 10.\n\n- `next_page?: string`\n Cursor that indicates where the next page of results should start.\n\n- `archive_filter?: 'ARCHIVED' | 'NOT_ARCHIVED' | 'ALL'`\n Filter packages by archived status. Defaults to NOT_ARCHIVED.\n\n### Returns\n\n- `{ id: string; commits: { id: string; product: { id: string; name: string; }; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { credit_type: credit_type_data; schedule_items: object[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; invoice_schedule?: { credit_type: credit_type_data; do_not_invoice: boolean; schedule_items: object[]; }; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: object[]; }[]; created_at: string; created_by: string; overrides: { id: string; override_specifiers: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_template_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_template_ids?: string[]; }[]; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_tags?: string[]; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_tiers?: object[]; overwrite_rate?: object; priority?: number; product?: { id: string; name: string; }; target?: 'COMMIT_RATE' | 'LIST_RATE'; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]; scheduled_charges: { id: string; product: { id: string; name: string; }; schedule: { credit_type: credit_type_data; schedule_items: object[]; }; custom_fields?: object; description?: string; name?: string; }[]; usage_statement_schedule: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START'; }; aliases?: { name: string; ending_before?: string; starting_at?: string; }[]; archived_at?: string; billing_provider?: string; contract_name?: string; credits?: { id: string; product: { id: string; name: string; }; access_schedule?: { credit_type: credit_type_data; schedule_items: object[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; specifiers?: object[]; }[]; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; threshold_balance_specifiers?: object[]; }; rate_card_id?: string; recurring_commits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { allocation: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config: object; subscription_template_id: string; }; }[]; recurring_credits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { allocation: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config: object; subscription_template_id: string; }; }[]; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; threshold_amount: number; discount_configuration?: object; }; spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[]; subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product: object; }; id?: string; custom_fields?: object; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; fiat_credit_type_id?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { seat_group_key: string; }; starting_at_offset?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; }[]; uniqueness_key?: string; }`\n\n - `id: string`\n - `commits: { id: string; product: { id: string; name: string; }; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { credit_type: { id: string; name: string; }; schedule_items: { id: string; amount: number; duration: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; invoice_schedule?: { credit_type: { id: string; name: string; }; do_not_invoice: boolean; schedule_items: { id: string; date_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; quantity: number; unit_price: number; }[]; }; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]`\n - `created_at: string`\n - `created_by: string`\n - `overrides: { id: string; override_specifiers: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_template_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_template_ids?: string[]; }[]; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_tags?: string[]; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_tiers?: { multiplier: number; size?: number; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type?: object; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: object[]; }; priority?: number; product?: { id: string; name: string; }; target?: 'COMMIT_RATE' | 'LIST_RATE'; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]`\n - `scheduled_charges: { id: string; product: { id: string; name: string; }; schedule: { credit_type: { id: string; name: string; }; schedule_items: { id: string; date_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; quantity: number; unit_price: number; }[]; }; custom_fields?: object; description?: string; name?: string; }[]`\n - `usage_statement_schedule: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START'; }`\n - `aliases?: { name: string; ending_before?: string; starting_at?: string; }[]`\n - `archived_at?: string`\n - `billing_provider?: string`\n - `contract_name?: string`\n - `credits?: { id: string; product: { id: string; name: string; }; access_schedule?: { credit_type: { id: string; name: string; }; schedule_items: { id: string; amount: number; duration: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; name?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]`\n - `delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'`\n - `duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }`\n - `multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'`\n - `name?: string`\n - `net_payment_terms_days?: number`\n - `prepaid_balance_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; threshold_balance_specifiers?: { exclude: { custom_field_filters: object[]; }[]; }[]; }`\n - `rate_card_id?: string`\n - `recurring_commits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { allocation: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config: { is_prorated: boolean; }; subscription_template_id: string; }; }[]`\n - `recurring_credits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at_offset: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; name?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { allocation: 'INDIVIDUAL' | 'POOLED'; apply_seat_increase_config: { is_prorated: boolean; }; subscription_template_id: string; }; }[]`\n - `scheduled_charges_on_usage_invoices?: 'ALL'`\n - `spend_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount: number; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; }`\n - `spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[]`\n - `subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product: { id: string; name: string; }; }; id?: string; custom_fields?: object; description?: string; duration?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; fiat_credit_type_id?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { seat_group_key: string; }; starting_at_offset?: { unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS'; value: number; }; }[]`\n - `uniqueness_key?: string`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\n// Automatically fetches more pages as needed.\nfor await (const packageListResponse of client.v1.packages.list()) {\n console.log(packageListResponse);\n}\n```",
perLanguage: {
typescript: {
method: 'client.v1.packages.list',
diff --git a/src/resources/shared.ts b/src/resources/shared.ts
index 067ad624..3581a43a 100644
--- a/src/resources/shared.ts
+++ b/src/resources/shared.ts
@@ -3221,6 +3221,8 @@ export interface PrepaidBalanceThresholdConfiguration {
custom_credit_type_id?: string;
discount_configuration?: PrepaidBalanceThresholdConfiguration.DiscountConfiguration;
+
+ threshold_balance_specifiers?: Array;
}
export namespace PrepaidBalanceThresholdConfiguration {
@@ -3280,6 +3282,30 @@ export namespace PrepaidBalanceThresholdConfiguration {
spend_tracker_alias: string;
}
}
+
+ export interface ThresholdBalanceSpecifier {
+ exclude: Array;
+ }
+
+ export namespace ThresholdBalanceSpecifier {
+ export interface Exclude {
+ /**
+ * If provided, balances with all the custom fields will not be considered when
+ * evaluating threshold billing
+ */
+ custom_field_filters: Array;
+ }
+
+ export namespace Exclude {
+ export interface CustomFieldFilter {
+ entity: 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit';
+
+ key: string;
+
+ value: string;
+ }
+ }
+ }
}
export interface PrepaidBalanceThresholdConfigurationV2 {
@@ -3312,6 +3338,8 @@ export interface PrepaidBalanceThresholdConfigurationV2 {
custom_credit_type_id?: string;
discount_configuration?: PrepaidBalanceThresholdConfigurationV2.DiscountConfiguration;
+
+ threshold_balance_specifiers?: Array;
}
export namespace PrepaidBalanceThresholdConfigurationV2 {
@@ -3373,6 +3401,26 @@ export namespace PrepaidBalanceThresholdConfigurationV2 {
spend_tracker_alias: string;
}
}
+
+ export interface ThresholdBalanceSpecifier {
+ exclude: Array;
+ }
+
+ export namespace ThresholdBalanceSpecifier {
+ export interface Exclude {
+ custom_field_filters: Array;
+ }
+
+ export namespace Exclude {
+ export interface CustomFieldFilter {
+ entity: 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit';
+
+ key: string;
+
+ value: string;
+ }
+ }
+ }
}
export interface PropertyFilter {
diff --git a/src/resources/v2/contracts.ts b/src/resources/v2/contracts.ts
index 55db01d4..3574f97f 100644
--- a/src/resources/v2/contracts.ts
+++ b/src/resources/v2/contracts.ts
@@ -1485,6 +1485,8 @@ export namespace ContractGetEditHistoryResponse {
* lowers to this amount, a threshold charge will be initiated.
*/
threshold_amount?: number;
+
+ threshold_balance_specifiers?: Array | null;
}
export namespace UpdatePrepaidBalanceThresholdConfiguration {
@@ -1543,6 +1545,26 @@ export namespace ContractGetEditHistoryResponse {
spend_tracker_alias: string;
}
}
+
+ export interface ThresholdBalanceSpecifier {
+ exclude: Array;
+ }
+
+ export namespace ThresholdBalanceSpecifier {
+ export interface Exclude {
+ custom_field_filters: Array;
+ }
+
+ export namespace Exclude {
+ export interface CustomFieldFilter {
+ entity: 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit';
+
+ key: string;
+
+ value: string;
+ }
+ }
+ }
}
export interface UpdateRecurringCommit {
@@ -3713,6 +3735,8 @@ export namespace ContractEditParams {
* lowers to this amount, a threshold charge will be initiated.
*/
threshold_amount?: number;
+
+ threshold_balance_specifiers?: Array | null;
}
export namespace UpdatePrepaidBalanceThresholdConfiguration {
@@ -3771,6 +3795,26 @@ export namespace ContractEditParams {
spend_tracker_alias: string;
}
}
+
+ export interface ThresholdBalanceSpecifier {
+ exclude: Array;
+ }
+
+ export namespace ThresholdBalanceSpecifier {
+ export interface Exclude {
+ custom_field_filters: Array;
+ }
+
+ export namespace Exclude {
+ export interface CustomFieldFilter {
+ entity: 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit';
+
+ key: string;
+
+ value: string;
+ }
+ }
+ }
}
export interface UpdateRecurringCommit {
diff --git a/tests/api-resources/v1/contracts/contracts.test.ts b/tests/api-resources/v1/contracts/contracts.test.ts
index eb7bf60a..7cce5ff5 100644
--- a/tests/api-resources/v1/contracts/contracts.test.ts
+++ b/tests/api-resources/v1/contracts/contracts.test.ts
@@ -237,6 +237,21 @@ describe('resource contracts', () => {
payment_fraction: 0,
cap: { amount: 0, spend_tracker_alias: 'spend_tracker_alias' },
},
+ threshold_balance_specifiers: [
+ {
+ exclude: [
+ {
+ custom_field_filters: [
+ {
+ entity: 'Commit',
+ key: 'key',
+ value: 'value',
+ },
+ ],
+ },
+ ],
+ },
+ ],
},
professional_services: [
{
diff --git a/tests/api-resources/v1/packages.test.ts b/tests/api-resources/v1/packages.test.ts
index e741cdf9..bb3c29e7 100644
--- a/tests/api-resources/v1/packages.test.ts
+++ b/tests/api-resources/v1/packages.test.ts
@@ -176,6 +176,21 @@ describe('resource packages', () => {
payment_fraction: 0,
cap: { amount: 0, spend_tracker_alias: 'spend_tracker_alias' },
},
+ threshold_balance_specifiers: [
+ {
+ exclude: [
+ {
+ custom_field_filters: [
+ {
+ entity: 'Commit',
+ key: 'key',
+ value: 'value',
+ },
+ ],
+ },
+ ],
+ },
+ ],
},
rate_card_alias: 'rate_card_alias',
rate_card_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
diff --git a/tests/api-resources/v2/contracts.test.ts b/tests/api-resources/v2/contracts.test.ts
index 7216f475..2a78b61a 100644
--- a/tests/api-resources/v2/contracts.test.ts
+++ b/tests/api-resources/v2/contracts.test.ts
@@ -279,6 +279,21 @@ describe('resource contracts', () => {
payment_fraction: 0,
cap: { amount: 0, spend_tracker_alias: 'spend_tracker_alias' },
},
+ threshold_balance_specifiers: [
+ {
+ exclude: [
+ {
+ custom_field_filters: [
+ {
+ entity: 'Commit',
+ key: 'key',
+ value: 'value',
+ },
+ ],
+ },
+ ],
+ },
+ ],
},
add_professional_services: [
{
@@ -617,6 +632,21 @@ describe('resource contracts', () => {
},
recharge_to_amount: 0,
threshold_amount: 0,
+ threshold_balance_specifiers: [
+ {
+ exclude: [
+ {
+ custom_field_filters: [
+ {
+ entity: 'Commit',
+ key: 'key',
+ value: 'value',
+ },
+ ],
+ },
+ ],
+ },
+ ],
},
update_recurring_commits: [
{
diff --git a/yarn.lock b/yarn.lock
index 00842e32..06fc1085 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1215,9 +1215,9 @@ baseline-browser-mapping@^2.9.0:
integrity sha512-B0xUquLkiGLgHhpPBqvl7GWegWBUNuujQ6kXd/r1U38ElPT6Ok8KZ8e+FpUGEc2ZoRQUzq/aUnaKFc/svWUGSg==
brace-expansion@^2.0.2:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.1.0.tgz#4f41a41190216ee36067ec381526fe9539c4f0ae"
- integrity sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w==
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.1.1.tgz#c68b1c4111c76aae3a6fba55d496cee10c39dad8"
+ integrity sha512-WR1cURNjuvBLMZBMbqM0UoE+WAfdUcEV1ccD8PVBVOI+Z3ND4+SZbN8RsfT2bMuG1qwz5RFvPukSZm5fF2D5eA==
dependencies:
balanced-match "^1.0.0"
From b6530d4c04ad0aebca11493212cf952f9a07b51d Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 26 May 2026 19:38:51 +0000
Subject: [PATCH 11/19] feat: create contract returns contract data
---
.stats.yml | 4 +-
packages/mcp-server/src/local-docs-search.ts | 5 +-
src/resources/v1/contracts/contracts.ts | 467 ++++++++++++++++++-
3 files changed, 471 insertions(+), 5 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 9a71216e..4a28321d 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 115
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome/metronome-dc7aacadde1a8eae59d0f2744d1701cc00dd1e73051b040308b43870e4c2f776.yml
-openapi_spec_hash: 26eb8219cc5aaf604f24389a88d8c6d2
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome/metronome-7305e771434edc0b0e9de5f32c984ee96063df9539246b9879970bb334f7047e.yml
+openapi_spec_hash: 2d52228f5bf9f2a879913efd1fb35cd2
config_hash: 6bd82f310398d5d47bcfeb8d7ed150b3
diff --git a/packages/mcp-server/src/local-docs-search.ts b/packages/mcp-server/src/local-docs-search.ts
index 8eee42e2..11f42710 100644
--- a/packages/mcp-server/src/local-docs-search.ts
+++ b/packages/mcp-server/src/local-docs-search.ts
@@ -3805,9 +3805,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
'usage_filter?: { group_key: string; group_values: string[]; starting_at?: string; };',
"usage_statement_schedule?: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; billing_anchor_date?: string; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START' | 'CUSTOM_DATE'; invoice_generation_starting_at?: string; };",
],
- response: '{ data: { id: string; }; }',
+ response:
+ "{ data: { id: string; contract?: { id: string; commits: commit[]; created_at: string; created_by: string; customer_id: string; overrides: override[]; scheduled_charges: scheduled_charge[]; starting_at: string; transitions: object[]; usage_filter: object[]; usage_statement_schedule: object; credits?: credit[]; custom_fields?: object; customer_billing_provider_configuration?: object; ending_before?: string; has_more?: object; hierarchy_configuration?: hierarchy_configuration; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; package_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; subscriptions?: subscription[]; uniqueness_key?: string; }; }; }",
markdown:
- "## create\n\n`client.v1.contracts.create(customer_id: string, starting_at: string, billing_provider_configuration?: { billing_provider?: 'aws_marketplace' | 'azure_marketplace' | 'gcp_marketplace' | 'stripe' | 'netsuite'; billing_provider_configuration_id?: string; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }, commits?: { product_id: string; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: object[]; credit_type_id?: string; }; amount?: number; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: object; invoice_schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: object[]; spend_tracker_attributes?: { counts_as_discounted: boolean; }; temporary_id?: string; }[], credits?: { access_schedule: { schedule_items: object[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: object[]; }[], custom_fields?: object, discounts?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[], ending_before?: string, hierarchy_configuration?: { parent?: { contract_id: string; customer_id: string; }; parent_behavior?: { invoice_consolidation_type?: 'CONCATENATE' | 'NONE'; }; payer?: 'SELF' | 'PARENT'; usage_statement_behavior?: 'CONSOLIDATE' | 'SEPARATE'; }, multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT', name?: string, net_payment_terms_days?: number, netsuite_sales_order_id?: string, overrides?: { starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: tier[]; }; priority?: number; product_id?: string; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[], package_alias?: string, package_id?: string, prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; threshold_balance_specifiers?: object[]; }, professional_services?: { max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[], rate_card_alias?: string, rate_card_id?: string, recurring_commits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: object; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { apply_seat_increase_config: object; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[], recurring_credits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { apply_seat_increase_config: object; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[], reseller_royalties?: { fraction: number; netsuite_reseller_id: string; reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_options?: { aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; }; ending_before?: string; gcp_options?: { gcp_account_id?: string; gcp_offer_id?: string; }; reseller_contract_value?: number; }[], revenue_system_configuration?: { delivery_method?: 'direct_to_billing_provider'; provider?: 'netsuite'; revenue_system_configuration_id?: string; }, salesforce_opportunity_id?: string, scheduled_charges?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[], scheduled_charges_on_usage_invoices?: 'ALL', spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; threshold_amount: number; discount_configuration?: object; }, spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[], subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated?: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product_id: string; }; custom_fields?: object; description?: string; ending_before?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { initial_seat_ids: string[]; seat_group_key: string; initial_unassigned_seats?: number; }; starting_at?: string; temporary_id?: string; }[], total_contract_value?: number, transition?: { from_contract_id: string; type: 'SUPERSEDE' | 'RENEWAL'; future_invoice_behavior?: { trueup?: 'REMOVE' | 'AS_IS'; }; }, uniqueness_key?: string, usage_filter?: { group_key: string; group_values: string[]; starting_at?: string; }, usage_statement_schedule?: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; billing_anchor_date?: string; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START' | 'CUSTOM_DATE'; invoice_generation_starting_at?: string; }): { data: id; }`\n\n**post** `/v1/contracts/create`\n\nContracts define a customer's products, pricing, discounts, access duration, and billing configuration. Contracts serve as the central billing agreement for both PLG and Enterprise customers. You can automatically grant customers access to your products and services directly from your product or CRM.\n\n### Use this endpoint to:\n- PLG onboarding: Automatically provision new self-serve customers with contracts when they sign up.\n- Enterprise sales: Push negotiated contracts from Salesforce with custom pricing and commitments\n- Promotional pricing: Implement time-limited discounts and free trials through overrides\n\n### Key components:\n#### Contract Term and Billing Schedule\n- Set contract duration using `starting_at` and `ending_before` fields. PLG contracts typically use perpetual agreements (no end date), while Enterprise contracts have fixed end dates which can be edited over time in the case of co-term upsells.\n\n#### Rate Card\nIf you are offering usage based pricing, you can set a rate card for the contract to reference through `rate_card_id` or `rate_card_alias`. The rate card is a store of all of your usage based products and their centralized pricing. Any new products or price changes on the rate card can be set to automatically propagate to all associated contracts - this ensures consistent pricing and product launches flow to contracts without manual updates and migrations. The `usage_statement_schedule` determines the cadence on which Metronome will finalize a usage invoice for the customer. This defaults to monthly on the 1st, with options for custom dates, quarterly, or annual cadences. Note: Most usage based billing companies align usage statements to be evaluated aligned to the first of the month.\nRead more about [Rate Cards](https://docs.metronome.com/pricing-packaging/create-manage-rate-cards/).\n\n#### Overrides and discounts\nCustomize pricing on the contract through time-bounded overrides that can target specific products, product families, or complex usage scenarios. Overrides enable two key capabilities:\n- Discounts: Apply percentage discounts, fixed rate reductions, or quantity-based pricing tiers\n- Entitlements: Provide special pricing or access to specific products for negotiated deals\n\nRead more about [Contract Overrides](https://docs.metronome.com/manage-product-access/add-contract-override/).\n\n#### Commits and Credits\nUsing commits, configure prepaid or postpaid spending commitments where customers promise to spend a certain amount over the contract period paid in advance or in arrears. Use credits to provide free spending allowances. Under the hood these are the same mechanisms, however, credits are typically offered for free (SLA or promotional) or as a part of an allotment associated with a Subscription.\n\nIn Metronome, you can set commits and credits to only be applicable for a subset of usage. Use `applicable_product_ids` or `applicable_product_tags` to create product or product-family specific commits or credits, or you can build complex boolean logic specifiers to target usage based on pricing and presentation group values using `override_specifiers`.\n\nThese objects can also also be configured to have a recurrence schedule to easily model customer packaging which includes recurring monthly or quarterly allotments.\n\nCommits support rollover settings (`rollover_fraction`) to transfer unused balances between contract periods, either entirely or as a percentage.\n\nRead more about [Credits and Commits](https://docs.metronome.com/pricing-packaging/apply-credits-commits/).\n\n#### Subscriptions\nYou can add a fixed recurring charge to a contract, like monthly licenses or seat-based fees, using the subscription charge. Subscription charges are defined on your rate card and you can select which subscription is applicable to add to each contract. When you add a subscription to a contract you need to:\n- Define whether the subscription is paid for in-advance or in-arrears (`collection_schedule`)\n- Define the proration behavior (`proration`)\n- Specify an initial quantity (`initial_quantity`)\n- Define which subscription rate on the rate card should be used (`subscription_rate`)\n\nRead more about [Subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/).\n\n#### Scheduled Charges\nSet up one-time, recurring, or entirely custom charges that occur on specific dates, separate from usage-based billing or commitments. These can be used to model non-recurring platform charges or professional services.\n\n#### Threshold Billing\nMetronome allows you to configure automatic billing triggers when customers reach spending thresholds to prevent fraud and manage risk. You can use `spend_threshold_configuration` to trigger an invoice to cover current charges whenever the threshold is reached or you can ensure the customer maintains a minimum prepaid balance using the `prepaid_balance_configuration`.\n\nRead more about [Spend Threshold](https://docs.metronome.com/manage-product-access/spend-thresholds/) and [Prepaid Balance Thresholds](https://docs.metronome.com/manage-product-access/prepaid-balance-thresholds/).\n\n### Usage guidelines:\n- You can always [Edit Contracts](https://docs.metronome.com/manage-product-access/edit-contract/) after it has been created, using the `editContract` endpoint. Metronome keeps track of all edits, both in the audit log and over the `getEditHistory` endpoint.\n- Customers in Metronome can have multiple concurrent contracts at one time. Use `usage_filters` to route the correct usage to each contract. [Read more about usage filters](https://docs.metronome.com/manage-product-access/provision-customer/#create-a-usage-filter).\n\n\n### Parameters\n\n- `customer_id: string`\n\n- `starting_at: string`\n inclusive contract start time\n\n- `billing_provider_configuration?: { billing_provider?: 'aws_marketplace' | 'azure_marketplace' | 'gcp_marketplace' | 'stripe' | 'netsuite'; billing_provider_configuration_id?: string; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }`\n The billing provider configuration associated with a contract. Provide either an ID or the provider and delivery method.\n - `billing_provider?: 'aws_marketplace' | 'azure_marketplace' | 'gcp_marketplace' | 'stripe' | 'netsuite'`\n Do not specify if using billing_provider_configuration_id.\n - `billing_provider_configuration_id?: string`\n The Metronome ID of the billing provider configuration. Use when a customer has multiple configurations with the same billing provider and delivery method. Otherwise, specify the billing_provider and delivery_method.\n - `delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'`\n Do not specify if using billing_provider_configuration_id.\n\n- `commits?: { product_id: string; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; amount?: number; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; spend_tracker_attributes?: { counts_as_discounted: boolean; }; temporary_id?: string; }[]`\n\n- `credits?: { access_schedule: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]`\n\n- `custom_fields?: object`\n Custom fields to be added eg. { \"key1\": \"value1\", \"key2\": \"value2\" }\n\n- `discounts?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]`\n This field's availability is dependent on your client's configuration.\n\n- `ending_before?: string`\n exclusive contract end time\n\n- `hierarchy_configuration?: { parent?: { contract_id: string; customer_id: string; }; parent_behavior?: { invoice_consolidation_type?: 'CONCATENATE' | 'NONE'; }; payer?: 'SELF' | 'PARENT'; usage_statement_behavior?: 'CONSOLIDATE' | 'SEPARATE'; }`\n - `parent?: { contract_id: string; customer_id: string; }`\n - `parent_behavior?: { invoice_consolidation_type?: 'CONCATENATE' | 'NONE'; }`\n - `payer?: 'SELF' | 'PARENT'`\n Indicates which customer should pay for the child's invoice charges\n\n**SELF**: The child pays for its own invoice charges\n\n**PARENT**: The parent pays for the child's invoice charges\n - `usage_statement_behavior?: 'CONSOLIDATE' | 'SEPARATE'`\n Indicates the behavior of the child's invoice statements on the parent's invoices.\n\n**CONSOLIDATE**: Child's invoice statements will be added to parent's consolidated invoices\n\n**SEPARATE**: Child's invoice statements will appear not appear on parent's consolidated invoices\n\n- `multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'`\n Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list prices automatically. EXPLICIT prioritization requires specifying priorities for each multiplier; the one with the lowest priority value will be prioritized first. If tiered overrides are used, prioritization must be explicit.\n\n- `name?: string`\n\n- `net_payment_terms_days?: number`\n\n- `netsuite_sales_order_id?: string`\n This field's availability is dependent on your client's configuration.\n\n- `overrides?: { starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: { price: number; size?: number; }[]; }; priority?: number; product_id?: string; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]`\n\n- `package_alias?: string`\n Selects the package linked to the specified alias as of the contract's start date. Mutually exclusive with package_id.\n\n- `package_id?: string`\n If provided, provisions a customer on a package instead of creating a traditional contract. When specified, only customer_id, starting_at, package_id, uniqueness_key, transition, and custom_fields are allowed.\n\n- `prepaid_balance_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; threshold_balance_specifiers?: { exclude: { custom_field_filters: object[]; }[]; }[]; }`\n - `commit: { product_id: string; description?: string; name?: string; priority?: number; }`\n - `is_enabled: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `recharge_to_amount: number`\n Specify the amount the balance should be recharged to.\n - `threshold_amount: number`\n Specify the threshold amount for the contract. Each time the contract's prepaid balance lowers to this amount, a threshold charge will be initiated.\n - `custom_credit_type_id?: string`\n If provided, the threshold, recharge-to amount, and the resulting threshold commit amount will be in terms of this credit type instead of the fiat currency.\n - `discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }`\n - `threshold_balance_specifiers?: { exclude: { custom_field_filters: { entity: 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit'; key: string; value: string; }[]; }[]; }[]`\n\n- `professional_services?: { max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[]`\n This field's availability is dependent on your client's configuration.\n\n- `rate_card_alias?: string`\n Selects the rate card linked to the specified alias as of the contract's start date.\n\n- `rate_card_id?: string`\n\n- `recurring_commits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[]`\n\n- `recurring_credits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[]`\n\n- `reseller_royalties?: { fraction: number; netsuite_reseller_id: string; reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_options?: { aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; }; ending_before?: string; gcp_options?: { gcp_account_id?: string; gcp_offer_id?: string; }; reseller_contract_value?: number; }[]`\n This field's availability is dependent on your client's configuration.\n\n- `revenue_system_configuration?: { delivery_method?: 'direct_to_billing_provider'; provider?: 'netsuite'; revenue_system_configuration_id?: string; }`\n The revenue system configuration associated with a contract. Provide either an ID or the provider and delivery method.\n - `delivery_method?: 'direct_to_billing_provider'`\n How revenue recognition records should be delivered to the revenue system. Do not specify if using revenue_system_configuration_id.\n - `provider?: 'netsuite'`\n The system that is providing services for revenue recognition. Do not specify if using revenue_system_configuration_id.\n - `revenue_system_configuration_id?: string`\n The Metronome ID of the revenue system configuration. Use when a customer has multiple configurations with the same provider and delivery method. Otherwise, specify the provider and delivery_method.\n\n- `salesforce_opportunity_id?: string`\n This field's availability is dependent on your client's configuration.\n\n- `scheduled_charges?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]`\n\n- `scheduled_charges_on_usage_invoices?: 'ALL'`\n Determines which scheduled and commit charges to consolidate onto the Contract's usage invoice. The charge's `timestamp` must match the usage invoice's `ending_before` date for consolidation to occur. This field cannot be modified after a Contract has been created. If this field is omitted, charges will appear on a separate invoice from usage charges.\n\n- `spend_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount: number; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; }`\n - `commit: { product_id: string; description?: string; name?: string; priority?: number; }`\n - `is_enabled: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `threshold_amount: number`\n Specify the threshold amount for the contract. Each time the contract's usage hits this amount, a threshold charge will be initiated.\n - `discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }`\n\n- `spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[]`\n Spend trackers to attach to this contract. Aliases must be unique within a contract.\n\n- `subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated?: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product_id: string; }; custom_fields?: object; description?: string; ending_before?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { initial_seat_ids: string[]; seat_group_key: string; initial_unassigned_seats?: number; }; starting_at?: string; temporary_id?: string; }[]`\n Optional list of [subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/) to add to the contract.\n\n- `total_contract_value?: number`\n This field's availability is dependent on your client's configuration.\n\n- `transition?: { from_contract_id: string; type: 'SUPERSEDE' | 'RENEWAL'; future_invoice_behavior?: { trueup?: 'REMOVE' | 'AS_IS'; }; }`\n - `from_contract_id: string`\n - `type: 'SUPERSEDE' | 'RENEWAL'`\n This field's available values may vary based on your client's configuration.\n - `future_invoice_behavior?: { trueup?: 'REMOVE' | 'AS_IS'; }`\n\n- `uniqueness_key?: string`\n Prevents the creation of duplicates. If a request to create a record is made with a previously used uniqueness key, a new record will not be created and the request will fail with a 409 error.\n\n- `usage_filter?: { group_key: string; group_values: string[]; starting_at?: string; }`\n - `group_key: string`\n - `group_values: string[]`\n - `starting_at?: string`\n\n- `usage_statement_schedule?: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; billing_anchor_date?: string; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START' | 'CUSTOM_DATE'; invoice_generation_starting_at?: string; }`\n - `frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'`\n - `billing_anchor_date?: string`\n Required when using CUSTOM_DATE. This option lets you set a historical billing anchor date, aligning future billing cycles with a chosen cadence. For example, if a contract starts on 2024-09-15 and you set the anchor date to 2024-09-10 with a MONTHLY frequency, the first usage statement will cover 09-15 to 10-10. Subsequent statements will follow the 10th of each month.\n - `day?: 'FIRST_OF_MONTH' | 'CONTRACT_START' | 'CUSTOM_DATE'`\n If not provided, defaults to the first day of the month.\n - `invoice_generation_starting_at?: string`\n The date Metronome should start generating usage invoices. If unspecified, contract start date will be used. This is useful to set if you want to import historical invoices via our 'Create Historical Invoices' API rather than having Metronome automatically generate them.\n\n### Returns\n\n- `{ data: { id: string; }; }`\n\n - `data: { id: string; }`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst contract = await client.v1.contracts.create({ customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d', starting_at: '2020-01-01T00:00:00.000Z' });\n\nconsole.log(contract);\n```",
+ "## create\n\n`client.v1.contracts.create(customer_id: string, starting_at: string, billing_provider_configuration?: { billing_provider?: 'aws_marketplace' | 'azure_marketplace' | 'gcp_marketplace' | 'stripe' | 'netsuite'; billing_provider_configuration_id?: string; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }, commits?: { product_id: string; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: object[]; credit_type_id?: string; }; amount?: number; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: object; invoice_schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: object[]; spend_tracker_attributes?: { counts_as_discounted: boolean; }; temporary_id?: string; }[], credits?: { access_schedule: { schedule_items: object[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: object[]; }[], custom_fields?: object, discounts?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[], ending_before?: string, hierarchy_configuration?: { parent?: { contract_id: string; customer_id: string; }; parent_behavior?: { invoice_consolidation_type?: 'CONCATENATE' | 'NONE'; }; payer?: 'SELF' | 'PARENT'; usage_statement_behavior?: 'CONSOLIDATE' | 'SEPARATE'; }, multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT', name?: string, net_payment_terms_days?: number, netsuite_sales_order_id?: string, overrides?: { starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: tier[]; }; priority?: number; product_id?: string; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[], package_alias?: string, package_id?: string, prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; threshold_balance_specifiers?: object[]; }, professional_services?: { max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[], rate_card_alias?: string, rate_card_id?: string, recurring_commits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: object; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { apply_seat_increase_config: object; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[], recurring_credits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { apply_seat_increase_config: object; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[], reseller_royalties?: { fraction: number; netsuite_reseller_id: string; reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_options?: { aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; }; ending_before?: string; gcp_options?: { gcp_account_id?: string; gcp_offer_id?: string; }; reseller_contract_value?: number; }[], revenue_system_configuration?: { delivery_method?: 'direct_to_billing_provider'; provider?: 'netsuite'; revenue_system_configuration_id?: string; }, salesforce_opportunity_id?: string, scheduled_charges?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[], scheduled_charges_on_usage_invoices?: 'ALL', spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; threshold_amount: number; discount_configuration?: object; }, spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[], subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated?: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product_id: string; }; custom_fields?: object; description?: string; ending_before?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { initial_seat_ids: string[]; seat_group_key: string; initial_unassigned_seats?: number; }; starting_at?: string; temporary_id?: string; }[], total_contract_value?: number, transition?: { from_contract_id: string; type: 'SUPERSEDE' | 'RENEWAL'; future_invoice_behavior?: { trueup?: 'REMOVE' | 'AS_IS'; }; }, uniqueness_key?: string, usage_filter?: { group_key: string; group_values: string[]; starting_at?: string; }, usage_statement_schedule?: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; billing_anchor_date?: string; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START' | 'CUSTOM_DATE'; invoice_generation_starting_at?: string; }): { data: object; }`\n\n**post** `/v1/contracts/create`\n\nContracts define a customer's products, pricing, discounts, access duration, and billing configuration. Contracts serve as the central billing agreement for both PLG and Enterprise customers. You can automatically grant customers access to your products and services directly from your product or CRM.\n\n### Use this endpoint to:\n- PLG onboarding: Automatically provision new self-serve customers with contracts when they sign up.\n- Enterprise sales: Push negotiated contracts from Salesforce with custom pricing and commitments\n- Promotional pricing: Implement time-limited discounts and free trials through overrides\n\n### Key components:\n#### Contract Term and Billing Schedule\n- Set contract duration using `starting_at` and `ending_before` fields. PLG contracts typically use perpetual agreements (no end date), while Enterprise contracts have fixed end dates which can be edited over time in the case of co-term upsells.\n\n#### Rate Card\nIf you are offering usage based pricing, you can set a rate card for the contract to reference through `rate_card_id` or `rate_card_alias`. The rate card is a store of all of your usage based products and their centralized pricing. Any new products or price changes on the rate card can be set to automatically propagate to all associated contracts - this ensures consistent pricing and product launches flow to contracts without manual updates and migrations. The `usage_statement_schedule` determines the cadence on which Metronome will finalize a usage invoice for the customer. This defaults to monthly on the 1st, with options for custom dates, quarterly, or annual cadences. Note: Most usage based billing companies align usage statements to be evaluated aligned to the first of the month.\nRead more about [Rate Cards](https://docs.metronome.com/pricing-packaging/create-manage-rate-cards/).\n\n#### Overrides and discounts\nCustomize pricing on the contract through time-bounded overrides that can target specific products, product families, or complex usage scenarios. Overrides enable two key capabilities:\n- Discounts: Apply percentage discounts, fixed rate reductions, or quantity-based pricing tiers\n- Entitlements: Provide special pricing or access to specific products for negotiated deals\n\nRead more about [Contract Overrides](https://docs.metronome.com/manage-product-access/add-contract-override/).\n\n#### Commits and Credits\nUsing commits, configure prepaid or postpaid spending commitments where customers promise to spend a certain amount over the contract period paid in advance or in arrears. Use credits to provide free spending allowances. Under the hood these are the same mechanisms, however, credits are typically offered for free (SLA or promotional) or as a part of an allotment associated with a Subscription.\n\nIn Metronome, you can set commits and credits to only be applicable for a subset of usage. Use `applicable_product_ids` or `applicable_product_tags` to create product or product-family specific commits or credits, or you can build complex boolean logic specifiers to target usage based on pricing and presentation group values using `override_specifiers`.\n\nThese objects can also also be configured to have a recurrence schedule to easily model customer packaging which includes recurring monthly or quarterly allotments.\n\nCommits support rollover settings (`rollover_fraction`) to transfer unused balances between contract periods, either entirely or as a percentage.\n\nRead more about [Credits and Commits](https://docs.metronome.com/pricing-packaging/apply-credits-commits/).\n\n#### Subscriptions\nYou can add a fixed recurring charge to a contract, like monthly licenses or seat-based fees, using the subscription charge. Subscription charges are defined on your rate card and you can select which subscription is applicable to add to each contract. When you add a subscription to a contract you need to:\n- Define whether the subscription is paid for in-advance or in-arrears (`collection_schedule`)\n- Define the proration behavior (`proration`)\n- Specify an initial quantity (`initial_quantity`)\n- Define which subscription rate on the rate card should be used (`subscription_rate`)\n\nRead more about [Subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/).\n\n#### Scheduled Charges\nSet up one-time, recurring, or entirely custom charges that occur on specific dates, separate from usage-based billing or commitments. These can be used to model non-recurring platform charges or professional services.\n\n#### Threshold Billing\nMetronome allows you to configure automatic billing triggers when customers reach spending thresholds to prevent fraud and manage risk. You can use `spend_threshold_configuration` to trigger an invoice to cover current charges whenever the threshold is reached or you can ensure the customer maintains a minimum prepaid balance using the `prepaid_balance_configuration`.\n\nRead more about [Spend Threshold](https://docs.metronome.com/manage-product-access/spend-thresholds/) and [Prepaid Balance Thresholds](https://docs.metronome.com/manage-product-access/prepaid-balance-thresholds/).\n\n### Usage guidelines:\n- You can always [Edit Contracts](https://docs.metronome.com/manage-product-access/edit-contract/) after it has been created, using the `editContract` endpoint. Metronome keeps track of all edits, both in the audit log and over the `getEditHistory` endpoint.\n- Customers in Metronome can have multiple concurrent contracts at one time. Use `usage_filters` to route the correct usage to each contract. [Read more about usage filters](https://docs.metronome.com/manage-product-access/provision-customer/#create-a-usage-filter).\n\n\n### Parameters\n\n- `customer_id: string`\n\n- `starting_at: string`\n inclusive contract start time\n\n- `billing_provider_configuration?: { billing_provider?: 'aws_marketplace' | 'azure_marketplace' | 'gcp_marketplace' | 'stripe' | 'netsuite'; billing_provider_configuration_id?: string; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }`\n The billing provider configuration associated with a contract. Provide either an ID or the provider and delivery method.\n - `billing_provider?: 'aws_marketplace' | 'azure_marketplace' | 'gcp_marketplace' | 'stripe' | 'netsuite'`\n Do not specify if using billing_provider_configuration_id.\n - `billing_provider_configuration_id?: string`\n The Metronome ID of the billing provider configuration. Use when a customer has multiple configurations with the same billing provider and delivery method. Otherwise, specify the billing_provider and delivery_method.\n - `delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'`\n Do not specify if using billing_provider_configuration_id.\n\n- `commits?: { product_id: string; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; amount?: number; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; spend_tracker_attributes?: { counts_as_discounted: boolean; }; temporary_id?: string; }[]`\n\n- `credits?: { access_schedule: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]`\n\n- `custom_fields?: object`\n Custom fields to be added eg. { \"key1\": \"value1\", \"key2\": \"value2\" }\n\n- `discounts?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]`\n This field's availability is dependent on your client's configuration.\n\n- `ending_before?: string`\n exclusive contract end time\n\n- `hierarchy_configuration?: { parent?: { contract_id: string; customer_id: string; }; parent_behavior?: { invoice_consolidation_type?: 'CONCATENATE' | 'NONE'; }; payer?: 'SELF' | 'PARENT'; usage_statement_behavior?: 'CONSOLIDATE' | 'SEPARATE'; }`\n - `parent?: { contract_id: string; customer_id: string; }`\n - `parent_behavior?: { invoice_consolidation_type?: 'CONCATENATE' | 'NONE'; }`\n - `payer?: 'SELF' | 'PARENT'`\n Indicates which customer should pay for the child's invoice charges\n\n**SELF**: The child pays for its own invoice charges\n\n**PARENT**: The parent pays for the child's invoice charges\n - `usage_statement_behavior?: 'CONSOLIDATE' | 'SEPARATE'`\n Indicates the behavior of the child's invoice statements on the parent's invoices.\n\n**CONSOLIDATE**: Child's invoice statements will be added to parent's consolidated invoices\n\n**SEPARATE**: Child's invoice statements will appear not appear on parent's consolidated invoices\n\n- `multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'`\n Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list prices automatically. EXPLICIT prioritization requires specifying priorities for each multiplier; the one with the lowest priority value will be prioritized first. If tiered overrides are used, prioritization must be explicit.\n\n- `name?: string`\n\n- `net_payment_terms_days?: number`\n\n- `netsuite_sales_order_id?: string`\n This field's availability is dependent on your client's configuration.\n\n- `overrides?: { starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: { price: number; size?: number; }[]; }; priority?: number; product_id?: string; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]`\n\n- `package_alias?: string`\n Selects the package linked to the specified alias as of the contract's start date. Mutually exclusive with package_id.\n\n- `package_id?: string`\n If provided, provisions a customer on a package instead of creating a traditional contract. When specified, only customer_id, starting_at, package_id, uniqueness_key, transition, and custom_fields are allowed.\n\n- `prepaid_balance_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; threshold_balance_specifiers?: { exclude: { custom_field_filters: object[]; }[]; }[]; }`\n - `commit: { product_id: string; description?: string; name?: string; priority?: number; }`\n - `is_enabled: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `recharge_to_amount: number`\n Specify the amount the balance should be recharged to.\n - `threshold_amount: number`\n Specify the threshold amount for the contract. Each time the contract's prepaid balance lowers to this amount, a threshold charge will be initiated.\n - `custom_credit_type_id?: string`\n If provided, the threshold, recharge-to amount, and the resulting threshold commit amount will be in terms of this credit type instead of the fiat currency.\n - `discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }`\n - `threshold_balance_specifiers?: { exclude: { custom_field_filters: { entity: 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit'; key: string; value: string; }[]; }[]; }[]`\n\n- `professional_services?: { max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[]`\n This field's availability is dependent on your client's configuration.\n\n- `rate_card_alias?: string`\n Selects the rate card linked to the specified alias as of the contract's start date.\n\n- `rate_card_id?: string`\n\n- `recurring_commits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[]`\n\n- `recurring_credits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'INDIVIDUAL' | 'POOLED'; }; temporary_id?: string; }[]`\n\n- `reseller_royalties?: { fraction: number; netsuite_reseller_id: string; reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_options?: { aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; }; ending_before?: string; gcp_options?: { gcp_account_id?: string; gcp_offer_id?: string; }; reseller_contract_value?: number; }[]`\n This field's availability is dependent on your client's configuration.\n\n- `revenue_system_configuration?: { delivery_method?: 'direct_to_billing_provider'; provider?: 'netsuite'; revenue_system_configuration_id?: string; }`\n The revenue system configuration associated with a contract. Provide either an ID or the provider and delivery method.\n - `delivery_method?: 'direct_to_billing_provider'`\n How revenue recognition records should be delivered to the revenue system. Do not specify if using revenue_system_configuration_id.\n - `provider?: 'netsuite'`\n The system that is providing services for revenue recognition. Do not specify if using revenue_system_configuration_id.\n - `revenue_system_configuration_id?: string`\n The Metronome ID of the revenue system configuration. Use when a customer has multiple configurations with the same provider and delivery method. Otherwise, specify the provider and delivery_method.\n\n- `salesforce_opportunity_id?: string`\n This field's availability is dependent on your client's configuration.\n\n- `scheduled_charges?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]`\n\n- `scheduled_charges_on_usage_invoices?: 'ALL'`\n Determines which scheduled and commit charges to consolidate onto the Contract's usage invoice. The charge's `timestamp` must match the usage invoice's `ending_before` date for consolidation to occur. This field cannot be modified after a Contract has been created. If this field is omitted, charges will appear on a separate invoice from usage charges.\n\n- `spend_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount: number; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; }`\n - `commit: { product_id: string; description?: string; name?: string; priority?: number; }`\n - `is_enabled: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `threshold_amount: number`\n Specify the threshold amount for the contract. Each time the contract's usage hits this amount, a threshold charge will be initiated.\n - `discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }`\n\n- `spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[]`\n Spend trackers to attach to this contract. Aliases must be unique within a contract.\n\n- `subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated?: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product_id: string; }; custom_fields?: object; description?: string; ending_before?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { initial_seat_ids: string[]; seat_group_key: string; initial_unassigned_seats?: number; }; starting_at?: string; temporary_id?: string; }[]`\n Optional list of [subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/) to add to the contract.\n\n- `total_contract_value?: number`\n This field's availability is dependent on your client's configuration.\n\n- `transition?: { from_contract_id: string; type: 'SUPERSEDE' | 'RENEWAL'; future_invoice_behavior?: { trueup?: 'REMOVE' | 'AS_IS'; }; }`\n - `from_contract_id: string`\n - `type: 'SUPERSEDE' | 'RENEWAL'`\n This field's available values may vary based on your client's configuration.\n - `future_invoice_behavior?: { trueup?: 'REMOVE' | 'AS_IS'; }`\n\n- `uniqueness_key?: string`\n Prevents the creation of duplicates. If a request to create a record is made with a previously used uniqueness key, a new record will not be created and the request will fail with a 409 error.\n\n- `usage_filter?: { group_key: string; group_values: string[]; starting_at?: string; }`\n - `group_key: string`\n - `group_values: string[]`\n - `starting_at?: string`\n\n- `usage_statement_schedule?: { frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; billing_anchor_date?: string; day?: 'FIRST_OF_MONTH' | 'CONTRACT_START' | 'CUSTOM_DATE'; invoice_generation_starting_at?: string; }`\n - `frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'`\n - `billing_anchor_date?: string`\n Required when using CUSTOM_DATE. This option lets you set a historical billing anchor date, aligning future billing cycles with a chosen cadence. For example, if a contract starts on 2024-09-15 and you set the anchor date to 2024-09-10 with a MONTHLY frequency, the first usage statement will cover 09-15 to 10-10. Subsequent statements will follow the 10th of each month.\n - `day?: 'FIRST_OF_MONTH' | 'CONTRACT_START' | 'CUSTOM_DATE'`\n If not provided, defaults to the first day of the month.\n - `invoice_generation_starting_at?: string`\n The date Metronome should start generating usage invoices. If unspecified, contract start date will be used. This is useful to set if you want to import historical invoices via our 'Create Historical Invoices' API rather than having Metronome automatically generate them.\n\n### Returns\n\n- `{ data: { id: string; contract?: { id: string; commits: commit[]; created_at: string; created_by: string; customer_id: string; overrides: override[]; scheduled_charges: scheduled_charge[]; starting_at: string; transitions: object[]; usage_filter: object[]; usage_statement_schedule: object; credits?: credit[]; custom_fields?: object; customer_billing_provider_configuration?: object; ending_before?: string; has_more?: object; hierarchy_configuration?: hierarchy_configuration; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; package_id?: string; prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration; rate_card_id?: string; recurring_commits?: object[]; recurring_credits?: object[]; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: spend_threshold_configuration; subscriptions?: subscription[]; uniqueness_key?: string; }; }; }`\n\n - `data: { id: string; contract?: { id: string; commits: { id: string; created_at: string; product: object; type: 'PREPAID' | 'POSTPAID'; access_schedule?: schedule_duration; amount?: number; applicable_contract_ids?: string[]; applicable_product_ids?: string[]; applicable_product_tags?: string[]; archived_at?: string; balance?: number; contract?: object; custom_fields?: object; description?: string; hierarchy_configuration?: commit_hierarchy_configuration; invoice_contract?: object; invoice_schedule?: schedule_point_in_time; ledger?: object | object | object | object | object | object | object | object | object | object | object | object | object | object[]; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurring_commit_id?: string; rolled_over_from?: object; rollover_fraction?: number; salesforce_opportunity_id?: string; specifiers?: commit_specifier[]; spend_tracker_attributes?: object; subscription_config?: object; uniqueness_key?: string; }[]; created_at: string; created_by: string; customer_id: string; overrides: { id: string; created_at: string; starting_at: string; applicable_product_tags?: string[]; credit_type?: credit_type_data; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; is_prorated?: boolean; multiplier?: number; override_specifiers?: object[]; override_tiers?: override_tier[]; overwrite_rate?: overwrite_rate; price?: number; priority?: number; product?: object; quantity?: number; rate_type?: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: tier[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; value?: object; }[]; scheduled_charges: { id: string; product: object; schedule: schedule_point_in_time; archived_at?: string; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]; starting_at: string; transitions: { from_contract_id: string; to_contract_id: string; type: 'SUPERSEDE' | 'RENEWAL'; }[]; usage_filter: { group_key: string; group_values: string[]; starting_at: string; ending_before?: string; }[]; usage_statement_schedule: { billing_anchor_date: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; }; credits?: { id: string; product: object; type: 'CREDIT'; access_schedule?: schedule_duration; applicable_contract_ids?: string[]; applicable_product_ids?: string[]; applicable_product_tags?: string[]; balance?: number; contract?: object; custom_fields?: object; description?: string; hierarchy_configuration?: commit_hierarchy_configuration; ledger?: object | object | object | object | object | object | object | object[]; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurring_credit_id?: string; rolled_over_from?: object; salesforce_opportunity_id?: string; specifiers?: commit_specifier[]; subscription_config?: object; uniqueness_key?: string; }[]; custom_fields?: object; customer_billing_provider_configuration?: { id?: string; billing_provider?: string; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }; ending_before?: string; has_more?: { commits: boolean; credits: boolean; }; hierarchy_configuration?: { children: object[]; parent_behavior?: object; } | { parent: object; payer?: 'SELF' | 'PARENT'; usage_statement_behavior?: 'CONSOLIDATE' | 'SEPARATE'; }; multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT'; name?: string; net_payment_terms_days?: number; package_id?: string; prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; threshold_balance_specifiers?: object[]; }; rate_card_id?: string; recurring_commits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; contract?: { id: string; }; description?: string; ending_before?: string; hierarchy_configuration?: object; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: object; }[]; recurring_credits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; contract?: { id: string; }; description?: string; ending_before?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: object; }[]; scheduled_charges_on_usage_invoices?: 'ALL'; spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config; threshold_amount: number; discount_configuration?: object; }; subscriptions?: { billing_periods: object; collection_schedule: 'ADVANCE' | 'ARREARS'; proration: object; quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY'; quantity_schedule: object[]; starting_at: string; subscription_rate: object; id?: string; custom_fields?: object; description?: string; ending_before?: string; fiat_credit_type_id?: string; name?: string; seat_config?: object; }[]; uniqueness_key?: string; }; }`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst contract = await client.v1.contracts.create({ customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d', starting_at: '2020-01-01T00:00:00.000Z' });\n\nconsole.log(contract);\n```",
perLanguage: {
typescript: {
method: 'client.v1.contracts.create',
diff --git a/src/resources/v1/contracts/contracts.ts b/src/resources/v1/contracts/contracts.ts
index c4fb03f8..d21f16d1 100644
--- a/src/resources/v1/contracts/contracts.ts
+++ b/src/resources/v1/contracts/contracts.ts
@@ -730,7 +730,472 @@ export class Contracts extends APIResource {
export type ContractListBalancesResponsesBodyCursorPage = BodyCursorPage;
export interface ContractCreateResponse {
- data: Shared.ID;
+ data: ContractCreateResponse.Data;
+}
+
+export namespace ContractCreateResponse {
+ export interface Data {
+ id: string;
+
+ /**
+ * The created contract.
+ */
+ contract?: Data.Contract;
+ }
+
+ export namespace Data {
+ /**
+ * The created contract.
+ */
+ export interface Contract {
+ id: string;
+
+ commits: Array;
+
+ created_at: string;
+
+ created_by: string;
+
+ customer_id: string;
+
+ overrides: Array;
+
+ scheduled_charges: Array;
+
+ starting_at: string;
+
+ transitions: Array;
+
+ usage_filter: Array;
+
+ usage_statement_schedule: Contract.UsageStatementSchedule;
+
+ credits?: Array;
+
+ /**
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
+ */
+ custom_fields?: { [key: string]: string };
+
+ /**
+ * The billing provider configuration associated with the contract.
+ */
+ customer_billing_provider_configuration?: Contract.CustomerBillingProviderConfiguration;
+
+ ending_before?: string;
+
+ /**
+ * Indicates whether there are more items than the limit for this endpoint. Use the
+ * respective list endpoints to get the full lists.
+ */
+ has_more?: Contract.HasMore;
+
+ /**
+ * Either a **parent** configuration with a list of children or a **child**
+ * configuration with a single parent.
+ */
+ hierarchy_configuration?: Shared.HierarchyConfiguration;
+
+ /**
+ * Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list
+ * prices automatically. EXPLICIT prioritization requires specifying priorities for
+ * each multiplier; the one with the lowest priority value will be prioritized
+ * first.
+ */
+ multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT';
+
+ name?: string;
+
+ net_payment_terms_days?: number;
+
+ /**
+ * ID of the package this contract was created from, if applicable.
+ */
+ package_id?: string;
+
+ prepaid_balance_threshold_configuration?: Shared.PrepaidBalanceThresholdConfiguration;
+
+ rate_card_id?: string;
+
+ recurring_commits?: Array;
+
+ recurring_credits?: Array;
+
+ /**
+ * Determines which scheduled and commit charges to consolidate onto the Contract's
+ * usage invoice. The charge's `timestamp` must match the usage invoice's
+ * `ending_before` date for consolidation to occur. This field cannot be modified
+ * after a Contract has been created. If this field is omitted, charges will appear
+ * on a separate invoice from usage charges.
+ */
+ scheduled_charges_on_usage_invoices?: 'ALL';
+
+ spend_threshold_configuration?: Shared.SpendThresholdConfiguration;
+
+ /**
+ * List of subscriptions on the contract.
+ */
+ subscriptions?: Array;
+
+ /**
+ * Optional uniqueness key to prevent duplicate contract creations.
+ */
+ uniqueness_key?: string;
+ }
+
+ export namespace Contract {
+ export interface Transition {
+ from_contract_id: string;
+
+ to_contract_id: string;
+
+ type: 'SUPERSEDE' | 'RENEWAL';
+ }
+
+ export interface UsageFilter {
+ group_key: string;
+
+ group_values: Array;
+
+ starting_at: string;
+
+ ending_before?: string;
+ }
+
+ export interface UsageStatementSchedule {
+ /**
+ * Contract usage statements follow a selected cadence based on this date.
+ */
+ billing_anchor_date: string;
+
+ frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
+ }
+
+ /**
+ * The billing provider configuration associated with the contract.
+ */
+ export interface CustomerBillingProviderConfiguration {
+ id?: string;
+
+ billing_provider?:
+ | 'aws_marketplace'
+ | 'stripe'
+ | 'netsuite'
+ | 'custom'
+ | 'azure_marketplace'
+ | 'quickbooks_online'
+ | 'workday'
+ | 'gcp_marketplace'
+ | 'metronome';
+
+ delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
+ }
+
+ /**
+ * Indicates whether there are more items than the limit for this endpoint. Use the
+ * respective list endpoints to get the full lists.
+ */
+ export interface HasMore {
+ /**
+ * Whether there are more commits on this contract than the limit for this
+ * endpoint. Use the /contracts/customerCommits/list endpoint to get the full list
+ * of commits.
+ */
+ commits: boolean;
+
+ /**
+ * Whether there are more credits on this contract than the limit for this
+ * endpoint. Use the /contracts/customerCredits/list endpoint to get the full list
+ * of credits.
+ */
+ credits: boolean;
+ }
+
+ export interface RecurringCommit {
+ id: string;
+
+ /**
+ * The amount of commit to grant.
+ */
+ access_amount: RecurringCommit.AccessAmount;
+
+ /**
+ * The amount of time the created commits will be valid for
+ */
+ commit_duration: RecurringCommit.CommitDuration;
+
+ /**
+ * Will be passed down to the individual commits
+ */
+ priority: number;
+
+ product: RecurringCommit.Product;
+
+ /**
+ * Whether the created commits will use the commit rate or list rate
+ */
+ rate_type: 'COMMIT_RATE' | 'LIST_RATE';
+
+ /**
+ * Determines the start time for the first commit
+ */
+ starting_at: string;
+
+ /**
+ * Will be passed down to the individual commits
+ */
+ applicable_product_ids?: Array;
+
+ /**
+ * Will be passed down to the individual commits
+ */
+ applicable_product_tags?: Array;
+
+ contract?: RecurringCommit.Contract;
+
+ /**
+ * Will be passed down to the individual commits
+ */
+ description?: string;
+
+ /**
+ * Determines when the contract will stop creating recurring commits. Optional
+ */
+ ending_before?: string;
+
+ /**
+ * Optional configuration for recurring commit/credit hierarchy access control
+ */
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
+
+ /**
+ * The amount the customer should be billed for the commit. Not required.
+ */
+ invoice_amount?: RecurringCommit.InvoiceAmount;
+
+ /**
+ * Displayed on invoices. Will be passed through to the individual commits
+ */
+ name?: string;
+
+ /**
+ * Will be passed down to the individual commits
+ */
+ netsuite_sales_order_id?: string;
+
+ /**
+ * Determines whether the first and last commit will be prorated. If not provided,
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
+ */
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
+
+ /**
+ * The frequency at which the recurring commits will be created. If not provided: -
+ * The commits will be created on the usage invoice frequency. If provided: - The
+ * period defined in the duration will correspond to this frequency. - Commits will
+ * be created aligned with the recurring commit's starting_at rather than the usage
+ * invoice dates.
+ */
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
+
+ /**
+ * Will be passed down to the individual commits. This controls how much of an
+ * individual unexpired commit will roll over upon contract transition. Must be
+ * between 0 and 1.
+ */
+ rollover_fraction?: number;
+
+ /**
+ * List of filters that determine what kind of customer usage draws down a commit
+ * or credit. A customer's usage needs to meet the condition of at least one of the
+ * specifiers to contribute to a commit's or credit's drawdown.
+ */
+ specifiers?: Array;
+
+ /**
+ * Attach a subscription to the recurring commit/credit.
+ */
+ subscription_config?: Shared.RecurringCommitSubscriptionConfig;
+ }
+
+ export namespace RecurringCommit {
+ /**
+ * The amount of commit to grant.
+ */
+ export interface AccessAmount {
+ credit_type_id: string;
+
+ unit_price: number;
+
+ quantity?: number;
+ }
+
+ /**
+ * The amount of time the created commits will be valid for
+ */
+ export interface CommitDuration {
+ value: number;
+
+ unit?: 'PERIODS';
+ }
+
+ export interface Product {
+ id: string;
+
+ name: string;
+ }
+
+ export interface Contract {
+ id: string;
+ }
+
+ /**
+ * The amount the customer should be billed for the commit. Not required.
+ */
+ export interface InvoiceAmount {
+ credit_type_id: string;
+
+ quantity: number;
+
+ unit_price: number;
+ }
+ }
+
+ export interface RecurringCredit {
+ id: string;
+
+ /**
+ * The amount of commit to grant.
+ */
+ access_amount: RecurringCredit.AccessAmount;
+
+ /**
+ * The amount of time the created commits will be valid for
+ */
+ commit_duration: RecurringCredit.CommitDuration;
+
+ /**
+ * Will be passed down to the individual commits
+ */
+ priority: number;
+
+ product: RecurringCredit.Product;
+
+ /**
+ * Whether the created commits will use the commit rate or list rate
+ */
+ rate_type: 'COMMIT_RATE' | 'LIST_RATE';
+
+ /**
+ * Determines the start time for the first commit
+ */
+ starting_at: string;
+
+ /**
+ * Will be passed down to the individual commits
+ */
+ applicable_product_ids?: Array;
+
+ /**
+ * Will be passed down to the individual commits
+ */
+ applicable_product_tags?: Array;
+
+ contract?: RecurringCredit.Contract;
+
+ /**
+ * Will be passed down to the individual commits
+ */
+ description?: string;
+
+ /**
+ * Determines when the contract will stop creating recurring commits. Optional
+ */
+ ending_before?: string;
+
+ /**
+ * Optional configuration for recurring commit/credit hierarchy access control
+ */
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
+
+ /**
+ * Displayed on invoices. Will be passed through to the individual commits
+ */
+ name?: string;
+
+ /**
+ * Will be passed down to the individual commits
+ */
+ netsuite_sales_order_id?: string;
+
+ /**
+ * Determines whether the first and last commit will be prorated. If not provided,
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
+ */
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
+
+ /**
+ * The frequency at which the recurring commits will be created. If not provided: -
+ * The commits will be created on the usage invoice frequency. If provided: - The
+ * period defined in the duration will correspond to this frequency. - Commits will
+ * be created aligned with the recurring commit's starting_at rather than the usage
+ * invoice dates.
+ */
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
+
+ /**
+ * Will be passed down to the individual commits. This controls how much of an
+ * individual unexpired commit will roll over upon contract transition. Must be
+ * between 0 and 1.
+ */
+ rollover_fraction?: number;
+
+ /**
+ * List of filters that determine what kind of customer usage draws down a commit
+ * or credit. A customer's usage needs to meet the condition of at least one of the
+ * specifiers to contribute to a commit's or credit's drawdown.
+ */
+ specifiers?: Array;
+
+ /**
+ * Attach a subscription to the recurring commit/credit.
+ */
+ subscription_config?: Shared.RecurringCommitSubscriptionConfig;
+ }
+
+ export namespace RecurringCredit {
+ /**
+ * The amount of commit to grant.
+ */
+ export interface AccessAmount {
+ credit_type_id: string;
+
+ unit_price: number;
+
+ quantity?: number;
+ }
+
+ /**
+ * The amount of time the created commits will be valid for
+ */
+ export interface CommitDuration {
+ value: number;
+
+ unit?: 'PERIODS';
+ }
+
+ export interface Product {
+ id: string;
+
+ name: string;
+ }
+
+ export interface Contract {
+ id: string;
+ }
+ }
+ }
+ }
}
export interface ContractRetrieveResponse {
From 39c2cdfaf1472a9bd00fd2f6ad953a26b499456b Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 27 May 2026 17:29:19 +0000
Subject: [PATCH 12/19] codegen metadata
---
.stats.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 4a28321d..6c5c4f94 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 115
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome/metronome-7305e771434edc0b0e9de5f32c984ee96063df9539246b9879970bb334f7047e.yml
-openapi_spec_hash: 2d52228f5bf9f2a879913efd1fb35cd2
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome/metronome-52936c9f9b92df491c3822b2b8498f8b227532ef3a21c45d1871f5f57c2ffa1d.yml
+openapi_spec_hash: fc35c1f2f5e4c4402ae8967f4768702f
config_hash: 6bd82f310398d5d47bcfeb8d7ed150b3
From 578ec7f9d9154678ff6e38e270cde8ff06d392c1 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 27 May 2026 18:23:46 +0000
Subject: [PATCH 13/19] codegen metadata
---
.stats.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 6c5c4f94..d4e20eaf 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 115
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome/metronome-52936c9f9b92df491c3822b2b8498f8b227532ef3a21c45d1871f5f57c2ffa1d.yml
-openapi_spec_hash: fc35c1f2f5e4c4402ae8967f4768702f
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome/metronome-789012201baef02cfd601b17626040ae43c9b03c87eaa37e384347d30e61dd60.yml
+openapi_spec_hash: 8325272024d67291287fa1195737ce0a
config_hash: 6bd82f310398d5d47bcfeb8d7ed150b3
From df0ff5b4c9e7591145369af6a2b862fc4f0d3fb3 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 28 May 2026 16:09:47 +0000
Subject: [PATCH 14/19] fix(mcp): use `pure-lockfile` when building mcp server
---
scripts/build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/build b/scripts/build
index 69d13389..d0bd575a 100755
--- a/scripts/build
+++ b/scripts/build
@@ -52,6 +52,6 @@ fi
# build all sub-packages
for dir in packages/*; do
if [ -d "$dir" ]; then
- (cd "$dir" && yarn install && yarn build)
+ (cd "$dir" && yarn install --pure-lockfile && yarn build)
fi
done
From 4ceedc98ddc04b455e9ca190779a8cefa87f8a5a Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 28 May 2026 19:32:07 +0000
Subject: [PATCH 15/19] codegen metadata
---
.stats.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index d4e20eaf..84dc7fe8 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 115
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome/metronome-789012201baef02cfd601b17626040ae43c9b03c87eaa37e384347d30e61dd60.yml
-openapi_spec_hash: 8325272024d67291287fa1195737ce0a
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome/metronome-172533e68539313320c2971e580a5de22c272a560ce3686fe1e5059d24ff615d.yml
+openapi_spec_hash: c1f4fe3fd7b1d3e47fc655fa6a9b1cb8
config_hash: 6bd82f310398d5d47bcfeb8d7ed150b3
From 197a27ad6de47af9b3c725ec79f296e567238f41 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 28 May 2026 19:46:11 +0000
Subject: [PATCH 16/19] feat: [LAUNCH-2814] editContract returns full edit in
the response
---
.stats.yml | 4 +-
packages/mcp-server/src/local-docs-search.ts | 5 +-
src/resources/v2/contracts.ts | 1572 +++++++++++++++++-
3 files changed, 1576 insertions(+), 5 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 84dc7fe8..f63b6543 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 115
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome/metronome-172533e68539313320c2971e580a5de22c272a560ce3686fe1e5059d24ff615d.yml
-openapi_spec_hash: c1f4fe3fd7b1d3e47fc655fa6a9b1cb8
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome/metronome-a571b8e97d292c366ba49c29d403b79a66e542a194b2b4228e61ac71385b1a23.yml
+openapi_spec_hash: 845b84bc254872c849a13f4b1d5a4383
config_hash: 6bd82f310398d5d47bcfeb8d7ed150b3
diff --git a/packages/mcp-server/src/local-docs-search.ts b/packages/mcp-server/src/local-docs-search.ts
index 11f42710..c0aab004 100644
--- a/packages/mcp-server/src/local-docs-search.ts
+++ b/packages/mcp-server/src/local-docs-search.ts
@@ -201,9 +201,10 @@ const EMBEDDED_METHODS: MethodEntry[] = [
"update_spend_threshold_configuration?: { commit?: { description?: string; name?: string; priority?: number; product_id?: string; }; discount_configuration?: { cap?: { amount: number; spend_tracker_alias: string; }; payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount?: number; };",
"update_subscriptions?: { subscription_id: string; ending_before?: string; quantity_management_mode_update?: { quantity_management_mode: 'SEAT_BASED'; seat_config: { seat_group_key: string; }; }; quantity_updates?: { starting_at: string; quantity?: number; quantity_delta?: number; }[]; seat_updates?: { add_seat_ids?: { seat_ids: string[]; starting_at: string; }[]; add_unassigned_seats?: { quantity: number; starting_at: string; }[]; remove_seat_ids?: { seat_ids: string[]; starting_at: string; }[]; remove_unassigned_seats?: { quantity: number; starting_at: string; }[]; }; }[];",
],
- response: '{ data: { id: string; }; }',
+ response:
+ '{ data: { id: string; edit?: { id: string; add_commits?: object[]; add_credits?: object[]; add_discounts?: discount[]; add_overrides?: object[]; add_prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration_v2; add_pro_services?: pro_service[]; add_recurring_commits?: object[]; add_recurring_credits?: object[]; add_reseller_royalties?: object[]; add_scheduled_charges?: object[]; add_spend_threshold_configuration?: spend_threshold_configuration_v2; add_subscriptions?: object[]; add_usage_filters?: object[]; archive_commits?: object[]; archive_credits?: object[]; archive_scheduled_charges?: object[]; remove_overrides?: object[]; timestamp?: string; uniqueness_key?: string; update_commits?: object[]; update_contract_end_date?: string; update_contract_name?: string; update_credits?: object[]; update_discounts?: object[]; update_prepaid_balance_threshold_configuration?: object; update_recurring_commits?: object[]; update_recurring_credits?: object[]; update_refund_invoices?: object[]; update_scheduled_charges?: object[]; update_spend_threshold_configuration?: object; update_subscriptions?: object[]; }; }; }',
markdown:
- "## edit\n\n`client.v2.contracts.edit(contract_id: string, customer_id: string, add_billing_provider_configuration_update?: { billing_provider_configuration: { billing_provider?: string; billing_provider_configuration_id?: string; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }; schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }; }, add_commits?: { product_id: string; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: object[]; credit_type_id?: string; }; amount?: number; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: object; invoice_schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; name?: string; netsuite_sales_order_id?: string; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: object[]; spend_tracker_attributes?: { counts_as_discounted: boolean; }; temporary_id?: string; }[], add_credits?: { access_schedule: { schedule_items: object[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: object[]; }[], add_discounts?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[], add_overrides?: { starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: tier[]; }; priority?: number; product_id?: string; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[], add_prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config_v2; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; threshold_balance_specifiers?: object[]; }, add_professional_services?: { max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[], add_recurring_commits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: object; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { apply_seat_increase_config: object; subscription_id: string; allocation?: 'POOLED' | 'INDIVIDUAL'; }; temporary_id?: string; }[], add_recurring_credits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { apply_seat_increase_config: object; subscription_id: string; allocation?: 'POOLED' | 'INDIVIDUAL'; }; temporary_id?: string; }[], add_reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_options?: { aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; }; ending_before?: string; fraction?: number; gcp_options?: { gcp_account_id?: string; gcp_offer_id?: string; }; netsuite_reseller_id?: string; reseller_contract_value?: number; starting_at?: string; }[], add_revenue_system_configuration_update?: { revenue_system_configuration: { delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; provider?: 'netsuite'; revenue_system_configuration_id?: string; }; schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }; }, add_scheduled_charges?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[], add_spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config_v2; threshold_amount: number; discount_configuration?: object; }, add_spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[], add_subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated?: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product_id: string; }; custom_fields?: object; description?: string; ending_before?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { initial_seat_ids: string[]; seat_group_key: string; initial_unassigned_seats?: number; }; starting_at?: string; temporary_id?: string; }[], allow_contract_ending_before_finalized_invoice?: boolean, archive_commits?: { id: string; }[], archive_credits?: { id: string; }[], archive_scheduled_charges?: { id: string; }[], archive_spend_trackers?: string[], remove_overrides?: { id: string; }[], uniqueness_key?: string, update_commits?: { commit_id: string; access_schedule?: { add_schedule_items?: object[]; remove_schedule_items?: object[]; update_schedule_items?: object[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: object; invoice_schedule?: { add_schedule_items?: object[]; remove_schedule_items?: object[]; update_schedule_items?: object[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; rollover_fraction?: number; }[], update_contract_end_date?: string, update_contract_name?: string, update_credits?: { credit_id: string; access_schedule?: { add_schedule_items?: object[]; remove_schedule_items?: object[]; update_schedule_items?: object[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; rollover_fraction?: number; }[], update_net_payment_terms_days?: number, update_prepaid_balance_threshold_configuration?: { commit?: object; custom_credit_type_id?: string; discount_configuration?: { cap?: object; payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: object; recharge_to_amount?: number; threshold_amount?: number; threshold_balance_specifiers?: { exclude: object[]; }[]; }, update_recurring_commits?: { recurring_commit_id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; invoice_amount?: { quantity?: number; unit_price?: number; }; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[], update_recurring_credits?: { recurring_credit_id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[], update_scheduled_charges?: { scheduled_charge_id: string; invoice_schedule?: { add_schedule_items?: object[]; remove_schedule_items?: object[]; update_schedule_items?: object[]; }; netsuite_sales_order_id?: string; }[], update_spend_threshold_configuration?: { commit?: object; discount_configuration?: { cap?: object; payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: object; threshold_amount?: number; }, update_subscriptions?: { subscription_id: string; ending_before?: string; quantity_management_mode_update?: { quantity_management_mode: 'SEAT_BASED'; seat_config: object; }; quantity_updates?: { starting_at: string; quantity?: number; quantity_delta?: number; }[]; seat_updates?: { add_seat_ids?: object[]; add_unassigned_seats?: object[]; remove_seat_ids?: object[]; remove_unassigned_seats?: object[]; }; }[]): { data: id; }`\n\n**post** `/v2/contracts/edit`\n\nThe ability to edit a contract helps you react quickly to the needs of your customers and your business.\n\n### Use this endpoint to:\n- Encode mid-term commitment and discount changes\n- Fix configuration mistakes and easily roll back packaging changes\n\n### Key response fields:\n- The `id` of the edit\n- Complete edit details. For example, if you edited the contract to add new overrides and credits, you will receive the IDs of those overrides and credits in the response.\n\n### Usage guidelines:\n- When you edit a contract, any draft invoices update immediately to reflect that edit. Finalized invoices remain unchanged - you must void and regenerate them in the UI or API to reflect the edit.\n- Contract editing must be enabled to use this endpoint. Reach out to your Metronome representative to learn more.\n\n\n### Parameters\n\n- `contract_id: string`\n ID of the contract being edited\n\n- `customer_id: string`\n ID of the customer whose contract is being edited\n\n- `add_billing_provider_configuration_update?: { billing_provider_configuration: { billing_provider?: string; billing_provider_configuration_id?: string; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }; schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }; }`\n Update the billing provider configuration on the contract. Currently only supports adding a billing provider configuration to a contract that does not already have one.\n - `billing_provider_configuration: { billing_provider?: string; billing_provider_configuration_id?: string; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }`\n - `schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }`\n Indicates when the billing provider will be active on the contract. Any charges accrued during the schedule will be billed to the indicated billing provider.\n\n- `add_commits?: { product_id: string; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; amount?: number; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; on_session_payment?: boolean; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; spend_tracker_attributes?: { counts_as_discounted: boolean; }; temporary_id?: string; }[]`\n\n- `add_credits?: { access_schedule: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]`\n\n- `add_discounts?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]`\n\n- `add_overrides?: { starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: { price: number; size?: number; }[]; }; priority?: number; product_id?: string; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]`\n\n- `add_prepaid_balance_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; threshold_balance_specifiers?: { exclude: { custom_field_filters: object[]; }[]; }[]; }`\n - `commit: { product_id: string; description?: string; name?: string; priority?: number; }`\n - `is_enabled: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `recharge_to_amount: number`\n Specify the amount the balance should be recharged to.\n - `threshold_amount: number`\n Specify the threshold amount for the contract. Each time the contract's balance lowers to this amount, a threshold charge will be initiated.\n - `custom_credit_type_id?: string`\n If provided, the threshold, recharge-to amount, and the resulting threshold commit amount will be in terms of this credit type instead of the fiat currency.\n - `discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }`\n - `threshold_balance_specifiers?: { exclude: { custom_field_filters: { entity: 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit'; key: string; value: string; }[]; }[]; }[]`\n\n- `add_professional_services?: { max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[]`\n This field's availability is dependent on your client's configuration.\n\n- `add_recurring_commits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'POOLED' | 'INDIVIDUAL'; }; temporary_id?: string; }[]`\n\n- `add_recurring_credits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'POOLED' | 'INDIVIDUAL'; }; temporary_id?: string; }[]`\n\n- `add_reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_options?: { aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; }; ending_before?: string; fraction?: number; gcp_options?: { gcp_account_id?: string; gcp_offer_id?: string; }; netsuite_reseller_id?: string; reseller_contract_value?: number; starting_at?: string; }[]`\n\n- `add_revenue_system_configuration_update?: { revenue_system_configuration: { delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; provider?: 'netsuite'; revenue_system_configuration_id?: string; }; schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }; }`\n Update the revenue system configuration on the contract. Currently only supports adding a revenue system configuration to a contract that does not already have one.\n - `revenue_system_configuration: { delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; provider?: 'netsuite'; revenue_system_configuration_id?: string; }`\n - `schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }`\n\n- `add_scheduled_charges?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]`\n\n- `add_spend_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount: number; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; }`\n - `commit: { product_id: string; description?: string; name?: string; priority?: number; }`\n - `is_enabled: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `threshold_amount: number`\n Specify the threshold amount for the contract. Each time the contract's usage hits this amount, a threshold charge will be initiated.\n - `discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }`\n\n- `add_spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[]`\n Spend trackers to add to this contract. Aliases must be unique within a contract.\n\n- `add_subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated?: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product_id: string; }; custom_fields?: object; description?: string; ending_before?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { initial_seat_ids: string[]; seat_group_key: string; initial_unassigned_seats?: number; }; starting_at?: string; temporary_id?: string; }[]`\n Optional list of [subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/) to add to the contract.\n\n- `allow_contract_ending_before_finalized_invoice?: boolean`\n If true, allows setting the contract end date earlier than the end_timestamp of existing finalized invoices. Finalized invoices will be unchanged; if you want to incorporate the new end date, you can void and regenerate finalized usage invoices. Defaults to true.\n\n- `archive_commits?: { id: string; }[]`\n IDs of commits to archive\n\n- `archive_credits?: { id: string; }[]`\n IDs of credits to archive\n\n- `archive_scheduled_charges?: { id: string; }[]`\n IDs of scheduled charges to archive\n\n- `archive_spend_trackers?: string[]`\n Aliases of spend trackers to archive.\n\n- `remove_overrides?: { id: string; }[]`\n IDs of overrides to remove\n\n- `uniqueness_key?: string`\n Optional uniqueness key to prevent duplicate contract edits.\n\n- `update_commits?: { commit_id: string; access_schedule?: { add_schedule_items?: { amount: number; ending_before: string; starting_at: string; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; ending_before?: string; starting_at?: string; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_schedule?: { add_schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; quantity?: number; timestamp?: string; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; rollover_fraction?: number; }[]`\n\n- `update_contract_end_date?: string`\n RFC 3339 timestamp indicating when the contract will end (exclusive).\n\n- `update_contract_name?: string`\n Value to update the contract name to. If not provided, the contract name will remain unchanged.\n\n- `update_credits?: { credit_id: string; access_schedule?: { add_schedule_items?: { amount: number; ending_before: string; starting_at: string; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; ending_before?: string; starting_at?: string; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; rollover_fraction?: number; }[]`\n\n- `update_net_payment_terms_days?: number`\n Number of days after issuance of invoice after which the invoice is due (e.g. Net 30).\n\n- `update_prepaid_balance_threshold_configuration?: { commit?: { description?: string; name?: string; priority?: number; product_id?: string; }; custom_credit_type_id?: string; discount_configuration?: { cap?: { amount: number; spend_tracker_alias: string; }; payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount?: number; threshold_amount?: number; threshold_balance_specifiers?: { exclude: { custom_field_filters: { entity: 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit'; key: string; value: string; }[]; }[]; }[]; }`\n - `commit?: { description?: string; name?: string; priority?: number; product_id?: string; }`\n - `custom_credit_type_id?: string`\n If provided, the threshold, recharge-to amount, and the resulting threshold commit amount will be in terms of this credit type instead of the fiat currency.\n - `discount_configuration?: { cap?: { amount: number; spend_tracker_alias: string; }; payment_fraction?: number; }`\n - `is_enabled?: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `recharge_to_amount?: number`\n Specify the amount the balance should be recharged to.\n - `threshold_amount?: number`\n Specify the threshold amount for the contract. Each time the contract's balance lowers to this amount, a threshold charge will be initiated.\n - `threshold_balance_specifiers?: { exclude: { custom_field_filters: { entity: 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit'; key: string; value: string; }[]; }[]; }[]`\n\n- `update_recurring_commits?: { recurring_commit_id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; invoice_amount?: { quantity?: number; unit_price?: number; }; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[]`\n Edits to these recurring commits will only affect commits whose access schedules has not started. Expired commits, and commits with an active access schedule will remain unchanged.\n\n- `update_recurring_credits?: { recurring_credit_id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[]`\n Edits to these recurring credits will only affect credits whose access schedules has not started. Expired credits, and credits with an active access schedule will remain unchanged.\n\n- `update_scheduled_charges?: { scheduled_charge_id: string; invoice_schedule?: { add_schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; quantity?: number; timestamp?: string; unit_price?: number; }[]; }; netsuite_sales_order_id?: string; }[]`\n\n- `update_spend_threshold_configuration?: { commit?: { description?: string; name?: string; priority?: number; product_id?: string; }; discount_configuration?: { cap?: { amount: number; spend_tracker_alias: string; }; payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount?: number; }`\n - `commit?: { description?: string; name?: string; priority?: number; product_id?: string; }`\n - `discount_configuration?: { cap?: { amount: number; spend_tracker_alias: string; }; payment_fraction?: number; }`\n - `is_enabled?: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `threshold_amount?: number`\n Specify the threshold amount for the contract. Each time the contract's usage hits this amount, a threshold charge will be initiated.\n\n- `update_subscriptions?: { subscription_id: string; ending_before?: string; quantity_management_mode_update?: { quantity_management_mode: 'SEAT_BASED'; seat_config: { seat_group_key: string; }; }; quantity_updates?: { starting_at: string; quantity?: number; quantity_delta?: number; }[]; seat_updates?: { add_seat_ids?: { seat_ids: string[]; starting_at: string; }[]; add_unassigned_seats?: { quantity: number; starting_at: string; }[]; remove_seat_ids?: { seat_ids: string[]; starting_at: string; }[]; remove_unassigned_seats?: { quantity: number; starting_at: string; }[]; }; }[]`\n Optional list of subscriptions to update.\n\n### Returns\n\n- `{ data: { id: string; }; }`\n\n - `data: { id: string; }`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst response = await client.v2.contracts.edit({ contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc', customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d' });\n\nconsole.log(response);\n```",
+ "## edit\n\n`client.v2.contracts.edit(contract_id: string, customer_id: string, add_billing_provider_configuration_update?: { billing_provider_configuration: { billing_provider?: string; billing_provider_configuration_id?: string; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }; schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }; }, add_commits?: { product_id: string; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: object[]; credit_type_id?: string; }; amount?: number; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: object; invoice_schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; name?: string; netsuite_sales_order_id?: string; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: object[]; spend_tracker_attributes?: { counts_as_discounted: boolean; }; temporary_id?: string; }[], add_credits?: { access_schedule: { schedule_items: object[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: object[]; }[], add_discounts?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[], add_overrides?: { starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: tier[]; }; priority?: number; product_id?: string; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[], add_prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config_v2; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; threshold_balance_specifiers?: object[]; }, add_professional_services?: { max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[], add_recurring_commits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: object; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { apply_seat_increase_config: object; subscription_id: string; allocation?: 'POOLED' | 'INDIVIDUAL'; }; temporary_id?: string; }[], add_recurring_credits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: { apply_seat_increase_config: object; subscription_id: string; allocation?: 'POOLED' | 'INDIVIDUAL'; }; temporary_id?: string; }[], add_reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_options?: { aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; }; ending_before?: string; fraction?: number; gcp_options?: { gcp_account_id?: string; gcp_offer_id?: string; }; netsuite_reseller_id?: string; reseller_contract_value?: number; starting_at?: string; }[], add_revenue_system_configuration_update?: { revenue_system_configuration: { delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; provider?: 'netsuite'; revenue_system_configuration_id?: string; }; schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }; }, add_scheduled_charges?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[], add_spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config_v2; threshold_amount: number; discount_configuration?: object; }, add_spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[], add_subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated?: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product_id: string; }; custom_fields?: object; description?: string; ending_before?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { initial_seat_ids: string[]; seat_group_key: string; initial_unassigned_seats?: number; }; starting_at?: string; temporary_id?: string; }[], allow_contract_ending_before_finalized_invoice?: boolean, archive_commits?: { id: string; }[], archive_credits?: { id: string; }[], archive_scheduled_charges?: { id: string; }[], archive_spend_trackers?: string[], remove_overrides?: { id: string; }[], uniqueness_key?: string, update_commits?: { commit_id: string; access_schedule?: { add_schedule_items?: object[]; remove_schedule_items?: object[]; update_schedule_items?: object[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: object; invoice_schedule?: { add_schedule_items?: object[]; remove_schedule_items?: object[]; update_schedule_items?: object[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; rollover_fraction?: number; }[], update_contract_end_date?: string, update_contract_name?: string, update_credits?: { credit_id: string; access_schedule?: { add_schedule_items?: object[]; remove_schedule_items?: object[]; update_schedule_items?: object[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; rollover_fraction?: number; }[], update_net_payment_terms_days?: number, update_prepaid_balance_threshold_configuration?: { commit?: object; custom_credit_type_id?: string; discount_configuration?: { cap?: object; payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: object; recharge_to_amount?: number; threshold_amount?: number; threshold_balance_specifiers?: { exclude: object[]; }[]; }, update_recurring_commits?: { recurring_commit_id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; invoice_amount?: { quantity?: number; unit_price?: number; }; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[], update_recurring_credits?: { recurring_credit_id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[], update_scheduled_charges?: { scheduled_charge_id: string; invoice_schedule?: { add_schedule_items?: object[]; remove_schedule_items?: object[]; update_schedule_items?: object[]; }; netsuite_sales_order_id?: string; }[], update_spend_threshold_configuration?: { commit?: object; discount_configuration?: { cap?: object; payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: object; threshold_amount?: number; }, update_subscriptions?: { subscription_id: string; ending_before?: string; quantity_management_mode_update?: { quantity_management_mode: 'SEAT_BASED'; seat_config: object; }; quantity_updates?: { starting_at: string; quantity?: number; quantity_delta?: number; }[]; seat_updates?: { add_seat_ids?: object[]; add_unassigned_seats?: object[]; remove_seat_ids?: object[]; remove_unassigned_seats?: object[]; }; }[]): { data: object; }`\n\n**post** `/v2/contracts/edit`\n\nThe ability to edit a contract helps you react quickly to the needs of your customers and your business.\n\n### Use this endpoint to:\n- Encode mid-term commitment and discount changes\n- Fix configuration mistakes and easily roll back packaging changes\n\n### Key response fields:\n- The `id` of the edit\n- Complete edit details. For example, if you edited the contract to add new overrides and credits, you will receive the IDs of those overrides and credits in the response.\n\n### Usage guidelines:\n- When you edit a contract, any draft invoices update immediately to reflect that edit. Finalized invoices remain unchanged - you must void and regenerate them in the UI or API to reflect the edit.\n- Contract editing must be enabled to use this endpoint. Reach out to your Metronome representative to learn more.\n\n\n### Parameters\n\n- `contract_id: string`\n ID of the contract being edited\n\n- `customer_id: string`\n ID of the customer whose contract is being edited\n\n- `add_billing_provider_configuration_update?: { billing_provider_configuration: { billing_provider?: string; billing_provider_configuration_id?: string; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }; schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }; }`\n Update the billing provider configuration on the contract. Currently only supports adding a billing provider configuration to a contract that does not already have one.\n - `billing_provider_configuration: { billing_provider?: string; billing_provider_configuration_id?: string; delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; }`\n - `schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }`\n Indicates when the billing provider will be active on the contract. Any charges accrued during the schedule will be billed to the indicated billing provider.\n\n- `add_commits?: { product_id: string; type: 'PREPAID' | 'POSTPAID'; access_schedule?: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; amount?: number; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; on_session_payment?: boolean; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; spend_tracker_attributes?: { counts_as_discounted: boolean; }; temporary_id?: string; }[]`\n\n- `add_credits?: { access_schedule: { schedule_items: { amount: number; ending_before: string; starting_at: string; }[]; credit_type_id?: string; }; product_id: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; custom_fields?: object; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; }[]`\n\n- `add_discounts?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]`\n\n- `add_overrides?: { starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type_id?: string; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: { price: number; size?: number; }[]; }; priority?: number; product_id?: string; target?: 'COMMIT_RATE' | 'LIST_RATE'; tiers?: { multiplier: number; size?: number; }[]; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]`\n\n- `add_prepaid_balance_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; threshold_balance_specifiers?: { exclude: { custom_field_filters: object[]; }[]; }[]; }`\n - `commit: { product_id: string; description?: string; name?: string; priority?: number; }`\n - `is_enabled: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `recharge_to_amount: number`\n Specify the amount the balance should be recharged to.\n - `threshold_amount: number`\n Specify the threshold amount for the contract. Each time the contract's balance lowers to this amount, a threshold charge will be initiated.\n - `custom_credit_type_id?: string`\n If provided, the threshold, recharge-to amount, and the resulting threshold commit amount will be in terms of this credit type instead of the fiat currency.\n - `discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }`\n - `threshold_balance_specifiers?: { exclude: { custom_field_filters: { entity: 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit'; key: string; value: string; }[]; }[]; }[]`\n\n- `add_professional_services?: { max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[]`\n This field's availability is dependent on your client's configuration.\n\n- `add_recurring_commits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'POOLED' | 'INDIVIDUAL'; }; temporary_id?: string; }[]`\n\n- `add_recurring_credits?: { access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product_id: string; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; ending_before?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: { presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; }[]; subscription_config?: { apply_seat_increase_config: { is_prorated: boolean; }; subscription_id: string; allocation?: 'POOLED' | 'INDIVIDUAL'; }; temporary_id?: string; }[]`\n\n- `add_reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_options?: { aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; }; ending_before?: string; fraction?: number; gcp_options?: { gcp_account_id?: string; gcp_offer_id?: string; }; netsuite_reseller_id?: string; reseller_contract_value?: number; starting_at?: string; }[]`\n\n- `add_revenue_system_configuration_update?: { revenue_system_configuration: { delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; provider?: 'netsuite'; revenue_system_configuration_id?: string; }; schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }; }`\n Update the revenue system configuration on the contract. Currently only supports adding a revenue system configuration to a contract that does not already have one.\n - `revenue_system_configuration: { delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns'; provider?: 'netsuite'; revenue_system_configuration_id?: string; }`\n - `schedule: { effective_at: 'START_OF_CURRENT_PERIOD'; }`\n\n- `add_scheduled_charges?: { product_id: string; schedule: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: { amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH'; ending_before: string; frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY'; starting_at: string; amount?: number; quantity?: number; unit_price?: number; }; schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; }; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]`\n\n- `add_spend_threshold_configuration?: { commit: { product_id: string; description?: string; name?: string; priority?: number; }; is_enabled: boolean; payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: object; stripe_config?: object; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount: number; discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }; }`\n - `commit: { product_id: string; description?: string; name?: string; priority?: number; }`\n - `is_enabled: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `threshold_amount: number`\n Specify the threshold amount for the contract. Each time the contract's usage hits this amount, a threshold charge will be initiated.\n - `discount_configuration?: { payment_fraction: number; cap?: { amount: number; spend_tracker_alias: string; }; }`\n\n- `add_spend_trackers?: { alias: string; applicable_spend_specifiers: { sources: 'THRESHOLD_RECHARGE' | 'MANUAL'[]; spend_type: 'COMMIT_PURCHASE'; discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY'; }[]; credit_type_id: string; reset_frequency: 'BILLING_PERIOD'; }[]`\n Spend trackers to add to this contract. Aliases must be unique within a contract.\n\n- `add_subscriptions?: { collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated?: boolean; }; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product_id: string; }; custom_fields?: object; description?: string; ending_before?: string; initial_quantity?: number; name?: string; quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY'; seat_config?: { initial_seat_ids: string[]; seat_group_key: string; initial_unassigned_seats?: number; }; starting_at?: string; temporary_id?: string; }[]`\n Optional list of [subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/) to add to the contract.\n\n- `allow_contract_ending_before_finalized_invoice?: boolean`\n If true, allows setting the contract end date earlier than the end_timestamp of existing finalized invoices. Finalized invoices will be unchanged; if you want to incorporate the new end date, you can void and regenerate finalized usage invoices. Defaults to true.\n\n- `archive_commits?: { id: string; }[]`\n IDs of commits to archive\n\n- `archive_credits?: { id: string; }[]`\n IDs of credits to archive\n\n- `archive_scheduled_charges?: { id: string; }[]`\n IDs of scheduled charges to archive\n\n- `archive_spend_trackers?: string[]`\n Aliases of spend trackers to archive.\n\n- `remove_overrides?: { id: string; }[]`\n IDs of overrides to remove\n\n- `uniqueness_key?: string`\n Optional uniqueness key to prevent duplicate contract edits.\n\n- `update_commits?: { commit_id: string; access_schedule?: { add_schedule_items?: { amount: number; ending_before: string; starting_at: string; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; ending_before?: string; starting_at?: string; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; invoice_schedule?: { add_schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; quantity?: number; timestamp?: string; unit_price?: number; }[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; rollover_fraction?: number; }[]`\n\n- `update_contract_end_date?: string`\n RFC 3339 timestamp indicating when the contract will end (exclusive).\n\n- `update_contract_name?: string`\n Value to update the contract name to. If not provided, the contract name will remain unchanged.\n\n- `update_credits?: { credit_id: string; access_schedule?: { add_schedule_items?: { amount: number; ending_before: string; starting_at: string; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; ending_before?: string; starting_at?: string; }[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: { child_access: { type: 'ALL'; } | { type: 'NONE'; } | { contract_ids: string[]; type: 'CONTRACT_IDS'; }; }; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; rollover_fraction?: number; }[]`\n\n- `update_net_payment_terms_days?: number`\n Number of days after issuance of invoice after which the invoice is due (e.g. Net 30).\n\n- `update_prepaid_balance_threshold_configuration?: { commit?: { description?: string; name?: string; priority?: number; product_id?: string; }; custom_credit_type_id?: string; discount_configuration?: { cap?: { amount: number; spend_tracker_alias: string; }; payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; recharge_to_amount?: number; threshold_amount?: number; threshold_balance_specifiers?: { exclude: { custom_field_filters: { entity: 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit'; key: string; value: string; }[]; }[]; }[]; }`\n - `commit?: { description?: string; name?: string; priority?: number; product_id?: string; }`\n - `custom_credit_type_id?: string`\n If provided, the threshold, recharge-to amount, and the resulting threshold commit amount will be in terms of this credit type instead of the fiat currency.\n - `discount_configuration?: { cap?: { amount: number; spend_tracker_alias: string; }; payment_fraction?: number; }`\n - `is_enabled?: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `recharge_to_amount?: number`\n Specify the amount the balance should be recharged to.\n - `threshold_amount?: number`\n Specify the threshold amount for the contract. Each time the contract's balance lowers to this amount, a threshold charge will be initiated.\n - `threshold_balance_specifiers?: { exclude: { custom_field_filters: { entity: 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit'; key: string; value: string; }[]; }[]; }[]`\n\n- `update_recurring_commits?: { recurring_commit_id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; invoice_amount?: { quantity?: number; unit_price?: number; }; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[]`\n Edits to these recurring commits will only affect commits whose access schedules has not started. Expired commits, and commits with an active access schedule will remain unchanged.\n\n- `update_recurring_credits?: { recurring_credit_id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[]`\n Edits to these recurring credits will only affect credits whose access schedules has not started. Expired credits, and credits with an active access schedule will remain unchanged.\n\n- `update_scheduled_charges?: { scheduled_charge_id: string; invoice_schedule?: { add_schedule_items?: { timestamp: string; amount?: number; quantity?: number; unit_price?: number; }[]; remove_schedule_items?: { id: string; }[]; update_schedule_items?: { id: string; amount?: number; quantity?: number; timestamp?: string; unit_price?: number; }[]; }; netsuite_sales_order_id?: string; }[]`\n\n- `update_spend_threshold_configuration?: { commit?: { description?: string; name?: string; priority?: number; product_id?: string; }; discount_configuration?: { cap?: { amount: number; spend_tracker_alias: string; }; payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }; threshold_amount?: number; }`\n - `commit?: { description?: string; name?: string; priority?: number; product_id?: string; }`\n - `discount_configuration?: { cap?: { amount: number; spend_tracker_alias: string; }; payment_fraction?: number; }`\n - `is_enabled?: boolean`\n When set to false, the contract will not be evaluated against the threshold_amount. Toggling to true will result an immediate evaluation, regardless of prior state.\n - `payment_gate_config?: { payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL'; precalculated_tax_config?: { tax_amount: number; tax_name?: string; }; stripe_config?: { payment_type: 'INVOICE' | 'PAYMENT_INTENT'; invoice_metadata?: object; }; tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED'; }`\n - `threshold_amount?: number`\n Specify the threshold amount for the contract. Each time the contract's usage hits this amount, a threshold charge will be initiated.\n\n- `update_subscriptions?: { subscription_id: string; ending_before?: string; quantity_management_mode_update?: { quantity_management_mode: 'SEAT_BASED'; seat_config: { seat_group_key: string; }; }; quantity_updates?: { starting_at: string; quantity?: number; quantity_delta?: number; }[]; seat_updates?: { add_seat_ids?: { seat_ids: string[]; starting_at: string; }[]; add_unassigned_seats?: { quantity: number; starting_at: string; }[]; remove_seat_ids?: { seat_ids: string[]; starting_at: string; }[]; remove_unassigned_seats?: { quantity: number; starting_at: string; }[]; }; }[]`\n Optional list of subscriptions to update.\n\n### Returns\n\n- `{ data: { id: string; edit?: { id: string; add_commits?: object[]; add_credits?: object[]; add_discounts?: discount[]; add_overrides?: object[]; add_prepaid_balance_threshold_configuration?: prepaid_balance_threshold_configuration_v2; add_pro_services?: pro_service[]; add_recurring_commits?: object[]; add_recurring_credits?: object[]; add_reseller_royalties?: object[]; add_scheduled_charges?: object[]; add_spend_threshold_configuration?: spend_threshold_configuration_v2; add_subscriptions?: object[]; add_usage_filters?: object[]; archive_commits?: object[]; archive_credits?: object[]; archive_scheduled_charges?: object[]; remove_overrides?: object[]; timestamp?: string; uniqueness_key?: string; update_commits?: object[]; update_contract_end_date?: string; update_contract_name?: string; update_credits?: object[]; update_discounts?: object[]; update_prepaid_balance_threshold_configuration?: object; update_recurring_commits?: object[]; update_recurring_credits?: object[]; update_refund_invoices?: object[]; update_scheduled_charges?: object[]; update_spend_threshold_configuration?: object; update_subscriptions?: object[]; }; }; }`\n\n - `data: { id: string; edit?: { id: string; add_commits?: { id: string; product: { id: string; name: string; }; type: 'PREPAID' | 'POSTPAID'; access_schedule?: object; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: object; invoice_schedule?: { credit_type?: credit_type_data; do_not_invoice?: boolean; schedule_items?: object[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; salesforce_opportunity_id?: string; specifiers?: object[]; }[]; add_credits?: { id: string; product: { id: string; name: string; }; type: 'CREDIT'; access_schedule?: object; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; priority?: number; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; salesforce_opportunity_id?: string; specifiers?: object[]; }[]; add_discounts?: { id: string; product: object; schedule: schedule_point_in_time; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; }[]; add_overrides?: { id: string; created_at: string; starting_at: string; applicable_product_tags?: string[]; ending_before?: string; entitled?: boolean; is_commit_specific?: boolean; multiplier?: number; override_specifiers?: { billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; commit_ids?: string[]; presentation_group_values?: object; pricing_group_values?: object; product_id?: string; product_tags?: string[]; recurring_commit_ids?: string[]; }[]; override_tiers?: object[]; overwrite_rate?: { rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM'; credit_type?: credit_type_data; custom_rate?: object; is_prorated?: boolean; price?: number; quantity?: number; tiers?: tier[]; }; priority?: number; product?: { id: string; name: string; }; target?: 'COMMIT_RATE' | 'LIST_RATE'; type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED'; }[]; add_prepaid_balance_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config_v2; recharge_to_amount: number; threshold_amount: number; custom_credit_type_id?: string; discount_configuration?: object; threshold_balance_specifiers?: object[]; }; add_pro_services?: { id: string; max_amount: number; product_id: string; quantity: number; unit_price: number; custom_fields?: object; description?: string; netsuite_sales_order_id?: string; }[]; add_recurring_commits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; contract?: { id: string; }; description?: string; ending_before?: string; hierarchy_configuration?: object; invoice_amount?: { credit_type_id: string; quantity: number; unit_price: number; }; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: object; }[]; add_recurring_credits?: { id: string; access_amount: { credit_type_id: string; unit_price: number; quantity?: number; }; commit_duration: { value: number; unit?: 'PERIODS'; }; priority: number; product: { id: string; name: string; }; rate_type: 'COMMIT_RATE' | 'LIST_RATE'; starting_at: string; applicable_product_ids?: string[]; applicable_product_tags?: string[]; contract?: { id: string; }; description?: string; ending_before?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST'; recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; rollover_fraction?: number; specifiers?: object[]; subscription_config?: object; }[]; add_reseller_royalties?: { reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE'; applicable_product_ids?: string[]; applicable_product_tags?: string[]; aws_account_number?: string; aws_offer_id?: string; aws_payer_reference_id?: string; ending_before?: string; fraction?: number; gcp_account_id?: string; gcp_offer_id?: string; netsuite_reseller_id?: string; reseller_contract_value?: number; starting_at?: string; }[]; add_scheduled_charges?: { id: string; product: { id: string; name: string; }; schedule: object; name?: string; netsuite_sales_order_id?: string; }[]; add_spend_threshold_configuration?: { commit: base_threshold_commit; is_enabled: boolean; payment_gate_config: payment_gate_config_v2; threshold_amount: number; discount_configuration?: object; }; add_subscriptions?: { billing_periods: { current?: object; next?: object; previous?: object; }; collection_schedule: 'ADVANCE' | 'ARREARS'; proration: { invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE'; is_prorated: boolean; }; quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY'; quantity_schedule: { quantity: number; starting_at: string; ending_before?: string; }[]; starting_at: string; subscription_rate: { billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY'; product: object; }; id?: string; custom_fields?: object; description?: string; ending_before?: string; fiat_credit_type_id?: string; name?: string; seat_config?: { seat_group_key: string; }; }[]; add_usage_filters?: { group_key: string; group_values: string[]; starting_at: string; ending_before?: string; }[]; archive_commits?: { id: string; }[]; archive_credits?: { id: string; }[]; archive_scheduled_charges?: { id: string; }[]; remove_overrides?: { id: string; }[]; timestamp?: string; uniqueness_key?: string; update_commits?: { id: string; access_schedule?: { add_schedule_items?: object[]; remove_schedule_items?: object[]; update_schedule_items?: object[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: object; invoice_schedule?: { add_schedule_items?: object[]; remove_schedule_items?: object[]; update_schedule_items?: object[]; }; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'COMMIT_RATE' | 'LIST_RATE'; rollover_fraction?: number; specifiers?: object[]; }[]; update_contract_end_date?: string; update_contract_name?: string; update_credits?: { id: string; access_schedule?: { add_schedule_items?: object[]; remove_schedule_items?: object[]; update_schedule_items?: object[]; }; applicable_product_ids?: string[]; applicable_product_tags?: string[]; description?: string; hierarchy_configuration?: object; name?: string; netsuite_sales_order_id?: string; priority?: number; product_id?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; rollover_fraction?: number; specifiers?: object[]; }[]; update_discounts?: { id: string; custom_fields?: object; name?: string; netsuite_sales_order_id?: string; schedule?: { credit_type_id?: string; do_not_invoice?: boolean; recurring_schedule?: object; schedule_items?: object[]; }; }[]; update_prepaid_balance_threshold_configuration?: { commit?: object; custom_credit_type_id?: string; discount_configuration?: { cap?: object; payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: object; recharge_to_amount?: number; threshold_amount?: number; threshold_balance_specifiers?: { exclude: object[]; }[]; }; update_recurring_commits?: { id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; invoice_amount?: { quantity?: number; unit_price?: number; }; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[]; update_recurring_credits?: { id: string; access_amount?: { quantity?: number; unit_price?: number; }; ending_before?: string; rate_type?: 'LIST_RATE' | 'COMMIT_RATE'; }[]; update_refund_invoices?: { date: string; invoice_id: string; }[]; update_scheduled_charges?: { id: string; invoice_schedule?: { add_schedule_items?: object[]; remove_schedule_items?: object[]; update_schedule_items?: object[]; }; name?: string; netsuite_sales_order_id?: string; }[]; update_spend_threshold_configuration?: { commit?: object; discount_configuration?: { cap?: object; payment_fraction?: number; }; is_enabled?: boolean; payment_gate_config?: object; threshold_amount?: number; }; update_subscriptions?: { id: string; ending_before?: string; quantity_updates?: { starting_at: string; quantity?: number; quantity_delta?: number; }[]; seat_updates?: { add_seat_ids?: object[]; add_unassigned_seats?: object[]; remove_seat_ids?: object[]; remove_unassigned_seats?: object[]; }; }[]; }; }`\n\n### Example\n\n```typescript\nimport Metronome from '@metronome/sdk';\n\nconst client = new Metronome();\n\nconst response = await client.v2.contracts.edit({ contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc', customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d' });\n\nconsole.log(response);\n```",
perLanguage: {
typescript: {
method: 'client.v2.contracts.edit',
diff --git a/src/resources/v2/contracts.ts b/src/resources/v2/contracts.ts
index 3574f97f..1d9a3eea 100644
--- a/src/resources/v2/contracts.ts
+++ b/src/resources/v2/contracts.ts
@@ -245,7 +245,1577 @@ export interface ContractListResponse {
}
export interface ContractEditResponse {
- data: Shared.ID;
+ data: ContractEditResponse.Data;
+}
+
+export namespace ContractEditResponse {
+ export interface Data {
+ id: string;
+
+ edit?: Data.Edit;
+ }
+
+ export namespace Data {
+ export interface Edit {
+ id: string;
+
+ add_commits?: Array;
+
+ add_credits?: Array;
+
+ add_discounts?: Array;
+
+ add_overrides?: Array;
+
+ add_prepaid_balance_threshold_configuration?: Shared.PrepaidBalanceThresholdConfigurationV2;
+
+ add_pro_services?: Array;
+
+ add_recurring_commits?: Array;
+
+ add_recurring_credits?: Array;
+
+ add_reseller_royalties?: Array;
+
+ add_scheduled_charges?: Array;
+
+ add_spend_threshold_configuration?: Shared.SpendThresholdConfigurationV2;
+
+ /**
+ * List of subscriptions on the contract.
+ */
+ add_subscriptions?: Array;
+
+ add_usage_filters?: Array;
+
+ archive_commits?: Array;
+
+ archive_credits?: Array;
+
+ archive_scheduled_charges?: Array;
+
+ remove_overrides?: Array;
+
+ timestamp?: string;
+
+ /**
+ * Prevents the creation of duplicates. If a request to create a record is made
+ * with a previously used uniqueness key, a new record will not be created and the
+ * request will fail with a 409 error.
+ */
+ uniqueness_key?: string;
+
+ update_commits?: Array;
+
+ update_contract_end_date?: string;
+
+ /**
+ * Value to update the contract name to. If not provided, the contract name will
+ * remain unchanged.
+ */
+ update_contract_name?: string | null;
+
+ update_credits?: Array;
+
+ update_discounts?: Array;
+
+ update_prepaid_balance_threshold_configuration?: Edit.UpdatePrepaidBalanceThresholdConfiguration;
+
+ update_recurring_commits?: Array;
+
+ update_recurring_credits?: Array;
+
+ update_refund_invoices?: Array;
+
+ update_scheduled_charges?: Array;
+
+ update_spend_threshold_configuration?: Edit.UpdateSpendThresholdConfiguration;
+
+ /**
+ * Optional list of subscriptions to update.
+ */
+ update_subscriptions?: Array;
+ }
+
+ export namespace Edit {
+ export interface AddCommit {
+ id: string;
+
+ product: AddCommit.Product;
+
+ type: 'PREPAID' | 'POSTPAID';
+
+ /**
+ * The schedule that the customer will gain access to the credits purposed with
+ * this commit.
+ */
+ access_schedule?: Shared.ScheduleDuration;
+
+ applicable_product_ids?: Array;
+
+ applicable_product_tags?: Array;
+
+ description?: string;
+
+ /**
+ * Optional configuration for commit hierarchy access control
+ */
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
+
+ /**
+ * The schedule that the customer will be invoiced for this commit.
+ */
+ invoice_schedule?: AddCommit.InvoiceSchedule;
+
+ name?: string;
+
+ /**
+ * This field's availability is dependent on your client's configuration.
+ */
+ netsuite_sales_order_id?: string;
+
+ /**
+ * If multiple credits or commits are applicable, the one with the lower priority
+ * will apply first.
+ */
+ priority?: number;
+
+ rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
+
+ rollover_fraction?: number;
+
+ /**
+ * This field's availability is dependent on your client's configuration.
+ */
+ salesforce_opportunity_id?: string;
+
+ /**
+ * List of filters that determine what kind of customer usage draws down a commit
+ * or credit. A customer's usage needs to meet the condition of at least one of the
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
+ * Instead, to target usage by product or product tag, pass those values in the
+ * body of `specifiers`.
+ */
+ specifiers?: Array;
+ }
+
+ export namespace AddCommit {
+ export interface Product {
+ id: string;
+
+ name: string;
+ }
+
+ /**
+ * The schedule that the customer will be invoiced for this commit.
+ */
+ export interface InvoiceSchedule {
+ credit_type?: Shared.CreditTypeData;
+
+ /**
+ * If true, this schedule will not generate an invoice.
+ */
+ do_not_invoice?: boolean;
+
+ schedule_items?: Array;
+ }
+
+ export namespace InvoiceSchedule {
+ export interface ScheduleItem {
+ id: string;
+
+ timestamp: string;
+
+ amount?: number;
+
+ invoice_id?: string | null;
+
+ quantity?: number;
+
+ unit_price?: number;
+ }
+ }
+ }
+
+ export interface AddCredit {
+ id: string;
+
+ product: AddCredit.Product;
+
+ type: 'CREDIT';
+
+ /**
+ * The schedule that the customer will gain access to the credits.
+ */
+ access_schedule?: Shared.ScheduleDuration;
+
+ applicable_product_ids?: Array;
+
+ applicable_product_tags?: Array;
+
+ description?: string;
+
+ /**
+ * Optional configuration for recurring credit hierarchy access control
+ */
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
+
+ name?: string;
+
+ /**
+ * This field's availability is dependent on your client's configuration.
+ */
+ netsuite_sales_order_id?: string;
+
+ /**
+ * If multiple credits or commits are applicable, the one with the lower priority
+ * will apply first.
+ */
+ priority?: number;
+
+ rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
+
+ rollover_fraction?: number;
+
+ /**
+ * This field's availability is dependent on your client's configuration.
+ */
+ salesforce_opportunity_id?: string;
+
+ /**
+ * List of filters that determine what kind of customer usage draws down a commit
+ * or credit. A customer's usage needs to meet the condition of at least one of the
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
+ * Instead, to target usage by product or product tag, pass those values in the
+ * body of `specifiers`.
+ */
+ specifiers?: Array;
+ }
+
+ export namespace AddCredit {
+ export interface Product {
+ id: string;
+
+ name: string;
+ }
+ }
+
+ export interface AddOverride {
+ id: string;
+
+ created_at: string;
+
+ starting_at: string;
+
+ applicable_product_tags?: Array;
+
+ ending_before?: string;
+
+ entitled?: boolean;
+
+ is_commit_specific?: boolean;
+
+ multiplier?: number;
+
+ override_specifiers?: Array;
+
+ override_tiers?: Array;
+
+ overwrite_rate?: AddOverride.OverwriteRate;
+
+ priority?: number;
+
+ product?: AddOverride.Product;
+
+ target?: 'COMMIT_RATE' | 'LIST_RATE';
+
+ type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED';
+ }
+
+ export namespace AddOverride {
+ export interface OverrideSpecifier {
+ billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
+
+ commit_ids?: Array;
+
+ presentation_group_values?: { [key: string]: string | null };
+
+ pricing_group_values?: { [key: string]: string };
+
+ product_id?: string;
+
+ product_tags?: Array;
+
+ recurring_commit_ids?: Array;
+ }
+
+ export interface OverwriteRate {
+ rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM';
+
+ credit_type?: Shared.CreditTypeData;
+
+ /**
+ * Only set for CUSTOM rate_type. This field is interpreted by custom rate
+ * processors.
+ */
+ custom_rate?: { [key: string]: unknown };
+
+ /**
+ * Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
+ * set to true.
+ */
+ is_prorated?: boolean;
+
+ /**
+ * Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type,
+ * this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1.
+ */
+ price?: number;
+
+ /**
+ * Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
+ */
+ quantity?: number;
+
+ /**
+ * Only set for TIERED rate_type.
+ */
+ tiers?: Array;
+ }
+
+ export interface Product {
+ id: string;
+
+ name: string;
+ }
+ }
+
+ export interface AddRecurringCommit {
+ id: string;
+
+ /**
+ * The amount of commit to grant.
+ */
+ access_amount: AddRecurringCommit.AccessAmount;
+
+ /**
+ * The amount of time the created commits will be valid for
+ */
+ commit_duration: AddRecurringCommit.CommitDuration;
+
+ /**
+ * Will be passed down to the individual commits
+ */
+ priority: number;
+
+ product: AddRecurringCommit.Product;
+
+ /**
+ * Whether the created commits will use the commit rate or list rate
+ */
+ rate_type: 'COMMIT_RATE' | 'LIST_RATE';
+
+ /**
+ * Determines the start time for the first commit
+ */
+ starting_at: string;
+
+ /**
+ * Will be passed down to the individual commits
+ */
+ applicable_product_ids?: Array;
+
+ /**
+ * Will be passed down to the individual commits
+ */
+ applicable_product_tags?: Array;
+
+ contract?: AddRecurringCommit.Contract;
+
+ /**
+ * Will be passed down to the individual commits
+ */
+ description?: string;
+
+ /**
+ * Determines when the contract will stop creating recurring commits. Optional
+ */
+ ending_before?: string;
+
+ /**
+ * Optional configuration for recurring credit hierarchy access control
+ */
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
+
+ /**
+ * The amount the customer should be billed for the commit. Not required.
+ */
+ invoice_amount?: AddRecurringCommit.InvoiceAmount;
+
+ /**
+ * Displayed on invoices. Will be passed through to the individual commits
+ */
+ name?: string;
+
+ /**
+ * Will be passed down to the individual commits
+ */
+ netsuite_sales_order_id?: string;
+
+ /**
+ * Determines whether the first and last commit will be prorated. If not provided,
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
+ */
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
+
+ /**
+ * The frequency at which the recurring commits will be created. If not provided: -
+ * The commits will be created on the usage invoice frequency. If provided: - The
+ * period defined in the duration will correspond to this frequency. - Commits will
+ * be created aligned with the recurring commit's starting_at rather than the usage
+ * invoice dates.
+ */
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
+
+ /**
+ * Will be passed down to the individual commits. This controls how much of an
+ * individual unexpired commit will roll over upon contract transition. Must be
+ * between 0 and 1.
+ */
+ rollover_fraction?: number;
+
+ /**
+ * List of filters that determine what kind of customer usage draws down a commit
+ * or credit. A customer's usage needs to meet the condition of at least one of the
+ * specifiers to contribute to a commit's or credit's drawdown.
+ */
+ specifiers?: Array;
+
+ /**
+ * Attach a subscription to the recurring commit/credit.
+ */
+ subscription_config?: Shared.RecurringCommitSubscriptionConfig;
+ }
+
+ export namespace AddRecurringCommit {
+ /**
+ * The amount of commit to grant.
+ */
+ export interface AccessAmount {
+ credit_type_id: string;
+
+ unit_price: number;
+
+ quantity?: number;
+ }
+
+ /**
+ * The amount of time the created commits will be valid for
+ */
+ export interface CommitDuration {
+ value: number;
+
+ unit?: 'PERIODS';
+ }
+
+ export interface Product {
+ id: string;
+
+ name: string;
+ }
+
+ export interface Contract {
+ id: string;
+ }
+
+ /**
+ * The amount the customer should be billed for the commit. Not required.
+ */
+ export interface InvoiceAmount {
+ credit_type_id: string;
+
+ quantity: number;
+
+ unit_price: number;
+ }
+ }
+
+ export interface AddRecurringCredit {
+ id: string;
+
+ /**
+ * The amount of commit to grant.
+ */
+ access_amount: AddRecurringCredit.AccessAmount;
+
+ /**
+ * The amount of time the created commits will be valid for
+ */
+ commit_duration: AddRecurringCredit.CommitDuration;
+
+ /**
+ * Will be passed down to the individual commits
+ */
+ priority: number;
+
+ product: AddRecurringCredit.Product;
+
+ /**
+ * Whether the created commits will use the commit rate or list rate
+ */
+ rate_type: 'COMMIT_RATE' | 'LIST_RATE';
+
+ /**
+ * Determines the start time for the first commit
+ */
+ starting_at: string;
+
+ /**
+ * Will be passed down to the individual commits
+ */
+ applicable_product_ids?: Array;
+
+ /**
+ * Will be passed down to the individual commits
+ */
+ applicable_product_tags?: Array;
+
+ contract?: AddRecurringCredit.Contract;
+
+ /**
+ * Will be passed down to the individual commits
+ */
+ description?: string;
+
+ /**
+ * Determines when the contract will stop creating recurring commits. Optional
+ */
+ ending_before?: string;
+
+ /**
+ * Optional configuration for recurring credit hierarchy access control
+ */
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
+
+ /**
+ * Displayed on invoices. Will be passed through to the individual commits
+ */
+ name?: string;
+
+ /**
+ * Will be passed down to the individual commits
+ */
+ netsuite_sales_order_id?: string;
+
+ /**
+ * Determines whether the first and last commit will be prorated. If not provided,
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
+ */
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
+
+ /**
+ * The frequency at which the recurring commits will be created. If not provided: -
+ * The commits will be created on the usage invoice frequency. If provided: - The
+ * period defined in the duration will correspond to this frequency. - Commits will
+ * be created aligned with the recurring commit's starting_at rather than the usage
+ * invoice dates.
+ */
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
+
+ /**
+ * Will be passed down to the individual commits. This controls how much of an
+ * individual unexpired commit will roll over upon contract transition. Must be
+ * between 0 and 1.
+ */
+ rollover_fraction?: number;
+
+ /**
+ * List of filters that determine what kind of customer usage draws down a commit
+ * or credit. A customer's usage needs to meet the condition of at least one of the
+ * specifiers to contribute to a commit's or credit's drawdown.
+ */
+ specifiers?: Array;
+
+ /**
+ * Attach a subscription to the recurring commit/credit.
+ */
+ subscription_config?: Shared.RecurringCommitSubscriptionConfig;
+ }
+
+ export namespace AddRecurringCredit {
+ /**
+ * The amount of commit to grant.
+ */
+ export interface AccessAmount {
+ credit_type_id: string;
+
+ unit_price: number;
+
+ quantity?: number;
+ }
+
+ /**
+ * The amount of time the created commits will be valid for
+ */
+ export interface CommitDuration {
+ value: number;
+
+ unit?: 'PERIODS';
+ }
+
+ export interface Product {
+ id: string;
+
+ name: string;
+ }
+
+ export interface Contract {
+ id: string;
+ }
+ }
+
+ export interface AddResellerRoyalty {
+ reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
+
+ applicable_product_ids?: Array;
+
+ applicable_product_tags?: Array;
+
+ aws_account_number?: string;
+
+ aws_offer_id?: string;
+
+ aws_payer_reference_id?: string;
+
+ ending_before?: string | null;
+
+ fraction?: number;
+
+ gcp_account_id?: string;
+
+ gcp_offer_id?: string;
+
+ netsuite_reseller_id?: string;
+
+ reseller_contract_value?: number;
+
+ starting_at?: string;
+ }
+
+ export interface AddScheduledCharge {
+ id: string;
+
+ product: AddScheduledCharge.Product;
+
+ schedule: Shared.SchedulePointInTime;
+
+ /**
+ * displayed on invoices
+ */
+ name?: string;
+
+ /**
+ * This field's availability is dependent on your client's configuration.
+ */
+ netsuite_sales_order_id?: string;
+ }
+
+ export namespace AddScheduledCharge {
+ export interface Product {
+ id: string;
+
+ name: string;
+ }
+ }
+
+ export interface AddSubscription {
+ /**
+ * Previous, current, and next billing periods for the subscription.
+ */
+ billing_periods: AddSubscription.BillingPeriods;
+
+ collection_schedule: 'ADVANCE' | 'ARREARS';
+
+ proration: AddSubscription.Proration;
+
+ /**
+ * Determines how the subscription's quantity is controlled. Defaults to
+ * QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
+ * directly on the subscription. `initial_quantity` must be provided with this
+ * option. Compatible with recurring commits/credits that use POOLED allocation.
+ * **SEAT_BASED**: Use when you want to pass specific seat identifiers (e.g. add
+ * user_123) to increment and decrement a subscription quantity, rather than
+ * directly providing the quantity. You must use a **SEAT_BASED** subscription to
+ * use a linked recurring credit with an allocation per seat. `seat_config` must be
+ * provided with this option.
+ */
+ quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY';
+
+ /**
+ * List of quantity schedule items for the subscription. Only includes the current
+ * quantity and future quantity changes.
+ */
+ quantity_schedule: Array;
+
+ starting_at: string;
+
+ subscription_rate: AddSubscription.SubscriptionRate;
+
+ id?: string;
+
+ /**
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
+ */
+ custom_fields?: { [key: string]: string };
+
+ description?: string;
+
+ ending_before?: string;
+
+ fiat_credit_type_id?: string;
+
+ name?: string;
+
+ seat_config?: AddSubscription.SeatConfig;
+ }
+
+ export namespace AddSubscription {
+ /**
+ * Previous, current, and next billing periods for the subscription.
+ */
+ export interface BillingPeriods {
+ current?: BillingPeriods.Current;
+
+ next?: BillingPeriods.Next;
+
+ previous?: BillingPeriods.Previous;
+ }
+
+ export namespace BillingPeriods {
+ export interface Current {
+ ending_before: string;
+
+ starting_at: string;
+ }
+
+ export interface Next {
+ ending_before: string;
+
+ starting_at: string;
+ }
+
+ export interface Previous {
+ ending_before: string;
+
+ starting_at: string;
+ }
+ }
+
+ export interface Proration {
+ invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE';
+
+ is_prorated: boolean;
+ }
+
+ export interface QuantitySchedule {
+ quantity: number;
+
+ starting_at: string;
+
+ ending_before?: string;
+ }
+
+ export interface SubscriptionRate {
+ billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
+
+ product: SubscriptionRate.Product;
+ }
+
+ export namespace SubscriptionRate {
+ export interface Product {
+ id: string;
+
+ name: string;
+ }
+ }
+
+ export interface SeatConfig {
+ /**
+ * The property name, sent on usage events, that identifies the seat ID associated
+ * with the usage event. For example, the property name might be seat_id or
+ * user_id. The property must be set as a group key on billable metrics and a
+ * presentation/pricing group key on contract products. This allows linked
+ * recurring credits with an allocation per seat to be consumed by only one seat's
+ * usage.
+ */
+ seat_group_key: string;
+ }
+ }
+
+ export interface AddUsageFilter {
+ group_key: string;
+
+ group_values: Array;
+
+ /**
+ * This will match contract starting_at value if usage filter is active from the
+ * beginning of the contract.
+ */
+ starting_at: string;
+
+ /**
+ * This will match contract ending_before value if usage filter is active until the
+ * end of the contract. It will be undefined if the contract is open-ended.
+ */
+ ending_before?: string;
+ }
+
+ export interface ArchiveCommit {
+ id: string;
+ }
+
+ export interface ArchiveCredit {
+ id: string;
+ }
+
+ export interface ArchiveScheduledCharge {
+ id: string;
+ }
+
+ export interface RemoveOverride {
+ id: string;
+ }
+
+ export interface UpdateCommit {
+ id: string;
+
+ access_schedule?: UpdateCommit.AccessSchedule;
+
+ /**
+ * Which products the commit applies to. If applicable_product_ids,
+ * applicable_product_tags or specifiers are not provided, the commit applies to
+ * all products.
+ */
+ applicable_product_ids?: Array | null;
+
+ /**
+ * Which tags the commit applies to. If applicable_product_ids,
+ * applicable_product_tags or specifiers are not provided, the commit applies to
+ * all products.
+ */
+ applicable_product_tags?: Array | null;
+
+ description?: string;
+
+ /**
+ * Optional configuration for commit hierarchy access control
+ */
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
+
+ invoice_schedule?: UpdateCommit.InvoiceSchedule;
+
+ name?: string;
+
+ netsuite_sales_order_id?: string | null;
+
+ /**
+ * If multiple commits are applicable, the one with the lower priority will apply
+ * first.
+ */
+ priority?: number | null;
+
+ product_id?: string;
+
+ /**
+ * If set, the commit's rate type was updated to the specified value.
+ */
+ rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
+
+ rollover_fraction?: number | null;
+
+ /**
+ * List of filters that determine what kind of customer usage draws down a commit
+ * or credit. A customer's usage needs to meet the condition of at least one of the
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
+ * Instead, to target usage by product or product tag, pass those values in the
+ * body of `specifiers`.
+ */
+ specifiers?: Array | null;
+ }
+
+ export namespace UpdateCommit {
+ export interface AccessSchedule {
+ add_schedule_items?: Array;
+
+ remove_schedule_items?: Array;
+
+ update_schedule_items?: Array;
+ }
+
+ export namespace AccessSchedule {
+ export interface AddScheduleItem {
+ amount: number;
+
+ /**
+ * RFC 3339 timestamp (exclusive)
+ */
+ ending_before: string;
+
+ /**
+ * RFC 3339 timestamp (inclusive)
+ */
+ starting_at: string;
+ }
+
+ export interface RemoveScheduleItem {
+ id: string;
+ }
+
+ export interface UpdateScheduleItem {
+ id: string;
+
+ amount?: number;
+
+ /**
+ * RFC 3339 timestamp (exclusive)
+ */
+ ending_before?: string;
+
+ /**
+ * RFC 3339 timestamp (inclusive)
+ */
+ starting_at?: string;
+ }
+ }
+
+ export interface InvoiceSchedule {
+ add_schedule_items?: Array;
+
+ remove_schedule_items?: Array;
+
+ update_schedule_items?: Array;
+ }
+
+ export namespace InvoiceSchedule {
+ export interface AddScheduleItem {
+ timestamp: string;
+
+ amount?: number;
+
+ quantity?: number;
+
+ unit_price?: number;
+ }
+
+ export interface RemoveScheduleItem {
+ id: string;
+ }
+
+ export interface UpdateScheduleItem {
+ id: string;
+
+ amount?: number;
+
+ quantity?: number;
+
+ timestamp?: string;
+
+ unit_price?: number;
+ }
+ }
+ }
+
+ export interface UpdateCredit {
+ id: string;
+
+ access_schedule?: UpdateCredit.AccessSchedule;
+
+ /**
+ * Which products the credit applies to. If applicable_product_ids,
+ * applicable_product_tags or specifiers are not provided, the credit applies to
+ * all products.
+ */
+ applicable_product_ids?: Array | null;
+
+ /**
+ * Which tags the credit applies to. If applicable_product_ids,
+ * applicable_product_tags or specifiers are not provided, the credit applies to
+ * all products.
+ */
+ applicable_product_tags?: Array | null;
+
+ description?: string;
+
+ /**
+ * Optional configuration for credit hierarchy access control
+ */
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
+
+ name?: string;
+
+ netsuite_sales_order_id?: string | null;
+
+ /**
+ * If multiple credits are applicable, the one with the lower priority will apply
+ * first.
+ */
+ priority?: number | null;
+
+ product_id?: string;
+
+ /**
+ * If set, the credit's rate type was updated to the specified value.
+ */
+ rate_type?: 'LIST_RATE' | 'COMMIT_RATE';
+
+ rollover_fraction?: number | null;
+
+ /**
+ * List of filters that determine what kind of customer usage draws down a commit
+ * or credit. A customer's usage needs to meet the condition of at least one of the
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
+ * Instead, to target usage by product or product tag, pass those values in the
+ * body of `specifiers`.
+ */
+ specifiers?: Array | null;
+ }
+
+ export namespace UpdateCredit {
+ export interface AccessSchedule {
+ add_schedule_items?: Array;
+
+ remove_schedule_items?: Array;
+
+ update_schedule_items?: Array;
+ }
+
+ export namespace AccessSchedule {
+ export interface AddScheduleItem {
+ amount: number;
+
+ /**
+ * RFC 3339 timestamp (exclusive)
+ */
+ ending_before: string;
+
+ /**
+ * RFC 3339 timestamp (inclusive)
+ */
+ starting_at: string;
+ }
+
+ export interface RemoveScheduleItem {
+ id: string;
+ }
+
+ export interface UpdateScheduleItem {
+ id: string;
+
+ amount?: number;
+
+ /**
+ * RFC 3339 timestamp (exclusive)
+ */
+ ending_before?: string;
+
+ /**
+ * RFC 3339 timestamp (inclusive)
+ */
+ starting_at?: string;
+ }
+ }
+ }
+
+ export interface UpdateDiscount {
+ id: string;
+
+ /**
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
+ */
+ custom_fields?: { [key: string]: string };
+
+ name?: string;
+
+ netsuite_sales_order_id?: string;
+
+ /**
+ * Must provide either schedule_items or recurring_schedule.
+ */
+ schedule?: UpdateDiscount.Schedule;
+ }
+
+ export namespace UpdateDiscount {
+ /**
+ * Must provide either schedule_items or recurring_schedule.
+ */
+ export interface Schedule {
+ /**
+ * Defaults to USD (cents) if not passed.
+ */
+ credit_type_id?: string;
+
+ /**
+ * This field is only applicable to commit invoice schedules. If true, this
+ * schedule will not generate an invoice.
+ */
+ do_not_invoice?: boolean;
+
+ /**
+ * Enter the unit price and quantity for the charge or instead only send the
+ * amount. If amount is sent, the unit price is assumed to be the amount and
+ * quantity is inferred to be 1.
+ */
+ recurring_schedule?: Schedule.RecurringSchedule;
+
+ /**
+ * Either provide amount or provide both unit_price and quantity.
+ */
+ schedule_items?: Array;
+ }
+
+ export namespace Schedule {
+ /**
+ * Enter the unit price and quantity for the charge or instead only send the
+ * amount. If amount is sent, the unit price is assumed to be the amount and
+ * quantity is inferred to be 1.
+ */
+ export interface RecurringSchedule {
+ amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH';
+
+ /**
+ * RFC 3339 timestamp (exclusive).
+ */
+ ending_before: string;
+
+ frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY';
+
+ /**
+ * RFC 3339 timestamp (inclusive).
+ */
+ starting_at: string;
+
+ /**
+ * Amount for the charge. Can be provided instead of unit_price and quantity. If
+ * amount is sent, the unit_price is assumed to be the amount and quantity is
+ * inferred to be 1.
+ */
+ amount?: number;
+
+ /**
+ * Quantity for the charge. Will be multiplied by unit_price to determine the
+ * amount and must be specified with unit_price. If specified amount cannot be
+ * provided.
+ */
+ quantity?: number;
+
+ /**
+ * Unit price for the charge. Will be multiplied by quantity to determine the
+ * amount and must be specified with quantity. If specified amount cannot be
+ * provided.
+ */
+ unit_price?: number;
+ }
+
+ export interface ScheduleItem {
+ /**
+ * timestamp of the scheduled event
+ */
+ timestamp: string;
+
+ /**
+ * Amount for the charge. Can be provided instead of unit_price and quantity. If
+ * amount is sent, the unit_price is assumed to be the amount and quantity is
+ * inferred to be 1.
+ */
+ amount?: number;
+
+ /**
+ * Quantity for the charge. Will be multiplied by unit_price to determine the
+ * amount and must be specified with unit_price. If specified amount cannot be
+ * provided.
+ */
+ quantity?: number;
+
+ /**
+ * Unit price for the charge. Will be multiplied by quantity to determine the
+ * amount and must be specified with quantity. If specified amount cannot be
+ * provided.
+ */
+ unit_price?: number;
+ }
+ }
+ }
+
+ export interface UpdatePrepaidBalanceThresholdConfiguration {
+ commit?: UpdatePrepaidBalanceThresholdConfiguration.Commit;
+
+ /**
+ * If provided, the threshold, recharge-to amount, and the resulting threshold
+ * commit amount will be in terms of this credit type instead of the fiat currency.
+ */
+ custom_credit_type_id?: string | null;
+
+ discount_configuration?: UpdatePrepaidBalanceThresholdConfiguration.DiscountConfiguration | null;
+
+ /**
+ * When set to false, the contract will not be evaluated against the
+ * threshold_amount. Toggling to true will result an immediate evaluation,
+ * regardless of prior state.
+ */
+ is_enabled?: boolean;
+
+ payment_gate_config?: Shared.PaymentGateConfigV2;
+
+ /**
+ * Specify the amount the balance should be recharged to.
+ */
+ recharge_to_amount?: number;
+
+ /**
+ * Specify the threshold amount for the contract. Each time the contract's balance
+ * lowers to this amount, a threshold charge will be initiated.
+ */
+ threshold_amount?: number;
+
+ threshold_balance_specifiers?: Array | null;
+ }
+
+ export namespace UpdatePrepaidBalanceThresholdConfiguration {
+ export interface Commit extends Shared.UpdateBaseThresholdCommit {
+ /**
+ * Which products the threshold commit applies to. If both applicable_product_ids
+ * and applicable_product_tags are not provided, the commit applies to all
+ * products.
+ */
+ applicable_product_ids?: Array | null;
+
+ /**
+ * Which tags the threshold commit applies to. If both applicable_product_ids and
+ * applicable_product_tags are not provided, the commit applies to all products.
+ */
+ applicable_product_tags?: Array | null;
+
+ /**
+ * List of filters that determine what kind of customer usage draws down a commit
+ * or credit. A customer's usage needs to meet the condition of at least one of the
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
+ * Instead, to target usage by product or product tag, pass those values in the
+ * body of `specifiers`.
+ */
+ specifiers?: Array | null;
+ }
+
+ export interface DiscountConfiguration {
+ /**
+ * Update the discount cap. Set to null to remove an existing cap.
+ */
+ cap?: DiscountConfiguration.Cap | null;
+
+ /**
+ * The fraction of the original amount that the customer pays after applying the
+ * discount. Set to null to remove the discount fraction. For example, 0.85 means
+ * the customer pays 85% of the original amount (a 15% discount).
+ */
+ payment_fraction?: number | null;
+ }
+
+ export namespace DiscountConfiguration {
+ /**
+ * Update the discount cap. Set to null to remove an existing cap.
+ */
+ export interface Cap {
+ /**
+ * Accumulated spend ceiling above which the discount stops applying.
+ */
+ amount: number;
+
+ /**
+ * Alias of the spend tracker this cap is measured against.
+ */
+ spend_tracker_alias: string;
+ }
+ }
+
+ export interface ThresholdBalanceSpecifier {
+ exclude: Array;
+ }
+
+ export namespace ThresholdBalanceSpecifier {
+ export interface Exclude {
+ custom_field_filters: Array;
+ }
+
+ export namespace Exclude {
+ export interface CustomFieldFilter {
+ entity: 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit';
+
+ key: string;
+
+ value: string;
+ }
+ }
+ }
+ }
+
+ export interface UpdateRecurringCommit {
+ id: string;
+
+ access_amount?: UpdateRecurringCommit.AccessAmount;
+
+ ending_before?: string;
+
+ invoice_amount?: UpdateRecurringCommit.InvoiceAmount;
+
+ rate_type?: 'LIST_RATE' | 'COMMIT_RATE';
+ }
+
+ export namespace UpdateRecurringCommit {
+ export interface AccessAmount {
+ quantity?: number;
+
+ unit_price?: number;
+ }
+
+ export interface InvoiceAmount {
+ quantity?: number;
+
+ unit_price?: number;
+ }
+ }
+
+ export interface UpdateRecurringCredit {
+ id: string;
+
+ access_amount?: UpdateRecurringCredit.AccessAmount;
+
+ ending_before?: string;
+
+ rate_type?: 'LIST_RATE' | 'COMMIT_RATE';
+ }
+
+ export namespace UpdateRecurringCredit {
+ export interface AccessAmount {
+ quantity?: number;
+
+ unit_price?: number;
+ }
+ }
+
+ export interface UpdateRefundInvoice {
+ date: string;
+
+ invoice_id: string;
+ }
+
+ export interface UpdateScheduledCharge {
+ id: string;
+
+ invoice_schedule?: UpdateScheduledCharge.InvoiceSchedule;
+
+ name?: string;
+
+ netsuite_sales_order_id?: string | null;
+ }
+
+ export namespace UpdateScheduledCharge {
+ export interface InvoiceSchedule {
+ add_schedule_items?: Array;
+
+ remove_schedule_items?: Array;
+
+ update_schedule_items?: Array;
+ }
+
+ export namespace InvoiceSchedule {
+ export interface AddScheduleItem {
+ timestamp: string;
+
+ amount?: number;
+
+ quantity?: number;
+
+ unit_price?: number;
+ }
+
+ export interface RemoveScheduleItem {
+ id: string;
+ }
+
+ export interface UpdateScheduleItem {
+ id: string;
+
+ amount?: number;
+
+ quantity?: number;
+
+ timestamp?: string;
+
+ unit_price?: number;
+ }
+ }
+ }
+
+ export interface UpdateSpendThresholdConfiguration {
+ commit?: Shared.UpdateBaseThresholdCommit;
+
+ discount_configuration?: UpdateSpendThresholdConfiguration.DiscountConfiguration | null;
+
+ /**
+ * When set to false, the contract will not be evaluated against the
+ * threshold_amount. Toggling to true will result an immediate evaluation,
+ * regardless of prior state.
+ */
+ is_enabled?: boolean;
+
+ payment_gate_config?: Shared.PaymentGateConfigV2;
+
+ /**
+ * Specify the threshold amount for the contract. Each time the contract's usage
+ * hits this amount, a threshold charge will be initiated.
+ */
+ threshold_amount?: number;
+ }
+
+ export namespace UpdateSpendThresholdConfiguration {
+ export interface DiscountConfiguration {
+ /**
+ * Update the discount cap. Set to null to remove an existing cap.
+ */
+ cap?: DiscountConfiguration.Cap | null;
+
+ /**
+ * The fraction of the original amount that the customer pays after applying the
+ * discount. Set to null to remove the discount fraction. For example, 0.85 means
+ * the customer pays 85% of the original amount (a 15% discount).
+ */
+ payment_fraction?: number | null;
+ }
+
+ export namespace DiscountConfiguration {
+ /**
+ * Update the discount cap. Set to null to remove an existing cap.
+ */
+ export interface Cap {
+ /**
+ * Accumulated spend ceiling above which the discount stops applying.
+ */
+ amount: number;
+
+ /**
+ * Alias of the spend tracker this cap is measured against.
+ */
+ spend_tracker_alias: string;
+ }
+ }
+ }
+
+ export interface UpdateSubscription {
+ id: string;
+
+ ending_before?: string;
+
+ quantity_updates?: Array;
+
+ /**
+ * Manage subscription seats for subscriptions in SEAT_BASED mode.
+ */
+ seat_updates?: UpdateSubscription.SeatUpdates;
+ }
+
+ export namespace UpdateSubscription {
+ export interface QuantityUpdate {
+ starting_at: string;
+
+ quantity?: number;
+
+ quantity_delta?: number;
+ }
+
+ /**
+ * Manage subscription seats for subscriptions in SEAT_BASED mode.
+ */
+ export interface SeatUpdates {
+ /**
+ * Adds seat IDs to the subscription. If there are unassigned seats, the new seat
+ * IDs will fill these unassigned seats and not increase the total subscription
+ * quantity. Otherwise, if there are more new seat IDs than unassigned seats, the
+ * total subscription quantity will increase.
+ */
+ add_seat_ids?: Array;
+
+ /**
+ * Adds unassigned seats to the subscription. This will increase the total
+ * subscription quantity.
+ */
+ add_unassigned_seats?: Array;
+
+ /**
+ * Removes seat IDs from the subscription, if possible. If a seat ID is removed,
+ * the total subscription quantity will decrease. Otherwise, if the seat ID is not
+ * found on the subscription, this is a no-op.
+ */
+ remove_seat_ids?: Array;
+
+ /**
+ * Removes unassigned seats from the subscription. This will decrease the total
+ * subscription quantity if there are are unassigned seats.
+ */
+ remove_unassigned_seats?: Array;
+ }
+
+ export namespace SeatUpdates {
+ export interface AddSeatID {
+ seat_ids: Array;
+
+ /**
+ * Assigned seats will be added/removed starting at this date.
+ */
+ starting_at: string;
+ }
+
+ export interface AddUnassignedSeat {
+ /**
+ * The number of unassigned seats on the subscription will increase/decrease by
+ * this delta. Must be greater than 0.
+ */
+ quantity: number;
+
+ /**
+ * Unassigned seats will be updated starting at this date.
+ */
+ starting_at: string;
+ }
+
+ export interface RemoveSeatID {
+ seat_ids: Array;
+
+ /**
+ * Assigned seats will be added/removed starting at this date.
+ */
+ starting_at: string;
+ }
+
+ export interface RemoveUnassignedSeat {
+ /**
+ * The number of unassigned seats on the subscription will increase/decrease by
+ * this delta. Must be greater than 0.
+ */
+ quantity: number;
+
+ /**
+ * Unassigned seats will be updated starting at this date.
+ */
+ starting_at: string;
+ }
+ }
+ }
+ }
+ }
}
export interface ContractEditCommitResponse {
From 6e0081848ce3597bae7c3fa4233afe9361d4abbf Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 28 May 2026 22:08:33 +0000
Subject: [PATCH 17/19] codegen metadata
---
.stats.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index f63b6543..4a56403b 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 115
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome/metronome-a571b8e97d292c366ba49c29d403b79a66e542a194b2b4228e61ac71385b1a23.yml
-openapi_spec_hash: 845b84bc254872c849a13f4b1d5a4383
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome/metronome-2e9de15d900e68e65b1517f829fd06deddce007892b4281bb90202ab90d99496.yml
+openapi_spec_hash: 6b353d77b123b069496eb5429468092f
config_hash: 6bd82f310398d5d47bcfeb8d7ed150b3
From fbc34b0e191832a6259bf811d5698bd691dce0df Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 29 May 2026 18:04:11 +0000
Subject: [PATCH 18/19] codegen metadata
---
.stats.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 4a56403b..a0aad226 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 115
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome/metronome-2e9de15d900e68e65b1517f829fd06deddce007892b4281bb90202ab90d99496.yml
-openapi_spec_hash: 6b353d77b123b069496eb5429468092f
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome/metronome-f12f505faf40d5f25d74c0b5a417e2b36c7f3f9621a0e23acd3d6ec4c615443e.yml
+openapi_spec_hash: 5c1f13896608a69feebd8855703b76df
config_hash: 6bd82f310398d5d47bcfeb8d7ed150b3
From f39825cddf48432f7210dd1fe0b72eda6e152e9b Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 29 May 2026 18:04:42 +0000
Subject: [PATCH 19/19] release: 3.7.0
---
.release-please-manifest.json | 2 +-
CHANGELOG.md | 22 ++++++++++++++++++++++
package.json | 2 +-
packages/mcp-server/manifest.json | 2 +-
packages/mcp-server/package.json | 2 +-
packages/mcp-server/src/server.ts | 2 +-
src/version.ts | 2 +-
7 files changed, 28 insertions(+), 6 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index dc703804..2a266f81 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "3.6.0"
+ ".": "3.7.0"
}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 96a43156..01b857f4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,27 @@
# Changelog
+## 3.7.0 (2026-05-29)
+
+Full Changelog: [v3.6.0...v3.7.0](https://github.com/Metronome-Industries/metronome-node/compare/v3.6.0...v3.7.0)
+
+### Features
+
+* [LAUNCH-2814] editContract returns full edit in the response ([197a27a](https://github.com/Metronome-Industries/metronome-node/commit/197a27ad6de47af9b3c725ec79f296e567238f41))
+* [orch-1860] remove all deprecated `/payments/*` endpoints from API ([03d2179](https://github.com/Metronome-Industries/metronome-node/commit/03d217925dad440f11f078606bd6387ed97371cb))
+* create contract returns contract data ([b6530d4](https://github.com/Metronome-Industries/metronome-node/commit/b6530d4c04ad0aebca11493212cf952f9a07b51d))
+* nikku-orch-1723-update-create-contract ([fc920c3](https://github.com/Metronome-Industries/metronome-node/commit/fc920c36a4cb7262cf70ae3b895b4e129b4a2f8b))
+
+
+### Bug Fixes
+
+* **mcp:** use `pure-lockfile` when building mcp server ([df0ff5b](https://github.com/Metronome-Industries/metronome-node/commit/df0ff5b4c9e7591145369af6a2b862fc4f0d3fb3))
+* **typescript:** upgrade tsc-multi so that it works with Node 26 ([ed31463](https://github.com/Metronome-Industries/metronome-node/commit/ed314636e08ca6002585211a9814bb60522fc614))
+
+
+### Chores
+
+* (internal) Add threshold balance specifier to contract create & edit, package create and both contract and package retrievals ([07eb0fe](https://github.com/Metronome-Industries/metronome-node/commit/07eb0fe97fee540544e5ce3b68109a3345c13854))
+
## 3.6.0 (2026-05-18)
Full Changelog: [v3.5.0...v3.6.0](https://github.com/Metronome-Industries/metronome-node/compare/v3.5.0...v3.6.0)
diff --git a/package.json b/package.json
index 32ab4337..6eee1dac 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@metronome/sdk",
- "version": "3.6.0",
+ "version": "3.7.0",
"description": "The official TypeScript library for the Metronome API",
"author": "Metronome ",
"types": "dist/index.d.ts",
diff --git a/packages/mcp-server/manifest.json b/packages/mcp-server/manifest.json
index d4ef8874..8c3b30c0 100644
--- a/packages/mcp-server/manifest.json
+++ b/packages/mcp-server/manifest.json
@@ -1,7 +1,7 @@
{
"dxt_version": "0.2",
"name": "@metronome/mcp",
- "version": "3.6.0",
+ "version": "3.7.0",
"description": "The official MCP Server for the Metronome API",
"author": {
"name": "Metronome",
diff --git a/packages/mcp-server/package.json b/packages/mcp-server/package.json
index 07b9adf8..2b9f868a 100644
--- a/packages/mcp-server/package.json
+++ b/packages/mcp-server/package.json
@@ -1,6 +1,6 @@
{
"name": "@metronome/mcp",
- "version": "3.6.0",
+ "version": "3.7.0",
"description": "The official MCP Server for the Metronome API",
"author": "Metronome ",
"types": "dist/index.d.ts",
diff --git a/packages/mcp-server/src/server.ts b/packages/mcp-server/src/server.ts
index d5bf7a0a..0259b69f 100644
--- a/packages/mcp-server/src/server.ts
+++ b/packages/mcp-server/src/server.ts
@@ -28,7 +28,7 @@ export const newMcpServer = async ({
new McpServer(
{
name: 'metronome_sdk_api',
- version: '3.6.0',
+ version: '3.7.0',
},
{
instructions: await getInstructions({ stainlessApiKey, customInstructionsPath }),
diff --git a/src/version.ts b/src/version.ts
index 73e38377..dd90c738 100644
--- a/src/version.ts
+++ b/src/version.ts
@@ -1 +1 @@
-export const VERSION = '3.6.0'; // x-release-please-version
+export const VERSION = '3.7.0'; // x-release-please-version