Order Books
Import Order Book
Add another instance’s published commodity book to your venue
POST
/
orderbooks
/
commodities
/
api
/
imports
curl -X POST "https://api.trusset.org/orderbooks/commodities/api/imports" \
-H "X-API-Key: trusset_your_key_here" \
-H "Content-Type: application/json" \
-d '{ "orderBookId": "clx_ob_comm_055" }'
const res = await fetch(
'https://api.trusset.org/orderbooks/commodities/api/imports',
{
method: 'POST',
headers: {
'X-API-Key': 'trusset_your_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({ orderBookId: 'clx_ob_comm_055' })
}
);
const { data } = await res.json();
{
"success": true,
"data": {
"id": "clx_import_031",
"instanceId": "inst_abc123",
"orderBookId": "clx_ob_comm_055",
"active": true,
"createdAt": "2025-06-15T12:00:00.000Z",
"updatedAt": "2025-06-15T12:00:00.000Z"
}
}
Imports a book another instance published, so your instance can read and route flow to it. The owner keeps configuration control: you cannot pause it, reprice it, or change its fees.
Re-importing a book you previously removed reactivates the existing link rather than creating a second one.
Body Parameters
string
required
ID of the book to import, from List Importable Order Books. Up to 100 characters.
Response Fields
Returns201 with the import record.
object
Importing does not put the two books in the same fungibility class. Pooling still requires both books to derive the same class from their attestations and both to have
allowSharedLiquidity set.curl -X POST "https://api.trusset.org/orderbooks/commodities/api/imports" \
-H "X-API-Key: trusset_your_key_here" \
-H "Content-Type: application/json" \
-d '{ "orderBookId": "clx_ob_comm_055" }'
const res = await fetch(
'https://api.trusset.org/orderbooks/commodities/api/imports',
{
method: 'POST',
headers: {
'X-API-Key': 'trusset_your_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({ orderBookId: 'clx_ob_comm_055' })
}
);
const { data } = await res.json();
{
"success": true,
"data": {
"id": "clx_import_031",
"instanceId": "inst_abc123",
"orderBookId": "clx_ob_comm_055",
"active": true,
"createdAt": "2025-06-15T12:00:00.000Z",
"updatedAt": "2025-06-15T12:00:00.000Z"
}
}
Error Codes
| Code | HTTP | Cause |
|---|---|---|
VALIDATION_ERROR | 400 | orderBookId is missing or malformed |
IMPORT_OWN | 400 | The book already belongs to your instance |
IMPORT_TYPE_MISMATCH | 400 | The book is not a commodity book. Use the venue that matches its token type |
NETWORK_MISMATCH | 400 | The owning instance runs on a different network |
IMPORT_NOT_ALLOWED | 403 | The book has allowImport off, or does not settle on-chain |
ORDER_BOOK_NOT_FOUND | 404 | No book with that ID |
ALREADY_IMPORTED | 409 | An active import already links this book to your instance |
SERVICE_NOT_ENABLED | 403 | The Trading service is not enabled on this instance |
⌘I
curl -X POST "https://api.trusset.org/orderbooks/commodities/api/imports" \
-H "X-API-Key: trusset_your_key_here" \
-H "Content-Type: application/json" \
-d '{ "orderBookId": "clx_ob_comm_055" }'
const res = await fetch(
'https://api.trusset.org/orderbooks/commodities/api/imports',
{
method: 'POST',
headers: {
'X-API-Key': 'trusset_your_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({ orderBookId: 'clx_ob_comm_055' })
}
);
const { data } = await res.json();
{
"success": true,
"data": {
"id": "clx_import_031",
"instanceId": "inst_abc123",
"orderBookId": "clx_ob_comm_055",
"active": true,
"createdAt": "2025-06-15T12:00:00.000Z",
"updatedAt": "2025-06-15T12:00:00.000Z"
}
}
