Docs Library

API Reference

Contract API endpoints

Create draft contracts from your contract system and read account balances back after each locked calculation.

Best For Developers syncing label or publisher contracts into Allocora.

Every contract endpoint with request and response examples.

To try sample data, create a free workspace and choose the SaaS Affiliate sample during setup.

On This Page

Details

What to know

Contract object

A contract response lists its parties, the catalog items it covers, its accounts and its version history.

  • A contract is created as a draft. It does not affect calculations until someone activates it in Allocora.
  • Activating contracts, amendments and balance transfers are done in the Allocora workspace.
  • Party payees, catalog items and recoupment pools must belong to the same workspace.
  • Writes run as the Allocora user who created the API key. If that user no longer has Owner, Admin or Finance access to the workspace, they return 403.

Accounts and balances

Each account shows the payee, the currency, the configured opening balance, advance, expenses and clawback, the recoupment pool, and balance with the unrecouped amounts after the latest locked calculation run.

  • balance is null until a locked calculation includes the account.
  • For an account in a pool, balance shows the pool balance and account the part that belongs to this contract.
  • Amounts are decimal strings.

Endpoint Examples

Requests and responses

Each example shows the request shape and a shortened successful response. Replace placeholder IDs with values from your workspace.

GET /api/v1/contracts

List contracts

Returns contracts with their status and current terms dates.

  • Requires read:contracts.

Request example

curl -H "Authorization: Bearer <ALLOCORA_API_KEY>" \
  "https://www.allocora.com/api/v1/contracts?status=active&payee_id=<PAYEE_ID>"

Response example

{
  "data": [
    {
      "id": "<CONTRACT_ID>",
      "title": "Mara Quill record deal",
      "reference": "MQ-1",
      "type": "recording",
      "status": "active",
      "is_default": false,
      "version": 2,
      "effective_from": "2026-01-01",
      "effective_to": null
    }
  ],
  "meta": {"current_page": 1, "last_page": 1, "per_page": 25, "total": 1}
}
GET /api/v1/contracts/{id}

Retrieve a contract

Returns one contract with its parties, catalog items, accounts with balances and versions.

  • Requires read:contracts.

Request example

curl -H "Authorization: Bearer <ALLOCORA_API_KEY>" \
  https://www.allocora.com/api/v1/contracts/<CONTRACT_ID>

Response example

{
  "data": {
    "id": "<CONTRACT_ID>",
    "title": "Mara Quill record deal",
    "status": "active",
    "parties": [{"role": "artist", "payee": {"id": "<PAYEE_ID>", "name": "Mara Quill"}, "name": null, "share_note": "18%"}],
    "catalog_items": [{"id": "<CATALOG_ITEM_ID>", "type": "recording", "title": "Northern Lights"}],
    "accounts": [
      {
        "payee": {"id": "<PAYEE_ID>", "name": "Mara Quill"},
        "currency": "USD",
        "configured": {"opening_balance": "0.000", "recoupable_advance": "5000.000", "recoupable_expenses": "0.000", "clawback_balance": "0.000"},
        "pool": null,
        "balance": {"run_id": "<RUN_ID>", "run_name": "March 2026", "period_end": "2026-03-31", "advance": "4120.500", "expenses": "0.000", "opening_balance": "0.000", "clawback": "0.000", "refund_carry": "0.000", "is_pool": false}
      }
    ],
    "versions": [{"version": 1, "effective_from": "2026-01-01", "effective_to": null, "change_summary": null}]
  }
}
POST /api/v1/contracts

Create a draft contract

Creates a draft contract with its parties, catalog items and accounts.

  • Requires write:contracts.
  • title, contract_type and effective_from are required.
  • Party payees, catalog items and pools must belong to the same workspace.

Request example

curl -X POST https://www.allocora.com/api/v1/contracts \
  -H "Authorization: Bearer <ALLOCORA_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Mara Quill record deal",
    "reference": "MQ-1",
    "contract_type": "recording",
    "effective_from": "2026-01-01",
    "parties": [{"role": "artist", "payee_id": "<PAYEE_ID>", "share_note": "18%"}],
    "catalog_item_ids": ["<CATALOG_ITEM_ID>"],
    "account_terms": [{"payee_id": "<PAYEE_ID>", "currency": "USD", "recoupable_advance": "5000.00"}]
  }'

Response example

{
  "data": {
    "id": "<CONTRACT_ID>",
    "title": "Mara Quill record deal",
    "status": "draft",
    "version": 1,
    "accounts": [{"currency": "USD", "configured": {"recoupable_advance": "5000.000"}, "balance": null}]
  }
}

Reference Tables

Fields and checks

List filters

The list endpoint accepts page and per_page (default 25, maximum 100) and returns meta with current_page, last_page, per_page and total. An unknown filter value returns 422.

Endpoint Filter Values
/api/v1/contracts status current (default, everything except archived), draft, active, expired, terminated, archived or all
/api/v1/contracts type recording, publishing, license_in, license_out, distribution or other
/api/v1/contracts payee_id Contracts where this payee is a party
/api/v1/contracts search Title or reference
/api/v1/contracts include_default true to include the Default agreement of each payee

Apply this in a workspace

Create a free workspace, explore sample data, and import your own revenue when you are ready.