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

# Create contract

`POST /contracts`

## Request

- Base URL: `https://api.toriihq.com/v1.0`
- URL: `https://api.toriihq.com/v1.0/contracts`
- Auth: API key in header `Authorization`

Creates a new contract.<br/><br/>The request body must contain the name, idApp, and status of the contract.<br/><br/>Fields an admin marked as required in Torii must have a value, or the request fails with 400 and lists them in `data.missingMandatoryFields`.<br/><br/>Dates should be sent in ISOString format. Example: "2022-02-03"<br/><br/>Currency fields (e.g., `amount`) can be numbers (`"amount": 1500`, uses org default currency) or objects to set a different currency: `"amount": { "value": 23000000, "currency": "EUR" }`. Cannot set `currency` as a top-level field.<br/><br/>Optional `lineItems` are created with the contract (each needs a `description`; `quantity`, `pricePerUnit`, `totalCost`, `currency`, `startDate`, `endDate`, `sku` and the other value fields are optional; row ids and license mapping cannot be set here). Read them back with `GET /contracts/{idContract}?fields=lineItems`.<br/><br/>
<p><ul><li>Rate limit: 200 requests per minute</li></ul></p>

## Request body

- Model75: Contract
  - `name` string, required
  - `idApp` integer, required: Unique app identifier
  - `status` string, required: Contract status
  - `amount` integer
  - `startDate` string, date-time: Contract start date, in ISO 8601 format (e.g. "2022-02-03")
  - `endDate` string, date-time: Contract end date, in ISO 8601 format (e.g. "2022-02-03")
  - `lineItems` Model74[]: Products / SKUs on the order, created as the contract's line items
    - `description` string, required
    - `quantity` integer
    - `pricePerUnit` number
    - `totalCost` number
    - `currency` string
    - `startDate` string, date-time
    - `endDate` string, date-time
    - `discount` number
    - `tax` number
    - `paymentTerm` string
    - `costPeriod` string
    - `licensingModel` string
    - `licensingMetric` string
    - `sku` string

## Response `200`

Create contract

- CreateContract: Create contract
  - `contract` Contract
    - `id` integer: Unique identifier
    - `name` string
    - `status` string: Contract status

---

[API](https://skmtc.dev/toriihq/apis/torii-api-documentation.md) - [All operations](https://skmtc.dev/toriihq/apis/torii-api-documentation/llms.txt) - [OpenAPI document](https://skmtc.dev/toriihq/apis/torii-api-documentation/revisions/15fd1512591b?raw)
