Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.swiftpay.finance/llms.txt

Use this file to discover all available pages before exploring further.

Quickstart for API integrations

This guide is for developers integrating with the SwiftPay API.

Choose your integration path

Before coding, decide your implementation model:

REST API — Invoices

Full control over invoice creation and status orchestration.

x402 — Per-request payments

Protect any API endpoint with HTTP 402. Callers pay per request with USDC.

Hosted Checkout

Redirect-based payment flow managed by SwiftPay. (coming soon)

Embedded iFrame

In-app payment surface. (coming soon)
If you are shipping now, start with REST API for invoice-based flows or x402 for per-request API monetisation.

1) Get your API keys from cockpit.swiftpay.finance

  1. Open the app at https://cockpit.swiftpay.finance and create/sign in to your account.
  2. Go to Settings (/settings).
  3. In the API Keys section, copy:
    • Secret key (sk_live_...) for server-side API calls.
    • Publishable key (pk_live_...) for checkout/session flows.
  4. Use Rotate if you need to regenerate keys (the old secret key becomes invalid).
Keep your secret key server-side only. Never ship it in browser code.

2) Authenticate requests

SwiftPay uses a custom API key header:
X-Swift-Key: sk_live_...
Use sk_live_... for server-side invoice and reporting operations. Use pk_live_... for checkout/session flows.

Example: create an invoice

curl -X POST https://api.swiftpay.finance/v1/invoices \
  -H "Content-Type: application/json" \
  -H "X-Swift-Key: sk_live_your_secret_key" \
  -d '{
    "externalRef": "order_123",
    "token": "USDC",
    "amountExpected": 100,
    "chains": ["sepolia"]
  }'