Skip to main content

API Reference

The Prism Gateway API is a REST API for creating charges, verifying payments, managing webhooks, and querying transactions. For most integrations, the server-side SDKs are recommended — they handle authentication, protocol flow, and error handling automatically. The API is available for custom integrations or when you need direct control.

Base URL

https://prism-gw.fd.xyz
Prism uses a single gateway URL. Testnet vs. mainnet is determined by the chain specified in your requests, not by the URL.

Authentication

Authenticate requests by including your API key in the X-API-Key header:
curl https://prism-gw.fd.xyz/v1/charges \
  -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json"
Get your API key from the Prism ConsoleAPI Keys.
Keep your API key secret. Never expose it in client-side code, browser requests, or public repositories.

Request Format

  • Content-Type: application/json
  • All request bodies are JSON
  • Use standard HTTP methods: GET, POST, DELETE

Response Format

Successful responses:
{
  "success": true,
  "data": {
    "id": "ch_abc123def456",
    "amount": "10000",
    "token": "USDC",
    "chain": "base",
    "status": "pending"
  }
}
Error responses:
{
  "success": false,
  "error": {
    "code": "INVALID_AMOUNT",
    "message": "Amount must be greater than 0"
  }
}
Common error codes:
HTTP StatusError CodeDescription
400INVALID_REQUESTMalformed request body
401UNAUTHORIZEDMissing or invalid API key
404NOT_FOUNDResource not found
422INVALID_AMOUNTInvalid amount or token
429RATE_LIMITEDToo many requests
500INTERNAL_ERRORServer error — retry with backoff

Endpoints Overview

MethodEndpointDescription
POST/v1/chargesCreate a new payment charge
GET/v1/charges/:idGet charge details
DELETE/v1/charges/:idCancel a pending charge
POST/v1/webhooksRegister a webhook endpoint
GET/v1/transactionsList transactions
See Endpoints for full request/response documentation.

Rate Limits

The API enforces rate limits to ensure stability. Rate limit info is returned in response headers:
HeaderDescription
X-RateLimit-LimitMaximum requests per window
X-RateLimit-RemainingRemaining requests in current window
X-RateLimit-ResetUnix timestamp when the window resets
When rate limited, the API returns 429 Too Many Requests. Back off and retry after the reset time.

SDKs

For most integrations, use a server-side SDK instead of calling the API directly. The SDKs handle authentication, x402 protocol flow, payment verification, and type safety: