Direct naar inhoud

API-referentie

Klantenportaal

Instellingen van het klantenportaal beheren en portaaldocumenten en gesprekken met klanten lezen.

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

Overzicht

Pakketfeature customer_portal, recht customer_portal.manage. Welke klant toegang heeft, regel je met portal_access_enabled op de klant. Tweestapsverificatie in het portaal staat altijd aan en kan niet worden uitgezet.

Endpoints

GET/customer-portal

Portaalinstellingen tonen

Instellingen, publieke URL en eventueel geverifieerd eigen domein.

Pakketfeature
customer_portal
Recht (app-login)
customer_portal.manage
curl "https://factora.one/api/v1/customer-portal" \
  -H "Authorization: Bearer $FACTORA_API_KEY" \
  -H "Accept: application/json"

200 Voorbeeldantwoord

{
  "data": {
    "enabled": true,
    "subdomain": "demo",
    "url": "https://factora.one/demo",
    "custom_domain": null,
    "primary_color": "#2563eb",
    "secondary_color": "#111827",
    "welcome_text": "Welkom in uw klantenportaal",
    "footer_text": null,
    "company_info": null,
    "contact_email": "support@demo.nl",
    "contact_phone": "020-1234567",
    "two_factor_enabled": true,
    "notification_settings": null
  }
}
PATCH/customer-portal

Portaalinstellingen bijwerken

Werkt de meegestuurde velden bij.

Pakketfeature
customer_portal
Recht (app-login)
customer_portal.manage

Body

  • portal_enabledboolean

    Portaal aan of uit

  • portal_primary_colorstring

    Hex-kleur #rrggbb

  • portal_secondary_colorstring

    Hex-kleur #rrggbb

  • portal_welcome_textstring

    Max. 255

  • portal_footer_textstring

    Max. 2000

  • portal_company_infostring

    Max. 2000

  • portal_contact_emailstring

    E-mailadres

  • portal_contact_phonestring

    Max. 255

  • portal_notification_settingsobject

    Meldingsinstellingen

curl -X PATCH "https://factora.one/api/v1/customer-portal" \
  -H "Authorization: Bearer $FACTORA_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "portal_enabled": true,
    "portal_primary_color": "#2563eb",
    "portal_secondary_color": "#111827",
    "portal_welcome_text": "Welkom in uw klantenportaal",
    "portal_contact_email": "support@demo.nl"
  }'

200 Voorbeeldantwoord

{
  "data": {
    "enabled": true,
    "subdomain": "demo",
    "url": "https://factora.one/demo",
    "custom_domain": null,
    "primary_color": "#2563eb",
    "secondary_color": "#111827",
    "welcome_text": "Welkom in uw klantenportaal",
    "footer_text": null,
    "company_info": null,
    "contact_email": "support@demo.nl",
    "contact_phone": "020-1234567",
    "two_factor_enabled": true,
    "notification_settings": null
  }
}
GET/customer-portal/documents

Portaaldocumenten

Gepagineerde lijst van gedeelde documenten.

Pakketfeature
customer_portal
Recht (app-login)
customer_portal.manage
curl "https://factora.one/api/v1/customer-portal/documents" \
  -H "Authorization: Bearer $FACTORA_API_KEY" \
  -H "Accept: application/json"

200 Voorbeeldantwoord

{
  "data": {
    "current_page": 1,
    "data": [
      {
        "id": "9d3ce082-91f5-4486-f2d9-a5e60354c198",
        "title": "Algemene voorwaarden 2026",
        "category": "contract",
        "original_name": "voorwaarden-2026.pdf",
        "mime_type": "application/pdf",
        "size": 182044,
        "visible_to_all": true,
        "customer": null,
        "created_at": "2026-10-01T09:00:00.000000Z",
        "updated_at": "2026-10-01T09:00:00.000000Z"
      }
    ],
    "first_page_url": "https://factora.one/api/v1/customer-portal/documents?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "https://factora.one/api/v1/customer-portal/documents?page=1",
    "next_page_url": null,
    "path": "https://factora.one/api/v1/customer-portal/documents",
    "per_page": 50,
    "prev_page_url": null,
    "to": 1,
    "total": 1
  }
}
GET/customer-portal/conversations

Gesprekken

Gepagineerde lijst met per gesprek het laatste bericht.

Pakketfeature
customer_portal
Recht (app-login)
customer_portal.manage
curl "https://factora.one/api/v1/customer-portal/conversations" \
  -H "Authorization: Bearer $FACTORA_API_KEY" \
  -H "Accept: application/json"

200 Voorbeeldantwoord

{
  "data": {
    "current_page": 1,
    "data": [
      {
        "id": "9d3cf193-a206-4597-03ea-b6f71465d2a9",
        "subject": "Vraag over factuur 2026-0142",
        "status": "open",
        "customer": {
          "id": "9d3c6f1b-2a8e-4d1f-8b62-3e7f9c8d5a21",
          "name": "Jansen Bouw",
          "email": "info@jansenbouw.nl"
        },
        "latest_message": "Kunnen we in twee termijnen betalen?",
        "created_at": "2026-11-12T10:30:00.000000Z",
        "updated_at": "2026-11-12T10:30:00.000000Z"
      }
    ],
    "first_page_url": "https://factora.one/api/v1/customer-portal/conversations?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "https://factora.one/api/v1/customer-portal/conversations?page=1",
    "next_page_url": null,
    "path": "https://factora.one/api/v1/customer-portal/conversations",
    "per_page": 50,
    "prev_page_url": null,
    "to": 1,
    "total": 1
  }
}
GET/customer-portal/conversations/{id}

Gesprek met berichten

Eén gesprek met alle berichten in messages.

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

200 Voorbeeldantwoord

{
  "data": {
    "id": "9d3cf193-a206-4597-03ea-b6f71465d2a9",
    "subject": "Vraag over factuur 2026-0142",
    "status": "open",
    "customer": {
      "id": "9d3c6f1b-2a8e-4d1f-8b62-3e7f9c8d5a21",
      "name": "Jansen Bouw",
      "email": "info@jansenbouw.nl"
    },
    "latest_message": "Kunnen we in twee termijnen betalen?",
    "created_at": "2026-11-12T10:30:00.000000Z",
    "updated_at": "2026-11-12T10:30:00.000000Z",
    "messages": [
      {
        "id": "9d3d02a4-b317-46a8-14fb-c708257be3ba",
        "sender_type": "customer",
        "sender_name": "Piet Jansen",
        "body": "Kunnen we in twee termijnen betalen?",
        "attachment_original_name": null,
        "read_at": null,
        "created_at": "2026-11-12T10:30:00.000000Z"
      }
    ]
  }
}