List contracts
GET
/v1/contractsYour layaway agreements, newest first, paginated. A sandbox key lists sandbox agreements and a live key live ones.
Authentication — X-Client-Id and
X-Api-Key, with the contracts:read
scope.
Request
| Parameter | In | Notes |
|---|---|---|
status |
query | Optional. Only agreements in this status. |
page |
query | Optional. Defaults to the first page. |
curl "$SHOTPAY_URL/v1/contracts?status=active" \
-H "X-Client-Id: $SHOTPAY_CLIENT_ID" \
-H "X-Api-Key: $SHOTPAY_API_KEY"
$contracts = Http::withHeaders([
'X-Client-Id' => config('shotpay.client_id'),
'X-Api-Key' => config('shotpay.api_key'),
])->get(config('shotpay.url').'/v1/contracts', ['status' => 'active'])->json('data');
$page = $client->contracts->list(['status' => 'active']);
foreach ($page->data as $contract) {
// $contract->reference, $contract->remainingAmount
}
const page = await client.contracts.list({ status: 'active' });
for (const contract of page.data) {
// contract.reference, contract.remaining_amount
}
Response
200 OK — a page of Contracts, with links and
meta pagination blocks alongside data.
{
"data": [
{
"reference": "LAY-8F2KQ0MZXA",
"order_reference": "SO-2026-0042",
"status": "active",
"…": "…"
}
],
"links": { "…": "…" },
"meta": { "current_page": 1, "…": "…" }
}
Errors
| Status | When |
|---|---|
401 |
The header pair did not authenticate. |
403 |
The key is missing the contracts:read scope, or the account is not active. |
429 |
Rate limited. Back off for Retry-After seconds. |
See Error Handling.