Libraries

Official client libraries

We have a couple of official libraries you can use to easily connect your app/service to fakturan.nu. Each library comes with it's own documentation and examples.

Choose your language:

CURL examples

If your language isn't listed, you can use CURL. The --user argument engages http basic auth.

Get a list of your products

curl --user <your-api-key-id>:<your-api-key-password> -H "Content-Type: application/json" https://www.fakturan.nu/api/v2/products

Create a product

curl --user <your-api-key-id>:<your-api-key-password> -H "Content-Type: application/json" -d '{"name": "Blue Suede Shoes", "unit": "pairs"}' https://www.fakturan.nu/api/v2/products

Create an invoice

curl --user <your-api-key-id>:<your-api-key-password> -H "Content-Type: application/json" -d '{"date": "20230101", "client": {"company": "Acme Shoe factory"}, "rows": [{"product_name": "Blue Suede Shoes", "unit": "pairs"}]}' https://www.fakturan.nu/api/v2/invoices

Create an invoice and send it via email

First, create the invoice. Don't forget to set the email field on the client:
curl --user <your-api-key-id>:<your-api-key-password> -H "Content-Type: application/json" -d '{"date": "20230101", "client": {"company": "Acme Shoe factory", "email": "test@mydomain.com"}, "rows": [{"product_name": "Blue Suede Shoes", "unit": "pairs"}]}' https://www.fakturan.nu/api/v2/invoices
Then grab the id from the response (123 in this case):
# => Response: {"data":{"id":123,"number":1,"date":"2023-01-01","client_id":324,"days":30,"our_reference":"","your_reference":"","sent":false,"paid_at":null,"locale":"sv","currency":"SEK" ...
Issue a POST request to the "send" endpoint using the id from the response. A "delivery_method" param is optional.
curl --user <your-api-key-id>:<your-api-key-password> -H "Content-Type: application/json" -d {} https://www.fakturan.nu/api/v2/invoices/123/send

Send a reminder

Issue a POST request to the "send" endpoint using the "as_reminder" parameter:
curl --user <your-api-key-id>:<your-api-key-password> -H "Content-Type: application/json" -d '{"as_reminder": true}' https://www.fakturan.nu/api/v2/invoices/123/send