Udviklerplatform

Byg med Payfriend

REST API og MCP-server til håndtering af fakturaer, kunder, betalinger og inkassoflows. Integrér direkte eller lad AI-agenter styre dine 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"}

Kom i gang på få minutter

Opret et API-token, send din første forespørgsel, og begynd at bygge.

1

Opret et token

Gå til Indstillinger → API-tokens i Payfriend-dashboardet. Opret et token med de rettigheder du har brug for.

2

Send en forespørgsel

Brug dit token som Bearer-token i Authorization-headeren. Alle endpoints returnerer JSON.

3

Byg din integration

Brug REST API'et til custom integrationer, eller MCP-serveren til at lade AI-agenter styre dine workflows.

Autentificering

Bearer-token autentificering

Alle API-kald kræver et Bearer-token i Authorization-headeren. Opret tokens under Indstillinger → API-tokens.

Tokens udløber aldrig — tilbagekald når som helst fra dashboardet

Afgrænsede rettigheder — opret skrivebeskyttede eller fuld-adgang tokens

SHA-256 hashed — token-værdier gemmes aldrig i klartekst

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 fordelt på 6 ressourcegrupper. Alle svar er JSON med standard HTTP-statuskoder.

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 med MCP

Forbind Claude, Cursor eller enhver MCP-kompatibel klient. 25 værktøjer til at styre hele din inkasso-workflow via samtale.

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

# Verify connection
claude mcp list
# payfriend: ✓ Connected

payfriend-mcp på 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

Tal helt naturligt

>"Vis mig alle forfaldne fakturaer"
>"Opret en kunde: Acme ApS, CVR 12345678"
>"Markér faktura 42 som betalt"
>"Opret en kreditnota på 5.000 DKK til Acme"
>"Pausér inkasso-eksekvering 17"
>"Hvad er status på min inkasso lige nu?"
>"Aktivér inkassoflow 1"
>"Søg efter kunder der matcher 'hansen'"

Klar til at integrere?

Opret dit API-token og begynd at bygge. Gratis plan inkluderer fuld API-adgang.