Send an invoice

Once you have created a creditor, you can use Kravia to produce and distribute invoices and credit notes on behalf of the creditor.

This can be done using the following steps:

  1. Register the invoice

  2. Upload an attachment if available

  3. Initiate the invoice distribution

Register the invoice

In order to register a new invoice, you can use the following API endpoint.

curl https://api.kravia.ai/api/v2/invoice/register \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: YOUR_SECRET_TOKEN' \
  --data '{
    "claimType": "Invoice",
    "creditorId": 10759,
    "accountingInvoiceId": null,
    "debtorName":"John Doe",
    "debtorNumber": "10001",
    "email": "kevcaballero@gmail.com",
    "ssn": null,
    "organizationNumber": null,
    "isPrivateIndividual": "true",
    "postalAddress": 
    {        
        "addressAddressLine1": "Karl Johan Gate",
        "addressPostalCode":"1000",
        "addressCity":"Oslo",
        "addressCountryCode": "NO"
    },
    "invoiceNo": "20001",
    "invoiceDate":"2025-04-01",
    "dueDate":"2026-01-01",
    "originalAmount": 2500,
    "currencyCode": "NOK",
    "description": "Description of the service delivere",
    "orderLines": [
        {
            "description": "Service A",
            "unitPrice": 125,
            "count": 10,
            "vatInPercent": 25,
            "unit": "g",
            "total": 1250
        },
        {
            "description": "Service B",
            "unitPrice": 125,
            "count": 10,
            "vatInPercent": 25,
            "unit": "g",
            "total": 1250,
            "discountInPercent": 0
        }
   ]
}'

Some key data elements:

  • You can provide all the customer details in each invoice request creation and kravia will automatically identify the customer card to use. Ensure the external customer number is used and passed as “debtorNumber” in order to ensure consistency

  • When building an integration, we do recommend passing your internal identifier as accountingInvoiceId as this can be used for reconciliation.

You can also register credit notes using the claimType = CreditNote

Upload an attachment

Kravia supports sending attachment along with the invoice that we produce. To do so, you can use the generic document endpoint

curl 'https://api.kravia.ai/api/v2/invoice/{id}/document?type=InvoiceAttachment' \
  --request POST \
  --header 'Content-Type: multipart/form-data' \
  --header 'Authorization: YOUR_SECRET_TOKEN' \
  --data "{"file":"BASE64_FILE_CONTENT"}"

Schedule the invoice

When the invoice and relevant documents are fully registered, you can trigger the invoicing process via the action API. This will not send the invoice right away but will schedule it for automated processing.

curl 'https://api.kravia.ai/api/v2/invoice/{invoiceId}/action?action=Start' \
  --request POST \
  --header 'Content-Type: multipart/form-data' \
  --header 'Authorization: YOUR_SECRET_TOKEN' \
  --data "{"Message":"Confirming invoice action"}"