Query Orders
orderquery blockchain orders
Describes how to use the Spell API to query orders.
After an order is generated, users can query it via the web interface or API requests.
Order details provide essential Spell order information along with a breakdown of the blockchain transaction. This includes key details like the Blockchain, Block Number, Transaction Hash, Timestamp, Sender, Recipient, Token Type, Transfer Amount, and Network Fee. Additionally, you can use the transaction hash to verify the transfer on the respective blockchain explorer.
API Documentation
Preparation
Before making a request, you may prepare the following data. The IDs obtained from these requests can be used as filter parameters in your query:
- Get the list of supported blockchains:
GET /api/v1/chain
- Get the list of supported tokens:
GET /api/v1/token
- Get the list of pre-created addresses:
GET /api/v1/address
Request
GET /api/v1/order
- Headers:
X-API-Key: '<API Key>'
- Request Parameters:
Parameter | Type | Required | Other Requirements | Parameter Description |
---|---|---|---|---|
page | number | No | Page number, defaults to 1 | |
size | number | No | Number of items per page, defaults to 10 | |
sort | string | No | Sorting field. Add a - prefix for descending order. Default: -created | |
type | string | No | Order confirmation type | |
group_no | string | No | Group number | |
order_no | string | No | Order number | |
chain | string | No | 15-character string | Chain ID obtained during preparation |
token | string | No | 15-character string | Token ID obtained during preparation |
address | string | No | 15-character string | Address ID obtained during preparation |
Response
The response type is application/json
.
total
is the total number of items that match the criteria.page
andsize
represent the current pagination settings.items
is an array of order data for the current page.
Success 200
{
"code": 200,
"page":1,
"size":10,
"total": 100,
"items": [
{
"id": "order_id",
"type": "tail", // id | tail
"group_no": "",
"order_no": "external_order_no",
"user": "RELATION_RECORD_ID",
"chain": "RELATION_RECORD_ID",
"address": "RELATION_RECORD_ID",
"token": "RELATION_RECORD_ID",
"amount": 123,
"tail": "5623", // empty for id type
"status": 0, // 0: pending, 1: success, 2: overdue
"pay_time": "", // empty when created
"timeout": 1800, // seconds, default 1800
"return_url": "https://domain.com/path",
"created": "2022-01-01 10:00:00.123Z",
"updated": "2022-01-01 10:00:00.123Z"
}
]
}
Fail 400
{
"code": 400,
"message": "error message"
}