Get next storage ID
Rate limit: 5 every second
API Overview
HTTP method
GET
Path
/api/v3/storageId
Summary
Fetches the next order id for a given sold token. If the need arises to repeatedly place orders in a short span of time, the order id can be initially fetched through the API and then managed locally. Each new order id can be derived from adding 2 to the last one
API description
HTTP Header
Field | Type | Required | Description | Example |
---|---|---|---|---|
X-API-KEY | string | Y | ApiKey | "HlkcGxbqBeaF76j4rvPaOasyfPwnkQ 6B6DQ6THZWbvrAGxzEdulXQvOKLrRW ZLnN" |
Request parameters
Field | Type | Required | Description | Example |
---|---|---|---|---|
accountId | integer | Y | Looprings account identifier | 1 |
sellTokenId | integer | Y | The unique identifier of the token which the user wants to sell in the next order. | 0 |
maxNext | boolean | N | Return the max of the next available storageId, so any storageId > returned value is avaliable, to help user manage storageId by themselves. for example, if [20, 60, 100] is avaliable, all other ids < 100 is used before, user gets 20 if flag is false (and 60 in next run), but gets 100 if flag is true, so he can use 102, 104 freely | "0" |
Request example
HTTP
CURL
GET https://api3.loopring.io/api/v3/storageId?accountId=1&sellTokenId=0&maxNext=0 HTTP/1.1
Host: api3.loopring.io
Connection: keep-alive
Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: zh,en;q=0.9
X-API-KEY: sra1aavfa
curl -H "X-API-KEY:sra1aavfa" https://api3.loopring.io/api/v3/storageId\?accountId\=1\&sellTokenId\=0\&maxNext\=0
Response fields
Field | Type | Required | Description | Example |
---|---|---|---|---|
orderId | integer | N | Next storage ID for order request, must be even | 100 |
offchainId | integer | N | Next storage ID for offchain requests, i.e., transfer/withdraw/updateAccount, must be odd | 101 |
Response example
{
"orderId" : 100,
"offchainId" : 101
}
Status code
Value | Description |
---|---|
100000 | Unknown error |
104001 | Empty ApiKey |
104002 | Invalid ApiKey |
104003 | Invalid Account ID |