Partners API
This API allows managing partners in the system. It provides endpoints to create, list, retrieve, and update partners, as well as perform specific operations such as obtaining the current partner.
The Partner Object
The Partner object represents a partner or collaborator in the system.
Attributes
| Attribute | Description | Type |
|---|---|---|
partnerId | Unique identifier of the partner | String (UUID) |
name | Legal name of the partner | String |
shortName | Short name of the partner for use in reports | String |
taxId | Tax identification of the partner | String |
email | Email address of the partner | String |
avatar | URL of the partner's avatar | String (URL) |
isAggregator | Indicates if the partner can manage other groups | Boolean |
status | Status of the partner (pending, enabled, disabled) | String |
createdAt | Date and time of partner creation | String (ISO 8601) |
updatedAt | Date and time of the last partner update | String (ISO 8601) |
Endpoints
List Partners
Retrieves a paginated list of partners with filtering and sorting options.
Query Parameters:
| Parameter | Description | Type |
|---|---|---|
name | Filter by partner name | String |
status | Filter by partner status | String |
is-aggregator | Filter by whether it is an aggregator or not | Boolean |
aggregator | Filter by aggregator ID | String |
tax-id | Filter by tax identification | String |
ids | List of partner IDs to filter | Array |
offset | Number of items to skip | Integer |
limit | Maximum number of items to return | Integer |
sort-direction | Sorting direction (asc or desc) | String |
page | Page number | Integer |
per-page | Items per page | Integer |
Successful Response:
Create a New Partner
Creates a new partner in the system.
Query Parameters:
| Parameter | Description | Type |
|---|---|---|
partner-id | Force ID of the new partner (optional) | String |
Request Body:
The request body must contain a JSON object with the following attributes:
| Attribute | Description | Type | Required |
|---|---|---|---|
name | Legal name of the partner | String | Yes |
shortName | Short name of the partner for use in reports | String | Yes |
taxId | Tax identification of the partner | String | Yes |
email | Email address of the partner | String | Yes |
avatar | URL of the partner's avatar | String | No |
isAggregator | Indicates if the partner can manage other groups | Boolean | No |
aggregator | ID of the aggregator partner (if applicable) | String | No |
Example Request:
Successful Response:
The response will be the complete Partner object created, including the assigned ID and other system-generated fields.
Get the Current Partner
Retrieves the information of the partner associated with the current user.
Successful Response:
The response will be the complete Partner object of the current user.
Get a Specific Partner
Retrieves the information of a specific partner by its ID.
Path Parameters:
| Parameter | Description |
|---|---|
partnerId | ID of the partner to retrieve |
Successful Response:
The response will be the complete Partner object of the requested partner.
Error Handling
The API may return the following error codes:
| Code | Description |
|---|---|
| 400 | Bad Request |
| 401 | Unauthorized |
| 404 | Not Found |
Errors will include a descriptive message in the response body.