How it works

The lifecycle of a Payment Link, the objects behind it, and who is responsible for what.

The lifecycle

graph LR
    A["Create link<br>(API or Portal)"] --> B["Share URL<br>with customer"]
    B --> C["Customer pays on<br>hosted page"]
    C --> D["Webhook sent<br>to your backend"]
    D --> E["Link closes"]
  1. Create. Your backend calls the Payrails API, or you create the link in the Portal. Payrails returns a hosted payment page URL.
  2. Share. You send the URL to your customer through any channel.
  3. Pay. The customer opens the link and pays on the Payrails-hosted page.
  4. Notify. Payrails sends a webhook to your backend with the outcome following the configured workflow.
  5. Close. The link closes when it is fully paid, expires, or you delete it.
ℹ️

Webhooks are the source of truth for payment state. Do not rely on the confirmation screen the customer sees, on a redirect, or on an API response alone. See Track and reconcile.

One link, one execution, many payments

graph LR
    A["Drop-in link<br>(the payment request)"] --> B["Execution<br>(one per link)"]
    B --> C["Payment 1"]
    B --> D["Payment 2"]
    B --> E["Payment n"]
ObjectWhat it represents
Drop-in linkThe payment request: total amount, currency, expiry, description, and the rules for collection. It is not a payment
ExecutionThe workflow execution behind the link. There is exactly one per link, created when the link is first used. Its ID appears on the link as executionId
PaymentAn individual payment made against that execution. One in single payment mode, several in partial payments mode

This is the standard Payrails execution-and-payment model, so reporting and cross-referencing behave the same as for any other execution.

paidAmount on the link accumulates across the payments beneath the execution.

Who is responsible for what

Payrails handlesYou handle
Hosting the payment pageCreating and configuring links
PCI compliance and page securitySharing links with your customers
Payment processing, authorization, and captureHosting and securing a webhook endpoint
3-D Secure enforcementProcessing webhook events idempotently
Accumulating paidAmount across paymentsUpdating your own systems, such as CRM, ERP, or order management
Execution and payment lifecycle managementAll customer communications: receipts, confirmations, reminders, refund notices

Link statuses

StatusMeaningWhat causes it
enabledThe link can accept payment. A payment may have been attempted but not completed successfullyThe initial state after creation
closedFully paid. No further payment is acceptedSingle mode: one successful payment. Partial mode: paidAmount reaches amount
expiredPast expiresAt. No new payment can start, and it cannot be reactivatedThe expiry timestamp passed
deletedDeleted by you. No new payment can start, and it cannot be restoredYou called the delete endpoint

Completed payments remain valid in all of these states, and the link record stays readable.

Failed payments do not change the status. The link stays enabled and the payer can retry.

State transitions are calculated by Payrails. Webhooks tell you the outcome of each payment, but they do not drive the status themselves.

Next steps


Did this page help you?