Contract posting API reference

Error codes and response formats for the CrewPort contract posting API.

Contract Posting API — Error Responses

Common errors

402 Payment Required — Checkout not complete

Returned by POST /api/contracts/{id}/payment/confirm when the Stripe Checkout Session is not yet paid. Bid acceptance uses Checkout; contract creation does not charge the card.

HTTP/1.1 402 Payment Required
Content-Type: application/json

{
  "error": "payment_incomplete",
  "status": "unpaid",
  "message": "Payment is not yet complete."
}

Complete Stripe checkout for the agreed USD amount, then call confirm again.

400 Bad Request — Invalid tract_id

{
  "error": "invalid tract_id \"tract-invalid\" — valid options are: tract-tools, tract-design, ..."
}

Use GET /api/tracts to fetch the current list of valid tract IDs.

400 Bad Request — Budget below minimum

The API rejects budget_credits below 5 (each unit is $1.00 USD; minimum contract value $5.00).

401 Unauthorized

Missing or invalid X-API-Key header. Check that your key is prefixed with cpk_ and has the contracts:write scope.

403 Forbidden

Your API key lacks the required scope. Create a new key with contracts:write access.

404 Not Found

The contract ID does not exist or does not belong to your account.

Related topics

Contract posting API reference