Metronome Contracts API

A contract defines a customer’s products, pricing, discounts, commitments, and more. Use these endpoints to create and update contracts data.

OpenAPI Specification

metronome-contracts-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Metronome Alerts Contracts API
  version: 1.0.0
  description: '[Alerts](https://docs.metronome.com/connecting-metronome/alerts/) monitor customer spending, balances, and other billing factors. Use these endpoints to create, retrieve, and archive customer alerts. To view sample alert payloads by alert type, navigate [here.](https://docs.metronome.com/manage-product-access/create-manage-alerts/#webhook-notifications)'
servers:
- url: https://api.metronome.com
  description: Production server
security:
- bearerAuth: []
tags:
- name: Contracts
  description: A contract defines a customer’s products, pricing, discounts, commitments, and more. Use these endpoints to create and update contracts data.
paths:
  /v1/contracts/get:
    post:
      description: 'This is the v1 endpoint to get a contract. New clients should implement using the v2 endpoint.

        '
      operationId: getContract-v1
      summary: Get a contract (v1)
      tags:
      - Contracts
      requestBody:
        description: Contract and customer IDs
        content:
          application/json:
            schema:
              type: object
              required:
              - customer_id
              - contract_id
              properties:
                customer_id:
                  type: string
                  format: uuid
                contract_id:
                  type: string
                  format: uuid
                include_ledgers:
                  type: boolean
                  description: Include commit ledgers in the response. Setting this flag may cause the query to be slower.
                include_balance:
                  type: boolean
                  description: Include the balance of credits and commits in the response. Setting this flag may cause the query to be slower.
            example:
              customer_id: 13117714-3f05-48e5-a6e9-a66093f13b4d
              contract_id: d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                required:
                - data
                properties:
                  data:
                    $ref: '#/components/schemas/Contract'
              example:
                data:
                  id: d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc
                  customer_id: e3fd63fd-fc9f-4153-a543-1fc2261a0e1c
                  initial:
                    name: My contract
                    rate_card_id: 92f3080d-27ca-4306-a23f-2430de61851e
                    starting_at: '2020-01-01T00:00:00.000Z'
                    net_payment_terms_days: 7
                    ending_before: '2022-01-01T00:00:00.000Z'
                    commits:
                    - id: 62c0cb84-bf3f-48b9-9bcf-a8ddf8c1cf35
                      type: PREPAID
                      name: My test commit
                      description: My test commit description
                      product:
                        id: 2e30f074-d04c-412e-a134-851ebfa5ceb2
                        name: My product A
                      rollover_fraction: 0.1
                      applicable_product_ids:
                      - 13a2179b-f0cb-460b-85a1-cd42964ca533
                      access_schedule:
                        credit_type:
                          id: 2714e483-4ff1-48e4-9e25-ac732e8f24f2
                          name: USD (cents)
                        schedule_items:
                        - id: 2d45952c-5a6e-43a9-8aab-f61ee21be81a
                          amount: 10000000
                          starting_at: '2020-02-01T00:00:00.000Z'
                          ending_before: '2021-02-01T00:00:00.000Z'
                      invoice_schedule:
                        credit_type:
                          id: 2714e483-4ff1-48e4-9e25-ac732e8f24f2
                          name: USD (cents)
                        schedule_items:
                        - id: f15e4e23-f74e-4de4-9b3a-8b07434116c4
                          invoice_id: 525b9759-7bbd-4a05-aab1-d7c43c976b57
                          amount: 10000000
                          unit_price: 10000000
                          quantity: 1
                          timestamp: '2020-03-01T00:00:00.000Z'
                        do_not_invoice: false
                      ledger:
                      - invoice_id: 525b9759-7bbd-4a05-aab1-d7c43c976b57
                        amount: 10000000
                        timestamp: '2020-03-01T00:00:00.000Z'
                        type: PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION
                        segment_id: 2d45952c-5a6e-43a9-8aab-f61ee21be81a
                      created_at: '2020-01-01T00:00:00.000Z'
                    overrides:
                    - id: 6cf3292a-e85c-4be6-822c-e25ba9d19757
                      created_at: '2020-01-01T00:00:00.000Z'
                      product:
                        id: eae8903b-693b-41a7-8c0b-f23748c9a9c8
                        name: My product B
                      starting_at: '2020-01-01T00:00:00.000Z'
                      type: MULTIPLIER
                      multiplier: 0.1
                    scheduled_charges: []
                    scheduled_charges_on_usage_invoices: ALL
                    transitions:
                    - type: RENEWAL
                      from_contract_id: 9bf48856-b430-42f4-844f-4d2ea85bcff8
                      to_contract_id: d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc
                    reseller_royalties: []
                    usage_statement_schedule:
                      frequency: MONTHLY
                      billing_anchor_date: '2020-01-01T00:00:00.000Z'
                    created_at: '2019-12-31T14:23:55.234Z'
                    created_by: Alice
                  current:
                    rate_card_id: 92f3080d-27ca-4306-a23f-2430de61851e
                    starting_at: '2020-01-01T00:00:00.000Z'
                    net_payment_terms_days: 7
                    ending_before: '2022-01-01T00:00:00.000Z'
                    commits:
                    - id: 62c0cb84-bf3f-48b9-9bcf-a8ddf8c1cf35
                      type: PREPAID
                      name: My test commit
                      description: My test commit description
                      product:
                        id: 2e30f074-d04c-412e-a134-851ebfa5ceb2
                        name: My product A
                      rollover_fraction: 0.1
                      applicable_product_ids:
                      - 13a2179b-f0cb-460b-85a1-cd42964ca533
                      access_schedule:
                        credit_type:
                          id: 2714e483-4ff1-48e4-9e25-ac732e8f24f2
                          name: USD (cents)
                        schedule_items:
                        - id: 2d45952c-5a6e-43a9-8aab-f61ee21be81a
                          amount: 10000000
                          starting_at: '2020-02-01T00:00:00.000Z'
                          ending_before: '2021-02-01T00:00:00.000Z'
                      invoice_schedule:
                        credit_type:
                          id: 2714e483-4ff1-48e4-9e25-ac732e8f24f2
                          name: USD (cents)
                        schedule_items:
                        - id: f15e4e23-f74e-4de4-9b3a-8b07434116c4
                          invoice_id: 525b9759-7bbd-4a05-aab1-d7c43c976b57
                          amount: 10000000
                          unit_price: 10000000
                          quantity: 1
                          timestamp: '2020-03-01T00:00:00.000Z'
                        do_not_invoice: false
                      created_at: '2020-01-01T00:00:00.000Z'
                    overrides:
                    - id: 6cf3292a-e85c-4be6-822c-e25ba9d19757
                      created_at: '2020-01-01T00:00:00.000Z'
                      product:
                        id: eae8903b-693b-41a7-8c0b-f23748c9a9c8
                        name: My product B
                      starting_at: '2020-01-01T00:00:00.000Z'
                      type: MULTIPLIER
                      multiplier: 0.1
                    scheduled_charges:
                    - id: 8e511ff1-3fd5-4d86-bc89-1e80239874bf
                      name: My test scheduled charge
                      product:
                        id: 2e30f074-d04c-412e-a134-851ebfa5ceb2
                        name: My product A
                      schedule:
                        schedule_items:
                        - id: 6ca40ebc-9c01-484e-a64e-4e47fbbd0ebe
                          invoice_id: 5cced82b-5464-41b4-9ea7-3e080e0a4dba
                          amount: 1000000
                          unit_price: 1000000
                          quantity: 1
                          timestamp: '2020-02-15T00:00:00.000Z'
                    scheduled_charges_on_usage_invoices: ALL
                    transitions:
                    - type: RENEWAL
                      from_contract_id: 9bf48856-b430-42f4-844f-4d2ea85bcff8
                      to_contract_id: d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc
                    reseller_royalties: []
                    usage_statement_schedule:
                      frequency: MONTHLY
                      billing_anchor_date: '2020-01-01T00:00:00.000Z'
                    created_at: '2019-12-31T14:23:55.234Z'
                    created_by: Alice
                  amendments:
                  - id: 4e2fab26-31ea-473c-b07d-1ce10e7c0146
                    starting_at: '2020-04-01T00:00:00.000Z'
                    scheduled_charges:
                    - id: 8e511ff1-3fd5-4d86-bc89-1e80239874bf
                      name: My test scheduled charge
                      product:
                        id: 2e30f074-d04c-412e-a134-851ebfa5ceb2
                        name: My product A
                      schedule:
                        schedule_items:
                        - id: 6ca40ebc-9c01-484e-a64e-4e47fbbd0ebe
                          invoice_id: 5cced82b-5464-41b4-9ea7-3e080e0a4dba
                          amount: 1000000
                          unit_price: 1000000
                          quantity: 1
                          timestamp: '2020-02-15T00:00:00.000Z'
                    commits: []
                    overrides: []
                    created_at: '2019-12-31T16:12:45.123Z'
                    created_by: Bob
                  custom_fields:
                    x_account_id: KyVnHhSBWl7eY2bl
        '404':
          $ref: '#/components/responses/NotFound'
  /v1/contracts/list:
    post:
      description: "Retrieves 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"
      operationId: listContracts-v1
      summary: List customer contracts (v1)
      tags:
      - Contracts
      requestBody:
        description: List all contracts for a customer
        content:
          application/json:
            schema:
              type: object
              required:
              - customer_id
              properties:
                customer_id:
                  type: string
                  format: uuid
                include_ledgers:
                  type: boolean
                  description: Include commit ledgers in the response. Setting this flag may cause the query to be slower.
                include_balance:
                  type: boolean
                  description: Include the balance of credits and commits in the response. Setting this flag may cause the query to be slower.
                include_archived:
                  type: boolean
                  description: Include archived contracts in the response
                starting_at:
                  description: 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.
                  type: string
                  format: date-time
                covering_date:
                  type: string
                  format: date-time
                  description: 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.
            example:
              customer_id: 9b85c1c1-5238-4f2a-a409-61412905e1e1
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                required:
                - data
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Contract'
              example:
                data:
                - id: d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc
                  customer_id: e3fd63fd-fc9f-4153-a543-1fc2261a0e1c
                  initial:
                    name: My contract
                    rate_card_id: 92f3080d-27ca-4306-a23f-2430de61851e
                    starting_at: '2020-01-01T00:00:00.000Z'
                    net_payment_terms_days: 7
                    ending_before: '2022-01-01T00:00:00.000Z'
                    commits:
                    - id: 62c0cb84-bf3f-48b9-9bcf-a8ddf8c1cf35
                      type: PREPAID
                      name: My test commit
                      description: My test commit description
                      product:
                        id: 2e30f074-d04c-412e-a134-851ebfa5ceb2
                        name: My product A
                      rollover_fraction: 0.1
                      applicable_product_ids:
                      - 13a2179b-f0cb-460b-85a1-cd42964ca533
                      access_schedule:
                        credit_type:
                          id: 2714e483-4ff1-48e4-9e25-ac732e8f24f2
                          name: USD (cents)
                        schedule_items:
                        - id: 2d45952c-5a6e-43a9-8aab-f61ee21be81a
                          amount: 10000000
                          starting_at: '2020-02-01T00:00:00.000Z'
                          ending_before: '2021-02-01T00:00:00.000Z'
                      invoice_schedule:
                        credit_type:
                          id: 2714e483-4ff1-48e4-9e25-ac732e8f24f2
                          name: USD (cents)
                        schedule_items:
                        - id: f15e4e23-f74e-4de4-9b3a-8b07434116c4
                          invoice_id: 525b9759-7bbd-4a05-aab1-d7c43c976b57
                          amount: 10000000
                          unit_price: 10000000
                          quantity: 1
                          timestamp: '2020-03-01T00:00:00.000Z'
                        do_not_invoice: false
                      ledger:
                      - invoice_id: 525b9759-7bbd-4a05-aab1-d7c43c976b57
                        amount: 10000000
                        timestamp: '2020-03-01T00:00:00.000Z'
                        type: PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION
                        segment_id: 2d45952c-5a6e-43a9-8aab-f61ee21be81a
                      created_at: '2020-01-01T00:00:00.000Z'
                    overrides:
                    - id: 6cf3292a-e85c-4be6-822c-e25ba9d19757
                      created_at: '2020-01-01T00:00:00.000Z'
                      product:
                        id: eae8903b-693b-41a7-8c0b-f23748c9a9c8
                        name: My product B
                      starting_at: '2020-01-01T00:00:00.000Z'
                      type: MULTIPLIER
                      multiplier: 0.1
                    scheduled_charges: []
                    scheduled_charges_on_usage_invoices: ALL
                    transitions:
                    - type: RENEWAL
                      from_contract_id: 9bf48856-b430-42f4-844f-4d2ea85bcff8
                      to_contract_id: d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc
                    reseller_royalties: []
                    usage_statement_schedule:
                      frequency: MONTHLY
                      billing_anchor_date: '2020-01-01T00:00:00.000Z'
                    created_at: '2019-12-31T14:23:55.234Z'
                    created_by: Alice
                  current:
                    rate_card_id: 92f3080d-27ca-4306-a23f-2430de61851e
                    starting_at: '2020-01-01T00:00:00.000Z'
                    net_payment_terms_days: 7
                    ending_before: '2022-01-01T00:00:00.000Z'
                    commits:
                    - id: 62c0cb84-bf3f-48b9-9bcf-a8ddf8c1cf35
                      type: PREPAID
                      name: My test commit
                      description: My test commit description
                      product:
                        id: 2e30f074-d04c-412e-a134-851ebfa5ceb2
                        name: My product A
                      rollover_fraction: 0.1
                      applicable_product_ids:
                      - 13a2179b-f0cb-460b-85a1-cd42964ca533
                      access_schedule:
                        credit_type:
                          id: 2714e483-4ff1-48e4-9e25-ac732e8f24f2
                          name: USD (cents)
                        schedule_items:
                        - id: 2d45952c-5a6e-43a9-8aab-f61ee21be81a
                          amount: 10000000
                          starting_at: '2020-02-01T00:00:00.000Z'
                          ending_before: '2021-02-01T00:00:00.000Z'
                      invoice_schedule:
                        credit_type:
                          id: 2714e483-4ff1-48e4-9e25-ac732e8f24f2
                          name: USD (cents)
                        schedule_items:
                        - id: f15e4e23-f74e-4de4-9b3a-8b07434116c4
                          invoice_id: 525b9759-7bbd-4a05-aab1-d7c43c976b57
                          amount: 10000000
                          unit_price: 10000000
                          quantity: 1
                          timestamp: '2020-03-01T00:00:00.000Z'
                        do_not_invoice: false
                      created_at: '2020-01-01T00:00:00.000Z'
                    overrides:
                    - id: 6cf3292a-e85c-4be6-822c-e25ba9d19757
                      created_at: '2020-01-01T00:00:00.000Z'
                      product:
                        id: eae8903b-693b-41a7-8c0b-f23748c9a9c8
                        name: My product B
                      starting_at: '2020-01-01T00:00:00.000Z'
                      type: MULTIPLIER
                      multiplier: 0.1
                    scheduled_charges:
                    - id: 8e511ff1-3fd5-4d86-bc89-1e80239874bf
                      name: My test scheduled charge
                      product:
                        id: 2e30f074-d04c-412e-a134-851ebfa5ceb2
                        name: My product A
                      schedule:
                        schedule_items:
                        - id: 6ca40ebc-9c01-484e-a64e-4e47fbbd0ebe
                          invoice_id: 5cced82b-5464-41b4-9ea7-3e080e0a4dba
                          amount: 1000000
                          unit_price: 1000000
                          quantity: 1
                          timestamp: '2020-02-15T00:00:00.000Z'
                    scheduled_charges_on_usage_invoices: ALL
                    transitions:
                    - type: RENEWAL
                      from_contract_id: 9bf48856-b430-42f4-844f-4d2ea85bcff8
                      to_contract_id: d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc
                    reseller_royalties: []
                    usage_statement_schedule:
                      frequency: MONTHLY
                      billing_anchor_date: '2020-01-01T00:00:00.000Z'
                    created_at: '2019-12-31T14:23:55.234Z'
                    created_by: Alice
                  amendments:
                  - id: 4e2fab26-31ea-473c-b07d-1ce10e7c0146
                    starting_at: '2020-04-01T00:00:00.000Z'
                    scheduled_charges:
                    - id: 8e511ff1-3fd5-4d86-bc89-1e80239874bf
                      name: My test scheduled charge
                      product:
                        id: 2e30f074-d04c-412e-a134-851ebfa5ceb2
                        name: My product A
                      schedule:
                        schedule_items:
                        - id: 6ca40ebc-9c01-484e-a64e-4e47fbbd0ebe
                          invoice_id: 5cced82b-5464-41b4-9ea7-3e080e0a4dba
                          amount: 1000000
                          unit_price: 1000000
                          quantity: 1
                          timestamp: '2020-02-15T00:00:00.000Z'
                    commits: []
                    overrides: []
                    created_at: '2019-12-31T16:12:45.123Z'
                    created_by: Bob
                  custom_fields:
                    x_account_id: KyVnHhSBWl7eY2bl
        '404':
          $ref: '#/components/responses/NotFound'
  /v1/contracts/create:
    post:
      description: 'Contracts 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 customers access to your products and services directly from your product or CRM.


        ### Use this endpoint to:

        - PLG onboarding: Automatically provision new self-serve customers with contracts when they sign up.

        - Enterprise sales: Push negotiated contracts from Salesforce with custom pricing and commitments

        - Promotional pricing: Implement time-limited discounts and free trials through overrides


        ### Key components:

        #### Contract Term and Billing Schedule

        - 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.


        #### Rate Card

        If 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.

        Read more about [Rate Cards](https://docs.metronome.com/pricing-packaging/create-manage-rate-cards/).


        #### Overrides and discounts

        Customize pricing on the contract through time-bounded overrides that can target specific products, product families, or complex usage scenarios. Overrides enable two key capabilities:

        - Discounts: Apply percentage discounts, fixed rate reductions, or quantity-based pricing tiers

        - Entitlements: Provide special pricing or access to specific products for negotiated deals


        Read more about [Contract Overrides](https://docs.metronome.com/manage-product-access/add-contract-override/).


        #### Commits and Credits

        Using 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.


        In 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`.


        These objects can also also be configured to have a recurrence schedule to easily model customer packaging which includes recurring monthly or quarterly allotments.


        Commits support rollover settings (`rollover_fraction`) to transfer unused balances between contract periods, either entirely or as a percentage.


        Read more about [Credits and Commits](https://docs.metronome.com/pricing-packaging/apply-credits-commits/).


        #### Subscriptions

        You 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:

        - Define whether the subscription is paid for in-advance or in-arrears (`collection_schedule`)

        - Define the proration behavior (`proration`)

        - Specify an initial quantity (`initial_quantity`)

        - Define which subscription rate on the rate card should be used (`subscription_rate`)


        Read more about [Subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/).


        #### Scheduled Charges

        Set 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.


        #### Threshold Billing

        Metronome 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`.


        Read 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/).


        ### Usage guidelines:

        - 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.

        - 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).

        '
      operationId: createContract-v1
      summary: Create a contract
      tags:
      - Contracts
      requestBody:
        description: Create a new contract
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateContractPayload'
            example:
              customer_id: 13117714-3f05-48e5-a6e9-a66093f13b4d
              rate_card_id: d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc
              starting_at: '2020-01-01T00:00:00.000Z'
              billing_provider_configuration:
                billing_provider: stripe
                delivery_method: direct_to_billing_provider
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                required:
                - data
                properties:
                  data:
                    $ref: '#/components/schemas/Id'
              example:
                data:
                  id: d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          $ref: '#/components/responses/NotFound'
  /v1/contracts/amend:
    post:
      description: 'Amendments 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.

        '
      operationId: amendContract-v1
      summary: Amend a contract
      tags:
      - Contracts
      requestBody:
        description: Amend a contract
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AmendContractPayload'
            example:
              customer_id: 13117714-3f05-48e5-a6e9-a66093f13b4d
              contract_id: d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc
              starting_at: '2020-01-01T00:00:00.000Z'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                required:
                - data
                properties:
                  data:
                    $ref: '#/components/schemas/Id'
              example:
                data:
                  id: d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          $ref: '#/components/responses/NotFound'
  /v1/contracts/archive:
    post:
      description: "Permanently end and archive a contract along with all its terms. Any draft invoices will be canceled, and all upcoming scheduled invoices will be voided–also all finalized invoices can optionally be voided. Use this in the event a contract was incorrectly created and needed to be removed from a customer.\n\n#### Impact on commits and credits:\nWhen archiving a contract, all associated commits and credits are also archived. For prepaid commits with active segments, Metronome automatically generates expiration ledger entries to close out any remaining balances, ensuring accurate accounting of unused prepaid amounts. These ledger entries will appear in the commit's transaction history with type `PREPAID_COMMIT_EXPIRATION`.\n\n#### Archived contract visibility: \nArchived contracts remain accessible for historical reporting and audit purposes. They can be retrieved using the `ListContracts` endpoint by setting the `include_archived` parameter to `true` or in the Metronome UI when the \"Show archived\" option is enabled.\n"
      operationId: archiveContract-v1
      summary: Archive a contract
      tags:
      - Contracts
      requestBody:
        description: "Permanently end and archive a contract along with all its terms. Any draft invoices will be canceled, and all upcoming scheduled invoices will be voided–also all finalized invoices can optionally be voided. Use this in the event a contract was incorrectly created and needed to be removed from a customer.\n\nImpact on commits and credits: \nWhen archiving a contract, all associated commits and credits are also archived. For prepaid commits with active segments, Metronome automatically generates expiration ledger entries to close out any remaining balances, ensuring accurate accounting of unused prepaid amounts. These ledger entries will appear in the commit's transaction history with type PREPAID_COMMIT_EXPIRATION.\n\nArchived contract visibility: \nArchived contracts remain accessible for historical reporting and audit purposes. They can be retrieved using the `ListContracts` endpoint by setting the `include_archived` parameter to `true` or in the Metronome UI when the \"Show archived\" option is enabled.\n"
        content:
          application/js

# --- truncated at 32 KB (392 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/metronome/refs/heads/main/openapi/metronome-contracts-api-openapi.yml