MENU navbar-image

Introduction

This documentation aims to provide all the information you need to work with our API.

<aside>As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile).
You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).</aside>

Authenticating requests

To authenticate requests, include an Authorization header with the value "Bearer your-token".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

ACL

Endpoints for managing roles and permissions.

Roles

Endpoints for managing roles.

List

requires authentication role index

List roles.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/acl/roles?q=Role+name" \
    --header "Authorization: Bearer cED66P5fb8V1g4av3kZdhea" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/acl/roles"
);

const params = {
    "q": "Role name",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer cED66P5fb8V1g4av3kZdhea",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "d28d0fb9-679c-338c-811d-b9efd9afe1e2",
            "name": "rerum-6aeddb57e347f",
            "display_name": "Ut occaecati nobis occaecati nihil.",
            "permissions_count": null
        },
        {
            "id": "2b05d563-ab58-3144-8bbb-763cdfc09643",
            "name": "eum-6aeddb57e6323",
            "display_name": "Dolores maiores dicta esse quaerat et iste.",
            "permissions_count": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/acl/roles

Headers

Authorization        

Example: Bearer cED66P5fb8V1g4av3kZdhea

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

q   string  optional    

Search query. Example: Role name

Create

requires authentication role store

Create a new role.

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/acl/roles" \
    --header "Authorization: Bearer aPEgkvfdcbhZ4636eD1aV85" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"display_name\": \"Example Name\",
    \"permissions\": [
        \"cb92d89a-a6a1-3511-9986-2993c522d1e6\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/acl/roles"
);

const headers = {
    "Authorization": "Bearer aPEgkvfdcbhZ4636eD1aV85",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "display_name": "Example Name",
    "permissions": [
        "cb92d89a-a6a1-3511-9986-2993c522d1e6"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "string"
}
 

Request      

POST api/acl/roles

Headers

Authorization        

Example: Bearer aPEgkvfdcbhZ4636eD1aV85

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Name. Example: Example Name

display_name   string     

Display name. Example: Example Name

permissions   string[]  optional    

Permissions *. The uuid of an existing record in the permissions table.

Update

requires authentication role update

Update a role.

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/acl/roles/1" \
    --header "Authorization: Bearer kEf1hdv68Zag4V536bacPDe" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"display_name\": \"Example Name\",
    \"permissions\": [
        \"27a39612-83ec-321f-a1cc-4f9d4bb7e7b0\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/acl/roles/1"
);

const headers = {
    "Authorization": "Bearer kEf1hdv68Zag4V536bacPDe",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "display_name": "Example Name",
    "permissions": [
        "27a39612-83ec-321f-a1cc-4f9d4bb7e7b0"
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "string"
}
 

Request      

PUT api/acl/roles/{id}

Headers

Authorization        

Example: Bearer kEf1hdv68Zag4V536bacPDe

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the role. Example: 1

Body Parameters

name   string  optional    

Name. Example: Example Name

display_name   string  optional    

Display name. Example: Example Name

permissions   string[]  optional    

Permissions *. The uuid of an existing record in the permissions table.

Show

requires authentication role show

Show a role.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/acl/roles/1" \
    --header "Authorization: Bearer Pf5caa81h6evVD6bgkE34Zd" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/acl/roles/1"
);

const headers = {
    "Authorization": "Bearer Pf5caa81h6evVD6bgkE34Zd",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "5c9f0788-b6c5-35ae-aebc-cadf1eca30ca",
        "name": "non-6aeddb57f02e0",
        "display_name": "Ipsum eaque hic earum quidem dolorem saepe numquam.",
        "permissions_count": null
    }
}
 

Request      

GET api/acl/roles/{id}

Headers

Authorization        

Example: Bearer Pf5caa81h6evVD6bgkE34Zd

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the role. Example: 1

Role Permissions

requires authentication role show

List permissions associated with a role.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/acl/roles/1/permissions" \
    --header "Authorization: Bearer kf48dDv135Zb6g6hEePVaac" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/acl/roles/1/permissions"
);

const headers = {
    "Authorization": "Bearer kf48dDv135Zb6g6hEePVaac",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": null,
            "name": "nobis",
            "display_name": "Assumenda ratione voluptas porro voluptate rerum et."
        },
        {
            "id": null,
            "name": "sapiente",
            "display_name": "Dolorem consequatur aut fugit accusantium incidunt est."
        }
    ]
}
 

Request      

GET api/acl/roles/{role}/permissions

Headers

Authorization        

Example: Bearer kf48dDv135Zb6g6hEePVaac

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

role   integer     

The role. Example: 1

Delete

requires authentication role delete

Delete a role.

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/acl/roles/1" \
    --header "Authorization: Bearer V8a6fdvhPbDea6135ZkcEg4" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/acl/roles/1"
);

const headers = {
    "Authorization": "Bearer V8a6fdvhPbDea6135ZkcEg4",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/acl/roles/{role}

Headers

Authorization        

Example: Bearer V8a6fdvhPbDea6135ZkcEg4

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

role   integer     

The role. Example: 1

Permissions

Endpoints for managing permissions.

List

requires authentication permission index

List permissions.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/acl/permissions?q=Permission+name" \
    --header "Authorization: Bearer dhbPkfE5D6Zc8v16egaVa34" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/acl/permissions"
);

const params = {
    "q": "Permission name",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer dhbPkfE5D6Zc8v16egaVa34",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": null,
            "name": "illo",
            "display_name": "Totam dolor eius doloremque magnam odio."
        },
        {
            "id": null,
            "name": "fugiat",
            "display_name": "Accusamus consectetur fuga qui dolorum sed ducimus maxime architecto."
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/acl/permissions

Headers

Authorization        

Example: Bearer dhbPkfE5D6Zc8v16egaVa34

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

q   string  optional    

Search query. Example: Permission name

Create

requires authentication permission store

Create a new permission.

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/acl/permissions" \
    --header "Authorization: Bearer 1faDZ8e56d3VEcgb4vkhPa6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"display_name\": \"Example Name\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/acl/permissions"
);

const headers = {
    "Authorization": "Bearer 1faDZ8e56d3VEcgb4vkhPa6",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "display_name": "Example Name"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "string"
}
 

Request      

POST api/acl/permissions

Headers

Authorization        

Example: Bearer 1faDZ8e56d3VEcgb4vkhPa6

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Name. Example: Example Name

display_name   string     

Display name. Example: Example Name

Update

requires authentication permission update

Update a permission.

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/acl/permissions/1" \
    --header "Authorization: Bearer E8V6bafhD4Zckav5ePd6g13" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"display_name\": \"Example Name\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/acl/permissions/1"
);

const headers = {
    "Authorization": "Bearer E8V6bafhD4Zckav5ePd6g13",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "display_name": "Example Name"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "string"
}
 

Request      

PUT api/acl/permissions/{id}

Headers

Authorization        

Example: Bearer E8V6bafhD4Zckav5ePd6g13

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the permission. Example: 1

Body Parameters

name   string  optional    

Name. Example: Example Name

display_name   string  optional    

Display name. Example: Example Name

Show

requires authentication permission show

Show a permission.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/acl/permissions/1" \
    --header "Authorization: Bearer 3h5eDVc1P668dfkZ4gavbEa" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/acl/permissions/1"
);

const headers = {
    "Authorization": "Bearer 3h5eDVc1P668dfkZ4gavbEa",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": null,
        "name": "sit",
        "display_name": "Enim sunt quae unde quibusdam illo et doloribus."
    }
}
 

Request      

GET api/acl/permissions/{id}

Headers

Authorization        

Example: Bearer 3h5eDVc1P668dfkZ4gavbEa

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the permission. Example: 1

Delete

requires authentication permission delete

Delete a permission.

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/acl/permissions/1" \
    --header "Authorization: Bearer DaE1Pbe45vg6d6hcVa3kfZ8" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/acl/permissions/1"
);

const headers = {
    "Authorization": "Bearer DaE1Pbe45vg6d6hcVa3kfZ8",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/acl/permissions/{permission}

Headers

Authorization        

Example: Bearer DaE1Pbe45vg6d6hcVa3kfZ8

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

permission   integer     

The permission. Example: 1

Accounts Payable Receivable

Endpoints for accounts payable receivable

List reminders for accounts payable receivable

requires authentication accounts-payable-receivable reminder

List reminders for accounts payable receivable that are about to expire soon

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/accounts-payable-receivable/reminders" \
    --header "Authorization: Bearer 5ve38PbhDaEa4k6fcd6VgZ1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/accounts-payable-receivable/reminders"
);

const headers = {
    "Authorization": "Bearer 5ve38PbhDaEa4k6fcd6VgZ1",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "284915a2-2cf3-3539-b42f-104ddcaff458",
            "code": null,
            "type": "saída",
            "payment_method": "boleto",
            "amount": 8146.55,
            "due_date": "2026-11-20T03:00:00.000000Z",
            "status": null,
            "payment_date": null,
            "protest_date": null,
            "paid_amount": null,
            "interest_amount": null,
            "penalty_amount": null,
            "notary_fee_amount": null,
            "description": "Id assumenda magnam aspernatur et ut fugit sed.",
            "is_recurring": null,
            "recurrence_config": null,
            "parent_id": null,
            "recurrence_order": 1,
            "total_recurrences": null,
            "children_count": 0,
            "remaining_recurrences": null,
            "has_children": false,
            "field1": "quia",
            "field2": 95,
            "field3": true,
            "notes": "Ut rem porro odio sunt saepe dolor recusandae.",
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "01a9c2d4-5247-31d5-b81b-f5f04290f0d7",
            "code": null,
            "type": "entrada",
            "payment_method": "boleto",
            "amount": 4672.84,
            "due_date": "2026-12-02T03:00:00.000000Z",
            "status": null,
            "payment_date": null,
            "protest_date": null,
            "paid_amount": null,
            "interest_amount": null,
            "penalty_amount": null,
            "notary_fee_amount": null,
            "description": "Amet neque odio voluptas qui expedita quas.",
            "is_recurring": null,
            "recurrence_config": null,
            "parent_id": null,
            "recurrence_order": 1,
            "total_recurrences": null,
            "children_count": 0,
            "remaining_recurrences": null,
            "has_children": false,
            "field1": "consequatur",
            "field2": 4,
            "field3": true,
            "notes": "Ut cum nihil sit est.",
            "created_at": null,
            "updated_at": null
        }
    ]
}
 

Request      

GET api/accounts-payable-receivable/reminders

Headers

Authorization        

Example: Bearer 5ve38PbhDaEa4k6fcd6VgZ1

Content-Type        

Example: application/json

Accept        

Example: application/json

Mark reminders as read

requires authentication accounts-payable-receivable reminder

Mark reminders for accounts payable receivable as read

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/accounts-payable-receivable/reminders/mark-as-read?items[]=qui" \
    --header "Authorization: Bearer bEe3kagDZda6hv85f4c6V1P" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/accounts-payable-receivable/reminders/mark-as-read"
);

const params = {
    "items[0]": "qui",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer bEe3kagDZda6hv85f4c6V1P",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "string"
}
 

Request      

POST api/accounts-payable-receivable/reminders/mark-as-read

Headers

Authorization        

Example: Bearer bEe3kagDZda6hv85f4c6V1P

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

items   string[]     

The uuid of an existing record in the account_payable_receivables table.

Get protest summary

requires authentication accounts-payable-receivable index

Get summary of accounts with protest status

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/accounts-payable-receivable/protests/summary" \
    --header "Authorization: Bearer 341va5P6fEDeVbcgka8Z6hd" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/accounts-payable-receivable/protests/summary"
);

const headers = {
    "Authorization": "Bearer 341va5P6fEDeVbcgka8Z6hd",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "to_protest_count": "integer",
    "protested_count": "integer",
    "protesting_today_count": "integer",
    "total_protest_amount": "float"
}
 

Request      

GET api/accounts-payable-receivable/protests/summary

Headers

Authorization        

Example: Bearer 341va5P6fEDeVbcgka8Z6hd

Content-Type        

Example: application/json

Accept        

Example: application/json

List protested accounts

requires authentication accounts-payable-receivable index

List accounts with protest date that are not paid/canceled

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/accounts-payable-receivable/protests?sort_by=created_at&sort_desc=1&page=1&per_page=10&q=Salary&code=CPR-000123&type=entrada&customers[]=numquam&suppliers[]=voluptatum&works[]=in&cost_centers[]=inventore&statuses[]=a+vencer&payment_method=cheque&date_start=2023-01-01&date_end=2023-12-31&protest_date_start=2026-11-06T10%3A51%3A20&protest_date_end=2026-11-06T10%3A51%3A20&has_protest=1&has_children=1&is_recurring=1" \
    --header "Authorization: Bearer hVb8ga315fkvP46EdeaZcD6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/accounts-payable-receivable/protests"
);

const params = {
    "sort_by": "created_at",
    "sort_desc": "1",
    "page": "1",
    "per_page": "10",
    "q": "Salary",
    "code": "CPR-000123",
    "type": "entrada",
    "customers[0]": "numquam",
    "suppliers[0]": "voluptatum",
    "works[0]": "in",
    "cost_centers[0]": "inventore",
    "statuses[0]": "a vencer",
    "payment_method": "cheque",
    "date_start": "2023-01-01",
    "date_end": "2023-12-31",
    "protest_date_start": "2026-11-06T10:51:20",
    "protest_date_end": "2026-11-06T10:51:20",
    "has_protest": "1",
    "has_children": "1",
    "is_recurring": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer hVb8ga315fkvP46EdeaZcD6",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "d597e3e5-cc71-32ed-9b56-5461d37c2e3a",
            "code": null,
            "type": "saída",
            "payment_method": "cheque",
            "amount": 4110.52,
            "due_date": "2026-12-04T03:00:00.000000Z",
            "status": null,
            "payment_date": null,
            "protest_date": null,
            "paid_amount": null,
            "interest_amount": null,
            "penalty_amount": null,
            "notary_fee_amount": null,
            "description": "Nisi consectetur aliquam et temporibus vel facilis iure.",
            "is_recurring": null,
            "recurrence_config": null,
            "parent_id": null,
            "recurrence_order": 1,
            "total_recurrences": null,
            "children_count": 0,
            "remaining_recurrences": null,
            "has_children": false,
            "field1": "reiciendis",
            "field2": 41,
            "field3": false,
            "notes": "Inventore consequatur sequi qui.",
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "e085d740-62d8-393f-a855-ea815ca616eb",
            "code": null,
            "type": "entrada",
            "payment_method": "boleto",
            "amount": 4562.11,
            "due_date": "2026-11-16T03:00:00.000000Z",
            "status": null,
            "payment_date": null,
            "protest_date": null,
            "paid_amount": null,
            "interest_amount": null,
            "penalty_amount": null,
            "notary_fee_amount": null,
            "description": "Laborum cumque eos tempora excepturi minus est et quisquam quos.",
            "is_recurring": null,
            "recurrence_config": null,
            "parent_id": null,
            "recurrence_order": 1,
            "total_recurrences": null,
            "children_count": 0,
            "remaining_recurrences": null,
            "has_children": false,
            "field1": "ab",
            "field2": 13,
            "field3": true,
            "notes": "Aut ut sit sed ipsa at quis.",
            "created_at": null,
            "updated_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/accounts-payable-receivable/protests

Headers

Authorization        

Example: Bearer hVb8ga315fkvP46EdeaZcD6

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

sort_by   string  optional    

Field to sort by. Example: created_at

sort_desc   boolean  optional    

Sort order (true for descending, false for ascending). Example: true

page   integer  optional    

Page number. O campo value deve ser pelo menos 1. Example: 1

per_page   integer  optional    

Items per page. O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 10

q   string  optional    

Search query. Example: Salary

code   string  optional    

Filter by account code. Example: CPR-000123

type   string  optional    

Type. Example: entrada

Must be one of:
  • entrada
  • saída
customers   string[]  optional    

The uuid of an existing record in the customers table.

suppliers   string[]  optional    

The uuid of an existing record in the suppliers table.

works   string[]  optional    

The uuid of an existing record in the works table.

cost_centers   string[]  optional    

The uuid of an existing record in the cost_centers table.

statuses   string[]  optional    
Must be one of:
  • a vencer
  • pago
  • pago_sem_lancamento
  • vencido
  • recebido
  • cancelado
  • a protestar
  • protestado
payment_method   string  optional    

Payment method. Example: cheque

Must be one of:
  • cheque
  • boleto
  • pix
  • cartao
  • outro
date_start   string  optional    

Start date. O campo value deve ser uma data válida. Example: 2023-01-01

date_end   string  optional    

End date. O campo value deve ser uma data válida. Example: 2023-12-31

protest_date_start   string  optional    

O campo value deve ser uma data válida. Example: 2026-11-06T10:51:20

protest_date_end   string  optional    

O campo value deve ser uma data válida. Example: 2026-11-06T10:51:20

has_protest   boolean  optional    

Example: true

has_children   boolean  optional    

Filter accounts that have recurring children. Example: true

is_recurring   boolean  optional    

Filter by recurring status (true: only recurring, false: only non-recurring, null: all). Example: true

List accounts payable receivable

requires authentication accounts-payable-receivable index

List all accounts payable receivable

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/accounts-payable-receivable?sort_by=created_at&sort_desc=1&page=1&per_page=10&q=Salary&code=CPR-000123&type=entrada&customers[]=esse&suppliers[]=reiciendis&works[]=debitis&cost_centers[]=consequatur&statuses[]=protestado&payment_method=cheque&date_start=2023-01-01&date_end=2023-12-31&protest_date_start=2026-11-06T10%3A51%3A20&protest_date_end=2026-11-06T10%3A51%3A20&has_protest=&has_children=1&is_recurring=1" \
    --header "Authorization: Bearer akDfbZd5cVghea13866PEv4" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/accounts-payable-receivable"
);

const params = {
    "sort_by": "created_at",
    "sort_desc": "1",
    "page": "1",
    "per_page": "10",
    "q": "Salary",
    "code": "CPR-000123",
    "type": "entrada",
    "customers[0]": "esse",
    "suppliers[0]": "reiciendis",
    "works[0]": "debitis",
    "cost_centers[0]": "consequatur",
    "statuses[0]": "protestado",
    "payment_method": "cheque",
    "date_start": "2023-01-01",
    "date_end": "2023-12-31",
    "protest_date_start": "2026-11-06T10:51:20",
    "protest_date_end": "2026-11-06T10:51:20",
    "has_protest": "0",
    "has_children": "1",
    "is_recurring": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer akDfbZd5cVghea13866PEv4",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "aabb6170-726b-33f0-a77e-cde105989f62",
            "code": null,
            "type": "saída",
            "payment_method": "boleto",
            "amount": 7745.78,
            "due_date": "2026-12-06T03:00:00.000000Z",
            "status": null,
            "payment_date": null,
            "protest_date": null,
            "paid_amount": null,
            "interest_amount": null,
            "penalty_amount": null,
            "notary_fee_amount": null,
            "description": "In voluptatem doloremque et voluptas aut est tenetur modi animi voluptas laboriosam modi et.",
            "is_recurring": null,
            "recurrence_config": null,
            "parent_id": null,
            "recurrence_order": 1,
            "total_recurrences": null,
            "children_count": 0,
            "remaining_recurrences": null,
            "has_children": false,
            "field1": "perspiciatis",
            "field2": 11,
            "field3": true,
            "notes": "Vel omnis eum ex corrupti et.",
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "7b166a49-4708-357f-b397-333282ee2436",
            "code": null,
            "type": "saída",
            "payment_method": "boleto",
            "amount": 7503.91,
            "due_date": "2026-11-15T03:00:00.000000Z",
            "status": null,
            "payment_date": null,
            "protest_date": null,
            "paid_amount": null,
            "interest_amount": null,
            "penalty_amount": null,
            "notary_fee_amount": null,
            "description": "Dolor consequatur et et consequuntur facilis ut.",
            "is_recurring": null,
            "recurrence_config": null,
            "parent_id": null,
            "recurrence_order": 1,
            "total_recurrences": null,
            "children_count": 0,
            "remaining_recurrences": null,
            "has_children": false,
            "field1": "harum",
            "field2": 28,
            "field3": false,
            "notes": "Placeat eos dolores ab rerum vel.",
            "created_at": null,
            "updated_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/accounts-payable-receivable

Headers

Authorization        

Example: Bearer akDfbZd5cVghea13866PEv4

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

sort_by   string  optional    

Field to sort by. Example: created_at

sort_desc   boolean  optional    

Sort order (true for descending, false for ascending). Example: true

page   integer  optional    

Page number. O campo value deve ser pelo menos 1. Example: 1

per_page   integer  optional    

Items per page. O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 10

q   string  optional    

Search query. Example: Salary

code   string  optional    

Filter by account code. Example: CPR-000123

type   string  optional    

Type. Example: entrada

Must be one of:
  • entrada
  • saída
customers   string[]  optional    

The uuid of an existing record in the customers table.

suppliers   string[]  optional    

The uuid of an existing record in the suppliers table.

works   string[]  optional    

The uuid of an existing record in the works table.

cost_centers   string[]  optional    

The uuid of an existing record in the cost_centers table.

statuses   string[]  optional    
Must be one of:
  • a vencer
  • pago
  • pago_sem_lancamento
  • vencido
  • recebido
  • cancelado
  • a protestar
  • protestado
payment_method   string  optional    

Payment method. Example: cheque

Must be one of:
  • cheque
  • boleto
  • pix
  • cartao
  • outro
date_start   string  optional    

Start date. O campo value deve ser uma data válida. Example: 2023-01-01

date_end   string  optional    

End date. O campo value deve ser uma data válida. Example: 2023-12-31

protest_date_start   string  optional    

O campo value deve ser uma data válida. Example: 2026-11-06T10:51:20

protest_date_end   string  optional    

O campo value deve ser uma data válida. Example: 2026-11-06T10:51:20

has_protest   boolean  optional    

Example: false

has_children   boolean  optional    

Filter accounts that have recurring children. Example: true

is_recurring   boolean  optional    

Filter by recurring status (true: only recurring, false: only non-recurring, null: all). Example: true

Create accounts payable receivable

requires authentication accounts-payable-receivable store

Create a new accounts payable receivable

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/accounts-payable-receivable" \
    --header "Authorization: Bearer EckbvgV365e14dPf8ZDaah6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"type\": \"Example Type\",
    \"payment_method\": \"Example Payment method\",
    \"due_date\": \"2024-01-01\",
    \"amount\": 1,
    \"description\": \"Example Description\",
    \"supplier_id\": \"afd6c5a5-322c-36c3-9c39-23403534d6ab\",
    \"customer_id\": \"157396e0-8d39-3966-915b-6df88a9e16e9\",
    \"work_id\": \"5cb18f70-e176-3cb7-bc90-1653eee9a26c\",
    \"cost_center_id\": \"85b14638-82dc-3ea0-8a02-4d75ad8c8249\",
    \"status\": \"Example Status\",
    \"protest_date\": \"2024-01-01\",
    \"bank_account_id\": \"44eb385c-5a29-3b26-ab46-daaf2d010475\",
    \"custom_fields\": [
        \"example1\",
        \"example2\"
    ],
    \"is_recurring\": true,
    \"recurrence_config\": {
        \"0\": \"example1\",
        \"1\": \"example2\",
        \"frequency_type\": \"Example Recurrence config frequency type\",
        \"frequency_value\": 1,
        \"end_date\": \"2024-01-01\",
        \"max_occurrences\": 1,
        \"generation_days_ahead\": 1
    }
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/accounts-payable-receivable"
);

const headers = {
    "Authorization": "Bearer EckbvgV365e14dPf8ZDaah6",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "type": "Example Type",
    "payment_method": "Example Payment method",
    "due_date": "2024-01-01",
    "amount": 1,
    "description": "Example Description",
    "supplier_id": "afd6c5a5-322c-36c3-9c39-23403534d6ab",
    "customer_id": "157396e0-8d39-3966-915b-6df88a9e16e9",
    "work_id": "5cb18f70-e176-3cb7-bc90-1653eee9a26c",
    "cost_center_id": "85b14638-82dc-3ea0-8a02-4d75ad8c8249",
    "status": "Example Status",
    "protest_date": "2024-01-01",
    "bank_account_id": "44eb385c-5a29-3b26-ab46-daaf2d010475",
    "custom_fields": [
        "example1",
        "example2"
    ],
    "is_recurring": true,
    "recurrence_config": {
        "0": "example1",
        "1": "example2",
        "frequency_type": "Example Recurrence config frequency type",
        "frequency_value": 1,
        "end_date": "2024-01-01",
        "max_occurrences": 1,
        "generation_days_ahead": 1
    }
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "string"
}
 

Request      

POST api/accounts-payable-receivable

Headers

Authorization        

Example: Bearer EckbvgV365e14dPf8ZDaah6

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

type   string     

Tipo. Example: Example Type

Must be one of:
  • entrada
  • saída
payment_method   string     

Forma de pagamento. Example: Example Payment method

Must be one of:
  • cheque
  • boleto
  • pix
  • cartao
  • outro
due_date   string     

Data de vencimento. O campo value deve ser uma data válida. Example: 2024-01-01

amount   number     

Valor. Example: 1

description   string     

Descrição. Example: Example Description

supplier_id   string  optional    

Fornecedor. The uuid of an existing record in the suppliers table. Example: afd6c5a5-322c-36c3-9c39-23403534d6ab

customer_id   string  optional    

Cliente. The uuid of an existing record in the customers table. Example: 157396e0-8d39-3966-915b-6df88a9e16e9

work_id   string  optional    

Obra. The uuid of an existing record in the works table. Example: 5cb18f70-e176-3cb7-bc90-1653eee9a26c

cost_center_id   string     

Cost center id. The uuid of an existing record in the cost_centers table. Example: 85b14638-82dc-3ea0-8a02-4d75ad8c8249

status   string  optional    

Status. Example: Example Status

Must be one of:
  • a vencer
  • pago
  • vencido
  • recebido
  • cancelado
  • a protestar
  • protestado
protest_date   string  optional    

Protest date. O campo value deve ser uma data válida. O campo value deve ser uma data posterior ou igual a due_date. Example: 2024-01-01

bank_account_id   string  optional    

Bank account id. The uuid of an existing record in the bank_accounts table. Example: 44eb385c-5a29-3b26-ab46-daaf2d010475

custom_fields   object  optional    

Custom fields.

is_recurring   boolean  optional    

Is recurring. Example: true

recurrence_config   object  optional    

Recurrence config.

frequency_type   string  optional    

Recurrence config frequency type. Example: Example Recurrence config frequency type

Must be one of:
  • monthly
  • weekly
  • biweekly
  • yearly
frequency_value   integer  optional    

Recurrence config frequency value. O campo value deve ser pelo menos 0. O campo value não pode ser superior a 31. Example: 1

end_date   string  optional    

Recurrence config end date. O campo value deve ser uma data válida. O campo value deve ser uma data posterior a due_date. Example: 2024-01-01

max_occurrences   integer  optional    

Recurrence config max occurrences. O campo value deve ser pelo menos 1. Example: 1

generation_days_ahead   integer  optional    

Recurrence config generation days ahead. O campo value deve ser pelo menos 1. O campo value não pode ser superior a 30. Example: 1

Import NFe installments

requires authentication accounts-payable-receivable import-nfe

Gera contas a pagar para as parcelas selecionadas de uma nota fiscal. A obra é opcional: quando omitida, só é herdada se a NF tiver exatamente uma obra vinculada.

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/accounts-payable-receivable/import-nfe" \
    --header "Authorization: Bearer akDaZgefEh63VP16vdc8b54" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"fiscal_document_id\": \"vel\",
    \"installment_ids\": [
        \"sed\"
    ],
    \"payment_method\": \"cartao\",
    \"work_id\": \"tempore\",
    \"cost_center_id\": \"quia\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/accounts-payable-receivable/import-nfe"
);

const headers = {
    "Authorization": "Bearer akDaZgefEh63VP16vdc8b54",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "fiscal_document_id": "vel",
    "installment_ids": [
        "sed"
    ],
    "payment_method": "cartao",
    "work_id": "tempore",
    "cost_center_id": "quia"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "string",
    "total": "integer"
}
 

Request      

POST api/accounts-payable-receivable/import-nfe

Headers

Authorization        

Example: Bearer akDaZgefEh63VP16vdc8b54

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

fiscal_document_id   string     

The uuid of an existing record in the fiscal_documents table. Example: vel

installment_ids   string[]  optional    

The uuid of an existing record in the fiscal_document_installments table.

payment_method   string  optional    

Example: cartao

Must be one of:
  • cheque
  • boleto
  • pix
  • cartao
  • outro
work_id   string  optional    

The uuid of an existing record in the works table. Example: tempore

cost_center_id   string  optional    

The uuid of an existing record in the cost_centers table. Example: quia

Get account history

requires authentication accounts-payable-receivable show

Get the activity log history for an account payable receivable

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/accounts-payable-receivable/voluptas/history" \
    --header "Authorization: Bearer PfgZD3eEhv5ak661Vcad8b4" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/accounts-payable-receivable/voluptas/history"
);

const headers = {
    "Authorization": "Bearer PfgZD3eEhv5ak661Vcad8b4",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/accounts-payable-receivable/{accountPayableReceivable}/history

Headers

Authorization        

Example: Bearer PfgZD3eEhv5ak661Vcad8b4

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

accountPayableReceivable   string     

Example: voluptas

Get accounts payable receivable

requires authentication accounts-payable-receivable show

Get an accounts payable receivable

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/accounts-payable-receivable/minus" \
    --header "Authorization: Bearer 66eh8ZEb3aadcVP54k1Dfgv" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/accounts-payable-receivable/minus"
);

const headers = {
    "Authorization": "Bearer 66eh8ZEb3aadcVP54k1Dfgv",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "d72781dc-879a-3186-be83-df9fa2cf68cc",
        "code": null,
        "type": "saída",
        "payment_method": "cheque",
        "amount": 8192.21,
        "due_date": "2026-11-26T03:00:00.000000Z",
        "status": null,
        "payment_date": null,
        "protest_date": null,
        "paid_amount": null,
        "interest_amount": null,
        "penalty_amount": null,
        "notary_fee_amount": null,
        "description": "Quia incidunt velit laboriosam doloribus sed illo occaecati.",
        "is_recurring": null,
        "recurrence_config": null,
        "parent_id": null,
        "recurrence_order": 1,
        "total_recurrences": null,
        "children_count": 0,
        "remaining_recurrences": null,
        "has_children": false,
        "field1": "qui",
        "field2": 100,
        "field3": true,
        "notes": "Nisi at qui quis soluta laudantium.",
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/accounts-payable-receivable/{accountPayableReceivable}

Headers

Authorization        

Example: Bearer 66eh8ZEb3aadcVP54k1Dfgv

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

accountPayableReceivable   string     

Example: minus

Update accounts payable receivable

requires authentication accounts-payable-receivable update

Update an accounts payable receivable

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/accounts-payable-receivable/consequatur" \
    --header "Authorization: Bearer akvP3VE6g6cedZ8hfba415D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"type\": \"Example Type\",
    \"payment_method\": \"Example Payment method\",
    \"due_date\": \"2024-01-01\",
    \"amount\": 1,
    \"description\": \"Example Description\",
    \"supplier_id\": \"1c9a561e-9702-3dbd-83d3-2bf826980375\",
    \"customer_id\": \"fb755c7d-615d-352e-aca2-53d5d1256cd7\",
    \"work_id\": \"90f15a1b-3308-3aa3-b508-48d29d057ca2\",
    \"cost_center_id\": \"a4b8dfd6-f59f-3aa0-b67f-78983c31fb81\",
    \"status\": \"Example Status\",
    \"payment_date\": \"2024-01-01\",
    \"protest_date\": \"2024-01-01\",
    \"paid_amount\": 1,
    \"interest_amount\": 1,
    \"penalty_amount\": 1,
    \"notary_fee_amount\": 1,
    \"bank_account_id\": \"111c1346-1b36-3957-941f-dd86a68183b4\",
    \"custom_fields\": [
        \"example1\",
        \"example2\"
    ],
    \"is_recurring\": true,
    \"recurrence_config\": {
        \"0\": \"example1\",
        \"1\": \"example2\",
        \"frequency_type\": \"Example Recurrence config frequency type\",
        \"frequency_value\": 1,
        \"end_date\": \"2024-01-01\",
        \"max_occurrences\": 1,
        \"generation_days_ahead\": 1
    }
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/accounts-payable-receivable/consequatur"
);

const headers = {
    "Authorization": "Bearer akvP3VE6g6cedZ8hfba415D",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "type": "Example Type",
    "payment_method": "Example Payment method",
    "due_date": "2024-01-01",
    "amount": 1,
    "description": "Example Description",
    "supplier_id": "1c9a561e-9702-3dbd-83d3-2bf826980375",
    "customer_id": "fb755c7d-615d-352e-aca2-53d5d1256cd7",
    "work_id": "90f15a1b-3308-3aa3-b508-48d29d057ca2",
    "cost_center_id": "a4b8dfd6-f59f-3aa0-b67f-78983c31fb81",
    "status": "Example Status",
    "payment_date": "2024-01-01",
    "protest_date": "2024-01-01",
    "paid_amount": 1,
    "interest_amount": 1,
    "penalty_amount": 1,
    "notary_fee_amount": 1,
    "bank_account_id": "111c1346-1b36-3957-941f-dd86a68183b4",
    "custom_fields": [
        "example1",
        "example2"
    ],
    "is_recurring": true,
    "recurrence_config": {
        "0": "example1",
        "1": "example2",
        "frequency_type": "Example Recurrence config frequency type",
        "frequency_value": 1,
        "end_date": "2024-01-01",
        "max_occurrences": 1,
        "generation_days_ahead": 1
    }
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "string"
}
 

Request      

PUT api/accounts-payable-receivable/{accountPayableReceivable}

Headers

Authorization        

Example: Bearer akvP3VE6g6cedZ8hfba415D

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

accountPayableReceivable   string     

Example: consequatur

Body Parameters

type   string  optional    

Type. Example: Example Type

Must be one of:
  • entrada
  • saída
payment_method   string  optional    

Payment method. Example: Example Payment method

Must be one of:
  • cheque
  • boleto
  • pix
  • cartao
  • outro
due_date   string  optional    

Due date. O campo value deve ser uma data válida. Example: 2024-01-01

amount   number  optional    

Amount. Example: 1

description   string  optional    

Description. Example: Example Description

supplier_id   string  optional    

Supplier id. The uuid of an existing record in the suppliers table. Example: 1c9a561e-9702-3dbd-83d3-2bf826980375

customer_id   string  optional    

Customer id. The uuid of an existing record in the customers table. Example: fb755c7d-615d-352e-aca2-53d5d1256cd7

work_id   string  optional    

Work id. The uuid of an existing record in the works table. Example: 90f15a1b-3308-3aa3-b508-48d29d057ca2

cost_center_id   string     

Cost center id. The uuid of an existing record in the cost_centers table. Example: a4b8dfd6-f59f-3aa0-b67f-78983c31fb81

status   string  optional    

Status. Example: Example Status

Must be one of:
  • a vencer
  • pago
  • vencido
  • recebido
  • cancelado
  • a protestar
  • protestado
payment_date   string  optional    

Payment date. O campo value deve ser uma data válida. Example: 2024-01-01

protest_date   string  optional    

Protest date. O campo value deve ser uma data válida. O campo value deve ser uma data posterior ou igual a due_date. Example: 2024-01-01

paid_amount   number  optional    

Paid amount. O campo value deve ser pelo menos 0. Example: 1

interest_amount   number  optional    

Interest amount. O campo value deve ser pelo menos 0. Example: 1

penalty_amount   number  optional    

Penalty amount. O campo value deve ser pelo menos 0. Example: 1

notary_fee_amount   number  optional    

Notary fee amount. O campo value deve ser pelo menos 0. Example: 1

bank_account_id   string  optional    

Bank account id. The uuid of an existing record in the bank_accounts table. Example: 111c1346-1b36-3957-941f-dd86a68183b4

custom_fields   object  optional    

Custom fields.

is_recurring   boolean  optional    

Is recurring. Example: true

recurrence_config   object  optional    

Recurrence config.

frequency_type   string  optional    

Recurrence config frequency type. Example: Example Recurrence config frequency type

Must be one of:
  • monthly
  • weekly
  • biweekly
  • yearly
frequency_value   integer  optional    

Recurrence config frequency value. O campo value deve ser pelo menos 0. O campo value não pode ser superior a 31. Example: 1

end_date   string  optional    

Recurrence config end date. O campo value deve ser uma data válida. O campo value deve ser uma data posterior a due_date. Example: 2024-01-01

max_occurrences   integer  optional    

Recurrence config max occurrences. O campo value deve ser pelo menos 1. Example: 1

generation_days_ahead   integer  optional    

Recurrence config generation days ahead. O campo value deve ser pelo menos 1. O campo value não pode ser superior a 30. Example: 1

Delete accounts payable receivable

requires authentication accounts-payable-receivable delete

Delete an accounts payable receivable

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/accounts-payable-receivable/ut" \
    --header "Authorization: Bearer fZgvEPD6ae856a14cbVd3kh" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/accounts-payable-receivable/ut"
);

const headers = {
    "Authorization": "Bearer fZgvEPD6ae856a14cbVd3kh",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "string"
}
 

Request      

DELETE api/accounts-payable-receivable/{accountPayableReceivable}

Headers

Authorization        

Example: Bearer fZgvEPD6ae856a14cbVd3kh

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

accountPayableReceivable   string     

Example: ut

Authentication

Endpoints for authentication

Login

No specific permission required

Login with email and password

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/auth/login" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"george.donnelly@example.org\",
    \"password\": \"password\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/auth/login"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "george.donnelly@example.org",
    "password": "password"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "token": "string"
}
 

Request      

POST api/auth/login

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

email   string     

Example: george.donnelly@example.org

password   string     

User password. Example: password

Me

requires authentication No specific permission required

Get the current user

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/auth/user" \
    --header "Authorization: Bearer d6kh65caDbVf14agvZ8EP3e" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/auth/user"
);

const headers = {
    "Authorization": "Bearer d6kh65caDbVf14agvZ8EP3e",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "7774f8ad-0aaf-331f-b9bb-6f3fbe994322",
        "name": "Rebecca Cartwright",
        "username": "theresia53",
        "email": "hilbert.hoppe@example.com",
        "ability": [
            {
                "action": "read",
                "subject": "Auth"
            },
            {
                "action": "listar",
                "subject": "padrão"
            }
        ],
        "roles": [],
        "preferences": [],
        "sectors": [],
        "image": {
            "id": null,
            "url": null
        }
    }
}
 

Request      

GET api/auth/user

Headers

Authorization        

Example: Bearer d6kh65caDbVf14agvZ8EP3e

Content-Type        

Example: application/json

Accept        

Example: application/json

Update Profile

requires authentication No specific permission required

Update the current user profile

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/auth/user" \
    --header "Authorization: Bearer fZ1ePavhgb6d54k8ca63DVE" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"certification\": \"Example Certification\",
    \"crea\": \"Example Crea\",
    \"email\": \"user@example.com\",
    \"username\": \"dcarter\",
    \"password\": \"password123\",
    \"image\": {
        \"0\": \"example1\",
        \"1\": \"example2\",
        \"path\": \"Example Image path\",
        \"name\": \"Example Name\",
        \"extension\": \"Example Image extension\",
        \"size\": \"Example Image size\"
    },
    \"sectors\": [
        \"778b8b1f-77df-3dc4-98c9-887790d6472e\"
    ],
    \"roles\": [
        \"d3233482-325e-3a18-8b58-f15537c46e9c\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/auth/user"
);

const headers = {
    "Authorization": "Bearer fZ1ePavhgb6d54k8ca63DVE",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "certification": "Example Certification",
    "crea": "Example Crea",
    "email": "user@example.com",
    "username": "dcarter",
    "password": "password123",
    "image": {
        "0": "example1",
        "1": "example2",
        "path": "Example Image path",
        "name": "Example Name",
        "extension": "Example Image extension",
        "size": "Example Image size"
    },
    "sectors": [
        "778b8b1f-77df-3dc4-98c9-887790d6472e"
    ],
    "roles": [
        "d3233482-325e-3a18-8b58-f15537c46e9c"
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

PUT api/auth/user

Headers

Authorization        

Example: Bearer fZ1ePavhgb6d54k8ca63DVE

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string  optional    

Nome. Example: Example Name

certification   string  optional    

Certificação. O campo value não pode ser superior a 255 caracteres. Example: Example Certification

crea   string  optional    

CREA. O campo value não pode ser superior a 255 caracteres. Example: Example Crea

email   string  optional    

E-mail. O campo value deve ser um endereço de e-mail válido. Example: user@example.com

username   string  optional    

Usuário. Example: dcarter

password   string  optional    

Password. Example: password123

image   object  optional    

Imagem.

path   string  optional    

Caminho da imagem. This field is required when image is present. Example: Example Image path

name   string  optional    

Nome da imagem. Example: Example Name

extension   string  optional    

Extensão da imagem. Example: Example Image extension

size   string  optional    

Tamanho da imagem. Example: Example Image size

sectors   string[]  optional    

UUID do setor. The uuid of an existing record in the sectors table.

roles   string[]  optional    

UUID da função. The uuid of an existing record in the roles table.

Logout

requires authentication No specific permission required

Logout the current user

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/auth/logout" \
    --header "Authorization: Bearer V38ZPf6baadhD54v61cekEg" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/auth/logout"
);

const headers = {
    "Authorization": "Bearer V38ZPf6baadhD54v61cekEg",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

POST api/auth/logout

Headers

Authorization        

Example: Bearer V38ZPf6baadhD54v61cekEg

Content-Type        

Example: application/json

Accept        

Example: application/json

Get user preferences

requires authentication No specific permission required

Get all user preferences

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/auth/preferences" \
    --header "Authorization: Bearer vP4ak165h83dcgVEfZDea6b" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/auth/preferences"
);

const headers = {
    "Authorization": "Bearer vP4ak165h83dcgVEfZDea6b",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "theme": "dark",
    "language": "pt-br",
    "notifications": {
        "email": true,
        "sms": false
    }
}
 

Request      

GET api/auth/preferences

Headers

Authorization        

Example: Bearer vP4ak165h83dcgVEfZDea6b

Content-Type        

Example: application/json

Accept        

Example: application/json

Set user preference

requires authentication No specific permission required

Set or update a user preference

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/auth/preferences" \
    --header "Authorization: Bearer g5ckV6Dd8avfb1ePh3Z6a4E" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"key\": \"tmdczvco\",
    \"value\": []
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/auth/preferences"
);

const headers = {
    "Authorization": "Bearer g5ckV6Dd8avfb1ePh3Z6a4E",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "key": "tmdczvco",
    "value": []
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Preference saved successfully"
}
 

Request      

POST api/auth/preferences

Headers

Authorization        

Example: Bearer g5ckV6Dd8avfb1ePh3Z6a4E

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

key   string     

O campo value não pode ser superior a 255 caracteres. Example: tmdczvco

value   object     

Delete user preference

requires authentication No specific permission required

Delete a specific user preference

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/auth/preferences/rem" \
    --header "Authorization: Bearer vea4Pahf6b85ZkDV63Edgc1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/auth/preferences/rem"
);

const headers = {
    "Authorization": "Bearer vea4Pahf6b85ZkDV63Edgc1",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "Preference deleted successfully"
}
 

Request      

DELETE api/auth/preferences/{key}

Headers

Authorization        

Example: Bearer vea4Pahf6b85ZkDV63Edgc1

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

key   string     

Example: rem

Generate user token

requires authentication auth generate-token

Generate a token for a specific user

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/auth/550e8400-e29b-41d4-a716-446655440000/token" \
    --header "Authorization: Bearer 6gEa13ZDfbhkPcvead48V56" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/auth/550e8400-e29b-41d4-a716-446655440000/token"
);

const headers = {
    "Authorization": "Bearer 6gEa13ZDfbhkPcvead48V56",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "token": "string",
    "userData": {
        "id": "uuid",
        "name": "string",
        "username": "string",
        "email": "string",
        "ability": [
            "array"
        ],
        "roles": [
            "array"
        ],
        "preferences": [
            "array"
        ],
        "sectors": [
            "array"
        ],
        "image": {
            "id": "uuid",
            "url": "string"
        }
    }
}
 

Request      

POST api/auth/{user}/token

Headers

Authorization        

Example: Bearer 6gEa13ZDfbhkPcvead48V56

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

user   string     

User UUID Example: 550e8400-e29b-41d4-a716-446655440000

Bank Account Movements

Endpoints for bank account deposits, withdraws and transfers

Transfer between bank accounts

requires authentication bank-account transfer

Transfers funds from a source account to a destination account

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/bank-accounts/transfers" \
    --header "Authorization: Bearer 3cb6deVg1D54EhvPZaak86f" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"source_id\": \"Example Source id\",
    \"destination_id\": \"Example Destination id\",
    \"amount\": 1,
    \"description\": \"Example Description\",
    \"transaction_date\": \"2024-01-01\",
    \"transaction_category_id\": \"Example Transaction category id\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/bank-accounts/transfers"
);

const headers = {
    "Authorization": "Bearer 3cb6deVg1D54EhvPZaak86f",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "source_id": "Example Source id",
    "destination_id": "Example Destination id",
    "amount": 1,
    "description": "Example Description",
    "transaction_date": "2024-01-01",
    "transaction_category_id": "Example Transaction category id"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "string",
    "data": "object"
}
 

Request      

POST api/bank-accounts/transfers

Headers

Authorization        

Example: Bearer 3cb6deVg1D54EhvPZaak86f

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

source_id   string     

Source id. The value and destination_id must be different. The uuid of an existing record in the bank_accounts table. Example: Example Source id

destination_id   string     

Destination id. The uuid of an existing record in the bank_accounts table. Example: Example Destination id

amount   number     

Amount. Example: 1

description   string  optional    

Description. O campo value não pode ser superior a 255 caracteres. Example: Example Description

transaction_date   string     

Transaction date. Must be a valid date in the format Y-m-d H:i:s. Example: 2024-01-01

transaction_category_id   string  optional    

Transaction category id. The uuid of an existing record in the transaction_categories table. Example: Example Transaction category id

Delete a bank transfer

requires authentication bank-account transfer

Reverts a transfer by deleting both cash flows and the transfer record

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/bank-accounts/transfers/fuga" \
    --header "Authorization: Bearer 18f4Z36daa5bhPkEecvgV6D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/bank-accounts/transfers/fuga"
);

const headers = {
    "Authorization": "Bearer 18f4Z36daa5bhPkEecvgV6D",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "string"
}
 

Request      

DELETE api/bank-accounts/transfers/{bankTransfer}

Headers

Authorization        

Example: Bearer 18f4Z36daa5bhPkEecvgV6D

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

bankTransfer   string     

Example: fuga

Deposit into bank account

requires authentication bank-account deposit

Adds funds to a bank account

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/bank-accounts/12/deposit" \
    --header "Authorization: Bearer a3b6V14h8EPDgkacfdZ56ve" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"amount\": 1,
    \"description\": \"Example Description\",
    \"transaction_date\": \"2024-01-01\",
    \"transaction_category_id\": \"Example Transaction category id\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/bank-accounts/12/deposit"
);

const headers = {
    "Authorization": "Bearer a3b6V14h8EPDgkacfdZ56ve",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "amount": 1,
    "description": "Example Description",
    "transaction_date": "2024-01-01",
    "transaction_category_id": "Example Transaction category id"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "string"
}
 

Request      

POST api/bank-accounts/{bankAccount}/deposit

Headers

Authorization        

Example: Bearer a3b6V14h8EPDgkacfdZ56ve

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

bankAccount   integer     

Example: 12

Body Parameters

amount   number     

Amount. Example: 1

description   string  optional    

Description. O campo value não pode ser superior a 255 caracteres. Example: Example Description

transaction_date   string     

Transaction date. Must be a valid date in the format Y-m-d H:i:s. Example: 2024-01-01

transaction_category_id   string  optional    

Transaction category id. The uuid of an existing record in the transaction_categories table. Example: Example Transaction category id

Withdraw from bank account

requires authentication bank-account withdraw

Removes funds from a bank account

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/bank-accounts/4/withdraw" \
    --header "Authorization: Bearer febd4a3Vc8h6vkPD1Z6gEa5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"amount\": 1,
    \"description\": \"Example Description\",
    \"transaction_date\": \"2024-01-01\",
    \"transaction_category_id\": \"Example Transaction category id\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/bank-accounts/4/withdraw"
);

const headers = {
    "Authorization": "Bearer febd4a3Vc8h6vkPD1Z6gEa5",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "amount": 1,
    "description": "Example Description",
    "transaction_date": "2024-01-01",
    "transaction_category_id": "Example Transaction category id"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "string"
}
 

Request      

POST api/bank-accounts/{bankAccount}/withdraw

Headers

Authorization        

Example: Bearer febd4a3Vc8h6vkPD1Z6gEa5

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

bankAccount   integer     

Example: 4

Body Parameters

amount   number     

Amount. Example: 1

description   string  optional    

Description. O campo value não pode ser superior a 255 caracteres. Example: Example Description

transaction_date   string     

Transaction date. Must be a valid date in the format Y-m-d H:i:s. Example: 2024-01-01

transaction_category_id   string  optional    

Transaction category id. The uuid of an existing record in the transaction_categories table. Example: Example Transaction category id

Bank Accounts

Endpoints for bank accounts

Get bank account balance summary

requires authentication bank-account summary

Get the balance summary of all bank accounts

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/bank-accounts/balance-summary" \
    --header "Authorization: Bearer h6daD416b35aE8ePckvVgZf" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/bank-accounts/balance-summary"
);

const headers = {
    "Authorization": "Bearer h6daD416b35aE8ePckvVgZf",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "totalBalance": "number",
        "totalBalancePositive": "number",
        "totalBalanceNegative": "number",
        "totalLimit": "number",
        "totalAvailableBalance": "number",
        "totalUsedLimit": "number",
        "totalAvailableLimit": "number",
        "accounts": {
            "*": {
                "id": "string",
                "bank": "string",
                "balance": "number",
                "limit": "number",
                "available_balance": "number",
                "used_limit": "number",
                "available_limit": "number"
            }
        }
    }
}
 

Request      

GET api/bank-accounts/balance-summary

Headers

Authorization        

Example: Bearer h6daD416b35aE8ePckvVgZf

Content-Type        

Example: application/json

Accept        

Example: application/json

Get default bank account by payment method

requires authentication bank-account show

Returns the bank account configured as default for the given payment method. Responds 404 when no default is configured.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/bank-accounts/default-by-payment-method?method=cash" \
    --header "Authorization: Bearer 8bh41g6PV6f3DvcZaa5ekEd" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/bank-accounts/default-by-payment-method"
);

const params = {
    "method": "cash",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer 8bh41g6PV6f3DvcZaa5ekEd",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "7157d491-691b-3e99-88c8-588794670d6c",
        "agency": "1549",
        "account": "0463673-1",
        "type": "poupança",
        "balance": 3852.91,
        "holder_type": "pj",
        "alias": "consectetur",
        "limit": 3131.53,
        "available_balance": 6984.4400000000005,
        "used_limit": 0,
        "available_limit": 3131.53,
        "is_default": null,
        "default_payment_method": null,
        "bank": {
            "id": null,
            "name": null,
            "code": null
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Example response (404):


{
    "message": "string"
}
 

Request      

GET api/bank-accounts/default-by-payment-method

Headers

Authorization        

Example: Bearer 8bh41g6PV6f3DvcZaa5ekEd

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

method   string     

Forma de pagamento (pix, bank_transfer, cash, check). Example: cash

Must be one of:
  • pix
  • bank_transfer
  • cash
  • check

List bank accounts

requires authentication bank-account index

List all bank accounts

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/bank-accounts?sort_by=created_at&sort_desc=1&page=1&per_page=15&q=name&is_default=1" \
    --header "Authorization: Bearer 61EPhVa46v8bZDgdk5efac3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/bank-accounts"
);

const params = {
    "sort_by": "created_at",
    "sort_desc": "1",
    "page": "1",
    "per_page": "15",
    "q": "name",
    "is_default": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer 61EPhVa46v8bZDgdk5efac3",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "5262a63e-8177-3148-8471-0c44a0577072",
            "agency": "1535",
            "account": "1813936-8",
            "type": "corrente",
            "balance": 3281.29,
            "holder_type": "pj",
            "alias": "exercitationem",
            "limit": 656.97,
            "available_balance": 3938.26,
            "used_limit": 0,
            "available_limit": 656.97,
            "is_default": null,
            "default_payment_method": null,
            "bank": {
                "id": null,
                "name": null,
                "code": null
            },
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "e47bb0ba-ba0b-31ba-acb8-cfd32179d306",
            "agency": "6387",
            "account": "0898551-4",
            "type": "corrente",
            "balance": 2549.3,
            "holder_type": "pj",
            "alias": "ut",
            "limit": 5270.14,
            "available_balance": 7819.4400000000005,
            "used_limit": 0,
            "available_limit": 5270.14,
            "is_default": null,
            "default_payment_method": null,
            "bank": {
                "id": null,
                "name": null,
                "code": null
            },
            "created_at": null,
            "updated_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/bank-accounts

Headers

Authorization        

Example: Bearer 61EPhVa46v8bZDgdk5efac3

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

sort_by   string  optional    

Field to sort by. Example: created_at

sort_desc   boolean  optional    

Sort order (true for descending, false for ascending). Example: true

page   integer  optional    

Page number for pagination. O campo value deve ser pelo menos 1. Example: 1

per_page   integer  optional    

Number of items per page (max: 100). O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 15

q   string  optional    

Search query. Example: name

is_default   boolean  optional    

Filter by default account (1 or 0). Example: true

Create bank account

requires authentication bank-account store

Create a new bank account

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/bank-accounts" \
    --header "Authorization: Bearer P6b46va8fhkdaEZ1ceg5DV3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"agency\": \"Example Agency\",
    \"account\": \"2291643-2\",
    \"bank_id\": \"c7bc6e18-49b7-390e-ae08-0edfda05521e\",
    \"type\": \"Example Type\",
    \"holder_type\": \"Example Holder type\",
    \"alias\": \"Example Alias\",
    \"balance\": 1,
    \"limit\": 1,
    \"is_default\": true,
    \"default_payment_method\": \"Example Default payment method\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/bank-accounts"
);

const headers = {
    "Authorization": "Bearer P6b46va8fhkdaEZ1ceg5DV3",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "agency": "Example Agency",
    "account": "2291643-2",
    "bank_id": "c7bc6e18-49b7-390e-ae08-0edfda05521e",
    "type": "Example Type",
    "holder_type": "Example Holder type",
    "alias": "Example Alias",
    "balance": 1,
    "limit": 1,
    "is_default": true,
    "default_payment_method": "Example Default payment method"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "string"
}
 

Request      

POST api/bank-accounts

Headers

Authorization        

Example: Bearer P6b46va8fhkdaEZ1ceg5DV3

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

agency   string     

Agency. Example: Example Agency

account   string     

Account. Example: 2291643-2

bank_id   string     

Bank id. The uuid of an existing record in the banks table. Example: c7bc6e18-49b7-390e-ae08-0edfda05521e

type   string     

Type. Example: Example Type

Must be one of:
  • corrente
  • poupança
  • caixa
holder_type   string     

Holder type. Example: Example Holder type

Must be one of:
  • pf
  • pj
alias   string     

Alias. Example: Example Alias

balance   number     

Balance. Example: 1

limit   number  optional    

Limit. Example: 1

is_default   boolean  optional    

Is default. Example: true

default_payment_method   string  optional    

Default payment method. Example: Example Default payment method

Must be one of:
  • pix
  • bank_transfer
  • cash
  • check

Update bank account

requires authentication bank-account update

Update a bank account

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/bank-accounts/5" \
    --header "Authorization: Bearer 8PDeVhvbka5c1a364d6ZEfg" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"agency\": \"Example Agency\",
    \"account\": \"1184960-6\",
    \"bank_id\": \"e0ad463f-3fb2-38b4-b518-7652eb5ab4f1\",
    \"type\": \"Example Type\",
    \"holder_type\": \"Example Holder type\",
    \"alias\": \"Example Alias\",
    \"balance\": 1,
    \"limit\": 1,
    \"is_default\": true,
    \"default_payment_method\": \"Example Default payment method\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/bank-accounts/5"
);

const headers = {
    "Authorization": "Bearer 8PDeVhvbka5c1a364d6ZEfg",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "agency": "Example Agency",
    "account": "1184960-6",
    "bank_id": "e0ad463f-3fb2-38b4-b518-7652eb5ab4f1",
    "type": "Example Type",
    "holder_type": "Example Holder type",
    "alias": "Example Alias",
    "balance": 1,
    "limit": 1,
    "is_default": true,
    "default_payment_method": "Example Default payment method"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "string"
}
 

Request      

PUT api/bank-accounts/{bankAccount}

Headers

Authorization        

Example: Bearer 8PDeVhvbka5c1a364d6ZEfg

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

bankAccount   integer     

Example: 5

Body Parameters

agency   string  optional    

Agency. Example: Example Agency

account   string  optional    

Account. Example: 1184960-6

bank_id   string  optional    

Bank id. The uuid of an existing record in the banks table. Example: e0ad463f-3fb2-38b4-b518-7652eb5ab4f1

type   string  optional    

Type. Example: Example Type

Must be one of:
  • corrente
  • poupança
  • caixa
holder_type   string  optional    

Holder type. Example: Example Holder type

Must be one of:
  • pf
  • pj
alias   string  optional    

Alias. Example: Example Alias

balance   number  optional    

Balance. Example: 1

limit   number  optional    

Limit. Example: 1

is_default   boolean  optional    

Is default. Example: true

default_payment_method   string  optional    

Default payment method. Example: Example Default payment method

Must be one of:
  • pix
  • bank_transfer
  • cash
  • check

Show bank account

requires authentication bank-account show

Show a bank account

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/bank-accounts/13" \
    --header "Authorization: Bearer vaef65ZgDdc4168hbaPk3EV" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/bank-accounts/13"
);

const headers = {
    "Authorization": "Bearer vaef65ZgDdc4168hbaPk3EV",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "40f17410-0897-3c78-9638-b5c8d33e4b6d",
        "agency": "8473",
        "account": "2367606-4",
        "type": "poupança",
        "balance": 5119.3,
        "holder_type": "pf",
        "alias": "aut",
        "limit": 3432.47,
        "available_balance": 8551.77,
        "used_limit": 0,
        "available_limit": 3432.47,
        "is_default": null,
        "default_payment_method": null,
        "bank": {
            "id": null,
            "name": null,
            "code": null
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/bank-accounts/{bankAccount}

Headers

Authorization        

Example: Bearer vaef65ZgDdc4168hbaPk3EV

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

bankAccount   integer     

Example: 13

Delete bank account

requires authentication bank-account delete

Delete a bank account

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/bank-accounts/17" \
    --header "Authorization: Bearer 4DE3vcedZV6kga81f56Pabh" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/bank-accounts/17"
);

const headers = {
    "Authorization": "Bearer 4DE3vcedZV6kga81f56Pabh",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "string"
}
 

Request      

DELETE api/bank-accounts/{bankAccount}

Headers

Authorization        

Example: Bearer 4DE3vcedZV6kga81f56Pabh

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

bankAccount   integer     

Example: 17

Bank Statements

Endpoints for bank account statements (extrato bancário)

Bank statement summary

requires authentication bank-statement summary

Get aggregated summary for the period

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/bank-accounts/14/statements/summary" \
    --header "Authorization: Bearer EeaVkg6P3Z15vh68Ddb4acf" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"date_start\": \"2024-01-01\",
    \"date_end\": \"2024-01-01\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/bank-accounts/14/statements/summary"
);

const headers = {
    "Authorization": "Bearer EeaVkg6P3Z15vh68Ddb4acf",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "date_start": "2024-01-01",
    "date_end": "2024-01-01"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": {
        "opening_balance": "number",
        "closing_balance": "number",
        "total_credit": "number",
        "total_debit": "number",
        "count": "integer",
        "date_start": "string",
        "date_end": "string"
    }
}
 

Request      

GET api/bank-accounts/{bankAccount}/statements/summary

Headers

Authorization        

Example: Bearer EeaVkg6P3Z15vh68Ddb4acf

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

bankAccount   integer     

Example: 14

Body Parameters

date_start   string  optional    

Date start. O campo value deve ser uma data válida. Example: 2024-01-01

date_end   string  optional    

Date end. O campo value deve ser uma data válida. O campo value deve ser uma data posterior ou igual a date_start. Example: 2024-01-01

List bank statements

requires authentication bank-statement index

List statements for a bank account. Default period: last 30 days.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/bank-accounts/11/statements" \
    --header "Authorization: Bearer cVDad5Efb64Z8vkg6h31Pea" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"sort_by\": \"et\",
    \"sort_desc\": false,
    \"page\": 41,
    \"per_page\": 9,
    \"q\": \"twaez\",
    \"type\": \"ajuste\",
    \"date_start\": \"2026-11-06T10:51:20\",
    \"date_end\": \"2106-03-10\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/bank-accounts/11/statements"
);

const headers = {
    "Authorization": "Bearer cVDad5Efb64Z8vkg6h31Pea",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "sort_by": "et",
    "sort_desc": false,
    "page": 41,
    "per_page": 9,
    "q": "twaez",
    "type": "ajuste",
    "date_start": "2026-11-06T10:51:20",
    "date_end": "2106-03-10"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": null,
            "type": null,
            "amount": null,
            "balance_after": null,
            "description": null,
            "date": null,
            "statement_date": null,
            "created_at": null,
            "updated_at": null
        },
        {
            "id": null,
            "type": null,
            "amount": null,
            "balance_after": null,
            "description": null,
            "date": null,
            "statement_date": null,
            "created_at": null,
            "updated_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/bank-accounts/{bankAccount}/statements

Headers

Authorization        

Example: Bearer cVDad5Efb64Z8vkg6h31Pea

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

bankAccount   integer     

Example: 11

Body Parameters

sort_by   string  optional    

Example: et

sort_desc   boolean  optional    

Example: false

page   integer  optional    

O campo value deve ser pelo menos 1. Example: 41

per_page   integer  optional    

O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 9

q   string  optional    

O campo value não pode ser superior a 255 caracteres. Example: twaez

type   string  optional    

Example: ajuste

Must be one of:
  • entrada
  • saída
  • tarifa
  • depósito
  • saque
  • transferência
  • pagamento
  • juros
  • ajuste
  • ajuste saída
date_start   string  optional    

O campo value deve ser uma data válida. Example: 2026-11-06T10:51:20

date_end   string  optional    

O campo value deve ser uma data válida. O campo value deve ser uma data posterior ou igual a date_start. Example: 2106-03-10

cash_flow_id   string  optional    

The uuid of an existing record in the cash_flows table.

Show bank statement

requires authentication bank-statement show

Show a specific statement entry

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/bank-accounts/15/statements/voluptates" \
    --header "Authorization: Bearer fDvbZ58h3Pke1gV6E4adac6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/bank-accounts/15/statements/voluptates"
);

const headers = {
    "Authorization": "Bearer fDvbZ58h3Pke1gV6E4adac6",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": null,
        "type": null,
        "amount": null,
        "balance_after": null,
        "description": null,
        "date": null,
        "statement_date": null,
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/bank-accounts/{bankAccount}/statements/{bankStatement}

Headers

Authorization        

Example: Bearer fDvbZ58h3Pke1gV6E4adac6

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

bankAccount   integer     

Example: 15

bankStatement   string     

Example: voluptates

Banks

Endpoints for banks

List banks

requires authentication bank index

List all banks

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/banks?sort_by=created_at&sort_desc=1&page=1&per_page=15&q=Permission+name" \
    --header "Authorization: Bearer DaPZ8c6563bvEa4dfV1kgeh" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/banks"
);

const params = {
    "sort_by": "created_at",
    "sort_desc": "1",
    "page": "1",
    "per_page": "15",
    "q": "Permission name",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer DaPZ8c6563bvEa4dfV1kgeh",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "c823e832-14ef-3258-85da-5d59bcbca68c",
            "name": "Paes e Associados",
            "code": "614"
        },
        {
            "id": "9d4813a1-d9f2-3456-90a7-e7a1fa7871af",
            "name": "Quintana-Valência",
            "code": "705"
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/banks

Headers

Authorization        

Example: Bearer DaPZ8c6563bvEa4dfV1kgeh

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

sort_by   string  optional    

Field to sort by. Example: created_at

sort_desc   boolean  optional    

Sort order (true for descending, false for ascending). Example: true

page   integer  optional    

Page number for pagination. O campo value deve ser pelo menos 1. Example: 1

per_page   integer  optional    

Number of items per page (max: 100). O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 15

q   string  optional    

Search query. Example: Permission name

Create bank

requires authentication bank store

Create a new bank

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/banks" \
    --header "Authorization: Bearer DvVhaEd6Zfkb1c3e5Pga648" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"code\": \"Example Code\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/banks"
);

const headers = {
    "Authorization": "Bearer DvVhaEd6Zfkb1c3e5Pga648",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "code": "Example Code"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "string"
}
 

Request      

POST api/banks

Headers

Authorization        

Example: Bearer DvVhaEd6Zfkb1c3e5Pga648

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Name. O campo value não pode ser superior a 255 caracteres. Example: Example Name

code   string     

Code. O campo value não pode ser superior a 255 caracteres. Example: Example Code

Update bank

requires authentication bank update

Update a bank

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/banks/1" \
    --header "Authorization: Bearer 4e6VDg3dbP68k5fhcEZa1va" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"code\": \"Example Code\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/banks/1"
);

const headers = {
    "Authorization": "Bearer 4e6VDg3dbP68k5fhcEZa1va",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "code": "Example Code"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "string"
}
 

Request      

PUT api/banks/{bank}

Headers

Authorization        

Example: Bearer 4e6VDg3dbP68k5fhcEZa1va

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

bank   integer     

The bank. Example: 1

Body Parameters

name   string  optional    

Name. O campo value não pode ser superior a 255 caracteres. Example: Example Name

code   string  optional    

Code. O campo value não pode ser superior a 255 caracteres. Example: Example Code

Show bank

requires authentication bank show

Show a bank

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/banks/1" \
    --header "Authorization: Bearer 1afc58dg66hZV34bEevkDaP" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/banks/1"
);

const headers = {
    "Authorization": "Bearer 1afc58dg66hZV34bEevkDaP",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "81e03e91-b859-36ad-b16d-99ab672d9243",
        "name": "Delvalle-Paz",
        "code": "332"
    }
}
 

Request      

GET api/banks/{bank}

Headers

Authorization        

Example: Bearer 1afc58dg66hZV34bEevkDaP

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

bank   integer     

The bank. Example: 1

Delete bank

requires authentication bank delete

Delete a bank

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/banks/1" \
    --header "Authorization: Bearer da8PZfbe3ED66h51Vagcv4k" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/banks/1"
);

const headers = {
    "Authorization": "Bearer da8PZfbe3ED66h51Vagcv4k",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/banks/{bank}

Headers

Authorization        

Example: Bearer da8PZfbe3ED66h51Vagcv4k

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

bank   integer     

The bank. Example: 1

CEP

Search CEP

requires authentication No specific permission required

Search for address information by CEP (Brazilian postal code)

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/cep/01001000" \
    --header "Authorization: Bearer vckED1efdPh5gZ4a368bV6a" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cep/01001000"
);

const headers = {
    "Authorization": "Bearer vckED1efdPh5gZ4a368bV6a",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200, CEP found successfully):


{
    "data": {
        "cep": "01001000",
        "street": "Praça da Sé",
        "district": "Sé",
        "city": "São Paulo",
        "state": "SP",
        "complement": "lado ímpar",
        "ibge": "3550308",
        "ddd": "11",
        "siafi": "7107"
    }
}
 

Example response (200, CEP not found):


{
    "data": {
        "cep": "99999999",
        "street": null,
        "district": null,
        "city": null,
        "state": null,
        "complement": null,
        "ibge": null,
        "ddd": null,
        "siafi": null
    }
}
 

Request      

GET api/cep/{cep}

Headers

Authorization        

Example: Bearer vckED1efdPh5gZ4a368bV6a

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

cep   string     

CEP to search for Example: 01001000

Cash Flow

Endpoints for cash flow

Get cash flow summary

requires authentication cash-flow summary

Get cash flow summary

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/cash-flows/summary?sort_by=created_at&sort_desc=1&page=1&per_page=15&q=Salary&cash_session=uuid&type=entrada&description=Ducimus+est+facilis+in+eos+repellendus.&categories[]=et&date_start=2021-01-01&date_end=2021-01-31&bank_accounts[]=excepturi&customers[]=aut&suppliers[]=earum&works[]=maiores&cost_centers[]=necessitatibus" \
    --header "Authorization: Bearer 1kf5ceaDPEZad3bhv468gV6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cash-flows/summary"
);

const params = {
    "sort_by": "created_at",
    "sort_desc": "1",
    "page": "1",
    "per_page": "15",
    "q": "Salary",
    "cash_session": "uuid",
    "type": "entrada",
    "description": "Ducimus est facilis in eos repellendus.",
    "categories[0]": "et",
    "date_start": "2021-01-01",
    "date_end": "2021-01-31",
    "bank_accounts[0]": "excepturi",
    "customers[0]": "aut",
    "suppliers[0]": "earum",
    "works[0]": "maiores",
    "cost_centers[0]": "necessitatibus",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer 1kf5ceaDPEZad3bhv468gV6",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "total_income": "number",
        "total_expense": "number",
        "total_fee": "number",
        "total_balance": "number"
    }
}
 

Request      

GET api/cash-flows/summary

Headers

Authorization        

Example: Bearer 1kf5ceaDPEZad3bhv468gV6

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

sort_by   string  optional    

Field to sort by. Example: created_at

sort_desc   boolean  optional    

Sort order (true for descending, false for ascending). Example: true

page   integer  optional    

Page number for pagination. O campo value deve ser pelo menos 1. Example: 1

per_page   integer  optional    

Number of items per page (max: 100). O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 15

q   string  optional    

Search query. Example: Salary

cash_session   string  optional    

Cash session. The uuid of an existing record in the cash_sessions table. Example: uuid

type   string  optional    

Cash flow type. Example: entrada

Must be one of:
  • entrada
  • saída
  • tarifa
  • depósito
  • saque
  • transferência
  • pagamento
  • juros
  • ajuste
  • ajuste saída
description   string  optional    

Description . Example: Ducimus est facilis in eos repellendus.

categories   string[]  optional    

The uuid of an existing record in the transaction_categories table.

date_start   string  optional    

Start date. O campo value deve ser uma data válida. Example: 2021-01-01

date_end   string  optional    

End date. O campo value deve ser uma data válida. Example: 2021-01-31

bank_accounts   string[]  optional    

The uuid of an existing record in the bank_accounts table.

customers   string[]  optional    

The uuid of an existing record in the customers table.

suppliers   string[]  optional    

The uuid of an existing record in the suppliers table.

works   string[]  optional    

The uuid of an existing record in the works table.

cost_centers   string[]  optional    

The uuid of an existing record in the cost_centers table.

List cash flow

requires authentication cash-flow index

List all cash flow

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/cash-flows?sort_by=created_at&sort_desc=1&page=1&per_page=15&q=Salary&cash_session=uuid&type=entrada&description=Et+voluptas+amet+eum+qui+fuga.&categories[]=aut&date_start=2021-01-01&date_end=2021-01-31&bank_accounts[]=distinctio&customers[]=voluptas&suppliers[]=maxime&works[]=magni&cost_centers[]=dolores" \
    --header "Authorization: Bearer V3abPEDk8h51646Zcaevdgf" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cash-flows"
);

const params = {
    "sort_by": "created_at",
    "sort_desc": "1",
    "page": "1",
    "per_page": "15",
    "q": "Salary",
    "cash_session": "uuid",
    "type": "entrada",
    "description": "Et voluptas amet eum qui fuga.",
    "categories[0]": "aut",
    "date_start": "2021-01-01",
    "date_end": "2021-01-31",
    "bank_accounts[0]": "distinctio",
    "customers[0]": "voluptas",
    "suppliers[0]": "maxime",
    "works[0]": "magni",
    "cost_centers[0]": "dolores",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer V3abPEDk8h51646Zcaevdgf",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "be6cbce8-f7bc-31fe-932e-bb34174a47ea",
            "code": "FC-71314253",
            "type": "entrada",
            "amount": 4190.82,
            "description": "Ipsam dolores minus ipsa iure quia in perferendis qui.",
            "transaction_date": "2023-04-24T03:00:00.000000Z",
            "transaction_category": {
                "id": null,
                "name": null,
                "type": null
            },
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "67db9027-6bbc-33a3-94b7-b7ba4c8a2dba",
            "code": "FC-51236710",
            "type": "saque",
            "amount": -5705.89,
            "description": "Possimus fugit natus provident illum.",
            "transaction_date": "2005-04-17T03:00:00.000000Z",
            "transaction_category": {
                "id": null,
                "name": null,
                "type": null
            },
            "created_at": null,
            "updated_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/cash-flows

Headers

Authorization        

Example: Bearer V3abPEDk8h51646Zcaevdgf

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

sort_by   string  optional    

Field to sort by. Example: created_at

sort_desc   boolean  optional    

Sort order (true for descending, false for ascending). Example: true

page   integer  optional    

Page number for pagination. O campo value deve ser pelo menos 1. Example: 1

per_page   integer  optional    

Number of items per page (max: 100). O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 15

q   string  optional    

Search query. Example: Salary

cash_session   string  optional    

Cash session. The uuid of an existing record in the cash_sessions table. Example: uuid

type   string  optional    

Cash flow type. Example: entrada

Must be one of:
  • entrada
  • saída
  • tarifa
  • depósito
  • saque
  • transferência
  • pagamento
  • juros
  • ajuste
  • ajuste saída
description   string  optional    

Description . Example: Et voluptas amet eum qui fuga.

categories   string[]  optional    

The uuid of an existing record in the transaction_categories table.

date_start   string  optional    

Start date. O campo value deve ser uma data válida. Example: 2021-01-01

date_end   string  optional    

End date. O campo value deve ser uma data válida. Example: 2021-01-31

bank_accounts   string[]  optional    

The uuid of an existing record in the bank_accounts table.

customers   string[]  optional    

The uuid of an existing record in the customers table.

suppliers   string[]  optional    

The uuid of an existing record in the suppliers table.

works   string[]  optional    

The uuid of an existing record in the works table.

cost_centers   string[]  optional    

The uuid of an existing record in the cost_centers table.

Create cash flow

requires authentication cash-flow store

Create a new cash flow

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/cash-flows" \
    --header "Authorization: Bearer 4c15kPg6VDE6ahbfe3vdZa8" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"type\": \"Example Type\",
    \"cash_session_id\": \"dc049380-d38f-3592-a5de-858b7c573e6b\",
    \"transaction_category_id\": \"24b209bb-49f5-3706-a0be-8706424cac96\",
    \"bank_account_id\": \"e96b7f48-5b90-3a05-aaab-4aedf7d2ec04\",
    \"customer_id\": \"c4e7cba7-42c9-315d-beec-0864a026d427\",
    \"supplier_id\": \"4f597c8e-6e9b-33e7-9ca3-64d08b009af3\",
    \"work_id\": \"d0dbae0b-0bae-33a6-88f3-454485fb3f03\",
    \"cost_center_id\": \"166f1fb0-0048-3b73-b82d-77ab3da76509\",
    \"amount\": 1,
    \"description\": \"Example Description\",
    \"transaction_date\": \"2024-01-01\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cash-flows"
);

const headers = {
    "Authorization": "Bearer 4c15kPg6VDE6ahbfe3vdZa8",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "type": "Example Type",
    "cash_session_id": "dc049380-d38f-3592-a5de-858b7c573e6b",
    "transaction_category_id": "24b209bb-49f5-3706-a0be-8706424cac96",
    "bank_account_id": "e96b7f48-5b90-3a05-aaab-4aedf7d2ec04",
    "customer_id": "c4e7cba7-42c9-315d-beec-0864a026d427",
    "supplier_id": "4f597c8e-6e9b-33e7-9ca3-64d08b009af3",
    "work_id": "d0dbae0b-0bae-33a6-88f3-454485fb3f03",
    "cost_center_id": "166f1fb0-0048-3b73-b82d-77ab3da76509",
    "amount": 1,
    "description": "Example Description",
    "transaction_date": "2024-01-01"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "string"
}
 

Request      

POST api/cash-flows

Headers

Authorization        

Example: Bearer 4c15kPg6VDE6ahbfe3vdZa8

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

type   string     

Type. Example: Example Type

Must be one of:
  • entrada
  • saída
  • tarifa
  • depósito
  • saque
  • transferência
  • pagamento
  • juros
  • ajuste
  • ajuste saída
cash_session_id   string     

Cash session id. The uuid of an existing record in the cash_sessions table. Example: dc049380-d38f-3592-a5de-858b7c573e6b

transaction_category_id   string  optional    

Transaction category id. The uuid of an existing record in the transaction_categories table. Example: 24b209bb-49f5-3706-a0be-8706424cac96

bank_account_id   string  optional    

Bank account id. The uuid of an existing record in the bank_accounts table. Example: e96b7f48-5b90-3a05-aaab-4aedf7d2ec04

customer_id   string  optional    

Customer id. The uuid of an existing record in the customers table. Example: c4e7cba7-42c9-315d-beec-0864a026d427

supplier_id   string  optional    

Supplier id. The uuid of an existing record in the suppliers table. Example: 4f597c8e-6e9b-33e7-9ca3-64d08b009af3

work_id   string  optional    

Work id. The uuid of an existing record in the works table. Example: d0dbae0b-0bae-33a6-88f3-454485fb3f03

cost_center_id   string     

Cost center id. The uuid of an existing record in the cost_centers table. Example: 166f1fb0-0048-3b73-b82d-77ab3da76509

amount   number     

Amount. Example: 1

description   string  optional    

Description. Example: Example Description

transaction_date   string     

Transaction date. O campo value deve ser uma data válida. Example: 2024-01-01

Show cash flow

requires authentication cash-flow show

Show a cash flow

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/cash-flows/6" \
    --header "Authorization: Bearer 8gV3adDP54Zevc1f6Eka6hb" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cash-flows/6"
);

const headers = {
    "Authorization": "Bearer 8gV3adDP54Zevc1f6Eka6hb",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "a7e7e979-dffd-3716-983e-44d9b529c079",
        "code": "FC-23908242",
        "type": "entrada",
        "amount": 6197.89,
        "description": "Sit est magnam quod esse nesciunt saepe.",
        "transaction_date": "2000-04-18T03:00:00.000000Z",
        "transaction_category": {
            "id": null,
            "name": null,
            "type": null
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/cash-flows/{cashFlow}

Headers

Authorization        

Example: Bearer 8gV3adDP54Zevc1f6Eka6hb

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

cashFlow   integer     

Example: 6

Update cash flow

requires authentication cash-flow update

Update a cash flow

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/cash-flows/11" \
    --header "Authorization: Bearer ekDEVv15cda8Pb43fZg6ha6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"type\": \"Example Type\",
    \"cash_session_id\": \"e9f99edc-08a2-3d3a-928a-779b3d5829cf\",
    \"transaction_category_id\": \"09732917-7793-33d3-a4d9-c76640e93fec\",
    \"bank_account_id\": \"1553ddc6-cf5f-34ea-9544-d7c60cf95f0a\",
    \"customer_id\": \"579e9859-5798-33ad-8687-ecf5cd16ca19\",
    \"supplier_id\": \"7d5d799b-4255-3bd6-a27c-e9c5bfb90ca2\",
    \"work_id\": \"06d595e7-bfe3-3a86-bb25-555c8e2dd0ba\",
    \"cost_center_id\": \"1e5ef82a-292e-3ea3-8195-cb48d3a6decd\",
    \"amount\": 1,
    \"description\": \"Example Description\",
    \"transaction_date\": \"2024-01-01\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cash-flows/11"
);

const headers = {
    "Authorization": "Bearer ekDEVv15cda8Pb43fZg6ha6",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "type": "Example Type",
    "cash_session_id": "e9f99edc-08a2-3d3a-928a-779b3d5829cf",
    "transaction_category_id": "09732917-7793-33d3-a4d9-c76640e93fec",
    "bank_account_id": "1553ddc6-cf5f-34ea-9544-d7c60cf95f0a",
    "customer_id": "579e9859-5798-33ad-8687-ecf5cd16ca19",
    "supplier_id": "7d5d799b-4255-3bd6-a27c-e9c5bfb90ca2",
    "work_id": "06d595e7-bfe3-3a86-bb25-555c8e2dd0ba",
    "cost_center_id": "1e5ef82a-292e-3ea3-8195-cb48d3a6decd",
    "amount": 1,
    "description": "Example Description",
    "transaction_date": "2024-01-01"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "string"
}
 

Request      

PUT api/cash-flows/{cashFlow}

Headers

Authorization        

Example: Bearer ekDEVv15cda8Pb43fZg6ha6

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

cashFlow   integer     

Example: 11

Body Parameters

type   string  optional    

Type. Example: Example Type

Must be one of:
  • entrada
  • saída
  • tarifa
  • depósito
  • saque
  • transferência
  • pagamento
  • juros
  • ajuste
  • ajuste saída
cash_session_id   string  optional    

Cash session id. The uuid of an existing record in the cash_sessions table. Example: e9f99edc-08a2-3d3a-928a-779b3d5829cf

transaction_category_id   string  optional    

Transaction category id. The uuid of an existing record in the transaction_categories table. Example: 09732917-7793-33d3-a4d9-c76640e93fec

bank_account_id   string  optional    

Bank account id. The uuid of an existing record in the bank_accounts table. Example: 1553ddc6-cf5f-34ea-9544-d7c60cf95f0a

customer_id   string  optional    

Customer id. The uuid of an existing record in the customers table. Example: 579e9859-5798-33ad-8687-ecf5cd16ca19

supplier_id   string  optional    

Supplier id. The uuid of an existing record in the suppliers table. Example: 7d5d799b-4255-3bd6-a27c-e9c5bfb90ca2

work_id   string  optional    

Work id. The uuid of an existing record in the works table. Example: 06d595e7-bfe3-3a86-bb25-555c8e2dd0ba

cost_center_id   string     

Cost center id. The uuid of an existing record in the cost_centers table. Example: 1e5ef82a-292e-3ea3-8195-cb48d3a6decd

amount   number  optional    

Amount. Example: 1

description   string  optional    

Description. Example: Example Description

transaction_date   string  optional    

Transaction date. O campo value deve ser uma data válida. Example: 2024-01-01

Delete cash flow

requires authentication cash-flow delete

Delete a cash flow

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/cash-flows/7" \
    --header "Authorization: Bearer 6V8va4d16agE5Zfbcek3hDP" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cash-flows/7"
);

const headers = {
    "Authorization": "Bearer 6V8va4d16agE5Zfbcek3hDP",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "string"
}
 

Request      

DELETE api/cash-flows/{cashFlow}

Headers

Authorization        

Example: Bearer 6V8va4d16agE5Zfbcek3hDP

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

cashFlow   integer     

Example: 7

Cash Session

Endpoints for cash session

List cash session

requires authentication cash-session index

List all cash session

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/cash-sessions" \
    --header "Authorization: Bearer Vc5k64Z6eaEd8Pga1Dvf3bh" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cash-sessions"
);

const headers = {
    "Authorization": "Bearer Vc5k64Z6eaEd8Pga1Dvf3bh",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "9ea8e33d-21c4-3000-865d-32ec8ea8965e",
            "code": null,
            "opened_by": null,
            "opened_at": "1986-11-02T20:43:28.000000Z",
            "closed_by": null,
            "closed_at": "1974-11-26T09:50:40.000000Z",
            "opening_balance": 4790.15,
            "closing_balance": 4223.29,
            "total_income": 0,
            "total_expense": 0,
            "total_balance": 0,
            "status": "Fechado",
            "hasSnapshot": false,
            "created_at": "2016-06-15T07:24:26.000000Z",
            "updated_at": "2013-08-09T12:42:19.000000Z"
        },
        {
            "id": "94b15aee-b646-3ce7-b29d-7c96e9d24773",
            "code": null,
            "opened_by": null,
            "opened_at": "1978-09-01T20:15:18.000000Z",
            "closed_by": null,
            "closed_at": "1977-10-25T06:38:50.000000Z",
            "opening_balance": 9739.84,
            "closing_balance": 9795.59,
            "total_income": 0,
            "total_expense": 0,
            "total_balance": 0,
            "status": "Fechado",
            "hasSnapshot": false,
            "created_at": "2021-02-06T10:54:56.000000Z",
            "updated_at": "1974-01-27T16:24:27.000000Z"
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/cash-sessions

Headers

Authorization        

Example: Bearer Vc5k64Z6eaEd8Pga1Dvf3bh

Content-Type        

Example: application/json

Accept        

Example: application/json

Open cash session

requires authentication cash-session open

Open a new cash session

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/cash-sessions/open" \
    --header "Authorization: Bearer k3bP4vVfa651ZEdDe8h6gca" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cash-sessions/open"
);

const headers = {
    "Authorization": "Bearer k3bP4vVfa651ZEdDe8h6gca",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "b3231f4c-b709-3e9b-bfa1-803ad94aec8e",
        "code": null,
        "opened_by": null,
        "opened_at": "2024-08-31T21:33:04.000000Z",
        "closed_by": null,
        "closed_at": "1997-11-05T08:09:18.000000Z",
        "opening_balance": 7302.96,
        "closing_balance": 3453.36,
        "total_income": 0,
        "total_expense": 0,
        "total_balance": 0,
        "status": "Fechado",
        "hasSnapshot": false,
        "created_at": "1990-01-05T03:08:01.000000Z",
        "updated_at": "2007-08-15T22:46:19.000000Z"
    }
}
 

Request      

POST api/cash-sessions/open

Headers

Authorization        

Example: Bearer k3bP4vVfa651ZEdDe8h6gca

Content-Type        

Example: application/json

Accept        

Example: application/json

Close cash session

requires authentication cash-session close

Close a cash session

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/cash-sessions/close/dd0c17b3-f376-3542-9737-755e40b96397" \
    --header "Authorization: Bearer va1PkeaD48b63fZhE5c6gdV" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cash-sessions/close/dd0c17b3-f376-3542-9737-755e40b96397"
);

const headers = {
    "Authorization": "Bearer va1PkeaD48b63fZhE5c6gdV",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "string"
}
 

Request      

POST api/cash-sessions/close/{uuid}

Headers

Authorization        

Example: Bearer va1PkeaD48b63fZhE5c6gdV

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

uuid   string     

Example: dd0c17b3-f376-3542-9737-755e40b96397

Cash session account snapshot

requires authentication cash-session show

List the account balance snapshot captured when the cash session was closed

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/cash-sessions/1d91b39d-02d3-3dd5-a08f-5fa1b2e3e51c/account-snapshot" \
    --header "Authorization: Bearer g6534Dda8fE6b1VvaePkZhc" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cash-sessions/1d91b39d-02d3-3dd5-a08f-5fa1b2e3e51c/account-snapshot"
);

const headers = {
    "Authorization": "Bearer g6534Dda8fE6b1VvaePkZhc",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/cash-sessions/{uuid}/account-snapshot

Headers

Authorization        

Example: Bearer g6534Dda8fE6b1VvaePkZhc

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

uuid   integer     

Example: 1d91b39d-02d3-3dd5-a08f-5fa1b2e3e51c

Show cash session

requires authentication cash-session show

Show a cash session

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/cash-sessions/e51ace80-a9f3-3af7-901d-1ed8490bb476" \
    --header "Authorization: Bearer 3dvD14agaeckEV5f8b6hPZ6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cash-sessions/e51ace80-a9f3-3af7-901d-1ed8490bb476"
);

const headers = {
    "Authorization": "Bearer 3dvD14agaeckEV5f8b6hPZ6",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "813bf137-f34a-33c1-a254-293b2cd100a5",
        "code": null,
        "opened_by": null,
        "opened_at": "1995-09-08T11:53:09.000000Z",
        "closed_by": null,
        "closed_at": "1982-07-19T03:15:22.000000Z",
        "opening_balance": 6276.26,
        "closing_balance": 1397.63,
        "total_income": 0,
        "total_expense": 0,
        "total_balance": 0,
        "status": "Fechado",
        "hasSnapshot": false,
        "created_at": "1985-04-14T10:57:49.000000Z",
        "updated_at": "2005-01-17T13:30:32.000000Z"
    }
}
 

Request      

GET api/cash-sessions/{uuid}

Headers

Authorization        

Example: Bearer 3dvD14agaeckEV5f8b6hPZ6

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

uuid   integer     

Example: e51ace80-a9f3-3af7-901d-1ed8490bb476

Delete cash session

requires authentication cash-session delete

Delete a cash session

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/cash-sessions/35d29928-397e-3479-96ef-011e1e098d52" \
    --header "Authorization: Bearer 4bEhdg863V1vZckP56feDaa" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cash-sessions/35d29928-397e-3479-96ef-011e1e098d52"
);

const headers = {
    "Authorization": "Bearer 4bEhdg863V1vZckP56feDaa",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "string"
}
 

Request      

DELETE api/cash-sessions/{uuid}

Headers

Authorization        

Example: Bearer 4bEhdg863V1vZckP56feDaa

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

uuid   integer     

Example: 35d29928-397e-3479-96ef-011e1e098d52

Central de Tutoriais

Consulta dos tutoriais liberados para quem está autenticado

Setores da central

requires authentication No specific permission required

Setores da pessoa que tenham ao menos um tutorial visível, com a contagem

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/tutorials/sectors" \
    --header "Authorization: Bearer hE6kPb6VZe5faD1v83adc4g" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/tutorials/sectors"
);

const headers = {
    "Authorization": "Bearer hE6kPb6VZe5faD1v83adc4g",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "0bad5e24-177c-3048-87c9-f61c19dc32cc",
            "name": "labore quos",
            "slug": null,
            "abbreviation": "ilk",
            "tutorials_count": 0
        },
        {
            "id": "ebb64999-9cf4-344f-a67b-a7c8e9c486a2",
            "name": "laborum debitis",
            "slug": null,
            "abbreviation": null,
            "tutorials_count": 0
        }
    ]
}
 

Request      

GET api/tutorials/sectors

Headers

Authorization        

Example: Bearer hE6kPb6VZe5faD1v83adc4g

Content-Type        

Example: application/json

Accept        

Example: application/json

Módulos da central

requires authentication No specific permission required

Módulos ativos com tutoriais visíveis para a pessoa; aceita filtro de setor

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/tutorials/modules?sector_id=b8d333c7-a202-3c12-a55e-4ac58d3ed29f" \
    --header "Authorization: Bearer 4DafVZkv83g5Ea1b6ehPcd6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/tutorials/modules"
);

const params = {
    "sector_id": "b8d333c7-a202-3c12-a55e-4ac58d3ed29f",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer 4DafVZkv83g5Ea1b6ehPcd6",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "218b311d-c6b6-322a-8d20-89c594f0155d",
            "name": "Quia minus",
            "slug": "quia-minus-654032",
            "description": "Voluptas et voluptas quas quasi ullam.",
            "sort_order": 0,
            "is_active": true,
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "4ab792c7-0345-3c59-ab6b-11b0697d82c5",
            "name": "Voluptatum quam",
            "slug": "voluptatum-quam-603361",
            "description": "Accusantium dolorum eaque similique molestias numquam excepturi.",
            "sort_order": 0,
            "is_active": true,
            "created_at": null,
            "updated_at": null
        }
    ]
}
 

Request      

GET api/tutorials/modules

Headers

Authorization        

Example: Bearer 4DafVZkv83g5Ea1b6ehPcd6

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

sector_id   string  optional    

Filtra os módulos pelos tutoriais de um setor, ou "geral" para o material sem setor marcado. O campo value deve ser um UUID válido. The uuid of an existing record in the sectors table. Example: b8d333c7-a202-3c12-a55e-4ac58d3ed29f

Listar tutoriais

requires authentication No specific permission required

Lista paginada dos tutoriais visíveis, com filtros de módulo, setor e busca por texto

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/tutorials?sort_by=created_at&sort_desc=1&page=1&per_page=15&q=ordem+de+servi%C3%A7o&module_id=7801192d-1089-3fa5-a026-a60ca156382b&sector_id=1cd72dd7-fc84-381d-ac32-47068b0d7400" \
    --header "Authorization: Bearer 6Vagc8ZD6bf14ehEkPdva35" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/tutorials"
);

const params = {
    "sort_by": "created_at",
    "sort_desc": "1",
    "page": "1",
    "per_page": "15",
    "q": "ordem de serviço",
    "module_id": "7801192d-1089-3fa5-a026-a60ca156382b",
    "sector_id": "1cd72dd7-fc84-381d-ac32-47068b0d7400",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer 6Vagc8ZD6bf14ehEkPdva35",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "6ea1e078-5630-32f3-b7dc-c6dea65ddbd1",
            "title": "Quae non asperiores dolores",
            "description": "Harum autem natus ut voluptates ut sequi.",
            "status": "draft",
            "published_at": null,
            "sort_order": 0,
            "module": {
                "id": "a32930de-7e9d-4f49-a1ac-5d52489d1070",
                "name": "In nemo",
                "slug": "in-nemo-959613"
            },
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "9019ed15-5973-3e37-822b-511f4a18ea63",
            "title": "Dolore ex aut id",
            "description": "Qui maxime dolores beatae consequatur.",
            "status": "draft",
            "published_at": null,
            "sort_order": 0,
            "module": {
                "id": "a32930de-810e-4968-ac20-7cbc102759f8",
                "name": "Est sunt",
                "slug": "est-sunt-988332"
            },
            "created_at": null,
            "updated_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/tutorials

Headers

Authorization        

Example: Bearer 6Vagc8ZD6bf14ehEkPdva35

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

sort_by   string  optional    

Field to sort by. Example: created_at

sort_desc   boolean  optional    

Sort order (true for descending, false for ascending). Example: true

page   integer  optional    

Page number for pagination. O campo value deve ser pelo menos 1. Example: 1

per_page   integer  optional    

Number of items per page (max: 100). O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 15

q   string  optional    

Busca por título ou descrição. Example: ordem de serviço

module_id   string  optional    

Filtra pelo UUID do módulo. O campo value deve ser um UUID válido. The uuid of an existing record in the tutorial_modules table. Example: 7801192d-1089-3fa5-a026-a60ca156382b

sector_id   string  optional    

Filtra pelo UUID do setor, ou "geral" para o material sem setor marcado. O campo value deve ser um UUID válido. The uuid of an existing record in the sectors table. Example: 1cd72dd7-fc84-381d-ac32-47068b0d7400

Detalhe do tutorial

requires authentication No specific permission required

Tutorial com os itens em ordem. Fora da visibilidade, responde 404.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/tutorials/1" \
    --header "Authorization: Bearer ZVakh8vEabd15f6cD64Pe3g" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/tutorials/1"
);

const headers = {
    "Authorization": "Bearer ZVakh8vEabd15f6cD64Pe3g",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "8db1e0fb-9416-3fc4-a196-c853f080394a",
        "title": "Natus maxime sed sit",
        "description": "Voluptatem vero doloremque aspernatur est quaerat et.",
        "status": "draft",
        "published_at": null,
        "sort_order": 0,
        "module": {
            "id": "a32930de-8672-4b40-9b10-36d5231e8bb3",
            "name": "Sint dolores",
            "slug": "sint-dolores-306017"
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/tutorials/{id}

Headers

Authorization        

Example: Bearer ZVakh8vEabd15f6cD64Pe3g

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the tutorial. Example: 1

tutorial   string     

UUID do tutorial Example: 019556e7-2e9f-777c-a177-30bbf0646c32

URL do item

requires authentication No specific permission required

Devolve a URL assinada de curta validade para o arquivo no S3, ou o link externo do item. O caminho bruto do S3 nunca é exposto.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/tutorial-items/019556e7-2e9f-777c-a177-30bbf0646c32/url" \
    --header "Authorization: Bearer aDVZkgf56Pd31vc6Ehb84ea" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/tutorial-items/019556e7-2e9f-777c-a177-30bbf0646c32/url"
);

const headers = {
    "Authorization": "Bearer aDVZkgf56Pd31vc6Ehb84ea",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "type": "string",
    "title": "string",
    "url": "string",
    "expires_in": "integer",
    "mime_type": "string",
    "size_bytes": "integer"
}
 

Request      

GET api/tutorial-items/{tutorialItem}/url

Headers

Authorization        

Example: Bearer aDVZkgf56Pd31vc6Ehb84ea

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

tutorialItem   string     

UUID do item Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Contracts

Endpoints for managing work contracts

List contracts

requires authentication contract index

List all work contracts

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/contracts" \
    --header "Authorization: Bearer bafZgdv3D6ak481V6PhEe5c" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"sort_by\": \"Example Sort by\",
    \"sort_desc\": true,
    \"page\": 1,
    \"per_page\": 1,
    \"work_id\": \"66095eea-a5f0-39f4-a2e2-30d6231b78de\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/contracts"
);

const headers = {
    "Authorization": "Bearer bafZgdv3D6ak481V6PhEe5c",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "sort_by": "Example Sort by",
    "sort_desc": true,
    "page": 1,
    "per_page": 1,
    "work_id": "66095eea-a5f0-39f4-a2e2-30d6231b78de"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "93f738fc-9b44-3477-91f9-cb49992badcb",
            "number": "183/2026",
            "started_at": "2026-11-06",
            "deadline_at": "2027-11-06",
            "work": {
                "id": "a32930d2-a557-44f3-a99f-8908aaf74e9b",
                "name": "Sr. Gean Gustavo Verdugo Filho"
            },
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "de9c5313-3990-3101-b964-dd4aebd996b3",
            "number": "068/2026",
            "started_at": "2026-11-06",
            "deadline_at": "2027-11-06",
            "work": {
                "id": "a32930d2-ab55-4e58-881f-fd36ee3b6c45",
                "name": "Dr. Lorenzo Faro Vasques"
            },
            "created_at": null,
            "updated_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/contracts

Headers

Authorization        

Example: Bearer bafZgdv3D6ak481V6PhEe5c

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

sort_by   string  optional    

Sort by. Example: Example Sort by

sort_desc   boolean  optional    

Sort desc. Example: true

page   integer  optional    

Page. O campo value deve ser pelo menos 1. Example: 1

per_page   integer  optional    

Per page. O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 1

work_id   string  optional    

Obra. The uuid of an existing record in the works table. Example: 66095eea-a5f0-39f4-a2e2-30d6231b78de

Create contract

requires authentication contract store

Create a new contract for a work

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/contracts" \
    --header "Authorization: Bearer Z56h64bd1avkVfacDgEeP38" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"work_id\": \"890f7695-e742-330e-a6fc-e8259d5a5d8e\",
    \"number\": \"Example Number\",
    \"started_at\": \"Example Started at\",
    \"deadline_at\": \"Example Deadline at\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/contracts"
);

const headers = {
    "Authorization": "Bearer Z56h64bd1avkVfacDgEeP38",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "work_id": "890f7695-e742-330e-a6fc-e8259d5a5d8e",
    "number": "Example Number",
    "started_at": "Example Started at",
    "deadline_at": "Example Deadline at"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "data": "object"
}
 

Request      

POST api/contracts

Headers

Authorization        

Example: Bearer Z56h64bd1avkVfacDgEeP38

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

work_id   string     

Obra. The uuid of an existing record in the works table. Example: 890f7695-e742-330e-a6fc-e8259d5a5d8e

number   string     

Número do contrato. O campo value não pode ser superior a 255 caracteres. Example: Example Number

started_at   string  optional    

Data de início. O campo value deve ser uma data válida. Example: Example Started at

deadline_at   string  optional    

Prazo. O campo value deve ser uma data válida. O campo value deve ser uma data posterior ou igual a started_at. Example: Example Deadline at

Show contract

requires authentication contract show

Show a work contract

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/contracts/7" \
    --header "Authorization: Bearer 4avfg6bdk1eEc3ZP6Vh58Da" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/contracts/7"
);

const headers = {
    "Authorization": "Bearer 4avfg6bdk1eEc3ZP6Vh58Da",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "8668caed-edf5-3052-95dd-03b3a62b2e88",
        "number": "903/2026",
        "started_at": "2026-11-06",
        "deadline_at": "2027-11-06",
        "work": {
            "id": "a32930d2-bc74-4e6a-92ba-8dc64f7b8446",
            "name": "Talita Rocha Neto"
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/contracts/{id}

Headers

Authorization        

Example: Bearer 4avfg6bdk1eEc3ZP6Vh58Da

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the contract. Example: 7

contract   string     

Contract UUID Example: ut

Update contract

requires authentication contract update

Update a work contract

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/contracts/13" \
    --header "Authorization: Bearer aE5h861geP6akcD4VZf3bdv" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"number\": \"Example Number\",
    \"started_at\": \"Example Started at\",
    \"deadline_at\": \"Example Deadline at\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/contracts/13"
);

const headers = {
    "Authorization": "Bearer aE5h861geP6akcD4VZf3bdv",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "number": "Example Number",
    "started_at": "Example Started at",
    "deadline_at": "Example Deadline at"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": "object"
}
 

Request      

PUT api/contracts/{id}

Headers

Authorization        

Example: Bearer aE5h861geP6akcD4VZf3bdv

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the contract. Example: 13

contract   string     

Contract UUID Example: et

Body Parameters

number   string  optional    

Número do contrato. O campo value não pode ser superior a 255 caracteres. Example: Example Number

started_at   string  optional    

Data de início. O campo value deve ser uma data válida. Example: Example Started at

deadline_at   string  optional    

Prazo. O campo value deve ser uma data válida. O campo value deve ser uma data posterior ou igual a started_at. Example: Example Deadline at

Delete contract

requires authentication contract delete

Delete a work contract

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/contracts/possimus" \
    --header "Authorization: Bearer aD1ZV5h43gePv8kdbaE6fc6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/contracts/possimus"
);

const headers = {
    "Authorization": "Bearer aD1ZV5h43gePv8kdbaE6fc6",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/contracts/{contract}

Headers

Authorization        

Example: Bearer aD1ZV5h43gePv8kdbaE6fc6

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

contract   string     

Contract UUID Example: possimus

Cost Centers

Endpoints for cost centers

Suggest next code

requires authentication cost-center index

Próximo código livre sob o pai informado. O código é sugestão e pode ser alterado antes de salvar.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/cost-centers/next-code?parent_id=sequi" \
    --header "Authorization: Bearer 548vg3Zhka6Dae6dV1cEfbP" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"parent_id\": \"ullam\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cost-centers/next-code"
);

const params = {
    "parent_id": "sequi",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer 548vg3Zhka6Dae6dV1cEfbP",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "parent_id": "ullam"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "code": "001.002"
}
 

Request      

GET api/cost-centers/next-code

Headers

Authorization        

Example: Bearer 548vg3Zhka6Dae6dV1cEfbP

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

parent_id   string  optional    

UUID do centro de custo pai. Omitido, sugere no primeiro nível. Example: sequi

Body Parameters

parent_id   string  optional    

The uuid of an existing record in the cost_centers table. Example: ullam

Cost center requirement

requires authentication cost-center requirement-config index

Data a partir da qual o centro de custo é obrigatório em lançamentos novos. A tela usa isso para marcar o campo como obrigatório sem precisar tentar salvar.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/cost-centers/requirement-config" \
    --header "Authorization: Bearer eb8kg6vaZa43PEDdh5fVc61" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cost-centers/requirement-config"
);

const headers = {
    "Authorization": "Bearer eb8kg6vaZa43PEDdh5fVc61",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "required_from": "2026-11-03",
    "required_now": true
}
 

Request      

GET api/cost-centers/requirement-config

Headers

Authorization        

Example: Bearer eb8kg6vaZa43PEDdh5fVc61

Content-Type        

Example: application/json

Accept        

Example: application/json

Update cost center requirement

requires authentication cost-center requirement-config update

Ajusta a data de corte. Enviar nulo desliga a obrigatoriedade.

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/cost-centers/requirement-config" \
    --header "Authorization: Bearer a14dvbgk68DE3e5ca6hVfZP" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"required_from\": \"2026-11-03\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cost-centers/requirement-config"
);

const headers = {
    "Authorization": "Bearer a14dvbgk68DE3e5ca6hVfZP",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "required_from": "2026-11-03"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "required_from": "2026-11-03",
    "required_now": true
}
 

Request      

PUT api/cost-centers/requirement-config

Headers

Authorization        

Example: Bearer a14dvbgk68DE3e5ca6hVfZP

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

required_from   string     

Data no formato Y-m-d, ou nulo para desligar Example: 2026-11-03

Stock cost center

requires authentication cost-center stock-config index

Centro de custo que recebe a compra de material. A conta a pagar gerada por NF-e de produto nasce nele, porque o custo do material chega à obra pela movimentação de estoque.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/cost-centers/stock-config" \
    --header "Authorization: Bearer e5V6aDab6hcPg3E8d4Zfvk1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cost-centers/stock-config"
);

const headers = {
    "Authorization": "Bearer e5V6aDab6hcPg3E8d4Zfvk1",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "cost_center": {
        "id": "uuid",
        "code": "003.001",
        "name": "Estoque central"
    }
}
 

Request      

GET api/cost-centers/stock-config

Headers

Authorization        

Example: Bearer e5V6aDab6hcPg3E8d4Zfvk1

Content-Type        

Example: application/json

Accept        

Example: application/json

Update stock cost center

requires authentication cost-center stock-config update

Aponta a configuração para outro centro. Nulo desliga: a conta da nota passa a nascer sem centro, para ser classificada na conferência.

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/cost-centers/stock-config" \
    --header "Authorization: Bearer aZekvaV31fh5PEd664cDg8b" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"cost_center_id\": \"nulla\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cost-centers/stock-config"
);

const headers = {
    "Authorization": "Bearer aZekvaV31fh5PEd664cDg8b",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "cost_center_id": "nulla"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "cost_center": {
        "id": "uuid",
        "code": "003.001",
        "name": "Estoque central"
    }
}
 

Request      

PUT api/cost-centers/stock-config

Headers

Authorization        

Example: Bearer aZekvaV31fh5PEd664cDg8b

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

cost_center_id   string     

UUID do centro de custo, ou nulo Example: nulla

List cost centers

requires authentication cost-center index

Lista plana ordenada por código, sem paginação. Cada item traz nível e caminho completo, para o cliente montar a árvore em memória.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/cost-centers?q=vila&active=1" \
    --header "Authorization: Bearer EDafvea6cVP86bh4k51Zgd3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cost-centers"
);

const params = {
    "q": "vila",
    "active": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer EDafvea6cVP86bh4k51Zgd3",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "1fecb133-4ed4-3059-af22-82f27ed71ed2",
            "code": "393",
            "name": "rerum qui",
            "level": 1,
            "path": null,
            "is_active": true,
            "selectable": false,
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "3be773f1-c93f-3cae-a9dd-9292c6bd7cb5",
            "code": "253",
            "name": "libero ipsum",
            "level": 1,
            "path": null,
            "is_active": true,
            "selectable": false,
            "created_at": null,
            "updated_at": null
        }
    ]
}
 

Request      

GET api/cost-centers

Headers

Authorization        

Example: Bearer EDafvea6cVP86bh4k51Zgd3

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

q   string  optional    

Busca por parte do nome ou do código. Example: vila

active   boolean  optional    

Filtra por situação. Omitido, traz ativos e inativos. Example: true

Show cost center

requires authentication cost-center show

Detalhe de um centro de custo

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/cost-centers/similique" \
    --header "Authorization: Bearer aPk8V1aEfgc6ehv3ZD4db56" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cost-centers/similique"
);

const headers = {
    "Authorization": "Bearer aPk8V1aEfgc6ehv3ZD4db56",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "3042b16d-1291-3a54-b150-dc7aca849c6f",
        "code": "877",
        "name": "nemo velit",
        "level": 1,
        "path": null,
        "is_active": true,
        "selectable": false,
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/cost-centers/{costCenter}

Headers

Authorization        

Example: Bearer aPk8V1aEfgc6ehv3ZD4db56

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

costCenter   string     

Cost center UUID Example: similique

Create cost center

requires authentication cost-center store

Cadastra um centro de custo

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/cost-centers" \
    --header "Authorization: Bearer gc6v85de4Z6EabafVPk1hD3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"code\": \"Example Code\",
    \"name\": \"Example Name\",
    \"parent_id\": \"44032399-7256-36ed-94e6-12c6079270b0\",
    \"work_id\": \"f03a30fc-6b80-3b04-88de-1b4630de4963\",
    \"is_active\": true
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cost-centers"
);

const headers = {
    "Authorization": "Bearer gc6v85de4Z6EabafVPk1hD3",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "code": "Example Code",
    "name": "Example Name",
    "parent_id": "44032399-7256-36ed-94e6-12c6079270b0",
    "work_id": "f03a30fc-6b80-3b04-88de-1b4630de4963",
    "is_active": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "string"
}
 

Request      

POST api/cost-centers

Headers

Authorization        

Example: Bearer gc6v85de4Z6EabafVPk1hD3

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

code   string     

Código. Must match the regex /^\d{3}(.\d{3}){0,2}$/. Example: Example Code

name   string     

Nome. O campo value não pode ser superior a 255 caracteres. Example: Example Name

parent_id   string  optional    

Centro de custo pai. The uuid of an existing record in the cost_centers table. Example: 44032399-7256-36ed-94e6-12c6079270b0

work_id   string  optional    

Obra. The uuid of an existing record in the works table. Example: f03a30fc-6b80-3b04-88de-1b4630de4963

is_active   boolean  optional    

Situação. Example: true

Update cost center

requires authentication cost-center update

Atualiza um centro de custo, inclusive a situação (inativar e reativar)

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/cost-centers/molestiae" \
    --header "Authorization: Bearer 3bZDv14Vgd68Eah6ckaf5eP" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"code\": \"Example Code\",
    \"name\": \"Example Name\",
    \"parent_id\": \"d7f6c394-1c23-39be-ae85-cc9846ee564c\",
    \"work_id\": \"b1241cbb-2b84-302d-95e2-e9a517543de1\",
    \"is_active\": true
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cost-centers/molestiae"
);

const headers = {
    "Authorization": "Bearer 3bZDv14Vgd68Eah6ckaf5eP",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "code": "Example Code",
    "name": "Example Name",
    "parent_id": "d7f6c394-1c23-39be-ae85-cc9846ee564c",
    "work_id": "b1241cbb-2b84-302d-95e2-e9a517543de1",
    "is_active": true
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "string"
}
 

Request      

PUT api/cost-centers/{costCenter}

Headers

Authorization        

Example: Bearer 3bZDv14Vgd68Eah6ckaf5eP

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

costCenter   string     

Cost center UUID Example: molestiae

Body Parameters

code   string  optional    

Código. Must match the regex /^\d{3}(.\d{3}){0,2}$/. Example: Example Code

name   string  optional    

Nome. O campo value não pode ser superior a 255 caracteres. Example: Example Name

parent_id   string  optional    

Centro de custo pai. The uuid of an existing record in the cost_centers table. Example: d7f6c394-1c23-39be-ae85-cc9846ee564c

work_id   string  optional    

Obra. The uuid of an existing record in the works table. Example: b1241cbb-2b84-302d-95e2-e9a517543de1

is_active   boolean  optional    

Situação. Example: true

Delete cost center

requires authentication cost-center delete

Exclui um centro de custo. Só é permitido quando ele não tem centros abaixo nem lançamentos.

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/cost-centers/est" \
    --header "Authorization: Bearer 6kPacbg86ZDd3hEVf41aev5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cost-centers/est"
);

const headers = {
    "Authorization": "Bearer 6kPacbg86ZDd3hEVf41aev5",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/cost-centers/{costCenter}

Headers

Authorization        

Example: Bearer 6kPacbg86ZDd3hEVf41aev5

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

costCenter   string     

Cost center UUID Example: est

Customers

Endpoints for customers

List customers

requires authentication customers index

List all customers

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/customers?sort_by=created_at&sort_desc=1&page=1&per_page=15&q=Customer+name" \
    --header "Authorization: Bearer hg65bEvfkPea8ac1dD34VZ6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/customers"
);

const params = {
    "sort_by": "created_at",
    "sort_desc": "1",
    "page": "1",
    "per_page": "15",
    "q": "Customer name",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer hg65bEvfkPea8ac1dD34VZ6",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "811e1fee-765b-3741-84d5-fe71938cf0f0",
            "name": "Melina Tainara Paes",
            "email": "gabi.leon@example.net",
            "phone": "(53) 99793-4521",
            "document": "132.010.415-05",
            "type": "pf",
            "responsible": "Mirella Ferraz",
            "image": {
                "id": null,
                "url": null
            },
            "address": {
                "street": null,
                "number": null,
                "complement": null,
                "neighborhood": null,
                "city": null,
                "state": null,
                "zip_code": null
            },
            "documents_count": 0
        },
        {
            "id": "e511b023-0393-3e00-8fbf-b9db76c8b367",
            "name": "Artur Azevedo Cordeiro",
            "email": "iserrano@example.net",
            "phone": "(74) 3914-0167",
            "document": "943.564.016-89",
            "type": "pj",
            "responsible": "Sra. Nathalia Janaina Medina",
            "image": {
                "id": null,
                "url": null
            },
            "address": {
                "street": null,
                "number": null,
                "complement": null,
                "neighborhood": null,
                "city": null,
                "state": null,
                "zip_code": null
            },
            "documents_count": 0
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/customers

Headers

Authorization        

Example: Bearer hg65bEvfkPea8ac1dD34VZ6

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

sort_by   string  optional    

Field to sort by. Example: created_at

sort_desc   boolean  optional    

Sort order (true for descending, false for ascending). Example: true

page   integer  optional    

Page number for pagination. O campo value deve ser pelo menos 1. Example: 1

per_page   integer  optional    

Number of items per page (max: 100). O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 15

q   string  optional    

Search query. Example: Customer name

Create customer

requires authentication customers store

Create a new customer

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/customers" \
    --header "Authorization: Bearer ahV3Ed5c6g84ZD6Pa1bvfek" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"email\": \"user@example.com\",
    \"phone\": \"(11) 99999-9999\",
    \"document\": \"Example Document\",
    \"type\": \"Example Type\",
    \"responsible\": \"Example Responsible\",
    \"image\": {
        \"0\": \"example1\",
        \"1\": \"example2\",
        \"path\": \"Example Image path\",
        \"name\": \"Example Name\",
        \"extension\": \"Example Image extension\",
        \"size\": \"Example Image size\"
    },
    \"address\": {
        \"0\": \"example1\",
        \"1\": \"example2\",
        \"street\": \"Example Address street\",
        \"number\": \"Example Address number\",
        \"complement\": \"Example Address complement\",
        \"neighborhood\": \"Example Address neighborhood\",
        \"city\": \"Example Address city\",
        \"state\": \"Example Address state\",
        \"zip_code\": \"Example Address zip code\"
    }
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/customers"
);

const headers = {
    "Authorization": "Bearer ahV3Ed5c6g84ZD6Pa1bvfek",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "email": "user@example.com",
    "phone": "(11) 99999-9999",
    "document": "Example Document",
    "type": "Example Type",
    "responsible": "Example Responsible",
    "image": {
        "0": "example1",
        "1": "example2",
        "path": "Example Image path",
        "name": "Example Name",
        "extension": "Example Image extension",
        "size": "Example Image size"
    },
    "address": {
        "0": "example1",
        "1": "example2",
        "street": "Example Address street",
        "number": "Example Address number",
        "complement": "Example Address complement",
        "neighborhood": "Example Address neighborhood",
        "city": "Example Address city",
        "state": "Example Address state",
        "zip_code": "Example Address zip code"
    }
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "string"
}
 

Request      

POST api/customers

Headers

Authorization        

Example: Bearer ahV3Ed5c6g84ZD6Pa1bvfek

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Nome. Example: Example Name

email   string  optional    

E-mail. O campo value deve ser um endereço de e-mail válido. Example: user@example.com

phone   string  optional    

Telefone. Example: (11) 99999-9999

document   string     

CPF/CNPJ. Example: Example Document

type   string     

Tipo. Example: Example Type

Must be one of:
  • pf
  • pj
responsible   string  optional    

Responsável. Example: Example Responsible

image   object  optional    

Imagem.

path   string  optional    

Caminho da imagem. This field is required when image is present. Example: Example Image path

name   string  optional    

Nome da imagem. Example: Example Name

extension   string  optional    

Extensão da imagem. Example: Example Image extension

size   string  optional    

Tamanho da imagem. Example: Example Image size

address   object     

Endereço.

street   string     

Rua. Example: Example Address street

number   string     

Número. Example: Example Address number

complement   string  optional    

Complemento. Example: Example Address complement

neighborhood   string     

Bairro. Example: Example Address neighborhood

city   string     

Cidade. Example: Example Address city

state   string     

Estado. Example: Example Address state

zip_code   string     

CEP. Example: Example Address zip code

Get customer

requires authentication customers index

Get a customer

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/customers/15" \
    --header "Authorization: Bearer f158cbk4gZha6edaDV6PvE3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/customers/15"
);

const headers = {
    "Authorization": "Bearer f158cbk4gZha6edaDV6PvE3",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "4f0b01d9-bafc-3057-9ef6-28778c1ce8f8",
        "name": "Jasmin Medina Prado",
        "email": "isabelly.vieira@example.net",
        "phone": "(33) 3719-3275",
        "document": "704.131.446-40",
        "type": "pf",
        "responsible": "Sr. Joaquin da Rosa",
        "image": {
            "id": null,
            "url": null
        },
        "address": {
            "street": null,
            "number": null,
            "complement": null,
            "neighborhood": null,
            "city": null,
            "state": null,
            "zip_code": null
        },
        "documents_count": 0
    }
}
 

Request      

GET api/customers/{id}

Headers

Authorization        

Example: Bearer f158cbk4gZha6edaDV6PvE3

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the customer. Example: 15

customer   string     

Customer ID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Update customer

requires authentication customers update

Update a customer

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/customers/13" \
    --header "Authorization: Bearer ZDgbh4kvdae51PfV8c63E6a" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"email\": \"user@example.com\",
    \"phone\": \"(11) 99999-9999\",
    \"document\": \"Example Document\",
    \"type\": \"Example Type\",
    \"responsible\": \"Example Responsible\",
    \"image\": {
        \"0\": \"example1\",
        \"1\": \"example2\",
        \"path\": \"Example Image path\",
        \"name\": \"Example Name\",
        \"extension\": \"Example Image extension\",
        \"size\": \"Example Image size\"
    },
    \"address\": {
        \"0\": \"example1\",
        \"1\": \"example2\",
        \"street\": \"Example Address street\",
        \"number\": \"Example Address number\",
        \"complement\": \"Example Address complement\",
        \"neighborhood\": \"Example Address neighborhood\",
        \"city\": \"Example Address city\",
        \"state\": \"Example Address state\",
        \"zip_code\": \"Example Address zip code\"
    }
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/customers/13"
);

const headers = {
    "Authorization": "Bearer ZDgbh4kvdae51PfV8c63E6a",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "email": "user@example.com",
    "phone": "(11) 99999-9999",
    "document": "Example Document",
    "type": "Example Type",
    "responsible": "Example Responsible",
    "image": {
        "0": "example1",
        "1": "example2",
        "path": "Example Image path",
        "name": "Example Name",
        "extension": "Example Image extension",
        "size": "Example Image size"
    },
    "address": {
        "0": "example1",
        "1": "example2",
        "street": "Example Address street",
        "number": "Example Address number",
        "complement": "Example Address complement",
        "neighborhood": "Example Address neighborhood",
        "city": "Example Address city",
        "state": "Example Address state",
        "zip_code": "Example Address zip code"
    }
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "string"
}
 

Request      

PUT api/customers/{id}

Headers

Authorization        

Example: Bearer ZDgbh4kvdae51PfV8c63E6a

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the customer. Example: 13

customer   string     

Customer ID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Body Parameters

name   string  optional    

Nome. Example: Example Name

email   string  optional    

E-mail. O campo value deve ser um endereço de e-mail válido. Example: user@example.com

phone   string  optional    

Telefone. Example: (11) 99999-9999

document   string  optional    

CPF/CNPJ. Example: Example Document

type   string  optional    

Tipo. Example: Example Type

Must be one of:
  • pf
  • pj
responsible   string  optional    

Responsável. Example: Example Responsible

image   object  optional    

Imagem.

path   string  optional    

Caminho da imagem. This field is required when image is present. Example: Example Image path

name   string  optional    

Nome da imagem. Example: Example Name

extension   string  optional    

Extensão da imagem. Example: Example Image extension

size   string  optional    

Tamanho da imagem. Example: Example Image size

address   object  optional    

Endereço.

street   string  optional    

Rua. Example: Example Address street

number   string  optional    

Número. Example: Example Address number

complement   string  optional    

Complemento. Example: Example Address complement

neighborhood   string  optional    

Bairro. Example: Example Address neighborhood

city   string  optional    

Cidade. Example: Example Address city

state   string  optional    

Estado. Example: Example Address state

zip_code   string  optional    

CEP. Example: Example Address zip code

Delete customer

requires authentication customers delete

Delete a customer

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/customers/019556e7-2e9f-777c-a177-30bbf0646c32" \
    --header "Authorization: Bearer cV36kh8PaZg5d4eab61fvDE" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/customers/019556e7-2e9f-777c-a177-30bbf0646c32"
);

const headers = {
    "Authorization": "Bearer cV36kh8PaZg5d4eab61fvDE",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/customers/{customer}

Headers

Authorization        

Example: Bearer cV36kh8PaZg5d4eab61fvDE

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

customer   string     

Customer ID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Daily Logs (RDO)

Endpoints for managing daily work reports (RDO)

List daily logs

requires authentication daily-log index

List all daily work reports (RDO)

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/daily-logs" \
    --header "Authorization: Bearer dV4b35PcgE1a6Zv68fakDeh" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"sort_by\": \"Example Sort by\",
    \"sort_desc\": true,
    \"page\": 1,
    \"per_page\": 1,
    \"q\": \"Example Q\",
    \"work_id\": \"42a8e40b-4084-3d99-9ee1-38c0215c4943\",
    \"contract_id\": \"7a1afc68-e4b1-3d9d-b49c-9fdc813b8442\",
    \"status_id\": \"b6b3413a-33e5-3777-b125-bddb339d7133\",
    \"filled_by\": \"9d33be52-6299-3bec-a242-5a8b3f93607b\",
    \"responsible_id\": \"a6536e25-0724-3313-a927-2cc7b710b772\",
    \"date_from\": \"2024-01-01\",
    \"date_to\": \"2024-01-01\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/daily-logs"
);

const headers = {
    "Authorization": "Bearer dV4b35PcgE1a6Zv68fakDeh",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "sort_by": "Example Sort by",
    "sort_desc": true,
    "page": 1,
    "per_page": 1,
    "q": "Example Q",
    "work_id": "42a8e40b-4084-3d99-9ee1-38c0215c4943",
    "contract_id": "7a1afc68-e4b1-3d9d-b49c-9fdc813b8442",
    "status_id": "b6b3413a-33e5-3777-b125-bddb339d7133",
    "filled_by": "9d33be52-6299-3bec-a242-5a8b3f93607b",
    "responsible_id": "a6536e25-0724-3313-a927-2cc7b710b772",
    "date_from": "2024-01-01",
    "date_to": "2024-01-01"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "a883db44-cb97-33b3-91fb-a4c9a9b75dba",
            "code": "RDO-06-11-26",
            "report_number": 1,
            "date": "2026-11-06",
            "status": {
                "id": "a32930d3-1f6c-40b0-918c-deee11810e86",
                "slug": null,
                "name": null,
                "abbreviation": "suscipit",
                "color": "#39f20d",
                "text_color": "#30ee4b"
            },
            "work": {
                "id": "a32930d3-1879-4340-a323-da8a43af2ac2",
                "name": "Sr. Giovane Correia Madeira",
                "started_at": "2013-08-23 12:37:55"
            },
            "filled_by": {
                "id": "a32930d3-1cde-438a-8afb-6c2da2b9a53e",
                "name": "Prof. Sofia Sipes I"
            },
            "contract_number": "619/2026",
            "deadline_at": "2027-11-06",
            "technical_responsible": {
                "name": null,
                "certification": null,
                "crea": null
            },
            "activities": [],
            "occurrences": null,
            "next_day_forecast": null,
            "finalized_at": null,
            "has_signed_document": false,
            "content_hash": null,
            "gov_br_validation_url": null,
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "9d103509-90a5-3167-8f06-0c110470dea1",
            "code": "RDO-06-11-26",
            "report_number": 1,
            "date": "2026-11-06",
            "status": {
                "id": "a32930d3-282c-47b5-8e44-1409ed1d3f94",
                "slug": null,
                "name": null,
                "abbreviation": "esse",
                "color": "#5a982f",
                "text_color": "#8f0f02"
            },
            "work": {
                "id": "a32930d3-22e0-4c36-a0ca-d2fc2b926211",
                "name": "Dr. Saulo Maldonado Alcantara Jr.",
                "started_at": "1975-09-04 11:56:55"
            },
            "filled_by": {
                "id": "a32930d3-26be-4893-ade1-5673e90458cc",
                "name": "Janie Kris PhD"
            },
            "contract_number": "449/2026",
            "deadline_at": "2027-11-06",
            "technical_responsible": {
                "name": null,
                "certification": null,
                "crea": null
            },
            "activities": [],
            "occurrences": null,
            "next_day_forecast": null,
            "finalized_at": null,
            "has_signed_document": false,
            "content_hash": null,
            "gov_br_validation_url": null,
            "created_at": null,
            "updated_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/daily-logs

Headers

Authorization        

Example: Bearer dV4b35PcgE1a6Zv68fakDeh

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

sort_by   string  optional    

Sort by. Example: Example Sort by

sort_desc   boolean  optional    

Sort desc. Example: true

page   integer  optional    

Page. O campo value deve ser pelo menos 1. Example: 1

per_page   integer  optional    

Per page. O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 1

q   string  optional    

Busca. Example: Example Q

work_id   string  optional    

Obra. The uuid of an existing record in the works table. Example: 42a8e40b-4084-3d99-9ee1-38c0215c4943

contract_id   string  optional    

Contrato. The uuid of an existing record in the contracts table. Example: 7a1afc68-e4b1-3d9d-b49c-9fdc813b8442

status_id   string  optional    

Status. The uuid of an existing record in the statuses table. Example: b6b3413a-33e5-3777-b125-bddb339d7133

filled_by   string  optional    

Preenchido por. The uuid of an existing record in the users table. Example: 9d33be52-6299-3bec-a242-5a8b3f93607b

responsible_id   string  optional    

Responsável. The uuid of an existing record in the users table. Example: a6536e25-0724-3313-a927-2cc7b710b772

date_from   string  optional    

Data inicial. O campo value deve ser uma data válida. Example: 2024-01-01

date_to   string  optional    

Data final. O campo value deve ser uma data válida. Example: 2024-01-01

Pending RDO days

requires authentication daily-log index

List the days in a period that have no RDO for a given work

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/daily-logs/pending-days" \
    --header "Authorization: Bearer akVcEhv5a18eZDP6d346fgb" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"contract_id\": \"Example Contract id\",
    \"date_from\": \"2024-01-01\",
    \"date_to\": \"2024-01-01\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/daily-logs/pending-days"
);

const headers = {
    "Authorization": "Bearer akVcEhv5a18eZDP6d346fgb",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "contract_id": "Example Contract id",
    "date_from": "2024-01-01",
    "date_to": "2024-01-01"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": [
        "2026-07-01",
        "2026-07-02"
    ]
}
 

Request      

GET api/daily-logs/pending-days

Headers

Authorization        

Example: Bearer akVcEhv5a18eZDP6d346fgb

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

contract_id   string     

Contrato. The uuid of an existing record in the contracts table. Example: Example Contract id

date_from   string     

Data inicial. O campo value deve ser uma data válida. Example: 2024-01-01

date_to   string     

Data final. O campo value deve ser uma data válida. O campo value deve ser uma data posterior ou igual a date_from. O campo value deve ser uma data anterior ou igual a 9999-12-31. Example: 2024-01-01

Show daily log

requires authentication daily-log show

Show a daily work report (RDO)

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/daily-logs/dignissimos" \
    --header "Authorization: Bearer c1Vavhk4EfDbgZae6d6835P" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/daily-logs/dignissimos"
);

const headers = {
    "Authorization": "Bearer c1Vavhk4EfDbgZae6d6835P",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "10f99192-db4b-355a-affa-2aafd2351392",
        "code": "RDO-06-11-26",
        "report_number": 1,
        "date": "2026-11-06",
        "status": {
            "id": "a32930d3-3e6b-4d9f-9128-3e7e4d65f274",
            "slug": null,
            "name": null,
            "abbreviation": "voluptatum",
            "color": "#54be68",
            "text_color": "#5195e4"
        },
        "work": {
            "id": "a32930d3-33be-467b-bc66-ea311f6fff40",
            "name": "Samanta Marisa Neves",
            "started_at": "2005-08-31 21:12:00"
        },
        "filled_by": {
            "id": "a32930d3-3c9a-4d84-b6bf-30c9a10991af",
            "name": "Prof. Emmalee Keebler"
        },
        "contract_number": "852/2026",
        "deadline_at": "2027-11-06",
        "technical_responsible": {
            "name": null,
            "certification": null,
            "crea": null
        },
        "activities": [],
        "occurrences": null,
        "next_day_forecast": null,
        "finalized_at": null,
        "has_signed_document": false,
        "content_hash": null,
        "gov_br_validation_url": null,
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/daily-logs/{dailyLog}

Headers

Authorization        

Example: Bearer c1Vavhk4EfDbgZae6d6835P

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

dailyLog   string     

Daily Log UUID Example: dignissimos

Create daily log

requires authentication daily-log store

Open a new daily work report (RDO) for a work

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/daily-logs" \
    --header "Authorization: Bearer gZPc1bEv83Dahade6Vf645k" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"contract_id\": \"Example Contract id\",
    \"date\": \"2024-01-01\",
    \"status_id\": \"7b4b8ea3-21d5-3f11-b3fd-00d9106221b4\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/daily-logs"
);

const headers = {
    "Authorization": "Bearer gZPc1bEv83Dahade6Vf645k",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "contract_id": "Example Contract id",
    "date": "2024-01-01",
    "status_id": "7b4b8ea3-21d5-3f11-b3fd-00d9106221b4"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "data": "object"
}
 

Request      

POST api/daily-logs

Headers

Authorization        

Example: Bearer gZPc1bEv83Dahade6Vf645k

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

contract_id   string     

Contrato. The uuid of an existing record in the contracts table. Example: Example Contract id

date   string     

Data do RDO. O campo value deve ser uma data válida. Example: 2024-01-01

status_id   string  optional    

Status. The uuid of an existing record in the statuses table. Example: 7b4b8ea3-21d5-3f11-b3fd-00d9106221b4

Update daily log

requires authentication daily-log update

Update a draft RDO: weather, team, activities, occurrences and next-day forecast

Example request:
curl --request PATCH \
    "https://api.bs-homolog.pensou.app.br/api/daily-logs/ipsa" \
    --header "Authorization: Bearer 5bDvVdfk1gPE8eZca34ah66" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"activities\": \"Example Activities\",
    \"occurrences\": \"Example Occurrences\",
    \"next_day_forecast\": \"Example Next day forecast\",
    \"weather\": [
        {
            \"shift\": \"Example Weather * shift\",
            \"weather\": \"Example Weather * weather\"
        },
        null
    ],
    \"teams\": [
        {
            \"employee_role_id\": \"01a32f83-7ea6-4c43-a83c-07b082ee64ba\",
            \"quantity\": 1
        },
        null
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/daily-logs/ipsa"
);

const headers = {
    "Authorization": "Bearer 5bDvVdfk1gPE8eZca34ah66",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "activities": "Example Activities",
    "occurrences": "Example Occurrences",
    "next_day_forecast": "Example Next day forecast",
    "weather": [
        {
            "shift": "Example Weather * shift",
            "weather": "Example Weather * weather"
        },
        null
    ],
    "teams": [
        {
            "employee_role_id": "01a32f83-7ea6-4c43-a83c-07b082ee64ba",
            "quantity": 1
        },
        null
    ]
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": "object"
}
 

Request      

PATCH api/daily-logs/{dailyLog}

Headers

Authorization        

Example: Bearer 5bDvVdfk1gPE8eZca34ah66

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

dailyLog   string     

Daily Log UUID Example: ipsa

Body Parameters

activities   string  optional    

Atividades executadas. Example: Example Activities

occurrences   string  optional    

Ocorrências. Example: Example Occurrences

next_day_forecast   string  optional    

Previsão do dia seguinte. Example: Example Next day forecast

weather   object[]  optional    

Registro do tempo.

shift   string  optional    

Turno. This field is required when weather is present. Example: Example Weather * shift

Must be one of:
  • manha
  • tarde
  • noite
weather   string  optional    

Clima. This field is required when weather is present. Example: Example Weather * weather

Must be one of:
  • sol
  • sol_nuvens
  • chuva
  • tempestade
teams   object[]  optional    

Composição da equipe.

employee_role_id   string  optional    

Função. This field is required when teams is present. The uuid of an existing record in the employee_roles table. Example: 01a32f83-7ea6-4c43-a83c-07b082ee64ba

quantity   integer  optional    

Quantidade. This field is required when teams is present. O campo value deve ser pelo menos 1. Example: 1

Finalize daily log

requires authentication daily-log finalize

Validate, stamp and lock a draft RDO (Rascunho → Finalizado)

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/daily-logs/quas/finalize" \
    --header "Authorization: Bearer 1fPZav3edD6achkg65bEV84" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/daily-logs/quas/finalize"
);

const headers = {
    "Authorization": "Bearer 1fPZav3edD6achkg65bEV84",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": "object"
}
 

Request      

POST api/daily-logs/{dailyLog}/finalize

Headers

Authorization        

Example: Bearer 1fPZav3edD6achkg65bEV84

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

dailyLog   string     

Daily Log UUID Example: quas

Attach gov.br signed document

requires authentication daily-log finalize

Attach the gov.br-signed PDF and validation link to a finalized RDO

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/daily-logs/omnis/signed-document" \
    --header "Authorization: Bearer b1hgfePvca6635DZd4Ea8kV" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"path\": \"Example Path\",
    \"name\": \"Example Name\",
    \"size\": \"Example Size\",
    \"extension\": \"Example Extension\",
    \"gov_br_validation_url\": \"https:\\/\\/example.com\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/daily-logs/omnis/signed-document"
);

const headers = {
    "Authorization": "Bearer b1hgfePvca6635DZd4Ea8kV",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "path": "Example Path",
    "name": "Example Name",
    "size": "Example Size",
    "extension": "Example Extension",
    "gov_br_validation_url": "https:\/\/example.com"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": "object"
}
 

Request      

POST api/daily-logs/{dailyLog}/signed-document

Headers

Authorization        

Example: Bearer b1hgfePvca6635DZd4Ea8kV

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

dailyLog   string     

Daily Log UUID Example: omnis

Body Parameters

path   string     

Arquivo assinado. Example: Example Path

name   string  optional    

Nome do arquivo. Example: Example Name

size   string  optional    

Size. Example: Example Size

extension   string  optional    

Extension. Example: Example Extension

gov_br_validation_url   string  optional    

Link de validação (gov.br). Must be a valid URL. Must match the regex /^https:\/\/([a-z0-9-]+.)*gov.br(\/|$)/i. O campo value não pode ser superior a 2048 caracteres. Example: https://example.com

Reopen daily log

requires authentication daily-log reopen

Send a finalized RDO back to draft (Finalizado → Rascunho). Refused when a gov.br-signed document is attached

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/daily-logs/praesentium/reopen" \
    --header "Authorization: Bearer vhc61feag4dka3ZDP85E6bV" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/daily-logs/praesentium/reopen"
);

const headers = {
    "Authorization": "Bearer vhc61feag4dka3ZDP85E6bV",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": "object"
}
 

Request      

POST api/daily-logs/{dailyLog}/reopen

Headers

Authorization        

Example: Bearer vhc61feag4dka3ZDP85E6bV

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

dailyLog   string     

Daily Log UUID Example: praesentium

Attach photos

requires authentication daily-log update

Attach photographs (already uploaded to storage) to a draft RDO

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/daily-logs/vel/photos" \
    --header "Authorization: Bearer kag648favch5Z6bED1dPVe3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"photos\": [
        {
            \"path\": \"Example Photos * path\",
            \"name\": \"Example Name\",
            \"size\": \"Example Photos * size\",
            \"extension\": \"Example Photos * extension\",
            \"caption\": \"Example Photos * caption\"
        },
        null
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/daily-logs/vel/photos"
);

const headers = {
    "Authorization": "Bearer kag648favch5Z6bED1dPVe3",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "photos": [
        {
            "path": "Example Photos * path",
            "name": "Example Name",
            "size": "Example Photos * size",
            "extension": "Example Photos * extension",
            "caption": "Example Photos * caption"
        },
        null
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "data": "object"
}
 

Request      

POST api/daily-logs/{dailyLog}/photos

Headers

Authorization        

Example: Bearer kag648favch5Z6bED1dPVe3

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

dailyLog   string     

Daily Log UUID Example: vel

Body Parameters

photos   object[]     

Fotos. O campo value deve ter pelo menos 1 itens.

path   string     

Arquivo. Example: Example Photos * path

name   string  optional    

Nome do arquivo. Example: Example Name

size   string  optional    

Photos size. Example: `Example Photos size`

extension   string  optional    

Photos extension. Example: `Example Photos extension`

caption   string  optional    

Legenda. Example: Example Photos * caption

Update photo caption

requires authentication daily-log update

Update the caption of a photo in a draft RDO

Example request:
curl --request PATCH \
    "https://api.bs-homolog.pensou.app.br/api/daily-logs/quia/photos/iusto" \
    --header "Authorization: Bearer e6D16k5bfa4E8aZVvcdg3hP" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"caption\": \"Example Caption\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/daily-logs/quia/photos/iusto"
);

const headers = {
    "Authorization": "Bearer e6D16k5bfa4E8aZVvcdg3hP",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "caption": "Example Caption"
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": "object"
}
 

Request      

PATCH api/daily-logs/{dailyLog}/photos/{id}

Headers

Authorization        

Example: Bearer e6D16k5bfa4E8aZVvcdg3hP

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

dailyLog   string     

Daily Log UUID Example: quia

id   string     

The ID of the photo. Example: iusto

photo   string     

Photo (File) UUID Example: error

Body Parameters

caption   string  optional    

Legenda. Example: Example Caption

Delete photo

requires authentication daily-log update

Remove a photo from a draft RDO

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/daily-logs/ex/photos/assumenda" \
    --header "Authorization: Bearer avd345eP8fc6hVaEZ1gD6bk" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/daily-logs/ex/photos/assumenda"
);

const headers = {
    "Authorization": "Bearer avd345eP8fc6hVaEZ1gD6bk",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/daily-logs/{dailyLog}/photos/{photo}

Headers

Authorization        

Example: Bearer avd345eP8fc6hVaEZ1gD6bk

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

dailyLog   string     

Daily Log UUID Example: ex

photo   string     

Photo (File) UUID Example: assumenda

Delete daily log

requires authentication daily-log delete

Delete a draft daily work report (RDO)

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/daily-logs/quis" \
    --header "Authorization: Bearer Vf53kdb64DZgc16hEePvaa8" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/daily-logs/quis"
);

const headers = {
    "Authorization": "Bearer Vf53kdb64DZgc16hEePvaa8",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/daily-logs/{dailyLog}

Headers

Authorization        

Example: Bearer Vf53kdb64DZgc16hEePvaa8

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

dailyLog   string     

Daily Log UUID Example: quis

Disciplines

Endpoints for engineering disciplines

List disciplines

requires authentication discipline index

List all disciplines

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/disciplines?q=El%C3%A9trico&active=1" \
    --header "Authorization: Bearer k6av86begcEP54aDfdZ31hV" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/disciplines"
);

const params = {
    "q": "Elétrico",
    "active": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer k6av86begcEP54aDfdZ31hV",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "57eb260a-c907-399c-a3b0-fd81396472f6",
            "name": "Earum",
            "code": "XUR",
            "description": "Accusamus sunt inventore provident neque rerum laborum.",
            "active": true
        },
        {
            "id": "d3a51374-0865-31fc-b932-a86317408b58",
            "name": "Qui",
            "code": "EJD",
            "description": "Quidem aut voluptas aliquam neque eaque.",
            "active": true
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/disciplines

Headers

Authorization        

Example: Bearer k6av86begcEP54aDfdZ31hV

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

q   string  optional    

Search query. Example: Elétrico

active   string  optional    

Filter by active status. Example: true

Must be one of:
  • true
  • false
  • 1
  • 0

Show discipline

requires authentication discipline show

Show a discipline

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/disciplines/1" \
    --header "Authorization: Bearer cgaV5f83dvEbaeZkhPD6146" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/disciplines/1"
);

const headers = {
    "Authorization": "Bearer cgaV5f83dvEbaeZkhPD6146",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "66e4e855-7e81-3b8f-969f-dab872963e6e",
        "name": "Aliquid",
        "code": "PSA",
        "description": "Id et quod quia assumenda.",
        "active": true
    }
}
 

Request      

GET api/disciplines/{id}

Headers

Authorization        

Example: Bearer cgaV5f83dvEbaeZkhPD6146

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the discipline. Example: 1

discipline   string     

Discipline UUID Example: voluptatem

Create discipline

requires authentication discipline store

Create a new discipline

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/disciplines" \
    --header "Authorization: Bearer eV436ghvfPk8Zd5EDbc16aa" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"code\": \"Example Code\",
    \"description\": \"Example Description\",
    \"active\": true
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/disciplines"
);

const headers = {
    "Authorization": "Bearer eV436ghvfPk8Zd5EDbc16aa",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "code": "Example Code",
    "description": "Example Description",
    "active": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "string"
}
 

Request      

POST api/disciplines

Headers

Authorization        

Example: Bearer eV436ghvfPk8Zd5EDbc16aa

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

nome. Example: Example Name

code   string  optional    

código. Example: Example Code

description   string  optional    

descrição. Example: Example Description

active   boolean  optional    

ativo. Example: true

Update discipline

requires authentication discipline update

Update a discipline

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/disciplines/1" \
    --header "Authorization: Bearer 4h6561fZPkEDad3aeVvb8gc" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"code\": \"Example Code\",
    \"description\": \"Example Description\",
    \"active\": true
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/disciplines/1"
);

const headers = {
    "Authorization": "Bearer 4h6561fZPkEDad3aeVvb8gc",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "code": "Example Code",
    "description": "Example Description",
    "active": true
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "string"
}
 

Request      

PUT api/disciplines/{id}

Headers

Authorization        

Example: Bearer 4h6561fZPkEDad3aeVvb8gc

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the discipline. Example: 1

discipline   string     

Discipline UUID Example: qui

Body Parameters

name   string     

nome. Example: Example Name

code   string  optional    

código. Example: Example Code

description   string  optional    

descrição. Example: Example Description

active   boolean  optional    

ativo. Example: true

Delete discipline

requires authentication discipline delete

Delete a discipline

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/disciplines/doloribus" \
    --header "Authorization: Bearer 516fkbaD64Zeg3cadVEh8Pv" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/disciplines/doloribus"
);

const headers = {
    "Authorization": "Bearer 516fkbaD64Zeg3cadVEh8Pv",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/disciplines/{discipline}

Headers

Authorization        

Example: Bearer 516fkbaD64Zeg3cadVEh8Pv

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

discipline   string     

Discipline UUID Example: doloribus

Document Categories

Endpoints for document categories

List document categories

requires authentication document-category index

List all document categories

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/document-categories?q=Contracts&module=employee" \
    --header "Authorization: Bearer Z346a5vV1gebkhdEaf6c8DP" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/document-categories"
);

const params = {
    "q": "Contracts",
    "module": "employee",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer Z346a5vV1gebkhdEaf6c8DP",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "3c3df169-acbf-3661-b77d-1458535aefd2",
            "name": "Srta. Daniela Nicole Feliciano",
            "description": "Sunt voluptas voluptas ad et quo. Assumenda odit animi eos quo eaque velit. Eaque dicta fugiat est nobis provident magni. Impedit nostrum autem numquam blanditiis.",
            "module": "document"
        },
        {
            "id": "5b399b6a-34fc-36d7-a3f8-ab93d3c9e4d4",
            "name": "Dr. Jácomo Sanches Fonseca Jr.",
            "description": "Et nesciunt facere vitae explicabo. Aliquid atque qui voluptatum laborum. Esse laudantium quis pariatur nobis. Sit eos dolor assumenda est.",
            "module": "document"
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/document-categories

Headers

Authorization        

Example: Bearer Z346a5vV1gebkhdEaf6c8DP

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

q   string  optional    

Search query. Example: Contracts

module   string  optional    

Filter by module. Example: employee

Show document category

requires authentication document-category show

Show a document category

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/document-categories/neque" \
    --header "Authorization: Bearer ZDe45cgaPdvfV1E683kb6ah" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/document-categories/neque"
);

const headers = {
    "Authorization": "Bearer ZDe45cgaPdvfV1E683kb6ah",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "c0ed6c3f-1ab6-3f8a-9721-1726de23d601",
        "name": "Emiliano James Jimenes",
        "description": "Nam laboriosam sint qui quasi velit voluptatem. Asperiores cum rerum architecto. Iusto deleniti non consequuntur nisi. Et fugit et amet. Dignissimos placeat inventore est vel.",
        "module": "document"
    }
}
 

Request      

GET api/document-categories/{documentCategory}

Headers

Authorization        

Example: Bearer ZDe45cgaPdvfV1E683kb6ah

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

documentCategory   string     

Document category UUID Example: neque

Create document category

requires authentication document-category store

Create a new document category

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/document-categories" \
    --header "Authorization: Bearer DkEPf5Vh6a16v8dbg3cea4Z" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"description\": \"Example Description\",
    \"module\": \"Example Module\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/document-categories"
);

const headers = {
    "Authorization": "Bearer DkEPf5Vh6a16v8dbg3cea4Z",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "description": "Example Description",
    "module": "Example Module"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "string"
}
 

Request      

POST api/document-categories

Headers

Authorization        

Example: Bearer DkEPf5Vh6a16v8dbg3cea4Z

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Name. Example: Example Name

description   string  optional    

Description. Example: Example Description

module   string     

Module. Example: Example Module

Update document category

requires authentication document-category update

Update a document category

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/document-categories/explicabo" \
    --header "Authorization: Bearer 4dkcf163eEVPZhbD856vaag" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"description\": \"Example Description\",
    \"module\": \"Example Module\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/document-categories/explicabo"
);

const headers = {
    "Authorization": "Bearer 4dkcf163eEVPZhbD856vaag",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "description": "Example Description",
    "module": "Example Module"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "string"
}
 

Request      

PUT api/document-categories/{documentCategory}

Headers

Authorization        

Example: Bearer 4dkcf163eEVPZhbD856vaag

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

documentCategory   string     

Document category UUID Example: explicabo

Body Parameters

name   string     

Name. Example: Example Name

description   string  optional    

Description. Example: Example Description

module   string     

Module. Example: Example Module

Delete document category

requires authentication document-category delete

Delete a document category

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/document-categories/iste" \
    --header "Authorization: Bearer b1Phvd6ZVD4kgae58caf63E" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/document-categories/iste"
);

const headers = {
    "Authorization": "Bearer b1Phvd6ZVD4kgae58caf63E",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/document-categories/{documentCategory}

Headers

Authorization        

Example: Bearer b1Phvd6ZVD4kgae58caf63E

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

documentCategory   string     

Document category UUID Example: iste

Documents

Endpoints for documents

List documents

requires authentication documents index

List all documents

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/documents?sort_by=created_at&sort_desc=1&page=1&per_page=15&q=Document+name&categories[]=esse&documentable_type=ipsam&customers[]=recusandae&suppliers[]=qui" \
    --header "Authorization: Bearer 581k4ZgfDbEha3eaVP6c6vd" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/documents"
);

const params = {
    "sort_by": "created_at",
    "sort_desc": "1",
    "page": "1",
    "per_page": "15",
    "q": "Document name",
    "categories[0]": "esse",
    "documentable_type": "ipsam",
    "customers[0]": "recusandae",
    "suppliers[0]": "qui",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer 581k4ZgfDbEha3eaVP6c6vd",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "a6ca2073-0012-32ca-a458-188dd25b1452",
            "name": "Sandro Santana Pena Jr.",
            "file": {
                "id": null,
                "url": null,
                "extension": null
            },
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "8e77517d-4e4b-3216-8a0f-03276fc947b7",
            "name": "Sr. Wellington Marinho Tamoio",
            "file": {
                "id": null,
                "url": null,
                "extension": null
            },
            "created_at": null,
            "updated_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/documents

Headers

Authorization        

Example: Bearer 581k4ZgfDbEha3eaVP6c6vd

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

sort_by   string  optional    

Field to sort by. Example: created_at

sort_desc   boolean  optional    

Sort order (true for descending, false for ascending). Example: true

page   integer  optional    

Page number for pagination. O campo value deve ser pelo menos 1. Example: 1

per_page   integer  optional    

Number of items per page (max: 100). O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 15

q   string  optional    

Example: Document name

categories   string[]  optional    

The uuid of an existing record in the document_categories table.

documentable_type   string  optional    

Type of the related documentable entity. The type of an existing record in the documentables table. Example: ipsam

customers   string[]  optional    

The uuid of an existing record in the customers table.

suppliers   string[]  optional    

The uuid of an existing record in the suppliers table.

Get document

requires authentication documents show

Get a document

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/documents/2" \
    --header "Authorization: Bearer 584kZPvd6f36ceV1DgEhbaa" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/documents/2"
);

const headers = {
    "Authorization": "Bearer 584kZPvd6f36ceV1DgEhbaa",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "bb2b348f-27e8-34e6-86e7-5c2dfe56c500",
        "name": "Sr. Christian das Neves",
        "file": {
            "id": null,
            "url": null,
            "extension": null
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/documents/{id}

Headers

Authorization        

Example: Bearer 584kZPvd6f36ceV1DgEhbaa

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the document. Example: 2

document   string     

Document ID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Create document

requires authentication documents store

Create a new document

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/documents" \
    --header "Authorization: Bearer 5fZ8P66kb4VahEcea3g1Ddv" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"category_id\": \"03b426aa-3efd-326e-bf9f-031c5729f1e7\",
    \"file\": {
        \"0\": \"example1\",
        \"1\": \"example2\",
        \"path\": \"Example File path\",
        \"name\": \"Example Name\",
        \"extension\": \"Example File extension\",
        \"size\": \"Example File size\"
    },
    \"documentable_type\": \"Example Documentable type\",
    \"documentable_id\": \"Example Documentable id\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/documents"
);

const headers = {
    "Authorization": "Bearer 5fZ8P66kb4VahEcea3g1Ddv",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "category_id": "03b426aa-3efd-326e-bf9f-031c5729f1e7",
    "file": {
        "0": "example1",
        "1": "example2",
        "path": "Example File path",
        "name": "Example Name",
        "extension": "Example File extension",
        "size": "Example File size"
    },
    "documentable_type": "Example Documentable type",
    "documentable_id": "Example Documentable id"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "string"
}
 

Request      

POST api/documents

Headers

Authorization        

Example: Bearer 5fZ8P66kb4VahEcea3g1Ddv

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Nome. Example: Example Name

category_id   string     

Categoria. The uuid of an existing record in the document_categories table. Example: 03b426aa-3efd-326e-bf9f-031c5729f1e7

file   object     

Arquivo.

path   string  optional    

Caminho do arquivo. This field is required when file is present. Example: Example File path

name   string     

Nome do arquivo. Example: Example Name

extension   string     

Extensão do arquivo. Example: Example File extension

size   string     

Tamanho do arquivo. Example: Example File size

documentable_type   string     

Tipo de relacionado do documento. Example: Example Documentable type

Must be one of:
  • customer
  • work
  • work_location
  • supplier
  • employee
documentable_id   string     

Relacionado do documento. Example: Example Documentable id

Update document

requires authentication documents update

Update a document

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/documents/18" \
    --header "Authorization: Bearer Dbhvfk6g3aVae1c564dPEZ8" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"category_id\": \"dc97c3e4-4cb0-31b6-8516-42612b189a76\",
    \"file\": {
        \"0\": \"example1\",
        \"1\": \"example2\",
        \"path\": \"Example File path\",
        \"name\": \"Example Name\",
        \"extension\": \"Example File extension\",
        \"size\": \"Example File size\"
    },
    \"documentable_type\": \"Example Documentable type\",
    \"documentable_id\": \"Example Documentable id\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/documents/18"
);

const headers = {
    "Authorization": "Bearer Dbhvfk6g3aVae1c564dPEZ8",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "category_id": "dc97c3e4-4cb0-31b6-8516-42612b189a76",
    "file": {
        "0": "example1",
        "1": "example2",
        "path": "Example File path",
        "name": "Example Name",
        "extension": "Example File extension",
        "size": "Example File size"
    },
    "documentable_type": "Example Documentable type",
    "documentable_id": "Example Documentable id"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "string"
}
 

Request      

PUT api/documents/{id}

Headers

Authorization        

Example: Bearer Dbhvfk6g3aVae1c564dPEZ8

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the document. Example: 18

document   string     

Document ID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Body Parameters

name   string  optional    

Nome. Example: Example Name

category_id   string  optional    

Categoria. The uuid of an existing record in the document_categories table. Example: dc97c3e4-4cb0-31b6-8516-42612b189a76

file   object  optional    

Arquivo.

path   string  optional    

Caminho do arquivo. This field is required when file is present. Example: Example File path

name   string  optional    

Nome do arquivo. Example: Example Name

extension   string  optional    

Extensão do arquivo. Example: Example File extension

size   string  optional    

Tamanho do arquivo. Example: Example File size

documentable_type   string  optional    

Documentable type. Example: Example Documentable type

Must be one of:
  • customer
  • work
  • work_location
  • supplier
  • employee
documentable_id   string  optional    

Documentable id. Example: Example Documentable id

Delete document

requires authentication documents delete

Delete a document

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/documents/019556e7-2e9f-777c-a177-30bbf0646c32" \
    --header "Authorization: Bearer P3kcE8ev4dh6a1baD6gZfV5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/documents/019556e7-2e9f-777c-a177-30bbf0646c32"
);

const headers = {
    "Authorization": "Bearer P3kcE8ev4dh6a1baD6gZfV5",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/documents/{document}

Headers

Authorization        

Example: Bearer P3kcE8ev4dh6a1baD6gZfV5

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

document   string     

Document ID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

EPI Renewals

Endpoints for EPI pending renewals

List EPI renewals

requires authentication employee-epi index

List pending/ignored (default) or completed EPI renewals. Ignored items remain in the default listing with renewal_status=ignored

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/epi-renewals" \
    --header "Authorization: Bearer E6khedv6VgZa48P31bDaf5c" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"q\": \"qui\",
    \"renewal_status\": \"completed\",
    \"urgency\": \"expires_7_days\",
    \"employee_id\": \"similique\",
    \"epi_type_id\": \"voluptatem\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/epi-renewals"
);

const headers = {
    "Authorization": "Bearer E6khedv6VgZa48P31bDaf5c",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "q": "qui",
    "renewal_status": "completed",
    "urgency": "expires_7_days",
    "employee_id": "similique",
    "epi_type_id": "voluptatem"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/epi-renewals

Headers

Authorization        

Example: Bearer E6khedv6VgZa48P31bDaf5c

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

q   string  optional    

Example: qui

renewal_status   string  optional    

Example: completed

Must be one of:
  • pending
  • completed
  • ignored
urgency   string  optional    

Example: expires_7_days

Must be one of:
  • expired
  • expires_7_days
  • expires_30_days
employee_id   string  optional    

The uuid of an existing record in the employees table. Example: similique

epi_type_id   string  optional    

The uuid of an existing record in the epi_types table. Example: voluptatem

EPI renewals summary

requires authentication employee-epi index

Counts of renewals by urgency (pending and ignored; ignore only silences notifications)

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/epi-renewals/summary" \
    --header "Authorization: Bearer Z65daDekhf1b6Ecv3agPV84" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/epi-renewals/summary"
);

const headers = {
    "Authorization": "Bearer Z65daDekhf1b6Ecv3agPV84",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/epi-renewals/summary

Headers

Authorization        

Example: Bearer Z65daDekhf1b6Ecv3agPV84

Content-Type        

Example: application/json

Accept        

Example: application/json

Renew EPI delivery

requires authentication employee-epi update

Renew an EPI delivery with a new delivery date

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/epi-renewals/nobis/renew" \
    --header "Authorization: Bearer fkdePv5ab163ah64ZVD8Egc" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"quantity\": 1,
    \"condition\": \"new\",
    \"confirm_insufficient_stock\": true
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/epi-renewals/nobis/renew"
);

const headers = {
    "Authorization": "Bearer fkdePv5ab163ah64ZVD8Egc",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "quantity": 1,
    "condition": "new",
    "confirm_insufficient_stock": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/epi-renewals/{id}/renew

Headers

Authorization        

Example: Bearer fkdePv5ab163ah64ZVD8Egc

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

EPI delivery UUID Example: nobis

Body Parameters

quantity   integer  optional    

Quantidade entregue. O campo value deve ser pelo menos 1. Example: 1

condition   string  optional    

Condição do EPI. Example: new

Must be one of:
  • new
  • used
  • reformed
confirm_insufficient_stock   boolean  optional    

Example: true

Ignore EPI renewal

requires authentication employee-epi update

Ignore expiry alerts for an EPI delivery

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/epi-renewals/et/ignore" \
    --header "Authorization: Bearer bvd31VZDPaE8feh64g56kca" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"ignore_reason\": \"Colaborador afastado temporariamente\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/epi-renewals/et/ignore"
);

const headers = {
    "Authorization": "Bearer bvd31VZDPaE8feh64g56kca",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "ignore_reason": "Colaborador afastado temporariamente"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/epi-renewals/{id}/ignore

Headers

Authorization        

Example: Bearer bvd31VZDPaE8feh64g56kca

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

EPI delivery UUID Example: et

Body Parameters

ignore_reason   string     

Motivo para ignorar o alerta de vencimento. O campo value não pode ser superior a 500 caracteres. Example: Colaborador afastado temporariamente

Unignore EPI renewal

requires authentication employee-epi update

Resume expiry alerts for an EPI delivery

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/epi-renewals/quo/ignore" \
    --header "Authorization: Bearer e6146haabVk8Zfgdc3EP5Dv" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/epi-renewals/quo/ignore"
);

const headers = {
    "Authorization": "Bearer e6146haabVk8Zfgdc3EP5Dv",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (200):



 

Request      

DELETE api/epi-renewals/{id}/ignore

Headers

Authorization        

Example: Bearer e6146haabVk8Zfgdc3EP5Dv

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

EPI delivery UUID Example: quo

EPI Types

Endpoints for EPI types catalog

List EPI types

requires authentication epi index

List all EPI types

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/epi-types" \
    --header "Authorization: Bearer 5kcDEhve1Vb64d8fg3aZ6aP" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"q\": \"impedit\",
    \"stock_id\": \"molestias\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/epi-types"
);

const headers = {
    "Authorization": "Bearer 5kcDEhve1Vb64d8fg3aZ6aP",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "q": "impedit",
    "stock_id": "molestias"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "d9fdefcd-730f-3ce1-b206-7bc358879da6",
            "name": "tenetur corporis",
            "default_validity_days": 132,
            "requires_signature": false,
            "numero_ca": "33970",
            "product": null,
            "available_quantity": null,
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "aae51571-e144-325d-a3f6-9fb438fd8971",
            "name": "blanditiis numquam",
            "default_validity_days": 600,
            "requires_signature": true,
            "numero_ca": "14471",
            "product": null,
            "available_quantity": null,
            "created_at": null,
            "updated_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/epi-types

Headers

Authorization        

Example: Bearer 5kcDEhve1Vb64d8fg3aZ6aP

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

q   string  optional    

Example: impedit

stock_id   string  optional    

The uuid of an existing record in the stocks table. Example: molestias

List catalog products that could become EPI

requires authentication epi index

Products sitting in a family flagged as EPI that do not have EPI attributes yet. Being here does not make a product an EPI: it becomes one when someone gives it a validity, through the create endpoint with action link_existing.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/epi-types/candidates" \
    --header "Authorization: Bearer vk6aeD5VE6g184fhbcZdPa3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"q\": \"voluptatem\",
    \"stock_id\": \"qui\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/epi-types/candidates"
);

const headers = {
    "Authorization": "Bearer vk6aeD5VE6g184fhbcZdPa3",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "q": "voluptatem",
    "stock_id": "qui"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/epi-types/candidates

Headers

Authorization        

Example: Bearer vk6aeD5VE6g184fhbcZdPa3

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

q   string  optional    

Example: voluptatem

stock_id   string  optional    

The uuid of an existing record in the stocks table. Example: qui

Show EPI type

requires authentication epi show

Show an EPI type

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/epi-types/in" \
    --header "Authorization: Bearer 16af4dEcZPb8Vkvh3ga56De" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/epi-types/in"
);

const headers = {
    "Authorization": "Bearer 16af4dEcZPb8Vkvh3ga56De",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "45f1f2e8-d09a-332b-97a5-61b05be65e12",
        "name": "quasi nobis",
        "default_validity_days": 718,
        "requires_signature": false,
        "numero_ca": "29193",
        "product": null,
        "available_quantity": null,
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/epi-types/{epiType}

Headers

Authorization        

Example: Bearer 16af4dEcZPb8Vkvh3ga56De

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

epiType   string     

EPI type UUID Example: in

Create EPI type

requires authentication epi store

Create a new EPI type

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/epi-types" \
    --header "Authorization: Bearer 1aca6bD5e4P3E8gVZf6hvdk" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"default_validity_days\": 1,
    \"requires_signature\": true,
    \"numero_ca\": \"Example Numero ca\",
    \"action\": \"Example Action\",
    \"product_id\": \"2802fd96-0375-363b-9424-9c0074749743\",
    \"product_family_id\": \"ae3b6cc0-82cb-31a2-bf69-4bc6a108e8d5\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/epi-types"
);

const headers = {
    "Authorization": "Bearer 1aca6bD5e4P3E8gVZf6hvdk",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "default_validity_days": 1,
    "requires_signature": true,
    "numero_ca": "Example Numero ca",
    "action": "Example Action",
    "product_id": "2802fd96-0375-363b-9424-9c0074749743",
    "product_family_id": "ae3b6cc0-82cb-31a2-bf69-4bc6a108e8d5"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "string"
}
 

Request      

POST api/epi-types

Headers

Authorization        

Example: Bearer 1aca6bD5e4P3E8gVZf6hvdk

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Nome. Example: Example Name

default_validity_days   integer     

Validade padrão (dias). O campo value deve ser pelo menos 1. Example: 1

requires_signature   boolean  optional    

Exige assinatura. Example: true

numero_ca   string  optional    

Número do CA. O campo value não pode ser superior a 20 caracteres. Example: Example Numero ca

action   string     

Ação. Example: Example Action

Must be one of:
  • link_existing
  • create_new
product_id   string  optional    

Produto. This field is required when action is link_existing. The uuid of an existing record in the products table. Example: 2802fd96-0375-363b-9424-9c0074749743

product_family_id   string  optional    

Família do produto. This field is required when action is create_new. The uuid of an existing record in the product_families table. Example: ae3b6cc0-82cb-31a2-bf69-4bc6a108e8d5

requires authentication epi update

Link several EPI types to catalog products at once, creating the product where it does not exist yet. All or nothing: one refusal rolls back the whole batch.

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/epi-types/link-products" \
    --header "Authorization: Bearer Zah1kEfd468be6cVa5gPD3v" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"items\": [
        {
            \"epi_type_id\": \"ac97cac5-93ac-38a6-b367-18ddcf4c12f0\",
            \"action\": \"Example Items * action\",
            \"product_id\": \"20a1aea7-32f0-3a61-9574-f584c96c120b\",
            \"product_family_id\": \"4b96d1ce-6c9b-3e49-8726-164eddd6863f\"
        },
        null
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/epi-types/link-products"
);

const headers = {
    "Authorization": "Bearer Zah1kEfd468be6cVa5gPD3v",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "items": [
        {
            "epi_type_id": "ac97cac5-93ac-38a6-b367-18ddcf4c12f0",
            "action": "Example Items * action",
            "product_id": "20a1aea7-32f0-3a61-9574-f584c96c120b",
            "product_family_id": "4b96d1ce-6c9b-3e49-8726-164eddd6863f"
        },
        null
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Link an EPI type to a catalog product

requires authentication epi update

Link one EPI type to an existing product, or create the product from the EPI type name.

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/epi-types/quibusdam/product" \
    --header "Authorization: Bearer hab3Eav1k4de56DZgcP6Vf8" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"action\": \"Example Action\",
    \"product_id\": \"cfea8774-231b-3b33-a59d-a5965608090e\",
    \"product_family_id\": \"cb769bdf-707f-34fc-a6f0-9738ea171af9\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/epi-types/quibusdam/product"
);

const headers = {
    "Authorization": "Bearer hab3Eav1k4de56DZgcP6Vf8",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "action": "Example Action",
    "product_id": "cfea8774-231b-3b33-a59d-a5965608090e",
    "product_family_id": "cb769bdf-707f-34fc-a6f0-9738ea171af9"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/epi-types/{epiType}/product

Headers

Authorization        

Example: Bearer hab3Eav1k4de56DZgcP6Vf8

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

epiType   string     

EPI type UUID Example: quibusdam

Body Parameters

action   string     

Ação. Example: Example Action

Must be one of:
  • link_existing
  • create_new
product_id   string  optional    

Produto. This field is required when action is link_existing. The uuid of an existing record in the products table. Example: cfea8774-231b-3b33-a59d-a5965608090e

product_family_id   string  optional    

Família do produto. This field is required when action is create_new. The uuid of an existing record in the product_families table. Example: cb769bdf-707f-34fc-a6f0-9738ea171af9

Update EPI type

requires authentication epi update

Update an EPI type

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/epi-types/sed" \
    --header "Authorization: Bearer 3ba516Z6dPake4cvhE8DfVg" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"default_validity_days\": 1,
    \"requires_signature\": true,
    \"numero_ca\": \"Example Numero ca\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/epi-types/sed"
);

const headers = {
    "Authorization": "Bearer 3ba516Z6dPake4cvhE8DfVg",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "default_validity_days": 1,
    "requires_signature": true,
    "numero_ca": "Example Numero ca"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "string"
}
 

Request      

PUT api/epi-types/{epiType}

Headers

Authorization        

Example: Bearer 3ba516Z6dPake4cvhE8DfVg

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

epiType   string     

EPI type UUID Example: sed

Body Parameters

name   string     

Nome. Example: Example Name

default_validity_days   integer     

Validade padrão (dias). O campo value deve ser pelo menos 1. Example: 1

requires_signature   boolean  optional    

Exige assinatura. Example: true

numero_ca   string  optional    

Número do CA. O campo value não pode ser superior a 20 caracteres. Example: Example Numero ca

Delete EPI type

requires authentication epi delete

Delete an EPI type

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/epi-types/qui" \
    --header "Authorization: Bearer 53c1akh46fgeZv8PDbadE6V" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/epi-types/qui"
);

const headers = {
    "Authorization": "Bearer 53c1akh46fgeZv8PDbadE6V",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/epi-types/{epiType}

Headers

Authorization        

Example: Bearer 53c1akh46fgeZv8PDbadE6V

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

epiType   string     

EPI type UUID Example: qui

Employee Roles

Endpoints for employee roles

List employee roles

requires authentication employee-role index

List all employee roles

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/employee-roles?sort_by=created_at&sort_desc=1&page=1&per_page=15&q=Manager" \
    --header "Authorization: Bearer bheDv84dkcEaa3V5PZg6f61" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employee-roles"
);

const params = {
    "sort_by": "created_at",
    "sort_desc": "1",
    "page": "1",
    "per_page": "15",
    "q": "Manager",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer bheDv84dkcEaa3V5PZg6f61",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "eb699d11-843d-4c50-ab91-3f4e5976ac36",
            "name": "minus",
            "description": "Occaecati sequi asperiores natus perferendis assumenda.",
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "8871aa91-4714-4548-ac4f-d14b092051e1",
            "name": "ea",
            "description": null,
            "created_at": null,
            "updated_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/employee-roles

Headers

Authorization        

Example: Bearer bheDv84dkcEaa3V5PZg6f61

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

sort_by   string  optional    

Field to sort by. Example: created_at

sort_desc   boolean  optional    

Sort order (true for descending, false for ascending). Example: true

page   integer  optional    

Page number for pagination. O campo value deve ser pelo menos 1. Example: 1

per_page   integer  optional    

Number of items per page (max: 100). O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 15

q   string  optional    

Search query. Example: Manager

Show employee role

requires authentication employee-role show

Show an employee role

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/employee-roles/quo" \
    --header "Authorization: Bearer Dc8kbg5dvh6E31ZePaf6a4V" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employee-roles/quo"
);

const headers = {
    "Authorization": "Bearer Dc8kbg5dvh6E31ZePaf6a4V",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "62db63c9-5795-48bb-8965-8e1299b61c4d",
        "name": "et",
        "description": "Fuga molestiae sequi dolore incidunt aliquam doloribus et.",
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/employee-roles/{employeeRole}

Headers

Authorization        

Example: Bearer Dc8kbg5dvh6E31ZePaf6a4V

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employeeRole   string     

Employee Role UUID Example: quo

Create employee role

requires authentication employee-role store

Create a new employee role

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/employee-roles" \
    --header "Authorization: Bearer baE6g3a8hP5kdZfe1VvcD46" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"description\": \"Example Description\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employee-roles"
);

const headers = {
    "Authorization": "Bearer baE6g3a8hP5kdZfe1VvcD46",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "description": "Example Description"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "string"
}
 

Request      

POST api/employee-roles

Headers

Authorization        

Example: Bearer baE6g3a8hP5kdZfe1VvcD46

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Nome. O campo value não pode ser superior a 255 caracteres. Example: Example Name

description   string  optional    

Descrição. Example: Example Description

Update employee role

requires authentication employee-role update

Update an employee role

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/employee-roles/a" \
    --header "Authorization: Bearer Vev56DhP6d3f8baa4kEZgc1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"description\": \"Example Description\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employee-roles/a"
);

const headers = {
    "Authorization": "Bearer Vev56DhP6d3f8baa4kEZgc1",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "description": "Example Description"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "string"
}
 

Request      

PUT api/employee-roles/{employeeRole}

Headers

Authorization        

Example: Bearer Vev56DhP6d3f8baa4kEZgc1

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employeeRole   string     

Employee Role UUID Example: a

Body Parameters

name   string  optional    

Nome. O campo value não pode ser superior a 255 caracteres. Example: Example Name

description   string  optional    

Descrição. Example: Example Description

Delete employee role

requires authentication employee-role delete

Delete an employee role

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/employee-roles/quaerat" \
    --header "Authorization: Bearer 6fdDg6avbZ51kPE34ae8chV" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employee-roles/quaerat"
);

const headers = {
    "Authorization": "Bearer 6fdDg6avbZ51kPE34ae8chV",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/employee-roles/{employeeRole}

Headers

Authorization        

Example: Bearer 6fdDg6avbZ51kPE34ae8chV

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employeeRole   string     

Employee Role UUID Example: quaerat

Employees

Endpoints for employees

List EPI terms

requires authentication employee-epi index

List initial EPI kit terms globally

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/epi-terms" \
    --header "Authorization: Bearer 36db4v6feaaVkcEPh5D18Zg" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"sort_by\": \"created_at\",
    \"sort_desc\": false,
    \"page\": 83,
    \"per_page\": 7,
    \"q\": \"ducimus\",
    \"employee_id\": \"explicabo\",
    \"has_term\": false
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/epi-terms"
);

const headers = {
    "Authorization": "Bearer 36db4v6feaaVkcEPh5D18Zg",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "sort_by": "created_at",
    "sort_desc": false,
    "page": 83,
    "per_page": 7,
    "q": "ducimus",
    "employee_id": "explicabo",
    "has_term": false
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/epi-terms

Headers

Authorization        

Example: Bearer 36db4v6feaaVkcEPh5D18Zg

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

sort_by   string  optional    

Example: created_at

Must be one of:
  • delivery_date
  • created_at
sort_desc   boolean  optional    

Example: false

page   integer  optional    

O campo value deve ser pelo menos 1. Example: 83

per_page   integer  optional    

O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 7

q   string  optional    

Example: ducimus

employee_id   string  optional    

The uuid of an existing record in the employees table. Example: explicabo

has_term   boolean  optional    

Example: false

List employees

requires authentication employee index

List all employees

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/employees?sort_by=created_at&sort_desc=1&page=1&per_page=15&q=Jo%C3%A3o+Silva&status=active&employee_roles[]=aut&admission_date_from=2026-01-01&admission_date_to=2026-12-31" \
    --header "Authorization: Bearer k1aDhfecbE6v4Z5VaP8g36d" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees"
);

const params = {
    "sort_by": "created_at",
    "sort_desc": "1",
    "page": "1",
    "per_page": "15",
    "q": "João Silva",
    "status": "active",
    "employee_roles[0]": "aut",
    "admission_date_from": "2026-01-01",
    "admission_date_to": "2026-12-31",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer k1aDhfecbE6v4Z5VaP8g36d",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "d0e4caf8-defc-45aa-8851-fd1ec1d3310d",
            "name": "Dr. Andres Esteves Rocha",
            "cpf": "867.897.553-26",
            "rg": "784239244",
            "ctps": "099741685",
            "phone": null,
            "birthdate": null,
            "email": null,
            "pis_pasep": null,
            "admission_date": "1996-06-16",
            "daily_salary": null,
            "monthly_salary": "3580.27",
            "nationality": "Reino Unido",
            "place_of_birth": "Salgado do Norte",
            "status": "active",
            "status_label": "Ativo",
            "address": {
                "street": null,
                "number": null,
                "complement": null,
                "neighborhood": null,
                "city": null,
                "state": null,
                "zip_code": null
            },
            "employee_role": {
                "id": "a32930d3-c4bf-41a3-80c0-93b3c68f3ed7",
                "name": "a"
            },
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "91ee0370-4ebf-4ec2-8b37-ea517757e22e",
            "name": "Paulina Delvalle Aragão Neto",
            "cpf": "963.783.762-76",
            "rg": "587816859",
            "ctps": null,
            "phone": "(34) 92267-6535",
            "birthdate": null,
            "email": "nfaria@example.org",
            "pis_pasep": null,
            "admission_date": "1972-02-17",
            "daily_salary": "337.81",
            "monthly_salary": "5509.60",
            "nationality": "Granada",
            "place_of_birth": "Lorena do Norte",
            "status": "active",
            "status_label": "Ativo",
            "address": {
                "street": null,
                "number": null,
                "complement": null,
                "neighborhood": null,
                "city": null,
                "state": null,
                "zip_code": null
            },
            "employee_role": {
                "id": "a32930d3-c78b-4c99-8146-22b88e228452",
                "name": "excepturi"
            },
            "created_at": null,
            "updated_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": "/?page=82",
        "next": null
    },
    "meta": {
        "current_page": 83,
        "from": 821,
        "last_page": 1,
        "links": [
            {
                "url": "/?page=82",
                "label": "&laquo; Anterior",
                "page": 82,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": false
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 822,
        "total": 2
    }
}
 

Request      

GET api/employees

Headers

Authorization        

Example: Bearer k1aDhfecbE6v4Z5VaP8g36d

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

sort_by   string  optional    

Field to sort by. Example: created_at

sort_desc   boolean  optional    

Sort order (true for descending, false for ascending). Example: true

page   integer  optional    

Page number for pagination. O campo value deve ser pelo menos 1. Example: 1

per_page   integer  optional    

Number of items per page (max: 100). O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 15

q   string  optional    

Search query. Example: João Silva

status   string  optional    

Filtrar por situação (active, inactive ou all). Sem o parâmetro, lista apenas ativos. Example: active

Must be one of:
  • active
  • inactive
  • all
employee_roles   string[]  optional    

The uuid of an existing record in the employee_roles table.

admission_date_from   string  optional    

Data inicial do período de admissão. O campo value deve ser uma data válida. Example: 2026-01-01

admission_date_to   string  optional    

Data final do período de admissão. O campo value deve ser uma data válida. O campo value deve ser uma data posterior ou igual a admission_date_from. Example: 2026-12-31

Export employees to Excel

requires authentication employee export

Dispatches async Excel generation using the same filters as the listing. Frontend is notified via Pusher when ready.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/employees/excel?sort_by=created_at&sort_desc=1&page=1&per_page=15&q=Jo%C3%A3o+Silva&status=active&employee_roles[]=adipisci&admission_date_from=2026-01-01&admission_date_to=2026-12-31" \
    --header "Authorization: Bearer 6dP3fZheaVv5gE4Dk6c1b8a" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/excel"
);

const params = {
    "sort_by": "created_at",
    "sort_desc": "1",
    "page": "1",
    "per_page": "15",
    "q": "João Silva",
    "status": "active",
    "employee_roles[0]": "adipisci",
    "admission_date_from": "2026-01-01",
    "admission_date_to": "2026-12-31",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer 6dP3fZheaVv5gE4Dk6c1b8a",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (202):


{
    "message": "string",
    "channel": "string",
    "event": "string"
}
 

Example response (422):


{
    "message": "string"
}
 

Request      

GET api/employees/excel

Headers

Authorization        

Example: Bearer 6dP3fZheaVv5gE4Dk6c1b8a

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

sort_by   string  optional    

Field to sort by. Example: created_at

sort_desc   boolean  optional    

Sort order (true for descending, false for ascending). Example: true

page   integer  optional    

Page number for pagination. O campo value deve ser pelo menos 1. Example: 1

per_page   integer  optional    

Number of items per page (max: 100). O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 15

q   string  optional    

Search query. Example: João Silva

status   string  optional    

Filtrar por situação (active, inactive ou all). Sem o parâmetro, lista apenas ativos. Example: active

Must be one of:
  • active
  • inactive
  • all
employee_roles   string[]  optional    

The uuid of an existing record in the employee_roles table.

admission_date_from   string  optional    

Data inicial do período de admissão. O campo value deve ser uma data válida. Example: 2026-01-01

admission_date_to   string  optional    

Data final do período de admissão. O campo value deve ser uma data válida. O campo value deve ser uma data posterior ou igual a admission_date_from. Example: 2026-12-31

Show employee

requires authentication employee show

Show an employee

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/employees/14" \
    --header "Authorization: Bearer 5EZ4cbavVad6e8h6PD3gf1k" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/14"
);

const headers = {
    "Authorization": "Bearer 5EZ4cbavVad6e8h6PD3gf1k",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "5562c256-0a47-47f6-b532-3fca001131e0",
        "name": "Pedro Quintana Saito Jr.",
        "cpf": "779.215.532-11",
        "rg": null,
        "ctps": "104218161",
        "phone": "(91) 98093-8287",
        "birthdate": null,
        "email": "mari93@example.org",
        "pis_pasep": null,
        "admission_date": "2025-08-28",
        "daily_salary": null,
        "monthly_salary": null,
        "nationality": "Botsuana",
        "place_of_birth": null,
        "status": "active",
        "status_label": "Ativo",
        "address": {
            "street": null,
            "number": null,
            "complement": null,
            "neighborhood": null,
            "city": null,
            "state": null,
            "zip_code": null
        },
        "employee_role": {
            "id": "a32930d3-d26a-4aa4-84d2-e31bb7f77b4b",
            "name": "dolorem"
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/employees/{id}

Headers

Authorization        

Example: Bearer 5EZ4cbavVad6e8h6PD3gf1k

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the employee. Example: 14

employee   string     

Employee ID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Create employee

requires authentication employee store

Create a new employee

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/employees" \
    --header "Authorization: Bearer a6fePV8dD5EZv4361gabhck" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"cpf\": \"Example Cpf\",
    \"rg\": \"Example Rg\",
    \"ctps\": \"Example Ctps\",
    \"phone\": \"(11) 99999-9999\",
    \"birthdate\": \"2024-01-01\",
    \"email\": \"user@example.com\",
    \"employee_role_id\": \"76a98e89-a78e-44ad-a79e-f3c883325589\",
    \"pis_pasep\": \"Example Pis pasep\",
    \"admission_date\": \"2024-01-01\",
    \"daily_salary\": 1,
    \"monthly_salary\": 1,
    \"nationality\": \"Example Nationality\",
    \"place_of_birth\": \"Example Place of birth\",
    \"address\": {
        \"0\": \"example1\",
        \"1\": \"example2\",
        \"street\": \"Example Address street\",
        \"number\": \"Example Address number\",
        \"complement\": \"Example Address complement\",
        \"neighborhood\": \"Example Address neighborhood\",
        \"city\": \"Example Address city\",
        \"state\": \"Example Address state\",
        \"zip_code\": \"Example Address zip code\"
    }
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees"
);

const headers = {
    "Authorization": "Bearer a6fePV8dD5EZv4361gabhck",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "cpf": "Example Cpf",
    "rg": "Example Rg",
    "ctps": "Example Ctps",
    "phone": "(11) 99999-9999",
    "birthdate": "2024-01-01",
    "email": "user@example.com",
    "employee_role_id": "76a98e89-a78e-44ad-a79e-f3c883325589",
    "pis_pasep": "Example Pis pasep",
    "admission_date": "2024-01-01",
    "daily_salary": 1,
    "monthly_salary": 1,
    "nationality": "Example Nationality",
    "place_of_birth": "Example Place of birth",
    "address": {
        "0": "example1",
        "1": "example2",
        "street": "Example Address street",
        "number": "Example Address number",
        "complement": "Example Address complement",
        "neighborhood": "Example Address neighborhood",
        "city": "Example Address city",
        "state": "Example Address state",
        "zip_code": "Example Address zip code"
    }
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "data": {
        "id": "d4242a28-54cf-4c3b-a238-9038e02fc161",
        "name": "Yuri Sales Jr.",
        "cpf": "101.433.457-09",
        "rg": null,
        "ctps": "384887878",
        "phone": null,
        "birthdate": "1980-08-08",
        "email": "sepulveda.joao@example.com",
        "pis_pasep": null,
        "admission_date": "1973-09-14",
        "daily_salary": "471.13",
        "monthly_salary": "6613.67",
        "nationality": null,
        "place_of_birth": null,
        "status": "active",
        "status_label": "Ativo",
        "address": {
            "street": null,
            "number": null,
            "complement": null,
            "neighborhood": null,
            "city": null,
            "state": null,
            "zip_code": null
        },
        "employee_role": {
            "id": "a32930d3-dad0-4255-8cea-214680db3df6",
            "name": "fugiat"
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

POST api/employees

Headers

Authorization        

Example: Bearer a6fePV8dD5EZv4361gabhck

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Nome. O campo value não pode ser superior a 255 caracteres. Example: Example Name

cpf   string     

CPF. O campo value deve ser 14 caracteres. Example: Example Cpf

rg   string  optional    

RG. O campo value não pode ser superior a 20 caracteres. Example: Example Rg

ctps   string  optional    

CTPS. O campo value não pode ser superior a 20 caracteres. Example: Example Ctps

phone   string  optional    

Telefone. O campo value não pode ser superior a 20 caracteres. Example: (11) 99999-9999

birthdate   string  optional    

Data de Nascimento. O campo value deve ser uma data válida. Example: 2024-01-01

email   string  optional    

E-mail. O campo value deve ser um endereço de e-mail válido. Example: user@example.com

employee_role_id   string     

Cargo. The uuid of an existing record in the employee_roles table. Example: 76a98e89-a78e-44ad-a79e-f3c883325589

pis_pasep   string  optional    

PIS/PASEP. O campo value deve ter 11 dígitos. Example: Example Pis pasep

admission_date   string  optional    

Data de Admissão. O campo value deve ser uma data válida. O campo value deve ser uma data anterior ou igual a today. Example: 2024-01-01

daily_salary   number  optional    

Salário Diário. O campo value deve ser pelo menos 0. Example: 1

monthly_salary   number  optional    

Salário Mensal. O campo value deve ser pelo menos 0. Example: 1

nationality   string  optional    

Nacionalidade. O campo value não pode ser superior a 100 caracteres. Example: Example Nationality

place_of_birth   string  optional    

Naturalidade. O campo value não pode ser superior a 255 caracteres. Example: Example Place of birth

address   object  optional    

Endereço.

street   string  optional    

Rua. Example: Example Address street

number   string  optional    

Número. Example: Example Address number

complement   string  optional    

Complemento. Example: Example Address complement

neighborhood   string  optional    

Bairro. Example: Example Address neighborhood

city   string  optional    

Cidade. Example: Example Address city

state   string  optional    

Estado. Example: Example Address state

zip_code   string  optional    

CEP. Example: Example Address zip code

Update employee

requires authentication employee update

Update an employee

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/employees/16" \
    --header "Authorization: Bearer 8Vecg46fakh3a1d5P6EbvDZ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"cpf\": \"Example Cpf\",
    \"rg\": \"Example Rg\",
    \"ctps\": \"Example Ctps\",
    \"phone\": \"(11) 99999-9999\",
    \"birthdate\": \"2024-01-01\",
    \"email\": \"user@example.com\",
    \"employee_role_id\": \"f7b0f3eb-2c6a-4c6f-926c-702755fcc06c\",
    \"pis_pasep\": \"Example Pis pasep\",
    \"admission_date\": \"2024-01-01\",
    \"daily_salary\": 1,
    \"monthly_salary\": 1,
    \"nationality\": \"Example Nationality\",
    \"place_of_birth\": \"Example Place of birth\",
    \"address\": {
        \"0\": \"example1\",
        \"1\": \"example2\",
        \"street\": \"Example Address street\",
        \"number\": \"Example Address number\",
        \"complement\": \"Example Address complement\",
        \"neighborhood\": \"Example Address neighborhood\",
        \"city\": \"Example Address city\",
        \"state\": \"Example Address state\",
        \"zip_code\": \"Example Address zip code\"
    }
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/16"
);

const headers = {
    "Authorization": "Bearer 8Vecg46fakh3a1d5P6EbvDZ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "cpf": "Example Cpf",
    "rg": "Example Rg",
    "ctps": "Example Ctps",
    "phone": "(11) 99999-9999",
    "birthdate": "2024-01-01",
    "email": "user@example.com",
    "employee_role_id": "f7b0f3eb-2c6a-4c6f-926c-702755fcc06c",
    "pis_pasep": "Example Pis pasep",
    "admission_date": "2024-01-01",
    "daily_salary": 1,
    "monthly_salary": 1,
    "nationality": "Example Nationality",
    "place_of_birth": "Example Place of birth",
    "address": {
        "0": "example1",
        "1": "example2",
        "street": "Example Address street",
        "number": "Example Address number",
        "complement": "Example Address complement",
        "neighborhood": "Example Address neighborhood",
        "city": "Example Address city",
        "state": "Example Address state",
        "zip_code": "Example Address zip code"
    }
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "string"
}
 

Request      

PUT api/employees/{id}

Headers

Authorization        

Example: Bearer 8Vecg46fakh3a1d5P6EbvDZ

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the employee. Example: 16

employee   string     

Employee ID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Body Parameters

name   string  optional    

Nome. O campo value não pode ser superior a 255 caracteres. Example: Example Name

cpf   string  optional    

CPF. O campo value deve ser 14 caracteres. Example: Example Cpf

rg   string  optional    

RG. O campo value não pode ser superior a 20 caracteres. Example: Example Rg

ctps   string  optional    

CTPS. O campo value não pode ser superior a 20 caracteres. Example: Example Ctps

phone   string  optional    

Telefone. O campo value não pode ser superior a 20 caracteres. Example: (11) 99999-9999

birthdate   string  optional    

Data de Nascimento. O campo value deve ser uma data válida. Example: 2024-01-01

email   string  optional    

E-mail. O campo value deve ser um endereço de e-mail válido. Example: user@example.com

employee_role_id   string  optional    

Cargo. The uuid of an existing record in the employee_roles table. Example: f7b0f3eb-2c6a-4c6f-926c-702755fcc06c

pis_pasep   string  optional    

PIS/PASEP. O campo value deve ter 11 dígitos. Example: Example Pis pasep

admission_date   string  optional    

Data de Admissão. O campo value deve ser uma data válida. O campo value deve ser uma data anterior ou igual a today. Example: 2024-01-01

daily_salary   number  optional    

Salário Diário. O campo value deve ser pelo menos 0. Example: 1

monthly_salary   number  optional    

Salário Mensal. O campo value deve ser pelo menos 0. Example: 1

nationality   string  optional    

Nacionalidade. O campo value não pode ser superior a 100 caracteres. Example: Example Nationality

place_of_birth   string  optional    

Naturalidade. O campo value não pode ser superior a 255 caracteres. Example: Example Place of birth

address   object  optional    

Endereço.

street   string  optional    

Rua. Example: Example Address street

number   string  optional    

Número. Example: Example Address number

complement   string  optional    

Complemento. Example: Example Address complement

neighborhood   string  optional    

Bairro. Example: Example Address neighborhood

city   string  optional    

Cidade. Example: Example Address city

state   string  optional    

Estado. Example: Example Address state

zip_code   string  optional    

CEP. Example: Example Address zip code

Dismiss employee

requires authentication employee employment

Register the dismissal of an active employee

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/employees/019556e7-2e9f-777c-a177-30bbf0646c32/dismiss" \
    --header "Authorization: Bearer k6v8aEDe5f1db3Z6VPacg4h" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"dismissal_date\": \"2026-11-06\",
    \"dismissal_reason\": \"resignation\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/019556e7-2e9f-777c-a177-30bbf0646c32/dismiss"
);

const headers = {
    "Authorization": "Bearer k6v8aEDe5f1db3Z6VPacg4h",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "dismissal_date": "2026-11-06",
    "dismissal_reason": "resignation"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "96eff785-6423-460c-ba2f-d07486480343",
        "name": "Suelen Branco Valentin",
        "cpf": "939.808.916-94",
        "rg": "531465651",
        "ctps": null,
        "phone": null,
        "birthdate": null,
        "email": "edilson.delatorre@example.org",
        "pis_pasep": "33055624041",
        "admission_date": "1999-03-01",
        "daily_salary": "362.62",
        "monthly_salary": null,
        "nationality": "Israel",
        "place_of_birth": "Cervantes do Sul",
        "status": "active",
        "status_label": "Ativo",
        "address": {
            "street": null,
            "number": null,
            "complement": null,
            "neighborhood": null,
            "city": null,
            "state": null,
            "zip_code": null
        },
        "employee_role": {
            "id": "a32930d3-e83f-4281-8640-436017acd75a",
            "name": "aut"
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

POST api/employees/{employee}/dismiss

Headers

Authorization        

Example: Bearer k6v8aEDe5f1db3Z6VPacg4h

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employee   string     

Employee ID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Body Parameters

dismissal_date   string     

Data da baixa. O campo value deve ser uma data válida. O campo value deve ser uma data anterior ou igual a today. Example: 2026-11-06

dismissal_reason   string     

Motivo da saída. Example: resignation

Must be one of:
  • resignation
  • dismissal_without_cause
  • dismissal_with_cause
  • end_of_contract
  • retirement

Rehire employee

requires authentication employee employment

Rehire an inactive employee with a new admission date

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/employees/019556e7-2e9f-777c-a177-30bbf0646c32/rehire" \
    --header "Authorization: Bearer 61gkaZV8cbePvh634DfaEd5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"admission_date\": \"2026-11-06\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/019556e7-2e9f-777c-a177-30bbf0646c32/rehire"
);

const headers = {
    "Authorization": "Bearer 61gkaZV8cbePvh634DfaEd5",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "admission_date": "2026-11-06"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "dcdebc9d-1f11-4a2a-bbba-6f3e6eb4a8bc",
        "name": "Esther Torres",
        "cpf": "634.245.989-80",
        "rg": "159052284",
        "ctps": null,
        "phone": null,
        "birthdate": null,
        "email": null,
        "pis_pasep": null,
        "admission_date": "2001-10-19",
        "daily_salary": null,
        "monthly_salary": "3266.28",
        "nationality": "Maldivas",
        "place_of_birth": "Vila Clara d'Oeste",
        "status": "active",
        "status_label": "Ativo",
        "address": {
            "street": null,
            "number": null,
            "complement": null,
            "neighborhood": null,
            "city": null,
            "state": null,
            "zip_code": null
        },
        "employee_role": {
            "id": "a32930d3-ed67-439a-969b-d593f552a11a",
            "name": "corrupti"
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

POST api/employees/{employee}/rehire

Headers

Authorization        

Example: Bearer 61gkaZV8cbePvh634DfaEd5

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employee   string     

Employee ID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Body Parameters

admission_date   string     

Nova data de admissão. O campo value deve ser uma data válida. O campo value deve ser uma data anterior ou igual a today. Example: 2026-11-06

Delete employee

requires authentication employee delete

Delete an employee

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/employees/019556e7-2e9f-777c-a177-30bbf0646c32" \
    --header "Authorization: Bearer aVfD16PZeda6Ekbg8345chv" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/019556e7-2e9f-777c-a177-30bbf0646c32"
);

const headers = {
    "Authorization": "Bearer aVfD16PZeda6Ekbg8345chv",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/employees/{employee}

Headers

Authorization        

Example: Bearer aVfD16PZeda6Ekbg8345chv

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employee   string     

Employee ID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

List employee bank accounts

requires authentication employee-bank-account index

List all bank accounts for an employee

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/employees/16/bank-account" \
    --header "Authorization: Bearer 4c81aghav6dE65fVkbe3ZDP" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/16/bank-account"
);

const headers = {
    "Authorization": "Bearer 4c81aghav6dE65fVkbe3ZDP",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/employees/{employee_id}/bank-account

Headers

Authorization        

Example: Bearer 4c81aghav6dE65fVkbe3ZDP

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employee_id   integer     

The ID of the employee. Example: 16

employee   string     

Employee UUID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Create employee bank account

requires authentication employee-bank-account store

Add a bank account to an employee

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/employees/10/bank-account" \
    --header "Authorization: Bearer a81kev6h36PZ5bEDdfa4cVg" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"bank_id\": \"eum\",
    \"agency\": \"pt\",
    \"account\": \"yjpagtukalszmpux\",
    \"account_type\": \"corrente\",
    \"pix_key\": \"ckwxvfpjyezkjfmbtjgvp\",
    \"favorite\": true
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/10/bank-account"
);

const headers = {
    "Authorization": "Bearer a81kev6h36PZ5bEDdfa4cVg",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "bank_id": "eum",
    "agency": "pt",
    "account": "yjpagtukalszmpux",
    "account_type": "corrente",
    "pix_key": "ckwxvfpjyezkjfmbtjgvp",
    "favorite": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):



 

Request      

POST api/employees/{employee_id}/bank-account

Headers

Authorization        

Example: Bearer a81kev6h36PZ5bEDdfa4cVg

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employee_id   integer     

The ID of the employee. Example: 10

employee   string     

Employee UUID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Body Parameters

bank_id   string     

The uuid of an existing record in the banks table. Example: eum

agency   string     

O campo value não pode ser superior a 255 caracteres. Example: pt

account   string     

O campo value não pode ser superior a 255 caracteres. Example: yjpagtukalszmpux

account_type   string     

Example: corrente

Must be one of:
  • corrente
  • poupança
pix_key   string  optional    

O campo value não pode ser superior a 255 caracteres. Example: ckwxvfpjyezkjfmbtjgvp

favorite   boolean  optional    

Example: true

Update employee bank account

requires authentication employee-bank-account update

Update a bank account for an employee

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/employees/13/bank-account/019556e7-2e9f-777c-a177-30bbf0646c33" \
    --header "Authorization: Bearer kePZc6gfaE1hV5abDv346d8" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"bank_id\": \"labore\",
    \"agency\": \"kfooyxe\",
    \"account\": \"hbzmhfphajldkyjg\",
    \"account_type\": \"corrente\",
    \"pix_key\": \"fyg\",
    \"favorite\": false
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/13/bank-account/019556e7-2e9f-777c-a177-30bbf0646c33"
);

const headers = {
    "Authorization": "Bearer kePZc6gfaE1hV5abDv346d8",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "bank_id": "labore",
    "agency": "kfooyxe",
    "account": "hbzmhfphajldkyjg",
    "account_type": "corrente",
    "pix_key": "fyg",
    "favorite": false
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/employees/{employee_id}/bank-account/{id}

Headers

Authorization        

Example: Bearer kePZc6gfaE1hV5abDv346d8

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employee_id   integer     

The ID of the employee. Example: 13

id   string     

Bank account UUID Example: 019556e7-2e9f-777c-a177-30bbf0646c33

employee   string     

Employee UUID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Body Parameters

bank_id   string  optional    

The uuid of an existing record in the banks table. Example: labore

agency   string  optional    

O campo value não pode ser superior a 255 caracteres. Example: kfooyxe

account   string  optional    

O campo value não pode ser superior a 255 caracteres. Example: hbzmhfphajldkyjg

account_type   string  optional    

Example: corrente

Must be one of:
  • corrente
  • poupança
pix_key   string  optional    

O campo value não pode ser superior a 255 caracteres. Example: fyg

favorite   boolean  optional    

Example: false

Delete employee bank account

requires authentication employee-bank-account delete

Delete a bank account from an employee

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/employees/019556e7-2e9f-777c-a177-30bbf0646c32/bank-account/019556e7-2e9f-777c-a177-30bbf0646c33" \
    --header "Authorization: Bearer 3Vf41Zbaa6gEvdDk8e6hcP5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/019556e7-2e9f-777c-a177-30bbf0646c32/bank-account/019556e7-2e9f-777c-a177-30bbf0646c33"
);

const headers = {
    "Authorization": "Bearer 3Vf41Zbaa6gEvdDk8e6hcP5",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/employees/{employee}/bank-account/{id}

Headers

Authorization        

Example: Bearer 3Vf41Zbaa6gEvdDk8e6hcP5

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employee   string     

Employee UUID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

id   string     

Bank account UUID Example: 019556e7-2e9f-777c-a177-30bbf0646c33

List employee EPI deliveries

requires authentication employee-epi index

List EPI deliveries for an employee

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/employees/6/epi-deliveries" \
    --header "Authorization: Bearer 6D1adea5fE468V3cbhZkPvg" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"q\": \"et\",
    \"status\": \"expiring\",
    \"epi_type_id\": \"tempora\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/6/epi-deliveries"
);

const headers = {
    "Authorization": "Bearer 6D1adea5fE468V3cbhZkPvg",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "q": "et",
    "status": "expiring",
    "epi_type_id": "tempora"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/employees/{employee_id}/epi-deliveries

Headers

Authorization        

Example: Bearer 6D1adea5fE468V3cbhZkPvg

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employee_id   integer     

The ID of the employee. Example: 6

employee   string     

Employee UUID Example: enim

Body Parameters

q   string  optional    

Example: et

status   string  optional    

Example: expiring

Must be one of:
  • valid
  • expiring
  • expired
epi_type_id   string  optional    

The uuid of an existing record in the epi_types table. Example: tempora

has_term   string  optional    

Pending EPI renewals count

requires authentication employee-epi index

Count of pending EPI renewals for an employee

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/employees/voluptate/epi-deliveries/pending-renewals-count" \
    --header "Authorization: Bearer Vhc5P1Zakde468fD6agEb3v" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/voluptate/epi-deliveries/pending-renewals-count"
);

const headers = {
    "Authorization": "Bearer Vhc5P1Zakde468fD6agEb3v",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/employees/{employee}/epi-deliveries/pending-renewals-count

Headers

Authorization        

Example: Bearer Vhc5P1Zakde468fD6agEb3v

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employee   string     

Employee UUID Example: voluptate

Show employee EPI delivery

requires authentication employee-epi show

Show an EPI delivery for an employee

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/employees/19/epi-deliveries/sit" \
    --header "Authorization: Bearer bDaZPe81h5kVd6vac34gfE6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/19/epi-deliveries/sit"
);

const headers = {
    "Authorization": "Bearer bDaZPe81h5kVd6vac34gfE6",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/employees/{employee_id}/epi-deliveries/{id}

Headers

Authorization        

Example: Bearer bDaZPe81h5kVd6vac34gfE6

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employee_id   integer     

The ID of the employee. Example: 19

id   string     

EPI delivery UUID Example: sit

employee   string     

Employee UUID Example: ipsa

Create employee EPI delivery

requires authentication employee-epi store

Register an EPI delivery for an employee

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/employees/17/epi-deliveries" \
    --header "Authorization: Bearer c1ZfDPag83k5a6dvEe4b6hV" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"epi_type_id\": \"e08096cf-6a76-362f-b279-1d45b11fb796\",
    \"delivery_date\": \"2024-01-01\",
    \"quantity\": 1,
    \"condition\": \"Example Condition\",
    \"delivered_by_employee_id\": \"39f0a5e8-66e6-49cd-b603-6c12aca18f4f\",
    \"stock_id\": \"0c26143e-b7b0-3a1e-99a3-e316e093f288\",
    \"confirm_insufficient_stock\": true
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/17/epi-deliveries"
);

const headers = {
    "Authorization": "Bearer c1ZfDPag83k5a6dvEe4b6hV",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "epi_type_id": "e08096cf-6a76-362f-b279-1d45b11fb796",
    "delivery_date": "2024-01-01",
    "quantity": 1,
    "condition": "Example Condition",
    "delivered_by_employee_id": "39f0a5e8-66e6-49cd-b603-6c12aca18f4f",
    "stock_id": "0c26143e-b7b0-3a1e-99a3-e316e093f288",
    "confirm_insufficient_stock": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):



 

Request      

POST api/employees/{employee_id}/epi-deliveries

Headers

Authorization        

Example: Bearer c1ZfDPag83k5a6dvEe4b6hV

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employee_id   integer     

The ID of the employee. Example: 17

employee   string     

Employee UUID Example: in

Body Parameters

epi_type_id   string     

Tipo de EPI. The uuid of an existing record in the epi_types table. Example: e08096cf-6a76-362f-b279-1d45b11fb796

delivery_date   string     

Data de entrega. O campo value deve ser uma data válida. Example: 2024-01-01

quantity   integer  optional    

Quantidade. O campo value deve ser pelo menos 1. Example: 1

condition   string     

Condicao. Example: Example Condition

Must be one of:
  • new
  • used
  • reformed
delivered_by_employee_id   string  optional    

Responsável pela entrega. The uuid of an existing record in the employees table. Example: 39f0a5e8-66e6-49cd-b603-6c12aca18f4f

stock_id   string  optional    

Estoque. The uuid of an existing record in the stocks table. Example: 0c26143e-b7b0-3a1e-99a3-e316e093f288

confirm_insufficient_stock   boolean  optional    

Confirmar saldo insuficiente. Example: true

Create employee initial EPI kit

requires authentication employee-epi kit

Register multiple EPI deliveries as initial kit

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/employees/dolor/epi-deliveries/kit" \
    --header "Authorization: Bearer hd46vakc85E36feDbPgaZV1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"delivery_date\": \"2024-01-01\",
    \"is_kit_initial\": true,
    \"show_epi_receipt_text\": true,
    \"delivered_by_employee_id\": \"ced8afdd-f457-4849-b822-8edc3e73a311\",
    \"stock_id\": \"6b4c1a36-72b8-3eb7-a091-72094e15fcb1\",
    \"confirm_insufficient_stock\": true,
    \"items\": [
        {
            \"epi_type_id\": \"605ca0ca-0f5a-3515-aaab-cdabb21aefa1\",
            \"quantity\": 1,
            \"condition\": \"Example Items * condition\"
        },
        null
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/dolor/epi-deliveries/kit"
);

const headers = {
    "Authorization": "Bearer hd46vakc85E36feDbPgaZV1",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "delivery_date": "2024-01-01",
    "is_kit_initial": true,
    "show_epi_receipt_text": true,
    "delivered_by_employee_id": "ced8afdd-f457-4849-b822-8edc3e73a311",
    "stock_id": "6b4c1a36-72b8-3eb7-a091-72094e15fcb1",
    "confirm_insufficient_stock": true,
    "items": [
        {
            "epi_type_id": "605ca0ca-0f5a-3515-aaab-cdabb21aefa1",
            "quantity": 1,
            "condition": "Example Items * condition"
        },
        null
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):



 

Request      

POST api/employees/{employee}/epi-deliveries/kit

Headers

Authorization        

Example: Bearer hd46vakc85E36feDbPgaZV1

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employee   string     

Employee UUID Example: dolor

Body Parameters

delivery_date   string     

Data de entrega. O campo value deve ser uma data válida. Example: 2024-01-01

is_kit_initial   boolean  optional    

Kit inicial. Example: true

show_epi_receipt_text   boolean  optional    

Exibir texto do recibo. Example: true

delivered_by_employee_id   string  optional    

Responsável pela entrega. The uuid of an existing record in the employees table. Example: ced8afdd-f457-4849-b822-8edc3e73a311

stock_id   string  optional    

Estoque. The uuid of an existing record in the stocks table. Example: 6b4c1a36-72b8-3eb7-a091-72094e15fcb1

confirm_insufficient_stock   boolean  optional    

Confirmar saldo insuficiente. Example: true

items   object[]     

Itens do kit. O campo value deve ter pelo menos 1 itens.

epi_type_id   string     

Tipo de EPI. The uuid of an existing record in the epi_types table. Example: 605ca0ca-0f5a-3515-aaab-cdabb21aefa1

quantity   integer  optional    

Quantidade. O campo value deve ser pelo menos 1. Example: 1

condition   string     

Condição. Example: Example Items * condition

Must be one of:
  • new
  • used
  • reformed

Promote EPI delivery to kit

requires authentication employee-epi kit

Turn a standalone EPI delivery into a single-item kit so it can generate the acknowledgement term. Idempotent: a delivery already belonging to a kit is returned unchanged.

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/employees/accusamus/epi-deliveries/mollitia/promote-to-kit" \
    --header "Authorization: Bearer eEcg8ad4hkf1bD3P66aVv5Z" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/accusamus/epi-deliveries/mollitia/promote-to-kit"
);

const headers = {
    "Authorization": "Bearer eEcg8ad4hkf1bD3P66aVv5Z",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/employees/{employee}/epi-deliveries/{id}/promote-to-kit

Headers

Authorization        

Example: Bearer eEcg8ad4hkf1bD3P66aVv5Z

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employee   string     

Employee UUID Example: accusamus

id   string     

EPI delivery UUID Example: mollitia

Update employee EPI delivery

requires authentication employee-epi update

Update an EPI delivery for an employee

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/employees/15/epi-deliveries/aperiam" \
    --header "Authorization: Bearer Zcv65aka14PEh3dfV8g6bDe" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"epi_type_id\": \"9af91db5-4d86-35d9-813a-6e2714dab687\",
    \"delivery_date\": \"2024-01-01\",
    \"quantity\": 1,
    \"condition\": \"Example Condition\",
    \"delivered_by_employee_id\": \"03ba4a0c-d7cf-4eb8-a32c-7cb4b3a58d5a\",
    \"stock_id\": \"069a1d42-2345-3196-b642-6393d769c2b8\",
    \"confirm_insufficient_stock\": true
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/15/epi-deliveries/aperiam"
);

const headers = {
    "Authorization": "Bearer Zcv65aka14PEh3dfV8g6bDe",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "epi_type_id": "9af91db5-4d86-35d9-813a-6e2714dab687",
    "delivery_date": "2024-01-01",
    "quantity": 1,
    "condition": "Example Condition",
    "delivered_by_employee_id": "03ba4a0c-d7cf-4eb8-a32c-7cb4b3a58d5a",
    "stock_id": "069a1d42-2345-3196-b642-6393d769c2b8",
    "confirm_insufficient_stock": true
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/employees/{employee_id}/epi-deliveries/{id}

Headers

Authorization        

Example: Bearer Zcv65aka14PEh3dfV8g6bDe

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employee_id   integer     

The ID of the employee. Example: 15

id   string     

EPI delivery UUID Example: aperiam

employee   string     

Employee UUID Example: impedit

Body Parameters

epi_type_id   string  optional    

Tipo de EPI. The uuid of an existing record in the epi_types table. Example: 9af91db5-4d86-35d9-813a-6e2714dab687

delivery_date   string  optional    

Data de entrega. O campo value deve ser uma data válida. Example: 2024-01-01

quantity   integer  optional    

Quantidade. O campo value deve ser pelo menos 1. Example: 1

condition   string  optional    

Condição. Example: Example Condition

Must be one of:
  • new
  • used
  • reformed
delivered_by_employee_id   string  optional    

Responsável pela entrega. The uuid of an existing record in the employees table. Example: 03ba4a0c-d7cf-4eb8-a32c-7cb4b3a58d5a

stock_id   string  optional    

Estoque. The uuid of an existing record in the stocks table. Example: 069a1d42-2345-3196-b642-6393d769c2b8

confirm_insufficient_stock   boolean  optional    

Confirmar saldo insuficiente. Example: true

Delete employee EPI delivery

requires authentication employee-epi delete

Delete an EPI delivery from an employee

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/employees/cupiditate/epi-deliveries/accusantium" \
    --header "Authorization: Bearer 1v6f4cg85a3ebDPhZkdVaE6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/cupiditate/epi-deliveries/accusantium"
);

const headers = {
    "Authorization": "Bearer 1v6f4cg85a3ebDPhZkdVaE6",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/employees/{employee}/epi-deliveries/{id}

Headers

Authorization        

Example: Bearer 1v6f4cg85a3ebDPhZkdVaE6

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employee   string     

Employee UUID Example: cupiditate

id   string     

EPI delivery UUID Example: accusantium

List employee EPI terms

requires authentication employee-epi index

List initial EPI kit terms for an employee

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/employees/8/epi-terms" \
    --header "Authorization: Bearer 5gZcfkVa3a6e8vb4E6d1DhP" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"sort_by\": \"delivery_date\",
    \"sort_desc\": false,
    \"page\": 58,
    \"per_page\": 23,
    \"q\": \"accusamus\",
    \"employee_id\": \"doloribus\",
    \"has_term\": true
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/8/epi-terms"
);

const headers = {
    "Authorization": "Bearer 5gZcfkVa3a6e8vb4E6d1DhP",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "sort_by": "delivery_date",
    "sort_desc": false,
    "page": 58,
    "per_page": 23,
    "q": "accusamus",
    "employee_id": "doloribus",
    "has_term": true
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/employees/{employee_id}/epi-terms

Headers

Authorization        

Example: Bearer 5gZcfkVa3a6e8vb4E6d1DhP

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employee_id   integer     

The ID of the employee. Example: 8

employee   string     

Employee UUID Example: est

Body Parameters

sort_by   string  optional    

Example: delivery_date

Must be one of:
  • delivery_date
  • created_at
sort_desc   boolean  optional    

Example: false

page   integer  optional    

O campo value deve ser pelo menos 1. Example: 58

per_page   integer  optional    

O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 23

q   string  optional    

Example: accusamus

employee_id   string  optional    

The uuid of an existing record in the employees table. Example: doloribus

has_term   boolean  optional    

Example: true

Upload signed EPI term

requires authentication employee-epi update

Upload signed Termo de Ciência for an initial kit

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/employees/natus/epi-terms/0f94cbf9-e509-3e37-836a-eddfd860a4d0/upload" \
    --header "Authorization: Bearer 6dZ15h4ED3ak8gPevbcaV6f" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"file\": {
        \"0\": \"example1\",
        \"1\": \"example2\",
        \"path\": \"Example File path\",
        \"name\": \"Example Name\",
        \"extension\": \"Example File extension\",
        \"size\": \"Example File size\",
        \"mime_type\": \"Example File mime type\"
    }
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/natus/epi-terms/0f94cbf9-e509-3e37-836a-eddfd860a4d0/upload"
);

const headers = {
    "Authorization": "Bearer 6dZ15h4ED3ak8gPevbcaV6f",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "file": {
        "0": "example1",
        "1": "example2",
        "path": "Example File path",
        "name": "Example Name",
        "extension": "Example File extension",
        "size": "Example File size",
        "mime_type": "Example File mime type"
    }
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):



 

Request      

POST api/employees/{employee}/epi-terms/{kitUuid}/upload

Headers

Authorization        

Example: Bearer 6dZ15h4ED3ak8gPevbcaV6f

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employee   string     

Employee UUID Example: natus

kitUuid   string     

Kit UUID Example: 0f94cbf9-e509-3e37-836a-eddfd860a4d0

Body Parameters

name   string  optional    

Nome. O campo value não pode ser superior a 255 caracteres. Example: Example Name

file   object     

Arquivo.

path   string     

Caminho do arquivo. Example: Example File path

name   string     

Nome do arquivo. Example: Example Name

extension   string     

Extensão do arquivo. Example: Example File extension

size   string     

Tamanho do arquivo. Example: Example File size

mime_type   string  optional    

File mime type. Example: Example File mime type

Download signed EPI term

requires authentication employee-epi show

Get temporary download URL for signed term

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/employees/magnam/epi-terms/c9c510dd-a25e-3ae0-afd6-e7e3fe32927c/document" \
    --header "Authorization: Bearer Pv5V18hf4Ze6k6dbaaDcg3E" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/magnam/epi-terms/c9c510dd-a25e-3ae0-afd6-e7e3fe32927c/document"
);

const headers = {
    "Authorization": "Bearer Pv5V18hf4Ze6k6dbaaDcg3E",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/employees/{employee}/epi-terms/{kitUuid}/document

Headers

Authorization        

Example: Bearer Pv5V18hf4Ze6k6dbaaDcg3E

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employee   string     

Employee UUID Example: magnam

kitUuid   string     

Kit UUID Example: c9c510dd-a25e-3ae0-afd6-e7e3fe32927c

Endpoints

GET api/up

No specific permission required

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/up" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/up"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "API is running"
}
 

Request      

GET api/up

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Files

Endpoints for files

Delete file

requires authentication No specific permission required

Delete a file

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/files/61068509-6c69-31ce-be29-a34e4e47b3ec" \
    --header "Authorization: Bearer gaVb6fcZ3D8kPh6d5Evea41" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/files/61068509-6c69-31ce-be29-a34e4e47b3ec"
);

const headers = {
    "Authorization": "Bearer gaVb6fcZ3D8kPh6d5Evea41",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/files/{uuid}

Headers

Authorization        

Example: Bearer gaVb6fcZ3D8kPh6d5Evea41

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

uuid   integer     

Example: 61068509-6c69-31ce-be29-a34e4e47b3ec

Get file info

requires authentication No specific permission required

Get file information

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/files/54fd0540-eb2e-3688-be45-b11189e97c00/info" \
    --header "Authorization: Bearer h16ab4f3DevadPE8k6ZgcV5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/files/54fd0540-eb2e-3688-be45-b11189e97c00/info"
);

const headers = {
    "Authorization": "Bearer h16ab4f3DevadPE8k6ZgcV5",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "uuid": "string",
    "name": "string",
    "size": "integer",
    "type": "string",
    "extension": "string",
    "path": "string"
}
 

Request      

GET api/files/{uuid}/info

Headers

Authorization        

Example: Bearer h16ab4f3DevadPE8k6ZgcV5

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

uuid   integer     

Example: 54fd0540-eb2e-3688-be45-b11189e97c00

Generate download URL

requires authentication No specific permission required

Generate a signed URL for downloading a file

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/files/34cd6af3-8aa4-3004-b704-61dec859e57f/download" \
    --header "Authorization: Bearer af4ZbgEca51Dv8dkh6e6V3P" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/files/34cd6af3-8aa4-3004-b704-61dec859e57f/download"
);

const headers = {
    "Authorization": "Bearer af4ZbgEca51Dv8dkh6e6V3P",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "url": "string",
    "filename": "string",
    "size": "integer",
    "type": "string"
}
 

Request      

GET api/files/{uuid}/download

Headers

Authorization        

Example: Bearer af4ZbgEca51Dv8dkh6e6V3P

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

uuid   string     

The UUID of the file to download Example: 34cd6af3-8aa4-3004-b704-61dec859e57f

Generate upload URL

requires authentication No specific permission required

Generate a signed URL for uploading a file

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/files/generate-upload-url" \
    --header "Authorization: Bearer 5EPa483g16VfcbkDZ6ehvad" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"path\": \"Example Path\",
    \"mimetype\": \"Example Mimetype\",
    \"public\": true
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/files/generate-upload-url"
);

const headers = {
    "Authorization": "Bearer 5EPa483g16VfcbkDZ6ehvad",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "path": "Example Path",
    "mimetype": "Example Mimetype",
    "public": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "url": "string",
    "path": "string",
    "headers": "array"
}
 

Request      

POST api/files/generate-upload-url

Headers

Authorization        

Example: Bearer 5EPa483g16VfcbkDZ6ehvad

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

path   string     

Path. Example: Example Path

mimetype   string     

Mimetype. Example: Example Mimetype

public   boolean     

Public. Example: true

Generate bulk upload URL

requires authentication No specific permission required

Generate signed URLs for uploading multiple files

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/files/generate-bulk-upload-url" \
    --header "Authorization: Bearer f3vbdh6c8Zka1a4Ve5gPDE6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"files\": [
        {
            \"path\": \"Example Files * path\",
            \"mimetype\": \"Example Files * mimetype\",
            \"public\": true
        },
        null
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/files/generate-bulk-upload-url"
);

const headers = {
    "Authorization": "Bearer f3vbdh6c8Zka1a4Ve5gPDE6",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "files": [
        {
            "path": "Example Files * path",
            "mimetype": "Example Files * mimetype",
            "public": true
        },
        null
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


[
    {
        "url": "string",
        "path": "string",
        "headers": "array"
    }
]
 

Request      

POST api/files/generate-bulk-upload-url

Headers

Authorization        

Example: Bearer f3vbdh6c8Zka1a4Ve5gPDE6

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

files   object[]     

Files.

path   string     

Files path. Example: `Example Files path`

mimetype   string     

Files mimetype. Example: `Example Files mimetype`

public   boolean     

Files * public. Example: true

Fiscal Documents

Endpoints para gerenciar notas fiscais (arquivos XML/PDF e vínculo com obras).

List fiscal documents

requires authentication fiscal-documents index

Lista notas fiscais com filtros por busca, fornecedor, obra e período.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/fiscal-documents" \
    --header "Authorization: Bearer g4k866vP5fbhaaEZDV1ced3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"q\": \"sint\",
    \"document_type\": \"nfse\",
    \"supplier_id\": \"quasi\",
    \"work_id\": \"expedita\",
    \"products_status\": \"imported\",
    \"financial_status\": \"partial\",
    \"start_date\": \"2026-11-06T10:51:22\",
    \"end_date\": \"2102-08-26\",
    \"per_page\": 1
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/fiscal-documents"
);

const headers = {
    "Authorization": "Bearer g4k866vP5fbhaaEZDV1ced3",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "q": "sint",
    "document_type": "nfse",
    "supplier_id": "quasi",
    "work_id": "expedita",
    "products_status": "imported",
    "financial_status": "partial",
    "start_date": "2026-11-06T10:51:22",
    "end_date": "2102-08-26",
    "per_page": 1
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "0a7fe729-b05d-3b09-a5b6-83c016b49df0",
            "document_type": "nfe",
            "document_type_label": "NF-e",
            "service_description": null,
            "nfe_access_key": "66369658210920626616850626191375936510374070",
            "nfe_number": "623099",
            "nfe_series": "81",
            "issue_date": "1996-08-18T03:00:00.000000Z",
            "total_value": "4846.04",
            "emit": {
                "cnpj": "69938393460533",
                "name": "Marks and Sons"
            },
            "dest": {
                "document": "81611966953166",
                "name": "Mueller, O'Reilly and Sipes"
            },
            "supplier": {
                "id": "a32930d5-61f3-4f13-803d-eb36a8458833",
                "name": "Gabriela Vale Brito Jr.",
                "document": "58.577.372/0001-65"
            },
            "financial_status": "pending",
            "products_imported_at": null,
            "created_at": null
        },
        {
            "id": "b4b8ad2f-ac9a-3acc-8bdb-e3763ac8f826",
            "document_type": "nfe",
            "document_type_label": "NF-e",
            "service_description": null,
            "nfe_access_key": "87959845812047182068845550458780681930572066",
            "nfe_number": "889916",
            "nfe_series": "25",
            "issue_date": "2005-11-07T02:00:00.000000Z",
            "total_value": "4960.76",
            "emit": {
                "cnpj": "56702056330527",
                "name": "Mayert, Flatley and Bradtke"
            },
            "dest": {
                "document": "16788732409377",
                "name": "Maggio-Bogisich"
            },
            "supplier": {
                "id": "a32930d5-666c-4226-a5b2-eae02c04aa62",
                "name": "Nicolas Teles Serra Sobrinho",
                "document": "83.364.484/0001-85"
            },
            "financial_status": "pending",
            "products_imported_at": null,
            "created_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 15,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/fiscal-documents

Headers

Authorization        

Example: Bearer g4k866vP5fbhaaEZDV1ced3

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

q   string  optional    

Example: sint

document_type   string  optional    

Example: nfse

Must be one of:
  • nfe
  • nfse
supplier_id   string  optional    

The uuid of an existing record in the suppliers table. Example: quasi

work_id   string  optional    

The uuid of an existing record in the works table. Example: expedita

products_status   string  optional    

Example: imported

Must be one of:
  • imported
  • pending
financial_status   string  optional    

Example: partial

Must be one of:
  • pending
  • partial
  • generated
start_date   string  optional    

O campo value deve ser uma data válida. Example: 2026-11-06T10:51:22

end_date   string  optional    

O campo value deve ser uma data válida. O campo value deve ser uma data posterior ou igual a start_date. Example: 2102-08-26

per_page   integer  optional    

O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 1

Create fiscal document

requires authentication fiscal-documents store

Registra uma NFe a partir do XML já enviado ao S3 e o vincula às obras informadas.

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/fiscal-documents" \
    --header "Authorization: Bearer gve145Da36PVbhZ6dkEca8f" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"s3_file_path\": \"quaerat\",
    \"original_filename\": \".xml$\\/i\",
    \"work_ids\": [
        \"molestiae\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/fiscal-documents"
);

const headers = {
    "Authorization": "Bearer gve145Da36PVbhZ6dkEca8f",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "s3_file_path": "quaerat",
    "original_filename": ".xml$\/i",
    "work_ids": [
        "molestiae"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "data": {
        "id": "2f31f252-9c25-3fdf-9327-da43f106fac2",
        "document_type": "nfe",
        "document_type_label": "NF-e",
        "service_description": null,
        "nfe_access_key": "56196392581327136375108925994469601698668213",
        "nfe_number": "857760",
        "nfe_series": "22",
        "issue_date": "2016-04-24T03:00:00.000000Z",
        "total_value": "3945.57",
        "emit": {
            "cnpj": "35444233611718",
            "name": "Bechtelar LLC"
        },
        "dest": {
            "document": "36892364412303",
            "name": "Wilkinson Inc"
        },
        "supplier": {
            "id": "a32930d5-6fec-4f06-90f7-84ced41edb58",
            "name": "Sérgio Mendonça Filho",
            "document": "32.937.856/0001-84"
        },
        "financial_status": "pending",
        "products_imported_at": null,
        "created_at": null
    }
}
 

Request      

POST api/fiscal-documents

Headers

Authorization        

Example: Bearer gve145Da36PVbhZ6dkEca8f

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

s3_file_path   string     

Example: quaerat

original_filename   string     

Must match the regex /.xml$/i. Example: .xml$/i

work_ids   string[]  optional    

The uuid of an existing record in the works table.

Get fiscal document

requires authentication fiscal-documents show

Detalha uma nota fiscal com arquivos e obras vinculadas.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/fiscal-documents/facilis" \
    --header "Authorization: Bearer Pv384cbhda1fak5gE6DV6eZ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/fiscal-documents/facilis"
);

const headers = {
    "Authorization": "Bearer Pv384cbhda1fak5gE6DV6eZ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "463d50f4-dda9-378f-b411-f4a4bd94791c",
        "document_type": "nfe",
        "document_type_label": "NF-e",
        "service_description": null,
        "nfe_access_key": "31461314734652748779860953153220900808263052",
        "nfe_number": "803683",
        "nfe_series": "81",
        "issue_date": "1990-11-17T02:00:00.000000Z",
        "total_value": "7585.00",
        "emit": {
            "cnpj": "51433126506040",
            "name": "Berge-Stehr"
        },
        "dest": {
            "document": "82890690965082",
            "name": "Kiehn, Lemke and Moore"
        },
        "supplier": {
            "id": "a32930d5-7877-406b-b4f8-18b014bb497c",
            "name": "Srta. Bella Cervantes Padrão Neto",
            "document": "11.741.078/0001-83"
        },
        "financial_status": "pending",
        "products_imported_at": null,
        "created_at": null
    }
}
 

Request      

GET api/fiscal-documents/{fiscalDocument}

Headers

Authorization        

Example: Bearer Pv384cbhda1fak5gE6DV6eZ

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

fiscalDocument   string     

UUID da nota fiscal Example: facilis

Fiscal document by cost center

requires authentication fiscal-documents show

Distribui a nota por centro de custo. NF-e de produto sai do estoque: o que a vinculação dos itens lançou em cada estoque de obra (quantidade × preço do lote, o mesmo cálculo do custo apropriado do painel), o que foi para o estoque principal e o que ainda não foi integrado. NFS-e sai das parcelas, pelo centro da conta gerada. As linhas somam o total da nota; a diferença vai para other_values, que pode ser negativo quando há desconto. Linhas zeradas são omitidas.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/fiscal-documents/corrupti/cost-centers" \
    --header "Authorization: Bearer akcE68gf3D1ev5dPV6haZ4b" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/fiscal-documents/corrupti/cost-centers"
);

const headers = {
    "Authorization": "Bearer akcE68gf3D1ev5dPV6haZ4b",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "total": "5074.19",
        "source": "stock",
        "rows": [
            {
                "kind": "cost_center",
                "cost_center": {
                    "id": "uuid",
                    "code": "002.001",
                    "name": "Residencial Vila Nova"
                },
                "amount": "2100.00",
                "share": 41.39
            },
            {
                "kind": "work_without_cost_center",
                "work": {
                    "id": "uuid",
                    "name": "Reforma Centro"
                },
                "amount": "474.19",
                "share": 9.35
            },
            {
                "kind": "main_stock",
                "cost_center": {
                    "id": "uuid",
                    "code": "003.001",
                    "name": "Estoque central"
                },
                "amount": "1500.00",
                "share": 29.56
            },
            {
                "kind": "not_integrated",
                "amount": "900.00",
                "share": 17.74
            },
            {
                "kind": "other_values",
                "amount": "100.00",
                "share": 1.97
            }
        ]
    }
}
 

Request      

GET api/fiscal-documents/{fiscalDocument}/cost-centers

Headers

Authorization        

Example: Bearer akcE68gf3D1ev5dPV6haZ4b

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

fiscalDocument   string     

UUID da nota fiscal Example: corrupti

Delete fiscal document

requires authentication fiscal-documents delete

Exclui definitivamente uma nota fiscal. Não permitido quando a nota já gerou parcelas no financeiro ou já teve produtos importados.

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/fiscal-documents/autem" \
    --header "Authorization: Bearer 3gZdEcve1fb64DVa6Pah58k" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/fiscal-documents/autem"
);

const headers = {
    "Authorization": "Bearer 3gZdEcve1fb64DVa6Pah58k",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204, Nota fiscal excluída.):

Empty response
 

Request      

DELETE api/fiscal-documents/{fiscalDocument}

Headers

Authorization        

Example: Bearer 3gZdEcve1fb64DVa6Pah58k

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

fiscalDocument   string     

UUID da nota fiscal Example: autem

Attach file

requires authentication fiscal-documents update

Anexa um arquivo (ex.: PDF da NF) já enviado ao S3 à nota fiscal.

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/fiscal-documents/repudiandae/files" \
    --header "Authorization: Bearer Ehak5dZv341c6bgD6af8ePV" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"file\": {
        \"path\": \"qui\",
        \"name\": \"expedita\",
        \"extension\": \"dignissimos\"
    }
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/fiscal-documents/repudiandae/files"
);

const headers = {
    "Authorization": "Bearer Ehak5dZv341c6bgD6af8ePV",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "file": {
        "path": "qui",
        "name": "expedita",
        "extension": "dignissimos"
    }
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "623620be-a4f6-3137-8933-854f3b122216",
        "document_type": "nfe",
        "document_type_label": "NF-e",
        "service_description": null,
        "nfe_access_key": "97696546987138462423591707667918829690135692",
        "nfe_number": "943086",
        "nfe_series": "94",
        "issue_date": "2013-03-24T03:00:00.000000Z",
        "total_value": "5692.15",
        "emit": {
            "cnpj": "95055498854719",
            "name": "Grant Group"
        },
        "dest": {
            "document": "59493326281157",
            "name": "Treutel Group"
        },
        "supplier": {
            "id": "a32930d5-85d7-4c70-a3c8-fc47bf395e0a",
            "name": "Sr. Inácio Salazar Filho",
            "document": "28.119.898/0001-30"
        },
        "financial_status": "pending",
        "products_imported_at": null,
        "created_at": null
    }
}
 

Request      

POST api/fiscal-documents/{fiscalDocument}/files

Headers

Authorization        

Example: Bearer Ehak5dZv341c6bgD6af8ePV

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

fiscalDocument   string     

UUID da nota fiscal Example: repudiandae

Body Parameters

file   object     
path   string     

Example: qui

name   string     

Example: expedita

extension   string     

Example: dignissimos

size   string  optional    

Detach file

requires authentication fiscal-documents update

Remove definitivamente um anexo da nota fiscal, inclusive o objeto no S3. O XML original da NFe não pode ser removido.

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/fiscal-documents/eligendi/files/quis" \
    --header "Authorization: Bearer vD1VP5hf836eZcEkda6gab4" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/fiscal-documents/eligendi/files/quis"
);

const headers = {
    "Authorization": "Bearer vD1VP5hf836eZcEkda6gab4",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "ac5af093-13d5-3941-afe4-6ecd84657aba",
        "document_type": "nfe",
        "document_type_label": "NF-e",
        "service_description": null,
        "nfe_access_key": "85675436946779118260567895548871307345002396",
        "nfe_number": "757254",
        "nfe_series": "39",
        "issue_date": "1980-07-02T03:00:00.000000Z",
        "total_value": "8764.10",
        "emit": {
            "cnpj": "24050375123649",
            "name": "Sawayn-Streich"
        },
        "dest": {
            "document": "81346209051531",
            "name": "Crist, Legros and Runte"
        },
        "supplier": {
            "id": "a32930d5-8e0a-444e-b90f-6c098aaa3d5e",
            "name": "Wellington Mascarenhas",
            "document": "87.380.030/0001-59"
        },
        "financial_status": "pending",
        "products_imported_at": null,
        "created_at": null
    }
}
 

Request      

DELETE api/fiscal-documents/{fiscalDocument}/files/{file}

Headers

Authorization        

Example: Bearer vD1VP5hf836eZcEkda6gab4

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

fiscalDocument   string     

UUID da nota fiscal Example: eligendi

file   string     

UUID do arquivo anexado Example: quis

Sync works

requires authentication fiscal-documents update

Sincroniza o vínculo documental da nota fiscal com N obras.

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/fiscal-documents/qui/works" \
    --header "Authorization: Bearer 6E13khZV4vgdcf658aaeDbP" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"work_ids\": [
        \"iure\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/fiscal-documents/qui/works"
);

const headers = {
    "Authorization": "Bearer 6E13khZV4vgdcf658aaeDbP",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "work_ids": [
        "iure"
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "8979c8e2-71b5-3cb3-92a1-b3353e56e138",
        "document_type": "nfe",
        "document_type_label": "NF-e",
        "service_description": null,
        "nfe_access_key": "89348518528009457370640205435321529402941978",
        "nfe_number": "990487",
        "nfe_series": "86",
        "issue_date": "1981-05-18T03:00:00.000000Z",
        "total_value": "701.52",
        "emit": {
            "cnpj": "72167924908563",
            "name": "Jacobson-Nader"
        },
        "dest": {
            "document": "97492669966756",
            "name": "Tillman-Luettgen"
        },
        "supplier": {
            "id": "a32930d5-9948-47ab-8853-f3fa4ab1889b",
            "name": "Josefina Fernanda Urias Neto",
            "document": "84.719.212/0001-13"
        },
        "financial_status": "pending",
        "products_imported_at": null,
        "created_at": null
    }
}
 

Request      

PUT api/fiscal-documents/{fiscalDocument}/works

Headers

Authorization        

Example: Bearer 6E13khZV4vgdcf658aaeDbP

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

fiscalDocument   string     

UUID da nota fiscal Example: qui

Body Parameters

work_ids   string[]  optional    

The uuid of an existing record in the works table.

Create installment

requires authentication fiscal-documents update

Lança uma cobrança avulsa na nota fiscal, para o boleto que o fornecedor cobra além das duplicatas do XML. Nasce pendente e sem conta no financeiro; a geração continua sendo pelo import-nfe.

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/fiscal-documents/excepturi/installments" \
    --header "Authorization: Bearer dhg6fav1E6ZPbe3D548ackV" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"due_date\": \"2024-01-01\",
    \"amount\": 1,
    \"number\": \"Example Number\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/fiscal-documents/excepturi/installments"
);

const headers = {
    "Authorization": "Bearer dhg6fav1E6ZPbe3D548ackV",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "due_date": "2024-01-01",
    "amount": 1,
    "number": "Example Number"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "data": {
        "id": "3b354a9e-1559-36cb-9c7d-955846ce061c",
        "document_type": "nfe",
        "document_type_label": "NF-e",
        "service_description": null,
        "nfe_access_key": "79528764466865541285650736950061621310050634",
        "nfe_number": "472511",
        "nfe_series": "39",
        "issue_date": "2012-04-06T03:00:00.000000Z",
        "total_value": "1460.36",
        "emit": {
            "cnpj": "88013519602282",
            "name": "Kuhic Group"
        },
        "dest": {
            "document": "82965509907868",
            "name": "Turcotte, Beier and Schumm"
        },
        "supplier": {
            "id": "a32930d5-a158-4f8b-972d-581386bcd6c8",
            "name": "Enzo Ferraz Sandoval Neto",
            "document": "55.576.461/0001-07"
        },
        "financial_status": "pending",
        "products_imported_at": null,
        "created_at": null
    }
}
 

Request      

POST api/fiscal-documents/{fiscalDocument}/installments

Headers

Authorization        

Example: Bearer dhg6fav1E6ZPbe3D548ackV

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

fiscalDocument   string     

UUID da nota fiscal Example: excepturi

Body Parameters

due_date   string     

Vencimento. O campo value deve ser uma data válida. Example: 2024-01-01

amount   number     

Valor. Example: 1

number   string  optional    

Número da cobrança. O campo value não pode ser superior a 60 caracteres. Example: Example Number

Import

Endpoints for managing NFe imports and product processing.

NFe Imports

Import and process Brazilian electronic invoice (NFe) files.

Create NFe Import

requires authentication imports store

Upload and process a Brazilian NFe (Nota Fiscal Eletrônica) XML file. The file should be uploaded to S3 first, then this endpoint processes it asynchronously.

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/imports/nfe/products" \
    --header "Authorization: Bearer 3Ze41gkb65vfacD6PEah8Vd" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"s3_file_path\": \"imports\\/nfe_12345.xml\",
    \"original_filename\": \"nota_fiscal_001.xml\",
    \"import_type\": \"nfe\",
    \"fiscal_document_id\": \"9b60ff33-173f-3902-b49b-227db1d59ff2\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/imports/nfe/products"
);

const headers = {
    "Authorization": "Bearer 3Ze41gkb65vfacD6PEah8Vd",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "s3_file_path": "imports\/nfe_12345.xml",
    "original_filename": "nota_fiscal_001.xml",
    "import_type": "nfe",
    "fiscal_document_id": "9b60ff33-173f-3902-b49b-227db1d59ff2"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201, Import created successfully):


{
    "import_id": "9d2f8e4a-1b3c-4d5e-6f7a-8b9c0d1e2f3a",
    "status": "pending",
    "channel": "import-progress.9d2f8e4a-1b3c-4d5e-6f7a-8b9c0d1e2f3a"
}
 

Example response (404, File not found in S3):


{
    "error": "Arquivo não encontrado no S3"
}
 

Example response (422, Invalid XML or not a valid NFe):


{
    "error": "Arquivo XML inválido ou não é uma NFe"
}
 

Request      

POST api/imports/nfe/products

Headers

Authorization        

Example: Bearer 3Ze41gkb65vfacD6PEah8Vd

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

s3_file_path   string     

Path to the NFe XML file in S3 storage Example: imports/nfe_12345.xml

original_filename   string     

Original filename of the uploaded NFe Example: nota_fiscal_001.xml

import_type   string     

Type of import (currently only "nfe" is supported) Example: nfe

fiscal_document_id   string  optional    

Fiscal document id. The uuid of an existing record in the fiscal_documents table. Example: 9b60ff33-173f-3902-b49b-227db1d59ff2

List Imports

requires authentication imports index

List all NFe imports with filtering and pagination options.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/imports?sort_by=created_at&sort_desc=1&page=1&per_page=15&status=completed&import_type=nfe" \
    --header "Authorization: Bearer gcbahdvZ8aVkP164e3Df6E5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/imports"
);

const params = {
    "sort_by": "created_at",
    "sort_desc": "1",
    "page": "1",
    "per_page": "15",
    "status": "completed",
    "import_type": "nfe",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer gcbahdvZ8aVkP164e3Df6E5",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200, Imports retrieved successfully):


{
    "data": [
        {
            "id": "9d2f8e4a-1b3c-4d5e-6f7a-8b9c0d1e2f3a",
            "status": "completed",
            "import_type": "nfe",
            "original_filename": "nota_fiscal_001.xml",
            "nfe_number": "123456",
            "nfe_date": "2023-12-01",
            "total_products": 15,
            "processed_products": 15,
            "progress_percentage": 100,
            "imported_at": "2023-12-01T10:30:00.000Z",
            "supplier": {
                "name": "Fornecedor Ltda",
                "document": "12345678000199"
            }
        }
    ]
}
 

Request      

GET api/imports

Headers

Authorization        

Example: Bearer gcbahdvZ8aVkP164e3Df6E5

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

sort_by   string  optional    

Field to sort by. Example: created_at

sort_desc   boolean  optional    

Sort order (true for descending, false for ascending). Example: true

page   integer  optional    

Page number for pagination. O campo value deve ser pelo menos 1. Example: 1

per_page   integer  optional    

Number of imports per page. O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 15

status   string  optional    

Filter imports by status (pending, processing, completed, failed). Example: completed

Must be one of:
  • pending
  • processing
  • completed
  • failed
import_type   string  optional    

Filter imports by type. Example: nfe

Must be one of:
  • initial_load
  • stock_update
  • nfe

Get Import Details

requires authentication imports show

Retrieve detailed information about a specific NFe import, including progress and supplier data.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/imports/soluta" \
    --header "Authorization: Bearer kPv46aDd6a8Zge3c5fb1hEV" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/imports/soluta"
);

const headers = {
    "Authorization": "Bearer kPv46aDd6a8Zge3c5fb1hEV",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200, Import details retrieved successfully):


{
    "import_id": "9d2f8e4a-1b3c-4d5e-6f7a-8b9c0d1e2f3a",
    "status": "completed",
    "import_type": "nfe",
    "original_filename": "nota_fiscal_001.xml",
    "nfe_number": "123456",
    "nfe_date": "2023-12-01",
    "total_products": 15,
    "processed_products": 10,
    "progress_percentage": 66.67,
    "auto_linked_count": 4,
    "stock_launched_count": 7,
    "pending_stock_launch_count": 3,
    "imported_by": "João Silva",
    "imported_at": "2023-12-01T10:30:00.000Z",
    "supplier": {
        "id": "supplier-uuid",
        "name": "Fornecedor Ltda",
        "document": "12345678000199"
    },
    "fiscal_document": {
        "id": "fiscal-document-uuid",
        "nfe_number": "123456",
        "works": [
            {
                "id": "work-uuid",
                "name": "Hospital Bom Jesus",
                "cost_center": {
                    "id": "cost-center-uuid",
                    "code": "002.001",
                    "name": "Hospital Bom Jesus"
                }
            },
            {
                "id": "work-uuid-2",
                "name": "Reforma Centro",
                "cost_center": null
            }
        ]
    },
    "channel": "import-progress.9d2f8e4a-1b3c-4d5e-6f7a-8b9c0d1e2f3a"
}
 

Request      

GET api/imports/{importId}

Headers

Authorization        

Example: Bearer kPv46aDd6a8Zge3c5fb1hEV

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

importId   string     

Example: soluta

Delete Import

requires authentication imports delete

Delete an NFe import along with its supplier products and pending link mappings. Only allowed when no imported product has been linked to a system product and the import is not being processed.

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/imports/cupiditate" \
    --header "Authorization: Bearer Pakv5Z16eb3f6a8g4VcdEhD" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/imports/cupiditate"
);

const headers = {
    "Authorization": "Bearer Pakv5Z16eb3f6a8g4VcdEhD",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204, Import deleted successfully):

Empty response
 

Example response (422, Import has linked products or is still processing):


{
    "error": "Não é possível excluir uma importação com produtos já vinculados."
}
 

Request      

DELETE api/imports/{importId}

Headers

Authorization        

Example: Bearer Pakv5Z16eb3f6a8g4VcdEhD

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

importId   string     

Example: cupiditate

Get Import Products

requires authentication import-products index

List all products from a specific NFe import with filtering and pagination options.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/imports/et/products?sort_by=created_at&sort_desc=1&page=1&per_page=15&status=pending&q=Produto+ABC" \
    --header "Authorization: Bearer Pfe5k4661Dgadvah83EVcZb" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/imports/et/products"
);

const params = {
    "sort_by": "created_at",
    "sort_desc": "1",
    "page": "1",
    "per_page": "15",
    "status": "pending",
    "q": "Produto ABC",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer Pfe5k4661Dgadvah83EVcZb",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200, Products retrieved successfully):


{
    "import": {
        "id": "9d2f8e4a-1b3c-4d5e-6f7a-8b9c0d1e2f3a",
        "total_products": 15,
        "processed_products": 10,
        "progress_percentage": 66.67
    },
    "products": {
        "data": [
            {
                "id": "product-uuid",
                "supplier_product_code": "ABC123",
                "ean_code": "7891234567890",
                "name": "Nome do Produto",
                "unit": "UN",
                "quantity": 10,
                "unit_price": 15.5,
                "total_price": 155,
                "is_processed": false,
                "system_product": null,
                "linked_at": null,
                "linked_by": null,
                "has_stock_movement": false
            }
        ]
    },
    "pagination": {
        "current_page": 1,
        "per_page": 15,
        "total": 15,
        "last_page": 1
    }
}
 

Request      

GET api/imports/{importId}/products

Headers

Authorization        

Example: Bearer Pfe5k4661Dgadvah83EVcZb

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

importId   string     

Example: et

Query Parameters

sort_by   string  optional    

Field to sort by. Example: created_at

sort_desc   boolean  optional    

Sort order (true for descending, false for ascending). Example: true

page   integer  optional    

Page number for pagination. O campo value deve ser pelo menos 1. Example: 1

per_page   integer  optional    

Number of products per page. O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 15

status   string  optional    

Filter products by processing status (pending, processed). Example: pending

Must be one of:
  • pending
  • processed
q   string  optional    

Search products by name / code / EAN. O campo value não pode ser superior a 255 caracteres. Example: Produto ABC

List Import Stock Distributions

requires authentication import-products index

Return, per imported product, how the purchased quantity was distributed across stocks (works and main). Aggregated from stock movements generated by the import.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/imports/ut/distributions" \
    --header "Authorization: Bearer 8a61PDcZkbv4f35gaE6dhVe" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/imports/ut/distributions"
);

const headers = {
    "Authorization": "Bearer 8a61PDcZkbv4f35gaE6dhVe",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200, Distribution breakdown per product):


{
    "data": [
        {
            "product": {
                "id": "product-uuid",
                "name": "Cano PVC XPTO"
            },
            "total": 50,
            "by_stock": [
                {
                    "stock": {
                        "id": "stock-uuid-a",
                        "name": "Obra A",
                        "is_main": false
                    },
                    "quantity": 10
                },
                {
                    "stock": {
                        "id": "stock-uuid-b",
                        "name": "Obra B",
                        "is_main": false
                    },
                    "quantity": 30
                },
                {
                    "stock": {
                        "id": "main-uuid",
                        "name": "Principal",
                        "is_main": true
                    },
                    "quantity": 10
                }
            ]
        }
    ]
}
 

Request      

GET api/imports/{importId}/distributions

Headers

Authorization        

Example: Bearer 8a61PDcZkbv4f35gaE6dhVe

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

importId   string     

Example: ut

requires authentication import-products link

Inicia, de forma assíncrona, a vinculação de produtos do fornecedor a produtos do sistema ou criação de novos itens no estoque. Retorna 202 com o canal para acompanhar o progresso.

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/imports/doloribus/products/link" \
    --header "Authorization: Bearer 5d41Pahbvc8Vf36EZk6aegD" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"mappings\": [
        {
            \"distributions\": [
                {
                    \"stock_id\": \"Example Mappings * distributions * stock id\",
                    \"quantity\": 1
                }
            ]
        }
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/imports/doloribus/products/link"
);

const headers = {
    "Authorization": "Bearer 5d41Pahbvc8Vf36EZk6aegD",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "mappings": [
        {
            "distributions": [
                {
                    "stock_id": "Example Mappings * distributions * stock id",
                    "quantity": 1
                }
            ]
        }
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (202, Linking accepted and started asynchronously):


{
    "message": "Vinculação de produtos iniciada com sucesso",
    "total_mappings": 2,
    "channel": "imports.{import-uuid}"
}
 

Example response (422, Error linking products):


{
    "error": "Erro ao vincular produtos: Product not found"
}
 

Locations

Endpoints for states and cities

List states

requires authentication No specific permission required

List all states paginated

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/locations/states" \
    --header "Authorization: Bearer ed56ZkhDc168fPbgaa3V4Ev" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"sort_by\": \"sint\",
    \"sort_desc\": false,
    \"page\": 43,
    \"per_page\": 21
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/locations/states"
);

const headers = {
    "Authorization": "Bearer ed56ZkhDc168fPbgaa3V4Ev",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "sort_by": "sint",
    "sort_desc": false,
    "page": 43,
    "per_page": 21
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": null,
            "name": "quia in",
            "abbreviation": "PD"
        },
        {
            "id": null,
            "name": "autem alias",
            "abbreviation": "MQ"
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 30,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/locations/states

Headers

Authorization        

Example: Bearer ed56ZkhDc168fPbgaa3V4Ev

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

sort_by   string  optional    

Example: sint

sort_desc   boolean  optional    

Example: false

page   integer  optional    

O campo value deve ser pelo menos 1. Example: 43

per_page   integer  optional    

O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 21

List cities by state

requires authentication No specific permission required

List all cities for a given state

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/locations/states/019556e7-2e9f-777c-a177-30bbf0646c32/cities" \
    --header "Authorization: Bearer hfbdPDVa1c6368egv4EkZ5a" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/locations/states/019556e7-2e9f-777c-a177-30bbf0646c32/cities"
);

const headers = {
    "Authorization": "Bearer hfbdPDVa1c6368egv4EkZ5a",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": null,
            "name": "Quigleyton"
        },
        {
            "id": null,
            "name": "Katlynnport"
        }
    ]
}
 

Request      

GET api/locations/states/{state}/cities

Headers

Authorization        

Example: Bearer hfbdPDVa1c6368egv4EkZ5a

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

state   string     

State UUID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Notifications

Endpoints for user notifications

List notifications

requires authentication No specific permission required

List user notifications

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/notifications?sort_by=created_at&sort_desc=1&page=1&per_page=15&module=CashFlow&type=success&priority=10&unread_only=1&read_status=unread&date_start=2024-01-01&date_end=2024-12-31&q=erro+faturamento" \
    --header "Authorization: Bearer d3VE4PaDevkahb1Zf68gc65" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/notifications"
);

const params = {
    "sort_by": "created_at",
    "sort_desc": "1",
    "page": "1",
    "per_page": "15",
    "module": "CashFlow",
    "type": "success",
    "priority": "10",
    "unread_only": "1",
    "read_status": "unread",
    "date_start": "2024-01-01",
    "date_end": "2024-12-31",
    "q": "erro faturamento",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer d3VE4PaDevkahb1Zf68gc65",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/notifications

Headers

Authorization        

Example: Bearer d3VE4PaDevkahb1Zf68gc65

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

sort_by   string  optional    

Field to sort by. Example: created_at

sort_desc   boolean  optional    

Sort order (true for descending, false for ascending). Example: true

page   integer  optional    

Page number for pagination. O campo value deve ser pelo menos 1. Example: 1

per_page   integer  optional    

Number of items per page (max: 100). O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 15

module   string  optional    

Filter by module name. O campo value não pode ser superior a 100 caracteres. Example: CashFlow

type   string  optional    

Filter by type (ex.: info, success, warning, error). O campo value não pode ser superior a 100 caracteres. Example: success

priority   integer  optional    

Filter by priority number. O campo value deve ser pelo menos 0. O campo value não pode ser superior a 255. Example: 10

unread_only   boolean  optional    

Only unread notifications when true. Example: true

read_status   string  optional    

Filter by read status (all, read, unread). Example: unread

Must be one of:
  • all
  • read
  • unread
date_start   string  optional    

Filter notifications created from this date (YYYY-MM-DD). O campo value deve ser uma data válida. Example: 2024-01-01

date_end   string  optional    

Filter notifications created until this date (YYYY-MM-DD). O campo value deve ser uma data válida. O campo value deve ser uma data posterior ou igual a date_start. Example: 2024-12-31

q   string  optional    

Search by title/message. O campo value não pode ser superior a 255 caracteres. Example: erro faturamento

Mark notifications as read

requires authentication No specific permission required

Mark one or many notifications as read

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/notifications/mark-as-read" \
    --header "Authorization: Bearer fk5av64d1Z38eDac6EPgVbh" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"notifications\": [
        \"Example Notifications *\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/notifications/mark-as-read"
);

const headers = {
    "Authorization": "Bearer fk5av64d1Z38eDac6EPgVbh",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "notifications": [
        "Example Notifications *"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/notifications/mark-as-read

Headers

Authorization        

Example: Bearer fk5av64d1Z38eDac6EPgVbh

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

notifications   string[]     

notificação. O campo value deve ser um UUID válido.

Mark notifications as unread

requires authentication No specific permission required

Mark one or many notifications as unread

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/notifications/mark-as-unread" \
    --header "Authorization: Bearer Dedb66aV4EgfZh35akc1Pv8" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"notifications\": [
        \"Example Notifications *\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/notifications/mark-as-unread"
);

const headers = {
    "Authorization": "Bearer Dedb66aV4EgfZh35akc1Pv8",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "notifications": [
        "Example Notifications *"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/notifications/mark-as-unread

Headers

Authorization        

Example: Bearer Dedb66aV4EgfZh35akc1Pv8

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

notifications   string[]     

notificação. O campo value deve ser um UUID válido.

Mark all notifications as read

requires authentication No specific permission required

Mark all user notifications as read

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/notifications/mark-all-as-read" \
    --header "Authorization: Bearer gfEc6ka6V15ev84ZabPhD3d" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/notifications/mark-all-as-read"
);

const headers = {
    "Authorization": "Bearer gfEc6ka6V15ev84ZabPhD3d",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/notifications/mark-all-as-read

Headers

Authorization        

Example: Bearer gfEc6ka6V15ev84ZabPhD3d

Content-Type        

Example: application/json

Accept        

Example: application/json

Unread notifications count

requires authentication No specific permission required

Count of unread notifications for the user

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/notifications/unread-count" \
    --header "Authorization: Bearer h64ca8fb5gk1v6dPD3VEeaZ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/notifications/unread-count"
);

const headers = {
    "Authorization": "Bearer h64ca8fb5gk1v6dPD3VEeaZ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/notifications/unread-count

Headers

Authorization        

Example: Bearer h64ca8fb5gk1v6dPD3VEeaZ

Content-Type        

Example: application/json

Accept        

Example: application/json

Payment Receipts

Endpoints for payment receipts

List payment receipts

requires authentication payment-receipt index

List all payment receipts with filters

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/payment-receipts?sort_by=created_at&sort_desc=1&page=1&per_page=15&q=Jo%C3%A3o+Silva&employee_id=a01edd80-bf3e-40f7-8613-ccb4be5831b3&receiver_type=employee&start_date=2025-01-01&end_date=2025-12-31&min_amount=100&max_amount=1000&payment_method=PIX&city=S%C3%A3o+Paulo&search=aut&document=accusamus&work_id=a01edd80-bf3e-40f7-8613-ccb4be5831b3&cost_center_id=96871952-cd8b-375e-bb76-e3b368e6c87d&bank_account_id=a01edd80-bf3e-40f7-8613-ccb4be5831b3" \
    --header "Authorization: Bearer 86a1da3Eecv54kPfbZhg6VD" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/payment-receipts"
);

const params = {
    "sort_by": "created_at",
    "sort_desc": "1",
    "page": "1",
    "per_page": "15",
    "q": "João Silva",
    "employee_id": "a01edd80-bf3e-40f7-8613-ccb4be5831b3",
    "receiver_type": "employee",
    "start_date": "2025-01-01",
    "end_date": "2025-12-31",
    "min_amount": "100",
    "max_amount": "1000",
    "payment_method": "PIX",
    "city": "São Paulo",
    "search": "aut",
    "document": "accusamus",
    "work_id": "a01edd80-bf3e-40f7-8613-ccb4be5831b3",
    "cost_center_id": "96871952-cd8b-375e-bb76-e3b368e6c87d",
    "bank_account_id": "a01edd80-bf3e-40f7-8613-ccb4be5831b3",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer 86a1da3Eecv54kPfbZhg6VD",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "fd666c4c-d26c-3690-b57a-d808386cc1ce",
            "receipt_number": "REC-3434",
            "receiver_type": "custom",
            "receiver": {
                "id": null,
                "name": "Mrs. Pearlie Powlowski",
                "document": "947.781.282-84"
            },
            "payment": {
                "amount": 6168.71,
                "amount_in_words": "Valor por extenso de teste",
                "method": "check",
                "description": "Corporis quo autem aut hic qui omnis animi."
            },
            "issuer": {
                "name": "Schaefer, Nienow and Kunde",
                "document": "47.849.433/0220-73"
            },
            "issue": {
                "date": "2026-10-29",
                "city": "New Serena",
                "state": "BA"
            },
            "created_by": {
                "id": "a32930d5-cf0d-47bf-b921-0013c1d874cd",
                "name": "Miss Roma Hammes"
            },
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "f767191b-0e7a-3865-9ba8-d0666bae460d",
            "receipt_number": "REC-4159",
            "receiver_type": "employee",
            "receiver": {
                "id": null,
                "name": "Obie Gerlach",
                "document": "569.655.852-66"
            },
            "payment": {
                "amount": 9963.14,
                "amount_in_words": "Valor por extenso de teste",
                "method": "check",
                "description": "Vitae molestias quia dolorem."
            },
            "issuer": {
                "name": "Ferry and Sons",
                "document": "13.579.701/0208-87"
            },
            "issue": {
                "date": "2026-10-09",
                "city": "Nienowfort",
                "state": "BA"
            },
            "created_by": {
                "id": "a32930d5-d1fe-40b4-90aa-863ceed41d4c",
                "name": "Lavada Emard"
            },
            "created_at": null,
            "updated_at": null
        }
    ],
    "pagination": {
        "total": 2,
        "count": 2,
        "per_page": 10,
        "current_page": 1,
        "total_pages": 1,
        "has_more_pages": false
    },
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/payment-receipts

Headers

Authorization        

Example: Bearer 86a1da3Eecv54kPfbZhg6VD

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

sort_by   string  optional    

Field to sort by. Example: created_at

sort_desc   boolean  optional    

Sort order (true for descending, false for ascending). Example: true

page   integer  optional    

Page number for pagination. O campo value deve ser pelo menos 1. Example: 1

per_page   integer  optional    

Number of items per page (max: 100). O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 15

q   string  optional    

Search query (searches in receiver name, document, and receipt number). Example: João Silva

employee_id   string  optional    

Filter by employee UUID. The uuid of an existing record in the employees table. Example: a01edd80-bf3e-40f7-8613-ccb4be5831b3

receiver_type   string  optional    

Filter by receiver type. Example: employee

Must be one of:
  • employee
  • custom
start_date   string  optional    

Filter by issue date (start). O campo value deve ser uma data válida. Example: 2025-01-01

end_date   string  optional    

Filter by issue date (end). O campo value deve ser uma data válida. O campo value deve ser uma data posterior ou igual a start_date. Example: 2025-12-31

min_amount   number  optional    

Filter by minimum amount. O campo value deve ser pelo menos 0. Example: 100

max_amount   number  optional    

Filter by maximum amount. O campo value deve ser pelo menos 0. Example: 1000

payment_method   string  optional    

Filter by payment method. Example: PIX

city   string  optional    

Filter by city. Example: São Paulo

search   string  optional    

Example: aut

document   string  optional    

Example: accusamus

work_id   string  optional    

Filter by work UUID. O campo value deve ser um UUID válido. The uuid of an existing record in the works table. Example: a01edd80-bf3e-40f7-8613-ccb4be5831b3

cost_center_id   string  optional    

O campo value deve ser um UUID válido. The uuid of an existing record in the cost_centers table. Example: 96871952-cd8b-375e-bb76-e3b368e6c87d

bank_account_id   string  optional    

Filter by bank account UUID. O campo value deve ser um UUID válido. The uuid of an existing record in the bank_accounts table. Example: a01edd80-bf3e-40f7-8613-ccb4be5831b3

Export payment receipts to Excel

requires authentication payment-receipt export

Dispatches async Excel generation using the same filters as the listing. Frontend is notified via Pusher when ready.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/payment-receipts/excel?sort_by=created_at&sort_desc=1&page=1&per_page=15&q=Jo%C3%A3o+Silva&employee_id=a01edd80-bf3e-40f7-8613-ccb4be5831b3&receiver_type=employee&start_date=2025-01-01&end_date=2025-12-31&min_amount=100&max_amount=1000&payment_method=PIX&city=S%C3%A3o+Paulo&search=distinctio&document=iusto&work_id=a01edd80-bf3e-40f7-8613-ccb4be5831b3&cost_center_id=11f03fd2-5b9a-33b8-a20b-5e36c7b9fbca&bank_account_id=a01edd80-bf3e-40f7-8613-ccb4be5831b3" \
    --header "Authorization: Bearer V3ZaEdDb45agcPf6h6kev81" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/payment-receipts/excel"
);

const params = {
    "sort_by": "created_at",
    "sort_desc": "1",
    "page": "1",
    "per_page": "15",
    "q": "João Silva",
    "employee_id": "a01edd80-bf3e-40f7-8613-ccb4be5831b3",
    "receiver_type": "employee",
    "start_date": "2025-01-01",
    "end_date": "2025-12-31",
    "min_amount": "100",
    "max_amount": "1000",
    "payment_method": "PIX",
    "city": "São Paulo",
    "search": "distinctio",
    "document": "iusto",
    "work_id": "a01edd80-bf3e-40f7-8613-ccb4be5831b3",
    "cost_center_id": "11f03fd2-5b9a-33b8-a20b-5e36c7b9fbca",
    "bank_account_id": "a01edd80-bf3e-40f7-8613-ccb4be5831b3",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer V3ZaEdDb45agcPf6h6kev81",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (202):


{
    "message": "string",
    "channel": "string",
    "event": "string"
}
 

Example response (422):


{
    "message": "string"
}
 

Request      

GET api/payment-receipts/excel

Headers

Authorization        

Example: Bearer V3ZaEdDb45agcPf6h6kev81

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

sort_by   string  optional    

Field to sort by. Example: created_at

sort_desc   boolean  optional    

Sort order (true for descending, false for ascending). Example: true

page   integer  optional    

Page number for pagination. O campo value deve ser pelo menos 1. Example: 1

per_page   integer  optional    

Number of items per page (max: 100). O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 15

q   string  optional    

Search query (searches in receiver name, document, and receipt number). Example: João Silva

employee_id   string  optional    

Filter by employee UUID. The uuid of an existing record in the employees table. Example: a01edd80-bf3e-40f7-8613-ccb4be5831b3

receiver_type   string  optional    

Filter by receiver type. Example: employee

Must be one of:
  • employee
  • custom
start_date   string  optional    

Filter by issue date (start). O campo value deve ser uma data válida. Example: 2025-01-01

end_date   string  optional    

Filter by issue date (end). O campo value deve ser uma data válida. O campo value deve ser uma data posterior ou igual a start_date. Example: 2025-12-31

min_amount   number  optional    

Filter by minimum amount. O campo value deve ser pelo menos 0. Example: 100

max_amount   number  optional    

Filter by maximum amount. O campo value deve ser pelo menos 0. Example: 1000

payment_method   string  optional    

Filter by payment method. Example: PIX

city   string  optional    

Filter by city. Example: São Paulo

search   string  optional    

Example: distinctio

document   string  optional    

Example: iusto

work_id   string  optional    

Filter by work UUID. O campo value deve ser um UUID válido. The uuid of an existing record in the works table. Example: a01edd80-bf3e-40f7-8613-ccb4be5831b3

cost_center_id   string  optional    

O campo value deve ser um UUID válido. The uuid of an existing record in the cost_centers table. Example: 11f03fd2-5b9a-33b8-a20b-5e36c7b9fbca

bank_account_id   string  optional    

Filter by bank account UUID. O campo value deve ser um UUID válido. The uuid of an existing record in the bank_accounts table. Example: a01edd80-bf3e-40f7-8613-ccb4be5831b3

Show receipt cash flow config

requires authentication payment-receipt cash-flow-config index

Lista cada forma de pagamento e se ela gera lancamento automatico no fluxo de caixa

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/payment-receipts/cash-flow-config" \
    --header "Authorization: Bearer c1f86vZgb4deakDhP5E63aV" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/payment-receipts/cash-flow-config"
);

const headers = {
    "Authorization": "Bearer c1f86vZgb4deakDhP5E63aV",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/payment-receipts/cash-flow-config

Headers

Authorization        

Example: Bearer c1f86vZgb4deakDhP5E63aV

Content-Type        

Example: application/json

Accept        

Example: application/json

Update receipt cash flow config

requires authentication payment-receipt cash-flow-config update

Define, por forma de pagamento, se o recibo gera lancamento automatico no fluxo de caixa

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/payment-receipts/cash-flow-config" \
    --header "Authorization: Bearer 38Vev66PhgE5abZkD1a4fdc" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"methods\": [
        {
            \"method\": \"pix\",
            \"eligible\": false
        }
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/payment-receipts/cash-flow-config"
);

const headers = {
    "Authorization": "Bearer 38Vev66PhgE5abZkD1a4fdc",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "methods": [
        {
            "method": "pix",
            "eligible": false
        }
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/payment-receipts/cash-flow-config

Headers

Authorization        

Example: Bearer 38Vev66PhgE5abZkD1a4fdc

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

methods   object[]     

O campo value deve ter pelo menos 1 itens.

method   string     

Example: pix

Must be one of:
  • pix
  • bank_transfer
  • cash
  • check
eligible   boolean     

Example: false

Show payment receipt

requires authentication payment-receipt show

Show a payment receipt

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/payment-receipts/019556e7-2e9f-777c-a177-30bbf0646c32" \
    --header "Authorization: Bearer 1c46ZDVab3dPE6ae5kvgh8f" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/payment-receipts/019556e7-2e9f-777c-a177-30bbf0646c32"
);

const headers = {
    "Authorization": "Bearer 1c46ZDVab3dPE6ae5kvgh8f",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "41a8ede6-ba6b-3256-9235-3da651f79759",
        "receipt_number": "REC-7872",
        "receiver_type": "employee",
        "receiver": {
            "id": null,
            "name": "Rae Lowe",
            "document": "554.087.240-70"
        },
        "payment": {
            "amount": 7857.44,
            "amount_in_words": "Valor por extenso de teste",
            "method": "bank_transfer",
            "description": "Nostrum vel ut placeat autem modi."
        },
        "issuer": {
            "name": "Turner, Deckow and Pollich",
            "document": "17.334.312/4217-52"
        },
        "issue": {
            "date": "2026-10-25",
            "city": "South Dannyborough",
            "state": "CE"
        },
        "created_by": {
            "id": "a32930d5-e447-4c4c-8de9-7f01017316f6",
            "name": "Prof. Brayan Beier"
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/payment-receipts/{receipt}

Headers

Authorization        

Example: Bearer 1c46ZDVab3dPE6ae5kvgh8f

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

receipt   string     

Payment Receipt ID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Create payment receipt

requires authentication payment-receipt store

Create a new payment receipt

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/payment-receipts" \
    --header "Authorization: Bearer b31k4gvh6dZEDV6e5a8Pcaf" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"receiver_type\": \"Example Receiver type\",
    \"employee_id\": \"3f5aced7-0c3b-4c75-96c0-153bd322272f\",
    \"receiver_name\": \"Example Name\",
    \"receiver_document\": \"Example Receiver document\",
    \"amount\": 1,
    \"amount_in_words\": \"Example Amount in words\",
    \"payment_method\": \"Example Payment method\",
    \"description\": \"Example Description\",
    \"issuer_name\": \"Example Name\",
    \"issuer_document\": \"Example Issuer document\",
    \"issue_date\": \"2024-01-01\",
    \"city\": \"Example City\",
    \"state\": \"Example State\",
    \"work_id\": \"c01419da-390c-38bd-a6a7-bf30dad039bd\",
    \"cost_center_id\": \"bd8fdba7-8cee-319d-88eb-f239b24a9738\",
    \"bank_account_id\": \"63ed4e74-3723-3f21-bb22-e964a3979d13\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/payment-receipts"
);

const headers = {
    "Authorization": "Bearer b31k4gvh6dZEDV6e5a8Pcaf",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "receiver_type": "Example Receiver type",
    "employee_id": "3f5aced7-0c3b-4c75-96c0-153bd322272f",
    "receiver_name": "Example Name",
    "receiver_document": "Example Receiver document",
    "amount": 1,
    "amount_in_words": "Example Amount in words",
    "payment_method": "Example Payment method",
    "description": "Example Description",
    "issuer_name": "Example Name",
    "issuer_document": "Example Issuer document",
    "issue_date": "2024-01-01",
    "city": "Example City",
    "state": "Example State",
    "work_id": "c01419da-390c-38bd-a6a7-bf30dad039bd",
    "cost_center_id": "bd8fdba7-8cee-319d-88eb-f239b24a9738",
    "bank_account_id": "63ed4e74-3723-3f21-bb22-e964a3979d13"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "string"
}
 

Request      

POST api/payment-receipts

Headers

Authorization        

Example: Bearer b31k4gvh6dZEDV6e5a8Pcaf

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

receiver_type   string     

Tipo de Recebedor. Example: Example Receiver type

Must be one of:
  • employee
  • custom
employee_id   string  optional    

Funcionário. This field is required when receiver_type is employee. The uuid of an existing record in the employees table. Example: 3f5aced7-0c3b-4c75-96c0-153bd322272f

receiver_name   string  optional    

Nome do Recebedor. This field is required when receiver_type is custom. O campo value não pode ser superior a 255 caracteres. Example: Example Name

receiver_document   string  optional    

Documento do Recebedor. This field is required when receiver_type is custom. O campo value não pode ser superior a 255 caracteres. Example: Example Receiver document

amount   number     

Valor. O campo value deve ser pelo menos 0.01. Example: 1

amount_in_words   string  optional    

Valor por Extenso. Example: Example Amount in words

payment_method   string     

Método de Pagamento. Example: Example Payment method

Must be one of:
  • pix
  • bank_transfer
  • cash
  • check
description   string     

Descrição. Example: Example Description

issuer_name   string     

Nome do Emissor. O campo value não pode ser superior a 255 caracteres. Example: Example Name

issuer_document   string     

Documento do Emissor. O campo value não pode ser superior a 255 caracteres. Example: Example Issuer document

issue_date   string     

Data de Emissão. O campo value deve ser uma data válida. O campo value deve ser uma data anterior ou igual a today. Example: 2024-01-01

city   string     

Cidade. O campo value não pode ser superior a 255 caracteres. Example: Example City

state   string     

Estado. O campo value não pode ser superior a 2 caracteres. Example: Example State

work_id   string  optional    

Obra. O campo value deve ser um UUID válido. The uuid of an existing record in the works table. Example: c01419da-390c-38bd-a6a7-bf30dad039bd

cost_center_id   string     

Cost center id. The uuid of an existing record in the cost_centers table. Example: bd8fdba7-8cee-319d-88eb-f239b24a9738

bank_account_id   string  optional    

Conta Bancária. O campo value deve ser um UUID válido. The uuid of an existing record in the bank_accounts table. Example: 63ed4e74-3723-3f21-bb22-e964a3979d13

Update payment receipt

requires authentication payment-receipt update

Update a payment receipt

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/payment-receipts/019556e7-2e9f-777c-a177-30bbf0646c32" \
    --header "Authorization: Bearer 4cVeZbf85Dkvghad61a6E3P" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"receiver_type\": \"Example Receiver type\",
    \"employee_id\": \"3c6fbc5c-4880-4b0d-8bfc-681c2e78fc65\",
    \"receiver_name\": \"Example Name\",
    \"receiver_document\": \"Example Receiver document\",
    \"amount\": 1,
    \"amount_in_words\": \"Example Amount in words\",
    \"payment_method\": \"Example Payment method\",
    \"description\": \"Example Description\",
    \"issuer_name\": \"Example Name\",
    \"issuer_document\": \"Example Issuer document\",
    \"issue_date\": \"2024-01-01\",
    \"city\": \"Example City\",
    \"state\": \"Example State\",
    \"work_id\": \"b2ec1136-5e97-3c6c-8fea-a7de5fa6ffe4\",
    \"cost_center_id\": \"def69573-ae6f-3307-b16b-8b537a117532\",
    \"bank_account_id\": \"d9bcacb4-1e6b-35f5-aefa-cc3bf0c069e7\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/payment-receipts/019556e7-2e9f-777c-a177-30bbf0646c32"
);

const headers = {
    "Authorization": "Bearer 4cVeZbf85Dkvghad61a6E3P",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "receiver_type": "Example Receiver type",
    "employee_id": "3c6fbc5c-4880-4b0d-8bfc-681c2e78fc65",
    "receiver_name": "Example Name",
    "receiver_document": "Example Receiver document",
    "amount": 1,
    "amount_in_words": "Example Amount in words",
    "payment_method": "Example Payment method",
    "description": "Example Description",
    "issuer_name": "Example Name",
    "issuer_document": "Example Issuer document",
    "issue_date": "2024-01-01",
    "city": "Example City",
    "state": "Example State",
    "work_id": "b2ec1136-5e97-3c6c-8fea-a7de5fa6ffe4",
    "cost_center_id": "def69573-ae6f-3307-b16b-8b537a117532",
    "bank_account_id": "d9bcacb4-1e6b-35f5-aefa-cc3bf0c069e7"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "string"
}
 

Request      

PUT api/payment-receipts/{receipt}

Headers

Authorization        

Example: Bearer 4cVeZbf85Dkvghad61a6E3P

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

receipt   string     

Payment Receipt ID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Body Parameters

receiver_type   string  optional    

Tipo de Recebedor. Example: Example Receiver type

Must be one of:
  • employee
  • custom
employee_id   string  optional    

Funcionário. This field is required when receiver_type is employee. The uuid of an existing record in the employees table. Example: 3c6fbc5c-4880-4b0d-8bfc-681c2e78fc65

receiver_name   string  optional    

Nome do Recebedor. This field is required when receiver_type is custom. O campo value não pode ser superior a 255 caracteres. Example: Example Name

receiver_document   string  optional    

Documento do Recebedor. This field is required when receiver_type is custom. O campo value não pode ser superior a 255 caracteres. Example: Example Receiver document

amount   number  optional    

Valor. O campo value deve ser pelo menos 0.01. Example: 1

amount_in_words   string  optional    

Valor por Extenso. Example: Example Amount in words

payment_method   string  optional    

Método de Pagamento. Example: Example Payment method

Must be one of:
  • pix
  • bank_transfer
  • cash
  • check
description   string  optional    

Descrição. Example: Example Description

issuer_name   string  optional    

Nome do Emissor. O campo value não pode ser superior a 255 caracteres. Example: Example Name

issuer_document   string  optional    

Documento do Emissor. O campo value não pode ser superior a 255 caracteres. Example: Example Issuer document

issue_date   string  optional    

Data de Emissão. O campo value deve ser uma data válida. O campo value deve ser uma data anterior ou igual a today. Example: 2024-01-01

city   string  optional    

Cidade. O campo value não pode ser superior a 255 caracteres. Example: Example City

state   string  optional    

Estado. O campo value não pode ser superior a 2 caracteres. Example: Example State

work_id   string  optional    

Obra. O campo value deve ser um UUID válido. The uuid of an existing record in the works table. Example: b2ec1136-5e97-3c6c-8fea-a7de5fa6ffe4

cost_center_id   string     

Cost center id. The uuid of an existing record in the cost_centers table. Example: def69573-ae6f-3307-b16b-8b537a117532

bank_account_id   string  optional    

Conta Bancária. O campo value deve ser um UUID válido. The uuid of an existing record in the bank_accounts table. Example: d9bcacb4-1e6b-35f5-aefa-cc3bf0c069e7

Delete payment receipt

requires authentication payment-receipt delete

Delete a payment receipt

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/payment-receipts/019556e7-2e9f-777c-a177-30bbf0646c32" \
    --header "Authorization: Bearer c8fb3PD65hVa146dZevEgak" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/payment-receipts/019556e7-2e9f-777c-a177-30bbf0646c32"
);

const headers = {
    "Authorization": "Bearer c8fb3PD65hVa146dZevEgak",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/payment-receipts/{receipt}

Headers

Authorization        

Example: Bearer c8fb3PD65hVa146dZevEgak

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

receipt   string     

Payment Receipt ID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

List employee receipts

requires authentication payment-receipt index

List all payment receipts for a specific employee

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/employees/17/receipts" \
    --header "Authorization: Bearer 56ecgPDkE6V4abvd8af1Z3h" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/17/receipts"
);

const headers = {
    "Authorization": "Bearer 56ecgPDkE6V4abvd8af1Z3h",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "eb123875-737e-3cae-8baf-86e1ca1442a9",
            "receipt_number": "REC-9986",
            "receiver_type": "employee",
            "receiver": {
                "id": null,
                "name": "Aurelie Hammes",
                "document": "365.453.538-54"
            },
            "payment": {
                "amount": 4705.43,
                "amount_in_words": "Valor por extenso de teste",
                "method": "cash",
                "description": "Facere et incidunt iure aliquid ea."
            },
            "issuer": {
                "name": "Greenholt, Barrows and Borer",
                "document": "15.901.722/0513-42"
            },
            "issue": {
                "date": "2026-10-14",
                "city": "South Jorgeberg",
                "state": "CE"
            },
            "created_by": {
                "id": "a32930d6-0f4f-40a2-bb6d-7347be1c85e8",
                "name": "Hettie Mitchell III"
            },
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "c6f12bc0-450c-3b81-b22f-01e76bf4fa1b",
            "receipt_number": "REC-6338",
            "receiver_type": "custom",
            "receiver": {
                "id": null,
                "name": "Effie Cummings",
                "document": "225.424.688-06"
            },
            "payment": {
                "amount": 7955.02,
                "amount_in_words": "Valor por extenso de teste",
                "method": "bank_transfer",
                "description": "Asperiores ea molestiae adipisci in voluptatem."
            },
            "issuer": {
                "name": "Herzog, Crist and Gusikowski",
                "document": "03.774.958/1077-61"
            },
            "issue": {
                "date": "2026-11-04",
                "city": "Harveytown",
                "state": "PE"
            },
            "created_by": {
                "id": "a32930d6-11a6-4e31-9a14-52ca66ceb409",
                "name": "Ms. Katelin Greenholt"
            },
            "created_at": null,
            "updated_at": null
        }
    ],
    "pagination": {
        "total": 2,
        "count": 2,
        "per_page": 10,
        "current_page": 1,
        "total_pages": 1,
        "has_more_pages": false
    },
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/employees/{employee_id}/receipts

Headers

Authorization        

Example: Bearer 56ecgPDkE6V4abvd8af1Z3h

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employee_id   integer     

The ID of the employee. Example: 17

employee   string     

Employee ID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Permission Groups

Endpoints for permission groups

List ungrouped permissions

requires authentication permission-group index

List all permissions that do not belong to any permission group.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/permission-groups/ungrouped-permissions?q=Permission+name&page=1&per_page=10" \
    --header "Authorization: Bearer hfZ6P6v1a4kVcE3deDb85ag" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/permission-groups/ungrouped-permissions"
);

const params = {
    "q": "Permission name",
    "page": "1",
    "per_page": "10",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer hfZ6P6v1a4kVcE3deDb85ag",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "70563aa5-b237-3d5c-8050-b0e55c51a4c6",
            "name": "voluptates",
            "display_name": "Laboriosam perferendis aut ipsam debitis."
        },
        {
            "id": "3efa7dc8-6e54-3079-a9c3-d23b9b788194",
            "name": "eos",
            "display_name": "Aliquam iste et soluta ea ipsam asperiores odio."
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/permission-groups/ungrouped-permissions

Headers

Authorization        

Example: Bearer hfZ6P6v1a4kVcE3deDb85ag

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

q   string  optional    

Search query. Example: Permission name

page   integer  optional    

Page number. O campo value deve ser pelo menos 1. Example: 1

per_page   integer  optional    

Items per page. O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 10

List permission groups

requires authentication permission-group index

List all permission groups

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/permission-groups" \
    --header "Authorization: Bearer vbefEk5h8V6cP4gD6dZa31a" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/permission-groups"
);

const headers = {
    "Authorization": "Bearer vbefEk5h8V6cP4gD6dZa31a",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "da1403f2-b769-362e-bf48-e2dbd94a8980",
            "name": "distinctio-aut",
            "display_name": "eum animi maiores",
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "a80508ca-9c03-360b-a2d2-3891ee6e62ce",
            "name": "officiis-ex",
            "display_name": "et dolore voluptatem",
            "created_at": null,
            "updated_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/permission-groups

Headers

Authorization        

Example: Bearer vbefEk5h8V6cP4gD6dZa31a

Content-Type        

Example: application/json

Accept        

Example: application/json

Create permission group

requires authentication permission-group store

Create a new permission group

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/permission-groups" \
    --header "Authorization: Bearer vfekEZa1Dgc8ha6364dPV5b" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"display_name\": \"Example Name\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/permission-groups"
);

const headers = {
    "Authorization": "Bearer vfekEZa1Dgc8ha6364dPV5b",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "display_name": "Example Name"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "string"
}
 

Request      

POST api/permission-groups

Headers

Authorization        

Example: Bearer vfekEZa1Dgc8ha6364dPV5b

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Name. O campo value não pode ser superior a 255 caracteres. Example: Example Name

display_name   string     

Display name. O campo value não pode ser superior a 255 caracteres. Example: Example Name

Update permission group

requires authentication permission-group update

Update a permission group

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/permission-groups/1" \
    --header "Authorization: Bearer b646a1a8vP5cdehDEkZg3Vf" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"display_name\": \"Example Name\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/permission-groups/1"
);

const headers = {
    "Authorization": "Bearer b646a1a8vP5cdehDEkZg3Vf",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "display_name": "Example Name"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "string"
}
 

Request      

PUT api/permission-groups/{permissionGroup}

Headers

Authorization        

Example: Bearer b646a1a8vP5cdehDEkZg3Vf

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

permissionGroup   integer     

Example: 1

Body Parameters

name   string  optional    

Name. O campo value não pode ser superior a 255 caracteres. Example: Example Name

display_name   string  optional    

Display name. O campo value não pode ser superior a 255 caracteres. Example: Example Name

Show permission group

requires authentication permission-group show

Show a permission group

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/permission-groups/1" \
    --header "Authorization: Bearer hb3cfe6ka1VZv68d5Eg4aPD" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/permission-groups/1"
);

const headers = {
    "Authorization": "Bearer hb3cfe6ka1VZv68d5Eg4aPD",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "df9584dc-1b9e-3234-be3c-6cb2ce35caa1",
        "name": "dolor-aut-quam",
        "display_name": "deleniti mollitia eum",
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/permission-groups/{permissionGroup}

Headers

Authorization        

Example: Bearer hb3cfe6ka1VZv68d5Eg4aPD

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

permissionGroup   integer     

Example: 1

Delete permission group

requires authentication permission-group delete

Delete a permission group

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/permission-groups/1" \
    --header "Authorization: Bearer 64cvkZha6V1fEba3eD58gPd" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/permission-groups/1"
);

const headers = {
    "Authorization": "Bearer 64cvkZha6V1fEba3eD58gPd",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/permission-groups/{permissionGroup}

Headers

Authorization        

Example: Bearer 64cvkZha6V1fEba3eD58gPd

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

permissionGroup   integer     

Example: 1

Attach permissions to group

requires authentication permission-group permissions-attach

Attach one or more permissions to a permission group. Permissions already in another group are moved to this group.

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/permission-groups/1/permissions" \
    --header "Authorization: Bearer P1648hafb6vdgecE5ZVk3Da" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"permissions\": [
        \"f34bb6b1-fbd3-391b-ba48-0d0c57528498\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/permission-groups/1/permissions"
);

const headers = {
    "Authorization": "Bearer P1648hafb6vdgecE5ZVk3Da",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "permissions": [
        "f34bb6b1-fbd3-391b-ba48-0d0c57528498"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "deb9d5ab-33df-39c7-aaaa-ab333d43e343",
        "name": "officia-eum-ratione",
        "display_name": "velit laboriosam delectus",
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

POST api/permission-groups/{permissionGroup}/permissions

Headers

Authorization        

Example: Bearer P1648hafb6vdgecE5ZVk3Da

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

permissionGroup   integer     

Example: 1

Body Parameters

permissions   string[]     

ID da permissão. O campo value deve ser um UUID válido. The uuid of an existing record in the permissions table.

Detach permissions from group

requires authentication permission-group permissions-detach

Detach one or more permissions from a permission group. Fails if any permission does not belong to the group.

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/permission-groups/1/permissions" \
    --header "Authorization: Bearer fV8Dcahkv53e1baP6Eg6d4Z" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"permissions\": [
        \"c6c2d454-7023-3476-bac0-52d0cbfc4818\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/permission-groups/1/permissions"
);

const headers = {
    "Authorization": "Bearer fV8Dcahkv53e1baP6Eg6d4Z",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "permissions": [
        "c6c2d454-7023-3476-bac0-52d0cbfc4818"
    ]
};

fetch(url, {
    method: "DELETE",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "685803fd-8bfc-309c-b5db-c372728ea040",
        "name": "nesciunt-eos",
        "display_name": "quidem velit temporibus",
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

DELETE api/permission-groups/{permissionGroup}/permissions

Headers

Authorization        

Example: Bearer fV8Dcahkv53e1baP6Eg6d4Z

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

permissionGroup   integer     

Example: 1

Body Parameters

permissions   string[]     

ID da permissão. O campo value deve ser um UUID válido. The uuid of an existing record in the permissions table.

Product Brands

Endpoints for product brands

List product brands

requires authentication product-brand index

List all product brands

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/product-brands?q=Structure" \
    --header "Authorization: Bearer a16Ddg3EPZfc5vb86hVae4k" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-brands"
);

const params = {
    "q": "Structure",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer a16Ddg3EPZfc5vb86hVae4k",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "c1847275-a89d-3b06-8cac-d00998ac7e23",
            "name": "Dr. Heitor Bernardo Arruda",
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "319ae9a1-53e5-35ab-9e7c-21e8af07c590",
            "name": "Dr. Cléber Matos Bittencourt",
            "created_at": null,
            "updated_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/product-brands

Headers

Authorization        

Example: Bearer a16Ddg3EPZfc5vb86hVae4k

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

q   string  optional    

Example: Structure

Show product brand

requires authentication product-brand show

Show a product brand

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/product-brands/explicabo" \
    --header "Authorization: Bearer b86D4EhZ6gPckafVe51vd3a" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-brands/explicabo"
);

const headers = {
    "Authorization": "Bearer b86D4EhZ6gPckafVe51vd3a",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "84bc48dc-c9f5-3d30-86c1-6849a6c5de52",
        "name": "Isabel Delgado Solano Jr.",
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/product-brands/{productBrand}

Headers

Authorization        

Example: Bearer b86D4EhZ6gPckafVe51vd3a

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productBrand   string     

Product brand UUID Example: explicabo

Create product brand

requires authentication product-brand store

Create a new product brand

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/product-brands" \
    --header "Authorization: Bearer ka4cDbZv3hfdea66PVE8g15" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-brands"
);

const headers = {
    "Authorization": "Bearer ka4cDbZv3hfdea66PVE8g15",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "string"
}
 

Request      

POST api/product-brands

Headers

Authorization        

Example: Bearer ka4cDbZv3hfdea66PVE8g15

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Nome. Example: Example Name

Update product brand

requires authentication product-brand update

Update a product brand

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/product-brands/voluptas" \
    --header "Authorization: Bearer 3cvP1kDh5aa8egfbZ6d46EV" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-brands/voluptas"
);

const headers = {
    "Authorization": "Bearer 3cvP1kDh5aa8egfbZ6d46EV",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "string"
}
 

Request      

PUT api/product-brands/{productBrand}

Headers

Authorization        

Example: Bearer 3cvP1kDh5aa8egfbZ6d46EV

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productBrand   string     

Product brand UUID Example: voluptas

Body Parameters

name   string     

Nome. Example: Example Name

Delete product brand

requires authentication product-brand delete

Delete a product brand

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/product-brands/facere" \
    --header "Authorization: Bearer 3VP5fbdah6evc4k6a1ZEg8D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-brands/facere"
);

const headers = {
    "Authorization": "Bearer 3VP5fbdah6evc4k6a1ZEg8D",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/product-brands/{productBrand}

Headers

Authorization        

Example: Bearer 3VP5fbdah6evc4k6a1ZEg8D

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productBrand   string     

Product brand UUID Example: facere

Product Families

Endpoints for product families

List product families

requires authentication product-family index

List all product families

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/product-families?is_epi=1&q=Structure" \
    --header "Authorization: Bearer cPZkVa56e3bagdvfD681hE4" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-families"
);

const params = {
    "is_epi": "1",
    "q": "Structure",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer cPZkVa56e3bagdvfD681hE4",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "d2c11f79-3181-34d1-af56-e19ee121e0d7",
            "name": "Dayana Marinho Branco",
            "is_epi": false,
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "0374b2b6-6f27-36e1-8ab4-50502f2a3fa9",
            "name": "Sr. Emanuel Aguiar Neto",
            "is_epi": false,
            "created_at": null,
            "updated_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/product-families

Headers

Authorization        

Example: Bearer cPZkVa56e3bagdvfD681hE4

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

is_epi   boolean  optional    

Example: true

q   string  optional    

Example: Structure

Show product family

requires authentication product-family show

Show a product family

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/product-families/labore" \
    --header "Authorization: Bearer Pb4gae8k3V5cdEh61v6fZDa" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-families/labore"
);

const headers = {
    "Authorization": "Bearer Pb4gae8k3V5cdEh61v6fZDa",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "ad82dc0a-e65e-36e4-85d7-eae4e507d48e",
        "name": "Elaine Lia Bonilha",
        "is_epi": false,
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/product-families/{productFamily}

Headers

Authorization        

Example: Bearer Pb4gae8k3V5cdEh61v6fZDa

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productFamily   string     

Product family UUID Example: labore

Create product family

requires authentication product-family store

Create a new product family

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/product-families" \
    --header "Authorization: Bearer d654h1faVage3PEbkcZ6v8D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"is_epi\": true
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-families"
);

const headers = {
    "Authorization": "Bearer d654h1faVage3PEbkcZ6v8D",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "is_epi": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "string"
}
 

Request      

POST api/product-families

Headers

Authorization        

Example: Bearer d654h1faVage3PEbkcZ6v8D

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Nome. Example: Example Name

is_epi   boolean  optional    

É família de EPI. Example: true

Update product family

requires authentication product-family update

Update a product family

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/product-families/eum" \
    --header "Authorization: Bearer gc6ea8b63PadfZkvEDh41V5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"is_epi\": true
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-families/eum"
);

const headers = {
    "Authorization": "Bearer gc6ea8b63PadfZkvEDh41V5",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "is_epi": true
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "string"
}
 

Request      

PUT api/product-families/{productFamily}

Headers

Authorization        

Example: Bearer gc6ea8b63PadfZkvEDh41V5

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productFamily   string     

Product family UUID Example: eum

Body Parameters

name   string     

Nome. Example: Example Name

is_epi   boolean  optional    

É família de EPI. Example: true

Delete product family

requires authentication product-family delete

Delete a product family

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/product-families/quod" \
    --header "Authorization: Bearer Za6fvD5d4VPEek6g1a83hbc" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-families/quod"
);

const headers = {
    "Authorization": "Bearer Za6fvD5d4VPEek6g1a83hbc",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/product-families/{productFamily}

Headers

Authorization        

Example: Bearer Za6fvD5d4VPEek6g1a83hbc

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productFamily   string     

Product family UUID Example: quod

Product Quantity Lists

Endpoints for managing product quantity lists

List product quantity lists

requires authentication product-quantity-list index

List all product quantity lists

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/product-quantity-lists" \
    --header "Authorization: Bearer Zf6e5agkbhPdv184EaD63Vc" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"q\": \"Example Q\",
    \"work_id\": \"f389198c-4823-32fb-afa1-bdde3d579b18\",
    \"user_id\": \"afcb78ed-f6e4-3391-b8e6-ff5c3c0b9f5a\",
    \"responsible_id\": \"7161704d-18bf-3f5d-9eef-d1c0ed53524f\",
    \"per_page\": 1,
    \"sort\": \"Example Sort\",
    \"sort_desc\": true
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-quantity-lists"
);

const headers = {
    "Authorization": "Bearer Zf6e5agkbhPdv184EaD63Vc",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "q": "Example Q",
    "work_id": "f389198c-4823-32fb-afa1-bdde3d579b18",
    "user_id": "afcb78ed-f6e4-3391-b8e6-ff5c3c0b9f5a",
    "responsible_id": "7161704d-18bf-3f5d-9eef-d1c0ed53524f",
    "per_page": 1,
    "sort": "Example Sort",
    "sort_desc": true
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "5c68a7e6-b147-3be9-a153-b95723040222",
            "name": "Vel tempore sint.",
            "description": null,
            "work": {
                "id": "a32930d6-aa9c-4649-b69d-4f438a5589bb",
                "name": "Henrique Matias Valentin"
            },
            "user": {
                "id": "a32930d6-adb0-45f6-8d52-383ce67efb8b",
                "name": "Westley Leannon Jr."
            },
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "61fc2ad3-bae8-395e-8808-2a0f74d87a84",
            "name": "Ut tenetur eos quo ipsa.",
            "description": null,
            "work": {
                "id": "a32930d6-b6bb-4727-893e-952513b2edb5",
                "name": "Srta. Alexa Alcantara Filho"
            },
            "user": {
                "id": "a32930d6-ba68-4b4c-b663-14e89be5fec3",
                "name": "Mathias Walsh"
            },
            "created_at": null,
            "updated_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/product-quantity-lists

Headers

Authorization        

Example: Bearer Zf6e5agkbhPdv184EaD63Vc

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

q   string  optional    

Busca. Example: Example Q

work_id   string  optional    

Obra. The uuid of an existing record in the works table. Example: f389198c-4823-32fb-afa1-bdde3d579b18

user_id   string  optional    

Usuário. The uuid of an existing record in the users table. Example: afcb78ed-f6e4-3391-b8e6-ff5c3c0b9f5a

responsible_id   string  optional    

Responsável. The uuid of an existing record in the users table. Example: 7161704d-18bf-3f5d-9eef-d1c0ed53524f

per_page   integer  optional    

Itens por página. O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 1

sort   string  optional    

Ordenação. Example: Example Sort

sort_desc   boolean  optional    

Ordem decrescente. Example: true

Show product quantity list

requires authentication product-quantity-list show

Show a product quantity list

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/product-quantity-lists/molestias" \
    --header "Authorization: Bearer P5gZda8DkVfEc6ab43he1v6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-quantity-lists/molestias"
);

const headers = {
    "Authorization": "Bearer P5gZda8DkVfEc6ab43he1v6",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "eba1c469-2826-3297-bb8a-c862a4b46d09",
        "name": "Nihil id id qui ea.",
        "description": null,
        "work": {
            "id": "a32930d6-c1be-48df-bcba-0e91ed29c78e",
            "name": "Sra. Alexa Vega Domingues"
        },
        "user": {
            "id": "a32930d6-c526-4cd9-b491-64f9b444ab08",
            "name": "Letha Wehner"
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/product-quantity-lists/{productQuantityList}

Headers

Authorization        

Example: Bearer P5gZda8DkVfEc6ab43he1v6

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productQuantityList   string     

Product Quantity List UUID Example: molestias

List items

requires authentication product-quantity-list show

List all items from a product quantity list with pagination

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/product-quantity-lists/laborum/items" \
    --header "Authorization: Bearer g864ZPbcD31ad6fvaEh5eVk" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"per_page\": 1,
    \"q\": \"Example Q\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-quantity-lists/laborum/items"
);

const headers = {
    "Authorization": "Bearer g864ZPbcD31ad6fvaEh5eVk",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "per_page": 1,
    "q": "Example Q"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "f703079d-42a3-336a-915b-cbd6a7a143eb",
            "product": {
                "id": "a32930d6-dd4c-4acc-8e49-b254967495d9",
                "name": "Dr. Regina Bonilha Alves",
                "code": "PRD-952999",
                "unit": {
                    "id": "a32930d6-dab1-4242-8fa2-f5873c28845c",
                    "name": "Victor Delvalle Jr.",
                    "abbreviation": "Giovanna Queirós Neves Neto"
                }
            },
            "quantity": 251.8724,
            "observation": "Rem distinctio adipisci omnis ad iste quasi.",
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "20f6811b-3a0f-3981-ac50-ba6c4fe00958",
            "product": {
                "id": "a32930d6-ed33-4ad5-8b8b-310db1e6fa43",
                "name": "Srta. Alessandra Juliana Montenegro Filho",
                "code": "PRD-031505",
                "unit": {
                    "id": "a32930d6-ebe2-4ff0-819b-37866e7ff4c7",
                    "name": "Anderson Feliciano",
                    "abbreviation": "Srta. Mia Lutero Gil Sobrinho"
                }
            },
            "quantity": 391.8951,
            "observation": "Repellendus qui nesciunt accusantium facilis rerum est.",
            "created_at": null,
            "updated_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/product-quantity-lists/{productQuantityList}/items

Headers

Authorization        

Example: Bearer g864ZPbcD31ad6fvaEh5eVk

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productQuantityList   string     

Product Quantity List UUID Example: laborum

Body Parameters

per_page   integer  optional    

Itens por página. O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 1

q   string  optional    

Busca. O campo value não pode ser superior a 255 caracteres. Example: Example Q

Create product quantity list

requires authentication product-quantity-list store

Create a new product quantity list

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/product-quantity-lists" \
    --header "Authorization: Bearer 6EDaP4Z13ghvfba85cV6kde" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"description\": \"Example Description\",
    \"work_id\": \"f3cc263b-082a-3564-8c0a-4f843e47b701\",
    \"items\": [
        {
            \"product_id\": \"4a3d4981-257f-3225-8f49-545d95fb2b0f\",
            \"quantity\": 1,
            \"observation\": \"Example Items * observation\"
        },
        null
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-quantity-lists"
);

const headers = {
    "Authorization": "Bearer 6EDaP4Z13ghvfba85cV6kde",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "description": "Example Description",
    "work_id": "f3cc263b-082a-3564-8c0a-4f843e47b701",
    "items": [
        {
            "product_id": "4a3d4981-257f-3225-8f49-545d95fb2b0f",
            "quantity": 1,
            "observation": "Example Items * observation"
        },
        null
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "data": "object"
}
 

Request      

POST api/product-quantity-lists

Headers

Authorization        

Example: Bearer 6EDaP4Z13ghvfba85cV6kde

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string  optional    

Nome. O campo value não pode ser superior a 255 caracteres. Example: Example Name

description   string  optional    

Descrição. Example: Example Description

work_id   string     

Obra. The uuid of an existing record in the works table. Example: f3cc263b-082a-3564-8c0a-4f843e47b701

items   object[]  optional    

Itens.

product_id   string     

Produto. The uuid of an existing record in the products table. Example: 4a3d4981-257f-3225-8f49-545d95fb2b0f

quantity   number     

Quantidade. O campo value deve ser pelo menos 0.0001. Example: 1

observation   string  optional    

Observação. Example: Example Items * observation

Update product quantity list

requires authentication product-quantity-list update

Update a product quantity list. Can include items to replace all items in the list.

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/product-quantity-lists/et" \
    --header "Authorization: Bearer Dvf5ha634ed6Z8gPkbcE1Va" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"description\": \"Example Description\",
    \"items\": [
        {
            \"id\": \"09d740ec-42f9-30bc-aae8-c13d625ff90d\",
            \"product_id\": \"f9e523e2-3e6c-3152-b128-7d3aeb36e7e5\",
            \"quantity\": 1,
            \"observation\": \"Example Items * observation\"
        },
        null
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-quantity-lists/et"
);

const headers = {
    "Authorization": "Bearer Dvf5ha634ed6Z8gPkbcE1Va",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "description": "Example Description",
    "items": [
        {
            "id": "09d740ec-42f9-30bc-aae8-c13d625ff90d",
            "product_id": "f9e523e2-3e6c-3152-b128-7d3aeb36e7e5",
            "quantity": 1,
            "observation": "Example Items * observation"
        },
        null
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": "object"
}
 

Request      

PUT api/product-quantity-lists/{productQuantityList}

Headers

Authorization        

Example: Bearer Dvf5ha634ed6Z8gPkbcE1Va

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productQuantityList   string     

Product Quantity List UUID Example: et

Body Parameters

name   string  optional    

Nome. O campo value não pode ser superior a 255 caracteres. Example: Example Name

description   string  optional    

Descrição. Example: Example Description

items   object[]  optional    

Itens.

id   string  optional    

ID do Item. The uuid of an existing record in the product_quantity_list_items table. Example: 09d740ec-42f9-30bc-aae8-c13d625ff90d

product_id   string     

Produto. The uuid of an existing record in the products table. Example: f9e523e2-3e6c-3152-b128-7d3aeb36e7e5

quantity   number     

Quantidade. O campo value deve ser pelo menos 0.0001. Example: 1

observation   string  optional    

Observação. Example: Example Items * observation

Delete product quantity list

requires authentication product-quantity-list delete

Delete a product quantity list

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/product-quantity-lists/suscipit" \
    --header "Authorization: Bearer 66agZdEafb8veP1h3c5VkD4" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-quantity-lists/suscipit"
);

const headers = {
    "Authorization": "Bearer 66agZdEafb8veP1h3c5VkD4",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/product-quantity-lists/{productQuantityList}

Headers

Authorization        

Example: Bearer 66agZdEafb8veP1h3c5VkD4

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productQuantityList   string     

Product Quantity List UUID Example: suscipit

Add items to list

requires authentication product-quantity-list update

Add one or more product items to the list

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/product-quantity-lists/autem/items" \
    --header "Authorization: Bearer vfb56VaEkPh83e6adgZcD41" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"items\": [
        {
            \"product_id\": \"fa313f3e-7736-3edf-b09f-3e5ea49ce3d4\",
            \"quantity\": 1,
            \"observation\": \"Example Items * observation\"
        },
        null
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-quantity-lists/autem/items"
);

const headers = {
    "Authorization": "Bearer vfb56VaEkPh83e6adgZcD41",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "items": [
        {
            "product_id": "fa313f3e-7736-3edf-b09f-3e5ea49ce3d4",
            "quantity": 1,
            "observation": "Example Items * observation"
        },
        null
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "data": "array"
}
 

Request      

POST api/product-quantity-lists/{productQuantityList}/items

Headers

Authorization        

Example: Bearer vfb56VaEkPh83e6adgZcD41

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productQuantityList   string     

Product Quantity List UUID Example: autem

Body Parameters

items   object[]     

Itens. O campo value deve ter pelo menos 1 itens.

product_id   string     

Produto. The uuid of an existing record in the products table. Example: fa313f3e-7736-3edf-b09f-3e5ea49ce3d4

quantity   number     

Quantidade. O campo value deve ser pelo menos 0.0001. Example: 1

observation   string  optional    

Observação. Example: Example Items * observation

Update item

requires authentication product-quantity-list update

Update a product item in the list

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/product-quantity-lists/items/dolorem" \
    --header "Authorization: Bearer f18d6vE5bVDg4aZk3Pca6eh" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"quantity\": 1,
    \"observation\": \"Example Observation\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-quantity-lists/items/dolorem"
);

const headers = {
    "Authorization": "Bearer f18d6vE5bVDg4aZk3Pca6eh",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "quantity": 1,
    "observation": "Example Observation"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": "object"
}
 

Request      

PUT api/product-quantity-lists/items/{id}

Headers

Authorization        

Example: Bearer f18d6vE5bVDg4aZk3Pca6eh

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the item. Example: dolorem

item   string     

Product Quantity List Item UUID Example: praesentium

Body Parameters

quantity   number  optional    

Quantidade. O campo value deve ser pelo menos 0.0001. Example: 1

observation   string  optional    

Observação. Example: Example Observation

Remove items

requires authentication product-quantity-list update

Remove one or more product items from the list

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/product-quantity-lists/fugit/items" \
    --header "Authorization: Bearer vcd6Dha4f8ak6b51EVePgZ3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"items\": [
        \"cae47a4e-0acc-3fec-862e-a403efc505fc\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-quantity-lists/fugit/items"
);

const headers = {
    "Authorization": "Bearer vcd6Dha4f8ak6b51EVePgZ3",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "items": [
        "cae47a4e-0acc-3fec-862e-a403efc505fc"
    ]
};

fetch(url, {
    method: "DELETE",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "deleted": "integer"
}
 

Request      

DELETE api/product-quantity-lists/{productQuantityList}/items

Headers

Authorization        

Example: Bearer vcd6Dha4f8ak6b51EVePgZ3

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productQuantityList   string     

Product Quantity List UUID Example: fugit

Body Parameters

items   string[]     

Item. The uuid of an existing record in the product_quantity_list_items table.

Sync items

requires authentication product-quantity-list update

Replace all items in the list

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/product-quantity-lists/omnis/sync-items" \
    --header "Authorization: Bearer vah1kfP8bZ5c3VE6g4aD6de" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"items\": [
        {
            \"id\": \"0115e044-f6c5-3516-a5ca-c118f9d23c5d\",
            \"product_id\": \"3de6db34-7111-3551-8870-64f9364b7183\",
            \"quantity\": 1,
            \"observation\": \"Example Items * observation\"
        },
        null
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-quantity-lists/omnis/sync-items"
);

const headers = {
    "Authorization": "Bearer vah1kfP8bZ5c3VE6g4aD6de",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "items": [
        {
            "id": "0115e044-f6c5-3516-a5ca-c118f9d23c5d",
            "product_id": "3de6db34-7111-3551-8870-64f9364b7183",
            "quantity": 1,
            "observation": "Example Items * observation"
        },
        null
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": "object"
}
 

Request      

PUT api/product-quantity-lists/{productQuantityList}/sync-items

Headers

Authorization        

Example: Bearer vah1kfP8bZ5c3VE6g4aD6de

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productQuantityList   string     

Product Quantity List UUID Example: omnis

Body Parameters

items   object[]     

Itens.

id   string  optional    

ID do Item. The uuid of an existing record in the product_quantity_list_items table. Example: 0115e044-f6c5-3516-a5ca-c118f9d23c5d

product_id   string     

Produto. The uuid of an existing record in the products table. Example: 3de6db34-7111-3551-8870-64f9364b7183

quantity   number     

Quantidade. O campo value deve ser pelo menos 0.0001. Example: 1

observation   string  optional    

Observação. Example: Example Items * observation

Product Request Fulfillment

Endpoints for fulfilling product request items

Fulfill item

requires authentication product-request fulfill

Fulfill a product request item via transfer or allocation

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/product-requests/items/dignissimos/fulfill" \
    --header "Authorization: Bearer 3DbePhg5Zd1cfEkvVa866a4" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"fulfillment_type\": \"Example Fulfillment type\",
    \"stock_id\": \"9ad982b4-0508-3af3-9834-90d4816d8ceb\",
    \"quantity\": 1,
    \"source_stock_id\": \"f026ff74-c47a-353a-92ee-b1cd703197ff\",
    \"reason\": \"Example Reason\",
    \"origins\": [
        {
            \"supplier_product_id\": \"e1c26e1e-908b-372d-bb68-15f8e2710f83\",
            \"quantity\": 1
        },
        null
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-requests/items/dignissimos/fulfill"
);

const headers = {
    "Authorization": "Bearer 3DbePhg5Zd1cfEkvVa866a4",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "fulfillment_type": "Example Fulfillment type",
    "stock_id": "9ad982b4-0508-3af3-9834-90d4816d8ceb",
    "quantity": 1,
    "source_stock_id": "f026ff74-c47a-353a-92ee-b1cd703197ff",
    "reason": "Example Reason",
    "origins": [
        {
            "supplier_product_id": "e1c26e1e-908b-372d-bb68-15f8e2710f83",
            "quantity": 1
        },
        null
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "data": "object"
}
 

Request      

POST api/product-requests/items/{item}/fulfill

Headers

Authorization        

Example: Bearer 3DbePhg5Zd1cfEkvVa866a4

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

item   string     

Product Request Item UUID Example: dignissimos

Body Parameters

fulfillment_type   string     

Tipo de atendimento. Example: Example Fulfillment type

Must be one of:
  • transfer
  • entry
stock_id   string  optional    

Estoque de destino. This field is required when fulfillment_type is transfer. The uuid of an existing record in the stocks table. Example: 9ad982b4-0508-3af3-9834-90d4816d8ceb

quantity   number     

Quantidade. O campo value deve ser pelo menos 0.0001. Example: 1

source_stock_id   string  optional    

Estoque de origem. This field is required when fulfillment_type is transfer. The value and stock_id must be different. The uuid of an existing record in the stocks table. Example: f026ff74-c47a-353a-92ee-b1cd703197ff

reason   string  optional    

Motivo. O campo value não pode ser superior a 500 caracteres. Example: Example Reason

origins   object[]  optional    

Origens (NFs).

supplier_product_id   string  optional    

NF de origem. This field is required when origins is present. The uuid of an existing record in the supplier_products table. Example: e1c26e1e-908b-372d-bb68-15f8e2710f83

quantity   number  optional    

Quantidade da origem. This field is required when origins is present. O campo value deve ser pelo menos 0.0001. Example: 1

List item fulfillments

requires authentication product-request show

List all fulfillments for a product request item

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/product-requests/items/in/fulfillments" \
    --header "Authorization: Bearer ZPDEfv584abgek6cd631aVh" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"per_page\": 1,
    \"page\": 1
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-requests/items/in/fulfillments"
);

const headers = {
    "Authorization": "Bearer ZPDEfv584abgek6cd631aVh",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "per_page": 1,
    "page": 1
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "3699d88a-5ed0-342b-ae2d-0682bb8c0f32",
            "quantity": 21.916,
            "fulfilled_at": "2026-10-19T00:37:52.000000Z",
            "created_at": null
        },
        {
            "id": "d903ec1e-2b21-3f5b-bf75-569ad8a97ecb",
            "quantity": 29.5341,
            "fulfilled_at": "2026-10-12T18:13:29.000000Z",
            "created_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/product-requests/items/{item}/fulfillments

Headers

Authorization        

Example: Bearer ZPDEfv584abgek6cd631aVh

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

item   string     

Product Request Item UUID Example: in

Body Parameters

per_page   integer  optional    

Per page. O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 1

page   integer  optional    

Page. O campo value deve ser pelo menos 1. Example: 1

Get item with fulfillment details

requires authentication product-request show

Get a single product request item with its fulfillment details

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/product-requests/items/dolor" \
    --header "Authorization: Bearer 6fhVd3g6aDkEZ14c5eaP8vb" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-requests/items/dolor"
);

const headers = {
    "Authorization": "Bearer 6fhVd3g6aDkEZ14c5eaP8vb",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "618ef9fe-af2a-3433-859e-b8077862b6ad",
        "product": {
            "id": "a32930db-1ace-4a8f-911b-8cee13faf4a4",
            "name": "Sergio Gael Toledo Sobrinho",
            "code": "PRD-233738",
            "unit": {
                "id": "a32930db-198f-4f29-9939-36415ba438d5",
                "name": "Dener Emiliano Domingues",
                "abbreviation": "Flávio Verdugo Neto"
            }
        },
        "quantity": 640.3615,
        "quantity_fulfilled": 0,
        "quantity_pending": 640.3615,
        "is_fulfilled": false,
        "is_partially_fulfilled": false,
        "observation": "Ducimus ut non minima.",
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/product-requests/items/{id}

Headers

Authorization        

Example: Bearer 6fhVd3g6aDkEZ14c5eaP8vb

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the item. Example: dolor

item   string     

Product Request Item UUID Example: temporibus

List pending items

requires authentication product-request show

List all pending items from a product request

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/product-requests/et/pending-items" \
    --header "Authorization: Bearer 6eavcbZ8ag634h1PkEDdf5V" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"per_page\": 1,
    \"page\": 1
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-requests/et/pending-items"
);

const headers = {
    "Authorization": "Bearer 6eavcbZ8ag634h1PkEDdf5V",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "per_page": 1,
    "page": 1
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "b2929189-9687-33ec-b803-dcc61f6a73f4",
            "product": {
                "id": "a32930db-314e-4b1e-8fd0-5a1a07aaabbb",
                "name": "Dr. Manuela Medina",
                "code": "PRD-842103",
                "unit": {
                    "id": "a32930db-3014-47b1-968e-23157df7a1d4",
                    "name": "Gisela Maia Filho",
                    "abbreviation": "Fátima Brito Sobrinho"
                }
            },
            "quantity": 896.7175,
            "quantity_fulfilled": 0,
            "quantity_pending": 896.7175,
            "is_fulfilled": false,
            "is_partially_fulfilled": false,
            "observation": null,
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "ba74d2b9-3d32-3e91-a13c-c89c88728607",
            "product": {
                "id": "a32930db-4a45-4f09-9251-5f4a61864833",
                "name": "Joaquin Perez Galindo",
                "code": "PRD-637231",
                "unit": {
                    "id": "a32930db-4913-4a77-9048-28a91b76e68e",
                    "name": "Dr. Enzo Adriano Oliveira",
                    "abbreviation": "Luna Leon Azevedo Filho"
                }
            },
            "quantity": 177.2428,
            "quantity_fulfilled": 0,
            "quantity_pending": 177.2428,
            "is_fulfilled": false,
            "is_partially_fulfilled": false,
            "observation": null,
            "created_at": null,
            "updated_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/product-requests/{productRequest}/pending-items

Headers

Authorization        

Example: Bearer 6eavcbZ8ag634h1PkEDdf5V

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productRequest   string     

Product Request UUID Example: et

Body Parameters

per_page   integer  optional    

Per page. O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 1

page   integer  optional    

Page. O campo value deve ser pelo menos 1. Example: 1

List pending items by product

requires authentication product-request show

List all pending product request items for a specific product

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/product-requests/pending-by-product/non" \
    --header "Authorization: Bearer 683gh1adkEcePVb6fZD4av5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-requests/pending-by-product/non"
);

const headers = {
    "Authorization": "Bearer 683gh1adkEcePVb6fZD4av5",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "ebf3ede5-8a4d-3981-9732-31548c16a65e",
            "product": {
                "id": "a32930db-6162-4453-8955-866e5e8ec934",
                "name": "Noelí Toledo Maldonado",
                "code": "PRD-833278",
                "unit": {
                    "id": "a32930db-601a-48d1-a416-925a22bff670",
                    "name": "Victor Beltrão",
                    "abbreviation": "Dr. Cláudio Salazar Quintana Sobrinho"
                }
            },
            "quantity": 92.3586,
            "quantity_fulfilled": 0,
            "quantity_pending": 92.3586,
            "is_fulfilled": false,
            "is_partially_fulfilled": false,
            "observation": "Quo consequuntur harum et vel voluptatibus ea.",
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "4355534b-1dae-3a5d-8a54-8aa2cee2fac1",
            "product": {
                "id": "a32930db-7416-4c63-8019-0c3be959d14c",
                "name": "Juliano D'ávila Neto",
                "code": "PRD-582389",
                "unit": {
                    "id": "a32930db-72ce-4dd9-b63b-bfe2cfe721b0",
                    "name": "Srta. Letícia Rico Godói Filho",
                    "abbreviation": "Rafael Ronaldo Duarte"
                }
            },
            "quantity": 674.3775,
            "quantity_fulfilled": 0,
            "quantity_pending": 674.3775,
            "is_fulfilled": false,
            "is_partially_fulfilled": false,
            "observation": "Quas autem ut quidem explicabo id asperiores numquam.",
            "created_at": null,
            "updated_at": null
        }
    ]
}
 

Request      

GET api/product-requests/pending-by-product/{product}

Headers

Authorization        

Example: Bearer 683gh1adkEcePVb6fZD4av5

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

product   string     

Product UUID Example: non

Product Requests

Endpoints for managing product requests for works

List product requests

requires authentication product-request index

List all product requests

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/product-requests" \
    --header "Authorization: Bearer a48EPfv1cd5VhgeDZ66bka3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"sort_by\": \"Example Sort by\",
    \"sort_desc\": true,
    \"page\": 1,
    \"per_page\": 1,
    \"q\": \"Example Q\",
    \"work_id\": \"bbd44470-af9e-3c91-ac1e-20c39b133626\",
    \"work_location_id\": \"7379a19e-aa27-30a1-9cc4-5e6f508953f8\",
    \"user_id\": \"4a28b2a6-ae1a-3b4e-affb-efa5c10710d7\",
    \"status_id\": \"b1b1f6a6-7332-3a43-a742-ce0f5729b455\",
    \"priority\": \"Example Priority\",
    \"needed_at_from\": \"Example Needed at from\",
    \"needed_at_to\": \"Example Needed at to\",
    \"responsible_id\": \"8891214e-ddd6-3833-872f-27af16612703\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-requests"
);

const headers = {
    "Authorization": "Bearer a48EPfv1cd5VhgeDZ66bka3",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "sort_by": "Example Sort by",
    "sort_desc": true,
    "page": 1,
    "per_page": 1,
    "q": "Example Q",
    "work_id": "bbd44470-af9e-3c91-ac1e-20c39b133626",
    "work_location_id": "7379a19e-aa27-30a1-9cc4-5e6f508953f8",
    "user_id": "4a28b2a6-ae1a-3b4e-affb-efa5c10710d7",
    "status_id": "b1b1f6a6-7332-3a43-a742-ce0f5729b455",
    "priority": "Example Priority",
    "needed_at_from": "Example Needed at from",
    "needed_at_to": "Example Needed at to",
    "responsible_id": "8891214e-ddd6-3833-872f-27af16612703"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "867bc2a8-e64c-3956-b400-ee9586925153",
            "code": null,
            "name": "Ratione omnis a enim blanditiis.",
            "description": null,
            "work": {
                "id": "a32930d8-6a30-4ffb-91d6-9ad57f8164a2",
                "name": "Srta. Violeta Vila Espinoza"
            },
            "user": {
                "id": "a32930d8-6d2a-4438-87b8-a36fd3990b46",
                "name": "Prof. Brenden Lynch IV"
            },
            "status": {
                "id": "a32930d8-6f2e-45b3-a8cc-5cd89df5cae6",
                "slug": null,
                "name": null,
                "description": "Cléber Mascarenhas Aragão",
                "abbreviation": "ullam",
                "color": "#736ae3",
                "text_color": "#a50536"
            },
            "priority": "high",
            "priority_label": "Alta",
            "needed_at": "2026-11-29",
            "approved_at": null,
            "rejection_reason": null,
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "528a6fc4-fc7b-3952-9e35-3089803caefa",
            "code": null,
            "name": "Architecto adipisci mollitia.",
            "description": null,
            "work": {
                "id": "a32930d8-7371-4767-a66a-0a985ea41e3f",
                "name": "Raphael Pereira Tamoio"
            },
            "user": {
                "id": "a32930d8-7665-4456-a80b-24f5c77d23f4",
                "name": "Cayla Armstrong V"
            },
            "status": {
                "id": "a32930d8-7864-48cd-a646-dc9d2dd46c0d",
                "slug": null,
                "name": null,
                "description": "Dr. Afonso Cervantes Jr.",
                "abbreviation": "nesciunt",
                "color": "#279375",
                "text_color": "#8959cf"
            },
            "priority": "high",
            "priority_label": "Alta",
            "needed_at": null,
            "approved_at": null,
            "rejection_reason": null,
            "created_at": null,
            "updated_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/product-requests

Headers

Authorization        

Example: Bearer a48EPfv1cd5VhgeDZ66bka3

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

sort_by   string  optional    

Sort by. Example: Example Sort by

sort_desc   boolean  optional    

Sort desc. Example: true

page   integer  optional    

Page. O campo value deve ser pelo menos 1. Example: 1

per_page   integer  optional    

Per page. O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 1

q   string  optional    

Busca. Example: Example Q

work_id   string  optional    

Obra. The uuid of an existing record in the works table. Example: bbd44470-af9e-3c91-ac1e-20c39b133626

work_location_id   string  optional    

Local da obra. The uuid of an existing record in the work_locations table. Example: 7379a19e-aa27-30a1-9cc4-5e6f508953f8

user_id   string  optional    

Usuário. The uuid of an existing record in the users table. Example: 4a28b2a6-ae1a-3b4e-affb-efa5c10710d7

status_id   string  optional    

Status. The uuid of an existing record in the statuses table. Example: b1b1f6a6-7332-3a43-a742-ce0f5729b455

priority   string  optional    

Prioridade. Example: Example Priority

Must be one of:
  • low
  • medium
  • high
  • urgent
needed_at_from   string  optional    

Data de necessidade inicial. O campo value deve ser uma data válida. Example: Example Needed at from

needed_at_to   string  optional    

Data de necessidade final. O campo value deve ser uma data válida. Example: Example Needed at to

responsible_id   string  optional    

Responsável. The uuid of an existing record in the users table. Example: 8891214e-ddd6-3833-872f-27af16612703

Show product request

requires authentication product-request show

Show a product request

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/product-requests/illum" \
    --header "Authorization: Bearer v6fk1dP5D8haa43ZVecb6Eg" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-requests/illum"
);

const headers = {
    "Authorization": "Bearer v6fk1dP5D8haa43ZVecb6Eg",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "7741b539-2ffb-31eb-b229-3df1c636b28c",
        "code": null,
        "name": "Non atque eos neque.",
        "description": "Ea beatae esse id harum molestias aliquam. Explicabo omnis quis et minima ipsa iste consequatur. Earum delectus qui est culpa soluta et.",
        "work": {
            "id": "a32930d8-8146-4b6a-91d3-d531c81ec565",
            "name": "Guilherme Bruno Marinho Filho"
        },
        "user": {
            "id": "a32930d8-8440-47d6-80bb-0d31efb08c9f",
            "name": "Miss Elda Cruickshank DVM"
        },
        "status": {
            "id": "a32930d8-8639-43ac-85d3-803c242c3c5d",
            "slug": null,
            "name": null,
            "description": "Dr. Mateus Rivera Leal",
            "abbreviation": "unde",
            "color": "#cc523f",
            "text_color": "#35cd9b"
        },
        "priority": "medium",
        "priority_label": "Média",
        "needed_at": "2026-11-10",
        "approved_at": null,
        "rejection_reason": null,
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/product-requests/{productRequest}

Headers

Authorization        

Example: Bearer v6fk1dP5D8haa43ZVecb6Eg

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productRequest   string     

Product Request UUID Example: illum

List items

requires authentication product-request show

List all items from a product request with pagination

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/product-requests/optio/items" \
    --header "Authorization: Bearer kf45a6EePbgVc861av3ZdDh" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"q\": \"Example Q\",
    \"per_page\": 1
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-requests/optio/items"
);

const headers = {
    "Authorization": "Bearer kf45a6EePbgVc861av3ZdDh",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "q": "Example Q",
    "per_page": 1
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "b065f6a2-ce14-3236-bd16-2b38bb237a8a",
            "product": {
                "id": "a32930d8-a26e-404e-b561-ab6f43b65a1b",
                "name": "Dr. Diego Máximo Chaves Jr.",
                "code": "PRD-623034",
                "unit": {
                    "id": "a32930d8-a113-4374-a17a-5b95d34c7d2f",
                    "name": "Sérgio Fidalgo",
                    "abbreviation": "Poliana Fontes Vega Filho"
                }
            },
            "quantity": 966.6102,
            "quantity_fulfilled": 0,
            "quantity_pending": 966.6102,
            "is_fulfilled": false,
            "is_partially_fulfilled": false,
            "observation": null,
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "5a879070-a963-3143-9ee7-70f3bcb8c2ba",
            "product": {
                "id": "a32930d8-bc12-47a9-aa4b-dadb366c5cfb",
                "name": "Demian da Rosa Chaves",
                "code": "PRD-649129",
                "unit": {
                    "id": "a32930d8-bab7-45d6-9db8-784521a99500",
                    "name": "Sra. Laiane Elaine Grego",
                    "abbreviation": "Sr. Simão Wagner Delgado"
                }
            },
            "quantity": 574.8602,
            "quantity_fulfilled": 0,
            "quantity_pending": 574.8602,
            "is_fulfilled": false,
            "is_partially_fulfilled": false,
            "observation": "Facere consequatur ad perferendis aut ab iure expedita.",
            "created_at": null,
            "updated_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/product-requests/{productRequest}/items

Headers

Authorization        

Example: Bearer kf45a6EePbgVc861av3ZdDh

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productRequest   string     

Product Request UUID Example: optio

Body Parameters

q   string  optional    

Busca. Example: Example Q

per_page   integer  optional    

Itens por página. O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 1

Create product request

requires authentication product-request store

Create a new product request

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/product-requests" \
    --header "Authorization: Bearer 3acZ6P8gkdEbD1vf46a5Veh" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"description\": \"Example Description\",
    \"work_id\": \"461d178a-134f-301d-9756-d10658eb522b\",
    \"work_location_id\": \"94042501-29b8-31cf-97ce-412b0cd8dde9\",
    \"status_id\": \"193bc180-99c3-37f3-ad0d-071c8b59e29e\",
    \"priority\": \"Example Priority\",
    \"needed_at\": \"Example Needed at\",
    \"items\": [
        {
            \"product_id\": \"1c285738-4421-3ae7-8146-efa2f931a851\",
            \"quantity\": 1,
            \"observation\": \"Example Items * observation\"
        },
        null
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-requests"
);

const headers = {
    "Authorization": "Bearer 3acZ6P8gkdEbD1vf46a5Veh",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "description": "Example Description",
    "work_id": "461d178a-134f-301d-9756-d10658eb522b",
    "work_location_id": "94042501-29b8-31cf-97ce-412b0cd8dde9",
    "status_id": "193bc180-99c3-37f3-ad0d-071c8b59e29e",
    "priority": "Example Priority",
    "needed_at": "Example Needed at",
    "items": [
        {
            "product_id": "1c285738-4421-3ae7-8146-efa2f931a851",
            "quantity": 1,
            "observation": "Example Items * observation"
        },
        null
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "data": "object"
}
 

Request      

POST api/product-requests

Headers

Authorization        

Example: Bearer 3acZ6P8gkdEbD1vf46a5Veh

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string  optional    

Nome. O campo value não pode ser superior a 255 caracteres. Example: Example Name

description   string  optional    

Descrição. Example: Example Description

work_id   string     

Obra. The uuid of an existing record in the works table. Example: 461d178a-134f-301d-9756-d10658eb522b

work_location_id   string  optional    

Local da obra. The uuid of an existing record in the work_locations table. Example: 94042501-29b8-31cf-97ce-412b0cd8dde9

status_id   string  optional    

Status. The uuid of an existing record in the statuses table. Example: 193bc180-99c3-37f3-ad0d-071c8b59e29e

priority   string  optional    

Prioridade. Example: Example Priority

Must be one of:
  • low
  • medium
  • high
  • urgent
needed_at   string  optional    

Data de necessidade. O campo value deve ser uma data válida. Example: Example Needed at

items   object[]  optional    

Itens.

product_id   string     

Produto. The uuid of an existing record in the products table. Example: 1c285738-4421-3ae7-8146-efa2f931a851

quantity   number     

Quantidade. O campo value deve ser pelo menos 0.0001. Example: 1

observation   string  optional    

Observação. Example: Example Items * observation

Update product request

requires authentication product-request update

Update a product request. Can include items to replace all items in the request.

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/product-requests/autem" \
    --header "Authorization: Bearer kEbg1Z3DdfceVh68a64P5av" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"description\": \"Example Description\",
    \"work_id\": \"74f7423a-7023-377a-b699-9d5191ba1adf\",
    \"work_location_id\": \"92e15853-5099-37c3-a4f5-023ceb39c14c\",
    \"status_id\": \"45581f69-7871-3194-b30c-ef047373041e\",
    \"priority\": \"Example Priority\",
    \"needed_at\": \"Example Needed at\",
    \"items\": [
        {
            \"id\": \"4c10a422-126c-35fb-8df4-c2e00a27ac7d\",
            \"product_id\": \"4380c8af-64da-3c66-a394-7e712dc48a20\",
            \"quantity\": 1,
            \"observation\": \"Example Items * observation\"
        },
        null
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-requests/autem"
);

const headers = {
    "Authorization": "Bearer kEbg1Z3DdfceVh68a64P5av",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "description": "Example Description",
    "work_id": "74f7423a-7023-377a-b699-9d5191ba1adf",
    "work_location_id": "92e15853-5099-37c3-a4f5-023ceb39c14c",
    "status_id": "45581f69-7871-3194-b30c-ef047373041e",
    "priority": "Example Priority",
    "needed_at": "Example Needed at",
    "items": [
        {
            "id": "4c10a422-126c-35fb-8df4-c2e00a27ac7d",
            "product_id": "4380c8af-64da-3c66-a394-7e712dc48a20",
            "quantity": 1,
            "observation": "Example Items * observation"
        },
        null
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": "object"
}
 

Request      

PUT api/product-requests/{productRequest}

Headers

Authorization        

Example: Bearer kEbg1Z3DdfceVh68a64P5av

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productRequest   string     

Product Request UUID Example: autem

Body Parameters

name   string  optional    

Nome. O campo value não pode ser superior a 255 caracteres. Example: Example Name

description   string  optional    

Descrição. Example: Example Description

work_id   string  optional    

Obra. The uuid of an existing record in the works table. Example: 74f7423a-7023-377a-b699-9d5191ba1adf

work_location_id   string  optional    

Local da obra. The uuid of an existing record in the work_locations table. Example: 92e15853-5099-37c3-a4f5-023ceb39c14c

status_id   string  optional    

Status. The uuid of an existing record in the statuses table. Example: 45581f69-7871-3194-b30c-ef047373041e

priority   string  optional    

Prioridade. Example: Example Priority

Must be one of:
  • low
  • medium
  • high
  • urgent
needed_at   string  optional    

Data de necessidade. O campo value deve ser uma data válida. Example: Example Needed at

items   object[]  optional    

Itens.

id   string  optional    

ID do Item. The uuid of an existing record in the product_request_items table. Example: 4c10a422-126c-35fb-8df4-c2e00a27ac7d

product_id   string     

Produto. The uuid of an existing record in the products table. Example: 4380c8af-64da-3c66-a394-7e712dc48a20

quantity   number     

Quantidade. O campo value deve ser pelo menos 0.0001. Example: 1

observation   string  optional    

Observação. Example: Example Items * observation

Delete product request

requires authentication product-request delete

Delete a product request

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/product-requests/accusamus" \
    --header "Authorization: Bearer Ega1ef3vd6baDc64Z5Ph8kV" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-requests/accusamus"
);

const headers = {
    "Authorization": "Bearer Ega1ef3vd6baDc64Z5Ph8kV",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/product-requests/{productRequest}

Headers

Authorization        

Example: Bearer Ega1ef3vd6baDc64Z5Ph8kV

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productRequest   string     

Product Request UUID Example: accusamus

Approve product request

requires authentication product-request approve

Approve a product request

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/product-requests/et/approve" \
    --header "Authorization: Bearer 6d8fhEVk54eg6Dva1acZb3P" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-requests/et/approve"
);

const headers = {
    "Authorization": "Bearer 6d8fhEVk54eg6Dva1acZb3P",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": "object"
}
 

Request      

POST api/product-requests/{productRequest}/approve

Headers

Authorization        

Example: Bearer 6d8fhEVk54eg6Dva1acZb3P

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productRequest   string     

Product Request UUID Example: et

Reject product request

requires authentication product-request reject

Reject a product request with a reason

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/product-requests/autem/reject" \
    --header "Authorization: Bearer 6vVfZE1aPa5g4386heDkcbd" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"reason\": \"Example Reason\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-requests/autem/reject"
);

const headers = {
    "Authorization": "Bearer 6vVfZE1aPa5g4386heDkcbd",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "reason": "Example Reason"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": "object"
}
 

Request      

POST api/product-requests/{productRequest}/reject

Headers

Authorization        

Example: Bearer 6vVfZE1aPa5g4386heDkcbd

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productRequest   string     

Product Request UUID Example: autem

Body Parameters

reason   string     

Motivo da rejeição. O campo value não pode ser superior a 1000 caracteres. Example: Example Reason

Add items to request

requires authentication product-request update

Add one or more product items to the request

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/product-requests/velit/items" \
    --header "Authorization: Bearer 64V3fhdDe1ka6agcPZbv8E5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"items\": [
        {
            \"product_id\": \"4a36a320-74e5-3680-a960-4095c5a1b1c2\",
            \"quantity\": 1,
            \"observation\": \"Example Items * observation\"
        },
        null
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-requests/velit/items"
);

const headers = {
    "Authorization": "Bearer 64V3fhdDe1ka6agcPZbv8E5",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "items": [
        {
            "product_id": "4a36a320-74e5-3680-a960-4095c5a1b1c2",
            "quantity": 1,
            "observation": "Example Items * observation"
        },
        null
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "data": "array"
}
 

Request      

POST api/product-requests/{productRequest}/items

Headers

Authorization        

Example: Bearer 64V3fhdDe1ka6agcPZbv8E5

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productRequest   string     

Product Request UUID Example: velit

Body Parameters

items   object[]     

Itens. O campo value deve ter pelo menos 1 itens.

product_id   string     

Produto. The uuid of an existing record in the products table. Example: 4a36a320-74e5-3680-a960-4095c5a1b1c2

quantity   number     

Quantidade. O campo value deve ser pelo menos 0.0001. Example: 1

observation   string  optional    

Observação. Example: Example Items * observation

Update item

requires authentication product-request update

Update a product item in the request

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/product-requests/items/aut" \
    --header "Authorization: Bearer DhZb661aEV3gac8k4fPdv5e" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"quantity\": 1,
    \"observation\": \"Example Observation\",
    \"status_id\": \"0f85de03-ac5e-3c1c-819c-5d08a2ceb725\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-requests/items/aut"
);

const headers = {
    "Authorization": "Bearer DhZb661aEV3gac8k4fPdv5e",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "quantity": 1,
    "observation": "Example Observation",
    "status_id": "0f85de03-ac5e-3c1c-819c-5d08a2ceb725"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": "object"
}
 

Request      

PUT api/product-requests/items/{id}

Headers

Authorization        

Example: Bearer DhZb661aEV3gac8k4fPdv5e

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the item. Example: aut

item   string     

Product Request Item UUID Example: quis

Body Parameters

quantity   number  optional    

Quantidade. O campo value deve ser pelo menos 0.0001. Example: 1

observation   string  optional    

Observação. Example: Example Observation

status_id   string  optional    

Status. The uuid of an existing record in the statuses table. Example: 0f85de03-ac5e-3c1c-819c-5d08a2ceb725

Remove items

requires authentication product-request update

Remove one or more product items from the request

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/product-requests/minus/items" \
    --header "Authorization: Bearer 8c6Ea1gPVa3df6e45hbDkvZ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"items\": [
        \"26145839-adaa-3ba9-a6b5-be50e03bce54\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-requests/minus/items"
);

const headers = {
    "Authorization": "Bearer 8c6Ea1gPVa3df6e45hbDkvZ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "items": [
        "26145839-adaa-3ba9-a6b5-be50e03bce54"
    ]
};

fetch(url, {
    method: "DELETE",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "deleted": "integer"
}
 

Request      

DELETE api/product-requests/{productRequest}/items

Headers

Authorization        

Example: Bearer 8c6Ea1gPVa3df6e45hbDkvZ

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productRequest   string     

Product Request UUID Example: minus

Body Parameters

items   string[]     

Item. The uuid of an existing record in the product_request_items table.

Sync items

requires authentication product-request update

Replace all items in the request

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/product-requests/pariatur/sync-items" \
    --header "Authorization: Bearer 36D6cVdE5aaheg8PfkZv4b1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"items\": [
        {
            \"id\": \"78ca62b0-a7b4-368c-b2df-bf43845d4e75\",
            \"product_id\": \"8cdab42d-2969-31aa-9de2-292576690a17\",
            \"quantity\": 1,
            \"observation\": \"Example Items * observation\"
        },
        null
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-requests/pariatur/sync-items"
);

const headers = {
    "Authorization": "Bearer 36D6cVdE5aaheg8PfkZv4b1",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "items": [
        {
            "id": "78ca62b0-a7b4-368c-b2df-bf43845d4e75",
            "product_id": "8cdab42d-2969-31aa-9de2-292576690a17",
            "quantity": 1,
            "observation": "Example Items * observation"
        },
        null
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": "object"
}
 

Request      

PUT api/product-requests/{productRequest}/sync-items

Headers

Authorization        

Example: Bearer 36D6cVdE5aaheg8PfkZv4b1

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productRequest   string     

Product Request UUID Example: pariatur

Body Parameters

items   object[]     

Itens.

id   string  optional    

ID do Item. The uuid of an existing record in the product_request_items table. Example: 78ca62b0-a7b4-368c-b2df-bf43845d4e75

product_id   string     

Produto. The uuid of an existing record in the products table. Example: 8cdab42d-2969-31aa-9de2-292576690a17

quantity   number     

Quantidade. O campo value deve ser pelo menos 0.0001. Example: 1

observation   string  optional    

Observação. Example: Example Items * observation

Products

Endpoints for products

List products

requires authentication product index

List all products

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/products?sort_by=created_at&sort_desc=1&page=1&per_page=15&q=Brick&code=PROD-00003&is_epi=1&has_epi_type=" \
    --header "Authorization: Bearer ecZfh65aabd1gP43kDv8EV6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/products"
);

const params = {
    "sort_by": "created_at",
    "sort_desc": "1",
    "page": "1",
    "per_page": "15",
    "q": "Brick",
    "code": "PROD-00003",
    "is_epi": "1",
    "has_epi_type": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer ecZfh65aabd1gP43kDv8EV6",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "1b4ea1f4-da9a-3974-9341-3047f8c573ff",
            "name": "Srta. Ayla Verdugo",
            "code": "PRD-291900",
            "stock": 618,
            "product_family": {
                "id": "a32930d6-43a3-4908-b2cc-61b3b4ca54ab",
                "name": "Sra. Débora Luara Barreto Sobrinho"
            },
            "product_brand": {
                "id": "a32930d6-4558-4d45-86dd-d4873f092a2c",
                "name": "Dr. Allison Tamoio Mendonça Jr."
            },
            "unit": {
                "id": "a32930d6-46f8-47f5-b717-badb0c30075e",
                "name": "Sérgio Nelson Fernandes Sobrinho",
                "abbreviation": "Dr. Hortência Vieira"
            },
            "image": {
                "id": null,
                "url": null
            },
            "epi_type": null,
            "description": "Ab rerum odit labore voluptas placeat magni.",
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "8d9d1085-f777-3c54-ad56-07266b591973",
            "name": "Gabi Valdez Lutero",
            "code": "PRD-323561",
            "stock": 12,
            "product_family": {
                "id": "a32930d6-4986-4817-b04c-858e32f4a85a",
                "name": "Luis Barreto Jr."
            },
            "product_brand": {
                "id": "a32930d6-4b1c-46f0-830c-c626e641b968",
                "name": "Sebastião Willian Benez"
            },
            "unit": {
                "id": "a32930d6-4c9c-4d67-83d1-320a643ad054",
                "name": "Jaqueline Medina Batista",
                "abbreviation": "James Ferreira Neto"
            },
            "image": {
                "id": null,
                "url": null
            },
            "epi_type": null,
            "description": "Molestiae ex corrupti omnis ratione nulla quo.",
            "created_at": null,
            "updated_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/products

Headers

Authorization        

Example: Bearer ecZfh65aabd1gP43kDv8EV6

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

sort_by   string  optional    

Field to sort by. Example: created_at

sort_desc   boolean  optional    

Sort order (true for descending, false for ascending). Example: true

page   integer  optional    

Page number for pagination. O campo value deve ser pelo menos 1. Example: 1

per_page   integer  optional    

Number of items per page (max: 100). O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 15

q   string  optional    

Search query. Example: Brick

code   string  optional    

Filter by product code. Example: PROD-00003

is_epi   boolean  optional    

Filter by products whose family is flagged as EPI. Example: true

has_epi_type   boolean  optional    

Filter by products that already are an EPI type. Pass 0 to list only products still available to become one. Example: false

Show product

requires authentication product show

Show a product

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/products/1" \
    --header "Authorization: Bearer Zkfb4P866agD13V5dcEhvae" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/products/1"
);

const headers = {
    "Authorization": "Bearer Zkfb4P866agD13V5dcEhvae",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "1693a0b5-4a51-3d0e-a3af-ae9788028ce7",
        "name": "Laiane Danielle Amaral",
        "code": "PRD-733570",
        "stock": 1451,
        "product_family": {
            "id": "a32930d6-55d5-4047-8df9-09116942248a",
            "name": "Dr. Jasmin Roque Sanches"
        },
        "product_brand": {
            "id": "a32930d6-5796-4690-9ac6-9514ac5374ab",
            "name": "Dr. Ariane Suellen Bezerra Jr."
        },
        "unit": {
            "id": "a32930d6-5951-4187-b288-92c59adc532b",
            "name": "Luzia Lozano Filho",
            "abbreviation": "Letícia Velasques Filho"
        },
        "image": {
            "id": null,
            "url": null
        },
        "epi_type": null,
        "description": "Praesentium qui voluptatum et necessitatibus optio.",
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/products/{id}

Headers

Authorization        

Example: Bearer Zkfb4P866agD13V5dcEhvae

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the product. Example: 1

product   string     

Product UUID Example: necessitatibus

List available origins

requires authentication product show

List supplier_products (NF items) with available quantity for the given product, ordered FIFO by NF date.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/products/commodi/available-origins" \
    --header "Authorization: Bearer gEVafZv3P84ac5hb61ed6Dk" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/products/commodi/available-origins"
);

const headers = {
    "Authorization": "Bearer gEVafZv3P84ac5hb61ed6Dk",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/products/{product}/available-origins

Headers

Authorization        

Example: Bearer gEVafZv3P84ac5hb61ed6Dk

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

product   string     

Product UUID Example: commodi

Create product

requires authentication product store

Create a new product

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/products" \
    --header "Authorization: Bearer a61VvDZbPcEgak3856hf4ed" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"product_family_id\": \"4fa7d2b2-48ba-3844-808b-1659ac2d443a\",
    \"product_brand_id\": \"5b25671e-98e5-3a6f-8e4a-e78cb36a6475\",
    \"unit_id\": \"be0bedb3-0c36-322c-9045-fdcc83e91006\",
    \"description\": \"Example Description\",
    \"stock\": 1
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/products"
);

const headers = {
    "Authorization": "Bearer a61VvDZbPcEgak3856hf4ed",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "product_family_id": "4fa7d2b2-48ba-3844-808b-1659ac2d443a",
    "product_brand_id": "5b25671e-98e5-3a6f-8e4a-e78cb36a6475",
    "unit_id": "be0bedb3-0c36-322c-9045-fdcc83e91006",
    "description": "Example Description",
    "stock": 1
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "string"
}
 

Request      

POST api/products

Headers

Authorization        

Example: Bearer a61VvDZbPcEgak3856hf4ed

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Nome. O campo value não pode ser superior a 255 caracteres. Example: Example Name

product_family_id   string     

Família do Produto. The uuid of an existing record in the product_families table. Example: 4fa7d2b2-48ba-3844-808b-1659ac2d443a

product_brand_id   string     

Marca do Produto. The uuid of an existing record in the product_brands table. Example: 5b25671e-98e5-3a6f-8e4a-e78cb36a6475

unit_id   string     

Unidade. The uuid of an existing record in the units table. Example: be0bedb3-0c36-322c-9045-fdcc83e91006

description   string  optional    

Descrição. Example: Example Description

stock   number     

Estoque. O campo value deve ser pelo menos 0. Example: 1

Update product

requires authentication product update

Update a product

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/products/1" \
    --header "Authorization: Bearer gaVeZhEb3v1a5686df4DcPk" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"product_family_id\": \"6bb68210-5907-3632-be44-a35f21c239ff\",
    \"product_brand_id\": \"3086c489-b95c-31be-bf5e-be08cc1ef700\",
    \"unit_id\": \"e0e41129-b871-3c9d-a8d1-39e5f7be1915\",
    \"stock\": 1,
    \"description\": \"Example Description\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/products/1"
);

const headers = {
    "Authorization": "Bearer gaVeZhEb3v1a5686df4DcPk",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "product_family_id": "6bb68210-5907-3632-be44-a35f21c239ff",
    "product_brand_id": "3086c489-b95c-31be-bf5e-be08cc1ef700",
    "unit_id": "e0e41129-b871-3c9d-a8d1-39e5f7be1915",
    "stock": 1,
    "description": "Example Description"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "string"
}
 

Request      

PUT api/products/{id}

Headers

Authorization        

Example: Bearer gaVeZhEb3v1a5686df4DcPk

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the product. Example: 1

product   string     

Product UUID Example: et

Body Parameters

name   string  optional    

Nome. O campo value não pode ser superior a 255 caracteres. Example: Example Name

product_family_id   string  optional    

Família do Produto. The uuid of an existing record in the product_families table. Example: 6bb68210-5907-3632-be44-a35f21c239ff

product_brand_id   string  optional    

Marca do Produto. The uuid of an existing record in the product_brands table. Example: 3086c489-b95c-31be-bf5e-be08cc1ef700

unit_id   string  optional    

Unidade. The uuid of an existing record in the units table. Example: e0e41129-b871-3c9d-a8d1-39e5f7be1915

stock   number  optional    

Estoque. O campo value deve ser pelo menos 0. Example: 1

description   string  optional    

Descrição. Example: Example Description

Delete product

requires authentication product delete

Delete a product

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/products/et" \
    --header "Authorization: Bearer 8a4kg6PEea6cf51bZVvD3hd" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/products/et"
);

const headers = {
    "Authorization": "Bearer 8a4kg6PEea6cf51bZVvD3hd",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/products/{product}

Headers

Authorization        

Example: Bearer 8a4kg6PEea6cf51bZVvD3hd

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

product   string     

Product UUID Example: et

Project Versions

Endpoints for project revisions

Create revision

requires authentication project version

Create a new revision and update the project current file

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/projects/e95972e4-131e-3bd8-9bd9-825808e8333c/versions" \
    --header "Authorization: Bearer a84EDP63v1ghfeZVdabc6k5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"notes\": \"Example Notes\",
    \"responsible_user_id\": \"131ad279-6f0e-36d7-9e98-96363607b0a2\",
    \"file\": {
        \"0\": \"example1\",
        \"1\": \"example2\",
        \"path\": \"Example File path\",
        \"name\": \"Example Name\",
        \"size\": \"Example File size\",
        \"extension\": \"Example File extension\"
    }
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/projects/e95972e4-131e-3bd8-9bd9-825808e8333c/versions"
);

const headers = {
    "Authorization": "Bearer a84EDP63v1ghfeZVdabc6k5",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "notes": "Example Notes",
    "responsible_user_id": "131ad279-6f0e-36d7-9e98-96363607b0a2",
    "file": {
        "0": "example1",
        "1": "example2",
        "path": "Example File path",
        "name": "Example Name",
        "size": "Example File size",
        "extension": "Example File extension"
    }
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):



 

Request      

POST api/projects/{projectUuid}/versions

Headers

Authorization        

Example: Bearer a84EDP63v1ghfeZVdabc6k5

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

projectUuid   string     

Project UUID Example: e95972e4-131e-3bd8-9bd9-825808e8333c

Body Parameters

notes   string  optional    

observação. Example: Example Notes

responsible_user_id   string  optional    

responsável. O campo value deve ser um UUID válido. The uuid of an existing record in the users table. Example: 131ad279-6f0e-36d7-9e98-96363607b0a2

file   object     

arquivo.

path   string  optional    

caminho do arquivo. This field is required when file is present. Example: Example File path

name   string     

nome do arquivo. Example: Example Name

size   string  optional    

tamanho do arquivo. Example: Example File size

extension   string  optional    

extensão do arquivo. Example: Example File extension

List revisions

requires authentication project show

List all revisions of a project

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/projects/6650e9de-7a1a-3158-a5c2-043abb9f698d/versions" \
    --header "Authorization: Bearer 4DPV6avd8Zb16ec53ahgfEk" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/projects/6650e9de-7a1a-3158-a5c2-043abb9f698d/versions"
);

const headers = {
    "Authorization": "Bearer 4DPV6avd8Zb16ec53ahgfEk",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/projects/{projectUuid}/versions

Headers

Authorization        

Example: Bearer 4DPV6avd8Zb16ec53ahgfEk

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

projectUuid   string     

Project UUID Example: 6650e9de-7a1a-3158-a5c2-043abb9f698d

Show revision

requires authentication project show

Show a specific revision

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/project-versions/536f295e-789c-3754-9c42-14cbf8cd8649" \
    --header "Authorization: Bearer vPDd81fg6aVcEk5Zh64a3eb" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/project-versions/536f295e-789c-3754-9c42-14cbf8cd8649"
);

const headers = {
    "Authorization": "Bearer vPDd81fg6aVcEk5Zh64a3eb",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/project-versions/{versionUuid}

Headers

Authorization        

Example: Bearer vPDd81fg6aVcEk5Zh64a3eb

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

versionUuid   string     

Revision UUID Example: 536f295e-789c-3754-9c42-14cbf8cd8649

Download revision

requires authentication project show

Generate a signed URL to download a revision

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/project-versions/2723bda2-9c3a-3de7-8697-454576429ab3/download" \
    --header "Authorization: Bearer 86hZ34eD61afg5bdkVcaEvP" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/project-versions/2723bda2-9c3a-3de7-8697-454576429ab3/download"
);

const headers = {
    "Authorization": "Bearer 86hZ34eD61afg5bdkVcaEvP",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "url": "string",
    "filename": "string",
    "size": "string",
    "version_number": "integer"
}
 

Request      

GET api/project-versions/{versionUuid}/download

Headers

Authorization        

Example: Bearer 86hZ34eD61afg5bdkVcaEvP

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

versionUuid   string     

Revision UUID Example: 2723bda2-9c3a-3de7-8697-454576429ab3

Restore revision

requires authentication project version

Restore a revision as the current file

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/project-versions/156b352c-0248-3ce9-8654-b796524e50d9/restore" \
    --header "Authorization: Bearer E5b4Vadgvc36eDkh1aZf8P6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/project-versions/156b352c-0248-3ce9-8654-b796524e50d9/restore"
);

const headers = {
    "Authorization": "Bearer E5b4Vadgvc36eDkh1aZf8P6",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "string"
}
 

Request      

POST api/project-versions/{versionUuid}/restore

Headers

Authorization        

Example: Bearer E5b4Vadgvc36eDkh1aZf8P6

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

versionUuid   string     

Revision UUID Example: 156b352c-0248-3ce9-8654-b796524e50d9

Delete revision

requires authentication project version

Soft delete a revision

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/project-versions/a225b33c-0034-3694-befa-a1d88475da2d" \
    --header "Authorization: Bearer 6ZgEdf8h4VPbv6kD13ac5ea" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/project-versions/a225b33c-0034-3694-befa-a1d88475da2d"
);

const headers = {
    "Authorization": "Bearer 6ZgEdf8h4VPbv6kD13ac5ea",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/project-versions/{versionUuid}

Headers

Authorization        

Example: Bearer 6ZgEdf8h4VPbv6kD13ac5ea

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

versionUuid   string     

Revision UUID Example: a225b33c-0034-3694-befa-a1d88475da2d

Projects

Endpoints for engineering projects

List projects

requires authentication project index

List all projects

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/projects?sort_by=created_at&sort_desc=1&page=1&per_page=15&q=El%C3%A9trico&discipline_id=5b9dae3e-8689-36cd-b5fa-7e8324d33ba0&work_id=92448b5a-e439-370d-9cf9-acf18fdc7652&status_id=41c88b04-0a45-3f5f-9f11-ac600295e020&responsible_id=a30bc0d1-d0a9-3600-8b5f-31641fb67db5" \
    --header "Authorization: Bearer PbhZvEe8a416f5gVa3D6ckd" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/projects"
);

const params = {
    "sort_by": "created_at",
    "sort_desc": "1",
    "page": "1",
    "per_page": "15",
    "q": "Elétrico",
    "discipline_id": "5b9dae3e-8689-36cd-b5fa-7e8324d33ba0",
    "work_id": "92448b5a-e439-370d-9cf9-acf18fdc7652",
    "status_id": "41c88b04-0a45-3f5f-9f11-ac600295e020",
    "responsible_id": "a30bc0d1-d0a9-3600-8b5f-31641fb67db5",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer PbhZvEe8a416f5gVa3D6ckd",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "108675b8-5d85-3fb4-9e83-b5343d06a082",
            "name": "Velit cupiditate sit",
            "description": "Voluptas non est cumque saepe autem qui.",
            "current_version": 1,
            "file": {
                "path": "projects/e8fa15a9-b004-37c5-a626-ad3a9f333301.pdf",
                "size": "2398968",
                "extension": "pdf"
            },
            "discipline": {
                "id": "a32930db-7d68-4155-90ec-f69bd9fd60ea",
                "name": "Ipsum",
                "code": "NBD"
            },
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "3acda458-b5b4-356e-8d9f-7f24879a3176",
            "name": "Ut sapiente tempore",
            "description": "Qui ab sed recusandae aut aut.",
            "current_version": 1,
            "file": {
                "path": "projects/fea45120-38c2-307d-a06f-aa82e3650f8f.pdf",
                "size": "4710140",
                "extension": "pdf"
            },
            "discipline": {
                "id": "a32930db-8091-439b-82dc-37597bdca3b8",
                "name": "Ipsa",
                "code": "MQT"
            },
            "created_at": null,
            "updated_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/projects

Headers

Authorization        

Example: Bearer PbhZvEe8a416f5gVa3D6ckd

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

sort_by   string  optional    

Field to sort by. Example: created_at

sort_desc   boolean  optional    

Sort order (true for descending, false for ascending). Example: true

page   integer  optional    

Page number for pagination. O campo value deve ser pelo menos 1. Example: 1

per_page   integer  optional    

Number of items per page (max: 100). O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 15

q   string  optional    

Search query. Example: Elétrico

discipline_id   string  optional    

Filter by discipline UUID. O campo value deve ser um UUID válido. The uuid of an existing record in the disciplines table. Example: 5b9dae3e-8689-36cd-b5fa-7e8324d33ba0

work_id   string  optional    

Filter by work UUID. O campo value deve ser um UUID válido. The uuid of an existing record in the works table. Example: 92448b5a-e439-370d-9cf9-acf18fdc7652

status_id   string  optional    

Filter by status UUID. O campo value deve ser um UUID válido. The uuid of an existing record in the statuses table. Example: 41c88b04-0a45-3f5f-9f11-ac600295e020

responsible_id   string  optional    

Filter by responsible user UUID. O campo value deve ser um UUID válido. The uuid of an existing record in the users table. Example: a30bc0d1-d0a9-3600-8b5f-31641fb67db5

Show project

requires authentication project show

Show a project

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/projects/13" \
    --header "Authorization: Bearer Z18dVc3a5fkDvg66E4haPeb" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/projects/13"
);

const headers = {
    "Authorization": "Bearer Z18dVc3a5fkDvg66E4haPeb",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "01f46d85-02ea-3f76-a9d7-63f0522f5c3a",
        "name": "Neque voluptas soluta",
        "description": "Commodi beatae aut officiis eligendi.",
        "current_version": 1,
        "file": {
            "path": "projects/84ccda29-cc45-38b7-8573-b1f140e31aed.pdf",
            "size": "85459",
            "extension": "pdf"
        },
        "discipline": {
            "id": "a32930db-881f-453d-85d0-e962b3e3d8da",
            "name": "Deleniti",
            "code": "DCU"
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/projects/{id}

Headers

Authorization        

Example: Bearer Z18dVc3a5fkDvg66E4haPeb

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the project. Example: 13

project   string     

Project UUID Example: et

Create project

requires authentication project store

Create a new project and its first revision (R00)

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/projects" \
    --header "Authorization: Bearer V4d183E6vDP6bahafkegZ5c" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"description\": \"Example Description\",
    \"discipline_id\": \"3b6a878e-2fa4-3296-aab2-99413e8b12c0\",
    \"work_id\": \"d8d4ebcb-c775-3443-813b-11a0fc3d53a5\",
    \"responsible_user_id\": \"ee4d01b4-a1fe-3002-b3e2-a36ada45e481\",
    \"notes\": \"Example Notes\",
    \"file\": {
        \"0\": \"example1\",
        \"1\": \"example2\",
        \"path\": \"Example File path\",
        \"name\": \"Example Name\",
        \"size\": \"Example File size\",
        \"extension\": \"Example File extension\"
    }
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/projects"
);

const headers = {
    "Authorization": "Bearer V4d183E6vDP6bahafkegZ5c",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "description": "Example Description",
    "discipline_id": "3b6a878e-2fa4-3296-aab2-99413e8b12c0",
    "work_id": "d8d4ebcb-c775-3443-813b-11a0fc3d53a5",
    "responsible_user_id": "ee4d01b4-a1fe-3002-b3e2-a36ada45e481",
    "notes": "Example Notes",
    "file": {
        "0": "example1",
        "1": "example2",
        "path": "Example File path",
        "name": "Example Name",
        "size": "Example File size",
        "extension": "Example File extension"
    }
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "string"
}
 

Request      

POST api/projects

Headers

Authorization        

Example: Bearer V4d183E6vDP6bahafkegZ5c

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

nome. Example: Example Name

description   string  optional    

descrição. Example: Example Description

discipline_id   string     

disciplina. O campo value deve ser um UUID válido. The uuid of an existing record in the disciplines table. Example: 3b6a878e-2fa4-3296-aab2-99413e8b12c0

work_id   string  optional    

obra. O campo value deve ser um UUID válido. The uuid of an existing record in the works table. Example: d8d4ebcb-c775-3443-813b-11a0fc3d53a5

responsible_user_id   string  optional    

responsável. O campo value deve ser um UUID válido. The uuid of an existing record in the users table. Example: ee4d01b4-a1fe-3002-b3e2-a36ada45e481

notes   string  optional    

observação. Example: Example Notes

file   object     

arquivo.

path   string  optional    

caminho do arquivo. This field is required when file is present. Example: Example File path

name   string     

nome do arquivo. Example: Example Name

size   string  optional    

tamanho do arquivo. Example: Example File size

extension   string  optional    

extensão do arquivo. Example: Example File extension

Update project

requires authentication project update

Update a project (metadata only)

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/projects/17" \
    --header "Authorization: Bearer 3hdbDgPkaV14Eefa86Zc65v" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"description\": \"Example Description\",
    \"discipline_id\": \"ace4d950-645f-31ec-9d33-ae0675d23ad4\",
    \"work_id\": \"d43745e9-34d4-3a00-9d6d-d22b47847333\",
    \"responsible_user_id\": \"4345d769-a504-387b-9763-26f2dcb49006\",
    \"status_id\": \"cda8a249-cbfe-3adc-80ea-0e0efcb94e40\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/projects/17"
);

const headers = {
    "Authorization": "Bearer 3hdbDgPkaV14Eefa86Zc65v",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "description": "Example Description",
    "discipline_id": "ace4d950-645f-31ec-9d33-ae0675d23ad4",
    "work_id": "d43745e9-34d4-3a00-9d6d-d22b47847333",
    "responsible_user_id": "4345d769-a504-387b-9763-26f2dcb49006",
    "status_id": "cda8a249-cbfe-3adc-80ea-0e0efcb94e40"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "string"
}
 

Request      

PUT api/projects/{id}

Headers

Authorization        

Example: Bearer 3hdbDgPkaV14Eefa86Zc65v

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the project. Example: 17

project   string     

Project UUID Example: earum

Body Parameters

name   string  optional    

nome. Example: Example Name

description   string  optional    

descrição. Example: Example Description

discipline_id   string  optional    

disciplina. O campo value deve ser um UUID válido. The uuid of an existing record in the disciplines table. Example: ace4d950-645f-31ec-9d33-ae0675d23ad4

work_id   string  optional    

obra. O campo value deve ser um UUID válido. The uuid of an existing record in the works table. Example: d43745e9-34d4-3a00-9d6d-d22b47847333

responsible_user_id   string  optional    

responsável. O campo value deve ser um UUID válido. The uuid of an existing record in the users table. Example: 4345d769-a504-387b-9763-26f2dcb49006

status_id   string  optional    

situação. O campo value deve ser um UUID válido. The uuid of an existing record in the statuses table. Example: cda8a249-cbfe-3adc-80ea-0e0efcb94e40

Delete project

requires authentication project delete

Delete a project and its revisions

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/projects/aut" \
    --header "Authorization: Bearer Z8E41h3gVbcv5akeD6Pd6af" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/projects/aut"
);

const headers = {
    "Authorization": "Bearer Z8E41h3gVbcv5akeD6Pd6af",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/projects/{project}

Headers

Authorization        

Example: Bearer Z8E41h3gVbcv5akeD6Pd6af

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

project   string     

Project UUID Example: aut

Reports

Endpoints for reports

Generate RDO PDF

requires authentication daily-log show

Dispatches async PDF generation. Frontend receives notification via Pusher when ready.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/reports/daily-log" \
    --header "Authorization: Bearer h3e6EvgDZ641fabcP5Vkda8" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"daily_log\": \"ipsum\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/reports/daily-log"
);

const headers = {
    "Authorization": "Bearer h3e6EvgDZ641fabcP5Vkda8",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "daily_log": "ipsum"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/reports/daily-log

Headers

Authorization        

Example: Bearer h3e6EvgDZ641fabcP5Vkda8

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

daily_log   string     

The uuid of an existing record in the daily_logs table. Example: ipsum

Generate EPI term PDF

requires authentication employee-epi show

Dispatches async PDF generation. Frontend receives notification via Pusher when ready.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/reports/epi-term" \
    --header "Authorization: Bearer 6dVP3DEb4e1gv6cZ5faahk8" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"employee\": \"cupiditate\",
    \"kit_uuid\": \"9dd33e37-0dd4-3320-820e-916cf0804b0a\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/reports/epi-term"
);

const headers = {
    "Authorization": "Bearer 6dVP3DEb4e1gv6cZ5faahk8",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "employee": "cupiditate",
    "kit_uuid": "9dd33e37-0dd4-3320-820e-916cf0804b0a"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/reports/epi-term

Headers

Authorization        

Example: Bearer 6dVP3DEb4e1gv6cZ5faahk8

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

employee   string     

The uuid of an existing record in the employees table. Example: cupiditate

kit_uuid   string     

O campo value deve ser um UUID válido. Example: 9dd33e37-0dd4-3320-820e-916cf0804b0a

Generate employee sheet PDF

requires authentication No specific permission required

Dispatches async PDF generation of the employee record. Frontend receives notification via Pusher when ready.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/reports/employee-sheet" \
    --header "Authorization: Bearer 6EP64gh85ea1cbvZ3kVDadf" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"employee\": \"ducimus\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/reports/employee-sheet"
);

const headers = {
    "Authorization": "Bearer 6EP64gh85ea1cbvZ3kVDadf",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "employee": "ducimus"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/reports/employee-sheet

Headers

Authorization        

Example: Bearer 6EP64gh85ea1cbvZ3kVDadf

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

employee   string     

The uuid of an existing record in the employees table. Example: ducimus

Cost center panel

requires authentication cost-center report

Totais por centro de custo no período, somados pela árvore. Devolve dois blocos declarados e separados: desembolso (fecha com o caixa e o banco) e custo apropriado por obra. Os dois não se somam — material comprado num mês e entregue em outro aparece em cada bloco no seu momento.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/reports/cost-center?date_start=2026-11-01&date_end=2026-11-30&works[]=36ef0889-7ff3-385d-850a-54b9776af45f&cost_centers[]=f43a1657-c2a6-39e6-ad6e-08d075bfdd97&format=xlsx" \
    --header "Authorization: Bearer bcD3eafdVEh61P5k4v6agZ8" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/reports/cost-center"
);

const params = {
    "date_start": "2026-11-01",
    "date_end": "2026-11-30",
    "works[0]": "36ef0889-7ff3-385d-850a-54b9776af45f",
    "cost_centers[0]": "f43a1657-c2a6-39e6-ad6e-08d075bfdd97",
    "format": "xlsx",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer bcD3eafdVEh61P5k4v6agZ8",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/reports/cost-center

Headers

Authorization        

Example: Bearer bcD3eafdVEh61P5k4v6agZ8

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

date_start   string     

Início do período. Must be a valid date in the format Y-m-d. Example: 2026-11-01

date_end   string     

Fim do período. Must be a valid date in the format Y-m-d. O campo value deve ser uma data posterior ou igual a date_start. Example: 2026-11-30

works   string[]  optional    

O campo value deve ser um UUID válido. The uuid of an existing record in the works table.

cost_centers   string[]  optional    

O campo value deve ser um UUID válido. The uuid of an existing record in the cost_centers table.

format   string  optional    

Só na exportação: xlsx (padrão) ou csv. Example: xlsx

Must be one of:
  • xlsx
  • csv

Cost center entries

requires authentication cost-center report

Lançamentos que formam um total do painel, paginados e em ordem de data. O centro informado inclui a subárvore, então clicar no total de um grupo lista o que veio dos filhos também.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/reports/cost-center/entries?search=officiis&sort_by=amount&sort_desc=1&per_page=10" \
    --header "Authorization: Bearer Db8P5av3VkhEa4fgZe66dc1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"date_start\": \"2026-11-06\",
    \"date_end\": \"2048-12-15\",
    \"block\": \"disbursement\",
    \"cost_center_id\": \"562acfd8-ee17-3a95-8a7e-79598da73986\",
    \"without_cost_center\": false,
    \"type\": \"labor\",
    \"per_page\": 8,
    \"search\": \"jjdjghupevgaqdqezi\",
    \"sort_by\": \"amount\",
    \"sort_desc\": true
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/reports/cost-center/entries"
);

const params = {
    "search": "officiis",
    "sort_by": "amount",
    "sort_desc": "1",
    "per_page": "10",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer Db8P5av3VkhEa4fgZe66dc1",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "date_start": "2026-11-06",
    "date_end": "2048-12-15",
    "block": "disbursement",
    "cost_center_id": "562acfd8-ee17-3a95-8a7e-79598da73986",
    "without_cost_center": false,
    "type": "labor",
    "per_page": 8,
    "search": "jjdjghupevgaqdqezi",
    "sort_by": "amount",
    "sort_desc": true
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/reports/cost-center/entries

Headers

Authorization        

Example: Bearer Db8P5av3VkhEa4fgZe66dc1

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

search   string  optional    

Texto livre em descrição, código, obra e fornecedor/recebedor, sem distinguir caixa nem acento. O total da paginação reflete a busca. Example: officiis

sort_by   string  optional    

date ou amount. Padrão: date. Example: amount

Must be one of:
  • date
  • amount
sort_desc   boolean  optional    

Ordem decrescente. Padrão: 1. Example: true

per_page   integer  optional    

Itens por página, até 100. Padrão: 10. Example: 10

Body Parameters

date_start   string     

Must be a valid date in the format Y-m-d. Example: 2026-11-06

date_end   string     

Must be a valid date in the format Y-m-d. O campo value deve ser uma data posterior ou igual a date_start. Example: 2048-12-15

block   string     

Example: disbursement

Must be one of:
  • disbursement
  • work_cost
cost_center_id   string  optional    

This field is required when without_cost_center is not present. O campo value deve ser um UUID válido. The uuid of an existing record in the cost_centers table. Example: 562acfd8-ee17-3a95-8a7e-79598da73986

without_cost_center   boolean  optional    

This field is required when cost_center_id is not present. Example: false

type   string  optional    

Example: labor

Must be one of:
  • material
  • labor
  • other
per_page   integer  optional    

O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 8

search   string  optional    

O campo value não pode ser superior a 255 caracteres. Example: jjdjghupevgaqdqezi

sort_by   string  optional    

Example: amount

Must be one of:
  • date
  • amount
sort_desc   boolean  optional    

Example: true

Export cost center panel

requires authentication cost-center report

Gera a planilha do painel com os filtros atuais. XLSX sai com três abas (um total por bloco, mais os lançamentos); CSV sai com as mesmas três coisas em seções. O arquivo é gerado em fila e chega por notificação.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/reports/cost-center/excel?date_start=2026-11-01&date_end=2026-11-30&works[]=b857e2e0-0cee-323d-9292-b0123cbc7476&cost_centers[]=8c78c33c-74e3-3a5a-b6ca-e1b66034ff3f&format=xlsx" \
    --header "Authorization: Bearer ZhP4fDa8k61vcbgV356adeE" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/reports/cost-center/excel"
);

const params = {
    "date_start": "2026-11-01",
    "date_end": "2026-11-30",
    "works[0]": "b857e2e0-0cee-323d-9292-b0123cbc7476",
    "cost_centers[0]": "8c78c33c-74e3-3a5a-b6ca-e1b66034ff3f",
    "format": "xlsx",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer ZhP4fDa8k61vcbgV356adeE",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (202):


{
    "message": "Relatório sendo gerado. Você será notificado quando estiver pronto.",
    "channel": "reports.{uuid}",
    "event": "excel-report.completed"
}
 

Request      

GET api/reports/cost-center/excel

Headers

Authorization        

Example: Bearer ZhP4fDa8k61vcbgV356adeE

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

date_start   string     

Início do período. Must be a valid date in the format Y-m-d. Example: 2026-11-01

date_end   string     

Fim do período. Must be a valid date in the format Y-m-d. O campo value deve ser uma data posterior ou igual a date_start. Example: 2026-11-30

works   string[]  optional    

O campo value deve ser um UUID válido. The uuid of an existing record in the works table.

cost_centers   string[]  optional    

O campo value deve ser um UUID válido. The uuid of an existing record in the cost_centers table.

format   string  optional    

Só na exportação: xlsx (padrão) ou csv. Example: xlsx

Must be one of:
  • xlsx
  • csv

Export Cash Flow to Excel

requires authentication No specific permission required

Dispatches async Excel generation. Frontend receives notification via Pusher when ready.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/reports/cash-flow/excel?q=saepe&type=entrada&description=Et+accusamus+consequatur+officiis+doloremque+quas+fugit+veniam+sapiente.&categories[]=f1b4770b-d7d4-32a5-8498-f003e1bb32f3&exclude_categories[]=1e000a51-3396-3038-b3d9-ce920db2d8a9&date_start=2026-01-01&date_end=2026-12-31&bank_accounts[]=0e60399a-73b8-3a73-b545-b6ebb144e664&customers[]=d7f2f560-210c-31d8-9f0d-38206e93d980&suppliers[]=e8fe7ff9-05b0-3350-89c0-3c71bf404f29&cash_session=444c7259-8815-3149-92ba-32fc207ad861&works[]=84617cec-b823-379e-b072-62f80395746e" \
    --header "Authorization: Bearer bV6Pdkg4DaE3ae518chvZf6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/reports/cash-flow/excel"
);

const params = {
    "q": "saepe",
    "type": "entrada",
    "description": "Et accusamus consequatur officiis doloremque quas fugit veniam sapiente.",
    "categories[0]": "f1b4770b-d7d4-32a5-8498-f003e1bb32f3",
    "exclude_categories[0]": "1e000a51-3396-3038-b3d9-ce920db2d8a9",
    "date_start": "2026-01-01",
    "date_end": "2026-12-31",
    "bank_accounts[0]": "0e60399a-73b8-3a73-b545-b6ebb144e664",
    "customers[0]": "d7f2f560-210c-31d8-9f0d-38206e93d980",
    "suppliers[0]": "e8fe7ff9-05b0-3350-89c0-3c71bf404f29",
    "cash_session": "444c7259-8815-3149-92ba-32fc207ad861",
    "works[0]": "84617cec-b823-379e-b072-62f80395746e",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer bV6Pdkg4DaE3ae518chvZf6",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/reports/cash-flow/excel

Headers

Authorization        

Example: Bearer bV6Pdkg4DaE3ae518chvZf6

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

q   string  optional    

Example: saepe

type   string  optional    

Tipo de lançamento. Example: entrada

Must be one of:
  • entrada
  • saída
  • tarifa
  • depósito
  • saque
  • transferência
  • pagamento
  • juros
  • ajuste
  • ajuste saída
description   string  optional    

Example: Et accusamus consequatur officiis doloremque quas fugit veniam sapiente.

categories   string[]  optional    

O campo value deve ser um UUID válido. The uuid of an existing record in the transaction_categories table.

exclude_categories   string[]  optional    

O campo value deve ser um UUID válido. The uuid of an existing record in the transaction_categories table.

date_start   string  optional    

Início do período (data). O campo value deve ser uma data válida. Example: 2026-01-01

date_end   string  optional    

Fim do período (data). O campo value deve ser uma data válida. Example: 2026-12-31

bank_accounts   string[]  optional    

O campo value deve ser um UUID válido.

customers   string[]  optional    

O campo value deve ser um UUID válido.

suppliers   string[]  optional    

O campo value deve ser um UUID válido.

cash_session   string  optional    

O campo value deve ser um UUID válido. Example: 444c7259-8815-3149-92ba-32fc207ad861

works   string[]  optional    

O campo value deve ser um UUID válido.

url   string  optional    
base64   string  optional    
aba_unica   string  optional    

GET api/reports/cash-flow

No specific permission required

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/reports/cash-flow?q=magni&type=entrada&description=Eum+hic+voluptas+voluptas+itaque+corrupti.&categories[]=c63189d1-c500-3ad1-8bbe-f842004c49b4&exclude_categories[]=3e1e3cf5-0969-39c4-a3fe-ef0864b8c1b6&date_start=2026-01-01&date_end=2026-12-31&bank_accounts[]=85fea1c9-da8f-3d24-afa9-d3d32bf7236a&customers[]=490f9b44-4dc0-3088-8e37-859e4148581a&suppliers[]=f8bfda99-2022-35bb-96b3-3d7fbeac80c7&cash_session=678926bd-d5b9-3591-8f71-a233a51be286&works[]=8786a595-83bf-315e-b4ae-38615d313357" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/reports/cash-flow"
);

const params = {
    "q": "magni",
    "type": "entrada",
    "description": "Eum hic voluptas voluptas itaque corrupti.",
    "categories[0]": "c63189d1-c500-3ad1-8bbe-f842004c49b4",
    "exclude_categories[0]": "3e1e3cf5-0969-39c4-a3fe-ef0864b8c1b6",
    "date_start": "2026-01-01",
    "date_end": "2026-12-31",
    "bank_accounts[0]": "85fea1c9-da8f-3d24-afa9-d3d32bf7236a",
    "customers[0]": "490f9b44-4dc0-3088-8e37-859e4148581a",
    "suppliers[0]": "f8bfda99-2022-35bb-96b3-3d7fbeac80c7",
    "cash_session": "678926bd-d5b9-3591-8f71-a233a51be286",
    "works[0]": "8786a595-83bf-315e-b4ae-38615d313357",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/reports/cash-flow

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

q   string  optional    

Example: magni

type   string  optional    

Tipo de lançamento. Example: entrada

Must be one of:
  • entrada
  • saída
  • tarifa
  • depósito
  • saque
  • transferência
  • pagamento
  • juros
  • ajuste
  • ajuste saída
description   string  optional    

Example: Eum hic voluptas voluptas itaque corrupti.

categories   string[]  optional    

O campo value deve ser um UUID válido. The uuid of an existing record in the transaction_categories table.

exclude_categories   string[]  optional    

O campo value deve ser um UUID válido. The uuid of an existing record in the transaction_categories table.

date_start   string  optional    

Início do período (data). O campo value deve ser uma data válida. Example: 2026-01-01

date_end   string  optional    

Fim do período (data). O campo value deve ser uma data válida. Example: 2026-12-31

bank_accounts   string[]  optional    

O campo value deve ser um UUID válido.

customers   string[]  optional    

O campo value deve ser um UUID válido.

suppliers   string[]  optional    

O campo value deve ser um UUID válido.

cash_session   string  optional    

O campo value deve ser um UUID válido. Example: 678926bd-d5b9-3591-8f71-a233a51be286

works   string[]  optional    

O campo value deve ser um UUID válido.

url   string  optional    
base64   string  optional    
aba_unica   string  optional    

Export Accounts Payable/Receivable to Excel

requires authentication No specific permission required

Dispatches async Excel generation. Frontend receives notification via Pusher when ready.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/reports/accounts-payable-receivable/excel" \
    --header "Authorization: Bearer k3d61bZ8DcvgPEVhaa54f6e" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/reports/accounts-payable-receivable/excel"
);

const headers = {
    "Authorization": "Bearer k3d61bZ8DcvgPEVhaa54f6e",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/reports/accounts-payable-receivable/excel

Headers

Authorization        

Example: Bearer k3d61bZ8DcvgPEVhaa54f6e

Content-Type        

Example: application/json

Accept        

Example: application/json

GET api/reports/accounts-payable-receivable

No specific permission required

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/reports/accounts-payable-receivable" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/reports/accounts-payable-receivable"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/reports/accounts-payable-receivable

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Sectors

Endpoints for sectors

List sectors

requires authentication sector index

List all sectors

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/sectors?sort_by=created_at&sort_desc=1&page=1&per_page=15&q=Tecnologia" \
    --header "Authorization: Bearer bv3hgDeEcPa584Zfa61dVk6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/sectors"
);

const params = {
    "sort_by": "created_at",
    "sort_desc": "1",
    "page": "1",
    "per_page": "15",
    "q": "Tecnologia",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer bv3hgDeEcPa584Zfa61dVk6",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "a680de73-d489-3949-9d5d-701270bf9933",
            "name": "occaecati eveniet",
            "slug": null,
            "description": "Non doloribus corporis quasi eum vitae rerum. Aut occaecati consequatur aliquid dolores consequatur ut numquam tempora. Qui eos labore sed excepturi fugiat officia.",
            "abbreviation": null,
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "892f646e-be72-3eac-8a58-f0000157aa73",
            "name": "ut qui",
            "slug": null,
            "description": null,
            "abbreviation": null,
            "created_at": null,
            "updated_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/sectors

Headers

Authorization        

Example: Bearer bv3hgDeEcPa584Zfa61dVk6

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

sort_by   string  optional    

Field to sort by. Example: created_at

sort_desc   boolean  optional    

Sort order (true for descending, false for ascending). Example: true

page   integer  optional    

Page number for pagination. O campo value deve ser pelo menos 1. Example: 1

per_page   integer  optional    

Number of items per page (max: 100). O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 15

q   string  optional    

Search query. Example: Tecnologia

Create sector

requires authentication sector store

Create a new sector

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/sectors" \
    --header "Authorization: Bearer fDa3Ved4v15h8E6ZkPag6bc" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"slug\": \"Example Slug\",
    \"description\": \"Example Description\",
    \"abbreviation\": \"Example Abbreviation\",
    \"image\": {
        \"0\": \"example1\",
        \"1\": \"example2\",
        \"path\": \"Example Image path\",
        \"url\": \"https:\\/\\/example.com\",
        \"name\": \"Example Name\",
        \"size\": \"Example Image size\",
        \"extension\": \"Example Image extension\"
    }
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/sectors"
);

const headers = {
    "Authorization": "Bearer fDa3Ved4v15h8E6ZkPag6bc",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "slug": "Example Slug",
    "description": "Example Description",
    "abbreviation": "Example Abbreviation",
    "image": {
        "0": "example1",
        "1": "example2",
        "path": "Example Image path",
        "url": "https:\/\/example.com",
        "name": "Example Name",
        "size": "Example Image size",
        "extension": "Example Image extension"
    }
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "string"
}
 

Request      

POST api/sectors

Headers

Authorization        

Example: Bearer fDa3Ved4v15h8E6ZkPag6bc

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Nome. O campo value não pode ser superior a 255 caracteres. Example: Example Name

slug   string  optional    

Slug. O campo value não pode ser superior a 255 caracteres. Example: Example Slug

description   string  optional    

Descrição. Example: Example Description

abbreviation   string  optional    

Abreviação. O campo value não pode ser superior a 10 caracteres. Example: Example Abbreviation

image   object  optional    

Imagem.

path   string  optional    

Caminho da imagem. O campo value não pode ser superior a 255 caracteres. Example: Example Image path

url   string  optional    

URL da imagem. Must be a valid URL. Example: https://example.com

name   string  optional    

Nome da imagem. O campo value não pode ser superior a 255 caracteres. Example: Example Name

size   string  optional    

Tamanho da imagem. O campo value não pode ser superior a 50 caracteres. Example: Example Image size

extension   string  optional    

Extensão da imagem. O campo value não pode ser superior a 10 caracteres. Example: Example Image extension

Get sector

requires authentication sector show

Get a sector

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/sectors/11" \
    --header "Authorization: Bearer D3h81acP56vZEV6dgekf4ba" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/sectors/11"
);

const headers = {
    "Authorization": "Bearer D3h81acP56vZEV6dgekf4ba",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "c7749898-2c0e-3c07-b4a2-4a28ba542f27",
        "name": "consequatur a",
        "slug": null,
        "description": "Ut sit omnis nesciunt voluptatem occaecati autem. Est dolor occaecati optio. Laudantium velit quod et ut dolorem. Veniam id et voluptatum totam.",
        "abbreviation": "nnr",
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/sectors/{id}

Headers

Authorization        

Example: Bearer D3h81acP56vZEV6dgekf4ba

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the sector. Example: 11

sector   string     

Sector ID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Update sector

requires authentication sector update

Update a sector

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/sectors/1" \
    --header "Authorization: Bearer eh4vDZa3g1Ef8aPVb5k6d6c" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"slug\": \"Example Slug\",
    \"description\": \"Example Description\",
    \"abbreviation\": \"Example Abbreviation\",
    \"image\": {
        \"0\": \"example1\",
        \"1\": \"example2\",
        \"path\": \"Example Image path\",
        \"url\": \"https:\\/\\/example.com\",
        \"name\": \"Example Name\",
        \"size\": \"Example Image size\",
        \"extension\": \"Example Image extension\"
    }
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/sectors/1"
);

const headers = {
    "Authorization": "Bearer eh4vDZa3g1Ef8aPVb5k6d6c",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "slug": "Example Slug",
    "description": "Example Description",
    "abbreviation": "Example Abbreviation",
    "image": {
        "0": "example1",
        "1": "example2",
        "path": "Example Image path",
        "url": "https:\/\/example.com",
        "name": "Example Name",
        "size": "Example Image size",
        "extension": "Example Image extension"
    }
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "string"
}
 

Request      

PUT api/sectors/{id}

Headers

Authorization        

Example: Bearer eh4vDZa3g1Ef8aPVb5k6d6c

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the sector. Example: 1

sector   string     

Sector ID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Body Parameters

name   string  optional    

Nome. O campo value não pode ser superior a 255 caracteres. Example: Example Name

slug   string  optional    

Slug. O campo value não pode ser superior a 255 caracteres. Example: Example Slug

description   string  optional    

Descrição. Example: Example Description

abbreviation   string  optional    

Abreviação. O campo value não pode ser superior a 10 caracteres. Example: Example Abbreviation

image   object  optional    

Imagem.

path   string  optional    

Caminho da imagem. O campo value não pode ser superior a 255 caracteres. Example: Example Image path

url   string  optional    

URL da imagem. Must be a valid URL. Example: https://example.com

name   string  optional    

Nome da imagem. O campo value não pode ser superior a 255 caracteres. Example: Example Name

size   string  optional    

Tamanho da imagem. O campo value não pode ser superior a 50 caracteres. Example: Example Image size

extension   string  optional    

Extensão da imagem. O campo value não pode ser superior a 10 caracteres. Example: Example Image extension

Delete sector

requires authentication sector delete

Delete a sector

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/sectors/3" \
    --header "Authorization: Bearer P3Va8Evk1a46gcdb6h5DefZ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/sectors/3"
);

const headers = {
    "Authorization": "Bearer P3Va8Evk1a46gcdb6h5DefZ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/sectors/{id}

Headers

Authorization        

Example: Bearer P3Va8Evk1a46gcdb6h5DefZ

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the sector. Example: 3

sector   string     

Sector ID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

List sector users

requires authentication sector show

List all users assigned to a sector

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/sectors/019556e7-2e9f-777c-a177-30bbf0646c32/users" \
    --header "Authorization: Bearer k6Vaa13Z8fhbDedg6cv4PE5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/sectors/019556e7-2e9f-777c-a177-30bbf0646c32/users"
);

const headers = {
    "Authorization": "Bearer k6Vaa13Z8fhbDedg6cv4PE5",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "9f6283fc-b198-360e-bfe3-04faef3d1ee6",
            "name": "Terry Boyle",
            "username": "merle35",
            "email": "queen03@example.net",
            "certification": null,
            "crea": null,
            "last_login_at": null,
            "image": {
                "id": null,
                "url": null
            },
            "sectors": [],
            "roles": []
        },
        {
            "id": "fd976a0e-5015-3805-b688-0bf12e85efa9",
            "name": "Mrs. Daniela Lubowitz",
            "username": "austyn54",
            "email": "feil.brooks@example.com",
            "certification": null,
            "crea": null,
            "last_login_at": null,
            "image": {
                "id": null,
                "url": null
            },
            "sectors": [],
            "roles": []
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/sectors/{sector}/users

Headers

Authorization        

Example: Bearer k6Vaa13Z8fhbDedg6cv4PE5

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

sector   string     

Sector UUID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Attach users to sector

requires authentication sector users attach

Attach users to a sector without removing existing ones. Expects an array of user UUIDs in the "users" field.

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/sectors/019556e7-2e9f-777c-a177-30bbf0646c32/users/attach" \
    --header "Authorization: Bearer 5Zb66afahc1P4kDdveE8gV3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"users\": [
        \"af3acd4d-8633-38fa-a271-572b0e1a6359\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/sectors/019556e7-2e9f-777c-a177-30bbf0646c32/users/attach"
);

const headers = {
    "Authorization": "Bearer 5Zb66afahc1P4kDdveE8gV3",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "users": [
        "af3acd4d-8633-38fa-a271-572b0e1a6359"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Users attached successfully"
}
 

Request      

POST api/sectors/{sector}/users/attach

Headers

Authorization        

Example: Bearer 5Zb66afahc1P4kDdveE8gV3

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

sector   string     

Sector UUID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Body Parameters

users   string[]  optional    

UUID do usuário. The uuid of an existing record in the users table.

Detach users from sector

requires authentication sector users detach

Remove specific users from a sector. Expects an array of user UUIDs in the "users" field.

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/sectors/019556e7-2e9f-777c-a177-30bbf0646c32/users/detach" \
    --header "Authorization: Bearer 3dh81Pe66g5ckEfaavZbDV4" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"users\": [
        \"7d8145c2-46b6-324a-ae3d-91af2f3f3b6b\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/sectors/019556e7-2e9f-777c-a177-30bbf0646c32/users/detach"
);

const headers = {
    "Authorization": "Bearer 3dh81Pe66g5ckEfaavZbDV4",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "users": [
        "7d8145c2-46b6-324a-ae3d-91af2f3f3b6b"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Users detached successfully"
}
 

Request      

POST api/sectors/{sector}/users/detach

Headers

Authorization        

Example: Bearer 3dh81Pe66g5ckEfaavZbDV4

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

sector   string     

Sector UUID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Body Parameters

users   string[]  optional    

UUID do usuário. The uuid of an existing record in the users table.

Sync sector users

requires authentication sector users sync

Replace all sector users with the provided list. Expects an array of user UUIDs in the "users" field.

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/sectors/019556e7-2e9f-777c-a177-30bbf0646c32/users/sync" \
    --header "Authorization: Bearer E3h5vV68adZag6Pf4e1bDkc" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"users\": [
        \"186513ce-c403-3cdb-b7a0-870a8e4b43b9\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/sectors/019556e7-2e9f-777c-a177-30bbf0646c32/users/sync"
);

const headers = {
    "Authorization": "Bearer E3h5vV68adZag6Pf4e1bDkc",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "users": [
        "186513ce-c403-3cdb-b7a0-870a8e4b43b9"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Users synchronized successfully"
}
 

Request      

POST api/sectors/{sector}/users/sync

Headers

Authorization        

Example: Bearer E3h5vV68adZag6Pf4e1bDkc

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

sector   string     

Sector UUID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Body Parameters

users   string[]  optional    

UUID do usuário. The uuid of an existing record in the users table.

Status Modules

Endpoints for modules that have status

List status modules

requires authentication status index

List all modules that have status functionality

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/status-modules" \
    --header "Authorization: Bearer Db8v1eVg45a6Phd6EaZ3cfk" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/status-modules"
);

const headers = {
    "Authorization": "Bearer Db8v1eVg45a6Phd6EaZ3cfk",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "name": "non excepturi",
            "slug": "quos-hic-quis-nihil-at-aliquid"
        },
        {
            "name": "alias et",
            "slug": "ut-hic-aut-delectus-odio"
        }
    ]
}
 

Request      

GET api/status-modules

Headers

Authorization        

Example: Bearer Db8v1eVg45a6Phd6EaZ3cfk

Content-Type        

Example: application/json

Accept        

Example: application/json

Statuses

Endpoints for statuses

List statuses

requires authentication status index

List all statuses

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/statuses?sort_by=created_at&sort_desc=1&page=1&per_page=15&q=Em+andamento&module=work&sector_id=019556e7-2e9f-777c-a177-30bbf0646c32" \
    --header "Authorization: Bearer bZagc6V4v16akhfdD58Pe3E" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/statuses"
);

const params = {
    "sort_by": "created_at",
    "sort_desc": "1",
    "page": "1",
    "per_page": "15",
    "q": "Em andamento",
    "module": "work",
    "sector_id": "019556e7-2e9f-777c-a177-30bbf0646c32",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer bZagc6V4v16akhfdD58Pe3E",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "e269f88d-86af-3834-9e94-05421e0c2bce",
            "slug": null,
            "name": null,
            "description": "Denise Caldeira Corona Sobrinho",
            "abbreviation": "sed",
            "color": "#d1f09f",
            "text_color": "#cd4bb3",
            "module": {
                "name": "Solicitação de Produtos",
                "slug": "product_request"
            },
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "3ac444bd-16c5-3baa-8df3-56dd6caa6fc4",
            "slug": null,
            "name": null,
            "description": "Sra. Noa Flor Ramos Jr.",
            "abbreviation": "doloremque",
            "color": "#626167",
            "text_color": "#1bd4d8",
            "module": {
                "name": "Obras",
                "slug": "work"
            },
            "created_at": null,
            "updated_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/statuses

Headers

Authorization        

Example: Bearer bZagc6V4v16akhfdD58Pe3E

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

sort_by   string  optional    

Field to sort by. Example: created_at

sort_desc   boolean  optional    

Sort order (true for descending, false for ascending). Example: true

page   integer  optional    

Page number for pagination. O campo value deve ser pelo menos 1. Example: 1

per_page   integer  optional    

Number of items per page (max: 100). O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 15

q   string  optional    

Search query. Example: Em andamento

module   string  optional    

Filter by module slug. The slug of an existing record in the status_modules table. Example: work

sector_id   string  optional    

Filter by sector UUID. The uuid of an existing record in the sectors table. Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Create status

requires authentication status store

Create a new status

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/statuses" \
    --header "Authorization: Bearer Zvg16bakEhV5a8Dc34edP6f" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"slug\": \"Example Slug\",
    \"name\": \"Example Name\",
    \"description\": \"Example Description\",
    \"abbreviation\": \"Example Abbreviation\",
    \"module\": \"Example Module\",
    \"sector_id\": \"3c24ef9f-47c3-3721-8d2c-41ccede074b6\",
    \"color\": \"Example Color\",
    \"text_color\": \"Example Text color\",
    \"order\": 1,
    \"is_initial\": true,
    \"is_final\": true
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/statuses"
);

const headers = {
    "Authorization": "Bearer Zvg16bakEhV5a8Dc34edP6f",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "slug": "Example Slug",
    "name": "Example Name",
    "description": "Example Description",
    "abbreviation": "Example Abbreviation",
    "module": "Example Module",
    "sector_id": "3c24ef9f-47c3-3721-8d2c-41ccede074b6",
    "color": "Example Color",
    "text_color": "Example Text color",
    "order": 1,
    "is_initial": true,
    "is_final": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "string"
}
 

Request      

POST api/statuses

Headers

Authorization        

Example: Bearer Zvg16bakEhV5a8Dc34edP6f

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

slug   string  optional    

Slug. O campo value não pode ser superior a 100 caracteres. Example: Example Slug

name   string  optional    

Nome. O campo value não pode ser superior a 255 caracteres. Example: Example Name

description   string     

Descrição. O campo value não pode ser superior a 255 caracteres. Example: Example Description

abbreviation   string     

Abreviação. O campo value não pode ser superior a 255 caracteres. Example: Example Abbreviation

module   string     

Módulo. Example: Example Module

sector_id   string     

Setor. The uuid of an existing record in the sectors table. Example: 3c24ef9f-47c3-3721-8d2c-41ccede074b6

color   string  optional    

Cor. Example: Example Color

text_color   string  optional    

Cor do texto. Example: Example Text color

order   integer  optional    

Ordem. O campo value deve ser pelo menos 0. Example: 1

is_initial   boolean  optional    

Status inicial. Example: true

is_final   boolean  optional    

Status final. Example: true

Get status

requires authentication status show

Get a status

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/statuses/1" \
    --header "Authorization: Bearer hZPdaaEk1634fcV6bgeD85v" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/statuses/1"
);

const headers = {
    "Authorization": "Bearer hZPdaaEk1634fcV6bgeD85v",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "6ed4898a-255b-33f9-995b-154127d1ce88",
        "slug": null,
        "name": null,
        "description": "Anderson Rogério Carvalho Sobrinho",
        "abbreviation": "fugiat",
        "color": "#5748cd",
        "text_color": "#e460b0",
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/statuses/{id}

Headers

Authorization        

Example: Bearer hZPdaaEk1634fcV6bgeD85v

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the status. Example: 1

status   string     

Status ID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Update status

requires authentication status update

Update a status

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/statuses/1" \
    --header "Authorization: Bearer ab1ZadPve43fk6cVgDE856h" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"slug\": \"Example Slug\",
    \"name\": \"Example Name\",
    \"description\": \"Example Description\",
    \"abbreviation\": \"Example Abbreviation\",
    \"module\": \"Example Module\",
    \"sector_id\": \"8d42a0f9-45d0-37c7-aad7-1ab12d27855e\",
    \"color\": \"Example Color\",
    \"text_color\": \"Example Text color\",
    \"order\": 1,
    \"is_initial\": true,
    \"is_final\": true
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/statuses/1"
);

const headers = {
    "Authorization": "Bearer ab1ZadPve43fk6cVgDE856h",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "slug": "Example Slug",
    "name": "Example Name",
    "description": "Example Description",
    "abbreviation": "Example Abbreviation",
    "module": "Example Module",
    "sector_id": "8d42a0f9-45d0-37c7-aad7-1ab12d27855e",
    "color": "Example Color",
    "text_color": "Example Text color",
    "order": 1,
    "is_initial": true,
    "is_final": true
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "string"
}
 

Request      

PUT api/statuses/{id}

Headers

Authorization        

Example: Bearer ab1ZadPve43fk6cVgDE856h

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the status. Example: 1

Status   string     

Status ID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Body Parameters

slug   string  optional    

Slug. O campo value não pode ser superior a 100 caracteres. Example: Example Slug

name   string  optional    

Nome. O campo value não pode ser superior a 255 caracteres. Example: Example Name

description   string  optional    

Descrição. O campo value não pode ser superior a 255 caracteres. Example: Example Description

abbreviation   string  optional    

Abreviação. O campo value não pode ser superior a 255 caracteres. Example: Example Abbreviation

module   string  optional    

Módulo. Example: Example Module

sector_id   string  optional    

Setor. The uuid of an existing record in the sectors table. Example: 8d42a0f9-45d0-37c7-aad7-1ab12d27855e

color   string  optional    

Cor. Example: Example Color

text_color   string  optional    

Cor do texto. Example: Example Text color

order   integer  optional    

Ordem. O campo value deve ser pelo menos 0. Example: 1

is_initial   boolean  optional    

Status inicial. Example: true

is_final   boolean  optional    

Status final. Example: true

Delete status

requires authentication status delete

Delete a status

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/statuses/019556e7-2e9f-777c-a177-30bbf0646c32" \
    --header "Authorization: Bearer e3Ddavb46E5g1c6a8khfVPZ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/statuses/019556e7-2e9f-777c-a177-30bbf0646c32"
);

const headers = {
    "Authorization": "Bearer e3Ddavb46E5g1c6a8khfVPZ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/statuses/{status}

Headers

Authorization        

Example: Bearer e3Ddavb46E5g1c6a8khfVPZ

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

status   string     

Status ID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Stock

Endpoints for stock management

List stocks available for transfer

requires authentication stock index

Returns a list of stock items from other works that have the specified product available for transfer

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/stocks/available-for-transfer?product_id=019556e7-2e9f-777c-a177-30bbf0646c32&exclude_work_id=019556e7-2e9f-777c-a177-30bbf0646c33&min_quantity=1" \
    --header "Authorization: Bearer Ze638a6Dgbdv1V5fPkEa4ch" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/stocks/available-for-transfer"
);

const params = {
    "product_id": "019556e7-2e9f-777c-a177-30bbf0646c32",
    "exclude_work_id": "019556e7-2e9f-777c-a177-30bbf0646c33",
    "min_quantity": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer Ze638a6Dgbdv1V5fPkEa4ch",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "3384d11b-285c-3801-8660-85909f0f71d7",
            "quantity": 398.1225,
            "min_quantity": null,
            "max_quantity": null,
            "below_minimum": false,
            "above_maximum": false,
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "d44c3dd5-e2ab-316c-98a4-40926959db21",
            "quantity": 838.2157,
            "min_quantity": null,
            "max_quantity": null,
            "below_minimum": false,
            "above_maximum": false,
            "created_at": null,
            "updated_at": null
        }
    ]
}
 

Request      

GET api/stocks/available-for-transfer

Headers

Authorization        

Example: Bearer Ze638a6Dgbdv1V5fPkEa4ch

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

product_id   string     

Product UUID to search for. O campo value deve ser um UUID válido. The uuid of an existing record in the products table. Example: 019556e7-2e9f-777c-a177-30bbf0646c32

exclude_work_id   string  optional    

Work UUID to exclude from results (usually the requesting work). O campo value deve ser um UUID válido. The uuid of an existing record in the works table. Example: 019556e7-2e9f-777c-a177-30bbf0646c33

min_quantity   number  optional    

Minimum quantity available. O campo value deve ser pelo menos 0.0001. Example: 1

List stocks

requires authentication stock index

Returns a paginated list of stocks

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/stocks?sort_by=created_at&sort_desc=1&page=1&per_page=10&q=Main+Stock&module=work&is_active=1" \
    --header "Authorization: Bearer 35E6adcfgeab8hkv41VZDP6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/stocks"
);

const params = {
    "sort_by": "created_at",
    "sort_desc": "1",
    "page": "1",
    "per_page": "10",
    "q": "Main Stock",
    "module": "work",
    "is_active": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer 35E6adcfgeab8hkv41VZDP6",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "d4590cfe-7458-34b5-bff9-cb97cff2a072",
            "name": "Estoque Burgos S.A.",
            "module": "work",
            "is_active": true,
            "is_main": false,
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "afc05711-96c7-3419-90b0-94a19914b55d",
            "name": "Estoque Teles e Marés",
            "module": "work",
            "is_active": true,
            "is_main": false,
            "created_at": null,
            "updated_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/stocks

Headers

Authorization        

Example: Bearer 35E6adcfgeab8hkv41VZDP6

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

sort_by   string  optional    

Field to sort by. Example: created_at

sort_desc   boolean  optional    

Sort order (true for descending, false for ascending). Example: true

page   integer  optional    

Page number for pagination. O campo value deve ser pelo menos 1. Example: 1

per_page   integer  optional    

Number of items per page. O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 10

q   string  optional    

Search by stock name. O campo value não pode ser superior a 255 caracteres. Example: Main Stock

module   string  optional    

Filter by module type (e.g., work, customer). O campo value não pode ser superior a 100 caracteres. Example: work

is_active   boolean  optional    

Filter by active status. Example: true

Create stock

requires authentication stock store

Creates a new stock linked to a module

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/stocks" \
    --header "Authorization: Bearer 6hPa8DdgZ3cV5vkf6e1Eba4" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"module\": \"Example Module\",
    \"id\": \"Example Id\",
    \"is_active\": true
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/stocks"
);

const headers = {
    "Authorization": "Bearer 6hPa8DdgZ3cV5vkf6e1Eba4",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "module": "Example Module",
    "id": "Example Id",
    "is_active": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "data": {
        "id": "cb8533c1-fe5e-3f03-b113-8a7c5b0c9c98",
        "name": "Estoque Uchoa S.A.",
        "module": "work",
        "is_active": true,
        "is_main": false,
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

POST api/stocks

Headers

Authorization        

Example: Bearer 6hPa8DdgZ3cV5vkf6e1Eba4

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

nome. O campo value não pode ser superior a 255 caracteres. Example: Example Name

module   string     

módulo. O campo value não pode ser superior a 255 caracteres. Example: Example Module

id   string     

identificador. Example: Example Id

is_active   boolean  optional    

ativo. Example: true

Get main stock

requires authentication stock.main show

Returns the main stock

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/stocks/main" \
    --header "Authorization: Bearer e8DEabPacvgVhZ361f54k6d" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/stocks/main"
);

const headers = {
    "Authorization": "Bearer e8DEabPacvgVhZ361f54k6d",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "f1fb18a1-9e86-3adb-b28e-d3002797eb03",
        "name": "Estoque Mendonça e Estrada S.A.",
        "module": "work",
        "is_active": true,
        "is_main": false,
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/stocks/main

Headers

Authorization        

Example: Bearer e8DEabPacvgVhZ361f54k6d

Content-Type        

Example: application/json

Accept        

Example: application/json

Show stock

requires authentication stock show

Returns details of a specific stock

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/stocks/1" \
    --header "Authorization: Bearer Zhef4dP6D8gvcE61a5Vbka3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/stocks/1"
);

const headers = {
    "Authorization": "Bearer Zhef4dP6D8gvcE61a5Vbka3",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "c48d380e-94cf-38f6-ab24-d75cb77d73e1",
        "name": "Estoque Espinoza Comercial Ltda.",
        "module": "work",
        "is_active": true,
        "is_main": false,
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/stocks/{id}

Headers

Authorization        

Example: Bearer Zhef4dP6D8gvcE61a5Vbka3

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the stock. Example: 1

stock   string     

Stock UUID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Update stock

requires authentication stock update

Updates an existing stock

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/stocks/1" \
    --header "Authorization: Bearer ZkdVvaDP3hfc861eb654aEg" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"is_active\": true
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/stocks/1"
);

const headers = {
    "Authorization": "Bearer ZkdVvaDP3hfc861eb654aEg",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "is_active": true
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "af484b8d-8665-3ced-9bb1-d1838110624c",
        "name": "Estoque da Silva e Associados",
        "module": "work",
        "is_active": true,
        "is_main": false,
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

PUT api/stocks/{id}

Headers

Authorization        

Example: Bearer ZkdVvaDP3hfc861eb654aEg

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the stock. Example: 1

stock   string     

Stock UUID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Body Parameters

name   string  optional    

nome. O campo value não pode ser superior a 255 caracteres. Example: Example Name

is_active   boolean  optional    

ativo. Example: true

Delete stock

requires authentication stock delete

Removes a stock (soft delete)

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/stocks/1" \
    --header "Authorization: Bearer afav6ebhVk5c1d6DE8Z3gP4" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/stocks/1"
);

const headers = {
    "Authorization": "Bearer afav6ebhVk5c1d6DE8Z3gP4",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/stocks/{id}

Headers

Authorization        

Example: Bearer afav6ebhVk5c1d6DE8Z3gP4

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the stock. Example: 1

stock   string     

Stock UUID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

List stock items

requires authentication stock show

Returns a paginated list of items/products in a stock

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/stocks/019556e7-2e9f-777c-a177-30bbf0646c32/items?sort_by=created_at&sort_desc=1&page=1&per_page=10&q=Cement&below_minimum=1&above_maximum=" \
    --header "Authorization: Bearer dhaVkcae86gP4E3b1ZD5vf6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/stocks/019556e7-2e9f-777c-a177-30bbf0646c32/items"
);

const params = {
    "sort_by": "created_at",
    "sort_desc": "1",
    "page": "1",
    "per_page": "10",
    "q": "Cement",
    "below_minimum": "1",
    "above_maximum": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer dhaVkcae86gP4E3b1ZD5vf6",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "a6096f32-114e-3f4a-a463-12b0c63ebe2f",
            "quantity": 276.8248,
            "min_quantity": null,
            "max_quantity": null,
            "below_minimum": false,
            "above_maximum": false,
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "3a85165c-3834-35ff-a6e1-1354caac8d29",
            "quantity": 250.9521,
            "min_quantity": null,
            "max_quantity": null,
            "below_minimum": false,
            "above_maximum": false,
            "created_at": null,
            "updated_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/stocks/{stock}/items

Headers

Authorization        

Example: Bearer dhaVkcae86gP4E3b1ZD5vf6

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

stock   string     

Stock UUID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Query Parameters

sort_by   string  optional    

Field to sort by. Example: created_at

sort_desc   boolean  optional    

Sort order (true for descending, false for ascending). Example: true

page   integer  optional    

Page number for pagination. O campo value deve ser pelo menos 1. Example: 1

per_page   integer  optional    

Number of items per page. O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 10

q   string  optional    

Search by product name. O campo value não pode ser superior a 255 caracteres. Example: Cement

below_minimum   boolean  optional    

Filter items below minimum quantity. Example: true

above_maximum   boolean  optional    

Filter items above maximum quantity. Example: false

Update stock item

requires authentication stock update

Updates min/max quantity thresholds for a stock item

Example request:
curl --request PATCH \
    "https://api.bs-homolog.pensou.app.br/api/stocks/1/items/esse" \
    --header "Authorization: Bearer ZcafVe8PhDb1v36E56dga4k" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"min_quantity\": 10,
    \"max_quantity\": 100
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/stocks/1/items/esse"
);

const headers = {
    "Authorization": "Bearer ZcafVe8PhDb1v36E56dga4k",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "min_quantity": 10,
    "max_quantity": 100
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "eb33621f-ca16-3411-9250-aba3fbddea4a",
        "quantity": 832.0551,
        "min_quantity": null,
        "max_quantity": null,
        "below_minimum": false,
        "above_maximum": false,
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

PATCH api/stocks/{stock_id}/items/{id}

Headers

Authorization        

Example: Bearer ZcafVe8PhDb1v36E56dga4k

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

stock_id   integer     

The ID of the stock. Example: 1

id   string     

The ID of the item. Example: esse

stock   string     

Stock UUID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

item   string     

Stock item UUID Example: 019556e7-3a1b-888d-b288-41ccf0757d43

Body Parameters

min_quantity   number  optional    

Minimum quantity threshold for low stock alert. O campo value deve ser pelo menos 0. Example: 10

max_quantity   number  optional    

Maximum quantity threshold for over stock alert. O campo value deve ser pelo menos 0. Example: 100

Stock summary

requires authentication stock show

Returns a summary with totals and alerts for the stock

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/stocks/019556e7-2e9f-777c-a177-30bbf0646c32/summary" \
    --header "Authorization: Bearer 1evd8k5bfDa3ZEach4gV66P" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/stocks/019556e7-2e9f-777c-a177-30bbf0646c32/summary"
);

const headers = {
    "Authorization": "Bearer 1evd8k5bfDa3ZEach4gV66P",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "total_products": 15,
        "total_quantity": 1250.5,
        "total_value": 18750.4,
        "current_value": 9000,
        "consumed_value": 9750.4,
        "unvalued_quantity": 5,
        "items_below_minimum": 3,
        "items_above_maximum": 1
    }
}
 

Request      

GET api/stocks/{stock}/summary

Headers

Authorization        

Example: Bearer 1evd8k5bfDa3ZEach4gV66P

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

stock   string     

Stock UUID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Stock Movements

Endpoints for stock movement management

List movements

requires authentication stock.movement index

Returns a paginated list of movements for a stock

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/stocks/1/movements?sort_by=created_at&sort_desc=1&page=1&per_page=10&type=entry&product_id=019556e7-2e9f-777c-a177-30bbf0646c32&date_start=2024-01-01&date_end=2024-12-31" \
    --header "Authorization: Bearer aZ8bcgVDef16hdv6Pk3a54E" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/stocks/1/movements"
);

const params = {
    "sort_by": "created_at",
    "sort_desc": "1",
    "page": "1",
    "per_page": "10",
    "type": "entry",
    "product_id": "019556e7-2e9f-777c-a177-30bbf0646c32",
    "date_start": "2024-01-01",
    "date_end": "2024-12-31",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer aZ8bcgVDef16hdv6Pk3a54E",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "59458364-23c2-33ec-809f-b7a1dbb17563",
            "code": "MOV-338593",
            "type": "devolução",
            "type_name": "RETURN",
            "is_entry": true,
            "is_exit": false,
            "quantity": 60.8191,
            "previous_quantity": 97.3462,
            "new_quantity": 158.1653,
            "reason": "Sapiente magni ipsam accusantium cupiditate aut quisquam deserunt.",
            "movement_date": "2026-10-31T17:08:25.000000Z",
            "created_at": null
        },
        {
            "id": "8b772ede-fd0c-31ff-a6fc-783a1c1da077",
            "code": "MOV-656637",
            "type": "compra",
            "type_name": "PURCHASE",
            "is_entry": true,
            "is_exit": false,
            "quantity": 66.799,
            "previous_quantity": 47.5874,
            "new_quantity": 114.3864,
            "reason": null,
            "movement_date": "2026-10-09T06:18:13.000000Z",
            "created_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/stocks/{stock_id}/movements

Headers

Authorization        

Example: Bearer aZ8bcgVDef16hdv6Pk3a54E

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

stock_id   integer     

The ID of the stock. Example: 1

stock   string     

Stock UUID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Query Parameters

sort_by   string  optional    

Field to sort by. Example: created_at

sort_desc   boolean  optional    

Sort order (true for descending, false for ascending). Example: true

page   integer  optional    

Page number for pagination. O campo value deve ser pelo menos 1. Example: 1

per_page   integer  optional    

Number of items per page. O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 10

type   string  optional    

Filter by movement type (entry, consumption, transfer_in, transfer_out, adjustment_up, adjustment_down). O campo value não pode ser superior a 50 caracteres. Example: entry

product_id   string  optional    

Filter by product UUID. O campo value deve ser um UUID válido. Example: 019556e7-2e9f-777c-a177-30bbf0646c32

date_start   string  optional    

Filter movements from this date (YYYY-MM-DD). O campo value deve ser uma data válida. Example: 2024-01-01

date_end   string  optional    

Filter movements until this date (YYYY-MM-DD). O campo value deve ser uma data válida. O campo value deve ser uma data posterior ou igual a date_start. Example: 2024-12-31

Create movement

requires authentication stock.movement store

Creates a new entry or exit movement in the stock

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/stocks/1/movements" \
    --header "Authorization: Bearer 4vdP5h6E6a31Dkb8gcaZeVf" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"product_id\": \"9afbeaf1-3f64-3b4c-96c7-d7fa6e294134\",
    \"type\": \"Example Type\",
    \"quantity\": 1,
    \"reason\": \"Example Reason\",
    \"reference_type\": \"Example Reference type\",
    \"reference_id\": 1,
    \"movement_date\": \"2024-01-01\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/stocks/1/movements"
);

const headers = {
    "Authorization": "Bearer 4vdP5h6E6a31Dkb8gcaZeVf",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "product_id": "9afbeaf1-3f64-3b4c-96c7-d7fa6e294134",
    "type": "Example Type",
    "quantity": 1,
    "reason": "Example Reason",
    "reference_type": "Example Reference type",
    "reference_id": 1,
    "movement_date": "2024-01-01"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "data": {
        "id": "de75af43-9361-3c9b-a810-6da8b136e979",
        "code": "MOV-283712",
        "type": "venda",
        "type_name": "SALE",
        "is_entry": false,
        "is_exit": true,
        "quantity": 35.68,
        "previous_quantity": 835.4658,
        "new_quantity": 799.7858,
        "reason": "Eaque corporis doloremque voluptas enim.",
        "movement_date": "2026-10-30T17:25:38.000000Z",
        "created_at": null
    }
}
 

Request      

POST api/stocks/{stock_id}/movements

Headers

Authorization        

Example: Bearer 4vdP5h6E6a31Dkb8gcaZeVf

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

stock_id   integer     

The ID of the stock. Example: 1

stock   string     

Stock UUID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Body Parameters

product_id   string     

produto. The uuid of an existing record in the products table. Example: 9afbeaf1-3f64-3b4c-96c7-d7fa6e294134

type   string     

tipo de movimentação. Example: Example Type

Must be one of:
  • compra
  • produção
  • devolução
  • consumo
  • venda
  • perda
  • vencido
  • alocação
quantity   number     

quantidade. Example: 1

reason   string  optional    

motivo. O campo value não pode ser superior a 500 caracteres. Example: Example Reason

reference_type   string  optional    

tipo de referência. O campo value não pode ser superior a 255 caracteres. Example: Example Reference type

reference_id   integer  optional    

referência. Example: 1

movement_date   string  optional    

data da movimentação. O campo value deve ser uma data válida. Example: 2024-01-01

Transfer between stocks

requires authentication stock.movement transfer

Transfers products from one stock to another

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/stocks/019556e7-2e9f-777c-a177-30bbf0646c32/movements/transfer" \
    --header "Authorization: Bearer 4vbfV1gh5EPa6ec8Dk36dZa" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"product_id\": \"80eb359d-a9bf-35e3-bf35-2ddf08f74991\",
    \"destination_stock_id\": \"3009a95c-3f1c-3628-8d87-11d1abf5f1f3\",
    \"quantity\": 1,
    \"reason\": \"Example Reason\",
    \"movement_date\": \"2024-01-01\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/stocks/019556e7-2e9f-777c-a177-30bbf0646c32/movements/transfer"
);

const headers = {
    "Authorization": "Bearer 4vbfV1gh5EPa6ec8Dk36dZa",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "product_id": "80eb359d-a9bf-35e3-bf35-2ddf08f74991",
    "destination_stock_id": "3009a95c-3f1c-3628-8d87-11d1abf5f1f3",
    "quantity": 1,
    "reason": "Example Reason",
    "movement_date": "2024-01-01"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "data": {
        "id": "c476b295-c944-39f9-9af8-6c6036038c8a",
        "code": "MOV-892507",
        "type": "compra",
        "type_name": "PURCHASE",
        "is_entry": true,
        "is_exit": false,
        "quantity": 3.4188,
        "previous_quantity": 75.3183,
        "new_quantity": 78.7371,
        "reason": null,
        "movement_date": "2026-10-24T10:14:40.000000Z",
        "created_at": null
    }
}
 

Request      

POST api/stocks/{stock}/movements/transfer

Headers

Authorization        

Example: Bearer 4vbfV1gh5EPa6ec8Dk36dZa

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

stock   string     

Source stock UUID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Body Parameters

product_id   string     

produto. The uuid of an existing record in the products table. Example: 80eb359d-a9bf-35e3-bf35-2ddf08f74991

destination_stock_id   string     

estoque de destino. The value and stock must be different. The uuid of an existing record in the stocks table. Example: 3009a95c-3f1c-3628-8d87-11d1abf5f1f3

quantity   number     

quantidade. Example: 1

reason   string  optional    

motivo. O campo value não pode ser superior a 500 caracteres. Example: Example Reason

movement_date   string  optional    

data da movimentação. O campo value deve ser uma data válida. Example: 2024-01-01

Inventory adjustment

requires authentication stock.movement inventory

Performs inventory adjustment to correct stock quantity

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/stocks/019556e7-2e9f-777c-a177-30bbf0646c32/movements/inventory" \
    --header "Authorization: Bearer dhgv8Zeafb5PEVDk614ca63" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"product_id\": \"70a2d963-1379-3d73-abe2-c44a9df9b68c\",
    \"new_quantity\": 1,
    \"reason\": \"Example Reason\",
    \"movement_date\": \"2024-01-01\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/stocks/019556e7-2e9f-777c-a177-30bbf0646c32/movements/inventory"
);

const headers = {
    "Authorization": "Bearer dhgv8Zeafb5PEVDk614ca63",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "product_id": "70a2d963-1379-3d73-abe2-c44a9df9b68c",
    "new_quantity": 1,
    "reason": "Example Reason",
    "movement_date": "2024-01-01"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "data": {
        "id": "fad82413-38cb-3d79-9ed5-686ef851ac1b",
        "code": "MOV-922802",
        "type": "vencido",
        "type_name": "EXPIRED",
        "is_entry": false,
        "is_exit": true,
        "quantity": 28.1509,
        "previous_quantity": 248.1109,
        "new_quantity": 219.96,
        "reason": "Nobis necessitatibus nesciunt iure recusandae qui quos occaecati.",
        "movement_date": "2026-10-21T22:36:44.000000Z",
        "created_at": null
    }
}
 

Request      

POST api/stocks/{stock}/movements/inventory

Headers

Authorization        

Example: Bearer dhgv8Zeafb5PEVDk614ca63

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

stock   string     

Stock UUID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Body Parameters

product_id   string     

produto. The uuid of an existing record in the products table. Example: 70a2d963-1379-3d73-abe2-c44a9df9b68c

new_quantity   number     

nova quantidade. Example: 1

reason   string  optional    

motivo. O campo value não pode ser superior a 500 caracteres. Example: Example Reason

movement_date   string  optional    

data da movimentação. O campo value deve ser uma data válida. Example: 2024-01-01

Purchase entry

requires authentication stock.movement store

Registers a purchase entry directly into the main stock

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/stock-movements/purchase" \
    --header "Authorization: Bearer Z8Ec451Df6k3gVabdP6evah" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"product_id\": \"154eef0a-533c-31bc-a68f-b0cfc7e9904a\",
    \"quantity\": 1,
    \"reason\": \"Example Reason\",
    \"movement_date\": \"2024-01-01\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/stock-movements/purchase"
);

const headers = {
    "Authorization": "Bearer Z8Ec451Df6k3gVabdP6evah",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "product_id": "154eef0a-533c-31bc-a68f-b0cfc7e9904a",
    "quantity": 1,
    "reason": "Example Reason",
    "movement_date": "2024-01-01"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "data": {
        "id": "6c130af2-2ba0-37bb-9b78-e25a3d2c5d00",
        "code": "MOV-085216",
        "type": "devolução",
        "type_name": "RETURN",
        "is_entry": true,
        "is_exit": false,
        "quantity": 48.9241,
        "previous_quantity": 146.3909,
        "new_quantity": 195.315,
        "reason": "Atque ut ut minima quaerat et id.",
        "movement_date": "2026-10-13T16:47:12.000000Z",
        "created_at": null
    }
}
 

Request      

POST api/stock-movements/purchase

Headers

Authorization        

Example: Bearer Z8Ec451Df6k3gVabdP6evah

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

product_id   string     

produto. The uuid of an existing record in the products table. Example: 154eef0a-533c-31bc-a68f-b0cfc7e9904a

quantity   number     

quantidade. O campo value deve ser pelo menos 0.0001. Example: 1

reason   string  optional    

motivo. O campo value não pode ser superior a 500 caracteres. Example: Example Reason

movement_date   string  optional    

data do movimento. O campo value deve ser uma data válida. Example: 2024-01-01

Show movement

requires authentication stock.movement index

Returns details of a specific movement

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/stock-movements/019556e7-2e9f-777c-a177-30bbf0646c32" \
    --header "Authorization: Bearer hD84k1g36EbP5vZfedaca6V" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/stock-movements/019556e7-2e9f-777c-a177-30bbf0646c32"
);

const headers = {
    "Authorization": "Bearer hD84k1g36EbP5vZfedaca6V",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "003a8fef-5a2e-3e7b-9855-8896a1b57d43",
        "code": "MOV-238355",
        "type": "produção",
        "type_name": "PRODUCTION",
        "is_entry": true,
        "is_exit": false,
        "quantity": 13.0239,
        "previous_quantity": 331.8006,
        "new_quantity": 344.8245,
        "reason": null,
        "movement_date": "2026-10-26T00:17:39.000000Z",
        "created_at": null
    }
}
 

Request      

GET api/stock-movements/{movement}

Headers

Authorization        

Example: Bearer hD84k1g36EbP5vZfedaca6V

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

movement   string     

Movement UUID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Suppliers

Endpoints for suppliers

List suppliers

requires authentication suppliers index

List all suppliers

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/suppliers?sort_by=created_at&sort_desc=1&page=1&per_page=15&q=Supplier+name" \
    --header "Authorization: Bearer 6VE61h4kZPbadf3evDag8c5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/suppliers"
);

const params = {
    "sort_by": "created_at",
    "sort_desc": "1",
    "page": "1",
    "per_page": "15",
    "q": "Supplier name",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer 6VE61h4kZPbadf3evDag8c5",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "10da5c46-e383-383f-a15c-4502fddfd45e",
            "name": "Srta. Bárbara da Cruz Benez Filho",
            "email": "roque.michelle@example.com",
            "phone": "(79) 2149-8713",
            "document": "34.951.936/0001-10",
            "type": "pf",
            "responsible": "Sr. Juan Ferreira",
            "image": {
                "id": null,
                "url": null
            },
            "address": {
                "street": null,
                "number": null,
                "complement": null,
                "neighborhood": null,
                "city": null,
                "state": null,
                "zip_code": null
            }
        },
        {
            "id": "68bcf3a9-798e-3649-b06d-e97179fbfce0",
            "name": "Dr. Madalena Espinoza Rodrigues",
            "email": "eurias@example.org",
            "phone": "(18) 2662-4703",
            "document": "25.378.156/0001-31",
            "type": "pf",
            "responsible": "Ayla Velasques Neto",
            "image": {
                "id": null,
                "url": null
            },
            "address": {
                "street": null,
                "number": null,
                "complement": null,
                "neighborhood": null,
                "city": null,
                "state": null,
                "zip_code": null
            }
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/suppliers

Headers

Authorization        

Example: Bearer 6VE61h4kZPbadf3evDag8c5

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

sort_by   string  optional    

Field to sort by. Example: created_at

sort_desc   boolean  optional    

Sort order (true for descending, false for ascending). Example: true

page   integer  optional    

Page number for pagination. O campo value deve ser pelo menos 1. Example: 1

per_page   integer  optional    

Number of items per page (max: 100). O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 15

q   string  optional    

Search query. Example: Supplier name

Create supplier

requires authentication suppliers store

Create a new supplier

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/suppliers" \
    --header "Authorization: Bearer kdZ1v6gfVcEP3haD68eb4a5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"email\": \"user@example.com\",
    \"phone\": \"(11) 99999-9999\",
    \"document\": \"Example Document\",
    \"type\": \"Example Type\",
    \"responsible\": \"Example Responsible\",
    \"image\": {
        \"0\": \"example1\",
        \"1\": \"example2\",
        \"path\": \"Example Image path\",
        \"name\": \"Example Name\",
        \"extension\": \"Example Image extension\",
        \"size\": \"Example Image size\"
    },
    \"address\": {
        \"0\": \"example1\",
        \"1\": \"example2\",
        \"street\": \"Example Address street\",
        \"number\": \"Example Address number\",
        \"complement\": \"Example Address complement\",
        \"neighborhood\": \"Example Address neighborhood\",
        \"city\": \"Example Address city\",
        \"state\": \"Example Address state\",
        \"zip_code\": \"Example Address zip code\"
    }
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/suppliers"
);

const headers = {
    "Authorization": "Bearer kdZ1v6gfVcEP3haD68eb4a5",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "email": "user@example.com",
    "phone": "(11) 99999-9999",
    "document": "Example Document",
    "type": "Example Type",
    "responsible": "Example Responsible",
    "image": {
        "0": "example1",
        "1": "example2",
        "path": "Example Image path",
        "name": "Example Name",
        "extension": "Example Image extension",
        "size": "Example Image size"
    },
    "address": {
        "0": "example1",
        "1": "example2",
        "street": "Example Address street",
        "number": "Example Address number",
        "complement": "Example Address complement",
        "neighborhood": "Example Address neighborhood",
        "city": "Example Address city",
        "state": "Example Address state",
        "zip_code": "Example Address zip code"
    }
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "string"
}
 

Request      

POST api/suppliers

Headers

Authorization        

Example: Bearer kdZ1v6gfVcEP3haD68eb4a5

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Nome. Example: Example Name

email   string  optional    

E-mail. O campo value deve ser um endereço de e-mail válido. Example: user@example.com

phone   string  optional    

Telefone. Example: (11) 99999-9999

document   string     

CPF/CNPJ. Example: Example Document

type   string     

Tipo. Example: Example Type

Must be one of:
  • pf
  • pj
responsible   string  optional    

Responsável. Example: Example Responsible

image   object  optional    

Imagem.

path   string  optional    

Caminho da imagem. This field is required when image is present. Example: Example Image path

name   string  optional    

Nome da imagem. Example: Example Name

extension   string  optional    

Extensão da imagem. Example: Example Image extension

size   string  optional    

Tamanho da imagem. Example: Example Image size

address   object  optional    

Endereço.

street   string     

Rua. Example: Example Address street

number   string     

Número. Example: Example Address number

complement   string  optional    

Complemento. Example: Example Address complement

neighborhood   string     

Bairro. Example: Example Address neighborhood

city   string     

Cidade. Example: Example Address city

state   string     

Estado. Example: Example Address state

zip_code   string     

CEP. Example: Example Address zip code

Get supplier

requires authentication suppliers show

Get a supplier

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/suppliers/1" \
    --header "Authorization: Bearer da6P4h8Vfc53gk6bvaEZ1eD" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/suppliers/1"
);

const headers = {
    "Authorization": "Bearer da6P4h8Vfc53gk6bvaEZ1eD",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "d3361636-fcce-3f64-8d22-71d72759625d",
        "name": "Srta. Jasmin Barros Alves",
        "email": "janaina90@example.org",
        "phone": "(43) 90734-0268",
        "document": "24.420.752/0001-70",
        "type": "pj",
        "responsible": "Gilberto Sergio Brito",
        "image": {
            "id": null,
            "url": null
        },
        "address": {
            "street": null,
            "number": null,
            "complement": null,
            "neighborhood": null,
            "city": null,
            "state": null,
            "zip_code": null
        }
    }
}
 

Request      

GET api/suppliers/{id}

Headers

Authorization        

Example: Bearer da6P4h8Vfc53gk6bvaEZ1eD

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the supplier. Example: 1

supplier   string     

Supplier ID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Update supplier

requires authentication suppliers update

Update a supplier

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/suppliers/1" \
    --header "Authorization: Bearer DkEP3e4Z6d618Vcaf5bghav" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"email\": \"user@example.com\",
    \"phone\": \"(11) 99999-9999\",
    \"document\": \"Example Document\",
    \"type\": \"Example Type\",
    \"responsible\": \"Example Responsible\",
    \"image\": {
        \"0\": \"example1\",
        \"1\": \"example2\",
        \"path\": \"Example Image path\",
        \"name\": \"Example Name\",
        \"extension\": \"Example Image extension\",
        \"size\": \"Example Image size\"
    },
    \"address\": {
        \"0\": \"example1\",
        \"1\": \"example2\",
        \"street\": \"Example Address street\",
        \"number\": \"Example Address number\",
        \"complement\": \"Example Address complement\",
        \"neighborhood\": \"Example Address neighborhood\",
        \"city\": \"Example Address city\",
        \"state\": \"Example Address state\",
        \"zip_code\": \"Example Address zip code\"
    }
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/suppliers/1"
);

const headers = {
    "Authorization": "Bearer DkEP3e4Z6d618Vcaf5bghav",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "email": "user@example.com",
    "phone": "(11) 99999-9999",
    "document": "Example Document",
    "type": "Example Type",
    "responsible": "Example Responsible",
    "image": {
        "0": "example1",
        "1": "example2",
        "path": "Example Image path",
        "name": "Example Name",
        "extension": "Example Image extension",
        "size": "Example Image size"
    },
    "address": {
        "0": "example1",
        "1": "example2",
        "street": "Example Address street",
        "number": "Example Address number",
        "complement": "Example Address complement",
        "neighborhood": "Example Address neighborhood",
        "city": "Example Address city",
        "state": "Example Address state",
        "zip_code": "Example Address zip code"
    }
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "string"
}
 

Request      

PUT api/suppliers/{id}

Headers

Authorization        

Example: Bearer DkEP3e4Z6d618Vcaf5bghav

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the supplier. Example: 1

supplier   string     

Supplier ID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Body Parameters

name   string  optional    

Nome. Example: Example Name

email   string  optional    

E-mail. O campo value deve ser um endereço de e-mail válido. Example: user@example.com

phone   string  optional    

Telefone. Example: (11) 99999-9999

document   string  optional    

CPF/CNPJ. Example: Example Document

type   string  optional    

Tipo. Example: Example Type

Must be one of:
  • pf
  • pj
responsible   string  optional    

Responsável. Example: Example Responsible

image   object  optional    

Imagem.

path   string  optional    

Caminho da imagem. This field is required when image is present. Example: Example Image path

name   string  optional    

Nome da imagem. Example: Example Name

extension   string  optional    

Extensão da imagem. Example: Example Image extension

size   string  optional    

Tamanho da imagem. Example: Example Image size

address   object  optional    

Endereço.

street   string  optional    

Rua. Example: Example Address street

number   string  optional    

Número. Example: Example Address number

complement   string  optional    

Complemento. Example: Example Address complement

neighborhood   string  optional    

Bairro. Example: Example Address neighborhood

city   string  optional    

Cidade. Example: Example Address city

state   string  optional    

Estado. Example: Example Address state

zip_code   string  optional    

CEP. Example: Example Address zip code

Delete supplier

requires authentication suppliers delete

Delete a supplier

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/suppliers/019556e7-2e9f-777c-a177-30bbf0646c32" \
    --header "Authorization: Bearer Zavh34EgDk68f1bea5cP6dV" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/suppliers/019556e7-2e9f-777c-a177-30bbf0646c32"
);

const headers = {
    "Authorization": "Bearer Zavh34EgDk68f1bea5cP6dV",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/suppliers/{supplier}

Headers

Authorization        

Example: Bearer Zavh34EgDk68f1bea5cP6dV

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

supplier   string     

Supplier ID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

System Types

Endpoints for system types

System Types

requires authentication No specific permission required

Get the system types

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/system-types" \
    --header "Authorization: Bearer Pa65kg1chdE4eDVv386Zabf" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/system-types"
);

const headers = {
    "Authorization": "Bearer Pa65kg1chdE4eDVv386Zabf",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "bankAccountTypes": {
            "key": "value"
        },
        "fileTypes": {
            "key": "value"
        },
        "legalEntityTypes": {
            "key": "value"
        },
        "transactionTypes": {
            "key": "value"
        }
    }
}
 

Request      

GET api/system-types

Headers

Authorization        

Example: Bearer Pa65kg1chdE4eDVv386Zabf

Content-Type        

Example: application/json

Accept        

Example: application/json

Transaction Categories

Endpoints for transaction categories

List transaction categories

requires authentication transaction-category index

List all transaction categories

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/transaction-categories?sort_by=created_at&sort_desc=1&page=1&per_page=15&q=Salary&type=entrada" \
    --header "Authorization: Bearer VdP68fabg4ekZvE15ah63Dc" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/transaction-categories"
);

const params = {
    "sort_by": "created_at",
    "sort_desc": "1",
    "page": "1",
    "per_page": "15",
    "q": "Salary",
    "type": "entrada",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer VdP68fabg4ekZvE15ah63Dc",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "76bab2f4-359b-3ff0-b3e3-438d3f5c60bb",
            "name": "Dr. Luna Reis Filho",
            "description": "Quibusdam illo qui dicta sit. Unde ut voluptates dolorum ut. Nihil et necessitatibus nihil error dolor deserunt ex. Labore incidunt qui porro quo ut.",
            "type": "ajuste saída"
        },
        {
            "id": "fe3429b3-dff1-32ed-90d6-d2c67fa130a9",
            "name": "Afonso Neves Pacheco",
            "description": "Omnis aliquam corrupti incidunt cum quia similique rerum. Doloribus laborum aut placeat asperiores dignissimos suscipit. Consequuntur ipsum animi dolore ipsa.",
            "type": "juros"
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/transaction-categories

Headers

Authorization        

Example: Bearer VdP68fabg4ekZvE15ah63Dc

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

sort_by   string  optional    

Field to sort by. Example: created_at

sort_desc   boolean  optional    

Sort order (true for descending, false for ascending). Example: true

page   integer  optional    

Page number for pagination. O campo value deve ser pelo menos 1. Example: 1

per_page   integer  optional    

Number of items per page (max: 100). O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 15

q   string  optional    

Search query. Example: Salary

type   string  optional    

Transaction type. Example: entrada

Must be one of:
  • entrada
  • saída
  • tarifa
  • depósito
  • saque
  • transferência
  • pagamento
  • juros
  • ajuste
  • ajuste saída

Show transaction category

requires authentication transaction-category show

Show a transaction category

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/transaction-categories/odit" \
    --header "Authorization: Bearer hafZ8DbvVkEe64g36ad5cP1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/transaction-categories/odit"
);

const headers = {
    "Authorization": "Bearer hafZ8DbvVkEe64g36ad5cP1",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "98ac831d-42ee-382e-81d7-be317d57f1ab",
        "name": "Srta. Michele Balestero Sobrinho",
        "description": "Est est amet in quia sed. Alias quia iste nam enim dolorum odit molestiae. Eius assumenda officia accusantium reprehenderit doloremque beatae. Iure quo ut et consequatur magni.",
        "type": "ajuste saída"
    }
}
 

Request      

GET api/transaction-categories/{transactionCategory}

Headers

Authorization        

Example: Bearer hafZ8DbvVkEe64g36ad5cP1

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

transactionCategory   string     

Transaction category UUID Example: odit

Create transaction category

requires authentication transaction-category store

Create a new transaction category

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/transaction-categories" \
    --header "Authorization: Bearer hZ6kDb4d5V8E1aefPagc3v6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"description\": \"Example Description\",
    \"type\": \"Example Type\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/transaction-categories"
);

const headers = {
    "Authorization": "Bearer hZ6kDb4d5V8E1aefPagc3v6",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "description": "Example Description",
    "type": "Example Type"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "string"
}
 

Request      

POST api/transaction-categories

Headers

Authorization        

Example: Bearer hZ6kDb4d5V8E1aefPagc3v6

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Name. Example: Example Name

description   string  optional    

Description. Example: Example Description

type   string     

Type. Example: Example Type

Must be one of:
  • entrada
  • saída
  • tarifa
  • depósito
  • saque
  • transferência
  • pagamento
  • juros
  • ajuste
  • ajuste saída

Update transaction category

requires authentication transaction-category update

Update a transaction category

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/transaction-categories/vero" \
    --header "Authorization: Bearer aE5h6bkP3Z6vdV8De1afcg4" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"description\": \"Example Description\",
    \"type\": \"Example Type\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/transaction-categories/vero"
);

const headers = {
    "Authorization": "Bearer aE5h6bkP3Z6vdV8De1afcg4",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "description": "Example Description",
    "type": "Example Type"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "string"
}
 

Request      

PUT api/transaction-categories/{transactionCategory}

Headers

Authorization        

Example: Bearer aE5h6bkP3Z6vdV8De1afcg4

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

transactionCategory   string     

Transaction category UUID Example: vero

Body Parameters

name   string     

Name. Example: Example Name

description   string  optional    

Description. Example: Example Description

type   string     

Type. Example: Example Type

Must be one of:
  • entrada
  • saída
  • tarifa
  • depósito
  • saque
  • transferência
  • pagamento
  • juros
  • ajuste
  • ajuste saída

Delete transaction category

requires authentication transaction-category delete

Delete a transaction category

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/transaction-categories/ipsam" \
    --header "Authorization: Bearer Dk6E5ePaZgvdh3cb4681fVa" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/transaction-categories/ipsam"
);

const headers = {
    "Authorization": "Bearer Dk6E5ePaZgvdh3cb4681fVa",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/transaction-categories/{transactionCategory}

Headers

Authorization        

Example: Bearer Dk6E5ePaZgvdh3cb4681fVa

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

transactionCategory   string     

Transaction category UUID Example: ipsam

Tutoriais (administração)

Cadastro do catálogo de módulos da Central de Tutoriais

Listar módulos

requires authentication tutorials index

Lista o catálogo de módulos de tutorial

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/admin/tutorial-modules?sort_by=created_at&sort_desc=1&page=1&per_page=15&q=Financeiro&is_active=1" \
    --header "Authorization: Bearer vfabeDaEVk1d6g64ch853PZ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/admin/tutorial-modules"
);

const params = {
    "sort_by": "created_at",
    "sort_desc": "1",
    "page": "1",
    "per_page": "15",
    "q": "Financeiro",
    "is_active": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer vfabeDaEVk1d6g64ch853PZ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "42529351-a360-34ec-b230-9fde3833764c",
            "name": "Magni aut",
            "slug": "magni-aut-581852",
            "description": "Culpa cumque quas expedita architecto.",
            "sort_order": 0,
            "is_active": true,
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "02158591-f2ed-3b61-aec3-18a1afe1ce6e",
            "name": "Dignissimos qui",
            "slug": "dignissimos-qui-115218",
            "description": "Sint recusandae et ut animi autem.",
            "sort_order": 0,
            "is_active": true,
            "created_at": null,
            "updated_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/admin/tutorial-modules

Headers

Authorization        

Example: Bearer vfabeDaEVk1d6g64ch853PZ

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

sort_by   string  optional    

Field to sort by. Example: created_at

sort_desc   boolean  optional    

Sort order (true for descending, false for ascending). Example: true

page   integer  optional    

Page number for pagination. O campo value deve ser pelo menos 1. Example: 1

per_page   integer  optional    

Number of items per page (max: 100). O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 15

q   string  optional    

Busca por nome ou descrição. Example: Financeiro

is_active   boolean  optional    

Filtra por módulos ativos ou inativos. Example: true

Cadastrar módulo

requires authentication tutorials store

Cria um módulo no catálogo. O slug é derivado do nome quando não informado.

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/admin/tutorial-modules" \
    --header "Authorization: Bearer 6ag8Pk6EcvDh51a43dVfebZ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"slug\": \"Example Slug\",
    \"description\": \"Example Description\",
    \"sort_order\": 1,
    \"is_active\": true
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/admin/tutorial-modules"
);

const headers = {
    "Authorization": "Bearer 6ag8Pk6EcvDh51a43dVfebZ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "slug": "Example Slug",
    "description": "Example Description",
    "sort_order": 1,
    "is_active": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "data": {
        "id": "3ee9f484-c91e-353c-ad6c-cfa442f37e57",
        "name": "Aspernatur voluptatem",
        "slug": "aspernatur-voluptatem-697242",
        "description": "Deleniti voluptas qui magnam fuga.",
        "sort_order": 0,
        "is_active": true,
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

POST api/admin/tutorial-modules

Headers

Authorization        

Example: Bearer 6ag8Pk6EcvDh51a43dVfebZ

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Nome. O campo value não pode ser superior a 255 caracteres. Example: Example Name

slug   string  optional    

Identificador. O campo value não pode ser superior a 255 caracteres. Example: Example Slug

description   string  optional    

Descrição. Example: Example Description

sort_order   integer  optional    

Ordem. O campo value deve ser pelo menos 0. Example: 1

is_active   boolean  optional    

Ativo. Example: true

Visualizar módulo

requires authentication tutorials index

Detalhe de um módulo do catálogo

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/admin/tutorial-modules/019556e7-2e9f-777c-a177-30bbf0646c32" \
    --header "Authorization: Bearer 586Evc6Ze1bkaagDVf4dP3h" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/admin/tutorial-modules/019556e7-2e9f-777c-a177-30bbf0646c32"
);

const headers = {
    "Authorization": "Bearer 586Evc6Ze1bkaagDVf4dP3h",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "1e5daa17-811f-3551-86ad-e0cae39772cc",
        "name": "Est sequi",
        "slug": "est-sequi-835378",
        "description": "Esse mollitia fugiat culpa consequatur.",
        "sort_order": 0,
        "is_active": true,
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/admin/tutorial-modules/{tutorialModule}

Headers

Authorization        

Example: Bearer 586Evc6Ze1bkaagDVf4dP3h

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

tutorialModule   string     

UUID do módulo Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Atualizar módulo

requires authentication tutorials update

Atualiza um módulo do catálogo

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/admin/tutorial-modules/019556e7-2e9f-777c-a177-30bbf0646c32" \
    --header "Authorization: Bearer E5a6VkPb6aZh1cvdeg84D3f" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"slug\": \"Example Slug\",
    \"description\": \"Example Description\",
    \"sort_order\": 1,
    \"is_active\": true
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/admin/tutorial-modules/019556e7-2e9f-777c-a177-30bbf0646c32"
);

const headers = {
    "Authorization": "Bearer E5a6VkPb6aZh1cvdeg84D3f",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "slug": "Example Slug",
    "description": "Example Description",
    "sort_order": 1,
    "is_active": true
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "83321d83-bbf7-3191-8ecd-ba7faf7f20f8",
        "name": "Dolorem nobis",
        "slug": "dolorem-nobis-604949",
        "description": "Molestias maiores et nemo.",
        "sort_order": 0,
        "is_active": true,
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

PUT api/admin/tutorial-modules/{tutorialModule}

Headers

Authorization        

Example: Bearer E5a6VkPb6aZh1cvdeg84D3f

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

tutorialModule   string     

UUID do módulo Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Body Parameters

name   string  optional    

Nome. O campo value não pode ser superior a 255 caracteres. Example: Example Name

slug   string  optional    

Identificador. O campo value não pode ser superior a 255 caracteres. Example: Example Slug

description   string  optional    

Descrição. Example: Example Description

sort_order   integer  optional    

Ordem. O campo value deve ser pelo menos 0. Example: 1

is_active   boolean  optional    

Ativo. Example: true

Remover módulo

requires authentication tutorials destroy

Remove o módulo e, junto, os tutoriais que pertenciam a ele

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/admin/tutorial-modules/019556e7-2e9f-777c-a177-30bbf0646c32" \
    --header "Authorization: Bearer 8vdhV5a4EfcPa3gDb61Zke6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/admin/tutorial-modules/019556e7-2e9f-777c-a177-30bbf0646c32"
);

const headers = {
    "Authorization": "Bearer 8vdhV5a4EfcPa3gDb61Zke6",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/admin/tutorial-modules/{tutorialModule}

Headers

Authorization        

Example: Bearer 8vdhV5a4EfcPa3gDb61Zke6

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

tutorialModule   string     

UUID do módulo Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Listar tutoriais

requires authentication tutorials index

Lista os tutoriais em qualquer status, para quem administra

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/admin/tutorials?sort_by=created_at&sort_desc=1&page=1&per_page=15&q=ordem+de+servi%C3%A7o&module_id=f9f6fc72-e576-3221-abbf-e8bfea168f50&sector_id=878269ea-afb5-3991-861a-9d3d24dab523&status=published" \
    --header "Authorization: Bearer Zd6evaVPg6D1bcf3Ekh4a58" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/admin/tutorials"
);

const params = {
    "sort_by": "created_at",
    "sort_desc": "1",
    "page": "1",
    "per_page": "15",
    "q": "ordem de serviço",
    "module_id": "f9f6fc72-e576-3221-abbf-e8bfea168f50",
    "sector_id": "878269ea-afb5-3991-861a-9d3d24dab523",
    "status": "published",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer Zd6evaVPg6D1bcf3Ekh4a58",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "2908c1a0-054f-3bfb-9a9d-ccaffa242423",
            "title": "Qui earum voluptas dolorem",
            "description": "Sint quo id corporis aut dolor a.",
            "status": "draft",
            "published_at": null,
            "sort_order": 0,
            "module": {
                "id": "a32930de-14dd-4c15-8ff7-7582a6128d89",
                "name": "Autem accusamus",
                "slug": "autem-accusamus-768268"
            },
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "01108e24-620a-3157-b4d5-6d3e292faff3",
            "title": "Sapiente facere dolor et",
            "description": "Aperiam rerum rem sed dolor numquam velit.",
            "status": "draft",
            "published_at": null,
            "sort_order": 0,
            "module": {
                "id": "a32930de-17fc-4de4-8447-a4416eb999e2",
                "name": "Temporibus voluptas",
                "slug": "temporibus-voluptas-679416"
            },
            "created_at": null,
            "updated_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/admin/tutorials

Headers

Authorization        

Example: Bearer Zd6evaVPg6D1bcf3Ekh4a58

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

sort_by   string  optional    

Field to sort by. Example: created_at

sort_desc   boolean  optional    

Sort order (true for descending, false for ascending). Example: true

page   integer  optional    

Page number for pagination. O campo value deve ser pelo menos 1. Example: 1

per_page   integer  optional    

Number of items per page (max: 100). O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 15

q   string  optional    

Busca por título ou descrição. Example: ordem de serviço

module_id   string  optional    

Filtra pelo UUID do módulo. O campo value deve ser um UUID válido. The uuid of an existing record in the tutorial_modules table. Example: f9f6fc72-e576-3221-abbf-e8bfea168f50

sector_id   string  optional    

Filtra pelo UUID do setor vinculado. O campo value deve ser um UUID válido. The uuid of an existing record in the sectors table. Example: 878269ea-afb5-3991-861a-9d3d24dab523

status   string  optional    

Filtra por status (draft ou published). Example: published

Must be one of:
  • draft
  • published

Cadastrar tutorial

requires authentication tutorials store

Cria um tutorial. Nasce como rascunho e só aparece na central depois de publicado.

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/admin/tutorials" \
    --header "Authorization: Bearer gPbca4aD1d3Z8Eh6vk65efV" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"module_id\": \"182e87c1-6202-30f6-8d92-c977b5161496\",
    \"title\": \"Example Title\",
    \"description\": \"Example Description\",
    \"cover_path\": \"Example Cover path\",
    \"sort_order\": 1,
    \"sectors\": [
        \"38008cbb-bf77-3797-ac86-591f1a372da7\"
    ],
    \"permissions\": [
        \"7c40c333-3fc6-3ddf-b02f-6e84345e4cda\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/admin/tutorials"
);

const headers = {
    "Authorization": "Bearer gPbca4aD1d3Z8Eh6vk65efV",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "module_id": "182e87c1-6202-30f6-8d92-c977b5161496",
    "title": "Example Title",
    "description": "Example Description",
    "cover_path": "Example Cover path",
    "sort_order": 1,
    "sectors": [
        "38008cbb-bf77-3797-ac86-591f1a372da7"
    ],
    "permissions": [
        "7c40c333-3fc6-3ddf-b02f-6e84345e4cda"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "data": {
        "id": "dbb6a89e-ba60-32b3-8696-20b378c03fb4",
        "title": "Necessitatibus voluptatem nesciunt ut",
        "description": "Itaque facere soluta ut aliquid aliquid neque nesciunt.",
        "status": "draft",
        "published_at": null,
        "sort_order": 0,
        "module": {
            "id": "a32930de-2149-475c-9c6a-a4a772f896b4",
            "name": "Sed eos",
            "slug": "sed-eos-535499"
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

POST api/admin/tutorials

Headers

Authorization        

Example: Bearer gPbca4aD1d3Z8Eh6vk65efV

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

module_id   string     

Módulo. O campo value deve ser um UUID válido. The uuid of an existing record in the tutorial_modules table. Example: 182e87c1-6202-30f6-8d92-c977b5161496

title   string     

Título. O campo value não pode ser superior a 255 caracteres. Example: Example Title

description   string  optional    

Descrição. Example: Example Description

cover_path   string  optional    

Capa. Must start with one of tutorials/. Example: Example Cover path

sort_order   integer  optional    

Ordem. O campo value deve ser pelo menos 0. Example: 1

sectors   string[]  optional    

Setor. O campo value deve ser um UUID válido. The uuid of an existing record in the sectors table.

permissions   string[]  optional    

Permissão. The name of an existing record in the permissions table.

Gerar URL de upload

requires authentication tutorials store

Devolve uma URL assinada de curta validade para o cliente enviar o arquivo direto ao S3. O arquivo só é conferido depois, ao criar o item ou salvar a capa.

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/admin/tutorials/upload-url" \
    --header "Authorization: Bearer E4Vdb685e1ZacfPva36ghkD" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"kind\": \"Example Kind\",
    \"filename\": \"Example Name\",
    \"extension\": \"Example Extension\",
    \"size_bytes\": 1
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/admin/tutorials/upload-url"
);

const headers = {
    "Authorization": "Bearer E4Vdb685e1ZacfPva36ghkD",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "kind": "Example Kind",
    "filename": "Example Name",
    "extension": "Example Extension",
    "size_bytes": 1
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "url": "string",
    "headers": "array",
    "path": "string",
    "expires_in": "integer"
}
 

Request      

POST api/admin/tutorials/upload-url

Headers

Authorization        

Example: Bearer E4Vdb685e1ZacfPva36ghkD

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

kind   string     

Tipo de arquivo. Example: Example Kind

Must be one of:
  • pdf
  • video
  • cover
filename   string     

Nome do arquivo. O campo value não pode ser superior a 255 caracteres. Example: Example Name

extension   string     

Extensão do arquivo. Example: Example Extension

Must be one of:
size_bytes   integer     

Tamanho do arquivo. O campo value deve ser pelo menos 1. O campo value não pode ser superior a 0. Example: 1

Visualizar tutorial

requires authentication tutorials index

Detalhe do tutorial com vínculos e itens

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/admin/tutorials/1" \
    --header "Authorization: Bearer bhvgDdPkV3cfZa564Ee16a8" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/admin/tutorials/1"
);

const headers = {
    "Authorization": "Bearer bhvgDdPkV3cfZa564Ee16a8",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "edb45954-2015-3646-a549-15fb35cfc246",
        "title": "Atque consequatur omnis perspiciatis",
        "description": "Et beatae eligendi aut ea debitis aspernatur repellat iste.",
        "status": "draft",
        "published_at": null,
        "sort_order": 0,
        "module": {
            "id": "a32930de-2b3c-4376-b5e3-d5556434179a",
            "name": "Distinctio sint",
            "slug": "distinctio-sint-85327"
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/admin/tutorials/{id}

Headers

Authorization        

Example: Bearer bhvgDdPkV3cfZa564Ee16a8

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the tutorial. Example: 1

tutorial   string     

UUID do tutorial Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Atualizar tutorial

requires authentication tutorials update

Atualiza o tutorial e os vínculos de setor e permissão

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/admin/tutorials/1" \
    --header "Authorization: Bearer e81vcPZkfdgDh56E64a3Vab" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"module_id\": \"19910eaf-8e39-3c10-9bab-bd6b019b0791\",
    \"title\": \"Example Title\",
    \"description\": \"Example Description\",
    \"cover_path\": \"Example Cover path\",
    \"sort_order\": 1,
    \"sectors\": [
        \"7ffb96f3-02ff-3f2d-a5e0-072414a3cb88\"
    ],
    \"permissions\": [
        \"f45f8127-6a9c-3398-b1b6-be4cf597e7f2\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/admin/tutorials/1"
);

const headers = {
    "Authorization": "Bearer e81vcPZkfdgDh56E64a3Vab",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "module_id": "19910eaf-8e39-3c10-9bab-bd6b019b0791",
    "title": "Example Title",
    "description": "Example Description",
    "cover_path": "Example Cover path",
    "sort_order": 1,
    "sectors": [
        "7ffb96f3-02ff-3f2d-a5e0-072414a3cb88"
    ],
    "permissions": [
        "f45f8127-6a9c-3398-b1b6-be4cf597e7f2"
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "3141b8a9-3d43-3d8b-a836-004ab3cc6d53",
        "title": "Sint voluptatibus ipsum quasi",
        "description": "Voluptatem iusto et dolor dolorem voluptas accusantium nulla.",
        "status": "draft",
        "published_at": null,
        "sort_order": 0,
        "module": {
            "id": "a32930de-342c-4d99-8c82-0c6042b46625",
            "name": "Consectetur et",
            "slug": "consectetur-et-612707"
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

PUT api/admin/tutorials/{id}

Headers

Authorization        

Example: Bearer e81vcPZkfdgDh56E64a3Vab

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the tutorial. Example: 1

tutorial   string     

UUID do tutorial Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Body Parameters

module_id   string  optional    

Módulo. O campo value deve ser um UUID válido. The uuid of an existing record in the tutorial_modules table. Example: 19910eaf-8e39-3c10-9bab-bd6b019b0791

title   string  optional    

Título. O campo value não pode ser superior a 255 caracteres. Example: Example Title

description   string  optional    

Descrição. Example: Example Description

cover_path   string  optional    

Capa. Must start with one of tutorials/. Example: Example Cover path

sort_order   integer  optional    

Ordem. O campo value deve ser pelo menos 0. Example: 1

sectors   string[]  optional    

Setor. O campo value deve ser um UUID válido. The uuid of an existing record in the sectors table.

permissions   string[]  optional    

Permissão. The name of an existing record in the permissions table.

Remover tutorial

requires authentication tutorials destroy

Remove o tutorial, os itens e os arquivos correspondentes no S3

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/admin/tutorials/1" \
    --header "Authorization: Bearer 5bv66D1P4kgaeEcadh8fV3Z" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/admin/tutorials/1"
);

const headers = {
    "Authorization": "Bearer 5bv66D1P4kgaeEcadh8fV3Z",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/admin/tutorials/{id}

Headers

Authorization        

Example: Bearer 5bv66D1P4kgaeEcadh8fV3Z

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the tutorial. Example: 1

tutorial   string     

UUID do tutorial Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Publicar tutorial

requires authentication tutorials update

Publica o tutorial e carimba a data de publicação

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/admin/tutorials/019556e7-2e9f-777c-a177-30bbf0646c32/publish" \
    --header "Authorization: Bearer e4agkD83bh1dc6P65afvZVE" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/admin/tutorials/019556e7-2e9f-777c-a177-30bbf0646c32/publish"
);

const headers = {
    "Authorization": "Bearer e4agkD83bh1dc6P65afvZVE",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "a7a6d1b8-98db-37d0-8a97-9703d6acfb2d",
        "title": "Perferendis quia repudiandae atque",
        "description": "Quas natus iure dolorum.",
        "status": "draft",
        "published_at": null,
        "sort_order": 0,
        "module": {
            "id": "a32930de-3cef-4eec-9a68-5c60f306de51",
            "name": "Ullam perferendis",
            "slug": "ullam-perferendis-883514"
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

POST api/admin/tutorials/{tutorial}/publish

Headers

Authorization        

Example: Bearer e4agkD83bh1dc6P65afvZVE

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

tutorial   string     

UUID do tutorial Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Despublicar tutorial

requires authentication tutorials update

Devolve o tutorial ao rascunho e limpa a data de publicação

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/admin/tutorials/019556e7-2e9f-777c-a177-30bbf0646c32/unpublish" \
    --header "Authorization: Bearer c6vaDgfkVbZh4P56Eae38d1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/admin/tutorials/019556e7-2e9f-777c-a177-30bbf0646c32/unpublish"
);

const headers = {
    "Authorization": "Bearer c6vaDgfkVbZh4P56Eae38d1",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "3a1398e6-bbd0-37ba-b294-474e25ecb8d8",
        "title": "Qui aut perspiciatis at",
        "description": "Autem sunt vero maxime nam amet.",
        "status": "draft",
        "published_at": null,
        "sort_order": 0,
        "module": {
            "id": "a32930de-4338-4910-9e87-e45a616eab55",
            "name": "Beatae repudiandae",
            "slug": "beatae-repudiandae-578180"
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

POST api/admin/tutorials/{tutorial}/unpublish

Headers

Authorization        

Example: Bearer c6vaDgfkVbZh4P56Eae38d1

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

tutorial   string     

UUID do tutorial Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Adicionar item ao tutorial

requires authentication tutorials store

Cria o item a partir de um arquivo já enviado ao S3 (pdf ou video) ou de um link do YouTube/Vimeo. O arquivo é conferido aqui: existência, tamanho real e assinatura do conteúdo.

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/admin/tutorials/1/items" \
    --header "Authorization: Bearer 6e5gEfkvZ41dchba8DV6Pa3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"type\": \"Example Type\",
    \"title\": \"Example Title\",
    \"file_path\": \"Example File path\",
    \"external_url\": \"https:\\/\\/example.com\",
    \"duration_seconds\": 1,
    \"sort_order\": 1
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/admin/tutorials/1/items"
);

const headers = {
    "Authorization": "Bearer 6e5gEfkvZ41dchba8DV6Pa3",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "type": "Example Type",
    "title": "Example Title",
    "file_path": "Example File path",
    "external_url": "https:\/\/example.com",
    "duration_seconds": 1,
    "sort_order": 1
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "data": {
        "id": "8a926e48-b824-35fb-be8e-759758823f95",
        "type": "pdf",
        "title": "Possimus reiciendis dolores",
        "mime_type": "application/pdf",
        "size_bytes": 3310142,
        "duration_seconds": null,
        "sort_order": 0,
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

POST api/admin/tutorials/{tutorial_id}/items

Headers

Authorization        

Example: Bearer 6e5gEfkvZ41dchba8DV6Pa3

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

tutorial_id   integer     

The ID of the tutorial. Example: 1

tutorial   string     

UUID do tutorial Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Body Parameters

type   string     

Tipo. Example: Example Type

Must be one of:
  • pdf
  • video
  • link
title   string     

Título. O campo value não pode ser superior a 255 caracteres. Example: Example Title

file_path   string     

Caminho do arquivo. Must start with one of tutorials/. Example: Example File path

external_url   string  optional    

Link externo. Example: https://example.com

duration_seconds   integer  optional    

Duração em segundos. O campo value deve ser pelo menos 0. Example: 1

sort_order   integer  optional    

Ordem. O campo value deve ser pelo menos 0. Example: 1

Reordenar itens

requires authentication tutorials update

Grava a ordem dos itens conforme a sequência de UUIDs enviada

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/admin/tutorials/019556e7-2e9f-777c-a177-30bbf0646c32/items/reorder" \
    --header "Authorization: Bearer 5VD68kEhabZ4Pdcegf1a36v" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"items\": [
        \"d448a98e-3958-3451-97f1-9c8662460805\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/admin/tutorials/019556e7-2e9f-777c-a177-30bbf0646c32/items/reorder"
);

const headers = {
    "Authorization": "Bearer 5VD68kEhabZ4Pdcegf1a36v",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "items": [
        "d448a98e-3958-3451-97f1-9c8662460805"
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Itens reordenados com sucesso"
}
 

Request      

PUT api/admin/tutorials/{tutorial}/items/reorder

Headers

Authorization        

Example: Bearer 5VD68kEhabZ4Pdcegf1a36v

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

tutorial   string     

UUID do tutorial Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Body Parameters

items   string[]     

Item. O campo value deve ser um UUID válido. The uuid of an existing record in the tutorial_items table.

Atualizar item

requires authentication tutorials update

Atualiza o item. O tipo não muda depois de criado.

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/admin/tutorial-items/019556e7-2e9f-777c-a177-30bbf0646c32" \
    --header "Authorization: Bearer 5gcDbP4v86h3k6Z1EaVfdea" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"title\": \"Example Title\",
    \"file_path\": \"Example File path\",
    \"external_url\": \"https:\\/\\/example.com\",
    \"duration_seconds\": 1,
    \"sort_order\": 1
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/admin/tutorial-items/019556e7-2e9f-777c-a177-30bbf0646c32"
);

const headers = {
    "Authorization": "Bearer 5gcDbP4v86h3k6Z1EaVfdea",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "title": "Example Title",
    "file_path": "Example File path",
    "external_url": "https:\/\/example.com",
    "duration_seconds": 1,
    "sort_order": 1
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "8571f4c9-50ec-3434-833d-626542cadfe5",
        "type": "pdf",
        "title": "Et rerum consequatur",
        "mime_type": "application/pdf",
        "size_bytes": 4919339,
        "duration_seconds": null,
        "sort_order": 0,
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

PUT api/admin/tutorial-items/{tutorialItem}

Headers

Authorization        

Example: Bearer 5gcDbP4v86h3k6Z1EaVfdea

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

tutorialItem   string     

UUID do item Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Body Parameters

title   string  optional    

Título. O campo value não pode ser superior a 255 caracteres. Example: Example Title

file_path   string  optional    

Caminho do arquivo. Must start with one of tutorials/. Example: Example File path

external_url   string  optional    

Link externo. O campo value não pode ser superior a 2048 caracteres. Example: https://example.com

duration_seconds   integer  optional    

Duração em segundos. O campo value deve ser pelo menos 0. Example: 1

sort_order   integer  optional    

Ordem. O campo value deve ser pelo menos 0. Example: 1

Remover item

requires authentication tutorials destroy

Remove o item e apaga o arquivo correspondente no S3

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/admin/tutorial-items/019556e7-2e9f-777c-a177-30bbf0646c32" \
    --header "Authorization: Bearer b85VcD63deEgfaP1v4ak6hZ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/admin/tutorial-items/019556e7-2e9f-777c-a177-30bbf0646c32"
);

const headers = {
    "Authorization": "Bearer b85VcD63deEgfaP1v4ak6hZ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/admin/tutorial-items/{tutorialItem}

Headers

Authorization        

Example: Bearer b85VcD63deEgfaP1v4ak6hZ

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

tutorialItem   string     

UUID do item Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Units

Endpoints for units

List units

requires authentication unit index

List all units

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/units?q=Structure" \
    --header "Authorization: Bearer e1E3ZbDaav8h6gdk5VPc6f4" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/units"
);

const params = {
    "q": "Structure",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer e1E3ZbDaav8h6gdk5VPc6f4",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "8e99b3a3-e949-3deb-9178-2e6394891999",
            "name": "Sr. Artur Erik Campos",
            "abbreviation": "George Adriano Pontes",
            "description": "Veritatis et cum alias.",
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "3e5fc350-e599-3427-b341-00fe3f8abe7d",
            "name": "Dr. Mário Burgos Sobrinho",
            "abbreviation": "Srta. Vanessa Manoela Paes Sobrinho",
            "description": "Animi ut impedit ut id error.",
            "created_at": null,
            "updated_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/units

Headers

Authorization        

Example: Bearer e1E3ZbDaav8h6gdk5VPc6f4

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

q   string  optional    

Example: Structure

Show unit

requires authentication unit show

Show a unit

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/units/1" \
    --header "Authorization: Bearer ghedvfka6ac8P13E65Z4bVD" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/units/1"
);

const headers = {
    "Authorization": "Bearer ghedvfka6ac8P13E65Z4bVD",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "ccebb9f0-6ac2-30b9-a470-095d6bd53267",
        "name": "Eduarda Cruz",
        "abbreviation": "Juan Delgado",
        "description": "Dicta qui ipsa quaerat.",
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/units/{id}

Headers

Authorization        

Example: Bearer ghedvfka6ac8P13E65Z4bVD

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the unit. Example: 1

unit   string     

Unit UUID Example: fuga

Create unit

requires authentication unit store

Create a new unit

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/units" \
    --header "Authorization: Bearer g6E6v34afbdch8k1aD5ZPVe" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"abbreviation\": \"Example Abbreviation\",
    \"description\": \"Example Description\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/units"
);

const headers = {
    "Authorization": "Bearer g6E6v34afbdch8k1aD5ZPVe",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "abbreviation": "Example Abbreviation",
    "description": "Example Description"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "string"
}
 

Request      

POST api/units

Headers

Authorization        

Example: Bearer g6E6v34afbdch8k1aD5ZPVe

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Nome da unidade. Example: Example Name

abbreviation   string     

Abreviação. Example: Example Abbreviation

description   string  optional    

Descrição. Example: Example Description

Update unit

requires authentication unit update

Update a unit

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/units/1" \
    --header "Authorization: Bearer Zka1hva6V5EgeDd3b4c8f6P" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"abbreviation\": \"Example Abbreviation\",
    \"description\": \"Example Description\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/units/1"
);

const headers = {
    "Authorization": "Bearer Zka1hva6V5EgeDd3b4c8f6P",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "abbreviation": "Example Abbreviation",
    "description": "Example Description"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "string"
}
 

Request      

PUT api/units/{id}

Headers

Authorization        

Example: Bearer Zka1hva6V5EgeDd3b4c8f6P

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the unit. Example: 1

unit   string     

Unit UUID Example: nostrum

Body Parameters

name   string     

Nome da unidade. Example: Example Name

abbreviation   string     

Abreviação. Example: Example Abbreviation

description   string  optional    

Descrição. Example: Example Description

Delete unit

requires authentication unit delete

Delete a unit

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/units/odit" \
    --header "Authorization: Bearer EkDVc8aZbgPf1654a63edhv" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/units/odit"
);

const headers = {
    "Authorization": "Bearer EkDVc8aZbgPf1654a63edhv",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/units/{unit}

Headers

Authorization        

Example: Bearer EkDVc8aZbgPf1654a63edhv

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

unit   string     

Unit UUID Example: odit

Users

Endpoints for users

List users

requires authentication user index

List all users

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/users?sort_by=created_at&sort_desc=1&page=1&per_page=15&q=John+Doe&sector_id=123e4567-e89b-12d3-a456-426614174000&role=ADMIN" \
    --header "Authorization: Bearer 5hZP63k6ab4fdecgaEv18DV" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/users"
);

const params = {
    "sort_by": "created_at",
    "sort_desc": "1",
    "page": "1",
    "per_page": "15",
    "q": "John Doe",
    "sector_id": "123e4567-e89b-12d3-a456-426614174000",
    "role": "ADMIN",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer 5hZP63k6ab4fdecgaEv18DV",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "fa1686a2-60ba-30f4-9355-01505bf9b91f",
            "name": "Fermin Sporer",
            "username": "christian.schumm",
            "email": "greta.quigley@example.net",
            "certification": null,
            "crea": null,
            "last_login_at": null,
            "image": {
                "id": null,
                "url": null
            },
            "sectors": [],
            "roles": []
        },
        {
            "id": "b681e89d-fc7f-3cc5-8ad6-f29696b2bbf5",
            "name": "Prof. Juliana Wunsch",
            "username": "pward",
            "email": "everett36@example.net",
            "certification": null,
            "crea": null,
            "last_login_at": null,
            "image": {
                "id": null,
                "url": null
            },
            "sectors": [],
            "roles": []
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/users

Headers

Authorization        

Example: Bearer 5hZP63k6ab4fdecgaEv18DV

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

sort_by   string  optional    

Field to sort by. Example: created_at

sort_desc   boolean  optional    

Sort order (true for descending, false for ascending). Example: true

page   integer  optional    

Page number for pagination. O campo value deve ser pelo menos 1. Example: 1

per_page   integer  optional    

Number of items per page (max: 100). O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 15

q   string  optional    

Search query by name or email. Example: John Doe

sector_id   string  optional    

Filter by sector UUID. The uuid of an existing record in the sectors table. Example: 123e4567-e89b-12d3-a456-426614174000

role   string  optional    

Filter by role name. The name of an existing record in the roles table. Example: ADMIN

Get user

requires authentication user show

Get a user

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/users/1" \
    --header "Authorization: Bearer P6VkZED15bd83v6gacfh4ea" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/users/1"
);

const headers = {
    "Authorization": "Bearer P6VkZED15bd83v6gacfh4ea",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "54f47d70-1919-3b72-a8eb-91287d2bbb13",
        "name": "Bennett Kemmer",
        "username": "schultz.hipolito",
        "email": "qmcglynn@example.org",
        "certification": null,
        "crea": null,
        "last_login_at": null,
        "image": {
            "id": null,
            "url": null
        },
        "sectors": [],
        "roles": []
    }
}
 

Request      

GET api/users/{id}

Headers

Authorization        

Example: Bearer P6VkZED15bd83v6gacfh4ea

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the user. Example: 1

Create user

requires authentication user store

Create a new user

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/users" \
    --header "Authorization: Bearer a8k16gaf3Eec6P4Ddvb5hVZ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"certification\": \"Example Certification\",
    \"crea\": \"Example Crea\",
    \"email\": \"user@example.com\",
    \"username\": \"mann.halle\",
    \"image\": {
        \"0\": \"example1\",
        \"1\": \"example2\",
        \"path\": \"Example Image path\",
        \"name\": \"Example Name\",
        \"extension\": \"Example Image extension\",
        \"size\": \"Example Image size\"
    },
    \"sectors\": [
        \"cb971c3d-55a9-38e1-acc5-a81a54d18ad5\"
    ],
    \"roles\": [
        \"489ce3a8-cfa4-35b9-9fe1-e9a362aa1b81\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/users"
);

const headers = {
    "Authorization": "Bearer a8k16gaf3Eec6P4Ddvb5hVZ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "certification": "Example Certification",
    "crea": "Example Crea",
    "email": "user@example.com",
    "username": "mann.halle",
    "image": {
        "0": "example1",
        "1": "example2",
        "path": "Example Image path",
        "name": "Example Name",
        "extension": "Example Image extension",
        "size": "Example Image size"
    },
    "sectors": [
        "cb971c3d-55a9-38e1-acc5-a81a54d18ad5"
    ],
    "roles": [
        "489ce3a8-cfa4-35b9-9fe1-e9a362aa1b81"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "string"
}
 

Request      

POST api/users

Headers

Authorization        

Example: Bearer a8k16gaf3Eec6P4Ddvb5hVZ

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Nome. Example: Example Name

certification   string  optional    

Certificação. O campo value não pode ser superior a 255 caracteres. Example: Example Certification

crea   string  optional    

CREA. O campo value não pode ser superior a 255 caracteres. Example: Example Crea

email   string     

E-mail. O campo value deve ser um endereço de e-mail válido. Example: user@example.com

username   string     

Usuário. Example: mann.halle

image   object  optional    

Imagem.

path   string  optional    

Caminho da imagem. This field is required when image is present. Example: Example Image path

name   string  optional    

Nome da imagem. Example: Example Name

extension   string  optional    

Extensão da imagem. Example: Example Image extension

size   string  optional    

Tamanho da imagem. Example: Example Image size

sectors   string[]  optional    

UUID do setor. The uuid of an existing record in the sectors table.

roles   string[]  optional    

UUID da função. The uuid of an existing record in the roles table.

Update user

requires authentication user update

Update a user

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/users/1" \
    --header "Authorization: Bearer 8hf4dP5VE1eakZvac366Dgb" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"certification\": \"Example Certification\",
    \"crea\": \"Example Crea\",
    \"email\": \"user@example.com\",
    \"username\": \"dock.feest\",
    \"password\": \"password123\",
    \"image\": {
        \"0\": \"example1\",
        \"1\": \"example2\",
        \"path\": \"Example Image path\",
        \"name\": \"Example Name\",
        \"extension\": \"Example Image extension\",
        \"size\": \"Example Image size\"
    },
    \"sectors\": [
        \"374894f7-53d1-3af6-9d8d-754b3603c562\"
    ],
    \"roles\": [
        \"669e79fd-4fa4-3add-b1be-109259023109\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/users/1"
);

const headers = {
    "Authorization": "Bearer 8hf4dP5VE1eakZvac366Dgb",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "certification": "Example Certification",
    "crea": "Example Crea",
    "email": "user@example.com",
    "username": "dock.feest",
    "password": "password123",
    "image": {
        "0": "example1",
        "1": "example2",
        "path": "Example Image path",
        "name": "Example Name",
        "extension": "Example Image extension",
        "size": "Example Image size"
    },
    "sectors": [
        "374894f7-53d1-3af6-9d8d-754b3603c562"
    ],
    "roles": [
        "669e79fd-4fa4-3add-b1be-109259023109"
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "string"
}
 

Request      

PUT api/users/{id}

Headers

Authorization        

Example: Bearer 8hf4dP5VE1eakZvac366Dgb

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the user. Example: 1

Body Parameters

name   string  optional    

Nome. Example: Example Name

certification   string  optional    

Certificação. O campo value não pode ser superior a 255 caracteres. Example: Example Certification

crea   string  optional    

CREA. O campo value não pode ser superior a 255 caracteres. Example: Example Crea

email   string  optional    

E-mail. O campo value deve ser um endereço de e-mail válido. Example: user@example.com

username   string  optional    

Usuário. Example: dock.feest

password   string  optional    

Password. Example: password123

image   object  optional    

Imagem.

path   string  optional    

Caminho da imagem. This field is required when image is present. Example: Example Image path

name   string  optional    

Nome da imagem. Example: Example Name

extension   string  optional    

Extensão da imagem. Example: Example Image extension

size   string  optional    

Tamanho da imagem. Example: Example Image size

sectors   string[]  optional    

UUID do setor. The uuid of an existing record in the sectors table.

roles   string[]  optional    

UUID da função. The uuid of an existing record in the roles table.

Delete user

requires authentication user delete

Delete a user

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/users/1" \
    --header "Authorization: Bearer Z8aPEfd413a6c6De5bvVgkh" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/users/1"
);

const headers = {
    "Authorization": "Bearer Z8aPEfd413a6c6De5bvVgkh",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "string"
}
 

Request      

DELETE api/users/{user}

Headers

Authorization        

Example: Bearer Z8aPEfd413a6c6De5bvVgkh

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

user   integer     

The user. Example: 1

Reset user password

requires authentication user password-reset

Reset a user password

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/users/019556e7-2e9f-777c-a177-30bbf0646c32/password-reset" \
    --header "Authorization: Bearer v6PgdefZkV514Ehb3cDaa68" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/users/019556e7-2e9f-777c-a177-30bbf0646c32/password-reset"
);

const headers = {
    "Authorization": "Bearer v6PgdefZkV514Ehb3cDaa68",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "PUT",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "Password reset successfully to foobaar"
}
 

Request      

PUT api/users/{user}/password-reset

Headers

Authorization        

Example: Bearer v6PgdefZkV514Ehb3cDaa68

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

user   string     

User ID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Attach permissions to user

requires authentication user update

Attach direct permissions to a user

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/users/1/permissions" \
    --header "Authorization: Bearer adVE318ak6vc6eZgDf5hPb4" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"permissions\": [
        \"05104e86-adeb-3a8d-a722-de6c4324efd4\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/users/1/permissions"
);

const headers = {
    "Authorization": "Bearer adVE318ak6vc6eZgDf5hPb4",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "permissions": [
        "05104e86-adeb-3a8d-a722-de6c4324efd4"
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Permissions attached successfully"
}
 

Request      

PUT api/users/{user}/permissions

Headers

Authorization        

Example: Bearer adVE318ak6vc6eZgDf5hPb4

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

user   integer     

The user. Example: 1

Body Parameters

permissions   string[]  optional    

UUID da permissão. The uuid of an existing record in the permissions table.

List user direct permissions

requires authentication user show

List direct permissions associated with a user

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/users/1/permissions" \
    --header "Authorization: Bearer 8d6h3ega5PkE1cvfbaVZ46D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/users/1/permissions"
);

const headers = {
    "Authorization": "Bearer 8d6h3ega5PkE1cvfbaVZ46D",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": null,
            "name": "nesciunt",
            "display_name": "Minima accusantium cum quia possimus distinctio repellendus."
        },
        {
            "id": null,
            "name": "aut",
            "display_name": "Autem esse ut facere inventore."
        }
    ]
}
 

Request      

GET api/users/{user}/permissions

Headers

Authorization        

Example: Bearer 8d6h3ega5PkE1cvfbaVZ46D

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

user   integer     

The user. Example: 1

Work Locations

Endpoints for work locations

List work locations

requires authentication work-location index

List all work locations

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/work-locations?sort_by=created_at&sort_desc=1&page=1&per_page=15&q=Tecnologia&work=uuid" \
    --header "Authorization: Bearer h41DvEdf6gcaVk6Z3b5ePa8" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/work-locations"
);

const params = {
    "sort_by": "created_at",
    "sort_desc": "1",
    "page": "1",
    "per_page": "15",
    "q": "Tecnologia",
    "work": "uuid",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer h41DvEdf6gcaVk6Z3b5ePa8",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "eefec3e7-9a3e-3aa2-b0f4-83d8b5720a25",
            "description": "Sr. Davi Verdara Neto",
            "work": {
                "id": null,
                "name": null
            },
            "documents": [],
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "cb43ded7-3fa0-3cd4-92f9-c26a8c1d4540",
            "description": "Ketlin Franciele Esteves",
            "work": {
                "id": null,
                "name": null
            },
            "documents": [],
            "created_at": null,
            "updated_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/work-locations

Headers

Authorization        

Example: Bearer h41DvEdf6gcaVk6Z3b5ePa8

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

sort_by   string  optional    

Field to sort by. Example: created_at

sort_desc   boolean  optional    

Sort order (true for descending, false for ascending). Example: true

page   integer  optional    

Page number for pagination. O campo value deve ser pelo menos 1. Example: 1

per_page   integer  optional    

Number of items per page (max: 100). O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 15

q   string  optional    

Search query. Example: Tecnologia

work   string  optional    

Work. The uuid of an existing record in the works table. Example: uuid

Create work location

requires authentication work-location store

Create a new work location

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/work-locations" \
    --header "Authorization: Bearer 63fP8EVDab5ved4ak6chg1Z" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"description\": \"Example Description\",
    \"work_id\": \"baaea323-4c99-3a16-bd63-27c5beced419\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/work-locations"
);

const headers = {
    "Authorization": "Bearer 63fP8EVDab5ved4ak6chg1Z",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "description": "Example Description",
    "work_id": "baaea323-4c99-3a16-bd63-27c5beced419"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "string"
}
 

Request      

POST api/work-locations

Headers

Authorization        

Example: Bearer 63fP8EVDab5ved4ak6chg1Z

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

description   string     

Descrição. O campo value não pode ser superior a 255 caracteres. Example: Example Description

work_id   string     

Obra. The uuid of an existing record in the works table. Example: baaea323-4c99-3a16-bd63-27c5beced419

Get work location

requires authentication work-location show

Get a work location

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/work-locations/019556e7-2e9f-777c-a177-30bbf0646c32" \
    --header "Authorization: Bearer dkVg684evbZ3aP5hD16aEcf" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/work-locations/019556e7-2e9f-777c-a177-30bbf0646c32"
);

const headers = {
    "Authorization": "Bearer dkVg684evbZ3aP5hD16aEcf",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "6b44c38d-c597-322a-ac9a-874b8fd573f1",
        "description": "Teobaldo Faro Jr.",
        "work": {
            "id": null,
            "name": null
        },
        "documents": [],
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/work-locations/{workLocation}

Headers

Authorization        

Example: Bearer dkVg684evbZ3aP5hD16aEcf

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

workLocation   string     

Work Location ID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Update work location

requires authentication work-location update

Update a work location

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/work-locations/019556e7-2e9f-777c-a177-30bbf0646c32" \
    --header "Authorization: Bearer V4cZa3g8Ee6b65haPkd1fDv" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"description\": \"Example Description\",
    \"work_id\": \"477e7fe6-8cf6-3a1d-9ecd-3d41e31eefe2\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/work-locations/019556e7-2e9f-777c-a177-30bbf0646c32"
);

const headers = {
    "Authorization": "Bearer V4cZa3g8Ee6b65haPkd1fDv",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "description": "Example Description",
    "work_id": "477e7fe6-8cf6-3a1d-9ecd-3d41e31eefe2"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "string"
}
 

Request      

PUT api/work-locations/{workLocation}

Headers

Authorization        

Example: Bearer V4cZa3g8Ee6b65haPkd1fDv

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

workLocation   string     

Work ID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Body Parameters

description   string  optional    

Descrição. O campo value não pode ser superior a 255 caracteres. Example: Example Description

work_id   string  optional    

Obra. The uuid of an existing record in the works table. Example: 477e7fe6-8cf6-3a1d-9ecd-3d41e31eefe2

Delete work location

requires authentication work-location delete

Delete a work location

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/work-locations/019556e7-2e9f-777c-a177-30bbf0646c32" \
    --header "Authorization: Bearer Pfc865vEeD6134haZkgabdV" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/work-locations/019556e7-2e9f-777c-a177-30bbf0646c32"
);

const headers = {
    "Authorization": "Bearer Pfc865vEeD6134haZkgabdV",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/work-locations/{workLocation}

Headers

Authorization        

Example: Bearer Pfc865vEeD6134haZkgabdV

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

workLocation   string     

Work ID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Works

Endpoints for works

List works

requires authentication work index

List all works

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/works?sort_by=created_at&sort_desc=1&page=1&per_page=15&q=Tecnologia&customer_id=019556e7-2e9f-777c-a177-30bbf0646c32&status_id=019556e7-2e9f-777c-a177-30bbf0646c32&responsible_id=019556e7-2e9f-777c-a177-30bbf0646c32&no_responsible=1" \
    --header "Authorization: Bearer 4ae3kD8ag51PVfcEZdh6vb6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/works"
);

const params = {
    "sort_by": "created_at",
    "sort_desc": "1",
    "page": "1",
    "per_page": "15",
    "q": "Tecnologia",
    "customer_id": "019556e7-2e9f-777c-a177-30bbf0646c32",
    "status_id": "019556e7-2e9f-777c-a177-30bbf0646c32",
    "responsible_id": "019556e7-2e9f-777c-a177-30bbf0646c32",
    "no_responsible": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer 4ae3kD8ag51PVfcEZdh6vb6",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "f9559ebb-a2f7-3cd7-a703-c944a338a88c",
            "name": "Thales Galvão",
            "address": {
                "street": null,
                "number": null,
                "complement": null,
                "neighborhood": null,
                "city": null,
                "state": null,
                "zip_code": null
            },
            "documents": [],
            "locations": [],
            "product_quantity_lists_count": 0,
            "product_quantity_list_items_count": 0,
            "product_requests_count": 0,
            "product_request_items_count": 0,
            "documents_count": 0,
            "locations_documents_count": 0,
            "total_documents_count": 0,
            "daily_logs_count": 0,
            "projects_count": 0,
            "started_at": {
                "date": "2008-01-31 21:30:08.000000",
                "timezone_type": 3,
                "timezone": "America/Sao_Paulo"
            },
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "3e08f721-f8c5-30f4-9ae8-147a7591bd39",
            "name": "Carla Fonseca Rocha Jr.",
            "address": {
                "street": null,
                "number": null,
                "complement": null,
                "neighborhood": null,
                "city": null,
                "state": null,
                "zip_code": null
            },
            "documents": [],
            "locations": [],
            "product_quantity_lists_count": 0,
            "product_quantity_list_items_count": 0,
            "product_requests_count": 0,
            "product_request_items_count": 0,
            "documents_count": 0,
            "locations_documents_count": 0,
            "total_documents_count": 0,
            "daily_logs_count": 0,
            "projects_count": 0,
            "started_at": {
                "date": "2019-11-03 00:56:07.000000",
                "timezone_type": 3,
                "timezone": "America/Sao_Paulo"
            },
            "created_at": null,
            "updated_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/works

Headers

Authorization        

Example: Bearer 4ae3kD8ag51PVfcEZdh6vb6

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

sort_by   string  optional    

Field to sort by. Example: created_at

sort_desc   boolean  optional    

Sort order (true for descending, false for ascending). Example: true

page   integer  optional    

Page number for pagination. O campo value deve ser pelo menos 1. Example: 1

per_page   integer  optional    

Number of items per page (max: 100). O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 15

q   string  optional    

Search query. Example: Tecnologia

customer_id   string  optional    

Filter by customer UUID. The uuid of an existing record in the customers table. Example: 019556e7-2e9f-777c-a177-30bbf0646c32

status_id   string  optional    

Filter by status UUID. The uuid of an existing record in the statuses table. Example: 019556e7-2e9f-777c-a177-30bbf0646c32

responsible_id   string  optional    

Filter by responsible user UUID. Only works if user has "work view-all" permission. The uuid of an existing record in the users table. Example: 019556e7-2e9f-777c-a177-30bbf0646c32

no_responsible   boolean  optional    

Filter works without any responsible users. Example: true

Create work

requires authentication work store

Create a new work

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/works" \
    --header "Authorization: Bearer 5dP613E4vage8aZVhkfbc6D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"customer_id\": \"fc5a5fcc-2fd3-397c-bf3d-b3bd6aad0dff\",
    \"status_id\": \"b51ee514-021d-31b3-a526-0f257ec469f3\",
    \"started_at\": \"Example Started at\",
    \"address\": {
        \"0\": \"example1\",
        \"1\": \"example2\",
        \"street\": \"Example Address street\",
        \"number\": \"Example Address number\",
        \"complement\": \"Example Address complement\",
        \"neighborhood\": \"Example Address neighborhood\",
        \"city\": \"Example Address city\",
        \"state\": \"Example Address state\",
        \"zip_code\": \"Example Address zip code\"
    }
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/works"
);

const headers = {
    "Authorization": "Bearer 5dP613E4vage8aZVhkfbc6D",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "customer_id": "fc5a5fcc-2fd3-397c-bf3d-b3bd6aad0dff",
    "status_id": "b51ee514-021d-31b3-a526-0f257ec469f3",
    "started_at": "Example Started at",
    "address": {
        "0": "example1",
        "1": "example2",
        "street": "Example Address street",
        "number": "Example Address number",
        "complement": "Example Address complement",
        "neighborhood": "Example Address neighborhood",
        "city": "Example Address city",
        "state": "Example Address state",
        "zip_code": "Example Address zip code"
    }
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "string"
}
 

Request      

POST api/works

Headers

Authorization        

Example: Bearer 5dP613E4vage8aZVhkfbc6D

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Nome. O campo value não pode ser superior a 255 caracteres. Example: Example Name

customer_id   string     

Cliente. The uuid of an existing record in the customers table. Example: fc5a5fcc-2fd3-397c-bf3d-b3bd6aad0dff

status_id   string     

Status id. The uuid of an existing record in the statuses table. Example: b51ee514-021d-31b3-a526-0f257ec469f3

started_at   string  optional    

Início da obra. O campo value deve ser uma data válida. Example: Example Started at

address   object     

Endereço.

street   string     

Rua. Example: Example Address street

number   string     

Número. Example: Example Address number

complement   string  optional    

Complemento. Example: Example Address complement

neighborhood   string     

Bairro. Example: Example Address neighborhood

city   string     

Cidade. Example: Example Address city

state   string     

Estado. Example: Example Address state

zip_code   string     

CEP. Example: Example Address zip code

Get work

requires authentication work show

Get a work

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/works/1" \
    --header "Authorization: Bearer D8c3a4edhagfE5k1b66VvPZ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/works/1"
);

const headers = {
    "Authorization": "Bearer D8c3a4edhagfE5k1b66VvPZ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": "80e4c9fb-1a11-359a-9588-50ee1642ecad",
        "name": "Santiago Pablo Torres Sobrinho",
        "address": {
            "street": null,
            "number": null,
            "complement": null,
            "neighborhood": null,
            "city": null,
            "state": null,
            "zip_code": null
        },
        "documents": [],
        "locations": [],
        "product_quantity_lists_count": 0,
        "product_quantity_list_items_count": 0,
        "product_requests_count": 0,
        "product_request_items_count": 0,
        "documents_count": 0,
        "locations_documents_count": 0,
        "total_documents_count": 0,
        "daily_logs_count": 0,
        "projects_count": 0,
        "started_at": {
            "date": "2020-11-07 08:23:13.000000",
            "timezone_type": 3,
            "timezone": "America/Sao_Paulo"
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/works/{id}

Headers

Authorization        

Example: Bearer D8c3a4edhagfE5k1b66VvPZ

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the work. Example: 1

work   string     

Work ID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Update work

requires authentication work update

Update a work

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/works/1" \
    --header "Authorization: Bearer ED53chda41Pbf68eVkg6aZv" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"customer_id\": \"4788a77c-141a-3e89-bc0b-38d10d4bc3b1\",
    \"status_id\": \"eb410b71-91e8-350e-bcd8-72968827090a\",
    \"started_at\": \"Example Started at\",
    \"address\": {
        \"0\": \"example1\",
        \"1\": \"example2\",
        \"street\": \"Example Address street\",
        \"number\": \"Example Address number\",
        \"complement\": \"Example Address complement\",
        \"neighborhood\": \"Example Address neighborhood\",
        \"city\": \"Example Address city\",
        \"state\": \"Example Address state\",
        \"zip_code\": \"Example Address zip code\"
    }
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/works/1"
);

const headers = {
    "Authorization": "Bearer ED53chda41Pbf68eVkg6aZv",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "customer_id": "4788a77c-141a-3e89-bc0b-38d10d4bc3b1",
    "status_id": "eb410b71-91e8-350e-bcd8-72968827090a",
    "started_at": "Example Started at",
    "address": {
        "0": "example1",
        "1": "example2",
        "street": "Example Address street",
        "number": "Example Address number",
        "complement": "Example Address complement",
        "neighborhood": "Example Address neighborhood",
        "city": "Example Address city",
        "state": "Example Address state",
        "zip_code": "Example Address zip code"
    }
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "string"
}
 

Request      

PUT api/works/{id}

Headers

Authorization        

Example: Bearer ED53chda41Pbf68eVkg6aZv

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the work. Example: 1

work   string     

Work ID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Body Parameters

name   string  optional    

Nome. O campo value não pode ser superior a 255 caracteres. Example: Example Name

customer_id   string  optional    

Cliente. The uuid of an existing record in the customers table. Example: 4788a77c-141a-3e89-bc0b-38d10d4bc3b1

status_id   string  optional    

Status id. The uuid of an existing record in the statuses table. Example: eb410b71-91e8-350e-bcd8-72968827090a

started_at   string  optional    

Início da obra. O campo value deve ser uma data válida. Example: Example Started at

address   object  optional    

Endereço.

street   string  optional    

Rua. Example: Example Address street

number   string  optional    

Número. Example: Example Address number

complement   string  optional    

Complemento. Example: Example Address complement

neighborhood   string  optional    

Bairro. Example: Example Address neighborhood

city   string  optional    

Cidade. Example: Example Address city

state   string  optional    

Estado. Example: Example Address state

zip_code   string  optional    

CEP. Example: Example Address zip code

Delete work

requires authentication work delete

Delete a work

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/works/1" \
    --header "Authorization: Bearer a6DEb5v4ac13gPdheV6k8Zf" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/works/1"
);

const headers = {
    "Authorization": "Bearer a6DEb5v4ac13gPdheV6k8Zf",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204):

Empty response
 

Request      

DELETE api/works/{id}

Headers

Authorization        

Example: Bearer a6DEb5v4ac13gPdheV6k8Zf

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the work. Example: 1

work   string     

Work ID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

List work responsibles

requires authentication work-responsibles index

List all users responsible for a work

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/works/019556e7-2e9f-777c-a177-30bbf0646c32/responsibles?sort_by=created_at&sort_desc=1&page=1&per_page=15&q=John" \
    --header "Authorization: Bearer 68fcEk1Da3645dabvgeZPVh" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/works/019556e7-2e9f-777c-a177-30bbf0646c32/responsibles"
);

const params = {
    "sort_by": "created_at",
    "sort_desc": "1",
    "page": "1",
    "per_page": "15",
    "q": "John",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer 68fcEk1Da3645dabvgeZPVh",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": "cbd3702b-e882-35db-9c19-61a21cdd27d2",
            "name": "Itzel DuBuque",
            "username": "ullrich.bennett",
            "email": "jaycee.kilback@example.net",
            "certification": null,
            "crea": null,
            "last_login_at": null,
            "image": {
                "id": null,
                "url": null
            },
            "sectors": [],
            "roles": []
        },
        {
            "id": "0f5979a3-b257-3a94-a9f4-8aacc1024816",
            "name": "Carey Jacobs",
            "username": "seamus13",
            "email": "wmueller@example.org",
            "certification": null,
            "crea": null,
            "last_login_at": null,
            "image": {
                "id": null,
                "url": null
            },
            "sectors": [],
            "roles": []
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/works/{work}/responsibles

Headers

Authorization        

Example: Bearer 68fcEk1Da3645dabvgeZPVh

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

work   string     

Work UUID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Query Parameters

sort_by   string  optional    

Field to sort by. Example: created_at

sort_desc   boolean  optional    

Sort order (true for descending, false for ascending). Example: true

page   integer  optional    

Page number for pagination. O campo value deve ser pelo menos 1. Example: 1

per_page   integer  optional    

Number of items per page (max: 100). O campo value deve ser pelo menos 1. O campo value não pode ser superior a 100. Example: 15

q   string  optional    

Search by name or email. Example: John

Attach responsibles to work

requires authentication work-responsibles attach

Attach users as responsibles to a work without removing existing ones

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/works/019556e7-2e9f-777c-a177-30bbf0646c32/responsibles/attach" \
    --header "Authorization: Bearer Zf43dbaPVca15evD86g6hkE" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"users\": [
        \"97759a13-d0ac-3608-8432-a9076e15f317\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/works/019556e7-2e9f-777c-a177-30bbf0646c32/responsibles/attach"
);

const headers = {
    "Authorization": "Bearer Zf43dbaPVca15evD86g6hkE",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "users": [
        "97759a13-d0ac-3608-8432-a9076e15f317"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Responsibles attached successfully"
}
 

Request      

POST api/works/{work}/responsibles/attach

Headers

Authorization        

Example: Bearer Zf43dbaPVca15evD86g6hkE

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

work   string     

Work UUID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Body Parameters

users   string[]  optional    

UUID do usuário. The uuid of an existing record in the users table.

Detach responsibles from work

requires authentication work-responsibles detach

Remove specific users as responsibles from a work

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/works/019556e7-2e9f-777c-a177-30bbf0646c32/responsibles/detach" \
    --header "Authorization: Bearer a64D68P51VgbhkvafEeZd3c" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"users\": [
        \"b7f52caf-aaa9-3a58-81df-f5b28196639d\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/works/019556e7-2e9f-777c-a177-30bbf0646c32/responsibles/detach"
);

const headers = {
    "Authorization": "Bearer a64D68P51VgbhkvafEeZd3c",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "users": [
        "b7f52caf-aaa9-3a58-81df-f5b28196639d"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Responsibles detached successfully"
}
 

Request      

POST api/works/{work}/responsibles/detach

Headers

Authorization        

Example: Bearer a64D68P51VgbhkvafEeZd3c

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

work   string     

Work UUID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Body Parameters

users   string[]  optional    

UUID do usuário. The uuid of an existing record in the users table.

Sync work responsibles

requires authentication work-responsibles sync

Replace all responsibles of a work with the provided list

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/works/019556e7-2e9f-777c-a177-30bbf0646c32/responsibles/sync" \
    --header "Authorization: Bearer c3eP6gbaEDVv8hfaZk514d6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"users\": [
        \"d448d19a-8aa3-32ba-8c8e-8d999164aa0e\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/works/019556e7-2e9f-777c-a177-30bbf0646c32/responsibles/sync"
);

const headers = {
    "Authorization": "Bearer c3eP6gbaEDVv8hfaZk514d6",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "users": [
        "d448d19a-8aa3-32ba-8c8e-8d999164aa0e"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Responsibles synchronized successfully"
}
 

Request      

POST api/works/{work}/responsibles/sync

Headers

Authorization        

Example: Bearer c3eP6gbaEDVv8hfaZk514d6

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

work   string     

Work UUID Example: 019556e7-2e9f-777c-a177-30bbf0646c32

Body Parameters

users   string[]  optional    

UUID do usuário. The uuid of an existing record in the users table.