🔌 API Reference

API Overview

Everything you need to know about the PayFlow API structure, authentication, and endpoints.

Base URL
All API requests should be made to the following base URL
https://api.payflow.com/v1

Note: Replace v1 with the latest API version when available.

Authentication
All API requests require authentication using your API key

Include your API key in the Authorization header of every request:

Authorization: Bearer pk_live_YOUR_API_KEY

Test Mode

Use pk_test_ keys for development and testing.

Live Mode

Use pk_live_ keys for production transactions.

API Endpoints

Payment Links
Create and manage payment links
POST/payment_links

Create a new payment link

GET/payment_links
GET/payment_links/:id
PATCH/payment_links/:id
Payments
Manage payment transactions
POST/payments/intents

Create payment intent

GET/payments
GET/payments/:id
Customers
Manage customer data
POST/customers

Create a new customer

GET/customers
GET/customers/:id
PATCH/customers/:id
Webhooks
Configure webhook endpoints
POST/webhooks

Create webhook endpoint

GET/webhooks
DELETE/webhooks/:id
Request & Response Format
All API requests and responses use JSON format
POST /v1/payment_links
Authorization: Bearer pk_live_YOUR_API_KEY
Content-Type: application/json

{
  "title": "Product Name",
  "description": "Product description",
  "amount": 1000,
  "currency": "PKR",
  "expires_at": "2024-12-31T23:59:59Z"
}
HTTP Status Codes
Standard HTTP status codes used by the PayFlow API

Success Responses

200OK - Request successful
201Created - Resource created
204No Content - Success, no response body

Error Responses

400Bad Request - Invalid parameters
401Unauthorized - Invalid API key
404Not Found - Resource not found
429Too Many Requests - Rate limit exceeded
500Internal Server Error - Server error
Rate Limiting
API rate limits to ensure fair usage and system stability
100

Requests per minute

Standard rate limit for most endpoints

1000

Requests per hour

Hourly rate limit for high-volume operations

10,000

Requests per day

Daily rate limit for all API calls

Rate Limit Headers: The API includes X-RateLimit-* headers in responses to help you track your usage and stay within limits.

SDKs & Libraries
Official and community-maintained libraries for popular programming languages

Official SDKs

JS
JavaScript/Node.js
Official
PY
Python
Official

Community Libraries

PHP
PHP
Community
GO
Go
Community

Don't see your language? We provide comprehensive REST API documentation for all integrations.

View all SDKs on GitHub →