Get orders

The GET /orders endpoint data field returns an array of Order objects matching the request filters or an empty array if no order is found.

Get orders successful response schema:

{
  "success": true,
  "message": null,
  "data": Order[] | []
}

Order object schema, see also Maker Orders | LooksRare Docs:

Field NameField TypeDescription
hashstringThe order hash is a unique hash which identifies the order. See the Order Hash section to find out how it's calculated.
collectionAddressstringThe address of the collection.
tokenIdstring | nullThe id of the asset.
If the order is a collection offer, this field will be null.
isOrderAskbooleanIf true, the order is a sell order (listing).
If false, the order is a buy order (offer).
signerstringThe address of the MakerOrder signer.
strategystringThe strategy address. See Addresses | LooksRare SDK for the possible values.
currencyAddressstringThe currency address. See Addresses | LooksRare SDK for the possible values.

The only whitelisted currency is WETH.
amountstringThe amount of tokens to sell/purchase. It's 1 for ERC-721 and >= 1 for ERC-1155.
pricestringThe price in WEI.
noncestringThe order nonce. It's meant to be unique expect for conditional orders. Once executed, the order nonce becomes invalid rendering all the orders with the same nonce invalid.
startTimenumberStart time timestamp in seconds (when the order starts to be valid).
endTimenumberEnd time timestamp in seconds (when the order becomes invalid).
minPercentageToAsknumberThe minPercentageToAsk represents the minimum percentage required to be transferred to the ask or the trade is rejected (e.g., 9800 = 98% of the trade price).

It protects the ask user from an unexpected increase in fees.
paramsstringThe order params are used for more advanced orders. For example to define the maximum price for a Dutch auction or recipient address for a private sale.

Not used for standard orders.
statusSee the Order Status section.The order status. Only VALID orders can be matched with a TakerOrder.
signaturestringThe full EIP-712 signature.
rstringThe r parameter of the EIP-712 signature.
sstringThe s parameter of the EIP-712 signature.
vnumberThe v parameter of the EIP-712 signature.

Create an order

The POST /orders endpoint is used to create a MakerOrder. If successful, it returns the newly created MakerOrder.

Create an order successful response schema:

{
  "success": true,
  "message": null,
  "data": Order
}

See the Get orders - Order schema above for the response Order object schema. See below for the object the API expects to create an order.

MakerOrder object schema, see also MakerOrder | LooksRare SDK:

Field NameField TypeDescription
isOrderAskbooleanSet to true, if the order is a sell order (listing).
Set to false, if the order is a buy order (offer).
signerstringThe address which will sign the MakerOrder object. If ask order, they must own the asset.
collectionstringThe collection address.
pricestringThe price in WEI.
tokenIdstringThe asset id. Must be null for collection offers.
amountstringThe amount of tokens.

Must be 1 for ERC-721, can be more for ERC-1155.
strategystringThe strategy address. See Deployed Contract Addresses | LooksRare Docs for the possible values.

For listings or standard offers use StrategyStandardSaleForFixedPrice.
For collection offer use StrategyAnyItemFromCollectionForFixedPrice.
currencystringThe currency address. See Addresses | LooksRare SDK for the possible values.

The only whitelisted currency is WETH.
noncestringThe order nonce. You can retrieve it with the Get order nonce endpoint.

It's meant to be unique expect for conditional orders. Once executed, the order nonce becomes invalid rendering all the orders with the same nonce invalid.

You can't create more than 20 orders with the same nonce.
startTimenumberStart time timestamp in seconds.

Math.floor(Date.now() / 1000)
endTimenumberEnd time timestamp in seconds (when the order becomes invalid).
minPercentageToAsknumberThe minPercentageToAsk represents the minimum percentage required to be transferred to the ask or the trade is rejected (e.g., 9800 = 98% of the trade price). Can't be higher than 9800.

It protects the ask user from an unexpected increase in fees.
paramsstring[]The order params are used for more advanced orders. For example to define the maximum price for a Dutch auction or recipient address for a private sale.

Not used for standard orders. Can be set to [].
signaturestringThe EIP-712 signature of the object with the previous params mentioned above. Must be added to the MakerOrder object before sending the POST request to the API endpoint.

Get order nonce

The GET /orders/nonce endpoint data field returns the nonce to use when creating an order.

Get order nonce successful response schema:

{
  "success": true,
  "message": null,
  "data": string
}

The data field will contain the nonce to use to create a new MakerOrder.

Miscellaneous

Order Status

StatusDescription
CANCELLEDThe user cancelled the MakerOrder.
ERC_APPROVALThe user has not set, or has revoked, the approval (setApprovalForAll) for the LooksrRare TransferManager contract to allow the asset to be transferred.
ERC20_APPROVALThe user has not set, or has revoked, the approval (approve) for the LooksRare Exchange to allow the transfer of WETH.
ERC20_BALANCEThe user-approved WETH balance is lower than the MakerOrder price.
EXECUTEDThe MakerOrder has been executed, meaning the listed asset was bought or the offer accepted.
EXPIREDThe current timestamp is greater than the endTime timestamp. Meaning the MakerOrder is expired.
INVALID_OWNERThe MakerOrder signer is no longer the asset owner.
VALIDA valid MakerOrder that can be executed (can be matched with a TakerOrder).

Order Hash

The order hash is the keccak256 hash of all the MakerOrder properties set when creating an order and a constant value.

NOTE: The order hash is automatically calculated at order creation. You don't need to worry about it.

Below is an example of how the order hash is obtained. In the following example, the order object is just a placeholder. The order object should contain a valid MakerOrder object.

import { encodeOrderParams } from "@looksrare/sdk";
import { defaultAbiCoder, keccak256 } from "ethers/lib/utils";

// NOTE: The order object is just a placeholder. The order object should contain a valid MakerOrder object.

const { encodedParams } = encodeOrderParams(order.params);

const types = [
    "bytes32",
    "bool",
    "address",
    "address",
    "uint256",
    "uint256",
    "uint256",
    "address",
    "address",
    "uint256",
    "uint256",
    "uint256",
    "uint256",
    "bytes32",
];

const values = [
  	// keccak256("MakerOrder(bool isOrderAsk,address signer,address collection,uint256 price,uint256 tokenId,uint256 amount,address strategy,address currency,uint256 nonce,uint256 startTime,uint256 endTime,uint256 minPercentageToAsk,bytes params)")
    "0x40261ade532fa1d2c7293df30aaadb9b3c616fae525a0b56d3d411c841a85028",
    order.isOrderAsk,
    order.signer,
    order.collection,
    order.price,
    order.tokenId,
    order.amount,
    order.strategy,
    order.currency,
    order.nonce,
    order.startTime,
    order.endTime,
    order.minPercentageToAsk,
    keccak256(encodedParams),
];

const hash = keccak256(defaultAbiCoder.encode(types, values));