This project sets up a Node.js-based REST API that integrates with the Shopify Admin API. It provides endpoints for handling customers, orders, products, collections, blogs, and blog articles. The API is designed to be used with a mobile application and can be tested using Postman.
- Customers: CRUD operations for customers.
- Orders: CRUD operations for orders.
- Products: CRUD operations for products.
- Collections: CRUD operations for custom and smart collections.
- Blogs & Articles: CRUD operations for blogs and blog articles.
-
Clone the Repository:
git clone <repository_url> cd shopify-rest-api
GET /customers- Retrieve all customers.GET /customers/:id- Retrieve a specific customer by ID.POST /customers- Create a new customer.PUT /customers/:id- Update a customer.DELETE /customers/:id- Delete a customer.
GET /orders- Retrieve all orders.GET /orders/:id- Retrieve a specific order by ID.POST /orders- Create a new order.PUT /orders/:id- Update an order.DELETE /orders/:id- Delete an order.
GET /products- Retrieve all products.GET /products/:id- Retrieve a specific product by ID.POST /products- Create a new product.PUT /products/:id- Update a product.DELETE /products/:id- Delete a product.
GET /collections/custom- Retrieve all custom collections.GET /collections/custom/:id- Retrieve a custom collection by ID.POST /collections/custom- Create a custom collection.PUT /collections/custom/:id- Update a custom collection.DELETE /collections/custom/:id- Delete a custom collection.
GET /collections/smart- Retrieve all smart collections.GET /collections/smart/:id- Retrieve a smart collection by ID.POST /collections/smart- Create a smart collection.PUT /collections/smart/:id- Update a smart collection.DELETE /collections/smart/:id- Delete a smart collection.
GET /blogs- Retrieve all blogs.GET /blogs/:id- Retrieve a specific blog by ID.POST /blogs- Create a new blog.PUT /blogs/:id- Update a blog.DELETE /blogs/:id- Delete a blog.
GET /blogs/:blogId/articles- Retrieve all articles for a specific blog.GET /blogs/:blogId/articles/:id- Retrieve a specific article by ID.POST /blogs/:blogId/articles- Create a new article in a blog.PUT /blogs/:blogId/articles/:id- Update an article.DELETE /blogs/:blogId/articles/:id- Delete an article.
- Create a new Postman collection and add requests for each endpoint listed above.
- Set the base URL: Use
http://localhost:3000(or your server URL) followed by the endpoint path (e.g.,{{base_url}}/customers). - Configure request bodies:
- For
POSTandPUTrequests, set the body type to JSON and include required data fields (e.g., customer name, product details).
- For
- Create a Postman environment with variables like
base_url(e.g.,http://localhost:3000). - Reference these variables in your requests using
{{variable_name}}syntax.
- Send requests to your server and verify responses.
- Ensure proper status codes (e.g.,
200 OK,201 Created,404 Not Found). - Validate response data matches expectations.