On this page
API reference
Marketplace API
Use the HTTP and WebSocket API of a Pando marketplace on Cloudflare.
Use your marketplace’s own HTTPS origin. Examples use https://marketplace.example. The Ethereum JSON API is under /v1. An Ink deployment uses its Ink routes. The versions belong to the template installed in the operator’s account.
Public marketplace reads, quotes and order preparation use ordinary HTTP. Order submission requires the maker’s signature. The admin token is for setup and data administration. Keep it server-side. The wallet of the shopper, holder or maker signs and sends every transaction. Simple Things Ltd publishes the software and receives no share of marketplace trades.
Amounts and identifiers#
Amounts such as priceWei are wei as decimal strings. Read currency to distinguish ETH from WETH. Use BigInt for arithmetic. Ethereum transaction value fields can be decimal or hex quantities depending on the route. Treat token IDs as strings. Convert timestamps using the units named in each response.
Errors#
The Ethereum JSON engine uses the following envelope. param is optional and identifies a path, query or body field. Send the Request-Id when reporting an error from a route that supplies one. Setup, data and Ink routes describe their additional shapes on their own pages.
{"error":{"type":"invalid_request","message":"This address is a WebSocket. Connect with a WebSocket client."}}| Status | Type | Meaning |
|---|---|---|
| 400 | invalid_request |
Input validation or request parsing failed. |
| 404 | not_found |
Route, collection, feed, venue or named resource is unavailable. The outer Worker can reject a contract or chain before validation. |
| 409 | configuration_changed |
Marketplace settings changed during preparation or since signing. Prepare again. |
| 409 | unprocessable |
The listing comparison changed during a pool estimate. |
| 410 | not_found |
The route is retired. |
| 413 | invalid_request |
The Worker refused an oversized order submission. |
| 422 | unprocessable |
An order, NFT, account or simulation failed the route’s checks. |
| 426 | invalid_request |
The route requires a WebSocket upgrade. |
| 429 | rate_limited |
A request exceeded its bucket. |
| 500 | internal_error |
Unexpected engine failure. |
| 502 | upstream_error |
The Worker could not get a usable answer from a venue or chain service. |
| 503 | not_configured |
Settings are missing, invalid or temporarily unreadable, or a required integration is disabled. |
| 503 | upstream_error |
A read could not verify the current state, or the Worker refused a response involving a blocked contract. |
Caching and CORS#
The Cloudflare Ethereum template sets Cache-Control: no-store on marketplace HTML and ordinary JSON responses, including reads for which the shared engine calculates a cache lifetime. Successful images and versioned browser modules have separate policies. An upgrade has no HTTP response body.
The Ethereum engine serves Access-Control-Allow-Origin: * on matched /v1/* API routes and image responses. JSON preflights allow GET, POST and OPTIONS, reflecting requested headers. It exposes Request-Id and Server-Timing on the versioned API. Images advertise GET. /v1 itself also matches the middleware wildcard. Responses returned before the engine, including setup, operator data and Ink, have their own rules. Use the same origin for their browser calls.
Limits#
Cloudflare configures 60 chain-read requests and 30 wallet reads per 60 seconds in separate IP-based buckets. These are Cloudflare rate-limit bindings. A response with Retry-After: 60 asks the client to pause. Some book reads only take a chain-read slot when they need a live fallback. Setup status and admin attempts use the separate rules in Setup and administration.
GET /v1#
Discover this marketplace’s API entry points.
There are no path or query parameters.
Response fields#
| Field | Type | Meaning |
|---|---|---|
object |
string | Always api. |
docs, collections, health |
URLs | Links on this marketplace’s origin. |
Cache. Cache-Control: no-store.
Limit. None specific.
Example request#
curl https://marketplace.example/v1const response = await fetch("https://marketplace.example/v1");
const result = await response.json();Example response#
{
"object": "api",
"docs": "https://marketplace.example/docs",
"collections": "https://marketplace.example/v1/collections",
"health": "https://marketplace.example/v1/health"
}OPTIONS /v1/*#
Preflight a browser request that passes the template path filter.
Path and query parameters#
| Name | Type | Required | Meaning | Default | Limits |
|---|---|---|---|---|---|
path |
path | Yes | A matched marketplace resource under this prefix. | — | — |
Response fields#
| Field | Type | Meaning |
|---|---|---|
body |
empty | HTTP 204. |
Access-Control-Allow-Origin, Access-Control-Allow-Methods, Access-Control-Allow-Headers |
headers | Wildcard origin, configured methods and requested headers when present. |
Cache. Cache-Control: no-store on the Ethereum marketplace.
Limit. None specific.
Errors#
| Status | Code | Meaning |
|---|---|---|
| 404 | not_found |
The collection, feed or venue is unavailable on this site. |
| 503 | not_configured |
The required checkout or order setting is unavailable. |
Example request#
curl \
-X OPTIONS \
-H 'Origin: https://client.example' \
-H 'Access-Control-Request-Method: GET' \
https://marketplace.example/v1/collections/1/0x4a8b01e437c65fa8612e8b699266c0e0a98ff65cExample response#
HTTP/1.1 204 No Content
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET,POST,OPTIONSOPTIONS /img/*#
Preflight a browser request that passes the template path filter.
Path and query parameters#
| Name | Type | Required | Meaning | Default | Limits |
|---|---|---|---|---|---|
path |
path | Yes | A matched marketplace resource under this prefix. | — | — |
Response fields#
| Field | Type | Meaning |
|---|---|---|
body |
empty | HTTP 204. |
Access-Control-Allow-Origin, Access-Control-Allow-Methods, Access-Control-Allow-Headers |
headers | Wildcard origin, configured methods and requested headers when present. |
Cache. Cache-Control: no-store on the Ethereum marketplace.
Limit. None specific.
Errors#
| Status | Code | Meaning |
|---|---|---|
| 404 | not_found |
The collection, feed or venue is unavailable on this site. |
| 503 | not_configured |
The required checkout or order setting is unavailable. |
Example request#
curl \
-X OPTIONS \
-H 'Origin: https://client.example' \
-H 'Access-Control-Request-Method: GET' \
https://marketplace.example/img/1/0x4a8b01e437c65fa8612e8b699266c0e0a98ff65cExample response#
HTTP/1.1 204 No Content
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET