v1
latestOpenAPI 3.0.32026-07-268955212.1 KBinvoices
Update an invoice
Update an existing invoice draft for the company.
This operation will update all fields of the invoice. It's recommended that you perform a GET request to the invoice first to get the current state of the invoice and then update the fields you want to change.
NOTE: It's only possible to update invoices that are in draft status.
Tax reduction: Only the integration that created the invoice can modify tax reduction data. If a different integration includes taxReduction changes in the request, the changes will be silently ignored and the existing tax reduction data will be preserved.
Scope: invoices:write
put/companies/{companyId}/invoices/{invoiceId}
Request body
Example request
{
"id": "a419cf69-db6f-4de9-992c-b1a60942a443",
"type": "invoice",
"customerRef": {
"id": "55c899c5-82b2-47fa-9c51-e35fc9b26443",
"name": "customer 1"
},
"contactDetailRef": {
"id": "d3b07384-d9a0-4c9b-8b3a-6e1f2a5c8d4e",
"email": "contact@customer1.com",
"phone": "+46701234567"
},
"invoiceNumber": "1234",
"paymentReference": null,
"orderNumberReference": "ORD-5678",
"projectReference": "PROJ-001",
"buyerReference": "BUYER-123",
"contractReference": "CONTRACT-456",
"currency": "SEK",
"currencyRate": 1,
"totalAmount": 10000,
"totalTax": 2500,
"paidAmount": 0,
"status": "draft",
"invoiceDate": "2024-10-10",
"dueDate": "2024-10-10",
"lineItems": [
{
"id": 1,
"itemRef": {
"id": "55c899c5-82b2-47fa-9c51-e35fc9b26443",
"description": "Product 1"
},
"description": "Product 1",
"itemType": "salesItem",
"productType": "goods",
"unitType": "piece",
"quantity": 1,
"unitPrice": 5000,
"taxRate": 25
},
{
"id": 2,
"description": "Installation work",
"itemType": "salesItem",
"productType": "services",
"unitType": "hour",
"quantity": 10,
"unitPrice": 500,
"taxRate": 25,
"taxReduction": {
"taxReductionType": "rot",
"jobType": "rotConstruction"
}
},
{
"id": 3,
"itemRef": {
"id": "e964435e-50ef-4524-a439-05ff87794952",
"description": "A description line"
},
"description": "A description line",
"itemType": "descriptionOnlyItem"
}
],
"billingAddress": {
"line1": "Älvsborgsvägen 10",
"line2": null,
"city": "Göteborg",
"postalCode": "123 45",
"country": "SE"
},
"deliveryAddress": {
"line1": "Delivery Street 15",
"line2": "Floor 2",
"city": "Stockholm",
"postalCode": "111 11",
"country": "SE"
},
"taxReduction": {
"type": "rot",
"description": "Bathroom renovation",
"propertyType": "realEstate",
"realEstateNumber": "STOCKHOLM SÖDER 1:2",
"deductionAmount": 1500,
"status": "draft",
"deductionPeople": [
{
"personalNumber": "19850101-1234",
"deductionAmount": 1500
}
]
},
"attachmentRefs": [
{
"id": "240a4af0-edfd-47b1-b4ab-f30450eaac19",
"fileName": "myfile.pdf"
},
{
"id": "94a8f806-8493-40f6-9d5b-0495c84f8ab9",
"fileName": "myfile2.pdf"
}
],
"journalEntryRef": {
"id": "f329df79-eb7f-5ef0-a8dc-c2b71f953554"
},
"metadata": {
"project": "Website Redesign",
"department": "IT",
"externalId": "EXT-INV-2024-001"
}
}Response
Invoice updated
Example response
{
"id": "a419cf69-db6f-4de9-992c-b1a60942a443",
"type": "invoice",
"customerRef": {
"id": "55c899c5-82b2-47fa-9c51-e35fc9b26443",
"name": "customer 1"
},
"contactDetailRef": {
"id": "d3b07384-d9a0-4c9b-8b3a-6e1f2a5c8d4e",
"email": "contact@customer1.com",
"phone": "+46701234567"
},
"invoiceNumber": "1234",
"paymentReference": null,
"orderNumberReference": "ORD-5678",
"projectReference": "PROJ-001",
"buyerReference": "BUYER-123",
"contractReference": "CONTRACT-456",
"currency": "SEK",
"currencyRate": 1,
"totalAmount": 10000,
"totalTax": 2500,
"paidAmount": 0,
"status": "draft",
"invoiceDate": "2024-10-10",
"dueDate": "2024-10-10",
"lineItems": [
{
"id": 1,
"itemRef": {
"id": "55c899c5-82b2-47fa-9c51-e35fc9b26443",
"description": "Product 1"
},
"description": "Product 1",
"itemType": "salesItem",
"productType": "goods",
"unitType": "piece",
"quantity": 1,
"unitPrice": 5000,
"taxRate": 25
},
{
"id": 2,
"description": "Installation work",
"itemType": "salesItem",
"productType": "services",
"unitType": "hour",
"quantity": 10,
"unitPrice": 500,
"taxRate": 25,
"taxReduction": {
"taxReductionType": "rot",
"jobType": "rotConstruction"
}
},
{
"id": 3,
"itemRef": {
"id": "e964435e-50ef-4524-a439-05ff87794952",
"description": "A description line"
},
"description": "A description line",
"itemType": "descriptionOnlyItem"
}
],
"billingAddress": {
"line1": "Älvsborgsvägen 10",
"line2": null,
"city": "Göteborg",
"postalCode": "123 45",
"country": "SE"
},
"deliveryAddress": {
"line1": "Delivery Street 15",
"line2": "Floor 2",
"city": "Stockholm",
"postalCode": "111 11",
"country": "SE"
},
"taxReduction": {
"type": "rot",
"description": "Bathroom renovation",
"propertyType": "realEstate",
"realEstateNumber": "STOCKHOLM SÖDER 1:2",
"deductionAmount": 1500,
"status": "draft",
"deductionPeople": [
{
"personalNumber": "19850101-1234",
"deductionAmount": 1500
}
]
},
"attachmentRefs": [
{
"id": "240a4af0-edfd-47b1-b4ab-f30450eaac19",
"fileName": "myfile.pdf"
},
{
"id": "94a8f806-8493-40f6-9d5b-0495c84f8ab9",
"fileName": "myfile2.pdf"
}
],
"journalEntryRef": {
"id": "f329df79-eb7f-5ef0-a8dc-c2b71f953554"
},
"metadata": {
"project": "Website Redesign",
"department": "IT",
"externalId": "EXT-INV-2024-001"
}
}