Create and manage payment links programmatically with our REST API.
https://api.payflow.com/v1/payment_links
/v1/payment_links
curl -X POST https://api.payflow.com/v1/payment_links \ -H "Authorization: Bearer pk_live_YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "title": "Premium Course Access", "description": "Get access to our premium course content", "amount": 2500, "currency": "PKR", "expires_at": "2024-12-31T23:59:59Z" }'
title
stringamount
integercurrency
stringdescription
stringexpires_at
datetimesuccess_url
stringcancel_url
string{ "id": "pl_1234567890", "title": "Premium Course Access", "description": "Get access to our premium course content", "amount": 2500, "currency": "PKR", "status": "active", "url": "https://payflow.com/pay/premium-course-123", "expires_at": "2024-12-31T23:59:59Z", "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T10:30:00Z" }
/v1/payment_links
limit
Default: 10, Max: 100starting_after
Cursor for paginationstatus
Filter by statuscurl -X GET "https://api.payflow.com/v1/payment_links?limit=20&status=active" \ -H "Authorization: Bearer pk_live_YOUR_API_KEY"
{ "data": [ { "id": "pl_1234567890", "title": "Premium Course Access", "amount": 2500, "currency": "PKR", "status": "active", "url": "https://payflow.com/pay/premium-course-123", "created_at": "2024-01-15T10:30:00Z" } ], "has_more": false, "total_count": 1 }
/v1/payment_links/:id
curl -X GET https://api.payflow.com/v1/payment_links/pl_1234567890 \ -H "Authorization: Bearer pk_live_YOUR_API_KEY"
{ "id": "pl_1234567890", "title": "Premium Course Access", "description": "Get access to our premium course content", "amount": 2500, "currency": "PKR", "status": "active", "url": "https://payflow.com/pay/premium-course-123", "clicks": 15, "conversion_rate": 0.33, "total_revenue": 7500, "expires_at": "2024-12-31T23:59:59Z", "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T10:30:00Z" }
/v1/payment_links/:id
curl -X PATCH https://api.payflow.com/v1/payment_links/pl_1234567890 \ -H "Authorization: Bearer pk_live_YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "title": "Updated Course Title", "amount": 3000 }'
title
- Product titledescription
- Product descriptionamount
- Price amountexpires_at
- Expiration datesuccess_url
- Success redirect URLcancel_url
- Cancel redirect URLInvalid parameters or missing required fields
Check your request body and ensure all required fields are present
Invalid or missing API key
Verify your API key is correct and included in the Authorization header
Payment link not found
Check the payment link ID in your request URL
Standard rate limit
Hourly limit
Daily limit
Rate Limit Headers: The API includes X-RateLimit-*
headers in responses to help you track your usage and stay within limits.