Coaccept Developer Docs
API documentation for invoices, customers and payments.
Build against the public integration API, queue invoice delivery, handle payment flows and consume errors consistently.
authentication
Authentication
Use an API key as a bearer token for every integration endpoint under /v1. Public invoice links under /public are token based and do not use API keys.
- Send Authorization, Content-Type and Accept headers on JSON requests.
- API keys can be scoped with invoices:read, invoices:write, customer:read and customer:write.
- Missing, expired, revoked or invalid keys return 401. Missing scopes return 403.
Authorization: Bearer coaccept_...
Content-Type: application/json
Accept: application/jsoninvoices
Invoices
Create draft invoices, add rows, list invoices with cursor pagination and queue draft invoices for delivery.
/v1/invoicesCreate a draft invoice.
/v1/invoicesList invoices.
/v1/invoices/:idGet one invoice.
/v1/invoices/:idUpdate a draft invoice.
/v1/invoices/:idDelete a draft invoice.
/v1/invoices/:id/rowsAdd an invoice row.
- Invoice statuses include DRAFT, QUEUED, GENERATING and SENT.
- Update, delete and delivery actions require the invoice to still be DRAFT.
- Money values are represented as integers in minor units.
POST /v1/invoices
{
"customer_id": "cus_xxx",
"issue_date": "2026-04-14",
"due_date": "2026-05-14",
"payment_terms": "30 dagar"
}customers
Customers
Customers are the recipients used when creating invoices and delivery links.
/v1/customersCreate a customer.
/v1/customersList customers.
/v1/customers/:idGet one customer.
- Customer IDs use the cus_ prefix.
- name is required.
- At least one of email or phone is required.
POST /v1/customers
{
"name": "Alice Andersson",
"email": "alice@example.com",
"phone": "+46701234567"
}delivery methods
Delivery methods
Queue a draft invoice for email or SMS delivery. Paper delivery is exposed but not implemented yet.
/v1/invoices/:id/emailQueue email delivery.
/v1/invoices/:id/smsQueue SMS delivery.
/v1/invoices/:id/paperReturns 501 Not Implemented.
- Email delivery requires the customer to have email.
- SMS delivery requires the customer to have phone.
- Successful delivery queue responses return 202 Accepted with status QUEUED.
payments
Payments
Public invoice payment endpoints live under /public and are used from invoice links. Current payment creation supports the tink method and requires an Idempotency-Key.
/public/invoices/:tokenRead a public invoice link.
/public/invoices/:token/paymentsCreate a payment session.
/public/invoices/:token/payments/:paymentIdRead payment status.
- Public invoice document URLs are signed and time-limited.
- Payment status responses use lowercase statuses such as settled, pending or failed.
- Invalid, expired or revoked public invoice tokens return 404.
POST /public/invoices/:token/payments
Idempotency-Key: pay_2026_04_14_001
{
"method": "tink"
}webhooks
Webhooks
Tink payment webhooks are received by the public API and verified with an HMAC SHA-256 signature.
/public/payments/tink/webhookReceive Tink payment events.
- Use the tink-signature or x-tink-signature header.
- The API accepts signatures with or without a sha256= prefix.
- Settled-like statuses mark the local payment as settled; other events are recorded.
errors
Errors
All application errors return an error object with a type, code and human-readable message.
- Common status codes are 400, 401, 403, 404, 422, 429 and 500.
- Validation errors can include a fields array.
- Use code for programmatic handling and message for display/debug output.
{
"error": {
"type": "validation_error",
"code": "missing_required_field",
"message": "Customer must have email.",
"fields": ["email"]
}
}pagination
Pagination
List endpoints that paginate use cursor pagination. Send the next_cursor from one response as cursor on the next request.
- GET /v1/invoices supports limit from 1 to 100 and defaults to 25.
- page.has_more tells you whether another request is available.
- A null next_cursor means you have reached the end.
GET /v1/invoices?limit=25&cursor=cur_xxx
{
"data": [],
"page": {
"limit": 25,
"next_cursor": null,
"has_more": false
}
}idempotency
Idempotency
Mutating requests should include an Idempotency-Key header. Payment creation requires it today.
- Keys can be up to 255 characters.
- Successful non-500 responses are cached for 24 hours per tenant and key.
- Reusing the same key returns the previous status and response body.
Idempotency-Key: invoice_create_2026_04_14_001rate limits
Rate limits
The API emits standard rate limit headers using the draft-7 header format.
- Protected /v1 API routes are limited to 300 requests per window.
- Public routes are limited to 60 requests per window.
- Internal portal routes are limited to 90 requests per window.
- The default window is 60 seconds and can be configured with RATE_LIMIT_WINDOW_MS.