---
title: "Create a contract (the contract-to-cash funding target)"
method: POST
path: "/companies/{companyId}/contracts"
tags: ["Receivables"]
---

# Create a contract (the contract-to-cash funding target)

`POST /companies/{companyId}/contracts`

## Request

- Base URL: `https://api.medianfi.com/api/v1`
- URL: `https://api.medianfi.com/api/v1/companies/{companyId}/contracts`
- Auth: HTTP bearer

DARK — 404s unless ar_ap_items_enabled. customerId (when given) must belong to the company — validated via the company-scoped customer lookup; customerName denormalizes from the master record when omitted. invoiced_to_date is never stored; funding derives on read.

## Response `201`

Contract created (with funding rollup)

## Other responses

- `401`: Authentication required
- `404`: Customer not found or AR/AP not enabled
- `422`: Validation error

---

[API](https://skmtc.dev/medianfi/apis/median-api.md) · [All operations](https://skmtc.dev/medianfi/apis/median-api/llms.txt) · [OpenAPI document](https://skmtc.dev/medianfi/apis/median-api/revisions/20090ea32b0d?raw)
