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) encount; het totaal staat in de headerX-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
Products
| GET | /products?q=&status=&category=&start=0&count=50 | List products (X-Total-Count header gives the total). |
| POST | /products | Create 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}/media | Add an image: {filename, contentType, data: base64, alt}. JPEG, PNG or WebP, 8 MB max. |
Categories
| GET | /categories | All categories (tree via parentId). |
| POST · PUT · DELETE | /categories[/{id}] | Create, update, delete. |
Orders
| GET | /orders?status=pending|paid|fulfilled|cancelled|refunded&q=&start&count | List orders. |
| GET | /orders/{id} | One order with lines, addresses, payment and fulfilment. |
| POST | /orders/{id}/fulfill | Mark shipped: {carrier, trackingNumber, trackingUrl}. The customer gets an e-mail. |
| POST | /orders/{id}/cancel | Cancel (a paid order is restocked and marked refunded). |
| PUT | /orders/{id}/note | Internal note: {note}. |
Customers and B2B
| GET | /customers?q=&b2b=pending|approved&start&count | List 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}/prices | Group price list: [{variantId, price, minQuantity}] (PUT replaces the list). |
Shop settings
| GET · PUT | /shop | Name, 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=30 | Sales totals, series and top products. |
Sleutel aanmaken Business-formule
Een vraag? Mail ons op support@kelcommerce.be.