Article import via JSON API
Question
How can I automatically import articles and prices into my configurator via API - e.g. from my ERP or PIM system?
Answer
K3 offers an API endpoint for direct article import via JSON. This allows you to update articles and prices programmatically.
1. generate API token
First you need an API token for authentication:
- Switch to your user profile
- Switch on the Developer mode
- Click on Generate token
→ Anleitung: API-Token erzeugen
2. determine configurator ID
You can find the ID of your configurator in the URL when you open the configurator in the editor:
https://k3.objectcode.de/app/#/admin/apps/3030/...
^^^^
ID = 3030
3. call API endpoint
POST https://k3-api.objectcode.de/api/v1.0/app/{ID}/import/articles/direct
Replace {ID} with the ID of your configurator.
4. JSON format
The format of the JSON data corresponds to the article and price format of the Shop API:
→ Dokumentation: Articles & prices
5th example with cURL
curl -X POST "https://k3-api.objectcode.de/api/v1.0/app/3030/import/articles/direct" \
-H "Authorization: Bearer IHR_API_TOKEN" \
-H "Content-Type: application/json" \
-d @artikel.json
Test API interactively
You can also test the API interactively on the Swagger documentation: