Welcome to the documentation of the Sales API. This API provides endpoints to manage companies, customers, projects, products, orders, document types, document series, and sales documents.
- Node.js
- npm (or yarn)
- Postman (for testing requests)
- Clone the repository:
git clone https://github.com/your-username/your-repository.git
cd your-repository
- Install dependencies:
npm install
# or
yarn install
- Configure environment variables:
Create a .env
file in the root of your project and add the following variables:
PORT=5000
- Start the server:
node src/server.js
The API will be available at http://localhost:5000.
The server.ts
file contains the code to set up and start the Express server. Here is an overview of
the file:
/* Add the TypeScript code here */
This API uses Bearer token authentication. Include the access token in authorized requests. An example token is provided below:
{
"token": "AAAAAAAAAA",
"type": "string"
}
- Endpoint:
GET /api/base/companies
- Request:
- Method: GET
- Authentication: Bearer Token
- Example:
curl -X GET -H "Authorization: Bearer YOUR_TOKEN" http://localhost:5000/api/base/companies