Skip to main content
This guide walks you through everything you need to make your first API call to Paylink. By the end you will have initialized a sandbox payment and received a hosted checkout URL you can open in a browser.
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 the secret somewhere safe (for example, an environment variable). You will not be able to view it again after initial creation.
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
Sign the exact bytes you send as the request body. Any change to JSON whitespace after signing — even a single added space — will invalidate the signature and produce a 401 error.
4

Initialize a payment

Call 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.Request
POST /payments/initialize
Request body
Response
200 OK
Open the 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 GET /payments/verify/{reference}.
GET /payments/verify/{reference}
A successful verification returns a 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.