Welcome to the E-commerce API repository. This API provides a set of endpoints to manage developers, organizations, products, and user authentication for an e-commerce platform. The API is designed to be easy to use and integrate with your existing systems, providing robust functionality for managing various aspects of an e-commerce application.
- Introduction
- Base URL
- Authentication
- Getting Started
- Key Features
- Technology Used
- Workflow
- Security Features
- Error Handling
- Rate Limiting
- Endpoints
- Example Requests
- Contact
Welcome to the E-commerce API documentation. This API provides a set of endpoints to manage developers, organizations, products, and user authentication for an e-commerce platform. The API is designed to be easy to use and integrate with your existing systems, providing robust functionality for managing various aspects of an e-commerce application.
All API endpoints are prefixed with the base URL:https://commercecore-user-service-api-c5139cd37734.herokuapp.com/
Documentation link: https://documenter.getpostman.com/view/38251338/2sAXqs7NKR
The API uses API tokens for authentication. Each developer is assigned a unique API token upon registration, which must be included in the headers of each request to authenticate the developer. Additionally, certain endpoints are restricted to specific services (e.g., product management, payment processes) and require a valid service token.
To get started with the E-commerce API, follow these steps:
-
Register a Developer: Use the
/register
endpoint to create a new developer account and obtain an API token. -
Authenticate and Retrieve API Token: Use the
/retrieve-token
endpoint to log in and retrieve your API token. -
Create an App: Use the
/create
endpoint to create a new App.
- Developer Management: Register and manage developer accounts.
- App Management: Create and manage apps.
- User Management: Sign up, sign in, and sign out users.
- Authentication: Secure API token-based authentication.
- Error Handling: Standard HTTP status codes for error handling.
- Rate Limiting: Prevent abuse with rate limiting.
- Node.js: Server-side JavaScript runtime.
- Express.js: Web application framework for Node.js.
- Prisma: ORM for database management.
- Nodemailer: Email sending library.
- JWT: JSON Web Tokens for authentication.
- bcrypt: Password hashing.
- Developer Registration: Developers register and receive an API token.
- App Creation: Developers create apps associated with their accounts.
- User Management: Users sign up, sign in, and sign out.
- Authentication: API tokens are used to authenticate requests.
- API Token Authentication: Secure access to endpoints using API tokens.
- Password Hashing: Secure storage of user passwords using bcrypt.
- JWT: Secure user sessions with JSON Web Tokens.
- Environment Variables: Secure configuration using environment variables.
The API uses standard HTTP status codes to indicate the success or failure of a request. Common status codes include:
- 200 OK: The request was successful.
- 201 Created: The resource was successfully created.
- 400 Bad Request: The request was invalid or missing required parameters.
- 401 Unauthorized: Authentication failed or the user does not have permissions for the requested operation.
- 403 Forbidden: The API token is invalid or inactive.
- 404 Not Found: The requested resource was not found.
- 500 Internal Server Error: An error occurred on the server.
To ensure fair usage and prevent abuse, the API enforces rate limits on requests. If you exceed the rate limit, you will receive a 429 Too Many Requests response. Please refer to the rate limit headers in the response for more details.
- POST /register: Register a new developer.
- POST /retrieve-token: Retrieve the developer's API token (login).
- GET /validate-token: Validate the developer's API token.
- POST /create: Create a single app.
- POST /create-multiple: Create multiple apps.
- POST /signup: Sign up a new user.
- POST /signin: Sign in an existing user.
- POST /logout: Sign out an existing user.
Each endpoint in the documentation includes example requests and responses to help you understand how to use the API effectively. You can use tools like Postman to test the endpoints and integrate them into your application.
If you have any questions or need further assistance, please contact our support team.
By following this overview, you should have a clear understanding of how to get started with the E-commerce API, the available endpoints, and how to authenticate and manage resources. This documentation aims to provide all the necessary information to integrate and use the API effectively.