Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contract Entitlement API

Turn customer-supplied contract terms into entitlements, reconciled schedules, renewal dates, obligations, and commitment exposure.

Quickstart: normalize one synthetic order form without an account

The public demo runs the real production engine, stores nothing, meters nothing, and requires no API key. The data below is synthetic.

cat > request.json <<'JSON'
{
  "contract": {
    "contractId": "ORD-2026-0041",
    "customer": "Acme Corp",
    "supplier": "Northwind Software",
    "currency": "USD",
    "startsAt": "2026-01-01T00:00:00Z",
    "endsAt": "2026-12-31T00:00:00Z",
    "lineItems": [
      {
        "sku": "platform.enterprise",
        "description": "Platform licence",
        "quantity": 250,
        "unitPriceMinor": 4000,
        "frequency": "monthly"
      },
      {
        "sku": "support.premium",
        "description": "Premium support",
        "quantity": 1,
        "unitPriceMinor": 1200000,
        "frequency": "annual"
      },
      {
        "sku": "onboarding",
        "description": "Implementation",
        "quantity": 1,
        "unitPriceMinor": 750000,
        "frequency": "one_time"
      }
    ],
    "renewal": {
      "autoRenew": true,
      "noticeDays": 90,
      "termMonths": 12,
      "upliftCapPct": 5
    },
    "commitment": {
      "minimumSpendMinor": 2000000,
      "spentToDateMinor": 400000
    }
  }
}
JSON

curl -sS -X POST https://contractentitlement-api.com/v1/demo/normalize \
  -H 'content-type: application/json' \
  --data-binary @request.json

Selected fields from the deterministic 200 response (evaluated at 2026-09-06T20:30:00.000Z for this example):

{
  "contract": {
    "contractId": "ORD-2026-0041",
    "currency": "USD",
    "totalContractValueMinor": 13950000,
    "annualizedValueMinor": 13200000,
    "obligations": [
      {
        "kind": "renewal_notice",
        "dueAt": "2026-10-02T00:00:00.000Z",
        "daysRemaining": 26,
        "status": "due_soon",
        "description": "Give notice by 2026-10-02 (26 day(s)) or this contract auto-renews."
      },
      {
        "kind": "auto_renewal",
        "dueAt": "2026-12-31T00:00:00.000Z",
        "daysRemaining": 116,
        "status": "upcoming",
        "description": "Auto-renews for 12 month(s), through 2027-12-31.",
        "amountMinor": 13860000
      },
      {
        "kind": "minimum_commitment",
        "dueAt": "2026-12-31T00:00:00.000Z",
        "daysRemaining": 116,
        "status": "upcoming",
        "amountMinor": 1600000,
        "description": "1600000 minor units remain against the minimum commitment and spend is BEHIND pace — projected shortfall 1411290."
      },
      {
        "kind": "term_expiry",
        "dueAt": "2026-12-31T00:00:00.000Z",
        "daysRemaining": 116,
        "status": "upcoming",
        "description": "The contract term ends on 2026-12-31."
      }
    ],
    "renewal": {
      "autoRenew": true,
      "noticeDeadline": "2026-10-02T00:00:00.000Z",
      "noticeWindowMissed": false,
      "daysToNoticeDeadline": 26,
      "renewsOn": "2026-12-31T00:00:00.000Z",
      "renewalTermEndsAt": "2027-12-31T00:00:00.000Z",
      "maxRenewalPriceMinor": 13860000,
      "maxUpliftMinor": 660000
    },
    "commitment": {
      "minimumSpendMinor": 2000000,
      "spentToDateMinor": 400000,
      "remainingMinor": 1600000,
      "requiredToDateMinor": 1358904,
      "projectedSpendMinor": 588710,
      "projectedShortfallMinor": 1411290,
      "onPace": false
    },
    "evaluatedAt": "2026-09-06T20:30:00.000Z",
    "warnings": []
  },
  "requestId": "req_example"
}

The first useful result is the real notice deadline plus the reconciled contract value and commitment shortfall. In this example, the notice is due soon and spend is behind pace, so Finance has a dated action instead of a buried clause.

Input contract

Amounts are integer minor units. endsAt is the inclusive last covered day; the engine uses calendar periods and exposes every schedule line.

Create and use a free API key

curl -sS -X POST https://contractentitlement-api.com/v1/keys \
  -H 'content-type: application/json' \
  -d '{"email":"you@example.com","name":"github-quickstart","source":{"source":"github","medium":"developer","campaign":"contract-entitlement-github","content":"readme"}}'

curl -sS -X POST https://contractentitlement-api.com/v1/keys/claim \
  -H 'content-type: application/json' \
  -d '{"token":"PASTE_ONE_TIME_TOKEN_FROM_EMAIL"}'

export API_KEY='PASTE_API_KEY_FROM_CLAIM_RESPONSE'

curl -sS -X POST https://contractentitlement-api.com/v1/contracts \
  -H "Authorization: Bearer $API_KEY" \
  -H 'content-type: application/json' \
  --data-binary @request.json

The key-request response is 202 and sends a one-time claim token by email. The claim response is the only place the raw API key is returned; store it securely and never commit it. The authenticated endpoint accepts the same request shape as the demo, with the documented production batch limits and metering.

What to do next

Send the same contract to /v1/entitlements/check with a SKU, quantity, and date to make a runtime access decision.

The stable code catalogue for this product is GET /v1/obligation-types. Branch on machine-readable codes, not human-readable detail text.

Authentication and troubleshooting

  • 401: the authenticated endpoint did not receive a valid active key. Set API_KEY to the value returned once by /v1/keys/claim; do not send a claim token as a bearer credential.
  • 400 invalid_request: read error.details.path when present and correct the named field. This service does not emit 422; a client-side schema tool may show 422 before a request reaches the API.
  • 429 quota_exceeded or 429 rate_limited: inspect error.code, honor Retry-After when present, and retry with bounded exponential backoff. A quota exhaustion requires a later quota window or plan change, not a tight retry loop.

Every API error has {"error":{"code","message","requestId"}}. Share the request ID with support, never the API key, claim token, or customer payload.

SDKs and authoritative contract

  • Python: ./sdk/python/contract_entitlement.py
  • TypeScript: ./sdk/typescript/index.ts

The live OpenAPI document is authoritative for operations and schemas. This overlay is a customer-runnable example aligned to that contract; it does not replace the OpenAPI document or claim that an unresolved external contract is authoritative.

Distribution attribution

The key request above uses contract-entitlement-github as the stable GitHub campaign. The Postman collection uses postman / collection / contract-entitlement-postman / public-collection. These are attribution inputs, not claims of customers or revenue.

License

MIT

Releases

Packages

Contributors

Languages