Authentication
Every GoPay API request — payments (C2B) and transfers (B2C) alike — is authenticated with a detached Ed25519 signature sent in HTTP headers. Your private key stays on your servers; GoPay stores only the public verification key. This means a compromise of GoPay’s database can never be used to forge requests on your behalf.API Keys
Create API keys in the merchant dashboard. Each key has:- A public key identifier — sent with every request in the
X-Public-Keyheader - An Ed25519 key pair — you sign with the private half, GoPay verifies with the public half
- Permissions —
c2b(accept payments),b2c(make transfers), or both - Optional IP allowlist, per-merchant rate limit, and expiry
- Server-generated (default)
- Bring your own key
GoPay generates the key pair and returns the private key once, at creation time. Store it in a secrets manager immediately — GoPay does not keep a copy and cannot recover it.
Required Headers
The Canonical String (v1)
The signature is computed over this string — lines joined with\n, no trailing newline:
Sign the canonical string with your Ed25519 private key and base64-encode the 64-byte result.
Because the host is part of the canonical string, a signature created for the sandbox cannot be replayed against production (and vice versa). Always sign with the exact host you send the request to.
Signing Helpers
Your private key is the base64 string shown once at key creation — it decodes to a 64-byte key (some libraries want only the first 32 bytes, the seed). These helpers return the exact headers to attach to any GoPay API request.- Node.js
- Python
- Go
What Else Is Checked
Beyond the signature, GoPay enforces per key:- Permission — the key must carry
c2bfor payments orb2cfor transfers - IP allowlist — if configured, requests from other IPs are rejected
- Replay protection — each
X-Request-IDis accepted exactly once - Rate limit — a per-merchant request budget
