PlanDocket

Payments

Business+

Track and record payments.

Required scopes: payments
Access level: GET payments:read POST / PUT / PATCH / DELETE payments:write About access levels
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. Only issued, open invoices (sent, partially_paid, overdue) accept payments: drafts, cancelled or refunded invoices and credit notes are rejected with 422, a fully paid invoice with 400. Repeating a Stripe/PayPal transaction_id returns the existing payment with 200, or 409 when it belongs to another invoice

PUT/PATCH /api/v1/payments/{id}

Update a payment (status, notes, payment date). Unchanged values are ignored; every change is recorded in the invoice audit log. Completion requires a payable invoice and enough open balance. On locked invoices, completed, refunded and Stripe/PayPal-confirmed payments keep their status and payment date (400); notes stay editable. Refunds cannot be changed via the API

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 "Accept: 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,
    ],
]);

$response = curl_exec($ch);
curl_close($ch);

$data = json_decode($response, true);
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}`,
  },
});

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}',
}

response = requests.get(f'{base_url}/api/v1/payments', headers=headers)
data = response.json()
print(data)

Sample Response

200 OK
{
    "data": [
        {
            "id": 1,
            "invoice_id": 1,
            "amount": 100,
            "currency": "string",
            "gateway_id": 1,
            "gateway_key": "string",
            "gateway_name": "string",
            "transaction_id": "string",
            "gateway_fee": 100,
            "net_amount": 100,
            "status": "string",
            "payment_date": "2026-01-15T10:00:00+01:00",
            "notes": "string",
            "created_at": "2026-01-15T10:00:00+01:00",
            "updated_at": "2026-01-15T10:00:00+01:00"
        }
    ],
    "meta": {
        "current_page": 1,
        "per_page": 25,
        "total": 1,
        "total_pages": 1
    }
}