Payments
Business+Track and record payments.
Required scopes:
payments
Feature flag:
invoices
Endpoints
GET
/api/v1/payments
List all payments
GET
/api/v1/payments/{id}
Retrieve a single payment
POST
/api/v1/payments
Record a payment
PUT/PATCH
/api/v1/payments/{id}
Update a payment
DELETE
/api/v1/payments/{id}
Delete a payment
Query Parameters
| Parameter | Description |
|---|---|
invoice_number
|
Filter by invoice number |
status
|
Filter by payment status |
date_from
|
Filter payments from this date (ISO 8601) |
date_to
|
Filter payments until this date (ISO 8601) |
sort
|
Sort field (amount, status, payment_date, created_at) |
order
|
Sort direction (ASC or DESC, default: DESC) |
include
|
Include related data (invoice) |
Request Schema
| Parameter | Type | Required | Description |
|---|---|---|---|
invoice_number
|
string | Yes | Invoice number to link the payment to (required) |
amount
|
float | Yes | Payment amount (required, must be positive) |
currency
|
string | No | Currency code (default: invoice currency or EUR) |
status
|
string | No | Payment status (default: completed) |
payment_date
|
string | No | Date of payment (ISO 8601 format, default: now) |
notes
|
string | No | Internal notes for the payment |
gateway_key
|
string | No | Payment gateway identifier |
transaction_id
|
string | No | External transaction ID |
Response Schema
| Field | Type |
|---|---|
id
|
integer |
invoice_id
|
integer |
amount
|
float |
currency
|
string |
gateway_id
|
integer|null |
gateway_key
|
string|null |
gateway_name
|
string|null |
transaction_id
|
string|null |
gateway_fee
|
float |
net_amount
|
float |
status
|
string |
payment_date
|
string|null |
notes
|
string|null |
created_at
|
string |
updated_at
|
string |
Code Examples
curl -X GET "https://your-tenant.plandocket.com/api/v1/payments" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"
<?php
$apiKey = 'YOUR_API_KEY';
$baseUrl = 'https://your-tenant.plandocket.com';
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => $baseUrl . '/api/v1/payments',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Content-Type: application/json',
],
]);
$response = curl_exec($ch);
$data = json_decode($response, true);
curl_close($ch);
print_r($data);
const apiKey = 'YOUR_API_KEY';
const baseUrl = 'https://your-tenant.plandocket.com';
const response = await fetch(`${baseUrl}/api/v1/payments`, {
method: 'GET',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
});
const data = await response.json();
console.log(data);
import requests
api_key = 'YOUR_API_KEY'
base_url = 'https://your-tenant.plandocket.com'
headers = {
'Authorization': f'Bearer {api_key}',
'Content-Type': 'application/json',
}
response = requests.get(f'{base_url}/api/v1/payments', headers=headers)
data = response.json()
print(data)
Sample Response
200 OK
{
"data": {
"payment_id": 1,
"created_at": 1704067200,
"updated_at": 1704067200
},
"meta": {
"request_id": "req_abc123"
}
}