Invoice payments
Money received against an issued invoice. Every receipt is its own row and the invoice's paid_cents is their sum, so part payments are ordinary and a refund is a negative payment. Recording a payment moves the invoice to partially_paid or paid by itself.
To record a payment from a bank file, find the invoice by its OCR reference (drop the last digit and search GET /invoices?q=), then post the amount with the bank's reference. The OCR reference is built from the number alone, so an organization that uses several series should also check references.ocr_reference and the series of the match.
A payment recorded here with method bank or autogiro is not paid a second time when the same transfer later arrives in a bank statement imported in the panel: a statement line carrying the invoice's OCR reference and exactly the payment's amount, booked within 31 days of paid_at, becomes that payment's bank record (its bank_statement_line_id), and so does a line somebody matches to the invoice by hand.
List an invoice's payments
/invoices/{invoice}/paymentsEvery receipt against the invoice, the most recent payment date first, with the invoice's balance in meta.invoice. The balance is computed from all payments, not from the page.
Besides receipts from the customer (from_customer: true) the list can hold the ROT/RUT settlement from Skatteverket (method: rot_rut) and write-offs (writeoff), which are recorded in Closepact and not through this API.
Paging is by cursor (meta.next_cursor); there are no links.
curl 'https://api.closepact.com/v1/api/invoices/01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40/payments' \
-H "Authorization: Bearer $CLOSEPACT_API_KEY"{
"data": [
{
"id": "01a15c11-9e2f-7d84-b3a6-5c8e1f4d2a97",
"customer_invoice_id": "01a15b02-7c14-7e2b-8d5a-3f9c1e6b4a27",
"paid_at": "2026-11-05",
"amount_cents": 131300,
"currency": "SEK",
"method": "bank",
"from_customer": true,
"reference": "10421",
"bank_statement_line_id": null,
"note": null,
"created_by": "Anna Lindqvist",
"created_at": "2026-11-06T07:45:12+00:00"
}
],
"meta": {
"invoice": {
"id": "01a15b02-7c14-7e2b-8d5a-3f9c1e6b4a27",
"reference": "A-1042",
"status": "paid",
"currency": "SEK",
"total_cents": 243800,
"rot_rut_requested_cents": 112500,
"paid_cents": 131300,
"outstanding_cents": 0,
"days_overdue": 0
},
"next_cursor": null,
"prev_cursor": null
}
}Path parameters
invoicestring(uuid)requiredThe invoice's or credit note's id.
Query parameters
filter[method]string | array of stringsOne method, or several as
filter[method][]=bank&filter[method][]=card.limitintegerPayments per page.
Default
501–100cursorstringOpaque cursor from
meta.next_cursorormeta.prev_cursorof the previous page.
Responses
Headers
X-RateLimit-Limit— Requests this key may make per minute.X-RateLimit-Remaining— Requests left in the current minute.
dataarray of objectsrequiredidstring(uuid)requiredcustomer_invoice_idstring(uuid)requiredpaid_atstring(date)nullablerequiredThe day the money moved.
amount_centsintegerrequiredNegative for a refund.
currencystringrequiredmethodstringrequiredrot_rutis Skatteverket's settlement of the deduction andwriteoffa decision to stop asking; neither is money from the customer.One of
bankcardautogirocashrot_rutwriteofffrom_customerbooleanrequiredFalse for
rot_rutandwriteoff.referencestringnullablerequiredThe bank's reference, typically the OCR number.
bank_statement_line_idstring(uuid)nullablerequiredSet when the payment came from a matched bank statement line.
notestringnullablerequiredcreated_bystringnullablerequiredThe name of the member who registered it (the key's member for API payments); null for automatic ones.
created_atstring(date-time)nullablerequired
metaobjectrequired
- 401No key, or the key is invalid, revoked or expired, or its creator no longer has access.Errors
- 402The organization has not bought the module this endpoint belongs to, or it has lapsed to read-only, or its tier does not include what the operation needs:Errors
featurenames the capability (the operation'sx-feature) andrequired_tierthe cheapest tier that grants it. Every operation answers this with"feature": "core.api"when no module the organization holds is on a tier that includes the API. - 403The key lacks the scope, or the member it acts as lacks the permission or holds no seat in the module (Errors
module_seat_required— an administrator assigns seats under Settings → Users), or the organization is suspended. - 404No such record in this organization.Errors
- 429The key has made more requests this minute than its limit allows.Errors
Register a payment
/invoices/{invoice}/paymentsRecords money received against an issued invoice and updates its status: paid once the customer's share is covered, partially_paid before that. On a ROT/RUT invoice the customer's share is total − rot_rut.requested; Skatteverket's part is settled separately in Closepact.
amount_centsis signed: a refund to the customer is a negative payment. Zero is refused.paid_atis the day the money moved (YYYY-MM-DD, default today) — VAT periods and ageing are cut on it, so send the bank's date rather than today's.currencymust be the invoice's; there is no conversion (409).- Put the bank's reference, typically the OCR number, in
reference.
Refused with 409 for a draft (nothing to pay yet) and for a credited or written-off invoice — money arriving against those belongs on the credit note or a new invoice. The response carries the new balance, so you need not fetch the invoice again.
curl -X POST 'https://api.closepact.com/v1/api/invoices/01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40/payments' \
-H "Authorization: Bearer $CLOSEPACT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount_cents": 131300,
"paid_at": "2026-11-05",
"method": "bank",
"reference": "10421"
}'{
"data": {
"id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"customer_invoice_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"paid_at": "2026-10-18",
"amount_cents": 125000,
"currency": "SEK",
"method": "bank",
"from_customer": true,
"reference": "string",
"bank_statement_line_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"note": "A short description.",
"created_by": "string",
"created_at": "2026-10-18T09:30:00Z"
},
"meta": {
"invoice": {
"id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"reference": "string",
"status": "draft",
"currency": "SEK",
"total_cents": 125000,
"rot_rut_requested_cents": 125000,
"paid_cents": 125000,
"outstanding_cents": 125000,
"days_overdue": 1
}
}
}Path parameters
invoicestring(uuid)requiredThe invoice's or credit note's id.
Request body
application/json · required
amount_centsintegerrequiredÖre. Negative for a refund.
paid_atstring(date)Defaults to today.
methodstringOne of
bankcardautogirocashDefault
"bank"referencestringnullableat most 128 characters
currencystringDefaults to, and must equal, the invoice's currency.
exactly 3 characters
notestringnullableat most 1,000 characters
Responses
Headers
X-RateLimit-Limit— Requests this key may make per minute.X-RateLimit-Remaining— Requests left in the current minute.
dataobjectrequiredMoney received against an invoice. Amounts in öre.
idstring(uuid)requiredcustomer_invoice_idstring(uuid)requiredpaid_atstring(date)nullablerequiredThe day the money moved.
amount_centsintegerrequiredNegative for a refund.
currencystringrequiredmethodstringrequiredrot_rutis Skatteverket's settlement of the deduction andwriteoffa decision to stop asking; neither is money from the customer.One of
bankcardautogirocashrot_rutwriteofffrom_customerbooleanrequiredFalse for
rot_rutandwriteoff.referencestringnullablerequiredThe bank's reference, typically the OCR number.
bank_statement_line_idstring(uuid)nullablerequiredSet when the payment came from a matched bank statement line.
notestringnullablerequiredcreated_bystringnullablerequiredThe name of the member who registered it (the key's member for API payments); null for automatic ones.
created_atstring(date-time)nullablerequired
metaobjectrequired
- 401No key, or the key is invalid, revoked or expired, or its creator no longer has access.Errors
- 402The organization has not bought the module this endpoint belongs to, or it has lapsed to read-only, or its tier does not include what the operation needs:Errors
featurenames the capability (the operation'sx-feature) andrequired_tierthe cheapest tier that grants it. Every operation answers this with"feature": "core.api"when no module the organization holds is on a tier that includes the API. - 403The key lacks the scope, or the member it acts as lacks the permission or holds no seat in the module (Errors
module_seat_required— an administrator assigns seats under Settings → Users), or the organization is suspended. - 404No such record in this organization.Errors
- 409The request is well-formed but the invoice's state does not allow it — for example it has already been issued, has no lines, or has been credited in full.Errors
erroris alwaysconflict; the message says what to do instead. - 422The request body or query failed validation.Errors
- 429The key has made more requests this minute than its limit allows.Errors
Remove a payment
/invoice-payments/{payment}Takes back a payment registered in error and recalculates the invoice. A paid invoice goes back to partially_paid — an issued invoice never returns to sent — and if the payment came from a matched bank statement line, that line is released for matching again.
Refused with 409 for a ROT/RUT settlement or a write-off (settled where they were decided), on a credited or written-off invoice, and once the invoice has been exported to the books (SIE) — correct it in the bookkeeping then.
curl -X DELETE 'https://api.closepact.com/v1/api/invoice-payments/01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40' \
-H "Authorization: Bearer $CLOSEPACT_API_KEY"{
"deleted": true,
"meta": {
"invoice": {
"id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"reference": "string",
"status": "draft",
"currency": "SEK",
"total_cents": 125000,
"rot_rut_requested_cents": 125000,
"paid_cents": 125000,
"outstanding_cents": 125000,
"days_overdue": 1
}
}
}Path parameters
paymentstring(uuid)requiredThe payment's id (
idin the payments list).
Responses
Headers
X-RateLimit-Limit— Requests this key may make per minute.X-RateLimit-Remaining— Requests left in the current minute.
deletedbooleanrequiredOne of
truemetaobjectrequired
- 401No key, or the key is invalid, revoked or expired, or its creator no longer has access.Errors
- 402The organization has not bought the module this endpoint belongs to, or it has lapsed to read-only, or its tier does not include what the operation needs:Errors
featurenames the capability (the operation'sx-feature) andrequired_tierthe cheapest tier that grants it. Every operation answers this with"feature": "core.api"when no module the organization holds is on a tier that includes the API. - 403The key lacks the scope, or the member it acts as lacks the permission or holds no seat in the module (Errors
module_seat_required— an administrator assigns seats under Settings → Users), or the organization is suspended. - 404No such record in this organization.Errors
- 409The request is well-formed but the invoice's state does not allow it — for example it has already been issued, has no lines, or has been credited in full.Errors
erroris alwaysconflict; the message says what to do instead. - 429The key has made more requests this minute than its limit allows.Errors