Storage Id
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.

EndPoint

GET api/v3/storageId

Header

Field
Description
Example
X-API-KEY
ApiKey, a valid apiKey is ok
"HlkcGxbqBeaF76j4rvPaOasyfPwnkQ6B6DQ6THZWbvrAGxzEdulXQvOKLrRWZLnN"

Request

Field
Description
Example
accountId
Loopring account identifier
10110
sellTokenId
The unique identifier of the token which the user wants to sell in the next order.
0
maxNext
(Optional) Return the max of the next available storageId, so any storageId > returned value is available, to help users manage storageId by themselves. for example, if [20, 60, 100] is available, all other ids < 100 are used before, the user gets 20 if the flag is false (and 60 in the next run), but gets 100 if the flag is true, so he can use 102, 104 freely
false

Response

Field
Description
Example
orderId
Next storage ID for order request, must be even
100
offchainId
Next storage ID for off-chain requests, i.e., transfer/withdraw/updateAccount, must be odd
101

Example

Header

X-API-KEY = bEef7a3Nzk7lgaHm85E0O1JO5ufu0iQ96p3bCmrsZz8TLGG83jTpPDYwcjUC0vlF

Request

GET api/v3/storageId
https://uat2.loopring.io/api/v3/storageId?accountId=11329&sellTokenId=0

Response

{
"orderId": 0,
"offchainId": 1
}