This is the API documentation for My Store API, which allows you to manage product catalogs and orders. This API is open for demonstration and testing purposes, and data will be wiped periodically.
Download:
Base URL: https://mystoreapi.com
Authentication:
Several endpoints require a JWT token for authorization. You can obtain a JWT token by logging in via the /auth/login
endpoint. Include the JWT token in the Authorization
header using the Bearer scheme (e.g., Authorization: Bearer YOUR_JWT_TOKEN
).
Get Categories (GET /catalog/categories
)
Get Products (GET /catalog/products
)
limit
(required, query): The maximum number of products to return (integer).skip
(required, query): The number of products to skip before starting to collect results (integer for pagination).Get Products in Category (GET /catalog/category/{category}/products
)
limit
(required, query): The maximum number of products to return (integer).skip
(required, query): The number of products to skip before starting to collect results (integer for pagination).category
(required, path): The category slug (string).Get Product (GET /catalog/product/{id}
)
id
(required, path): The product ID (integer).Create Product (POST /catalog/product
)
CreateProductDto
schema (see components section).Delete Product (DELETE /catalog/product/{id}
)
id
(required, path): The product ID (integer).Create Order (POST /order/new
)
CreateOrderDto
schema (see components section).Add Product to Order (POST /order/{id}/product
)
id
(required, path): The order ID (string).AddProductToOrderDto
schema (see components section).Get Order (GET /order/{id}
)
id
(required, path): The order ID (string).Cancel Order (DELETE /order/{id}
)
Cancel Order (DELETE /order/{id}
)
id
(required, path): The order ID (string).Delete Product from Order (DELETE /order/{id}/product/{productId}
)
id
(required, path): The order ID (string).productId
(required, path): The product ID to remove (integer).Get User Orders (GET /order/my
)
Authorization
header using the Bearer scheme.Place Order (POST /order/{id}/place
)
id
(required, path): The order ID (string).Authorization
header using the Bearer scheme.Login (POST /auth/login
)
CreateUserDto
schema (see components section).Create User (Sign Up) (POST /auth/user
)
CreateUserDto
schema (see components section).Me (GET /auth/me
)
Authorization
header using the Bearer scheme.This section describes the data structures used in some API requests and responses.
CreateProductDto
name
(required, string): The name of the product.price
(required, number): The price of the product.manufacturer
(required, string): The manufacturer of the product.category
(required, string): The category of the product (matches a category slug).description
(required, string): A description of the product.tags
(required, string): Comma-separated tags associated with the product (optional).CreateOrderDto
customer
(required, string): The customer placing the order.address
(required, string): The customerโs address for order fulfillment.AddProductToOrderDto
productId
(required, string): The ID of the product to add (matches a product ID).amount
(required, number): The quantity of the product to add.CreateUserDto
username
(required, string): The username for the new user.password
(required, string): The password for the new user.This concludes the API documentation for My Store API. Please refer to the specific details of each endpoint for proper usage and expected responses. Remember that this API is for demonstration purposes only.