Clients
1. Get Clients
Request
- Method:
GET
- Endpoint:
/clients
- Parameters:
filter
(optional): Filter clients by name, last name, or DNI.skip
(optional): Number of records to skip.limit
(optional): Maximum number of records to retrieve.orderBy
(optional): Property by which to order the results (e.g., “name”, “lastname”).desc
(optional): Set to true for descending order, false or omit for ascending order.
Example
Response
2. Get Client by ID
Request
- Method:
GET
- Endpoint:
/clients/{id}
- Parameters:
id
(required): ID of the client.
Example
Response
3. Add Client
Request
- Method:
POST
- Endpoint:
/clients
- Body:
name
(required): First name of the client.lastname
(required): Last name of the client.idcard
(required): Id Card (identification number) of the client.mail
(required): Email address of the client.
Example
Response
4. Update Client
Request
- Method:
PATCH
- Endpoint:
/clients
- Body:
id
(required): ID of the client to update.- Additional fields (optional): Updated values for
name
,lastname
,idcard
, ormail
.
Example
Response
5. Delete Client (Logic)
Request
- Method:
DELETE
- Endpoint:
/clients/{id}
- Parameters:
id
(required): ID of the client to delete.
Example
Response
6. Full Delete Client
Request
- Method:
DELETE
- Endpoint:
/clients/fulldelete/{id}
- Parameters:
id
(required): ID of the client to fully delete (including database removal).
Example
Response
Pagination and Filtering in Get Clients
When using the Get Clients
endpoint, you can apply
pagination and filtering to retrieve specific sets of data.
Pagination
- Use the
skip
parameter to skip a certain number of records. - Use the
limit
parameter to set the maximum number of records to retrieve.
Example:
This will skip the first 10 records and retrieve the next 5 records.
Filtering
- Use the
filter
parameter to filter clients by name, last name, or id card. - Use the
orderBy
parameter to specify the property by which to order the results. - Use the
desc
parameter to set the order as descending (true) or ascending (false).
Example:
This will filter clients with the last name “Doe” and order the results by the first name in ascending order.
Data Model
Attribute | Type | Description |
---|---|---|
id | Long | El ID del producto. |
name | String | El name del producto. |
last_name | String | La descripción del producto. |
id_card | String | El price del producto. |
String | La cantidad de stock del producto. | |
state | Byte | La URL de la imagen del producto. |
Validations
- Name: Minimum length of 3 characters.
- LastName: Minimum length of 3 characters.
- IdCard: Must have 8 digits.
- Mail: Valid email address. Must not exist in the database for other clients with a different ID and a non-zero state.