💼

contracts

Legal agreement or contract document between a business and a client. Tracks contract details, financial terms, duration, status, and specific terms and conditions.

🎯 Request Builder

https://api.mockly.codes/contracts?page=1&limit=10&count=10
📡

Configure your request and click Send Request to see the response here.

Endpoints

GET/contracts

Get a collection of contracts

Alternative: /business/contracts
GET/contracts/:id

Get a single contract by ID

Alternative: /business/contracts/:id
GET/contracts/meta

Get resource metadata and schema

Alternative: /business/contracts/meta
🔍

How to Use Search

The search feature allows you to filter results by searching for text across all or specific fields. Choose between ?q= or ?search= parameter names.

1. Basic Search

Search across all text fields:

Basic Search
GET https://api.mockly.codes/contracts?q=laptop

2. Search Specific Fields

Field-Specific Search
GET https://api.mockly.codes/contracts?q=laptop&search_fields=name,description

💡 Pro Tips

  • Search is case-insensitive and performs partial matching
  • Without search_fields, all text fields are searched
  • Combine with pagination to handle large result sets efficiently

Code Examples

JavaScript

Fetch Collection
// Get 10 contracts
fetch('https://api.mockly.codes/contracts?count=10')
  .then(res => res.json())
  .then(data => console.log(data));

Python

Fetch with Requests
import requests

response = requests.get(
    'https://api.mockly.codes/contracts?count=10'
)
data = response.json()

cURL

Command Line
curl "https://api.mockly.codes/contracts?count=10"

Bypass Cache

Get Fresh Data
fetch('https://api.mockly.codes/contracts?nocache=true')

Schema Properties

idinteger

Unique identifier for the contract record

Gen:random_int
contract_numberstring

Unique contract reference number or identifier used for legal and administrative purposes

Gen:uuid
client_idinteger

Foreign key reference to the client or party the contract is with

Gen:random_int
titlestring

Short descriptive title or name of the contract

Gen:sentence
descriptionstring

Detailed description of the contract's purpose, scope, and objectives

Gen:paragraph
valuenumber

Total monetary value or contract amount agreed upon

Gen:price
currencystring

ISO currency code for the contract value (e.g., USD, EUR, GBP)

Gen:currency
start_datestring

Date when the contract becomes effective and obligations begin

Gen:past_datedate
end_datestring

Date when the contract expires or terminates

Gen:future_datedate
statusstring

Current status of the contract (e.g., draft, active, expired, terminated, renewed)

Gen:status
termsstring

Detailed terms and conditions, obligations, and clauses of the contract

Gen:paragraph

Query Parameters

countinteger

Number of items to return (default: 10, max: 100)

seedinteger

Seed for reproducible data generation

nocacheboolean

Bypass cache and generate fresh data on every request