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

GET/invoices/{invoice}/payments

Every 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"
Response · 200
{
  "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)required

    The invoice's or credit note's id.

Query parameters

  • filter[method]string | array of strings

    One method, or several as filter[method][]=bank&filter[method][]=card.

  • limitinteger

    Payments per page.

    Default 501–100

  • cursorstring

    Opaque cursor from meta.next_cursor or meta.prev_cursor of 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 objectsrequired
      • idstring(uuid)required
      • customer_invoice_idstring(uuid)required
      • paid_atstring(date)nullablerequired

        The day the money moved.

      • amount_centsintegerrequired

        Negative for a refund.

      • currencystringrequired
      • methodstringrequired

        rot_rut is Skatteverket's settlement of the deduction and writeoff a decision to stop asking; neither is money from the customer.

        One ofbankcardautogirocashrot_rutwriteoff

      • from_customerbooleanrequired

        False for rot_rut and writeoff.

      • referencestringnullablerequired

        The bank's reference, typically the OCR number.

      • bank_statement_line_idstring(uuid)nullablerequired

        Set when the payment came from a matched bank statement line.

      • notestringnullablerequired
      • created_bystringnullablerequired

        The 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: feature names the capability (the operation's x-feature) and required_tier the 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.
    Errors
  • 403The key lacks the scope, or the member it acts as lacks the permission or holds no seat in the module (module_seat_required — an administrator assigns seats under Settings → Users), or the organization is suspended.
    Errors
  • 404No such record in this organization.
    Errors
  • 429The key has made more requests this minute than its limit allows.
    Errors

Register a payment

POST/invoices/{invoice}/payments
Scope write Module Invoicing Permission invoicing.payments.manage

Records 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_cents is signed: a refund to the customer is a negative payment. Zero is refused.
  • paid_at is 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.
  • currency must 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"
}'
Response · 201
{
  "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)required

    The 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.

  • methodstring

    One ofbankcardautogirocash

    Default "bank"

  • referencestringnullable

    at most 128 characters

  • currencystring

    Defaults to, and must equal, the invoice's currency.

    exactly 3 characters

  • notestringnullable

    at 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.
    • dataobjectrequired

      Money received against an invoice. Amounts in öre.

      • idstring(uuid)required
      • customer_invoice_idstring(uuid)required
      • paid_atstring(date)nullablerequired

        The day the money moved.

      • amount_centsintegerrequired

        Negative for a refund.

      • currencystringrequired
      • methodstringrequired

        rot_rut is Skatteverket's settlement of the deduction and writeoff a decision to stop asking; neither is money from the customer.

        One ofbankcardautogirocashrot_rutwriteoff

      • from_customerbooleanrequired

        False for rot_rut and writeoff.

      • referencestringnullablerequired

        The bank's reference, typically the OCR number.

      • bank_statement_line_idstring(uuid)nullablerequired

        Set when the payment came from a matched bank statement line.

      • notestringnullablerequired
      • created_bystringnullablerequired

        The 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: feature names the capability (the operation's x-feature) and required_tier the 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.
    Errors
  • 403The key lacks the scope, or the member it acts as lacks the permission or holds no seat in the module (module_seat_required — an administrator assigns seats under Settings → Users), or the organization is suspended.
    Errors
  • 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. error is always conflict; the message says what to do instead.
    Errors
  • 422The request body or query failed validation.
    Errors
  • 429The key has made more requests this minute than its limit allows.
    Errors

Remove a payment

DELETE/invoice-payments/{payment}
Scope write Module Invoicing Permission invoicing.payments.manage

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"
Response · 200
{
  "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)required

    The payment's id (id in the payments list).

Responses

  • Headers

    • X-RateLimit-Limit — Requests this key may make per minute.
    • X-RateLimit-Remaining — Requests left in the current minute.
    • deletedbooleanrequired

      One oftrue

    • 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: feature names the capability (the operation's x-feature) and required_tier the 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.
    Errors
  • 403The key lacks the scope, or the member it acts as lacks the permission or holds no seat in the module (module_seat_required — an administrator assigns seats under Settings → Users), or the organization is suspended.
    Errors
  • 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. error is always conflict; the message says what to do instead.
    Errors
  • 429The key has made more requests this minute than its limit allows.
    Errors