Invoices
Customer invoices (kundfakturor) and credit notes, from draft to paid.
Life of an invoice. An invoice starts as a draft: no number, no OCR reference, freely editable, and deletable without leaving a trace. POST /invoices/{invoice}/send issues it — it takes the next number in its series, gets an OCR reference, is dated, has its PDF stored and is emailed — and from that moment it can never be edited or deleted. Payments then move it to partially_paid and paid. A mistake on an issued invoice is corrected with a credit note, never with an edit; that is what bokföringslagen means by an invoice.
| status | meaning | can become |
|---|---|---|
draft | being written | sent, cancelled |
sent | issued, nothing paid | partially_paid, paid, overdue, credited, written_off |
overdue | due date passed with money outstanding (set by a nightly job) | partially_paid, paid, credited, written_off |
partially_paid | some money in | paid, overdue, credited, written_off |
paid | the customer's share is settled | credited, partially_paid (refund) |
credited | fully credited by credit notes | — |
cancelled, written_off | closed | — |
Numbers and OCR. Invoice numbers come from an unbroken series per organization and series letter (A unless you choose another); credit notes have their own series, K + the invoice's (KA). A number is spent only at send, inside the same transaction, so a failed send leaves no gap. The OCR reference is the invoice number's digits plus a Luhn (modulus 10) check digit — invoice 1042 gets OCR 10421 — so the invoice behind an OCR number is its digits minus the last one.
Amounts are integers in öre, VAT is 25, 12, 6 or 0 percent per line, and the total is rounded to whole kronor (öresavrundning, shown as rounding_cents).
ROT and RUT. Set rot_rut on the invoice and mark labour lines rot_rut_eligible; Closepact adds and maintains the deduction line itself — 30 % (ROT) or 50 % (RUT) of the eligible labour including VAT. Materials never qualify, whatever the flag says. The customer pays rot_rut.customer_pays_cents; the rest is claimed from Skatteverket in Closepact's deduction workflow, which needs the buyer's personnummer and, for ROT, the property — see the customer's tax_profiles. Each labour line (or the invoice, for every line that names none) can carry rot_rut_work_type, Skatteverket's category for the work, which the claim declares hours and material under. The yearly ceiling per person is not applied (it depends on other companies' claims), and the response says so with annual_ceiling_applied: false. Once the customer has paid their share, the claim is filed from the panel as Skatteverket's import file; when Skatteverket's decision is recorded, rot_rut.status follows it, what it paid arrives as a rot_rut payment, and what it refused (rot_rut.refused_cents) is owed by the customer again.
Webhooks. No webhook is sent for invoices or payments yet. To follow status changes, poll GET /invoices with filter[status] or filter[overdue].
Not available through the API: sending payment reminders (deliberately a person's decision — level 3 announces collection), bank statement import and matching, recurring invoice schedules, filing ROT/RUT claims with Skatteverket, the SIE export and the reports. They are in the Closepact panel.
List invoices
/invoicesInvoices and credit notes, newest first, without their lines (fetch one invoice for those).
For bookkeeping, filter[from]/filter[to] select on the issue date — the date an accountant means by "September" — and filter[type]=credit_note gives the credit notes. filter[overdue]=true is decided at the moment you ask (issued, due date passed, and something still owed by the customer once a ROT/RUT share is set aside), so it is more current than filter[status]=overdue, which a nightly job writes.
q is a case-insensitive contains match on the invoice number and on Er referens / Vår referens.
Paging is by cursor: pass meta.next_cursor back as cursor together with the same filters and limit — the URLs in links do not carry your filters.
curl 'https://api.closepact.com/v1/api/invoices' \
-H "Authorization: Bearer $CLOSEPACT_API_KEY"{
"data": [
{
"id": "01a15b02-7c14-7e2b-8d5a-3f9c1e6b4a27",
"type": "invoice",
"invoice_number": "1042",
"series": "A",
"reference": "A-1042",
"status": "sent",
"status_label": "Skickad",
"is_editable": false,
"handover": null,
"customer": {
"id": "01a15a21-0c44-7b19-8e2d-6f3a9c1b5d70",
"name": "Eva Ek",
"customer_number": "1043",
"payment_terms_days": 20
},
"dates": {
"issue_date": "2026-10-18",
"due_date": "2026-11-07",
"delivery_date": "2026-10-16",
"payment_terms_days": 20,
"days_overdue": 0
},
"references": {
"your_reference": "Eva Ek",
"our_reference": "Anna Lindqvist",
"ocr_reference": "10421"
},
"amounts": {
"currency": "SEK",
"net_cents": 195000,
"vat_cents": 48750,
"rounding_cents": 50,
"total_cents": 243800,
"paid_cents": 0,
"outstanding_cents": 131300,
"vat_by_rate": [
{
"rate": 25,
"net_cents": 195000,
"vat_cents": 48750
}
]
},
"rot_rut": {
"type": "rut",
"work_type": "Stadning",
"requested_cents": 112500,
"approved_cents": 0,
"refused_cents": 0,
"status": "none",
"customer_pays_cents": 131300,
"annual_ceiling_applied": false,
"tax_profile_id": null,
"buyer": null
},
"delivery_method": "email",
"delivery": null,
"delivery_failure": null,
"sent_at": "2026-10-18T09:20:44+00:00",
"viewed_at": null,
"notes": null,
"created_at": "2026-10-17T15:02:10+00:00",
"updated_at": "2026-10-18T09:20:44+00:00"
}
],
"links": {
"first": null,
"last": null,
"prev": null,
"next": null
},
"meta": {
"path": "https://api.closepact.com/v1/api/invoices",
"per_page": 50,
"next_cursor": null,
"prev_cursor": null
}
}Query parameters
qstringSearch the invoice number and the two references.
Example
1042filter[status]string | array of stringsOne status, or several as
filter[status][]=sent&filter[status][]=partially_paid.filter[account_id]string(uuid)Only this customer's invoices.
filter[type]string | array of stringsInvoices, credit notes, or (repeated as
filter[type][]) both.filter[overdue]booleantruefor invoices that are overdue right now.filter[from]string(date)Issued on or after this date.
Example
2026-09-01filter[to]string(date)Issued on or before this date.
Example
2026-09-30limitintegerInvoices per page.
Default
501–200cursorstringOpaque 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)requiredtypestringrequiredOne of
invoicecredit_noteinvoice_numberstringnullablerequiredNull on a draft; allocated at send.
seriesstringrequiredAunless chosen otherwise; credit notesK+ the invoice's series.referencestringrequiredThe number as said out loud —
A-1042— orUtkastfor a draft.statusstringrequiredSee the status table in the Invoices section.
One of
draftsentpartially_paidpaidoverduecreditedcancelledwritten_offstatus_labelstringrequiredThe status in Swedish, as printed: Utkast, Skickad, Delbetald, Betald, Förfallen, Krediterad, Makulerad, Avskriven.
is_editablebooleanrequiredTrue only for a draft.
handoverobjectnullablerequiredThe accepted quote this invoice was drafted from — for an organization with invoicing and no scheduling — or null.
customerobjectrequiredcontactobjectnullableThe person the invoice is addressed to. Only on a single invoice.
datesobjectrequiredreferencesobjectrequiredamountsobjectrequiredIntegers in öre.
rot_rutobjectrequiredThe tax deduction on the invoice, kept apart from what the customer owes.
linesarray of objectsAbsent from lists.
delivery_methodstringrequiredOne of
emailpeppolprintdeliveryobjectnullablerequiredWhere Closepact emailed the invoice.
automaticis true when a recurring invoice agreement sent it;statusisqueuedfor a send from the panel or API (handed to the mail queue) andsentfor an automatic one (accepted by the mail server before the invoice counted as sent). Null when nothing was emailed — Peppol and print are not delivered by Closepact.delivery_failureobjectnullablerequiredWhy a recurring invoice agreement that was meant to send this invoice did not. The invoice is then still a draft, without a number.
sent_atstring(date-time)nullablerequiredviewed_atstring(date-time)nullablerequiredWhen the customer first opened the emailed invoice.
notesstringnullablerequiredPrinted on the invoice. On a credit note, the reason.
created_atstring(date-time)requiredupdated_atstring(date-time)required
linksobjectrequiredmetaobjectrequired
- 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. - 429The key has made more requests this minute than its limit allows.Errors
Create an invoice draft
/invoicesCreates a draft for a customer. Add its rows with POST /invoices/{invoice}/lines, then send it.
Only account_id is required. The rest comes from the customer: payment terms (then the organization's default, 30 days) and currency. delivery_method defaults to email.
The dates on a draft are provisional. Sending stamps the invoice with the day it is sent, by the Swedish calendar, and a due date payment_terms_days after that — whatever issue_date and due_date the draft held. To give the customer 20 days, send payment_terms_days: 20. delivery_date (leveransdatum, when the work was done) is kept as you set it; it decides the VAT period.
ROT/RUT. rot_rut: "rot" or "rut" makes Closepact add and maintain the deduction line from the eligible labour lines. Use it only for private customers, and make sure the customer has a tax profile — see the Invoices section.
No number, OCR reference or amount can be set here; they are produced by the lines and by sending. A customer, contact or office id from another organization answers 404.
curl -X POST 'https://api.closepact.com/v1/api/invoices' \
-H "Authorization: Bearer $CLOSEPACT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"account_id": "01a15a21-0c44-7b19-8e2d-6f3a9c1b5d70",
"contact_id": "01a15a21-0c7a-70e4-9b3c-5d8a2f6e1c49",
"delivery_date": "2026-10-16",
"payment_terms_days": 20,
"your_reference": "Eva Ek",
"our_reference": "Anna Lindqvist",
"rot_rut": "rut"
}'{
"data": {
"id": "01a15b02-7c14-7e2b-8d5a-3f9c1e6b4a27",
"type": "invoice",
"invoice_number": null,
"series": "A",
"reference": "Utkast",
"status": "draft",
"status_label": "Utkast",
"is_editable": true,
"handover": null,
"customer": {
"id": "01a15a21-0c44-7b19-8e2d-6f3a9c1b5d70",
"name": "Eva Ek",
"customer_number": "1043",
"payment_terms_days": 20
},
"dates": {
"issue_date": "2026-10-17",
"due_date": "2026-11-06",
"delivery_date": "2026-10-16",
"payment_terms_days": 20,
"days_overdue": 0
},
"references": {
"your_reference": "Eva Ek",
"our_reference": "Anna Lindqvist",
"ocr_reference": null
},
"amounts": {
"currency": "SEK",
"net_cents": 0,
"vat_cents": 0,
"rounding_cents": 0,
"total_cents": 0,
"paid_cents": 0,
"outstanding_cents": 0,
"vat_by_rate": []
},
"rot_rut": {
"type": "rut",
"work_type": null,
"requested_cents": 0,
"approved_cents": 0,
"refused_cents": 0,
"status": "none",
"customer_pays_cents": 0,
"annual_ceiling_applied": false,
"tax_profile_id": null,
"buyer": null
},
"lines": [],
"delivery_method": "email",
"delivery": null,
"delivery_failure": null,
"sent_at": null,
"viewed_at": null,
"notes": null,
"created_at": "2026-10-17T15:02:10+00:00",
"updated_at": "2026-10-17T15:02:10+00:00"
}
}Request body
application/json · required
The writable header fields of an invoice draft. On update every field is optional.
account_idstring(uuid)requiredThe customer.
contact_idstring(uuid)nullableThe person at the customer it is addressed to; their email is where it is sent.
sub_entity_idstring(uuid)nullableThe office issuing it, for organizations with several.
issue_datestring(date)nullableProvisional; replaced by the send date.
due_datestring(date)nullableProvisional; replaced by send date + payment terms.
delivery_datestring(date)nullablepayment_terms_daysinteger0–365
currencystringexactly 3 characters
your_referencestringnullableat most 128 characters
our_referencestringnullableat most 128 characters
seriesstringNumber series. Each series is numbered on its own.
Default
"A"at most 8 charactersrot_rutstringROT and RUT are included from the Väx tier of invoicing (
invoicing.tax_deduction); settingrotorrutwithout it is answered402with thatfeature.noneis always accepted.One of
nonerotrutDefault
"none"rot_rut_work_typestringnullableSkatteverket's category for the work on every line that names none of its own (
rot_rut_work_typeon the line). The claim to Skatteverket declares the labour, hours and material per category.One of
ByggElGlasPlatarbeteMarkDraneringarbeteMurningMalningTapetseringVvsStadningKladOchTextilvardSnoskottningTradgardsarbeteBarnpassningPersonligomsorgFlyttjansterItTjansterReparationAvVitvarorMobleringTillsynAvBostadTransportTillForsaljningTvattVidTvattinrattningtax_profile_idstring(uuid)nullableWhich of the customer's ROT/RUT tax profiles the deduction is claimed for. Must belong to the invoice's customer. Left out on a ROT/RUT invoice, the customer's only profile (or the one tied to the work order's service address) is used.
delivery_methodstringOne of
emailpeppolprintDefault
"email"notesstringnullable
Responses
Headers
X-RateLimit-Limit— Requests this key may make per minute.X-RateLimit-Remaining— Requests left in the current minute.
dataobjectrequiredAn invoice or credit note.
idstring(uuid)requiredtypestringrequiredOne of
invoicecredit_noteinvoice_numberstringnullablerequiredNull on a draft; allocated at send.
seriesstringrequiredAunless chosen otherwise; credit notesK+ the invoice's series.referencestringrequiredThe number as said out loud —
A-1042— orUtkastfor a draft.statusstringrequiredSee the status table in the Invoices section.
One of
draftsentpartially_paidpaidoverduecreditedcancelledwritten_offstatus_labelstringrequiredThe status in Swedish, as printed: Utkast, Skickad, Delbetald, Betald, Förfallen, Krediterad, Makulerad, Avskriven.
is_editablebooleanrequiredTrue only for a draft.
handoverobjectnullablerequiredThe accepted quote this invoice was drafted from — for an organization with invoicing and no scheduling — or null.
customerobjectrequiredcontactobjectnullableThe person the invoice is addressed to. Only on a single invoice.
datesobjectrequiredreferencesobjectrequiredamountsobjectrequiredIntegers in öre.
rot_rutobjectrequiredThe tax deduction on the invoice, kept apart from what the customer owes.
linesarray of objectsAbsent from lists.
delivery_methodstringrequiredOne of
emailpeppolprintdeliveryobjectnullablerequiredWhere Closepact emailed the invoice.
automaticis true when a recurring invoice agreement sent it;statusisqueuedfor a send from the panel or API (handed to the mail queue) andsentfor an automatic one (accepted by the mail server before the invoice counted as sent). Null when nothing was emailed — Peppol and print are not delivered by Closepact.delivery_failureobjectnullablerequiredWhy a recurring invoice agreement that was meant to send this invoice did not. The invoice is then still a draft, without a number.
sent_atstring(date-time)nullablerequiredviewed_atstring(date-time)nullablerequiredWhen the customer first opened the emailed invoice.
notesstringnullablerequiredPrinted on the invoice. On a credit note, the reason.
created_atstring(date-time)requiredupdated_atstring(date-time)required
- 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
- 422The request body or query failed validation.Errors
- 429The key has made more requests this minute than its limit allows.Errors
Create a draft from finished work orders
/invoices/from-work-ordersBuilds one invoice draft from up to 100 finished work orders of the scheduling module, the way the panel's Fakturera button does, and marks the work orders invoiced.
What is billed is what scheduling has settled: approved time only (hours still awaiting approval are left out and reported in meta.warnings), services and materials as separate lines, and the agreed price instead of the hours for a fixed-price job. The ROT/RUT type comes from the work orders.
Refused with 409 when the work orders belong to different customers, disagree about the deduction, are not finished, or were already invoiced. A work order id the organization cannot see answers 404, and so does every request from an organization without the scheduling module. The result is an ordinary draft: check meta.warnings, adjust the lines if needed, and send it.
curl -X POST 'https://api.closepact.com/v1/api/invoices/from-work-orders' \
-H "Authorization: Bearer $CLOSEPACT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"work_order_ids": [
"01a158e4-6b1d-7a29-8c5f-2e7d4b9a3c16"
],
"delivery_date": "2026-10-16",
"our_reference": "Anna Lindqvist"
}'{
"data": {
"id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"type": "invoice",
"invoice_number": "string",
"series": "string",
"reference": "string",
"status": "draft",
"status_label": "string",
"is_editable": true,
"handover": {
"quote_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"quote_number": "string",
"created_automatically": true,
"warnings": [
{
"code": "string",
"message": "A short description."
}
]
},
"customer": {
"id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"name": "Anna Lindqvist",
"customer_number": "string",
"payment_terms_days": 1
},
"contact": {
"id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"organization_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"account_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"email": "anna@nordiskfastighet.se",
"name": "Anna Lindqvist",
"title": "Quarterly window cleaning",
"phone": "+46701234567",
"crm_external_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"crm_provider": "string",
"metadata": {},
"created_at": "2026-10-18T09:30:00Z",
"updated_at": "2026-10-18T09:30:00Z",
"deleted_at": "2026-10-18T09:30:00Z"
},
"dates": {
"issue_date": "2026-10-18",
"due_date": "2026-10-18",
"delivery_date": "2026-10-18",
"payment_terms_days": 1,
"days_overdue": 1
},
"references": {
"your_reference": "string",
"our_reference": "string",
"ocr_reference": "string"
},
"amounts": {
"currency": "SEK",
"net_cents": 125000,
"vat_cents": 125000,
"rounding_cents": 125000,
"total_cents": 125000,
"paid_cents": 125000,
"outstanding_cents": 125000,
"vat_by_rate": [
{
"rate": 1,
"net_cents": 125000,
"vat_cents": 125000
}
]
},
"rot_rut": {
"type": "none",
"work_type": "Bygg",
"requested_cents": 125000,
"approved_cents": 125000,
"refused_cents": 125000,
"status": "none",
"customer_pays_cents": 125000,
"annual_ceiling_applied": false,
"tax_profile_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"buyer": {
"name": "Anna Lindqvist",
"personal_number_masked": "string",
"property_designation": "string",
"brf_org_number": "556677-8899",
"apartment_number": "string",
"work_address": "Södra Hamngatan 1"
}
},
"lines": [
{
"id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"sort_order": 1,
"description": "A short description.",
"quantity": 1,
"unit": "string",
"unit_price_cents": 125000,
"discount_percent": 25,
"vat_rate": 25,
"net_cents": 125000,
"vat_cents": 125000,
"total_cents": 125000,
"line_type": "goods",
"rot_rut_eligible": true,
"rot_rut_work_type": "Bygg",
"is_generated": true,
"account_code": "string",
"article_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"work_order_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"time_entry_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"metadata": {}
}
],
"delivery_method": "email",
"delivery": {
"method": "email",
"to": "anna@nordiskfastighet.se",
"at": "2026-10-18T09:30:00Z",
"automatic": true,
"status": "queued"
},
"delivery_failure": {
"at": "2026-10-18T09:30:00Z",
"reason": "string",
"automatic": true
},
"sent_at": "2026-10-18T09:30:00Z",
"viewed_at": "2026-10-18T09:30:00Z",
"notes": "A short description.",
"created_at": "2026-10-18T09:30:00Z",
"updated_at": "2026-10-18T09:30:00Z"
},
"meta": {
"warnings": [
{
"code": "string",
"message": "A short description.",
"context": {},
"work_order_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"order_number": "string"
}
],
"work_order_ids": [
"01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40"
]
}
}Request body
application/json · required
work_order_idsarray of strings(uuid)required1–100 items
issue_datestring(date)Provisional, as on any draft.
due_datestring(date)On or after
issue_date. Provisional, as on any draft.delivery_datestring(date)your_referencestringnullableat most 128 characters
our_referencestringnullableat most 128 characters
notesstringnullable
Responses
Headers
X-RateLimit-Limit— Requests this key may make per minute.X-RateLimit-Remaining— Requests left in the current minute.
dataobjectrequiredAn invoice or credit note.
idstring(uuid)requiredtypestringrequiredOne of
invoicecredit_noteinvoice_numberstringnullablerequiredNull on a draft; allocated at send.
seriesstringrequiredAunless chosen otherwise; credit notesK+ the invoice's series.referencestringrequiredThe number as said out loud —
A-1042— orUtkastfor a draft.statusstringrequiredSee the status table in the Invoices section.
One of
draftsentpartially_paidpaidoverduecreditedcancelledwritten_offstatus_labelstringrequiredThe status in Swedish, as printed: Utkast, Skickad, Delbetald, Betald, Förfallen, Krediterad, Makulerad, Avskriven.
is_editablebooleanrequiredTrue only for a draft.
handoverobjectnullablerequiredThe accepted quote this invoice was drafted from — for an organization with invoicing and no scheduling — or null.
customerobjectrequiredcontactobjectnullableThe person the invoice is addressed to. Only on a single invoice.
datesobjectrequiredreferencesobjectrequiredamountsobjectrequiredIntegers in öre.
rot_rutobjectrequiredThe tax deduction on the invoice, kept apart from what the customer owes.
linesarray of objectsAbsent from lists.
delivery_methodstringrequiredOne of
emailpeppolprintdeliveryobjectnullablerequiredWhere Closepact emailed the invoice.
automaticis true when a recurring invoice agreement sent it;statusisqueuedfor a send from the panel or API (handed to the mail queue) andsentfor an automatic one (accepted by the mail server before the invoice counted as sent). Null when nothing was emailed — Peppol and print are not delivered by Closepact.delivery_failureobjectnullablerequiredWhy a recurring invoice agreement that was meant to send this invoice did not. The invoice is then still a draft, without a number.
sent_atstring(date-time)nullablerequiredviewed_atstring(date-time)nullablerequiredWhen the customer first opened the emailed invoice.
notesstringnullablerequiredPrinted on the invoice. On a credit note, the reason.
created_atstring(date-time)requiredupdated_atstring(date-time)required
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
Get an invoice
/invoices/{invoice}One invoice or credit note with its contact and all its lines, including the generated ROT/RUT line.
What bookkeeping needs is here: amounts.vat_by_rate gives the VAT per rate (never blended), amounts.outstanding_cents what the customer still owes, and rot_rut the part claimed from Skatteverket, kept apart from what the customer owes. is_editable says whether the invoice may still change. Another organization's invoice id answers 404.
curl 'https://api.closepact.com/v1/api/invoices/01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40' \
-H "Authorization: Bearer $CLOSEPACT_API_KEY"{
"data": {
"id": "01a15b02-7c14-7e2b-8d5a-3f9c1e6b4a27",
"type": "invoice",
"invoice_number": "1042",
"series": "A",
"reference": "A-1042",
"status": "sent",
"status_label": "Skickad",
"is_editable": false,
"handover": null,
"customer": {
"id": "01a15a21-0c44-7b19-8e2d-6f3a9c1b5d70",
"name": "Eva Ek",
"customer_number": "1043",
"payment_terms_days": 20
},
"contact": {
"id": "01a15a21-0c7a-70e4-9b3c-5d8a2f6e1c49",
"organization_id": "01a14eb3-c5f0-7c55-8c2e-6a0e1f7b9d21",
"account_id": "01a15a21-0c44-7b19-8e2d-6f3a9c1b5d70",
"email": "eva.ek@example.se",
"name": "Eva Ek",
"title": null,
"phone": "+46 70 123 45 67",
"crm_external_id": null,
"crm_provider": null,
"metadata": null,
"created_at": "2026-09-14T10:03:51.000000Z",
"updated_at": "2026-09-14T10:03:51.000000Z",
"deleted_at": null
},
"dates": {
"issue_date": "2026-10-18",
"due_date": "2026-11-07",
"delivery_date": "2026-10-16",
"payment_terms_days": 20,
"days_overdue": 0
},
"references": {
"your_reference": "Eva Ek",
"our_reference": "Anna Lindqvist",
"ocr_reference": "10421"
},
"amounts": {
"currency": "SEK",
"net_cents": 195000,
"vat_cents": 48750,
"rounding_cents": 50,
"total_cents": 243800,
"paid_cents": 0,
"outstanding_cents": 131300,
"vat_by_rate": [
{
"rate": 25,
"net_cents": 195000,
"vat_cents": 48750
}
]
},
"rot_rut": {
"type": "rut",
"work_type": "Stadning",
"requested_cents": 112500,
"approved_cents": 0,
"refused_cents": 0,
"status": "none",
"customer_pays_cents": 131300,
"annual_ceiling_applied": false,
"tax_profile_id": null,
"buyer": null
},
"lines": [
{
"id": "01a15b02-7c2e-7148-a9f3-6d2b8e5c1f40",
"sort_order": 0,
"description": "Hemstädning",
"quantity": 4,
"unit": "tim",
"unit_price_cents": 45000,
"discount_percent": 0,
"vat_rate": 25,
"net_cents": 180000,
"vat_cents": 45000,
"total_cents": 225000,
"line_type": "labour",
"rot_rut_eligible": true,
"rot_rut_work_type": "Stadning",
"is_generated": false,
"account_code": "3001",
"article_id": "01a159f8-2d6a-7b3e-9f1c-8e4a2d7b5c63",
"work_order_id": null,
"time_entry_id": null,
"metadata": []
},
{
"id": "01a15b02-7c41-72d6-b5e8-1a7f3c9d2e85",
"sort_order": 1,
"description": "Rengöringsmedel",
"quantity": 1,
"unit": "st",
"unit_price_cents": 15000,
"discount_percent": 0,
"vat_rate": 25,
"net_cents": 15000,
"vat_cents": 3750,
"total_cents": 18750,
"line_type": "goods",
"rot_rut_eligible": false,
"rot_rut_work_type": null,
"is_generated": false,
"account_code": null,
"article_id": null,
"work_order_id": null,
"time_entry_id": null,
"metadata": []
},
{
"id": "01a15b02-7c53-7a9c-8e1d-4b6f2a8c5d19",
"sort_order": 2,
"description": "RUT-avdrag, 50 % av arbetskostnad inkl. moms",
"quantity": 1,
"unit": null,
"unit_price_cents": -112500,
"discount_percent": 0,
"vat_rate": 0,
"net_cents": -112500,
"vat_cents": 0,
"total_cents": -112500,
"line_type": "rot_rut_deduction",
"rot_rut_eligible": false,
"rot_rut_work_type": null,
"is_generated": true,
"account_code": null,
"article_id": null,
"work_order_id": null,
"time_entry_id": null,
"metadata": {
"eligible_gross_cents": 225000,
"rate_percent": 50,
"customer_pays_cents": 131300,
"annual_ceiling_applied": false
}
}
],
"delivery_method": "email",
"delivery": null,
"delivery_failure": null,
"sent_at": "2026-10-18T09:20:44+00:00",
"viewed_at": "2026-10-18T17:02:31+00:00",
"notes": null,
"created_at": "2026-10-17T15:02:10+00:00",
"updated_at": "2026-10-18T09:20:44+00:00"
}
}Path parameters
invoicestring(uuid)requiredThe invoice's or credit note's id.
Responses
Headers
X-RateLimit-Limit— Requests this key may make per minute.X-RateLimit-Remaining— Requests left in the current minute.
dataobjectrequiredAn invoice or credit note.
idstring(uuid)requiredtypestringrequiredOne of
invoicecredit_noteinvoice_numberstringnullablerequiredNull on a draft; allocated at send.
seriesstringrequiredAunless chosen otherwise; credit notesK+ the invoice's series.referencestringrequiredThe number as said out loud —
A-1042— orUtkastfor a draft.statusstringrequiredSee the status table in the Invoices section.
One of
draftsentpartially_paidpaidoverduecreditedcancelledwritten_offstatus_labelstringrequiredThe status in Swedish, as printed: Utkast, Skickad, Delbetald, Betald, Förfallen, Krediterad, Makulerad, Avskriven.
is_editablebooleanrequiredTrue only for a draft.
handoverobjectnullablerequiredThe accepted quote this invoice was drafted from — for an organization with invoicing and no scheduling — or null.
customerobjectrequiredcontactobjectnullableThe person the invoice is addressed to. Only on a single invoice.
datesobjectrequiredreferencesobjectrequiredamountsobjectrequiredIntegers in öre.
rot_rutobjectrequiredThe tax deduction on the invoice, kept apart from what the customer owes.
linesarray of objectsAbsent from lists.
delivery_methodstringrequiredOne of
emailpeppolprintdeliveryobjectnullablerequiredWhere Closepact emailed the invoice.
automaticis true when a recurring invoice agreement sent it;statusisqueuedfor a send from the panel or API (handed to the mail queue) andsentfor an automatic one (accepted by the mail server before the invoice counted as sent). Null when nothing was emailed — Peppol and print are not delivered by Closepact.delivery_failureobjectnullablerequiredWhy a recurring invoice agreement that was meant to send this invoice did not. The invoice is then still a draft, without a number.
sent_atstring(date-time)nullablerequiredviewed_atstring(date-time)nullablerequiredWhen the customer first opened the emailed invoice.
notesstringnullablerequiredPrinted on the invoice. On a credit note, the reason.
created_atstring(date-time)requiredupdated_atstring(date-time)required
- 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
Update an invoice draft
/invoices/{invoice}Changes the header of a draft — customer, contact, dates, terms, references, ROT/RUT, delivery method, notes. Only the fields you send change.
- Changing
payment_terms_daysorissue_datewithout sendingdue_datemoves the due date with them. - Changing
account_idtakes the new customer's payment terms unless you send your own. - Changing
rot_rutadds, recalculates or removes the deduction line at once.
An issued invoice answers 409: correct it with a credit note.
curl -X PATCH 'https://api.closepact.com/v1/api/invoices/01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40' \
-H "Authorization: Bearer $CLOSEPACT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"payment_terms_days": 30,
"notes": "Gäller städning vecka 42."
}'{
"data": {
"id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"type": "invoice",
"invoice_number": "string",
"series": "string",
"reference": "string",
"status": "draft",
"status_label": "string",
"is_editable": true,
"handover": {
"quote_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"quote_number": "string",
"created_automatically": true,
"warnings": [
{
"code": "string",
"message": "A short description."
}
]
},
"customer": {
"id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"name": "Anna Lindqvist",
"customer_number": "string",
"payment_terms_days": 1
},
"contact": {
"id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"organization_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"account_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"email": "anna@nordiskfastighet.se",
"name": "Anna Lindqvist",
"title": "Quarterly window cleaning",
"phone": "+46701234567",
"crm_external_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"crm_provider": "string",
"metadata": {},
"created_at": "2026-10-18T09:30:00Z",
"updated_at": "2026-10-18T09:30:00Z",
"deleted_at": "2026-10-18T09:30:00Z"
},
"dates": {
"issue_date": "2026-10-18",
"due_date": "2026-10-18",
"delivery_date": "2026-10-18",
"payment_terms_days": 1,
"days_overdue": 1
},
"references": {
"your_reference": "string",
"our_reference": "string",
"ocr_reference": "string"
},
"amounts": {
"currency": "SEK",
"net_cents": 125000,
"vat_cents": 125000,
"rounding_cents": 125000,
"total_cents": 125000,
"paid_cents": 125000,
"outstanding_cents": 125000,
"vat_by_rate": [
{
"rate": 1,
"net_cents": 125000,
"vat_cents": 125000
}
]
},
"rot_rut": {
"type": "none",
"work_type": "Bygg",
"requested_cents": 125000,
"approved_cents": 125000,
"refused_cents": 125000,
"status": "none",
"customer_pays_cents": 125000,
"annual_ceiling_applied": false,
"tax_profile_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"buyer": {
"name": "Anna Lindqvist",
"personal_number_masked": "string",
"property_designation": "string",
"brf_org_number": "556677-8899",
"apartment_number": "string",
"work_address": "Södra Hamngatan 1"
}
},
"lines": [
{
"id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"sort_order": 1,
"description": "A short description.",
"quantity": 1,
"unit": "string",
"unit_price_cents": 125000,
"discount_percent": 25,
"vat_rate": 25,
"net_cents": 125000,
"vat_cents": 125000,
"total_cents": 125000,
"line_type": "goods",
"rot_rut_eligible": true,
"rot_rut_work_type": "Bygg",
"is_generated": true,
"account_code": "string",
"article_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"work_order_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"time_entry_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"metadata": {}
}
],
"delivery_method": "email",
"delivery": {
"method": "email",
"to": "anna@nordiskfastighet.se",
"at": "2026-10-18T09:30:00Z",
"automatic": true,
"status": "queued"
},
"delivery_failure": {
"at": "2026-10-18T09:30:00Z",
"reason": "string",
"automatic": true
},
"sent_at": "2026-10-18T09:30:00Z",
"viewed_at": "2026-10-18T09:30:00Z",
"notes": "A short description.",
"created_at": "2026-10-18T09:30:00Z",
"updated_at": "2026-10-18T09:30:00Z"
}
}Path parameters
invoicestring(uuid)requiredThe invoice's or credit note's id.
Request body
application/json · required
The writable header fields of an invoice draft. On update every field is optional.
account_idstring(uuid)The customer.
contact_idstring(uuid)nullableThe person at the customer it is addressed to; their email is where it is sent.
sub_entity_idstring(uuid)nullableThe office issuing it, for organizations with several.
issue_datestring(date)nullableProvisional; replaced by the send date.
due_datestring(date)nullableProvisional; replaced by send date + payment terms.
delivery_datestring(date)nullablepayment_terms_daysinteger0–365
currencystringexactly 3 characters
your_referencestringnullableat most 128 characters
our_referencestringnullableat most 128 characters
seriesstringNumber series. Each series is numbered on its own.
Default
"A"at most 8 charactersrot_rutstringROT and RUT are included from the Väx tier of invoicing (
invoicing.tax_deduction); settingrotorrutwithout it is answered402with thatfeature.noneis always accepted.One of
nonerotrutDefault
"none"rot_rut_work_typestringnullableSkatteverket's category for the work on every line that names none of its own (
rot_rut_work_typeon the line). The claim to Skatteverket declares the labour, hours and material per category.One of
ByggElGlasPlatarbeteMarkDraneringarbeteMurningMalningTapetseringVvsStadningKladOchTextilvardSnoskottningTradgardsarbeteBarnpassningPersonligomsorgFlyttjansterItTjansterReparationAvVitvarorMobleringTillsynAvBostadTransportTillForsaljningTvattVidTvattinrattningtax_profile_idstring(uuid)nullableWhich of the customer's ROT/RUT tax profiles the deduction is claimed for. Must belong to the invoice's customer. Left out on a ROT/RUT invoice, the customer's only profile (or the one tied to the work order's service address) is used.
delivery_methodstringOne of
emailpeppolprintDefault
"email"notesstringnullable
Responses
Headers
X-RateLimit-Limit— Requests this key may make per minute.X-RateLimit-Remaining— Requests left in the current minute.
dataobjectrequiredAn invoice or credit note.
idstring(uuid)requiredtypestringrequiredOne of
invoicecredit_noteinvoice_numberstringnullablerequiredNull on a draft; allocated at send.
seriesstringrequiredAunless chosen otherwise; credit notesK+ the invoice's series.referencestringrequiredThe number as said out loud —
A-1042— orUtkastfor a draft.statusstringrequiredSee the status table in the Invoices section.
One of
draftsentpartially_paidpaidoverduecreditedcancelledwritten_offstatus_labelstringrequiredThe status in Swedish, as printed: Utkast, Skickad, Delbetald, Betald, Förfallen, Krediterad, Makulerad, Avskriven.
is_editablebooleanrequiredTrue only for a draft.
handoverobjectnullablerequiredThe accepted quote this invoice was drafted from — for an organization with invoicing and no scheduling — or null.
customerobjectrequiredcontactobjectnullableThe person the invoice is addressed to. Only on a single invoice.
datesobjectrequiredreferencesobjectrequiredamountsobjectrequiredIntegers in öre.
rot_rutobjectrequiredThe tax deduction on the invoice, kept apart from what the customer owes.
linesarray of objectsAbsent from lists.
delivery_methodstringrequiredOne of
emailpeppolprintdeliveryobjectnullablerequiredWhere Closepact emailed the invoice.
automaticis true when a recurring invoice agreement sent it;statusisqueuedfor a send from the panel or API (handed to the mail queue) andsentfor an automatic one (accepted by the mail server before the invoice counted as sent). Null when nothing was emailed — Peppol and print are not delivered by Closepact.delivery_failureobjectnullablerequiredWhy a recurring invoice agreement that was meant to send this invoice did not. The invoice is then still a draft, without a number.
sent_atstring(date-time)nullablerequiredviewed_atstring(date-time)nullablerequiredWhen the customer first opened the emailed invoice.
notesstringnullablerequiredPrinted on the invoice. On a credit note, the reason.
created_atstring(date-time)requiredupdated_atstring(date-time)required
- 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
Delete an invoice draft
/invoices/{invoice}Throws a draft away. A draft never took a number, so nothing is left to explain. An issued invoice cannot be deleted — it has to be kept for seven years — and answers 409; correct it with a credit note instead.
curl -X DELETE 'https://api.closepact.com/v1/api/invoices/01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40' \
-H "Authorization: Bearer $CLOSEPACT_API_KEY"{
"deleted": true
}Path parameters
invoicestring(uuid)requiredThe invoice's or credit note's id.
Responses
Headers
X-RateLimit-Limit— Requests this key may make per minute.X-RateLimit-Remaining— Requests left in the current minute.
deletedbooleanrequiredOne of
true
- 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
Send (issue) an invoice
/invoices/{invoice}/sendTurns a draft into an invoice and delivers it. This is the irreversible step, and it needs its own permission, invoicing.invoices.send.
In one transaction the invoice:
- takes the next number in its series and gets its OCR reference;
- is dated today by the Swedish calendar, with the due date
payment_terms_dayslater; - has its totals summed from the lines and its ROT/RUT request fixed;
- becomes
sent, and its PDF is rendered and stored — that file is whatGET /invoices/{invoice}/pdfserves from now on.
Then, for delivery_method: email, it is emailed with the PDF attached to to, or else to the invoice's contact, or else to the customer's reminder_email. peppol and print are recorded but not delivered by Closepact; delivered is null for them and you deliver the PDF yourself.
Before anything is spent: an invoice that is already issued answers 409 (a retried request is therefore safe — it cannot take a second number), an invoice without lines 409, and an email invoice with nowhere to send it 422 on to, leaving the draft untouched.
The response is the issued invoice as stored — its database row with lines, account and contact — which is a different shape from GET /invoices/{invoice}; fetch that if you want the usual one.
curl -X POST 'https://api.closepact.com/v1/api/invoices/01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40/send' \
-H "Authorization: Bearer $CLOSEPACT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "eva.ek@example.se"
}'{
"data": {
"id": "01a15b02-7c14-7e2b-8d5a-3f9c1e6b4a27",
"organization_id": "01a14eb3-c5f0-7c55-8c2e-6a0e1f7b9d21",
"sub_entity_id": null,
"invoice_number": "1042",
"series": "A",
"type": "invoice",
"credited_invoice_id": null,
"account_id": "01a15a21-0c44-7b19-8e2d-6f3a9c1b5d70",
"contact_id": "01a15a21-0c7a-70e4-9b3c-5d8a2f6e1c49",
"status": "sent",
"issue_date": "2026-10-18T00:00:00.000000Z",
"due_date": "2026-11-07T00:00:00.000000Z",
"delivery_date": "2026-10-16T00:00:00.000000Z",
"currency": "SEK",
"your_reference": "Eva Ek",
"our_reference": "Anna Lindqvist",
"payment_terms_days": 20,
"net_cents": 195000,
"vat_cents": 48750,
"rounding_cents": 50,
"total_cents": 243800,
"rot_rut": "rut",
"rot_rut_work_type": "Stadning",
"rot_rut_requested_cents": 112500,
"rot_rut_approved_cents": 0,
"rot_rut_refused_cents": 0,
"rot_rut_status": "pending",
"tax_profile_id": null,
"paid_cents": 0,
"ocr_reference": "10421",
"delivery_method": "email",
"sent_at": "2026-10-18T09:20:44.000000Z",
"viewed_at": null,
"reminder_count": 0,
"last_reminder_at": null,
"pdf_document_id": "01a15b02-8f61-7c3a-b4d2-9e1f6a3c8b05",
"sie_exported_at": null,
"external_ref": [],
"notes": null,
"metadata": {
"vat_by_rate": [
{
"rate": 25,
"net_cents": 195000,
"vat_cents": 48750
}
],
"deduction": {
"type": "rut",
"rate_percent": 50,
"eligible_gross_cents": 225000,
"deduction_cents": 112500,
"customer_pays_cents": 131300,
"annual_ceiling_applied": false
},
"delivery": {
"method": "email",
"to": "eva.ek@example.se",
"at": "2026-10-18T09:20:44+00:00",
"automatic": false,
"status": "queued"
}
},
"created_by": "01a14eb3-c634-7238-bc76-18b09b287f98",
"created_at": "2026-10-17T15:02:10.000000Z",
"updated_at": "2026-10-18T09:20:44.000000Z",
"deleted_at": null,
"recurring_invoice_id": null,
"occurrence_date": null,
"lines": [
{
"id": "01a15b02-7c2e-7148-a9f3-6d2b8e5c1f40",
"customer_invoice_id": "01a15b02-7c14-7e2b-8d5a-3f9c1e6b4a27",
"organization_id": "01a14eb3-c5f0-7c55-8c2e-6a0e1f7b9d21",
"sort_order": 0,
"article_id": "01a159f8-2d6a-7b3e-9f1c-8e4a2d7b5c63",
"work_order_id": null,
"time_entry_id": null,
"description": "Hemstädning",
"quantity": 4,
"unit": "tim",
"unit_price_cents": 45000,
"discount_percent": 0,
"vat_rate": 25,
"net_cents": 180000,
"vat_cents": 45000,
"total_cents": 225000,
"line_type": "labour",
"rot_rut_eligible": true,
"rot_rut_work_type": "Stadning",
"account_code": "3001",
"metadata": [],
"created_at": "2026-10-17T15:03:40.000000Z",
"updated_at": "2026-10-17T15:03:40.000000Z"
}
],
"account": {
"id": "01a15a21-0c44-7b19-8e2d-6f3a9c1b5d70",
"organization_id": "01a14eb3-c5f0-7c55-8c2e-6a0e1f7b9d21",
"name": "Eva Ek",
"domain": null,
"industry": null,
"size": null,
"country": "SE",
"crm_external_id": null,
"crm_provider": null,
"metadata": null,
"created_at": "2026-09-14T10:03:51.000000Z",
"updated_at": "2026-09-14T10:03:51.000000Z",
"deleted_at": null,
"sub_entity_id": null,
"customer_number": "1043",
"customer_type": "private",
"org_number": null,
"vat_number": null,
"industry_code": null,
"payment_terms_days": 20,
"late_interest_percent": null,
"vat_mode": "se",
"invoice_delivery": "email",
"peppol_id": null,
"einvoice_reference": null,
"reminder_email": null,
"currency": "SEK",
"locale": "sv",
"default_price_list_id": null,
"credit_limit_cents": null,
"is_blocked": false,
"notes": null
},
"contact": {
"id": "01a15a21-0c7a-70e4-9b3c-5d8a2f6e1c49",
"organization_id": "01a14eb3-c5f0-7c55-8c2e-6a0e1f7b9d21",
"account_id": "01a15a21-0c44-7b19-8e2d-6f3a9c1b5d70",
"email": "eva.ek@example.se",
"name": "Eva Ek",
"title": null,
"phone": "+46 70 123 45 67",
"crm_external_id": null,
"crm_provider": null,
"metadata": null,
"created_at": "2026-09-14T10:03:51.000000Z",
"updated_at": "2026-09-14T10:03:51.000000Z",
"deleted_at": null
}
},
"delivered": "eva.ek@example.se"
}Path parameters
invoicestring(uuid)requiredThe invoice's or credit note's id.
Request body
application/json
tostring(email)nullableSend to this address instead of the contact's.
at most 320 characters
delivery_methodstringOverrides the draft's delivery method, and is saved on it.
One of
emailpeppolprint
Responses
Headers
X-RateLimit-Limit— Requests this key may make per minute.X-RateLimit-Remaining— Requests left in the current minute.
dataobjectrequiredAn invoice exactly as stored, returned by send and credit. Dates are serialized as midnight UTC timestamps. Prefer
GET /invoices/{invoice}for display.idstring(uuid)requiredorganization_idstring(uuid)requiredsub_entity_idstring(uuid)nullablerequiredinvoice_numberstringnullablerequiredseriesstringrequiredtypestringrequiredOne of
invoicecredit_notecredited_invoice_idstring(uuid)nullablerequiredOn a credit note, the invoice it credits.
account_idstring(uuid)requiredcontact_idstring(uuid)nullablerequiredstatusstringrequiredSee the status table in the Invoices section.
One of
draftsentpartially_paidpaidoverduecreditedcancelledwritten_offissue_datestring(date-time)nullablerequireddue_datestring(date-time)nullablerequireddelivery_datestring(date-time)nullablerequiredcurrencystringrequiredyour_referencestringnullablerequiredour_referencestringnullablerequiredpayment_terms_daysintegerrequirednet_centsintegerrequiredvat_centsintegerrequiredrounding_centsintegerrequiredtotal_centsintegerrequiredrot_rutstringrequiredOne of
nonerotrutrot_rut_work_typestringnullablerequiredSkatteverket's category for ROT or RUT work, as named in its claim file schema (version 6):
ByggtoVvsare ROT,StadningtoTvattVidTvattinrattningRUT.TransportTillForsaljningandTvattVidTvattinrattningare flat-rate services that are claimed without hours or material. Read when the claim to Skatteverket is filed; null when none is chosen.One of
ByggElGlasPlatarbeteMarkDraneringarbeteMurningMalningTapetseringVvsStadningKladOchTextilvardSnoskottningTradgardsarbeteBarnpassningPersonligomsorgFlyttjansterItTjansterReparationAvVitvarorMobleringTillsynAvBostadTransportTillForsaljningTvattVidTvattinrattningrot_rut_requested_centsintegerrequiredrot_rut_approved_centsintegerrequiredrot_rut_refused_centsintegerrequiredWhat Skatteverket refused of the deduction; owed by the customer again.
rot_rut_statusstringrequiredtax_profile_idstring(uuid)nullablerequiredThe ROT/RUT tax profile the deduction is claimed for.
paid_centsintegerrequiredocr_referencestringnullablerequireddelivery_methodstringrequiredOne of
emailpeppolprintsent_atstring(date-time)nullablerequiredviewed_atstring(date-time)nullablerequiredreminder_countintegerrequiredlast_reminder_atstring(date-time)nullablerequiredpdf_document_idstring(uuid)nullablerequiredThe stored PDF. Download it with
GET /invoices/{invoice}/pdf.sie_exported_atstring(date-time)nullablerequiredWhen the invoice went to the books in an SIE export.
external_refobject | array of valuesnullablerequirednotesstringnullablerequiredmetadataobject | array of valuesnullablerequiredWorking figures —
vat_by_rate,deduction,credits,source,delivery— not a stable contract.GET /invoices/{invoice}carriesdeliveryas a documented field.created_bystring(uuid)nullablerequiredcreated_atstring(date-time)requiredupdated_atstring(date-time)requireddeleted_atstring(date-time)nullablerequiredrecurring_invoice_idstring(uuid)nullableThe recurring invoice that produced it.
occurrence_datestringnullableFor a recurring invoice, the period it bills.
quote_idstring(uuid)nullableThe accepted quote the invoice was drafted from, for an organization that invoices without scheduling.
linesarray of objectsaccountobjectThe invoiced customer exactly as stored. The field names are the storage names:
invoice_deliveryandeinvoice_referenceareinvoicing.deliveryandinvoicing.referenceon a Customer.contactobjectnullablecredited_invoiceanynullableOn a credit note from
POST /invoices/{invoice}/credit: the original invoice, as stored.
deliveredstringnullablerequiredThe address the invoice was emailed to, or null when nothing was sent (peppol, print).
- 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
Credit an issued invoice
/invoices/{invoice}/creditCorrects an issued invoice by raising a credit note (kreditfaktura) against it. The original is never edited.
The body chooses how much:
- nothing — the whole invoice, every line mirrored with negative quantities;
lines— some lines, each for its full quantity or for part of it (quantity, at most what was invoiced);amount_cents— an agreed sum (net, in öre, atvat_rate, default 25) that corresponds to no line. Not combined withlines.
The credit note is issued immediately: it gets its own number in the credit series (K + the invoice's series, so KA-17), no OCR reference, today's date and a stored PDF, and it is emailed when the invoice has a recipient — though, unlike sending, a missing address does not stop it. When the invoice has been credited in full it becomes credited and is no longer chased.
Refused with 409 for a draft (edit it instead), for a credit note, for an invoice already credited in full, and for more than remains to credit. Whether a ROT/RUT claim already filed with Skatteverket is withdrawn is handled in Closepact's deduction workflow, not by the credit note.
Like sending, the response is the credit note as stored, with credited_invoice holding the original.
curl -X POST 'https://api.closepact.com/v1/api/invoices/01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40/credit' \
-H "Authorization: Bearer $CLOSEPACT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"reason": "Fakturan skickades till fel kund."
}'{
"data": {
"id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"organization_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"sub_entity_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"invoice_number": "string",
"series": "string",
"type": "invoice",
"credited_invoice_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"account_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"contact_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"status": "draft",
"issue_date": "2026-10-18T09:30:00Z",
"due_date": "2026-10-18T09:30:00Z",
"delivery_date": "2026-10-18T09:30:00Z",
"currency": "SEK",
"your_reference": "string",
"our_reference": "string",
"payment_terms_days": 1,
"net_cents": 125000,
"vat_cents": 125000,
"rounding_cents": 125000,
"total_cents": 125000,
"rot_rut": "none",
"rot_rut_work_type": "Bygg",
"rot_rut_requested_cents": 125000,
"rot_rut_approved_cents": 125000,
"rot_rut_refused_cents": 125000,
"rot_rut_status": "string",
"tax_profile_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"paid_cents": 125000,
"ocr_reference": "string",
"delivery_method": "email",
"sent_at": "2026-10-18T09:30:00Z",
"viewed_at": "2026-10-18T09:30:00Z",
"reminder_count": 1,
"last_reminder_at": "2026-10-18T09:30:00Z",
"pdf_document_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"sie_exported_at": "2026-10-18T09:30:00Z",
"external_ref": {},
"notes": "A short description.",
"metadata": {},
"created_by": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"created_at": "2026-10-18T09:30:00Z",
"updated_at": "2026-10-18T09:30:00Z",
"deleted_at": "2026-10-18T09:30:00Z",
"recurring_invoice_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"occurrence_date": "2026-10-18",
"quote_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"lines": [
{
"id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"customer_invoice_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"organization_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"sort_order": 1,
"article_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"work_order_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"time_entry_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"description": "A short description.",
"quantity": 1,
"unit": "string",
"unit_price_cents": 125000,
"discount_percent": 25,
"vat_rate": 25,
"net_cents": 125000,
"vat_cents": 125000,
"total_cents": 125000,
"line_type": "goods",
"rot_rut_eligible": true,
"rot_rut_work_type": "Bygg",
"account_code": "string",
"metadata": {},
"created_at": "2026-10-18T09:30:00Z",
"updated_at": "2026-10-18T09:30:00Z"
}
],
"account": {
"id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"organization_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"name": "Anna Lindqvist",
"domain": "string",
"industry": "string",
"size": "string",
"country": "SE",
"crm_external_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"crm_provider": "string",
"metadata": {},
"created_at": "2026-10-18T09:30:00Z",
"updated_at": "2026-10-18T09:30:00Z",
"deleted_at": "2026-10-18T09:30:00Z",
"sub_entity_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"customer_number": "string",
"customer_type": "company",
"org_number": "556677-8899",
"vat_number": "SE556677889901",
"industry_code": "string",
"payment_terms_days": 1,
"late_interest_percent": 25,
"vat_mode": "se",
"invoice_delivery": "email",
"peppol_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"einvoice_reference": "string",
"reminder_email": "anna@nordiskfastighet.se",
"currency": "SEK",
"locale": "sv",
"default_price_list_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"credit_limit_cents": 125000,
"is_blocked": true,
"notes": "A short description."
},
"contact": {
"id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"organization_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"account_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"email": "anna@nordiskfastighet.se",
"name": "Anna Lindqvist",
"title": "Quarterly window cleaning",
"phone": "+46701234567",
"crm_external_id": "01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40",
"crm_provider": "string",
"metadata": {},
"created_at": "2026-10-18T09:30:00Z",
"updated_at": "2026-10-18T09:30:00Z",
"deleted_at": "2026-10-18T09:30:00Z"
},
"credited_invoice": {}
}
}Path parameters
invoicestring(uuid)requiredThe invoice's or credit note's id.
Request body
application/json
reasonstringnullablePrinted on the credit note.
at most 500 characters
linesarray of objectsamount_centsintegerCredit this net amount in öre instead of lines.
≥ 1
vat_ratenumberWith
amount_cents: the VAT rate the amount was charged at.One of
251260Default
25descriptionstringnullableWith
amount_cents: the credit line's text. Defaults to Kreditering av faktura A-1042.at most 500 characters
Responses
Headers
X-RateLimit-Limit— Requests this key may make per minute.X-RateLimit-Remaining— Requests left in the current minute.
dataobjectrequiredAn invoice exactly as stored, returned by send and credit. Dates are serialized as midnight UTC timestamps. Prefer
GET /invoices/{invoice}for display.idstring(uuid)requiredorganization_idstring(uuid)requiredsub_entity_idstring(uuid)nullablerequiredinvoice_numberstringnullablerequiredseriesstringrequiredtypestringrequiredOne of
invoicecredit_notecredited_invoice_idstring(uuid)nullablerequiredOn a credit note, the invoice it credits.
account_idstring(uuid)requiredcontact_idstring(uuid)nullablerequiredstatusstringrequiredSee the status table in the Invoices section.
One of
draftsentpartially_paidpaidoverduecreditedcancelledwritten_offissue_datestring(date-time)nullablerequireddue_datestring(date-time)nullablerequireddelivery_datestring(date-time)nullablerequiredcurrencystringrequiredyour_referencestringnullablerequiredour_referencestringnullablerequiredpayment_terms_daysintegerrequirednet_centsintegerrequiredvat_centsintegerrequiredrounding_centsintegerrequiredtotal_centsintegerrequiredrot_rutstringrequiredOne of
nonerotrutrot_rut_work_typestringnullablerequiredSkatteverket's category for ROT or RUT work, as named in its claim file schema (version 6):
ByggtoVvsare ROT,StadningtoTvattVidTvattinrattningRUT.TransportTillForsaljningandTvattVidTvattinrattningare flat-rate services that are claimed without hours or material. Read when the claim to Skatteverket is filed; null when none is chosen.One of
ByggElGlasPlatarbeteMarkDraneringarbeteMurningMalningTapetseringVvsStadningKladOchTextilvardSnoskottningTradgardsarbeteBarnpassningPersonligomsorgFlyttjansterItTjansterReparationAvVitvarorMobleringTillsynAvBostadTransportTillForsaljningTvattVidTvattinrattningrot_rut_requested_centsintegerrequiredrot_rut_approved_centsintegerrequiredrot_rut_refused_centsintegerrequiredWhat Skatteverket refused of the deduction; owed by the customer again.
rot_rut_statusstringrequiredtax_profile_idstring(uuid)nullablerequiredThe ROT/RUT tax profile the deduction is claimed for.
paid_centsintegerrequiredocr_referencestringnullablerequireddelivery_methodstringrequiredOne of
emailpeppolprintsent_atstring(date-time)nullablerequiredviewed_atstring(date-time)nullablerequiredreminder_countintegerrequiredlast_reminder_atstring(date-time)nullablerequiredpdf_document_idstring(uuid)nullablerequiredThe stored PDF. Download it with
GET /invoices/{invoice}/pdf.sie_exported_atstring(date-time)nullablerequiredWhen the invoice went to the books in an SIE export.
external_refobject | array of valuesnullablerequirednotesstringnullablerequiredmetadataobject | array of valuesnullablerequiredWorking figures —
vat_by_rate,deduction,credits,source,delivery— not a stable contract.GET /invoices/{invoice}carriesdeliveryas a documented field.created_bystring(uuid)nullablerequiredcreated_atstring(date-time)requiredupdated_atstring(date-time)requireddeleted_atstring(date-time)nullablerequiredrecurring_invoice_idstring(uuid)nullableThe recurring invoice that produced it.
occurrence_datestringnullableFor a recurring invoice, the period it bills.
quote_idstring(uuid)nullableThe accepted quote the invoice was drafted from, for an organization that invoices without scheduling.
linesarray of objectsaccountobjectThe invoiced customer exactly as stored. The field names are the storage names:
invoice_deliveryandeinvoice_referenceareinvoicing.deliveryandinvoicing.referenceon a Customer.contactobjectnullablecredited_invoiceanynullableOn a credit note from
POST /invoices/{invoice}/credit: the original invoice, as stored.
- 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
Download the PDF
/invoices/{invoice}/pdfThe invoice document itself, as application/pdf bytes in the response body (served inline, with a file name in Content-Disposition). There is no signed URL to fetch; download it with the API key.
- Issued invoice or credit note: exactly the file stored when it was sent — the one the customer received — never re-rendered, so it stays identical for the seven years it has to be kept. If that file has gone missing the answer is 409 rather than a lookalike.
- Draft: a preview rendered on the spot, watermarked, with no number and no OCR reference, named
…-utkast.pdf. It is not an invoice and must not be handed over as one.
No extra permission: an organization whose invoicing module has lapsed can still fetch its old invoices for an auditor.
curl 'https://api.closepact.com/v1/api/invoices/01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40/pdf' \
-H "Authorization: Bearer $CLOSEPACT_API_KEY""(binary)"Path parameters
invoicestring(uuid)requiredThe invoice's or credit note's id.
Responses
Headers
Content-Disposition—inline; filename="…".X-RateLimit-Limit— Requests this key may make per minute.X-RateLimit-Remaining— Requests left in the current minute.
string(binary)
- 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
List an invoice's payment reminders
/invoices/{invoice}/remindersThe payment reminders (påminnelser) sent for the invoice, with the fee and interest each one charged — figures your bookkeeping needs, because the customer was told them — and what the next reminder would be.
There are three levels and at most one reminder per level. Levels 1 and 2 can go out automatically on the organization's schedule; level 3 announces that the debt goes to collection and is only ever sent by a person in Closepact. next_level_refusal says why the next reminder could not be sent now (for example This invoice is not overdue yet.), or is null when it could. Sending reminders is not available through the API.
curl 'https://api.closepact.com/v1/api/invoices/01a14f2c-7c1e-7d0b-9a3e-3f5b2c8d1e40/reminders' \
-H "Authorization: Bearer $CLOSEPACT_API_KEY"{
"data": {
"reminders": [
{
"id": "01a15d33-4c8e-7b15-a6f9-1d3e7c2b5a84",
"customer_invoice_id": "01a15b02-7c14-7e2b-8d5a-3f9c1e6b4a27",
"level": 1,
"sent_at": "2026-11-15T06:00:12+00:00",
"fee_cents": 6000,
"interest_percent": 10.5,
"interest_cents": 302,
"channel": "email",
"created_by": null,
"metadata": [],
"created_at": "2026-11-15T06:00:12+00:00"
}
],
"next_level": 2,
"next_level_refusal": null,
"automatic_up_to": 2,
"outstanding_cents": 131300,
"days_overdue": 8
}
}Path parameters
invoicestring(uuid)requiredThe invoice's or credit note's id.
Responses
Headers
X-RateLimit-Limit— Requests this key may make per minute.X-RateLimit-Remaining— Requests left in the current minute.
dataobjectrequiredremindersarray of objectsrequirednext_levelintegernullablerequiredNull once all three levels have been sent.
1–3
next_level_refusalstringnullablerequiredWhy the next level cannot be sent now; null when it can.
automatic_up_tointegerrequiredThe highest level the schedule sends by itself.
outstanding_centsintegerrequiredWhat the customer still owes, excluding a ROT/RUT share.
days_overdueintegerrequired
- 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