EMPLOYEE

Endpoints

Search employees

GET /employee

Description: Returns all registered employees, with the ability to filter by name, email, id, store, among others.

GET /public/employee?limit=100&external_store_id=EX123 HTTP/1.1
Host: api.solucx.com.br
x-solucx-api-key: YOUR_API_KEY
Accept: */*

Responses:

  • 200 OK: Returns a list of employees.

Create employee

POST /employee

Description: Creates a new employee.

POST /public/employee HTTP/1.1
Host: api.solucx.com.br
x-solucx-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*

{
  "employee_id": "EMP123",
  "name": "João",
  "email": "[email protected]",
  "store_id": "EX123"
}

Responses:

  • 200 OK: Employee successfully created.
  • 400 Bad Request: Invalid parameters.

Search employee by id

GET /employee/{id}

Description: Returns an employee by id.

GET /public/employee/{id} HTTP/1.1
Host: api.solucx.com.br
x-solucx-api-key: YOUR_API_KEY
Accept: */*

Responses:

  • 200 OK: Returns the employee.
  • 404 Not Found: Employee not found.

Edit employee

PUT /employee/{id}

Description: Edits an existing employee.

PUT /public/employee/{id} HTTP/1.1
Host: api.solucx.com.br
x-solucx-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*

{
  "name": "Novo Nome",
  "email": "[email protected]"
}

Responses:

  • 200 OK: Employee successfully edited.
  • 422 Unprocessable Entity: Invalid parameters.

Deactivate employee

DELETE /employee/{id}

Description: Deactivates an existing employee.

DELETE /public/employee/{id} HTTP/1.1
Host: api.solucx.com.br
x-solucx-api-key: YOUR_API_KEY
Accept: */*

Responses:

  • 200 OK: Employee successfully deactivated.
  • 422 Unprocessable Entity: Employee not found.

Listing units linked to the employee

GET /employee/{id}/stores

Descrição: By using the ID generated when creating the employee (internal ID), it is possible to know which units are linked to the employee.

GET /public/employee/{id}/stores HTTP/1.1
Host: api.solucx.com.br
x-solucx-api-key: YOUR_API_KEY
Accept: */*

Respostas:

  • 200 OK: Returns a list of employees.
  • 404 Not Found: Employee not found.

Edit the Relationship between Units and the Employee

PUT /employee/{ID}/stores

Descrição: You must use the ID generated during employee creation. Pass only the internal IDs of the units to associate with the employee. You must have access to the units you wish to modify (add or remove). The result of the request is the updated list of units linked to the employee.

PUT /public/employee/{id}/stores HTTP/1.1
Host: api.solucx.com.br
x-solucx-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 19

[
  123,
  1213,
  222,
  1423
]

Respostas:

  • 200 OK: Returns a list of employees.
  • 401 Not Authorized: Not authorized.
  • 404 Not Found: Employee not found.

Listing groups linked to the employee

GET /employee/{id}/groups

Descrição: By using the ID generated when creating the employee (internal ID), it is possible to know which groups are linked to the employee.

GET /public/employee/{id}/groups HTTP/1.1
Host: api.solucx.com.br
x-solucx-api-key: YOUR_API_KEY
Accept: */*

Respostas:

  • 200 OK: Returns a list of employees.
  • 404 Not Found: Employee not found.

Edit the Relationship between Groups and the Employee

PUT /employee/{id}/groups

Descrição: You must use the ID generated during employee creation. Pass only the internal group IDs to associate with the employee. You must have access to the groups you want to modify for the employee (add or remove). The result of the request is the updated list of groups linked to the employee.

PUT /public/employee/{id}/groups HTTP/1.1
Host: api.solucx.com.br
x-solucx-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 19

[
  123,
  1213,
  222,
  1423
]

Respostas:

  • 200 OK: Returns a list of employees.
  • 401 Not Authorized: Not authorized.
  • 404 Not Found: Employee not found.