> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a contract

> Create a contract

### Request body

`CreateRevenueContractRequest`

<ParamField body="contract_number" type="string,null" />

<ParamField body="customer_id" type="string" required />

<ParamField body="effective_date" type="string" required>
  ISO date (`YYYY-MM-DD`).
</ParamField>

<ParamField body="invoice_id" type="string,null" />

<ParamField body="obligations" type="CreateObligationRequest[]" required />

<ParamField body="order_id" type="string,null" />

<ParamField body="transaction_price" type="string" required>
  Decimal transaction price as a string.
</ParamField>

### Responses

<ResponseField name="201" type="RevenueContractResponse" />

<ResponseField name="400" type="ErrorBody" />

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.stateset.com/api/v1/revenue-contracts' \
    --header 'Authorization: Bearer YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "contract_number": null,
    "customer_id": "string",
    "effective_date": "string",
    "invoice_id": null,
    "obligations": [
      {
        "allocated_amount": "string",
        "description": "string",
        "end": null,
        "recognition_method": "string",
        "standalone_selling_price": null,
        "start": null
      }
    ],
    "order_id": null,
    "transaction_price": "string"
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "contract_number": "string",
    "created_at": "string",
    "currency": "string",
    "customer_id": "string",
    "deferred_balance": "string",
    "effective_date": "string",
    "id": "string",
    "obligations": [
      {
        "allocated_amount": "string",
        "contract_id": "string",
        "deferred_amount": "string",
        "description": "string",
        "id": "string",
        "recognition_method": "string",
        "recognized_amount": "string"
      }
    ],
    "status": "string",
    "total_recognized": "string",
    "transaction_price": "string"
  }
  ```
</ResponseExample>
