General Info
Note: This API is in a beta state. Breaking changes may occur.
If you need more API methods, or have any suggestions to existing ones, please contact us at support@zubibu.com.
Schema
All API access is over HTTP, and accessed from the api.zubibu.com domain. All data is sent and received as JSON and XML.
Blank fields are included as null instead of being omitted.
All timestamps are returned in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ
Authentication
Some resources require authentication. Authentication is done be sending your api_key as a parameter. You can find your api_key in your zubibu backend
$ curl -I http://api.zubibu.com/v1/orders.json?api_key=API_KEY
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Connection: close
Pagination
Requests that return multiple items will be paginated to 10 items by default. You can specify further pages with the ?page parameter. You can also set a custom page size up to 50 with the ?per_page parameter.
$ curl https://api.zubibu.com/v1/orders.json?api_key=API_KEY&page=2&per_page=100
The pagination info is included in the Link header:
$ curl -I http://api.zubibu.com/v1/orders.json?api_key=API_KEY&status=any&page=2
HTTP/1.1 200 OK
Link: <http://api.zubibu.com/v1/orders.json?page=3&status=any>; rel="next",
<http://api.zubibu.com/v1/orders.json?page=7&status=any>; rel="last",
<http://api.zubibu.com/v1/orders.json?page=1&status=any>; rel="first",
<http://api.zubibu.com/v1/orders.json?page=1&status=any>; rel="prev"
Linebreaks are included for readability.
Rate Limiting
We limit requests to API to 5000 per day. This is keyed off request IP. You can check the returned HTTP headers of any API request to see your current status:
$ curl -i http://api.zubibu.com/v1.json
HTTP/1.1 200 OK
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4997
{
"status": "OK"
}
Once you meet Rate Limit for your IP we will respond with 403 HTTP status code:
HTTP/1.1 403 Forbidden
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 0
403 Forbidden (Rate Limit Exceeded)
If you need more API calls per day, please contact us at support@zubibu.com
Client Errors
Wrong type of input values.
$ curl -i -X POST -H "Content-Type: application/json" http://api.zubibu.com/v1/web_hooks.json?api_key=API_KEY \
-d '{"format": "json", "topic": "order/run", "url": "http://myshop.example.com"}'
HTTP/1.1 400 Bad Request
{
"message": "invalid topic"
}
Unauthorized access to resource
$ curl -i http://api.zubibu.com/v1/orders.json
HTTP/1.1 401 Unauthorized
{
"message":"unauthorized"
}
Rate Limit Exceeded
HTTP/1.1 403 Forbidden
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 0
403 Forbidden (Rate Limit Exceeded)
Resource not found
$ curl http://api.zubibu.com/v1/web_hooks/abc.json?api_key=API_KEY
HTTP/1.1 404 Not Found
{
"message": "resource not found"
}
