Settlement
Get Settlement
Read one settlement and the trades it covers
GET
/
orderbooks
/
external-securities
/
api
/
settlements
/
{settlementId}
curl "https://api.trusset.org/orderbooks/external-securities/api/settlements/0f7c2a19-64b8-4d02-9e51-73ab0c5d6f18" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/orderbooks/external-securities/api/settlements/${settlementId}`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
console.log(data.status, data.txHash ?? data.error);
{
"success": true,
"data": {
"id": "clx_settle_77",
"settlementId": "0f7c2a19-64b8-4d02-9e51-73ab0c5d6f18",
"instanceId": "inst_abc123",
"status": "CONFIRMED",
"txHash": "0x9f2c41d8b7e05a3164c2870fbd935e1a4c7802db6135ea9048f7c21b5d3ea41b",
"blockNumber": 6412901,
"gasUsed": "241880",
"error": null,
"settledAt": "2025-06-15T12:00:41.000Z",
"createdAt": "2025-06-15T12:00:01.000Z",
"updatedAt": "2025-06-15T12:00:41.000Z",
"trades": [
{
"tradeId": "5b3c19e0-7a42-4d86-91f5-2c0e8d47b613",
"price": "104200000",
"quantity": "10000000",
"settlementStatus": "CONFIRMED",
"settlementError": null
}
]
}
}
{
"success": true,
"data": {
"settlementId": "3a17f0c8-52d9-41b6-8e04-9c7b25a1f0d3",
"status": "FAILED",
"txHash": null,
"error": "A signed order in this settlement was cancelled on chain. The trade has been reversed and both reservations released.",
"settledAt": null,
"trades": [
{
"tradeId": "d92a4c11-6f38-4b70-a5e2-81c0f37d4b96",
"settlementStatus": "FAILED",
"settlementError": "A signed order in this settlement was cancelled on chain. The trade has been reversed and both reservations released."
}
]
}
}
Returns a settlement with its trades, in any state. Unlike List Pending Settlements, this resolves confirmed and failed settlements too, which makes it the read for reconciliation and for explaining a failure after the fact.
Only settlements belonging to your instance resolve, and only ones whose trades sit on external securities books. Both the public
settlementId and the internal row ID are accepted.
Path Parameters
string
required
Settlement ID.
Response Fields
object
Show child attributes
Show child attributes
string
Internal row ID.
string
Public settlement ID.
string
Instance that owns the book the settlement belongs to.
string
PENDING, PROCESSING, CONFIRMED or FAILED.string
Settlement transaction, or
null.integer
Block the transaction landed in, or
null.string
Gas consumed, or
null.string
Why the settlement failed, or
null.string
ISO 8601 timestamp of confirmation, or
null.string
ISO 8601 timestamp.
string
ISO 8601 timestamp.
array
Every trade the settlement covers, each with its own
settlementStatus and settlementError.A
FAILED settlement on this venue is terminal and already unwound: its trades were reversed and both sides’ reservations released. There is nothing to retry, and the orders behind it are free to be signed again with a fresh salt.curl "https://api.trusset.org/orderbooks/external-securities/api/settlements/0f7c2a19-64b8-4d02-9e51-73ab0c5d6f18" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/orderbooks/external-securities/api/settlements/${settlementId}`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
console.log(data.status, data.txHash ?? data.error);
{
"success": true,
"data": {
"id": "clx_settle_77",
"settlementId": "0f7c2a19-64b8-4d02-9e51-73ab0c5d6f18",
"instanceId": "inst_abc123",
"status": "CONFIRMED",
"txHash": "0x9f2c41d8b7e05a3164c2870fbd935e1a4c7802db6135ea9048f7c21b5d3ea41b",
"blockNumber": 6412901,
"gasUsed": "241880",
"error": null,
"settledAt": "2025-06-15T12:00:41.000Z",
"createdAt": "2025-06-15T12:00:01.000Z",
"updatedAt": "2025-06-15T12:00:41.000Z",
"trades": [
{
"tradeId": "5b3c19e0-7a42-4d86-91f5-2c0e8d47b613",
"price": "104200000",
"quantity": "10000000",
"settlementStatus": "CONFIRMED",
"settlementError": null
}
]
}
}
{
"success": true,
"data": {
"settlementId": "3a17f0c8-52d9-41b6-8e04-9c7b25a1f0d3",
"status": "FAILED",
"txHash": null,
"error": "A signed order in this settlement was cancelled on chain. The trade has been reversed and both reservations released.",
"settledAt": null,
"trades": [
{
"tradeId": "d92a4c11-6f38-4b70-a5e2-81c0f37d4b96",
"settlementStatus": "FAILED",
"settlementError": "A signed order in this settlement was cancelled on chain. The trade has been reversed and both reservations released."
}
]
}
}
Error Codes
| Code | HTTP | Cause |
|---|---|---|
SETTLEMENT_NOT_FOUND | 404 | No settlement with that ID on your instance, or it is not an external securities settlement |
SERVICE_NOT_ENABLED | 403 | The Trading service is not enabled on this instance |
⌘I
curl "https://api.trusset.org/orderbooks/external-securities/api/settlements/0f7c2a19-64b8-4d02-9e51-73ab0c5d6f18" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/orderbooks/external-securities/api/settlements/${settlementId}`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
console.log(data.status, data.txHash ?? data.error);
{
"success": true,
"data": {
"id": "clx_settle_77",
"settlementId": "0f7c2a19-64b8-4d02-9e51-73ab0c5d6f18",
"instanceId": "inst_abc123",
"status": "CONFIRMED",
"txHash": "0x9f2c41d8b7e05a3164c2870fbd935e1a4c7802db6135ea9048f7c21b5d3ea41b",
"blockNumber": 6412901,
"gasUsed": "241880",
"error": null,
"settledAt": "2025-06-15T12:00:41.000Z",
"createdAt": "2025-06-15T12:00:01.000Z",
"updatedAt": "2025-06-15T12:00:41.000Z",
"trades": [
{
"tradeId": "5b3c19e0-7a42-4d86-91f5-2c0e8d47b613",
"price": "104200000",
"quantity": "10000000",
"settlementStatus": "CONFIRMED",
"settlementError": null
}
]
}
}
{
"success": true,
"data": {
"settlementId": "3a17f0c8-52d9-41b6-8e04-9c7b25a1f0d3",
"status": "FAILED",
"txHash": null,
"error": "A signed order in this settlement was cancelled on chain. The trade has been reversed and both reservations released.",
"settledAt": null,
"trades": [
{
"tradeId": "d92a4c11-6f38-4b70-a5e2-81c0f37d4b96",
"settlementStatus": "FAILED",
"settlementError": "A signed order in this settlement was cancelled on chain. The trade has been reversed and both reservations released."
}
]
}
}
