Guides
This guide includes full reference and real-world examples for every endpoint listed in this documentation. Each section provides an overview of the endpoint, available fields, their meaning, and a working example.
🔐 Authentication
Get OAuth Token
Description
Generates an OAuth 2.0 token using client_credentials. Required before making any authenticated requests.
Method & Path
POST /oauth/token
Input Parameters
grant_type(required): Must beclient_credentialsProvide
client_idandclient_secretusing Basic Auth (base64-encoded)
Request:
curl -X POST https://public-api.alternativepayments.io/oauth/token \
-H "Authorization: Basic BASE64(client_id:client_secret)" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials"Response:
{
"access_token": "eyJ0eXAiOiJKV1QiLCJh...",
"token_type": "Bearer",
"expires_in": 3600
}Header format:
Note: There is no refresh token in the client-credentials flow. If the token expires, request a new one.
👤 Customers
List Customers
Description Retrieves a paginated list of customer records.
Method & Path
GET /customers
Input Parameters:
limit(integer): Number of records to returnafter(string): Cursor for paginationcompany_name(string): Filter by namecreated_at(range): Filter by created date
Request:
Response:
Create Customer
Description Creates a new customer in your account.
Method & Path
POST /customers
Input Parameters:
name(string, required): Customer or company nameemail(string, required): Billing contact emailexternal_id(string, optional): Your internal reference ID
Request:
Response:
Retrieve Customer
Description Fetches details of a single customer.
Method & Path
GET /customers/{id}
Request:
Response:
Archive Customer
Description Soft-deletes (archives) a customer from your list.
Method & Path
DELETE /customers/{id}
Request:
List Customer Users
Description Retrieves users linked to a customer account.
Method & Path
GET /customers/{id}/users
Request:
Response:
Add User to Customer
Description Adds a new user under the given customer.
Method & Path
POST /customers/{id}/users
Input Parameters:
email(string)first_name(string)last_name(string)
Request:
Response:
🧾 Invoices
List Invoices
Description Returns all invoices filtered by status, customer, or date.
Method & Path
GET /invoices
Input Parameters:
status(e.g., PAID, OVERDUE)created_at,due_daterangescustomer_id
Request:
Response:
Create Invoice
Description Creates an invoice with line items.
Method & Path
POST /invoices
Input Parameters:
customer_idcurrencydue_dateline_items[]withdescription,amount,quantity
Request:
Response:
Retrieve Invoice
Description Returns full details for a specific invoice.
Method & Path
GET /invoices/{id}
Request:
Response:
Archive Invoice
Description Soft-deletes an invoice.
Method & Path
DELETE /invoices/{id}
Request:
Get Invoice Payment Link
Description Generates a hosted payment link for an invoice.
Method & Path
GET /invoices/{id}/payment-link
Request:
Response:
Get Invoice PDF
Description Generates a signed URL to download invoice PDF.
Method & Path
GET /invoices/{id}/pdf-link
Request:
Response:
💵 Payment Request
Create Payment Request
Description Creates a payment request (not tied to invoice).
Method & Path
POST /payments/request
Input Parameters:
amount,currency,redirect_url,reference_id
Request:
Response:
Get Payment Request by ID
Description Returns details for a payment request.
Method & Path
GET /payments/request/{id}
Request:
Response:
💳 Transactions
List Transactions
Description Fetches transactions by filters.
Method & Path
GET /payments
Input Parameters:
status,type,payment_method,invoice_id,customer_id
Request:
Response:
💸 Payouts
List Payouts
Description Returns list of payout batches.
Method & Path
GET /payouts
Request:
Response:
Get Payout by ID
Description Returns details for a single payout.
Method & Path
GET /payouts/{id}
Request:
Response:
List Payout Transactions
Description Returns all transactions for a specific payout.
Method & Path
GET /payouts/{id}/transactions
Request:
Response:
⚠️Error Handling
All errors return standard HTTP status codes plus a JSON body:
400
Malformed JSON or missing required field
401
Missing or invalid token
403
Token is valid but lacks permission (rare)
404
Object not found
422
Semantic validation error (e.g., unsupported currency)
429
Rate limit exceeded.
500
Unexpected server error; retry later
Last updated
Was this helpful?
