Skip to main content
Use Paylink Checkout to collect card, bank transfer, USSD, and direct-debit payments from your customers. The flow has three steps: initialize a payment session on your server, redirect the customer to the hosted checkout page, then verify the result server-side once they return.

Initialize a Payment

Send a POST request to /payments/initialize from your server. Never call this endpoint from client-side code — your secret key must stay private.
Request
A successful response returns an authorization_url that you use to redirect the customer:
Response
Save the reference value to your database before redirecting. You will need it to verify the payment outcome.

Redirect the Customer to Checkout

Redirect the customer’s browser to the authorization_url from the response. The customer completes payment on the Paylink-hosted checkout page and is then sent back to your callback_url.
Example redirect (HTTP response header)

Use Sandbox Test Cards

Use the following cards on the sandbox checkout page to simulate different payment outcomes:

Handle the Callback

When the customer returns to your callback_url, Paylink appends the reference as a query parameter:
Never trust the callback URL alone to confirm a successful payment. A customer can visit your callback URL directly without completing payment. Always verify the payment server-side using the reference.

Verify Payment Status

Call GET /payments/verify/{reference} from your server immediately after receiving the callback:
Request
Response
Only fulfil the order — ship goods, activate a subscription, grant access — when the returned status is success.

Payment Statuses

Use Webhooks for Reliable Delivery

Callbacks depend on the customer’s browser returning to your site, which can fail if they close the tab or lose connectivity. Webhooks are server-to-server notifications sent directly to your webhook_url, making them the most reliable way to track payment outcomes. Always set a webhook_url when you initialize a payment:
Webhook event payload (example)
Respond to webhook requests with an HTTP 200 status as quickly as possible. Move order-fulfillment logic to a background job so you don’t time out.

View Transaction History

Retrieve a paginated list of all your transactions at GET /merchants/transactions. Use the query parameters below to filter results:
Example request

Payments API Reference

Full parameter list and response schema for the payments endpoints.

Webhooks Guide

Learn how to verify webhook signatures and handle events securely.