Skip to main content

Payment links

Payment links let you create a hosted payment page and share its URL with a customer. Use a link for invoices, one-off collections, or payments where you do not want to build checkout UI yourself.

Engineering flowBuild, verify, then reconcile
Test this flow in sandbox
  1. 01Create linkCreate it on your server and store its ID with your order.
  2. 02Share checkoutSend only the hosted URL to the intended customer.
  3. 03Customer paysA redirect improves UX but does not prove payment.
  4. 04Verify paymentProcess the signed event and reconcile amount and order once.

Use a dashboard-issued sandbox API key on your server. Do not enter credentials into this documentation site.

StepYour application doesDo not rely on
CreateCreates a link on the server and stores its ID against your order.A client-side API key.
ShareSends the returned hosted URL to the intended customer.Altering the amount/title after sharing without updating your order.
ReturnOptionally receives the customer at a redirect URL.A redirect as proof of payment.
ConfirmVerifies the signed payment event and link/payment state.An unverified browser callback.

Create the link on your server with the amount, currency, title, and optional redirect URL.

curl -X POST https://sandbox.payscribe.ng/api/v1/links \
-H "Authorization: Bearer $PAYSCRIBE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount":15000,
"currency":"NGN",
"title":"Payment for invoice INV-10021",
"description":"Website services",
"redirect":"https://example.com/payment-return"
}'

Store the returned link ID and associate it with your internal order before sharing the returned URL.

Present and confirm payment safely

You may redirect the customer to the hosted URL or share it over an appropriate channel. A redirect_url improves customer experience after checkout, but it is not an authoritative payment confirmation.

Mark an order paid only after the relevant signed webhook has been verified and its event ID processed once. Then reconcile the amount, currency, link/order association, and final state before fulfilment.

Use the API to retrieve, list, update, or delete links. If a link is changed or removed, update the related order state in your system and avoid accepting an unexpected or stale payment.

Common implementation mistakes

MistakeBetter approach
Marking an order paid on browser redirectConfirm through a verified webhook and API record.
Creating links from frontend codeCreate them from your backend with the API key.
Not storing the link IDPersist it with your internal order/reference.
Processing the same webhook twiceStore event IDs with a unique constraint.

See Webhooks for secure event handling and the Payment Links API reference for the full request and response contracts.

Was this page helpful?

Report a docs issue →