Skip to main content
GET
/
api
/
v1
/
contracts
/
{contract_id}
Get Contract
curl --request GET \
  --url https://api.example.com/api/v1/contracts/{contract_id}
{
  "contract_id": "<string>",
  "status": "<string>",
  "created_at": "<string>",
  "expires_at": "<string>",
  "total_amount": 123,
  "currency": "<string>",
  "parties": [
    {}
  ],
  "contract_hash": "<string>"
}
Fetches detailed information about a specific contract including its status, parties, terms, and contract hash.

Path Parameters

contract_id
string
required
The unique identifier of the contract to retrieve

Response

contract_id
string
Unique identifier for the contract
status
string
Current contract status:
  • pending: Awaiting signatures
  • confirmed: All parties have signed
  • active: Contract is in effect
  • completed: Contract has been fulfilled
  • cancelled: Contract was cancelled
created_at
string
ISO 8601 timestamp of contract creation
expires_at
string
ISO 8601 timestamp of contract expiration (if applicable)
total_amount
number
Total contract amount
currency
string
Currency code (e.g., “KES”, “USD”)
parties
array
List of contract parties:
  • phone_number: Party’s phone number
  • role: Party’s role (buyer, seller, etc.)
  • name: Party’s name
contract_hash
string
Cryptographic hash for contract verification and integrity

Example Request

curl -X GET https://api.voicepact.com/api/v1/contracts/AGRI-2026-001234 \
  -H "Content-Type: application/json"

Example Response

{
  "contract_id": "AGRI-2026-001234",
  "status": "confirmed",
  "created_at": "2026-03-06T10:30:00Z",
  "expires_at": "2026-04-06T10:30:00Z",
  "total_amount": 25000,
  "currency": "KES",
  "parties": [
    {
      "phone_number": "+254712345678",
      "role": "buyer",
      "name": "John Kamau"
    },
    {
      "phone_number": "+254787654321",
      "role": "seller",
      "name": "Mary Wanjiru"
    }
  ],
  "contract_hash": "a7f8d9e2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0"
}

Error Responses

404 Not Found

{
  "detail": "Contract not found"
}
Returned when the specified contract_id does not exist in the database.

500 Internal Server Error

{
  "detail": "Failed to retrieve contract"
}
Returned when an unexpected error occurs during contract retrieval.

Build docs developers (and LLMs) love