Direct naar inhoud

API-referentie

Producten

De productcatalogus: producten en diensten met prijs, btw, eenheid en factuurinterval.

Basis-URL: https://factora.one/api/v1

Overzicht

Pakketfeature products. Het factuurinterval (billing_interval + billing_interval_unit) wordt gebruikt als standaard wanneer je een klantabonnement op het product start.

Endpoints

GET/products

Producten opvragen

Gepagineerde lijst: actieve producten eerst, dan op naam.

Pakketfeature
products
Recht (app-login)
products.view

Queryparameters

  • searchstring

    Zoekt in naam, SKU en omschrijving

  • is_activeboolean

    true of false

  • per_pageinteger

    1–100, standaard 50

curl "https://factora.one/api/v1/products?is_active=true" \
  -H "Authorization: Bearer $FACTORA_API_KEY" \
  -H "Accept: application/json"

200 Voorbeeldantwoord

{
  "data": {
    "current_page": 1,
    "data": [
      {
        "id": "9d3c9c4e-5db1-4042-be95-61a2cf108d54",
        "sku": "CONSULT-UUR",
        "name": "Consultancy",
        "description": "Advies en implementatie per uur",
        "unit": "uur",
        "unit_price": 9500,
        "tax_rate": 21,
        "billing_interval": 1,
        "billing_interval_unit": "month",
        "is_active": true,
        "created_at": "2026-11-12T08:40:00.000000Z",
        "updated_at": "2026-11-12T08:40:00.000000Z"
      }
    ],
    "first_page_url": "https://factora.one/api/v1/products?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "https://factora.one/api/v1/products?page=1",
    "next_page_url": null,
    "path": "https://factora.one/api/v1/products",
    "per_page": 50,
    "prev_page_url": null,
    "to": 1,
    "total": 1
  }
}
GET/products/{id}

Product tonen

Eén product.

Pakketfeature
products
Recht (app-login)
products.view
curl "https://factora.one/api/v1/products/<id>" \
  -H "Authorization: Bearer $FACTORA_API_KEY" \
  -H "Accept: application/json"

200 Voorbeeldantwoord

{
  "data": {
    "id": "9d3c9c4e-5db1-4042-be95-61a2cf108d54",
    "sku": "CONSULT-UUR",
    "name": "Consultancy",
    "description": "Advies en implementatie per uur",
    "unit": "uur",
    "unit_price": 9500,
    "tax_rate": 21,
    "billing_interval": 1,
    "billing_interval_unit": "month",
    "is_active": true,
    "created_at": "2026-11-12T08:40:00.000000Z",
    "updated_at": "2026-11-12T08:40:00.000000Z"
  }
}
POST/products

Product aanmaken

Maakt een product of dienst aan.

Pakketfeature
products
Recht (app-login)
products.manage

Body

  • skustring

    Max. 80 tekens, uniek binnen de organisatie

  • namestringverplicht

    Max. 255

  • descriptionstring

    Max. 2000

  • unitstringverplicht

    Eenheid, max. 30, bijv. stuk, uur, maand

  • unit_priceintegerverplicht

    Prijs in centen exclusief btw

  • tax_ratenumberverplicht

    Btw-percentage, 0–100

  • billing_intervalintegerverplicht

    1–999

  • billing_interval_unitstringverplicht

    day, week, month, quarter of year

  • is_activeboolean

    Beschikbaar voor nieuwe documenten

curl -X POST "https://factora.one/api/v1/products" \
  -H "Authorization: Bearer $FACTORA_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "sku": "CONSULT-UUR",
    "name": "Consultancy",
    "description": "Advies en implementatie per uur",
    "unit": "uur",
    "unit_price": 9500,
    "tax_rate": 21,
    "billing_interval": 1,
    "billing_interval_unit": "month",
    "is_active": true
  }'

201 Voorbeeldantwoord

{
  "data": {
    "id": "9d3c9c4e-5db1-4042-be95-61a2cf108d54",
    "sku": "CONSULT-UUR",
    "name": "Consultancy",
    "description": "Advies en implementatie per uur",
    "unit": "uur",
    "unit_price": 9500,
    "tax_rate": 21,
    "billing_interval": 1,
    "billing_interval_unit": "month",
    "is_active": true,
    "created_at": "2026-11-12T08:40:00.000000Z",
    "updated_at": "2026-11-12T08:40:00.000000Z"
  }
}
PATCH/products/{id}

Product bijwerken

Werkt de meegestuurde velden bij. Bestaande abonnementen veranderen niet mee.

Pakketfeature
products
Recht (app-login)
products.manage
curl -X PATCH "https://factora.one/api/v1/products/<id>" \
  -H "Authorization: Bearer $FACTORA_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "unit_price": 9900
  }'

200 Voorbeeldantwoord

{
  "data": {
    "id": "9d3c9c4e-5db1-4042-be95-61a2cf108d54",
    "sku": "CONSULT-UUR",
    "name": "Consultancy",
    "description": "Advies en implementatie per uur",
    "unit": "uur",
    "unit_price": 9900,
    "tax_rate": 21,
    "billing_interval": 1,
    "billing_interval_unit": "month",
    "is_active": true,
    "created_at": "2026-11-12T08:40:00.000000Z",
    "updated_at": "2026-11-12T08:40:00.000000Z"
  }
}
DELETE/products/{id}

Product verwijderen

Verwijdert het product uit de catalogus.

Pakketfeature
products
Recht (app-login)
products.manage
curl -X DELETE "https://factora.one/api/v1/products/<id>" \
  -H "Authorization: Bearer $FACTORA_API_KEY" \
  -H "Accept: application/json"

200 Voorbeeldantwoord

{
  "message": "Product verwijderd."
}