Skip to main content

Quickstart for API integrations

This guide is for developers integrating with the SwiftPay API.

Choose your integration path

Before coding, decide your implementation model: If you are shipping now, start with REST API and move to Checkout or iFrame when they are launched.

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"]
  }'