Skip to Content

POST /api/v1/orders

Save a Seaport order (listing or offer) to the database. For listings, the ENS name is looked up by token ID — if not found, it is fetched from The Graph and created. Existing active listings with the same order hash and source are auto-cancelled before the new one is inserted.

Fee validation is performed for Grails marketplace orders.

Authentication: Required

Cache: None

Request Body

FieldTypeRequiredDescription
typestringYesOrder type: listing, offer, or collection_offer
token_idstringYesENS name token ID
price_weistringYesPrice in wei
currency_addressstringNoPayment token (defaults to ETH zero address)
order_datastringYesJSON string of the Seaport order
order_hashstringYesUnique Seaport order hash
seller_addressstringNoSeller address (for listings)
buyer_addressstringNoBuyer address (for offers)
traitsanyNoOptional traits metadata
statusstringNoOrder status (default active)
sourcestringNoMarketplace source (default grails)

Sample Request

curl -X POST -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" \ https://api.grails.app/api/v1/orders \ -d '{ "type": "listing", "token_id": "12345678901234567890", "price_wei": "100000000000000000", "order_data": "{...}", "order_hash": "0xabc123...", "seller_address": "0xabcd..." }'

Response

// 201 Created { "success": true, "data": { "id": 43, "ens_name_id": 1, "seller_address": "0xabcd...", "price_wei": "100000000000000000", "currency_address": "0x0000000000000000000000000000000000000000", "order_hash": "0xabc123...", "order_data": "{...}", "status": "active", "source": "grails", "broker_address": null, "broker_fee_bps": null, "expires_at": "2026-04-14T12:00:00.000Z", "created_at": "2026-04-07T12:00:00.000Z", "updated_at": "2026-04-07T12:00:00.000Z" }, "meta": { "timestamp": "2026-04-07T12:00:00.000Z", "version": "1.0.0" } }

Error Responses

StatusCodeDescription
400INVALID_FEEInvalid marketplace fee in order data
403FORBIDDENAddress does not match authenticated user
500ORDER_SAVE_FAILEDFailed to save order to database
501NOT_IMPLEMENTEDOffer creation via this endpoint not yet implemented
Last updated on