---
title: "Creates a contract"
method: POST
path: "/contracts"
tags: ["Contracts"]
---

# Creates a contract

`POST /contracts`

Rillet supports two contract scope types: FULL and REVENUE_RECOGNITION_ONLY. The selected scope determines how the invoices are created and what information the user needs to provide.

The FULL scope is used when contract invoices are generated and sent directly from Rillet. In this case, Rillet automatically assigns the invoice numbers.

The REVENUE_RECOGNITION_ONLY scope is intended for situations where contracts and invoices are issued from another system and only need to be recorded in Rillet for accounting purposes. In this workflow, users must provide the invoice numbers manually. Other fields can be populated based on the data imported from the external system.

For example, if your organization issues invoices through an external billing platform but tracks financials in Rillet, you should select REVENUE_RECOGNITION_ONLY. If Rillet handles the entire invoicing and sending process, choose the FULL scope.

## Request body

- union
  - object
    - `name` string, required
    - `close_date` string, date, required
    - `start_date` string, date, required
    - `end_date` string, date
    - `items` ContractItemRequest[], required
      - `product_id` string, uuid, required
      - `price` union, required
        - FixedRecurringPrice
          - `amount` MonetaryAmount, required
            - `amount` string, required — Monetary amount in decimal format, using a period (.) as the decimal separator. (e.g. '1.01' in $ currency represents 1$ and 1 cent.)
            - `currency` string, required — Currency code following ISO-4217
          - `interval_months` integer, required
          - `type` string, required
        - OneTimePrice
          - `amount` MonetaryAmount, required
            - `amount` string, required — Monetary amount in decimal format, using a period (.) as the decimal separator. (e.g. '1.01' in $ currency represents 1$ and 1 cent.)
            - `currency` string, required — Currency code following ISO-4217
          - `type` string, required
        - UsagePrice
          - `interval_months` integer, required
          - `type` string, required
          - `billing_scheme` union, required
            - PerUnitBilling
              - …
            - TieredBilling — All tiers except for the highest have to define a value for upTo. There cannot be more than one tier with the same upTo value.
              - …
      - `quantity` number, required
      - `revenue_pattern` 'DAILY' | 'EVEN_PERIOD', required — DAILY means that the revenue is divided equally per day in the revenue period. EVEN_PERIOD means that the revenue is divided equally for each calendar month in the revenue period.
      - `discount` union
        - AmountDiscount
          - `amount_off` RoundedMonetaryAmount, required — A monetary amount that must be rounded to the currency's default decimal places (e.g., 2 decimal places for USD).
            - `amount` string, required — Monetary amount in decimal format, using a period (.) as the decimal separator. Must be rounded to the currency's default decimal places (e.g. '1.01' in USD represents 1 dollar and 1 cent).
            - `currency` string, required — Currency code following ISO-4217
          - `type` string
        - PercentageDiscount
          - `percentage_off` number, double, required
          - `type` string
      - `tax_rate` TaxRateWithOptionalAmount
        - `percentage` number, required
        - `tax_amount` RoundedMonetaryAmount — A monetary amount that must be rounded to the currency's default decimal places (e.g., 2 decimal places for USD).
          - `amount` string, required — Monetary amount in decimal format, using a period (.) as the decimal separator. Must be rounded to the currency's default decimal places (e.g. '1.01' in USD represents 1 dollar and 1 cent).
          - `currency` string, required — Currency code following ISO-4217
        - `country` string, required — Two-letter country code (ISO 3166-1 alpha-2).
        - `type` 'VAT' | 'SALES_TAX', required
        - `description` string, required
      - `start_date` string, date — Defaults to the contract start date.
      - `end_date` string, date — Defaults to the contract end date.
      - `external_reference` ExternalReference — For requests, only pre-defined custom IDs are accepted. In responses, an object imported through an integration (e.g. Stripe) would return the provider's object ID.
        - `type` string, required
        - `id` string, required
        - `url` string, uri
      - `fields` object[]
        - `field_id` string, uuid, required
        - `field_value_id` string, uuid, required
      - `usage_minimum_commitment` UsageCommitment
        - `amount` RoundedMonetaryAmount, required — A monetary amount that must be rounded to the currency's default decimal places (e.g., 2 decimal places for USD).
          - `amount` string, required — Monetary amount in decimal format, using a period (.) as the decimal separator. Must be rounded to the currency's default decimal places (e.g. '1.01' in USD represents 1 dollar and 1 cent).
          - `currency` string, required — Currency code following ISO-4217
        - `revenue_account` string, required — The account code found in the Chart of Accounts
    - `invoicing` union
      - MonthlyInvoicing
        - `payment_terms` integer, required
        - `interval` string, required
        - `day` integer, required
      - MonthlyProratedInvoicing — Monthly prorated invoicing is only available for contracts with usage products and a minimum usage commitment.
        - `payment_terms` integer, required
        - `interval` string, required
        - `day` integer, required
      - QuarterlyInvoicing
        - `payment_terms` integer, required
        - `interval` string, required
        - `month_day` string, required — A string in --MM-dd format. Invoices will be created starting on that date and every 3 months.
      - SemiAnnualInvoicing
        - `payment_terms` integer, required
        - `interval` string, required
        - `month_day` string, required — A string in --MM-dd format. Invoices will be created starting on that date and every 6 months.
      - YearlyInvoicing
        - `payment_terms` integer, required
        - `interval` string, required
        - `month_day` string, required — A string in --MM-dd format
    - `usage_configuration` UsageConfiguration
      - `usage_invoicing` UsageInvoicing, required
        - `frequency` 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'YEARLY', required
        - `payment_terms` integer, required
        - `invoice_date` 'FIRST_DAY_OF_NEXT_CYCLE' | 'LAST_DAY_OF_CURRENT_CYCLE', required — When the usage invoice is created in relation to the usage cycle.
        - `cycle` 'CALENDAR' | 'SUBSCRIPTION_ANNIVERSARY', required — When does the invoicing pricing cycle reset and results in an invoice. Calendar option is only allowed when usage invoice frequency is Monthly, and contract does not start on the 1st of the Month.
      - `minimum_commitment_invoicing` MinimumCommitmentInvoicing
        - `frequency` 'MONTHLY' | 'MONTHLY_PRORATED' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'YEARLY', required — MONTHLY_PRORATED is only available for CALENDAR usage invoice cycle. It need to be the same as contract level invoicing frequency.
        - `payment_terms` integer, required
      - `minimum_commitment_cycle` 'MONTHLY' | 'CONTRACT' — Determines how often does the minimum commitment reset.
      - `contract_level_minimum_commitment` UsageCommitment
        - `amount` RoundedMonetaryAmount, required — A monetary amount that must be rounded to the currency's default decimal places (e.g., 2 decimal places for USD).
          - `amount` string, required — Monetary amount in decimal format, using a period (.) as the decimal separator. Must be rounded to the currency's default decimal places (e.g. '1.01' in USD represents 1 dollar and 1 cent).
          - `currency` string, required — Currency code following ISO-4217
        - `revenue_account` string, required — The account code found in the Chart of Accounts
    - `external_references` ExternalReference[]
      - `type` string, required
      - `id` string, required
      - `url` string, uri
    - `customer_id` string, uuid, required
    - `subsidiary_id` string, uuid
    - `exchange_rate` ExchangeRate
      - `base` string, required — Currency code following ISO-4217
      - `target` string, required — Currency code following ISO-4217
      - `rate` string, required
      - `date` string, date, required
    - `scope` 'FULL' | 'REVENUE_RECOGNITION_ONLY', required — The "FULL" scope includes revenue recognition and invoicing handled in Rillet. With the "REVENUE_RECOGNITION_ONLY" scope, invoicing is handled outside Rillet.
  - object
    - `name` string, required
    - `close_date` string, date — Defaults to the start date if not provided.
    - `start_date` string, date, required
    - `end_date` string, date
    - `items` RevenueRecognitionOnlyContractItemRequest[], required
      - `product_id` string, uuid, required
      - `price` MonetaryAmount, required
        - `amount` string, required — Monetary amount in decimal format, using a period (.) as the decimal separator. (e.g. '1.01' in $ currency represents 1$ and 1 cent.)
        - `currency` string, required — Currency code following ISO-4217
      - `discount` union
        - AmountDiscount
          - `amount_off` RoundedMonetaryAmount, required — A monetary amount that must be rounded to the currency's default decimal places (e.g., 2 decimal places for USD).
            - `amount` string, required — Monetary amount in decimal format, using a period (.) as the decimal separator. Must be rounded to the currency's default decimal places (e.g. '1.01' in USD represents 1 dollar and 1 cent).
            - `currency` string, required — Currency code following ISO-4217
          - `type` string
        - PercentageDiscount
          - `percentage_off` number, double, required
          - `type` string
      - `revenue_pattern` 'DAILY' | 'EVEN_PERIOD', required — DAILY means that the revenue is divided equally per day in the revenue period. EVEN_PERIOD means that the revenue is divided equally for each calendar month in the revenue period.
      - `start_date` string, date — Defaults to the contract start date.
      - `end_date` string, date — Defaults to the contract end date.
      - `external_reference` ExternalReference, required — For requests, only pre-defined custom IDs are accepted. In responses, an object imported through an integration (e.g. Stripe) would return the provider's object ID.
        - `type` string, required
        - `id` string, required
        - `url` string, uri
    - `invoice_schedule` InvoiceSchedule, required
      - `invoices` InvoiceScheduleInvoice[]
        - `due_date` string, date — Defaults to invoice_date, if not provided
        - `invoice_date` string, date, required
        - `invoice_number` string, required
        - `tax_amount` RoundedMonetaryAmount — A monetary amount that must be rounded to the currency's default decimal places (e.g., 2 decimal places for USD).
          - `amount` string, required — Monetary amount in decimal format, using a period (.) as the decimal separator. Must be rounded to the currency's default decimal places (e.g. '1.01' in USD represents 1 dollar and 1 cent).
          - `currency` string, required — Currency code following ISO-4217
        - `items` InvoiceScheduleInvoiceItem[], required
          - `description` string, required
          - `contract_item_reference` string, required — Refers to the ID of the contract item's external_reference.
          - `quantity` number, required
          - `total_amount` RoundedMonetaryAmount, required — A monetary amount that must be rounded to the currency's default decimal places (e.g., 2 decimal places for USD).
            - `amount` string, required — Monetary amount in decimal format, using a period (.) as the decimal separator. Must be rounded to the currency's default decimal places (e.g. '1.01' in USD represents 1 dollar and 1 cent).
            - `currency` string, required — Currency code following ISO-4217
          - `tax_amount` RoundedMonetaryAmount — A monetary amount that must be rounded to the currency's default decimal places (e.g., 2 decimal places for USD).
            - `amount` string, required — Monetary amount in decimal format, using a period (.) as the decimal separator. Must be rounded to the currency's default decimal places (e.g. '1.01' in USD represents 1 dollar and 1 cent).
            - `currency` string, required — Currency code following ISO-4217
          - `discount_amount` RoundedMonetaryAmount — A monetary amount that must be rounded to the currency's default decimal places (e.g., 2 decimal places for USD).
            - `amount` string, required — Monetary amount in decimal format, using a period (.) as the decimal separator. Must be rounded to the currency's default decimal places (e.g. '1.01' in USD represents 1 dollar and 1 cent).
            - `currency` string, required — Currency code following ISO-4217
          - `external_references` ExternalReference[], required
            - `type` string, required
            - `id` string, required
            - `url` string, uri
        - `external_references` ExternalReference[], required
          - `type` string, required
          - `id` string, required
          - `url` string, uri
    - `external_references` ExternalReference[], required
      - `type` string, required
      - `id` string, required
      - `url` string, uri
    - `customer_id` string, uuid, required
    - `subsidiary_id` string, uuid
    - `scope` 'FULL' | 'REVENUE_RECOGNITION_ONLY', required — The "FULL" scope includes revenue recognition and invoicing handled in Rillet. With the "REVENUE_RECOGNITION_ONLY" scope, invoicing is handled outside Rillet.

## Response `200`

OK

- ExpandedContract
  - `id` string, uuid, required
  - `customer_id` string, uuid, required
  - `subsidiary_id` string, uuid, required
  - `name` string, required
  - `items` ContractItem[], required
    - `id` string, uuid, required
    - `product_id` string, uuid, required
    - `price` union, required
      - FixedRecurringPrice
        - `amount` MonetaryAmount, required
          - `amount` string, required — Monetary amount in decimal format, using a period (.) as the decimal separator. (e.g. '1.01' in $ currency represents 1$ and 1 cent.)
          - `currency` string, required — Currency code following ISO-4217
        - `interval_months` integer, required
        - `type` string, required
      - OneTimePrice
        - `amount` MonetaryAmount, required
          - `amount` string, required — Monetary amount in decimal format, using a period (.) as the decimal separator. (e.g. '1.01' in $ currency represents 1$ and 1 cent.)
          - `currency` string, required — Currency code following ISO-4217
        - `type` string, required
      - UsagePrice
        - `interval_months` integer, required
        - `type` string, required
        - `billing_scheme` union, required
          - PerUnitBilling
            - `type` string, required
            - `amount` MonetaryAmount, required
              - …
            - `units` integer, required
          - TieredBilling — All tiers except for the highest have to define a value for upTo. There cannot be more than one tier with the same upTo value.
            - `type` string, required
            - `mode` 'GRADUATED' | 'METERED', required — In metered tiering, the maximum quantity within a period determines the price. In graduated tiering, pricing changes as the quantity grows – the price from each tier up to the reported quantity is accumulated.
            - `tiers` Tier[], required
              - …
    - `quantity` number, required
    - `total_value` RoundedMonetaryAmount, required — A monetary amount that must be rounded to the currency's default decimal places (e.g., 2 decimal places for USD).
      - `amount` string, required — Monetary amount in decimal format, using a period (.) as the decimal separator. Must be rounded to the currency's default decimal places (e.g. '1.01' in USD represents 1 dollar and 1 cent).
      - `currency` string, required — Currency code following ISO-4217
    - `revenue_pattern` 'DAILY' | 'EVEN_PERIOD', required — DAILY means that the revenue is divided equally per day in the revenue period. EVEN_PERIOD means that the revenue is divided equally for each calendar month in the revenue period.
    - `discount` union
      - AmountDiscount
        - `amount_off` RoundedMonetaryAmount, required — A monetary amount that must be rounded to the currency's default decimal places (e.g., 2 decimal places for USD).
          - `amount` string, required — Monetary amount in decimal format, using a period (.) as the decimal separator. Must be rounded to the currency's default decimal places (e.g. '1.01' in USD represents 1 dollar and 1 cent).
          - `currency` string, required — Currency code following ISO-4217
        - `type` string
      - PercentageDiscount
        - `percentage_off` number, double, required
        - `type` string
    - `tax_rate` TaxRate
      - `percentage` number, required
      - `tax_amount` RoundedMonetaryAmount — A monetary amount that must be rounded to the currency's default decimal places (e.g., 2 decimal places for USD).
        - `amount` string, required — Monetary amount in decimal format, using a period (.) as the decimal separator. Must be rounded to the currency's default decimal places (e.g. '1.01' in USD represents 1 dollar and 1 cent).
        - `currency` string, required — Currency code following ISO-4217
      - `country` string, required — Two-letter country code (ISO 3166-1 alpha-2).
      - `type` 'VAT' | 'SALES_TAX', required
      - `description` string, required
    - `start_date` string, date, required
    - `end_date` string, date
    - `status` 'AMENDED' | 'ACTIVE', required
    - `amending` string, uuid — When set, references the item this item is amending.
    - `fields` object[]
      - `field_id` string, uuid, required
      - `field_value_id` string, uuid, required
    - `external_references` ExternalReference[], required
      - `type` string, required
      - `id` string, required
      - `url` string, uri
    - `usage_minimum_commitment` UsageCommitment
      - `amount` RoundedMonetaryAmount, required — A monetary amount that must be rounded to the currency's default decimal places (e.g., 2 decimal places for USD).
        - `amount` string, required — Monetary amount in decimal format, using a period (.) as the decimal separator. Must be rounded to the currency's default decimal places (e.g. '1.01' in USD represents 1 dollar and 1 cent).
        - `currency` string, required — Currency code following ISO-4217
      - `revenue_account` string, required — The account code found in the Chart of Accounts
  - `status` 'ACTIVE' | 'IN_EFFECT' | 'CANCELLED' | 'ENDED' | 'AMENDED', required
  - `start_date` string, date, required
  - `end_date` string, date
  - `close_date` string, date, required
  - `invoicing` union, required
    - MonthlyInvoicing
      - `payment_terms` integer, required
      - `interval` string, required
      - `day` integer, required
    - MonthlyProratedInvoicing — Monthly prorated invoicing is only available for contracts with usage products and a minimum usage commitment.
      - `payment_terms` integer, required
      - `interval` string, required
      - `day` integer, required
    - QuarterlyInvoicing
      - `payment_terms` integer, required
      - `interval` string, required
      - `month_day` string, required — A string in --MM-dd format. Invoices will be created starting on that date and every 3 months.
    - SemiAnnualInvoicing
      - `payment_terms` integer, required
      - `interval` string, required
      - `month_day` string, required — A string in --MM-dd format. Invoices will be created starting on that date and every 6 months.
    - YearlyInvoicing
      - `payment_terms` integer, required
      - `interval` string, required
      - `month_day` string, required — A string in --MM-dd format
  - `usage_configuration` UsageConfiguration
    - `usage_invoicing` UsageInvoicing, required
      - `frequency` 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'YEARLY', required
      - `payment_terms` integer, required
      - `invoice_date` 'FIRST_DAY_OF_NEXT_CYCLE' | 'LAST_DAY_OF_CURRENT_CYCLE', required — When the usage invoice is created in relation to the usage cycle.
      - `cycle` 'CALENDAR' | 'SUBSCRIPTION_ANNIVERSARY', required — When does the invoicing pricing cycle reset and results in an invoice. Calendar option is only allowed when usage invoice frequency is Monthly, and contract does not start on the 1st of the Month.
    - `minimum_commitment_invoicing` MinimumCommitmentInvoicing
      - `frequency` 'MONTHLY' | 'MONTHLY_PRORATED' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'YEARLY', required — MONTHLY_PRORATED is only available for CALENDAR usage invoice cycle. It need to be the same as contract level invoicing frequency.
      - `payment_terms` integer, required
    - `minimum_commitment_cycle` 'MONTHLY' | 'CONTRACT' — Determines how often does the minimum commitment reset.
    - `contract_level_minimum_commitment` UsageCommitment
      - `amount` RoundedMonetaryAmount, required — A monetary amount that must be rounded to the currency's default decimal places (e.g., 2 decimal places for USD).
        - `amount` string, required — Monetary amount in decimal format, using a period (.) as the decimal separator. Must be rounded to the currency's default decimal places (e.g. '1.01' in USD represents 1 dollar and 1 cent).
        - `currency` string, required — Currency code following ISO-4217
      - `revenue_account` string, required — The account code found in the Chart of Accounts
  - `total_value` RoundedMonetaryAmount, required — A monetary amount that must be rounded to the currency's default decimal places (e.g., 2 decimal places for USD).
    - `amount` string, required — Monetary amount in decimal format, using a period (.) as the decimal separator. Must be rounded to the currency's default decimal places (e.g. '1.01' in USD represents 1 dollar and 1 cent).
    - `currency` string, required — Currency code following ISO-4217
  - `external_references` ExternalReference[]
    - `type` string, required
    - `id` string, required
    - `url` string, uri
  - `exchange_rate` ExchangeRate
    - `base` string, required — Currency code following ISO-4217
    - `target` string, required — Currency code following ISO-4217
    - `rate` string, required
    - `date` string, date, required
  - `invoices` ContractInvoice[]
    - `id` string, uuid, required
    - `invoice_number` string, required
    - `invoice_date` string, date, required
    - `due_date` string, date, required
    - `status` 'UNPAID' | 'PAID' | 'PARTIALLY_PAID' | 'UNBILLED' | 'CREDITED' | 'PARTIALLY_CREDITED', required
    - `total` RoundedMonetaryAmount, required — A monetary amount that must be rounded to the currency's default decimal places (e.g., 2 decimal places for USD).
      - `amount` string, required — Monetary amount in decimal format, using a period (.) as the decimal separator. Must be rounded to the currency's default decimal places (e.g. '1.01' in USD represents 1 dollar and 1 cent).
      - `currency` string, required — Currency code following ISO-4217
    - `taxed_amount` RoundedMonetaryAmount, required — A monetary amount that must be rounded to the currency's default decimal places (e.g., 2 decimal places for USD).
      - `amount` string, required — Monetary amount in decimal format, using a period (.) as the decimal separator. Must be rounded to the currency's default decimal places (e.g. '1.01' in USD represents 1 dollar and 1 cent).
      - `currency` string, required — Currency code following ISO-4217
    - `items` InvoiceItem[], required
      - `id` string, uuid, required
      - `description` string, required
      - `revenue` ItemRevenue, required
        - `period` CalendarPeriod
          - `start` string, date, required
          - `end` string, date, required
        - `pattern` 'DAILY' | 'EVEN_PERIOD' — DAILY means that the revenue is divided equally per day in the revenue period. EVEN_PERIOD means that the revenue is divided equally for each calendar month in the revenue period.
        - `account_code` string — The account code found in the Chart of Accounts
      - `total_amount` RoundedMonetaryAmount, required — A monetary amount that must be rounded to the currency's default decimal places (e.g., 2 decimal places for USD).
        - `amount` string, required — Monetary amount in decimal format, using a period (.) as the decimal separator. Must be rounded to the currency's default decimal places (e.g. '1.01' in USD represents 1 dollar and 1 cent).
        - `currency` string, required — Currency code following ISO-4217
      - `total_discount` RoundedMonetaryAmount, required — A monetary amount that must be rounded to the currency's default decimal places (e.g., 2 decimal places for USD).
        - `amount` string, required — Monetary amount in decimal format, using a period (.) as the decimal separator. Must be rounded to the currency's default decimal places (e.g. '1.01' in USD represents 1 dollar and 1 cent).
        - `currency` string, required — Currency code following ISO-4217
      - `taxed_amount` RoundedMonetaryAmount, required — A monetary amount that must be rounded to the currency's default decimal places (e.g., 2 decimal places for USD).
        - `amount` string, required — Monetary amount in decimal format, using a period (.) as the decimal separator. Must be rounded to the currency's default decimal places (e.g. '1.01' in USD represents 1 dollar and 1 cent).
        - `currency` string, required — Currency code following ISO-4217
      - `gross_rate` RoundedMonetaryAmount, required — A monetary amount that must be rounded to the currency's default decimal places (e.g., 2 decimal places for USD).
        - `amount` string, required — Monetary amount in decimal format, using a period (.) as the decimal separator. Must be rounded to the currency's default decimal places (e.g. '1.01' in USD represents 1 dollar and 1 cent).
        - `currency` string, required — Currency code following ISO-4217
      - `quantity` number, required
      - `product_id` string, uuid, required
      - `external_references` ExternalReference[], required
        - `type` string, required
        - `id` string, required
        - `url` string, uri
      - `fields` object[]
        - `field_id` string, uuid, required
        - `field_value_id` string, uuid, required
    - `external_references` ExternalReference[], required
      - `type` string, required
      - `id` string, required
      - `url` string, uri

## Other responses

- `default` — Error

---

[API](https://skmtc.net/rillet/apis/rillet-accounting-api.md) · [All operations](https://skmtc.net/rillet/apis/rillet-accounting-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/rillet/rillet-accounting-api/versions/a2ab794dd5f2/schema)
