API Overview
The Storenvy API provides a REST-like interface for remotely creating and manipulating stores, their contents, and orders. All endpoints are only available via https
requests made to https://api.storenvy.com/v1/{endpoint}.json
.
Requests
All requests must be made in JSON format.
Back To TopResponse Structure
Responses are wrapped in an envelope that provides access to status codes and other meta information. The data response will be in the "data" attribute of the response.
{ "data" : { ... // Your response data }, "meta" : { "code" : 200 // Should always match the HTTP status code "api_version" : "1.0" }, "pagination" : { "total" : 400, // The total number of objects at this endpoint "offset" : 50, // The number of items skipped in this request "total_pages" : 1, // The number of total pages at this endpoint "next_url" : "https...", // The url of the next page of paginated results at this endpoint "current_max_id" : 15292 // The maximum ID at this endpoint. } }
Back To TopMeta Key
The meta key will typically only contain the status code and the API version. In the case of an application or validation error, the meta key will include more information about what happened.
{ "meta" : { "code" : 405, "error_type" : "MethodNotAllowed", "error_message" : "This API call requires a store. Create one with POST /v1/store" } }
Back To TopPagination
We limit the number of responses for each request to 50 objects. We then provide a convenient way to access the next data in the sequence. Simply call the url in the next_url parameter and we'll respond with the next set of data.
{ ... "pagination": { "total" : 400, // The total number of objects at this endpoint "offset" : 50, // The number of items skipped in this request "total_pages" : 1, // The number of total pages at this endpoint "next_url": "https://api.storenvy.com/v1/orders?access_token=...&after_id=15292", "current_max_id": 15292 } }
Back To TopJSONP
All endpoints support JSONP for javascript callbacks. Using the callback
parameter in the request.
GET https://api.storenvy.com/v1/products?access_token=...&callback=myCallbackWould respond with:
myCallback({ "data" : {...} "meta" : {...} "pagination" : {...} });