Yrittämisen iloa
Takaisin

Sales Invoicing API - happy case and bare minimum examples

1. Create a new contact as the recipient of the invoice for later use (POST Contact)

Example body (bare minimum):

{
    "organizationNumber": 14222,
    "type": "Consumer",
    "number": "0",
    "name": "John Doe",
    "currency": "EUR",
    "InvoiceLanguage": "fi-FI",
    "defaultReceivableAccountNumber": "1701",
    "invoicingAddress": {
        "address1": "Doe street 1",
        "country": "FI",
        "postalCode": "00100",
        "postOffice": "Helsinki"
    }
}

2. Create a draft invoice for the contact (POST Invoice)

No request body, contactId required in query params

3. Update the draft invoice with invoice rows (PUT Invoice)

Please note that the row and invoice total sums are automatically calculated by using the quantity and pricePerUnit (or PricePerUnitTaxIncluded) from lineItems.

User can either copy the POST Invoice response and add this bare minimum lineItems:

{
    "type": "Product",
    "productName": "Thingy",
    "quantity": 5.0000,
    "pricePerUnit": 10.00000000000,
    "salesAccountNumber": 3000,
    "taxPercent": 24.00,
}

OR

User can copy this whole body with lineItems included. Please note that the 'invoiceId' and 'invoiceRowVersion' along with suitable dates should be updated before sending the request.

{
    "id": "{{invoiceId}}",
    "rowVersion": "{{invoiceRowVersion}}",
    "organizationNumber": 14222,
    "number": 0,
    "status": "Draft",
    "type": "Normal",
    "invoiceOrigin": "Integration",
    "voucherNumber": "0",
    "voucherType": "39",
    "date": "2024-05-10",
    "dueDate": "2024-05-10",
    "originalDueDate": null,
    "remarkTime": 8,
    "paymentTerm": 0,
    "overdueInterest": 10.00,
    "referenceNumber": "",
    "createdDateUtc": "2024-05-10T12:29:33.3946799Z",
    "updatedDateUtc": "2024-05-10T12:29:33.9919439Z",
    "approvedDate": null,
    "sentDate": null,
    "shipMode": "SelfDelivery",
    "creditedInvoiceNumber": "",
    "cashDiscountDate": null,
    "cashDiscountPercent": 0.00,
    "currency": "EUR",
    "exchangeRate": 1.0,
    "currencyTotal": 0.0,
    "currencyTotalTax": 0.0,
    "currencyTotalWithoutTax": 0.0,
    "currencyPaidTotal": 0.0,
    "currencyUnpaidTotal": 0.0,
    "accountingCurrencyTotal": 0.0,
    "accountingCurrencyTotalTax": 0.0,
    "accountingCurrencyTotalWithoutTax": 0.0,
    "accountingCurrencyPaidTotal": 0.0,
    "accountingCurrencyUnpaidTotal": 0.0,
    "recipientContact": {
        "name": "John Doe",
        "nameExtension": "",
        "type": "Consumer",
        "businessId": "",
        "vatId": "",
        "invoicingAddress": {
            "address1": "Doe street 1",
            "address2": "",
            "country": "FI",
            "postalCode": "00100",
            "postOffice": "Helsinki"
        },
        "deliveryAddress": {
            "address1": "",
            "address2": "",
            "country": "",
            "postalCode": "",
            "postOffice": ""
        },
        "deliveryLocation": "",
        "eInvoiceIdentifier": "",
        "eInvoiceIntermediator": null,
        "isEmailInvoicingInUse": false,
        "invoicingEmailAddress": "",
        "emailInvoicingSendType": "Link",
        "invoiceLanguage": "fi-FI"
    },
    "message": "",
    "generalMessage": "",
    "contactSpecificMessage": "",
    "ourReference": "",
    "yourReference": "",
    "orderNumber": null,
    "orderDate": null,
    "deliveryDate": null,
    "comment": "",
    "isDebtCollectionBlocked": false,
    "isPaymentReminderBlocked": false,
    "receivableAccountNumber": 1701,
    "lineItems": [
        {
    "type": "Product",
    "productName": "Thingy",
    "quantity": 5.0000,
    "pricePerUnit": 10.00000000000,
    "salesAccountNumber": 3000,
    "taxPercent": 24.00,
}
],
    "financing": {
        "bankAccountNumber": "",
        "iban": "",
        "bic": "",
        "message": "",
        "messageSentDate": null
    },
    "reminders": [],
    "debtCollection": {
        "collectionBillingDate": null,
        "collectionShipDate": null,
        "isCollectionOrderGenerated": false,
        "collectionFee": 0.0,
        "collectionInterest": 0.0
    },
    "attachments": [],
    "sender": null
}

5. Initiate invoice delivery for the invoice (POST InvoiceDelivery)

Request body contains only the shipMode chosen:

{
  "shipMode": "SelfDelivery"
}
Takaisin

Ota yhteyttä

Lähetä meille viesti, vastaamme mahdollisimman pian.

Kiireellisissä asioissa ota yhteyttä 0207 525 546 tai integraatiot@talenom.fi.