1
Get your API credentials
Sign in to the Paylink Dashboard and navigate to Settings → API Keys. Create a new key pair to obtain your:
- API Key ID (
X-Key-Id) — a public identifier for the key - API Secret — the private value you use to sign requests
Store credentials as environment variables
2
Set your base URL to sandbox
All calls in this guide target the sandbox environment. The sandbox is fully isolated from live funds, so you can experiment freely.
Set the base URL in your environment so you can switch to live later with a single change:
Set base URL
3
Sign your first request
Every protected endpoint requires three authentication headers. You build the
X-Signature by computing an HMAC-SHA256 digest over {timestamp}:{raw_request_body} using your API secret.Here is a reusable Python helper that builds the headers for any request body:signing.py
4
Initialize a payment
Call ResponseOpen the
POST /payments/initialize to create a new payment session. The response contains an authorization_url — redirect your customer there to complete payment on the hosted checkout page.RequestPOST /payments/initialize
Request body
200 OK
authorization_url in your browser to walk through the sandbox checkout flow. Use the sandbox test cards to simulate different payment outcomes.5
Verify the payment
After your customer completes checkout (or your webhook fires), confirm the final payment status by calling A successful verification returns a
GET /payments/verify/{reference}.GET /payments/verify/{reference}
status field of "success" and the full payment record. Store the verified status in your database before fulfilling the order — never rely solely on the callback redirect.This quickstart only covers the essentials of request signing. To understand the full signing algorithm, replay-attack protection, and how to handle authentication errors, read the Authentication page.
Next Steps
Authentication
Deep-dive into HMAC-SHA256 signing, required headers, and how to handle auth errors.
Webhooks
Set up your webhook endpoint to receive real-time payment status updates.
Accept Payments
Build a full end-to-end checkout flow with the Paylink hosted payment page.