Productys - PIMEX API
Customer definition
A customer is a company or a person, it can be linked to one or more projects.POST /customers
Requesting this endpoint will allow you to create or update the customer. To perform this operation, you must include all the parameters below. If the request of creation or update is succcessful you will have a response payload with the message "success" otherwise the result will be "error".
Data Parameters:
- id (String min-length=1 / max-length=64) : customer identifier, unique key, allows us to retrieve or create a unique customer with this id
- name (String min-length=1 / max-length=64) : customer name
- designation (String min-length=1 / max-length=128) : common designation of the customer
- description (String min-length=1 / max-length=1024) : customer description, not mandatory
- deliveryPostalCode (String min-length=1 / max-length=12) : customer delivery postal code
- deliveryAddress (String min-length=1 / max-length=255) : customer delivery address
- deliveryAddress2 (String min-length=1 / max-length=255) : customer delivery address 2, not mandatory
- billingPostalCode (String min-length=1 / max-length=12) : customer billing postal code
- billingAddress (String min-length=1 / max-length=255) : customer billing address
- billingAddress2 (String min-length=1 / max-length=255) : customer billing address 2, not mandatory
Request Payload:
{
"id": "1",
"name": "Customer Name",
"designation": "Customer Designation",
"description": "Customer Description",
"deliveryPostalCode": "75000",
"deliveryAddress": "1 rue de la Paix",
"deliveryAddress2": "Appartement 1",
"billingPostalCode": "75000",
"billingAddress": "1 rue de la Paix",
"billingAddress2": "Appartement 1"
}
Response:
If create/update is successful, the response will contain :
{
result: "success",
}
If create/update is not successful, the response will contain :
{
result: "error",
}
GET /customers/{id}
Retrieves the details of a specific customer based on the provided customer ID. It will return a 404 error if the customer is not found.
Path Parameters:
id(String) : The unique identifier of the customer. This is a required parameter.
Response:
If the customer is found, the response will contain the customer details in JSON format:
{
"id": "1",
"name": "Hyper-Ptys",
"designation": "Customer Designation",
"description": "Customer Description",
"deliveryPostalCode": "75000",
"deliveryAddress": "1 rue de la Paix",
"deliveryAddress2": "Appartement 1",
"billingPostalCode": "75000",
"billingAddress": "1 rue de la Paix",
"billingAddress2": "Appartement 1",
}
If the customer is not found, the response will return 404 Not Found.
GET /customers
Retrieves a list of customers with pagination support. It includes a "customers" array and also a the number of customers in the database.
Query Parameters:
- skip: The number of customers to skip before starting to fetch. Used for pagination. Default is 0.
- take: The number of customers to retrieve. Used for pagination. Default is 20 (max. 100).
Example: /customers?skip=20&take=10
Response:
The response will contain a list of customers in JSON format:
{
"customers": [
{
"id": "1",
"name": "Hyper-Ptys",
"designation": "Customer Designation",
"description": "Customer Description",
...
},
...
],
"totalCount": 30
}
If no customers are found, the response will be an empty array.
Project definition
A project constitutes a grouping and is linked to one and only one customer, and will include from 1 to N orders with no limit on quantity, themselves able to give rise to several orders, all linked to one and only one order. In the absence of any notion of file, and with the desire to use it, the customer's name can constitute the project, with sufficiently large default constraint dates.POST /projects
Requesting this endpoint will allow you to create or update the project of a specific customer. To perform this operation, you must include all the parameters below. If the request of creation or update is succcessful you will have a response payload with the message "success" otherwise the result will be "error".
Data Parameters:
- id (String min-length=1 / max-length=64) : project identifier, unique key, allows us to retrieve or create a unique project with this id
- customerId (String min-length=1 / max-length=64) : customer identifier, to link a project to a spectific customer
- name (String min-length=1 / max-length=64) : project name
- designation (String min-length=1 / max-length=128) : common designation of the project
- description (String min-length=1 / max-length=1024) : project description, not mandatory
- earliestStart (Date) : earliest project start date
- latestStart (Date) : latest project start date
- earliestEnd (Date) : earliest project end date
- latestEnd (Date) : latest project end date
- earliestConstraint (Date) : earliest constraint date
- latestConstraint (Date) : latest constraint date
- hDuration (Int min-hours=1 / max-hours=8760) : duration of the project
- allocatedHours (Int min-hours=1 / max-hours=8760) : number of hours allocated to the project
Request Payload:
{
"id": "1",
"customerId": "1",
"name": "Group001",
"designation": "Group Designation 001",
"description": "Group Description 001",
"earliestStart": "2023-08-22",
"latestStart": "2023-08-22",
"earliestEnd": "2023-08-24",
"latestEnd": "2023-08-24",
"earliestConstraint": "2023-08-22",
"latestConstraint": "2023-08-24",
"hDuration": 24,
"allocatedHours": 12
}
Response:
If create/update is successful, the response will contain :
{
result: "success",
}
If create/update is not successful, the response will contain :
{
result: "error",
}
GET /projects/{id}
Retrieves the details of a specific project based on the provided project ID. It will return a 404 error if the project is not found.
Path Parameters:
id(String) : The unique identifier of the project. This is a required parameter.
Response:
If the project is found, the response will contain the project details in JSON format:
{
"id": 2,
"customerId": "Hyper-Ptys",
"name": "Group002",
"designation": "Group Designation 002",
"earliestStart": "22-08-2023",
"latestStart": "22-08-2023",
"earliestEnd": "24-08-2023",
"latestEnd": "24-08-2023",
"earliestConstraint": "22-08-2023",
"latestConstraint": "24-08-2023",
"hDuration": 24,
"allocatedHours": 12,
"realStart": "2023-08-30T10:29:37",
"realEnd": "",
"progress": 0,
"consumedHours": 0,
"remaningHours": 0
}
If the project is not found, the response will return 404 Not Found.
GET /projects
Retrieves a list of projects with pagination support. It includes a "projects" array and also a the number of projects in the database.
Query Parameters:
- skip: The number of projects to skip before starting to fetch. Used for pagination. Default is 0.
- take: The number of projects to retrieve. Used for pagination. Default is 20 (max. 100).
Example: /projects?skip=20&take=10
Response:
The response will contain a list of projects in JSON format:
{
"projects": [
{
"id": "1",
"customerId": "1",
"name": "Group001",
...
},
...
],
"totalCount": 200
}
If no projects are found, the response will be an empty array.
Copyright ©
Productys