Payment Link
With PagaSul, you can accept payments by sharing a link directly with your customer. No server-to-server API call is needed — the link is a URL with payment parameters in the query string. When the customer follows it, PagaSul renders the hosted checkout.
Here is a step-by-step description of the payment processing flow with the payment link.
How to integrate
1. Build the payment link
Construct a URL to https://checkout.pagasul.com/pay with your payment parameters as a query string. You can do this on the server or the client.
https://checkout.pagasul.com/pay
?client_id=123
&client_payment_id=order_42
&amount=150.00
¤cy=BRL
&payer.id=user_1234
&callback_url=https%3A%2F%2Fyour-site.com%2Fwebhook
&payment_options.return_url=https%3A%2F%2Fyour-site.com%2Fthank-you
client_payment_id must be unique per payment in your system — it is used for idempotency.
To preselect a payment method, include payment_method=BR.PIX (or another code). Without it, the customer chooses on the checkout page. See Payment Methods for available codes and any additional required fields per method.
For the full parameter list, see Create payment link in the API Reference.
2. Share the link
Send the link to your customer via email, SMS, or embed it as a button in your UI. When the customer follows it, PagaSul opens the checkout page.
3. Handle the callback
When the payment is completed, PagaSul sends a POST to your callback_url. Verify the signature in the header, then check the status field:
| Status | Meaning | Action |
|---|---|---|
success | Payment completed | Fulfil the order |
decline | Payment declined | Notify the customer |
failed | Processing error | Contact PagaSul support |
For all statuses and result codes, see Statuses & Codes. For the full callback structure, see Callbacks.
4. Return the customer
After checkout, PagaSul redirects the customer to payment_options.return_url. Use it to display a confirmation page. Do not use this redirect to determine payment outcome — use the callback for that.