API Dokumentation

Denne dokumentation beskriver, hvordan du indsætter komplette ordredata via vores API, samt hvordan du finder din API-nøgle i teamets settings.

Indsendelse af Ordredata

For at indsende en ordre skal du sende en POST-request til /api/orders med følgende JSON payload:

  {
    "order_id": "123456",
    "date_created": "2023-01-01",
    "integration": "api",           /* Default 'api' */
    "status": "processing",
    "sub_total": 100.00,
    "shipping_total": 10.00,
    "discount": 0.00,
    "total_tax": 15.00,
    "total": 125.00,
    "currency": "DKK",
    "payment_method": "quickpay",
    "accounting_id": null,          /* Reference til bogføringssystemet */
    "order_items": [
      {
        "product_id": 1,
        "quantity": 2,
        "unit_price": 30.00,
        "total_price": 60.00,
        "item_name": "Produkt 1",
        "vat_rate": 25,
        "line_type": "product"
      },
      {
        "product_id": 2,
        "quantity": 1,
        "unit_price": 40.00,
        "total_price": 40.00,
        "item_name": "Produkt 2",
        "vat_rate": 25,
        "line_type": "product"
      },
      {
        /* Forsendelse */
        "product_id": null,
        "quantity": 1,
        "unit_price": 31.20,
        "total_price": 31.20,
        "item_name": "GLS Pakkeshop",
        "vat_rate": 25,
        "line_type": "shipping"
      },
      {
        /* Pant og andre gebyrer/tillæg */
        "product_id": null,
        "quantity": 1,
        "unit_price": 19.20,
        "total_price": 19.20,
        "item_name": "Pant A",
        "vat_rate": 25,
        "line_type": "fee"
      }
    ],
    "billing_info": {
      "first_name": "John",
      "last_name": "Doe",
      "company": "Invomate",
      "address": "Rådhuspladsen 37",
      "city": "Aalborg",
      "postal_code": "9000",
      "country": "DK",
      "email": "john.doe@example.com",
      "phone": "+1234567890",
      "cvr": "12345678",
      "ean": "9876543210123"
    }
  }
      

Feltbeskrivelser

Order

Order Items (OrderLine)

Billing Info (BillingDetail)

Find din API

Din unikke API-nøgle kan findes under kontoens indstillinger. Følg disse trin:

Eksempel på cURL Request

  curl --request POST \
    --url https://facturaflow.dk/api/orders \
    --header 'Authorization: Bearer {din_api_token}' \
    --header 'Content-Type: application/json' \
    --data '{
      "order_id": "123456",
      "date": "2023-01-01",
      "integration": "teams-api",
      "status": "shipped",
      "sub_total": 100.00,
      "shipping_total": 10.00,
      "discount": 5.00,
      "total_tax": 15.00,
      "total": 120.00,
      "currency": "DKK",
      "payment_method": "credit_card",
      "accounting_id": "acc-98765",
      "order_items": [
        {
          "product_id": 1,
          "quantity": 2,
          "unit_price": 30.00,
          "total_price": 60.00,
          "item_name": "Produkt 1",
          "vat_rate": 25,
          "discount": 0,
          "line_type": "normal"
        },
        {
          "product_id": 2,
          "quantity": 1,
          "unit_price": 40.00,
          "total_price": 40.00,
          "item_name": "Produkt 2",
          "vat_rate": 25,
          "discount": 5,
          "line_type": "normal"
        }
      ],
      "billing_info": {
        "first_name": "John",
        "last_name": "Doe",
        "company": "Acme Inc.",
        "address": "123 Elm St",
        "city": "Springfield",
        "postal_code": "62701",
        "country": "USA",
        "email": "john.doe@example.com",
        "phone": "+1234567890",
        "cvr": "12345678",
        "ean": "9876543210123"
      }
    }'
      

Med denne dokumentation burde du være klar til at integrere med vores API og indsende komplette ordrer med alle tilhørende detaljer.