General
Authentication
All API requests need to be authenticated. To do this, you need to always send the HTTP header Authorization
with your API key as a bearer token:
Authorization: Bearer your_api_key
Rate limits
To protect our servers from getting overloaded and avoid misuse, we enforce a rate limit of 100 requests per minute. You shouldn't need to poll frequently for status updates as you can get real-time updates via Webhooks. In case you have a valid use case for a higher rate limit, please contact your account manager.
The API responds with the following headers to indicate the number of requests used and the maximum available:
Any requests above the limit will be denied with a 429 response code (too many requests). In that case, the response also includes an extra header which shows how many seconds you need to wait before sending a new request:
Errors
When a request is unsuccessful, you will get an HTTP status code of 4xx (for client errors) or 5xx (for server errors). The body then will always contain an errors
property which contains an array of human-readable errors.
Common errors
If your API key is missing, or wrong, you'd get a 401 Unauthorized with this JSON response:
Another example, when the request is malformed, you'd get a 400 Bad request:
Finally, if the data is not valid, you'd get a 422 Unprocessable Entity:
Successful responses
When an API request is successful, you will get an HTTP status code of 2xx. The response body will either be a single object or a collection of objects.
Single object
When you create or update an object, you will get the final state of the object in the response:
Collection of objects
When you get a collection of objects in the response, the response is an object with a data
property and a pagination
property. The actual collection of object is in the data
property:
Pagination
In order to access all the objects of the collection, you need to send multiple requests to an endpoint. This works by adding the query string parameter page
to the URL (e.g. https://app.hive.app/merchant_api/v1/skus?page=2)
The pagination.page_count
property of the response, returns how many pages are available. If no page parameter is provided, it defaults to 1
(that is, the first page of results).
Last updated