The information presented in the Cratejoy API section applies to both the merchant and store API's
The Cratejoy Merchant API provides an interface into most of the data and functionality of interest to merchants and developers. It is useful to merchants and developers looking to write custom scripts or back-end extensions.
There are some example scripts provided for reference purposes at https://github.com/cratejoy/api_examples
Resource representations are JSON throughout the API, by default. Agents should still send an
Accept header with
application/json for requests, and a
Content-Type header with
PUT requests with a JSON body. In the future, the API may add support for other representations of data.
All data is encoded with UTF-8, and agents should send data encoded in UTF-8 to avoid problems. Queries and filters are URL parameters. All
PUT requests use a JSON body. No endpoints use Forms or URL parameters for updates.
- Major versions will be prefixed to all routes:
- Collection Resource URIs follow the pattern
- Element Resource URIs follow the pattern
200 OKWill be returned for successful GET, PUT, and PATCH requests.
201 CreatedWill be returned for successful POST requests.
204 No ContentWill be returned for successful DELETE requests
400 Bad Requestfor generic client errors.
403 Forbiddenwhen requesting a Resource which is not accessible by the client.
404 Not Foundwhen requesting a Resource which does not exist.
405 Method Not Allowedwhen using an inappropriate HTTP method for a Resource.
429 Too Many Requestswhen a client has issued too many requests.
500 Internal Server Errorif we are having unspecified problems.
503 Service Unavailableduring expected downtime
Retry-AfterIn the event of a
429 Too Many Requests, a
Retry-Afterheader will be included in the response. Agents can observe this value to retry at a later time. Time is returned in seconds until retry.