Direct naar inhoud

API-referentie

Klantabonnementen

Terugkerende facturatie per klant: abonnementen starten, wijzigen, pauzeren, hervatten, stoppen en verwerken.

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

Overzicht

Pakketfeature subscriptions. Een abonnement neemt prijs, btw, omschrijving en interval van het product over als momentopname. Latere productwijzigingen veranderen een bestaand abonnement niet.

StatusMogelijke acties
activepause, cancel, process
pausedresume, cancel
cancelled—
ended—

auto_send staat standaard uit en vereist de pakketfeature automatic_emails. Factora verstuurt alleen automatisch als iedere regel op de conceptfactuur daarvoor geschikt is.

Endpoints

GET/subscriptions

Abonnementen opvragen

Gepagineerde lijst.

Pakketfeature
subscriptions
Recht (app-login)
subscriptions.view

Queryparameters

  • statusstring

    active, paused, cancelled of ended

  • customer_iduuid

    Alleen van deze klant

  • per_pageinteger

    1–100, standaard 50

curl "https://factora.one/api/v1/subscriptions?status=active" \
  -H "Authorization: Bearer $FACTORA_API_KEY" \
  -H "Accept: application/json"

200 Voorbeeldantwoord

{
  "data": {
    "current_page": 1,
    "data": [
      {
        "id": "9d3cad5f-6ec2-4153-cfa6-72b3d0219e65",
        "customer_id": "9d3c6f1b-2a8e-4d1f-8b62-3e7f9c8d5a21",
        "customer": {
          "id": "9d3c6f1b-2a8e-4d1f-8b62-3e7f9c8d5a21",
          "name": "Jansen Bouw",
          "email": "info@jansenbouw.nl"
        },
        "product_id": "9d3c9c4e-5db1-4042-be95-61a2cf108d54",
        "product": {
          "id": "9d3c9c4e-5db1-4042-be95-61a2cf108d54",
          "name": "Hosting",
          "sku": "HOST-M"
        },
        "status": "active",
        "quantity": 1,
        "unit_price": 2500,
        "vat_rate": 21,
        "description": "Hosting",
        "billing_interval": 1,
        "billing_interval_unit": "month",
        "start_date": "2026-12-01",
        "next_invoice_date": "2026-12-01",
        "last_invoiced_at": null,
        "end_date": null,
        "auto_send": false
      }
    ],
    "first_page_url": "https://factora.one/api/v1/subscriptions?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "https://factora.one/api/v1/subscriptions?page=1",
    "next_page_url": null,
    "path": "https://factora.one/api/v1/subscriptions",
    "per_page": 50,
    "prev_page_url": null,
    "to": 1,
    "total": 1
  }
}
GET/subscriptions/{id}

Abonnement tonen

Abonnement met zijn facturatieruns in runs.

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

200 Voorbeeldantwoord

{
  "data": {
    "id": "9d3cad5f-6ec2-4153-cfa6-72b3d0219e65",
    "customer_id": "9d3c6f1b-2a8e-4d1f-8b62-3e7f9c8d5a21",
    "customer": {
      "id": "9d3c6f1b-2a8e-4d1f-8b62-3e7f9c8d5a21",
      "name": "Jansen Bouw",
      "email": "info@jansenbouw.nl"
    },
    "product_id": "9d3c9c4e-5db1-4042-be95-61a2cf108d54",
    "product": {
      "id": "9d3c9c4e-5db1-4042-be95-61a2cf108d54",
      "name": "Hosting",
      "sku": "HOST-M"
    },
    "status": "active",
    "quantity": 1,
    "unit_price": 2500,
    "vat_rate": 21,
    "description": "Hosting",
    "billing_interval": 1,
    "billing_interval_unit": "month",
    "start_date": "2026-12-01",
    "next_invoice_date": "2026-12-01",
    "last_invoiced_at": null,
    "end_date": null,
    "auto_send": false,
    "runs": []
  }
}
POST/subscriptions

Abonnement starten

Velden die je weglaat, komen van het product.

Pakketfeature
subscriptions
Recht (app-login)
subscriptions.manage

Body

  • customer_iduuidverplicht

    Klant van dezelfde organisatie

  • product_iduuidverplicht

    Product van dezelfde organisatie

  • quantitynumber

    Standaard 1, minimaal 0.01

  • unit_priceinteger

    Centen; standaard de productprijs

  • vat_ratenumber

    0–100; standaard het btw-tarief van het product

  • descriptionstring

    Max. 5000; standaard naam en omschrijving van het product

  • billing_intervalinteger

    1–999

  • billing_interval_unitstring

    day, week, month, quarter of year

  • start_datedate

    Standaard vandaag

  • next_invoice_datedate

    Standaard de startdatum

  • end_datedate

    Optionele einddatum

  • auto_sendboolean

    Standaard false

curl -X POST "https://factora.one/api/v1/subscriptions" \
  -H "Authorization: Bearer $FACTORA_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "customer_id": "9d3c6f1b-2a8e-4d1f-8b62-3e7f9c8d5a21",
    "product_id": "9d3c9c4e-5db1-4042-be95-61a2cf108d54",
    "quantity": 1,
    "start_date": "2026-12-01",
    "next_invoice_date": "2026-12-01",
    "auto_send": false
  }'

201 Voorbeeldantwoord

{
  "data": {
    "id": "9d3cad5f-6ec2-4153-cfa6-72b3d0219e65",
    "customer_id": "9d3c6f1b-2a8e-4d1f-8b62-3e7f9c8d5a21",
    "customer": {
      "id": "9d3c6f1b-2a8e-4d1f-8b62-3e7f9c8d5a21",
      "name": "Jansen Bouw",
      "email": "info@jansenbouw.nl"
    },
    "product_id": "9d3c9c4e-5db1-4042-be95-61a2cf108d54",
    "product": {
      "id": "9d3c9c4e-5db1-4042-be95-61a2cf108d54",
      "name": "Hosting",
      "sku": "HOST-M"
    },
    "status": "active",
    "quantity": 1,
    "unit_price": 2500,
    "vat_rate": 21,
    "description": "Hosting",
    "billing_interval": 1,
    "billing_interval_unit": "month",
    "start_date": "2026-12-01",
    "next_invoice_date": "2026-12-01",
    "last_invoiced_at": null,
    "end_date": null,
    "auto_send": false
  }
}
PATCH/subscriptions/{id}

Abonnement bijwerken

Wijzig de momentopname (prijs, aantal, omschrijving), de periode of de planning.

Pakketfeature
subscriptions
Recht (app-login)
subscriptions.manage
curl -X PATCH "https://factora.one/api/v1/subscriptions/<id>" \
  -H "Authorization: Bearer $FACTORA_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "quantity": 2,
    "next_invoice_date": "2027-01-01"
  }'

200 Voorbeeldantwoord

{
  "data": {
    "id": "9d3cad5f-6ec2-4153-cfa6-72b3d0219e65",
    "customer_id": "9d3c6f1b-2a8e-4d1f-8b62-3e7f9c8d5a21",
    "customer": {
      "id": "9d3c6f1b-2a8e-4d1f-8b62-3e7f9c8d5a21",
      "name": "Jansen Bouw",
      "email": "info@jansenbouw.nl"
    },
    "product_id": "9d3c9c4e-5db1-4042-be95-61a2cf108d54",
    "product": {
      "id": "9d3c9c4e-5db1-4042-be95-61a2cf108d54",
      "name": "Hosting",
      "sku": "HOST-M"
    },
    "status": "active",
    "quantity": 2,
    "unit_price": 2500,
    "vat_rate": 21,
    "description": "Hosting",
    "billing_interval": 1,
    "billing_interval_unit": "month",
    "start_date": "2026-12-01",
    "next_invoice_date": "2027-01-01",
    "last_invoiced_at": null,
    "end_date": null,
    "auto_send": false
  }
}
POST/subscriptions/{id}/pause

Pauzeren

Alleen vanuit active.

Pakketfeature
subscriptions
Recht (app-login)
subscriptions.manage

Mogelijke fouten

  • 422Deze statusovergang is niet toegestaan.
curl -X POST "https://factora.one/api/v1/subscriptions/<id>/pause" \
  -H "Authorization: Bearer $FACTORA_API_KEY" \
  -H "Accept: application/json"

200 Voorbeeldantwoord

{
  "data": {
    "id": "9d3cad5f-6ec2-4153-cfa6-72b3d0219e65",
    "customer_id": "9d3c6f1b-2a8e-4d1f-8b62-3e7f9c8d5a21",
    "customer": {
      "id": "9d3c6f1b-2a8e-4d1f-8b62-3e7f9c8d5a21",
      "name": "Jansen Bouw",
      "email": "info@jansenbouw.nl"
    },
    "product_id": "9d3c9c4e-5db1-4042-be95-61a2cf108d54",
    "product": {
      "id": "9d3c9c4e-5db1-4042-be95-61a2cf108d54",
      "name": "Hosting",
      "sku": "HOST-M"
    },
    "status": "paused",
    "quantity": 1,
    "unit_price": 2500,
    "vat_rate": 21,
    "description": "Hosting",
    "billing_interval": 1,
    "billing_interval_unit": "month",
    "start_date": "2026-12-01",
    "next_invoice_date": "2026-12-01",
    "last_invoiced_at": null,
    "end_date": null,
    "auto_send": false
  }
}
POST/subscriptions/{id}/resume

Hervatten

Alleen vanuit paused.

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

200 Voorbeeldantwoord

{
  "data": {
    "id": "9d3cad5f-6ec2-4153-cfa6-72b3d0219e65",
    "customer_id": "9d3c6f1b-2a8e-4d1f-8b62-3e7f9c8d5a21",
    "customer": {
      "id": "9d3c6f1b-2a8e-4d1f-8b62-3e7f9c8d5a21",
      "name": "Jansen Bouw",
      "email": "info@jansenbouw.nl"
    },
    "product_id": "9d3c9c4e-5db1-4042-be95-61a2cf108d54",
    "product": {
      "id": "9d3c9c4e-5db1-4042-be95-61a2cf108d54",
      "name": "Hosting",
      "sku": "HOST-M"
    },
    "status": "active",
    "quantity": 1,
    "unit_price": 2500,
    "vat_rate": 21,
    "description": "Hosting",
    "billing_interval": 1,
    "billing_interval_unit": "month",
    "start_date": "2026-12-01",
    "next_invoice_date": "2026-12-01",
    "last_invoiced_at": null,
    "end_date": null,
    "auto_send": false
  }
}
POST/subscriptions/{id}/cancel

Stoppen

Niet vanuit cancelled of ended.

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

200 Voorbeeldantwoord

{
  "data": {
    "id": "9d3cad5f-6ec2-4153-cfa6-72b3d0219e65",
    "customer_id": "9d3c6f1b-2a8e-4d1f-8b62-3e7f9c8d5a21",
    "customer": {
      "id": "9d3c6f1b-2a8e-4d1f-8b62-3e7f9c8d5a21",
      "name": "Jansen Bouw",
      "email": "info@jansenbouw.nl"
    },
    "product_id": "9d3c9c4e-5db1-4042-be95-61a2cf108d54",
    "product": {
      "id": "9d3c9c4e-5db1-4042-be95-61a2cf108d54",
      "name": "Hosting",
      "sku": "HOST-M"
    },
    "status": "cancelled",
    "quantity": 1,
    "unit_price": 2500,
    "vat_rate": 21,
    "description": "Hosting",
    "billing_interval": 1,
    "billing_interval_unit": "month",
    "start_date": "2026-12-01",
    "next_invoice_date": "2026-12-01",
    "last_invoiced_at": null,
    "end_date": null,
    "auto_send": false
  }
}
POST/subscriptions/{id}/process

Vervallen periode verwerken

Maakt direct de factuur voor een vervallen periode. Geeft het ID van de nieuwe factuur in invoice_id.

Pakketfeature
subscriptions + automatic_invoicing
Recht (app-login)
subscriptions.manage

Mogelijke fouten

  • 422Abonnement is niet vervallen of niet actief.
curl -X POST "https://factora.one/api/v1/subscriptions/<id>/process" \
  -H "Authorization: Bearer $FACTORA_API_KEY" \
  -H "Accept: application/json"

200 Voorbeeldantwoord

{
  "data": {
    "id": "9d3cad5f-6ec2-4153-cfa6-72b3d0219e65",
    "customer_id": "9d3c6f1b-2a8e-4d1f-8b62-3e7f9c8d5a21",
    "customer": {
      "id": "9d3c6f1b-2a8e-4d1f-8b62-3e7f9c8d5a21",
      "name": "Jansen Bouw",
      "email": "info@jansenbouw.nl"
    },
    "product_id": "9d3c9c4e-5db1-4042-be95-61a2cf108d54",
    "product": {
      "id": "9d3c9c4e-5db1-4042-be95-61a2cf108d54",
      "name": "Hosting",
      "sku": "HOST-M"
    },
    "status": "active",
    "quantity": 1,
    "unit_price": 2500,
    "vat_rate": 21,
    "description": "Hosting",
    "billing_interval": 1,
    "billing_interval_unit": "month",
    "start_date": "2026-12-01",
    "next_invoice_date": "2027-01-01",
    "last_invoiced_at": "2026-12-01T06:00:00.000000Z",
    "end_date": null,
    "auto_send": false
  },
  "invoice_id": "9d3c7a2c-3b9f-4e20-9c73-4f80ad9e6b32"
}