Cost+ Docs

Payment Links

Create reusable payment links

Payment links are reusable URLs that allow customers to pay for an order. Unlike standard orders that expire after a single failed attempt, payment links support multiple retry attempts, making them ideal for invoices, email-based payments, and scenarios where the customer may not pay immediately.

Key Features

  • Reusable: Customers can retry payment up to 25 times if previous attempts fail.
  • Long-lived: Default expiration is 30 days (configurable via expiration_period).
  • Shareable: Send the link via email, SMS, chat, or embed it on your website.

Send a POST request to /v1/paymentlinks/:

{
  "merchant_order_id": "my-order-id",
  "amount": 1295,
  "currency": "EUR",
  "description": "My payment link",
  "return_url": "https://www.example.com",
  "webhook_url": "https://www.example.com/webhook"
}

Required Fields

FieldDescription
merchant_order_idYour own reference ID for the payment link
amountAmount in cents (e.g., 12.95 EUR = 1295)
currencyISO 4217 currency code (e.g., EUR, GBP)

Optional Fields

FieldDescription
payment_methodsFilter which payment methods are available
descriptionDescription shown to the customer
expiration_periodISO 8601 duration. Default is P30D (30 days)
return_urlURL to redirect the customer after successful payment
webhook_urlURL to receive status change notifications
customerCustomer details object (name, email, etc.)

[!TIP] Include the customer object with an email address if you want Cost+ to send the payment link to the customer automatically.

Send a GET request to /v1/paymentlinks/\{id\}/ to retrieve the current state of a payment link:

GET /v1/paymentlinks/pl_abc123.../

The response includes the payment link URL, current status, and details of any payment attempts.

StatusDescription
newThe link has been created but no payment attempt has been made.
processingA payment attempt is currently in progress.
all_unsuccessfulAll payment attempts so far have failed. The customer can still retry (up to 25 attempts).
completedPayment was successful. The link is no longer active.
expiredThe link has expired before a successful payment was made.

[!NOTE] The all_unsuccessful status is not a final status. The customer can still attempt to pay again until either the payment succeeds, the maximum number of attempts (25) is reached, or the link expires.

[!WARNING] Once a payment link reaches the completed or expired status, it cannot be used again. Create a new payment link if the customer needs to pay again.

Example Workflow

  1. Create a payment link via POST /v1/paymentlinks/.
  2. Share the returned URL with your customer (e.g., via email).
  3. The customer opens the link and completes payment.
  4. Cost+ sends a webhook to your webhook_url when the status changes.
  5. Verify the payment link status via GET /v1/paymentlinks/\{id\}/.
  6. Fulfill the order once the status is completed.

On this page