Skip to main content

Create Invoice

Building an integration?

If you are building an integration to create invoices - see the Invoice Integration guide.

This endpoint allows a user to create invoices.

Request​

URL​

/invoices

Method​

POST

Headers​

Content-Type: application/json
Authorization: Bearer eyy...

Body​

A JSON representation of invoice fields. See below example.

Request Body: all available fields

This section contains a list of all possible fields. For a minimalist example please see the example at the end of this page. We advise starting with the minimum number of fields, ensuring this passes the backend field validations, before proceeding to add new fields.

{
"clientId": {
"type": "String",
"description": "Internal client id for the client connected to the invoice. This field is required when the user session is not for a client type user."
},
"productCode": {
"type": "String",
"description": "Product used for the invoice. Can be one of INVOICE_SERVICE, REMINDER_SERVICE, COLLECTION_SERVICE, INVOICE_FACTORING_LOAN or INVOICE_FACTORING_SELL."
},
"invoiceNumber": {
"type": "String",
"description": "Your invoice number of the invoice.",
"required": true
},
"paymentReference": {
"type": "String",
"description": "Payment reference of the invoice. Used when debtor pay for the invoice."
},
"debitInvoiceNumber": {
"type": "String",
"description": "Your reference to debit invoice number. This should be provided if the invoice is a credit invoice."
},
"dates": {
"type": "Nested",
"Nested": {
"invoiceDate": {
"type": "Date",
"description": "Invoice date of the invoice.",
"required": true
},
"expireDate": {
"type": "Date",
"description": "Expire date of the invoice.",
"required": true
},
"deliveryDate": {
"type": "Date",
"description": "Delivery date of the invoice."
}
}
},
"debtor": {
"type": "Nested",
"Nested": {
"customerNumber": {
"type": "String",
"description": "Your customer number of the debtor connected to the invoice.",
"required": true
},
"name": {
"type": "String",
"description": "Debtor name. Either a person- or a company name depending on the debtor type.",
"required": true
},
"identificationNumber": {
"type": "String",
"description": "Debtor identification number. Should be a valid organization number or social security number depending on the debtor type."
},
"type": {
"type": "ChoiceString",
"description": "Debtor type. Can be one of COMPANY or PERSON.",
"required": true
},
"GLN": {
"type": "GLN",
"description": null
},
"email": {
"type": "Email",
"description": "Debtor email."
},
"phone": {
"type": "String",
"description": "Debtor phone number."
},
"cellPhone": {
"type": "String",
"description": "Debtor cell phone number."
},
"invoiceAddress": {
"type": "Nested",
"Nested": {
"name": {
"type": "String",
"description": "Debtor invoice address name. Either a person- or a company name depending on the debtor type.",
"required": true
},
"address": {
"type": "String",
"description": "Debtor invoice address.",
"required": true
},
"address2": {
"type": "String",
"description": "Debtor invoice address line 2"
},
"address3": {
"type": "String",
"description": "Debtor invoice address line 3"
},
"zip": {
"type": "ZipCode",
"description": "Debtor invoice address zip code.",
"required": true
},
"city": {
"type": "String",
"description": "Debtor invoice address city.",
"required": true
},
"countryCode": {
"type": "Country",
"description": "Debtor invoice address country code. Should be in ISO 3166-1 alpha-2 format."
}
}
},
"deliveryAddress": {
"type": "Nested",
"Nested": {
"name": {
"type": "String",
"description": "Debtor delivery address name. Either a person- or a company name depending on the debtor type."
},
"address": {
"type": "String",
"description": "Debtor delivery address."
},
"address2": {
"type": "String",
"description": "Debtor delivery address line 2"
},
"address3": {
"type": "String",
"description": "Debtor delivery address line 3"
},
"zip": {
"type": "ZipCode",
"description": "Debtor delivery address zip code."
},
"city": {
"type": "String",
"description": "Debtor delivery address city."
},
"countryCode": {
"type": "Country",
"description": "Debtor delivery address country code. Should be in ISO 3166-1 alpha-2 format."
}
}
},
"vatNumber": {
"type": "String",
"description": null
},
"distributionChannelOverride": {
"type": "Boolean",
"description": null
},
"distributionChannel": {
"type": "String",
"description": null
},
"FMI": {
"type": "String",
"description": "Receiver id for internet bank electronic invoice."
}
}
},
"distributionCode": {
"type": "ChoiceString",
"description": "Distribution method used for the invoice. Can be one of LETTER, EMAIL or NULL."
},
"documentTemplateCode": {
"type": "String",
"description": "Template used on the invoice. Determines how the invoice PDF will appear."
},
"type": {
"type": "ChoiceString",
"description": null
},
"useRecourse": {
"type": "Boolean",
"description": null
},
"activatedDate": {
"type": "DateTime",
"description": null
},
"activatedById": {
"type": "String",
"description": null
},
"ourReference": {
"type": "String",
"description": "Your reference of the invoice."
},
"yourReference": {
"type": "String",
"description": "Debtor reference of the invoice."
},
"yourContactPerson": {
"type": "String",
"description": "Debtor contact person of the invoice."
},
"ourOrderNumber": {
"type": "String",
"description": "Your order number of the invoice."
},
"yourOrderNumber": {
"type": "String",
"description": "Debtor order number of the invoice."
},
"articleRows": {
"type": "List(Nested)",
"required": true
},
"vats": {
"type": "List(Nested)",
"required": true
},
"remark": {
"type": "String",
"description": "Invoice text that will be visible on the invoice PDF. Useful if you want to send a message to your debtor."
},
"terms": {
"type": "Nested",
"Nested": {
"payment": {
"type": "String",
"description": "Terms of payment of the invoice."
},
"delivery": {
"type": "String",
"description": "Terms of delivery of the invoice."
}
}
},
"fees": {
"type": "Nested",
"Nested": {
"administration": {
"type": "Money",
"description": "Administration fee of the invoice."
},
"administrationVatPercentage": {
"type": "ChoiceInteger",
"description": "VAT percentage that is declared. Can be one of 0, 6, 12 or 25."
},
"freight": {
"type": "Money",
"description": "Freight fee of the invoice"
},
"freightVatPercentage": {
"type": "ChoiceInteger",
"description": "VAT percentage that is declared. Can be one of 0, 6, 12 or 25."
}
}
},
"reverseCharge": {
"type": "Boolean",
"description": null
},
"refund": {
"type": "Boolean",
"description": null
},
"totals": {
"type": "Nested",
"Nested": {
"totalToPay": {
"type": "Money",
"description": "Total amount for debtor to pay to close the invoice."
},
"total": {
"type": "Money",
"description": "Total amount with VAT of the invoice.",
"required": true
},
"totalRoundOff": {
"type": "Money",
"description": "Total roundoff amount of the invoice."
},
"totalExclVat": {
"type": "Money",
"description": "Total amount without VAT of the invoice.",
"required": true
},
"totalVat": {
"type": "Money",
"description": "Total VAT of the invoice.",
"required": true
},
"taxReduction": {
"type": "Money",
"description": "Total tax reduction of the invoice."
}
}
},
"currency": {
"type": "Nested",
"Nested": {
"invoiceCurrency": {
"type": "ChoiceString",
"description": "Invoice currency. This is what currency we should use in the invoice PDF. Can be one of supported currencies."
},
"baseCurrency": {
"type": "ChoiceString",
"description": "Invoice base currency. This tells in what currency we should handle the invoice and all transactions connected with it. Can be one of supported currencies."
},
"exchangeRate": {
"type": "Float",
"description": "Exchange rate of the invoice. This tells what exchange rate should use to convert transactions connected with the invoice to base currency."
}
}
},
"serviceProviderCode": {
"type": "String",
"description": null
}
}

Response​

With a successful 200 response the body contains the created invoice object in JSON format. See below example of a payload response.

Response Body

For a response example please see the example at the end of this page.

{
"id": {
"type": "String",
"description": "Internal id of the entity."
},
"clientId": {
"type": "String",
"description": "Internal client id for the client connected to the invoice."
},
"clientName": {
"type": "String",
"description": "Your company name."
},
"productCode": {
"type": "String",
"description": "Product used for the invoice. Can be one of INVOICE_SERVICE, REMINDER_SERVICE, COLLECTION_SERVICE, INVOICE_FACTORING_LOAN or INVOICE_FACTORING_SELL."
},
"serviceProviderCode": {
"type": "String",
"description": "Which installed service provider will be used to administrate the invoice."
},
"invoiceNumber": {
"type": "String",
"description": "Your invoice number of the invoice.",
"required": true
},
"paymentReference": {
"type": "String",
"description": "Payment reference of the invoice. Used when debtor pay for the invoice."
},
"debitInvoiceNumber": {
"type": "String",
"description": "Your reference to debit invoice number. This should be provided if the invoice is a credit invoice."
},
"statuses": {
"type": "Nested",
"Nested": {
"main": {
"type": "String",
"description": null
},
"ledger": {
"type": "String",
"description": "Ledger status of the invoice. This is how far the invoice is in the reminder process. Can be one of NULL, INVOICE, EXPIRED, EXPIRED_NOTIFICATION, REMINDER, COLLECTION, DELAYED_PENALTY_FEE, MONITORING_DECISION or MONITORING."
},
"ledgerSubType": {
"type": "String",
"description": null
}
}
},
"partPayment": {
"type": "Nested",
"Nested": {
"isPartPayment": {
"type": "Boolean",
"description": null
},
"partPaymentPlanId": {
"type": "Integer",
"description": null
}
}
},
"dates": {
"type": "Nested",
"Nested": {
"invoiceDate": {
"type": "Date",
"description": "Invoice date of the invoice.",
"required": true
},
"expireDate": {
"type": "Date",
"description": "Expire date of the invoice.",
"required": true
},
"deliveryDate": {
"type": "Date",
"description": "Delivery date of the invoice."
},
"pausedUntilDate": {
"type": "Date",
"description": "Shows for how long the handling of the invoice is paused."
},
"ledgerPerformedDate": {
"type": "Date",
"description": "Ledger performed date. Shows the performed date of the previous ledger event. "
},
"latestFinancialDate": {
"type": "Date",
"description": "Financial event date of latest created event.",
"required": true
}
}
},
"debtor": {
"type": "Nested",
"Nested": {
"id": {
"type": "String",
"description": "Internal id of the debtor connected to the invoice."
},
"customerNumber": {
"type": "String",
"description": "Your customer number of the debtor connected to the invoice.",
"required": true
},
"name": {
"type": "String",
"description": "Debtor name. Either a person- or a company name depending on the debtor type.",
"required": true
},
"identificationNumber": {
"type": "String",
"description": "Debtor identification number. Should be a valid organization number or social security number depending on the debtor type."
},
"type": {
"type": "ChoiceString",
"description": "Debtor type. Can be one of COMPANY or PERSON.",
"required": true
},
"GLN": {
"type": "GLN",
"description": null
},
"email": {
"type": "Email",
"description": "Debtor email."
},
"phone": {
"type": "String",
"description": "Debtor phone number."
},
"cellPhone": {
"type": "String",
"description": "Debtor cell phone number."
},
"invoiceAddress": {
"type": "Nested",
"Nested": {
"name": {
"type": "String",
"description": "Debtor invoice address name. Either a person- or a company name depending on the debtor type.",
"required": true
},
"address": {
"type": "String",
"description": "Debtor invoice address.",
"required": true
},
"address2": {
"type": "String",
"description": "Debtor invoice address line 2"
},
"address3": {
"type": "String",
"description": "Debtor invoice address line 3"
},
"zip": {
"type": "ZipCode",
"description": "Debtor invoice address zip code.",
"required": true
},
"city": {
"type": "String",
"description": "Debtor invoice address city.",
"required": true
},
"countryCode": {
"type": "Country",
"description": "Debtor invoice address country code. Should be in ISO 3166-1 alpha-2 format."
}
}
},
"deliveryAddress": {
"type": "Nested",
"Nested": {
"name": {
"type": "String",
"description": "Debtor delivery address name. Either a person- or a company name depending on the debtor type."
},
"address": {
"type": "String",
"description": "Debtor delivery address."
},
"address2": {
"type": "String",
"description": "Debtor delivery address line 2"
},
"address3": {
"type": "String",
"description": "Debtor delivery address line 3"
},
"zip": {
"type": "ZipCode",
"description": "Debtor delivery address zip code."
},
"city": {
"type": "String",
"description": "Debtor delivery address city."
},
"countryCode": {
"type": "Country",
"description": "Debtor delivery address country code. Should be in ISO 3166-1 alpha-2 format."
}
}
},
"vatNumber": {
"type": "String",
"description": null
},
"distributionChannelOverride": {
"type": "Boolean",
"description": null
},
"distributionChannel": {
"type": "String",
"description": null
},
"FMI": {
"type": "String",
"description": "Receiver id for internet bank electronic invoice."
}
}
},
"document": {
"type": "Nested",
"Nested": {
"attachment": {
"type": "String",
"description": "File name of the attachment PDF added to the invoice. Download it with {{API}}/storage/{{fileName}}."
},
"invoicePreview": {
"type": "String",
"description": "File name of the invoice preview PDF. Download it with {{API}}/storage/{{fileName}}."
},
"invoice": {
"type": "String",
"description": "File name of the invoice PDF. Download it with {{API}}/storage/{{fileName}}."
},
"invoiceWithAttachments": {
"type": "String",
"description": "File name of the invoice PDF with attachments. Download it with {{API}}/storage/{{fileName}}."
},
"connectedFileCount": {
"type": "Integer",
"description": "Count of connected files to the invoice."
}
}
},
"distributionCode": {
"type": "ChoiceString",
"description": "Distribution method used for the invoice. Can be one of LETTER, EMAIL or NULL."
},
"documentTemplateCode": {
"type": "String",
"description": "Template used on the invoice. Determines how the invoice PDF will appear."
},
"type": {
"type": "ChoiceString",
"description": null
},
"isRecourse": {
"type": "Boolean",
"description": null
},
"useRecourse": {
"type": "Boolean",
"description": null
},
"createdDate": {
"type": "DateTime",
"description": null
},
"createdBy": {
"type": "String",
"description": null
},
"activatedDate": {
"type": "DateTime",
"description": null
},
"activatedById": {
"type": "String",
"description": null
},
"reminderProfileCode": {
"type": "String",
"description": "Reminder profile used on the invoice. Determines the reminder process of the invoice. Standard profile will be used if no value is provided. "
},
"ourReference": {
"type": "String",
"description": "Your reference of the invoice."
},
"yourReference": {
"type": "String",
"description": "Debtor reference of the invoice."
},
"yourContactPerson": {
"type": "String",
"description": "Debtor contact person of the invoice."
},
"ourOrderNumber": {
"type": "String",
"description": "Your order number of the invoice."
},
"yourOrderNumber": {
"type": "String",
"description": "Debtor order number of the invoice."
},
"articleRows": {
"type": "List(Nested)",
"required": true
},
"vats": {
"type": "List(Nested)",
"required": true
},
"remark": {
"type": "String",
"description": "Invoice text that will be visible on the invoice PDF. Useful if you want to send a message to your debtor."
},
"terms": {
"type": "Nested",
"Nested": {
"payment": {
"type": "String",
"description": "Terms of payment of the invoice."
},
"delivery": {
"type": "String",
"description": "Terms of delivery of the invoice."
}
}
},
"fees": {
"type": "Nested",
"Nested": {
"administration": {
"type": "Money",
"description": "Administration fee of the invoice."
},
"administrationVatPercentage": {
"type": "ChoiceInteger",
"description": "VAT percentage that is declared. Can be one of 0, 6, 12 or 25."
},
"freight": {
"type": "Money",
"description": "Freight fee of the invoice"
},
"freightVatPercentage": {
"type": "ChoiceInteger",
"description": "VAT percentage that is declared. Can be one of 0, 6, 12 or 25."
}
}
},
"reverseCharge": {
"type": "Boolean",
"description": null
},
"refund": {
"type": "Boolean",
"description": null
},
"totals": {
"type": "Nested",
"Nested": {
"totalToPay": {
"type": "Money",
"description": "Total amount for debtor to pay to close the invoice."
},
"total": {
"type": "Money",
"description": "Total amount with VAT of the invoice.",
"required": true
},
"totalRoundOff": {
"type": "Money",
"description": "Total roundoff amount of the invoice."
},
"totalExclVat": {
"type": "Money",
"description": "Total amount without VAT of the invoice.",
"required": true
},
"totalVat": {
"type": "Money",
"description": "Total VAT of the invoice.",
"required": true
},
"taxReduction": {
"type": "Money",
"description": "Total tax reduction of the invoice."
},
"totalToPayBase": {
"type": "Money",
"description": "Total amount for debtor to pay to close the invoice in invoice base currency."
}
}
},
"currency": {
"type": "Nested",
"Nested": {
"invoiceCurrency": {
"type": "ChoiceString",
"description": "Invoice currency. This is what currency we should use in the invoice PDF. Can be one of supported currencies."
},
"baseCurrency": {
"type": "ChoiceString",
"description": "Invoice base currency. This tells in what currency we should handle the invoice and all transactions connected with it. Can be one of supported currencies."
},
"exchangeRate": {
"type": "Float",
"description": "Exchange rate of the invoice. This tells what exchange rate should use to convert transactions connected with the invoice to base currency."
}
}
},
"balances": {
"type": "Nested",
"Nested": {
"total": {
"type": "Money",
"description": "Total balance of the invoice. This is what's left for your debtor to pay in total to close the invoice."
},
"totalLocale": {
"type": "Money",
"description": "Total balance of the invoice in locale currency. This is what's left for your debtor to pay in total to close the invoice."
},
"capital": {
"type": "Money",
"description": "Capital balance of the invoice. This is what's left for your debtor to pay from the original amount."
},
"capitalLocale": {
"type": "Money",
"description": "Capital balance of the invoice in locale currency. This is what's left for your debtor to pay from the original amount."
},
"capitalService": {
"type": "Money",
"description": "Capital service balance of the invoice."
},
"capitalServiceLocale": {
"type": "Money",
"description": "Capital service balance of the invoice in locale currency."
},
"capitalFinanced": {
"type": "Money",
"description": null
},
"capitalFinancedLocale": {
"type": "Money",
"description": "Capital financed balance of the invoice in locale currency."
},
"reminder": {
"type": "Money",
"description": "Reminder balance of the invoice. This is what's left for your debtor to pay from the reminder fees."
},
"reminderLocale": {
"type": "Money",
"description": "Reminder balance of the invoice in locale. This is what's left for your debtor to pay from the reminder fees. "
},
"interest": {
"type": "Money",
"description": "Interest balance of the invoice. This is what's left for your debtor to pay from the interest."
},
"interestLocale": {
"type": "Money",
"description": "Interest balance of the invoice in locale currency. This is what's left for your debtor to pay from the interest."
}
}
}
}

Example​

Request​

Request Call​

curl -X POST \
'https://api.{domain}/invoices' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer eyy...' \
-d '{"articleRows": [{"description": "This is a article", "discountType": "PERCENTAGE", "price": 100, "quantity": "2,00", "total": 200.0, "totalDiscount": 0.0, "totalExclVat": 200, "totalVat": 50, "unit": "pcs", "vatPercentage": 25}], "currency": {"baseCurrency": "SEK", "exchangeRate": 1.0, "invoiceCurrency": "SEK"}, "dates": {"expireDate": "2021-06-01", "invoiceDate": "2021-05-17"}, "debtor": {"cellPhone": "+46", "customerNumber": "123", "identificationNumber": "1234567890", "invoiceAddress": {"address": "Address", "city": "City", "countryCode": "SE", "name": "Name", "zip": "12345"}, "name": "Name", "type": "COMPANY"}, "distributionCode": "LETTER", "invoiceNumber": "123456", "productCode": "INVOICE_SERVICE", "totals": {"taxReduction": 0.0, "total": 250.0, "totalExclVat": 200, "totalRoundOff": 0.0, "totalToPay": 250.0, "totalVat": 50.0}, "type": "INVOICE", "vats": [{"percentage": 25, "totalTaxable": 200, "totalVat": 50}]}'
Example Request Body

{
"articleRows": [
{
"description": "This is a article",
"discountType": "PERCENTAGE",
"price": 100,
"quantity": "2,00",
"total": 200,
"totalDiscount": 0,
"totalExclVat": 200,
"totalVat": 50,
"unit": "pcs",
"vatPercentage": 25
}
],
"currency": {
"baseCurrency": "SEK",
"exchangeRate": 1,
"invoiceCurrency": "SEK"
},
"dates": {
"expireDate": "2021-06-01",
"invoiceDate": "2021-05-17"
},
"debtor": {
"cellPhone": "+46",
"customerNumber": "123",
"identificationNumber": "1234567890",
"invoiceAddress": {
"address": "Address",
"city": "City",
"countryCode": "SE",
"name": "Name",
"zip": "12345"
},
"name": "Name",
"type": "COMPANY"
},
"distributionCode": "LETTER",
"invoiceNumber": "123456",
"productCode": "INVOICE_SERVICE",
"totals": {
"taxReduction": 0,
"total": 250,
"totalExclVat": 200,
"totalRoundOff": 0,
"totalToPay": 250,
"totalVat": 50
},
"type": "INVOICE",
"vats": [
{
"percentage": 25,
"totalTaxable": 200,
"totalVat": 50
}
]
}

Example Response Body

{
"activatedById": null,
"activatedDate": null,
"articleRows": [
{
"accountNumber": null,
"articleNumber": null,
"description": "This is a article",
"discountType": "PERCENTAGE",
"id": "IR.321035638",
"price": 100,
"quantity": "2,00",
"total": 200,
"totalDiscount": 0,
"totalExclVat": 200,
"totalVat": 50,
"unit": "pcs",
"vatPercentage": 25
}
],
"balances": {
"capital": 0,
"capitalFinanced": 0,
"capitalFinancedLocale": 0,
"capitalLocale": 0,
"capitalService": 0,
"capitalServiceLocale": 0,
"interest": 0,
"interestLocale": 0,
"reminder": 0,
"reminderLocale": 0,
"total": 0,
"totalLocale": 0
},
"clientId": "C.100123",
"clientName": "Quiddly Test",
"createdBy": "[email protected]",
"createdDate": "2022-04-08T11:21:12",
"currency": {
"baseCurrency": "SEK",
"exchangeRate": 1,
"invoiceCurrency": "SEK"
},
"dates": {
"deliveryDate": null,
"expireDate": "2021-06-01",
"invoiceDate": "2021-05-17",
"latestFinancialDate": null,
"ledgerPerformedDate": null,
"pausedUntilDate": null
},
"debitInvoiceNumber": null,
"debtor": {
"FMI": null,
"GLN": null,
"cellPhone": "+46",
"customerNumber": "123",
"deliveryAddress": null,
"distributionChannel": null,
"distributionChannelOverride": null,
"email": null,
"id": null,
"identificationNumber": null,
"invoiceAddress": {
"address": "Address",
"address2": null,
"address3": null,
"city": "City",
"countryCode": "SE",
"name": "Name",
"zip": "12345"
},
"name": "Name",
"phone": null,
"type": "COMPANY",
"vatNumber": null
},
"distributionCode": "LETTER",
"document": {
"attachment": null,
"connectedFileCount": 0,
"invoice": null,
"invoicePreview": "57b7f0d607f1403fa3e23643342f1b58",
"invoiceWithAttachments": null
},
"documentTemplateCode": "STANDARD_MARKETING",
"fees": {
"administration": 0,
"administrationVatPercentage": null,
"freight": 0,
"freightVatPercentage": null
},
"id": "I.111225694",
"invoiceNumber": "123457",
"isRecourse": false,
"ourOrderNumber": null,
"ourReference": null,
"partPayment": {
"isPartPayment": false,
"partPaymentPlanId": null
},
"paymentReference": null,
"productCode": "REMINDER_SERVICE",
"refund": false,
"remark": null,
"reminderProfileCode": null,
"reverseCharge": false,
"serviceProviderCode": null,
"statuses": {
"ledger": null,
"ledgerSubType": null,
"main": "CREATED"
},
"terms": {
"delivery": null,
"payment": null
},
"totals": {
"taxReduction": 0,
"total": 250,
"totalExclVat": 200,
"totalRoundOff": 0,
"totalToPay": 250,
"totalToPayBase": 250,
"totalVat": 50
},
"type": "INVOICE",
"useRecourse": true,
"vats": [
{
"percentage": 25,
"totalTaxable": 200,
"totalVat": 50
}
],
"yourContactPerson": null,
"yourOrderNumber": null,
"yourReference": null
}