P
PayDock Docs

API Reference

REST API for integrations with external systems.

Interactive documentation available via Swagger UI at /api/docs — test endpoints directly in the browser.

Authentication

All API requests require an API key in the X-API-Key header. Create a key via Settings > API keys.

curl -X GET "https://your-project.supabase.co/functions/v1/api/contacts" \
  -H "X-API-Key: ftj_your_api_key_here"

Contacts

Full CRUD for customers.

MethodPathDescription
GET/contactsList all contacts
POST/contactsCreate contact
GET/contacts/{id}Get contact
PUT/contacts/{id}Update contact
DELETE/contacts/{id}Delete contact

Products

Full CRUD for products.

MethodPathDescription
GET/productsList all products
POST/productsCreate product
GET/products/{id}Get product
PUT/products/{id}Update product
DELETE/products/{id}Delete product

Invoices

Create, retrieve, filter and update invoices. Ideal for external systems that register invoices.

MethodPathDescription
POST/invoicesCreate invoice with lines (auto calculation)
GET/invoicesList with filters: status, contact_id, limit, offset
GET/invoices/{id}Invoice with lines and contact data
PATCH/invoices/{id}Update status, due date or note

Create invoice example

POST /invoices
X-API-Key: ftj_...

{
  "contact_id": "uuid-of-customer",
  "status": "verzonden",
  "invoice_date": "2026-04-11",
  "due_date": "2026-05-11",
  "lines": [
    {
      "description": "Spont POS Licentie",
      "quantity": 1,
      "unit_price_incl": 89.00,
      "tax_percentage": 21,
      "product_id": "uuid-of-product"
    },
    {
      "description": "Installatie",
      "quantity": 2,
      "unit_price_incl": 125.00,
      "tax_percentage": 21
    },
    {
      "description": "Notitie: Levering binnen 5 werkdagen",
      "is_text_line": true
    }
  ]
}

→ Invoice created with auto-calculated totals

Register payment

After creating an invoice you can register a payment. The invoice status is automatically updated to 'partially paid' or 'paid'.

POST /payments
X-API-Key: ftj_...

{
  "invoice_id": "uuid-of-invoice",
  "amount": 339.00,
  "payment_date": "2026-04-11",
  "external_method": "bank_transfer",
  "external_reference": "TXN-12345",
  "note": "Betaling ontvangen via extern systeem"
}

→ Invoice status updated to "betaald"

Quotes

MethodPathDescription
GET/quotesList with filters
GET/quotes/{id}Quote with lines
PATCH/quotes/{id}Update status

Subscriptions

MethodPathDescription
GET/subscriptionsList with filters
GET/subscriptions/{id}Subscription with lines
PATCH/subscriptions/{id}Update status

Payments

MethodPathDescription
GET/paymentsList payments
POST/paymentsRegister payment (updates invoice amount_paid)
GET/payments/{id}Get payment

Client portal endpoint

The /client-portal/{external_id} endpoint returns all data for a customer in one request. Ideal for chatbot integrations.

GET /client-portal/CRM-12345

{
  "contact": { "name": "Acme BV", "email": "info@acme.nl", ... },
  "summary": {
    "open_invoice_count": 2,
    "open_invoice_amount": 850.00,
    "active_subscriptions": 1,
    "balance": 125.50
  },
  "invoices": [...],
  "quotes": [...],
  "subscriptions": [...],
  "recent_payments": [...]
}

Query parameters

The list endpoints support these filters:

ParameterTypeDescription
statusstringFilter by status (e.g. 'verzonden', 'betaald')
contact_idUUIDFilter by customer ID
limitintegerMaximum results (default 100, max 500)
offsetintegerSkip first N results (for pagination)

Webhook events

The API triggers webhooks for these events:

  • contact.created, contact.updated, contact.deleted
  • product.created, product.updated, product.deleted
  • invoice.updated, quote.updated, subscription.updated
  • payment.created

OpenAPI / Swagger

The full API specification is available as OpenAPI 3.0 JSON at /openapi.json. Interactive Swagger UI is available at /docs.