v1

latestOpenAPI 3.1.02026-08-042453938.9 KB
Contracts

List contracts

List all contracts for your business, optionally filtered by customer or status. Results are ordered by creation date (newest first).

Requires a secret key (sk_*) with the ADMIN role.

get/v1/contracts

Query parameters

customerIdstring
Example:cus_abc123def456

Filter contracts by customer ID

status'ACTIVE' | 'PAUSED' | 'EXPIRED' | 'CANCELLED'
Example:ACTIVE

Filter contracts by status

Response

List of contracts

Example response

{
  "contracts": [
    {
      "id": "ctr_abc123def456",
      "businessId": "biz_789xyz",
      "customerId": "cus_abc123def456",
      "name": "Acme Corp Enterprise Agreement",
      "status": "ACTIVE",
      "startDate": "2024-01-01T00:00:00.000Z",
      "endDate": "2024-12-31T23:59:59.000Z",
      "minimumUsdc": "500.000000",
      "maximumUsdc": "10000.000000",
      "discountPct": "15.00",
      "prepaidAmountUsdc": "1000.000000",
      "prepaidBalanceUsdc": "750.000000",
      "includedUnits": {
        "api_call": 10000,
        "token": 1000000
      },
      "metadata": {
        "salesforceId": "OPP-12345",
        "tier": "enterprise"
      },
      "createdAt": "2024-01-15T10:30:00.000Z",
      "updatedAt": "2024-01-15T10:30:00.000Z",
      "priceOverrides": [
        {
          "id": "cpo_abc123def456",
          "unitType": "api_call",
          "unitPriceUsd": "0.000800"
        }
      ]
    }
  ]
}