Complete reference documentation for the Paebs Payments REST API. Build powerful payment integrations.
The Paebs API uses API keys to authenticate requests. You can view and manage your API keys in your Dashboard. Authentication is performed via HTTP Bearer auth. Provide your API key as the bearer token value.
Authorization: Bearer sk_live_4eC39HqLyjWDarjtT1zdp7dc
Keep your API keys secure! Do not share them in public repositories or client-side code.
Paebs uses conventional HTTP response codes to indicate success or failure. Codes in the 2xx range indicate success, 4xx indicate client errors, and 5xx indicate server errors.
| Code | Description |
|---|---|
200 |
Success |
400 |
Bad Request - Invalid parameters |
401 |
Unauthorized - Invalid API key |
402 |
Payment Required - Card declined |
404 |
Not Found - Resource doesn't exist |
429 |
Too Many Requests - Rate limit exceeded |
500 |
Server Error - Something went wrong |
All list endpoints support pagination using limit and starting_after parameters. The response includes a has_more boolean indicating if more results exist.
/v1/payments?limit=10&starting_after=pay_abc123
List with pagination
Request Body
{
"object": "list",
"data": [...],
"has_more": true,
"url": "/v1/payments"
}
Payment objects represent a single payment attempt. Create a Payment to charge a card. You can retrieve individual payments or list all payments.
/v1/payments
Create a new payment
Request Body
{
"amount": 2500,
"currency": "gbp",
"source": "tok_visa",
"description": "Order #12345",
"metadata": {
"order_id": "12345"
}
}
Response
{
"id": "pay_1NqL9JABC123def456",
"object": "payment",
"amount": 2500,
"currency": "gbp",
"status": "succeeded",
"source": {
"id": "card_1NqL9JABC789",
"brand": "visa",
"last4": "4242"
},
"created": 1693425365,
"description": "Order #12345"
}
/v1/payments/{id}
Retrieve a payment by ID
Response
{
"id": "pay_1NqL9JABC123def456",
"object": "payment",
"amount": 2500,
"currency": "gbp",
"status": "succeeded",
"created": 1693425365
}
/v1/payments
List all payments with optional filters
Response
{
"object": "list",
"data": [
{
"id": "pay_1NqL9JABC123def456",
"amount": 2500,
"status": "succeeded"
}
],
"has_more": true
}
/v1/payments/{id}/capture
Capture an authorized payment
Request Body
{
"amount": 2000
}
Response
{
"id": "pay_1NqL9JABC123def456",
"status": "succeeded",
"captured": true,
"amount_captured": 2000
}
/v1/payments/{id}/cancel
Cancel an uncaptured payment
Response
{
"id": "pay_1NqL9JABC123def456",
"status": "canceled"
}
Refund objects allow you to refund a payment that has been previously created. Funds are returned to the customer's card.
/v1/refunds
Create a full or partial refund
Request Body
{
"payment": "pay_1NqL9JABC123def456",
"amount": 1000,
"reason": "requested_by_customer"
}
Response
{
"id": "re_1NqMAABC123xyz789",
"object": "refund",
"amount": 1000,
"currency": "gbp",
"payment": "pay_1NqL9JABC123def456",
"status": "succeeded",
"created": 1693426000
}
/v1/refunds/{id}
Retrieve a refund by ID
Response
{
"id": "re_1NqMAABC123xyz789",
"object": "refund",
"amount": 1000,
"status": "succeeded"
}
/v1/refunds
List all refunds
Response
{
"object": "list",
"data": [...],
"has_more": false
}
Customer objects allow you to save payment methods and track payments across multiple sessions.
/v1/customers
Create a new customer
Request Body
{
"email": "customer@example.com",
"name": "John Smith",
"phone": "+447123456789",
"metadata": {
"internal_id": "usr_123"
}
}
Response
{
"id": "cus_1NqNBBBC456abc",
"object": "customer",
"email": "customer@example.com",
"name": "John Smith",
"created": 1693427000
}
/v1/customers/{id}
Retrieve a customer by ID
Response
{
"id": "cus_1NqNBBBC456abc",
"object": "customer",
"email": "customer@example.com",
"name": "John Smith"
}
/v1/customers/{id}
Update customer details
Request Body
{
"email": "newemail@example.com"
}
Response
{
"id": "cus_1NqNBBBC456abc",
"email": "newemail@example.com"
}
/v1/customers/{id}
Delete a customer
Response
{
"id": "cus_1NqNBBBC456abc",
"object": "customer",
"deleted": true
}
/v1/customers
List all customers
Response
{
"object": "list",
"data": [...],
"has_more": true
}
Card objects represent a customer's payment card. You can save cards to customers for future payments.
/v1/customers/{customer_id}/cards
Add a card to a customer
Request Body
{
"source": "tok_visa"
}
Response
{
"id": "card_1NqOCCCC789xyz",
"object": "card",
"brand": "visa",
"last4": "4242",
"exp_month": 12,
"exp_year": 2025,
"customer": "cus_1NqNBBBC456abc"
}
/v1/customers/{customer_id}/cards/{id}
Retrieve a card
Response
{
"id": "card_1NqOCCCC789xyz",
"brand": "visa",
"last4": "4242"
}
/v1/customers/{customer_id}/cards/{id}
Delete a card from customer
Response
{
"id": "card_1NqOCCCC789xyz",
"deleted": true
}
Tokens are used to securely collect card details from your frontend without sensitive data touching your server.
/v1/tokens
Create a card token (use with Paebs.js)
Request Body
{
"card": {
"number": "4242424242424242",
"exp_month": 12,
"exp_year": 2025,
"cvc": "123"
}
}
Response
{
"id": "tok_1NqPDDDD123abc",
"object": "token",
"card": {
"brand": "visa",
"last4": "4242"
},
"created": 1693428000,
"used": false
}
/v1/tokens/{id}
Retrieve a token
Response
{
"id": "tok_1NqPDDDD123abc",
"object": "token",
"used": false
}
Account objects represent your Paebs account. Manager accounts can create sub-accounts.
/v1/account
Retrieve your account details
Response
{
"id": "acct_1NqQEEEE456xyz",
"object": "account",
"business_name": "Acme Ltd",
"email": "admin@acme.com",
"type": "manager",
"iban": "GB82PAEB60913100123456",
"created": 1693400000
}
/v1/account
Update account settings
Request Body
{
"business_name": "Acme Corporation Ltd",
"support_email": "help@acme.com"
}
Response
{
"id": "acct_1NqQEEEE456xyz",
"business_name": "Acme Corporation Ltd"
}
Sub-accounts are created under manager accounts to manage payments for clients or team members.
/v1/subaccounts
Create a new sub-account
Request Body
{
"name": "John Design Studio",
"email": "john@studio.com",
"payout_schedule": "weekly"
}
Response
{
"id": "sub_1NqRFFFF789abc",
"object": "subaccount",
"name": "John Design Studio",
"email": "john@studio.com",
"status": "active",
"created": 1693429000
}
/v1/subaccounts/{id}
Retrieve sub-account details
Response
{
"id": "sub_1NqRFFFF789abc",
"name": "John Design Studio",
"balance": 12450
}
/v1/subaccounts/{id}
Update sub-account settings
Request Body
{
"payout_schedule": "daily"
}
Response
{
"id": "sub_1NqRFFFF789abc",
"payout_schedule": "daily"
}
/v1/subaccounts/{id}/deactivate
Deactivate a sub-account
Response
{
"id": "sub_1NqRFFFF789abc",
"status": "inactive"
}
/v1/subaccounts
List all sub-accounts
Response
{
"object": "list",
"data": [...],
"has_more": false
}
Transfer funds between your manager account and sub-accounts.
/v1/transfers
Transfer funds to a sub-account
Request Body
{
"amount": 5000,
"currency": "gbp",
"destination": "sub_1NqRFFFF789abc",
"description": "March payout"
}
Response
{
"id": "tr_1NqSGGGG123xyz",
"object": "transfer",
"amount": 5000,
"currency": "gbp",
"destination": "sub_1NqRFFFF789abc",
"status": "completed",
"created": 1693430000
}
/v1/transfers/{id}
Retrieve transfer details
Response
{
"id": "tr_1NqSGGGG123xyz",
"amount": 5000,
"status": "completed"
}
Retrieve your current balance including available and pending funds.
/v1/balance
Get current balance
Response
{
"object": "balance",
"available": [
{
"amount": 124892,
"currency": "gbp"
}
],
"pending": [
{
"amount": 24156,
"currency": "gbp"
}
]
}
Send funds from your Paebs balance to your bank account.
/v1/payouts
Create a payout to your bank
Request Body
{
"amount": 50000,
"currency": "gbp",
"method": "instant"
}
Response
{
"id": "po_1NqTHHHH456abc",
"object": "payout",
"amount": 50000,
"currency": "gbp",
"status": "in_transit",
"arrival_date": 1693516800,
"created": 1693431000
}
/v1/payouts/{id}
Retrieve payout details
Response
{
"id": "po_1NqTHHHH456abc",
"amount": 50000,
"status": "paid"
}
/v1/payouts/{id}/cancel
Cancel a pending payout
Response
{
"id": "po_1NqTHHHH456abc",
"status": "canceled"
}
/v1/payouts
List all payouts
Response
{
"object": "list",
"data": [...],
"has_more": true
}
Balance transactions represent funds moving in and out of your Paebs account.
/v1/balance_transactions/{id}
Retrieve transaction details
Response
{
"id": "txn_1NqUIIII789xyz",
"object": "balance_transaction",
"amount": 2500,
"fee": 55,
"net": 2445,
"type": "payment",
"created": 1693432000
}
/v1/balance_transactions
List all balance transactions
Response
{
"object": "list",
"data": [...],
"has_more": true
}
Webhooks allow you to receive real-time notifications about events in your Paebs account.
/v1/webhook_endpoints
Create a new webhook endpoint
Request Body
{
"url": "https://example.com/webhooks/paebs",
"events": [
"payment.succeeded",
"payment.failed",
"refund.created"
]
}
Response
{
"id": "we_1NqVJJJJ123abc",
"object": "webhook_endpoint",
"url": "https://example.com/webhooks/paebs",
"status": "enabled",
"secret": "whsec_abc123...",
"created": 1693433000
}
/v1/webhook_endpoints
List all webhook endpoints
Response
{
"object": "list",
"data": [...],
"has_more": false
}
/v1/webhook_endpoints/{id}
Delete a webhook endpoint
Response
{
"id": "we_1NqVJJJJ123abc",
"deleted": true
}
Events represent actions that have occurred in your account. You can retrieve individual events or list recent events.
/v1/events/{id}
Retrieve event details
Response
{
"id": "evt_1NqWKKKK456xyz",
"object": "event",
"type": "payment.succeeded",
"data": {
"object": {
"id": "pay_1NqL9JABC123def456",
"amount": 2500
}
},
"created": 1693434000
}
/v1/events?type=payment.succeeded
List events with optional type filter
Response
{
"object": "list",
"data": [...],
"has_more": true
}
Dispute objects are created when a cardholder questions a charge with their bank.
/v1/disputes/{id}
Retrieve dispute details
Response
{
"id": "dp_1NqXLLLL789abc",
"object": "dispute",
"amount": 2500,
"payment": "pay_1NqL9JABC123def456",
"reason": "fraudulent",
"status": "needs_response",
"evidence_due_by": 1694038800,
"created": 1693435000
}
/v1/disputes/{id}
Submit evidence for a dispute
Request Body
{
"evidence": {
"customer_name": "John Smith",
"customer_email": "john@example.com",
"shipping_tracking_number": "1Z999AA10123456784",
"uncategorized_text": "Customer received and used the product."
},
"submit": true
}
Response
{
"id": "dp_1NqXLLLL789abc",
"status": "under_review"
}
/v1/disputes/{id}/close
Accept and close a dispute
Response
{
"id": "dp_1NqXLLLL789abc",
"status": "lost"
}
/v1/disputes
List all disputes
Response
{
"object": "list",
"data": [...],
"has_more": false
}