Documentatie

KelCommerce API

Koppel je winkel aan je kassa, ERP of boekhouding. De API zit in de Business-formule.

API-sleutels

Maak een sleutel aan in je beheer, menu Instellingen › API. Een sleutel „alleen lezen” kan enkel lezen; een sleutel „lezen en schrijven” kan alles wijzigen. De sleutel wordt maar één keer getoond: bewaar hem als een wachtwoord. Je kunt hem op elk moment intrekken.

Authenticatie

Stuur de sleutel mee in de Authorization-header. Vervang {handle} door de naam van je winkel (die van het adres jouw-naam.kelcommerce.eu).

Authorization: Bearer kc_…
https://admin.kelcommerce.be/api/commerce/manage/{handle}/…

Regels

  • JSON in en uit, in UTF-8. Bedragen zijn strings met twee decimalen ("19.90"), inclusief btw.
  • Lijsten worden gepagineerd met start (vanaf 0) en count; het totaal staat in de header X-Total-Count.
  • Limiet: 120 verzoeken per minuut per sleutel. Daarboven: status 429 en header Retry-After.
  • Fouten: {"error": "code", "message": "…"} met status 401 (sleutel ontbreekt, ingetrokken of geen Business-formule), 404 (niet gevonden), 417 (geweigerd), 429 (limiet).
  • Een sleutel geeft nooit toegang tot facturatie, het team, API-sleutels of de betaalinstellingen.

Voorbeeld: betaalde bestellingen om te verzenden

curl -H "Authorization: Bearer kc_…" \
  "https://admin.kelcommerce.be/api/commerce/manage/{handle}/orders?status=paid&start=0&count=50"

Referentie

De routereferentie is in het Engels.

Products

GET/products?q=&status=&category=&start=0&count=50List products (X-Total-Count header gives the total).
POST/productsCreate a product with its options, variants and categories.
GET/products/{id}One product with variants, stock and media.
PUT/products/{id}Replace a product; variants with an id are kept, without id created, missing ones deleted.
DELETE/products/{id}Delete a product.
POST/products/{id}/mediaAdd an image: {filename, contentType, data: base64, alt}. JPEG, PNG or WebP, 8 MB max.

Categories

GET/categoriesAll categories (tree via parentId).
POST · PUT · DELETE/categories[/{id}]Create, update, delete.

Orders

GET/orders?status=pending|paid|fulfilled|cancelled|refunded&q=&start&countList orders.
GET/orders/{id}One order with lines, addresses, payment and fulfilment.
POST/orders/{id}/fulfillMark shipped: {carrier, trackingNumber, trackingUrl}. The customer gets an e-mail.
POST/orders/{id}/cancelCancel (a paid order is restocked and marked refunded).
PUT/orders/{id}/noteInternal note: {note}.

Customers and B2B

GET/customers?q=&b2b=pending|approved&start&countList customers.
GET/customers/{id}One customer with their orders.
PUT/customers/{id}B2B status and price group: {b2bStatus, groupId}.
GET · POST · PUT · DELETE/customer-groups[/{id}]Price groups: {name, discountPercent}.
GET · PUT/customer-groups/{id}/pricesGroup price list: [{variantId, price, minQuantity}] (PUT replaces the list).

Shop settings

GET · PUT/shopName, languages, address, theme…
GET · POST · PUT · DELETE/shipping-rates[/{id}]Shipping rates.
GET · POST · PUT · DELETE/discounts[/{id}]Discount codes.
GET · POST · PUT · DELETE/pages[/{id}]Content pages.
GET/dashboard?days=30Sales totals, series and top products.

Sleutel aanmaken Business-formule

Een vraag? Mail ons op support@kelcommerce.be.