Generate a payment link for one-time or recurring payments
| Parameter | Type | Required | Description |
|---|---|---|---|
amount_cents | integer | Yes | Total amount in cents |
currency | string | Yes | ISO 4217 currency code (e.g., “USD”) |
description | string | Yes | Description of the payment |
customer | object | No | Pre-fill customer information |
customer.email | string | No | Customer email |
customer.first_name | string | No | Customer first name |
customer.last_name | string | No | Customer last name |
products | array | No | Product line items |
products[].merchant_product_id | string | Yes* | Your product reference ID |
products[].name | string | Yes* | Product name |
products[].quantity | integer | Yes* | Quantity |
products[].price_cents | integer | Yes* | Unit price in cents |
payment_type | enum | No | one_time or subscription (default: one_time) |
subscription | object | No | Required if payment_type is subscription |
subscription.interval | enum | Yes* | daily, weekly, monthly, yearly |
subscription.interval_count | integer | No | Number of intervals (default: 1) |
subscription.trial_period_days | integer | No | Free trial days |
success_url | string | Yes | Redirect URL after successful payment |
cancel_url | string | No | Redirect URL if customer cancels |
metadata | object | No | Custom key-value pairs |
expires_at | timestamp | No | When link expires (default: 15 days) |
| Interval | interval_count | Billing Frequency |
|---|---|---|
daily | 1 | Every day |
daily | 7 | Every 7 days |
weekly | 1 | Every week |
weekly | 2 | Every 2 weeks (bi-weekly) |
monthly | 1 | Every month |
monthly | 3 | Every 3 months (quarterly) |
yearly | 1 | Every year |
| Status | Description |
|---|---|
active | Link is active and ready for payment |
expired | Link has expired (past expires_at time) |
paid | Payment completed successfully |
cancelled | Link was cancelled |
payment_link.created - Link createdpayment_link.paid - Payment completedpayment_link.expired - Link expiredorder.created - Order created from payment| Status Code | Error Code | Description |
|---|---|---|
| 400 | invalid_request | Missing or invalid parameters |
| 400 | invalid_amount | Amount must be positive integer in cents |
| 400 | invalid_currency | Unsupported currency code |
| 401 | unauthorized | Invalid or missing API key |
| 422 | validation_error | Field validation failed |
| 429 | rate_limit_exceeded | Too many requests |
expires_at to prevent stale links from being usedpayment_link.paid to fulfill orders