Skip to content

Calling Market

https://market.pactnetwork.io/v1/<endpoint>/<upstream-path>

v1 is a literal Pact-side prefix — the API version that the gate, the signature middleware, and the proxy route all mount under. <endpoint> is the identifier issued to private-beta users at access time. <upstream-path> is the upstream path as-is: same segments, same query string, same body.

HeaderValue
AuthorizationBearer pact_beta_… (your private-beta key)
Content-TypeMatch upstream’s expected content type. Usually application/json.

A missing or invalid Authorization header returns 403 pact_auth_not_in_beta. See Applying for access.

Terminal window
curl -X POST \
https://market.pactnetwork.io/v1/<endpoint>/<upstream-path> \
-H "Authorization: Bearer $PACT_BETA_KEY" \
-H "Content-Type: application/json" \
-d '{"limit": 10}'

Market returns the upstream body unchanged. Headers it adds:

  • X-Pact-Classificationsuccess, client_error, or server_error.
  • X-Pact-Call-Id — opaque ID. Use this when reporting issues.
  • X-Pact-Premium-Microusd — premium charged for this call, in microUSDC.

Non-upstream errors (auth, rate limit, upstream failures) return JSON. The private-beta gate returns a flat shape:

{ "error": "pact_auth_not_in_beta" }

Other Market errors use the nested envelope:

{
"error": {
"code": "RATE_LIMIT",
"message": "Per-key cap exceeded.",
"call_id": "..."
}
}
Statuserror / error.codeWhen
403pact_auth_not_in_betaMissing/invalid Bearer key, or key revoked. The private-beta gate is on. See Applying for access.
401AUTH_FAILEDRequest carries an x-pact-agent header and its ed25519 signature didn’t verify against that key. Unsigned requests skip this check.
429RATE_LIMITYou hit the per-key cap.
502UPSTREAM_UNREACHABLEMarket couldn’t reach the upstream. Classifies as server_error, refund queued.
504UPSTREAM_TIMEOUTRead timeout from upstream. Classifies as server_error.

Upstream errors pass through as-is — same status, body, and headers. Market only adds its classification headers.

If your call is classified server_error:

  • The refund is queued; you don’t do anything.
  • The next settler run posts it on-chain. Cadence: Status.
  • Confirm by querying the indexer with X-Pact-Call-Id.