RESTful API Overview
EverShop is an API based e-commerce platform. It provides a RESTful API and a GraphQL API for developers to build their own e-commerce applications.
Check out this document to learn more about the API routes.
Check out this document to learn more about the GraphQL API in EverShop.
EverShop uses the JSON format for all the API requests and responses. The content type of the request and response is
Some API endpoints do not require authentication. If the
access property is set to
public in the
route.json file, the API endpoint will be treated as a public API endpoint. Public API endpoints can be accessed by anyone.
Where possible, the EverShop REST API strives to use appropriate HTTP verbs for each action. Note that HTTP verbs are case-sensitive.
- GET: Used for retrieving resources.
- POST: Used for creating resources.
- PATCH: Used for updating resources with partial JSON data. For instance, an Issue resource has title and body attributes. A PATCH request may accept one or more of the attributes to update the resource.
- DELETE: Used for deleting resources.
EverShop uses the HTTP status codes to indicate the status of the API calls. The HTTP status code is returned in the response header.
List of the HTTP status codes:
- 200: OK
- 400: Bad Request
- 401: Unauthorized
- 403: Forbidden
- 404: Not Found
- 405: Method Not Allowed
- 500: Internal Server Error
If the API call was failed, the response body will contain the error message. The error message is a JSON object with the following structure: