Developer Platform

Build on Payfriend

REST API and MCP server for managing invoices, customers, payments, and collection flows. Integrate directly or let AI agents handle your workflows.

payfriend-api
$ curl -H "Authorization: Bearer YOUR_TOKEN" https://app.payfriend.io/api/v1/invoices/stats
// Response
{
  "total_count": 847,  "total_amount": 2458350.00,  "overdue_count": 23,  "overdue_amount": 156200.50,  "paid_this_month": 412800.00,  "currency": "DKK"}

Get started in minutes

Create an API token, make your first request, and start building.

1

Create a token

Go to Settings → API Tokens in the Payfriend dashboard. Create a token with the scopes you need.

2

Make a request

Use your token as a Bearer token in the Authorization header. All endpoints return JSON.

3

Build your integration

Use the REST API for custom integrations, or the MCP server to let AI agents manage your workflows.

Authentication

Bearer token authentication

All API requests require a Bearer token in the Authorization header. Create tokens in Settings → API Tokens.

Tokens never expire — revoke anytime from the dashboard

Scoped permissions — create read-only or full-access tokens

SHA-256 hashed — token values are never stored in plain text

Authentication
curl -X GET https://app.payfriend.io/api/v1/customers \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json"
Error Response (401)
{
  "message": "Unauthenticated."
}
REST API

API Reference

24 endpoints across 6 resource groups. All responses are JSON with standard HTTP status codes.

Base URL: https://app.payfriend.io/api/v1

Customers

5 endpoints

GET/api/v1/customers
GET/api/v1/customers/{id}
POST/api/v1/customers
PUT/api/v1/customers/{id}
GET/api/v1/customers/search

Invoices

6 endpoints

GET/api/v1/invoices
GET/api/v1/invoices/{id}
POST/api/v1/invoices
PATCH/api/v1/invoices/{id}/status
POST/api/v1/invoices/{id}/mark-paid
GET/api/v1/invoices/stats

Payments

2 endpoints

GET/api/v1/payments
POST/api/v1/payments

Collection Flows

7 endpoints

GET/api/v1/flows
GET/api/v1/flows/{id}
POST/api/v1/flows
PUT/api/v1/flows/{id}
POST/api/v1/flows/{id}/activate
POST/api/v1/flows/{id}/deactivate
GET/api/v1/flows/{id}/executions

Credit Notes

3 endpoints

GET/api/v1/credit-notes
GET/api/v1/credit-notes/{id}
POST/api/v1/credit-notes

Collection Stats

1 endpoints

GET/api/v1/collection/stats
curl -X GET "https://app.payfriend.io/api/v1/invoices?status=overdue&page=1" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json"
MCP Server

AI-native with MCP

Connect Claude, Cursor, or any MCP-compatible client. 25 tools for managing your entire collection workflow conversationally.

claude mcp add payfriend -s user -- npx -y payfriend-mcp --token=YOUR_TOKEN

# Verify connection
claude mcp list
# payfriend: ✓ Connected

payfriend-mcp on npm

Customers

5 tools
customers_list
customers_get
customers_create
customers_update
customers_search

Invoices

6 tools
invoices_list
invoices_get
invoices_create
invoices_update_status
invoices_mark_paid
invoices_stats

Payments

2 tools
payments_list
payments_register

Flows

5 tools
flows_list
flows_get
flows_activate
flows_deactivate
flows_executions

Credit Notes

3 tools
credit_notes_list
credit_notes_get
credit_notes_create

Executions

3 tools
executions_pause
executions_resume
executions_cancel

Stats

1 tool
collection_stats

Just talk naturally

>"Show me all overdue invoices"
>"Create a customer: Acme ApS, CVR 12345678"
>"Mark invoice 42 as paid"
>"Create a credit note for 5,000 DKK for Acme"
>"Pause collection execution 17"
>"What's my collection status right now?"
>"Activate collection flow 1"
>"Search for customers matching 'hansen'"

Ready to integrate?

Create your API token and start building. Free tier includes full API access.