The Kodmyran Commerce platform provides several very different APIs, firstly the old SOAP API is still available but deprecated; secondly a range of new JSON/REST based APIs enables access to all parts of the platform without restrictions; and thirdly the JSON headless API provides a complete headless implementation. All APIs except the SOAP API are described in this documentation.
You can find the obsolete documentation for the SOAP API here:
All strings are to be sent as UTF-8 per JSON standards.
You can access the swagger.json file for integration with various tools at:
https://testaccount.shop4sale.se/admin/api/swagger.json
Replace testaccount with your own domain provided when your account was setup.
A single call to the JSON API is fully transactional, a failure during processing will result in a database rollback of all data changed during that call. The API may in certain cases store individual updates and re-apply these after a rollback. This is intended to be used for call tracking/tracing only and not for normal operation and is invisible to API users.
All the end-points are regulated by an API call limit/minute, except the headless API. This limit is global for the entire account and is applied to all calls that can be authenticated. Calls that terminate prior to authentication are not included in the limit (e.g. fetching swagger.json or issuing some OPTION commands over HTTP).
The limit has a default value of 20 calls/minute but can be adjusted if required, contact Kodmyran for more information if this limit is too low.
Kodmyran Commerce takes security very seriously and requires authentication of all calls, the use of HTTPS and provides several consistency checks to prevent misuse.
All APIs except the headless requires all requests to be authenticated using one of the below four methods:
Passing initial authentication is not sufficient by itself, you also need to communicate using HTTPS, and must be sending your queries to the account domain, not the user domain. Hence you cannot call either https://www.myshop.com/admin/api or http://www.myshop.com/admin/api. All requests must be directed to https://<account>.shop4sale.se/admin/api - where account is replaced by your eight-character account name.
Once the key has been validated, and the domain name checked, the user associated with the API key is checked for proper permissions. Initially the user must possess the "Remote call: Read" and/or the "Remote call: Write" permissions (depending upon the HTTP request verb).
Once the user passes this check the role that they possess must also contain permissions to access the requested entity type. The permissions granted to that role for that object type dictates the users access. The available permissions are:
The headless API requires the use of an API key to permit requests. This API key is unrelated to the API key used for the other APIs, it is an application unique string that must be provided in each call in the X-API-Key HTTP header.
To create the API key to use for the headless API you need to use the SOAP API first, and use the registerApplication call which will return an application ID/key in return. The headless API can only be used server-to-server and will not allow direct access using Javascript from a clients browser.
Kodmyran Commerce has support for a wide variety of synchronization patterns, here are some common ways of synchronizing. The first four items are used with the entity API, the fifth option is strictly for the integration API.
All requests hitting Kodmyran Commerce must use the proper content-type. All current calls expect the content-type to be set to application/json