Order Books
Import Order Book
Add another instance’s published stock book to your own venue
POST
/
orderbooks
/
stocks
/
api
/
imports
curl -X POST "https://api.trusset.org/orderbooks/stocks/api/imports" \
-H "X-API-Key: trusset_your_key_here" \
-H "Content-Type: application/json" \
-d '{ "orderBookId": "clx_ob_stock_044" }'
const res = await fetch(
'https://api.trusset.org/orderbooks/stocks/api/imports',
{
method: 'POST',
headers: {
'X-API-Key': 'trusset_your_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({ orderBookId: 'clx_ob_stock_044' })
}
);
const { data } = await res.json();
{
"success": true,
"data": {
"id": "clx_import_007",
"instanceId": "inst_abc123",
"orderBookId": "clx_ob_stock_044",
"active": true,
"createdAt": "2025-06-15T12:00:00.000Z",
"updatedAt": "2025-06-15T12:00:00.000Z"
}
}
{
"success": false,
"data": null,
"error": {
"code": "IMPORT_NOT_ALLOWED",
"message": "This order book does not allow imports"
}
}
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
curl -X POST "https://api.trusset.org/orderbooks/stocks/api/imports" \
-H "X-API-Key: trusset_your_key_here" \
-H "Content-Type: application/json" \
-d '{ "orderBookId": "clx_ob_stock_044" }'
const res = await fetch(
'https://api.trusset.org/orderbooks/stocks/api/imports',
{
method: 'POST',
headers: {
'X-API-Key': 'trusset_your_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({ orderBookId: 'clx_ob_stock_044' })
}
);
const { data } = await res.json();
{
"success": true,
"data": {
"id": "clx_import_007",
"instanceId": "inst_abc123",
"orderBookId": "clx_ob_stock_044",
"active": true,
"createdAt": "2025-06-15T12:00:00.000Z",
"updatedAt": "2025-06-15T12:00:00.000Z"
}
}
{
"success": false,
"data": null,
"error": {
"code": "IMPORT_NOT_ALLOWED",
"message": "This order book does not allow imports"
}
}
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 stock 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 settles off-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/stocks/api/imports" \
-H "X-API-Key: trusset_your_key_here" \
-H "Content-Type: application/json" \
-d '{ "orderBookId": "clx_ob_stock_044" }'
const res = await fetch(
'https://api.trusset.org/orderbooks/stocks/api/imports',
{
method: 'POST',
headers: {
'X-API-Key': 'trusset_your_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({ orderBookId: 'clx_ob_stock_044' })
}
);
const { data } = await res.json();
{
"success": true,
"data": {
"id": "clx_import_007",
"instanceId": "inst_abc123",
"orderBookId": "clx_ob_stock_044",
"active": true,
"createdAt": "2025-06-15T12:00:00.000Z",
"updatedAt": "2025-06-15T12:00:00.000Z"
}
}
{
"success": false,
"data": null,
"error": {
"code": "IMPORT_NOT_ALLOWED",
"message": "This order book does not allow imports"
}
}
