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 kg4eD3a6Vb8615dfPaZvEhc" \
    --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 kg4eD3a6Vb8615dfPaZvEhc",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": [
        {
            "id": "db783f5b-f563-3916-bcaa-96b68b03a62f",
            "name": "et-6b0093a10ac15",
            "display_name": "Dolorum ut ut dolorum necessitatibus tempore est porro.",
            "permissions_count": null
        },
        {
            "id": "4115f3e3-dfa2-3c94-ab87-d3f7f107c153",
            "name": "cupiditate-6b0093a10de26",
            "display_name": "Corporis illum quod rerum et qui voluptatibus assumenda quia.",
            "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 kg4eD3a6Vb8615dfPaZvEhc

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 1E5Pvag64ZVhebDkac8fd63" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"display_name\": \"Example Name\",
    \"permissions\": [
        \"c0d6fb2d-6d46-341f-93e9-0370dd1a1f34\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/acl/roles"
);

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

let body = {
    "name": "Example Name",
    "display_name": "Example Name",
    "permissions": [
        "c0d6fb2d-6d46-341f-93e9-0370dd1a1f34"
    ]
};

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 1E5Pvag64ZVhebDkac8fd63

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 ge6Eva5Dkdfcb63P184aZhV" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"display_name\": \"Example Name\",
    \"permissions\": [
        \"3de99ca0-c566-3ed7-824e-48daa2080233\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/acl/roles/1"
);

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

let body = {
    "name": "Example Name",
    "display_name": "Example Name",
    "permissions": [
        "3de99ca0-c566-3ed7-824e-48daa2080233"
    ]
};

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 ge6Eva5Dkdfcb63P184aZhV

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 b36Vf5P6a8eavD1dhkZ4cgE" \
    --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 b36Vf5P6a8eavD1dhkZ4cgE",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": {
        "id": "0648f3c5-b12d-3dd6-bcc6-cd1d29649c7e",
        "name": "ducimus-6b0093a118c8f",
        "display_name": "Cum modi dolor voluptatem qui.",
        "permissions_count": null
    }
}
 

Request      

GET api/acl/roles/{id}

Headers

Authorization        

Example: Bearer b36Vf5P6a8eavD1dhkZ4cgE

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 ade3Z616aDEP48fbkh5gvVc" \
    --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 ade3Z616aDEP48fbkh5gvVc",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": [
        {
            "id": null,
            "name": "amet",
            "display_name": "Ratione at quas eveniet consequatur quam."
        },
        {
            "id": null,
            "name": "occaecati",
            "display_name": "At nobis accusamus quisquam temporibus accusantium voluptas."
        }
    ]
}
 

Request      

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

Headers

Authorization        

Example: Bearer ade3Z616aDEP48fbkh5gvVc

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 vP4ak36ce8b1dfhEaVg5D6Z" \
    --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 vP4ak36ce8b1dfhEaVg5D6Z",
    "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 vP4ak36ce8b1dfhEaVg5D6Z

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 cP1eDakgV5Ea6Zv364bdhf8" \
    --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 cP1eDakgV5Ea6Zv364bdhf8",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": [
        {
            "id": null,
            "name": "aperiam",
            "display_name": "Sit optio ratione eius in."
        },
        {
            "id": null,
            "name": "repudiandae",
            "display_name": "Quis fugit sit qui possimus laudantium possimus ut."
        }
    ],
    "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 cP1eDakgV5Ea6Zv364bdhf8

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 d5bkhaEevD1a36gcV8PfZ46" \
    --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 d5bkhaEevD1a36gcV8PfZ46",
    "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 d5bkhaEevD1a36gcV8PfZ46

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 5ac6bdZega4V6138EPvhkDf" \
    --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 5ac6bdZega4V6138EPvhkDf",
    "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 5ac6bdZega4V6138EPvhkDf

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 Pe4k3dbva5VgDZcEfh61a68" \
    --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 Pe4k3dbva5VgDZcEfh61a68",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": {
        "id": null,
        "name": "cumque",
        "display_name": "Totam sed cum sunt voluptate."
    }
}
 

Request      

GET api/acl/permissions/{id}

Headers

Authorization        

Example: Bearer Pe4k3dbva5VgDZcEfh61a68

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 Ebf1Zeg3vcdkV6aPD4h5a86" \
    --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 Ebf1Zeg3vcdkV6aPD4h5a86",
    "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 Ebf1Zeg3vcdkV6aPD4h5a86

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 faP8gcdDh154bk3VZ6E6eva" \
    --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 faP8gcdDh154bk3VZ6E6eva",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": [
        {
            "id": "041e289a-bf97-328e-9569-b4f82245f9bc",
            "code": null,
            "type": "entrada",
            "payment_method": "cheque",
            "amount": 7506.82,
            "due_date": "2026-12-12T03: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 aut doloremque modi ut vitae libero provident.",
            "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": "saepe",
            "field2": 51,
            "field3": false,
            "notes": "Occaecati odio quas placeat explicabo.",
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "63fd577a-f80c-3d07-97b2-1f30f5aab32e",
            "code": null,
            "type": "saída",
            "payment_method": "cheque",
            "amount": 1976.47,
            "due_date": "2026-12-05T03: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": "Eius omnis rerum quia nemo fugiat eum quos consequatur reiciendis.",
            "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": "voluptatibus",
            "field2": 93,
            "field3": false,
            "notes": "Sint ipsam et harum dolorum quia quasi et.",
            "created_at": null,
            "updated_at": null
        }
    ]
}
 

Request      

GET api/accounts-payable-receivable/reminders

Headers

Authorization        

Example: Bearer faP8gcdDh154bk3VZ6E6eva

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[]=nostrum" \
    --header "Authorization: Bearer PVe866ZEg4dav1abfc3hkD5" \
    --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]": "nostrum",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer PVe866ZEg4dav1abfc3hkD5",
    "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 PVe866ZEg4dav1abfc3hkD5

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 d8vPca6DZ6fhVke5bg31a4E" \
    --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 d8vPca6DZ6fhVke5bg31a4E",
    "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 d8vPca6DZ6fhVke5bg31a4E

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[]=explicabo&suppliers[]=vel&works[]=in&cost_centers[]=suscipit&statuses[]=a+vencer&payment_method=cheque&date_start=2023-01-01&date_end=2023-12-31&protest_date_start=2026-11-20T15%3A38%3A25&protest_date_end=2026-11-20T15%3A38%3A25&has_protest=1&has_children=1&is_recurring=1" \
    --header "Authorization: Bearer 3g5EZaP81aVhcbDdevk4f66" \
    --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]": "explicabo",
    "suppliers[0]": "vel",
    "works[0]": "in",
    "cost_centers[0]": "suscipit",
    "statuses[0]": "a vencer",
    "payment_method": "cheque",
    "date_start": "2023-01-01",
    "date_end": "2023-12-31",
    "protest_date_start": "2026-11-20T15:38:25",
    "protest_date_end": "2026-11-20T15:38:25",
    "has_protest": "1",
    "has_children": "1",
    "is_recurring": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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


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

Example response (200):


{
    "data": [
        {
            "id": "13829179-7584-3a35-87b9-f01565374281",
            "code": null,
            "type": "saída",
            "payment_method": "boleto",
            "amount": 9674.03,
            "due_date": "2026-12-09T03: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": "Et saepe doloribus vel earum facere qui necessitatibus.",
            "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": "non",
            "field2": 16,
            "field3": false,
            "notes": "Non nulla quis dolorem commodi.",
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "d5c51883-147e-3c22-ad33-09c7bf96e833",
            "code": null,
            "type": "entrada",
            "payment_method": "boleto",
            "amount": 5529.79,
            "due_date": "2026-12-05T03: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": "Consequatur quasi ut quia velit harum doloribus natus et cumque numquam dolor occaecati 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": "debitis",
            "field2": 10,
            "field3": true,
            "notes": "Ut fugit officia soluta illum.",
            "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 3g5EZaP81aVhcbDdevk4f66

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-20T15:38:25

protest_date_end   string  optional    

O campo value deve ser uma data válida. Example: 2026-11-20T15:38:25

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[]=est&suppliers[]=adipisci&works[]=cumque&cost_centers[]=ut&statuses[]=cancelado&payment_method=cheque&date_start=2023-01-01&date_end=2023-12-31&protest_date_start=2026-11-20T15%3A38%3A25&protest_date_end=2026-11-20T15%3A38%3A25&has_protest=&has_children=1&is_recurring=1" \
    --header "Authorization: Bearer ha6bdgPv1a3eEkV4DZf685c" \
    --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]": "est",
    "suppliers[0]": "adipisci",
    "works[0]": "cumque",
    "cost_centers[0]": "ut",
    "statuses[0]": "cancelado",
    "payment_method": "cheque",
    "date_start": "2023-01-01",
    "date_end": "2023-12-31",
    "protest_date_start": "2026-11-20T15:38:25",
    "protest_date_end": "2026-11-20T15:38:25",
    "has_protest": "0",
    "has_children": "1",
    "is_recurring": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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


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

Example response (200):


{
    "data": [
        {
            "id": "79ee47b3-d462-3130-a88b-0ca27b4a3a4d",
            "code": null,
            "type": "saída",
            "payment_method": "cheque",
            "amount": 6952.79,
            "due_date": "2026-12-13T03: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": "Aut fugit nemo ducimus possimus et quo inventore.",
            "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": "molestiae",
            "field2": 27,
            "field3": true,
            "notes": "Impedit autem sed dolor.",
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "eef9e414-8585-3f59-834b-99c1a44471b2",
            "code": null,
            "type": "entrada",
            "payment_method": "cheque",
            "amount": 6142.49,
            "due_date": "2026-11-28T03: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": "Sequi et repudiandae repudiandae vel laborum velit dolores culpa vel aperiam nihil voluptatem.",
            "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": "iste",
            "field2": 93,
            "field3": false,
            "notes": "Unde tempore a sequi tempore nobis.",
            "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 ha6bdgPv1a3eEkV4DZf685c

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-20T15:38:25

protest_date_end   string  optional    

O campo value deve ser uma data válida. Example: 2026-11-20T15:38:25

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 e3ah1EbDfvkca68d4PZ6V5g" \
    --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\": \"4624ad63-9e5e-3a2b-b372-6c62e424e68e\",
    \"customer_id\": \"7939047f-3d88-30e7-9ad4-b64e91b2d416\",
    \"work_id\": \"0c7a0220-4502-33a9-9499-a3030e27727b\",
    \"cost_center_id\": \"dbc871e5-399e-3813-b803-099cbeadccbe\",
    \"status\": \"Example Status\",
    \"protest_date\": \"2024-01-01\",
    \"bank_account_id\": \"5e85ed56-d867-38c1-b121-7401312f3f82\",
    \"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 e3ah1EbDfvkca68d4PZ6V5g",
    "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": "4624ad63-9e5e-3a2b-b372-6c62e424e68e",
    "customer_id": "7939047f-3d88-30e7-9ad4-b64e91b2d416",
    "work_id": "0c7a0220-4502-33a9-9499-a3030e27727b",
    "cost_center_id": "dbc871e5-399e-3813-b803-099cbeadccbe",
    "status": "Example Status",
    "protest_date": "2024-01-01",
    "bank_account_id": "5e85ed56-d867-38c1-b121-7401312f3f82",
    "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 e3ah1EbDfvkca68d4PZ6V5g

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: 4624ad63-9e5e-3a2b-b372-6c62e424e68e

customer_id   string  optional    

Cliente. The uuid of an existing record in the customers table. Example: 7939047f-3d88-30e7-9ad4-b64e91b2d416

work_id   string  optional    

Obra. The uuid of an existing record in the works table. Example: 0c7a0220-4502-33a9-9499-a3030e27727b

cost_center_id   string     

Cost center id. The uuid of an existing record in the cost_centers table. Example: dbc871e5-399e-3813-b803-099cbeadccbe

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: 5e85ed56-d867-38c1-b121-7401312f3f82

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 6Za4kfV63E1P8egav5hbDcd" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"fiscal_document_id\": \"numquam\",
    \"installment_ids\": [
        \"cupiditate\"
    ],
    \"payment_method\": \"boleto\",
    \"work_id\": \"voluptatem\",
    \"cost_center_id\": \"reprehenderit\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/accounts-payable-receivable/import-nfe"
);

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

let body = {
    "fiscal_document_id": "numquam",
    "installment_ids": [
        "cupiditate"
    ],
    "payment_method": "boleto",
    "work_id": "voluptatem",
    "cost_center_id": "reprehenderit"
};

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 6Za4kfV63E1P8egav5hbDcd

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: numquam

installment_ids   string[]  optional    

The uuid of an existing record in the fiscal_document_installments table.

payment_method   string  optional    

Example: boleto

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

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

cost_center_id   string  optional    

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

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/ex/history" \
    --header "Authorization: Bearer fcD5gaaheP6vEVb3146dk8Z" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/accounts-payable-receivable/ex/history"
);

const headers = {
    "Authorization": "Bearer fcD5gaaheP6vEVb3146dk8Z",
    "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 fcD5gaaheP6vEVb3146dk8Z

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

accountPayableReceivable   string     

Example: ex

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/incidunt" \
    --header "Authorization: Bearer dev51PV4ha6k6Z3aE8gfcDb" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/accounts-payable-receivable/incidunt"
);

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


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

Example response (200):


{
    "data": {
        "id": "b61b0ced-3181-3c23-9e8b-4be9d0584725",
        "code": null,
        "type": "entrada",
        "payment_method": "boleto",
        "amount": 5154.13,
        "due_date": "2026-12-03T03: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": "Ullam assumenda fuga praesentium aut perspiciatis velit non ut qui nam et sit saepe.",
        "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": "impedit",
        "field2": 14,
        "field3": true,
        "notes": "Saepe cumque eos corrupti qui vero et ipsam.",
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

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

Headers

Authorization        

Example: Bearer dev51PV4ha6k6Z3aE8gfcDb

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

accountPayableReceivable   string     

Example: incidunt

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/ducimus" \
    --header "Authorization: Bearer V56v36dEghakPa84ec1DbfZ" \
    --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\": \"656262d1-9a94-3eed-be9a-85095a5c6862\",
    \"customer_id\": \"182a4505-79b0-3e37-92d6-b5f49f1513eb\",
    \"work_id\": \"b8e6165f-64fb-3a2a-977b-79aa0d2d3883\",
    \"cost_center_id\": \"a9a00b15-a0d9-3daf-8815-0d00af6bca42\",
    \"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\": \"4e982dc5-13af-39fb-922c-8f8ec9a67c09\",
    \"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/ducimus"
);

const headers = {
    "Authorization": "Bearer V56v36dEghakPa84ec1DbfZ",
    "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": "656262d1-9a94-3eed-be9a-85095a5c6862",
    "customer_id": "182a4505-79b0-3e37-92d6-b5f49f1513eb",
    "work_id": "b8e6165f-64fb-3a2a-977b-79aa0d2d3883",
    "cost_center_id": "a9a00b15-a0d9-3daf-8815-0d00af6bca42",
    "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": "4e982dc5-13af-39fb-922c-8f8ec9a67c09",
    "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 V56v36dEghakPa84ec1DbfZ

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

accountPayableReceivable   string     

Example: ducimus

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: 656262d1-9a94-3eed-be9a-85095a5c6862

customer_id   string  optional    

Customer id. The uuid of an existing record in the customers table. Example: 182a4505-79b0-3e37-92d6-b5f49f1513eb

work_id   string  optional    

Work id. The uuid of an existing record in the works table. Example: b8e6165f-64fb-3a2a-977b-79aa0d2d3883

cost_center_id   string     

Cost center id. The uuid of an existing record in the cost_centers table. Example: a9a00b15-a0d9-3daf-8815-0d00af6bca42

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: 4e982dc5-13af-39fb-922c-8f8ec9a67c09

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/rem" \
    --header "Authorization: Bearer gekadfh6V36DEZbv458Pac1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/accounts-payable-receivable/rem"
);

const headers = {
    "Authorization": "Bearer gekadfh6V36DEZbv458Pac1",
    "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 gekadfh6V36DEZbv458Pac1

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

accountPayableReceivable   string     

Example: rem

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\": \"crona.lenna@example.net\",
    \"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": "crona.lenna@example.net",
    "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: crona.lenna@example.net

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 d3EbDva84P1cgfa6V6Zek5h" \
    --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 d3EbDva84P1cgfa6V6Zek5h",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": {
        "id": "7a6ed904-b45f-373b-8471-5d1ddbed014d",
        "name": "Rosemary Hodkiewicz",
        "username": "americo57",
        "email": "lorna75@example.net",
        "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 d3EbDva84P1cgfa6V6Zek5h

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 aZEdPacgVe4f36hD6kvb851" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"certification\": \"Example Certification\",
    \"crea\": \"Example Crea\",
    \"email\": \"user@example.com\",
    \"username\": \"elenor.donnelly\",
    \"password\": \"password123\",
    \"image\": {
        \"0\": \"example1\",
        \"1\": \"example2\",
        \"path\": \"Example Image path\",
        \"name\": \"Example Name\",
        \"extension\": \"Example Image extension\",
        \"size\": \"Example Image size\"
    },
    \"sectors\": [
        \"f26480d5-b637-36ae-a4ba-ea700d282cbe\"
    ],
    \"roles\": [
        \"61b4f901-d9f8-3862-9089-16ff62106005\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/auth/user"
);

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

let body = {
    "name": "Example Name",
    "certification": "Example Certification",
    "crea": "Example Crea",
    "email": "user@example.com",
    "username": "elenor.donnelly",
    "password": "password123",
    "image": {
        "0": "example1",
        "1": "example2",
        "path": "Example Image path",
        "name": "Example Name",
        "extension": "Example Image extension",
        "size": "Example Image size"
    },
    "sectors": [
        "f26480d5-b637-36ae-a4ba-ea700d282cbe"
    ],
    "roles": [
        "61b4f901-d9f8-3862-9089-16ff62106005"
    ]
};

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 aZEdPacgVe4f36hD6kvb851

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: elenor.donnelly

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 63P4Vka58bZdEgDv1fe6ach" \
    --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 63P4Vka58bZdEgDv1fe6ach",
    "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 63P4Vka58bZdEgDv1fe6ach

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 P4gZav1c3Efaed658Dhk6Vb" \
    --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 P4gZav1c3Efaed658Dhk6Vb",
    "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 P4gZav1c3Efaed658Dhk6Vb

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 vg54PkhVZa6Ea1fd8bD63ce" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"key\": \"nmuuzktazgv\",
    \"value\": []
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/auth/preferences"
);

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

let body = {
    "key": "nmuuzktazgv",
    "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 vg54PkhVZa6Ea1fd8bD63ce

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: nmuuzktazgv

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/corporis" \
    --header "Authorization: Bearer cP8aZ46Vg63edhvD1f5bkaE" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/auth/preferences/corporis"
);

const headers = {
    "Authorization": "Bearer cP8aZ46Vg63edhvD1f5bkaE",
    "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 cP8aZ46Vg63edhvD1f5bkaE

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

key   string     

Example: corporis

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 ahV1bc4ek6EPdaZ53Dv6gf8" \
    --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 ahV1bc4ek6EPdaZ53Dv6gf8",
    "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 ahV1bc4ek6EPdaZ53Dv6gf8

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 8Ev41kP635dgfaa6VZebDch" \
    --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 8Ev41kP635dgfaa6VZebDch",
    "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 8Ev41kP635dgfaa6VZebDch

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/dolor" \
    --header "Authorization: Bearer 3g65PfekEdv1acahV48bZ6D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/bank-accounts/transfers/dolor"
);

const headers = {
    "Authorization": "Bearer 3g65PfekEdv1acahV48bZ6D",
    "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 3g65PfekEdv1acahV48bZ6D

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

bankTransfer   string     

Example: dolor

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/18/deposit" \
    --header "Authorization: Bearer 6daDehfZ5g86kvbVa4cP1E3" \
    --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/18/deposit"
);

const headers = {
    "Authorization": "Bearer 6daDehfZ5g86kvbVa4cP1E3",
    "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 6daDehfZ5g86kvbVa4cP1E3

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

bankAccount   integer     

Example: 18

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/6/withdraw" \
    --header "Authorization: Bearer ebcZkE1Vhda5f8gD43P6va6" \
    --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/6/withdraw"
);

const headers = {
    "Authorization": "Bearer ebcZkE1Vhda5f8gD43P6va6",
    "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 ebcZkE1Vhda5f8gD43P6va6

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

bankAccount   integer     

Example: 6

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 aP1ceZD48V3fgahbEv5k6d6" \
    --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 aP1ceZD48V3fgahbEv5k6d6",
    "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 aP1ceZD48V3fgahbEv5k6d6

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 3DVP6vafdb85Ee64hkgZ1ca" \
    --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 3DVP6vafdb85Ee64hkgZ1ca",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": {
        "id": "19adddee-7b18-3c10-869b-5e386ad0fe7a",
        "agency": "0207",
        "account": "6220583-6",
        "type": "caixa",
        "balance": 6222.28,
        "holder_type": "pf",
        "alias": "et",
        "limit": 3831.29,
        "available_balance": 10053.57,
        "used_limit": 0,
        "available_limit": 3831.29,
        "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 3DVP6vafdb85Ee64hkgZ1ca

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 8De6kh6Pca5VvEb134Zgfda" \
    --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 8De6kh6Pca5VvEb134Zgfda",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": [
        {
            "id": "6cee952b-7a82-3d63-ae8c-1a5d0d351c87",
            "agency": "5195",
            "account": "1597094-8",
            "type": "corrente",
            "balance": 3404.43,
            "holder_type": "pj",
            "alias": "ea",
            "limit": 3218.88,
            "available_balance": 6623.3099999999995,
            "used_limit": 0,
            "available_limit": 3218.88,
            "is_default": null,
            "default_payment_method": null,
            "bank": {
                "id": null,
                "name": null,
                "code": null
            },
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "fb776fa0-eb14-39d4-82f6-50604eeb6ac7",
            "agency": "6719",
            "account": "4971546-8",
            "type": "caixa",
            "balance": 5093.84,
            "holder_type": "pf",
            "alias": "eaque",
            "limit": 1115.68,
            "available_balance": 6209.52,
            "used_limit": 0,
            "available_limit": 1115.68,
            "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 8De6kh6Pca5VvEb134Zgfda

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 k5D6caeh6PV84vbaEZ3fdg1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"agency\": \"Example Agency\",
    \"account\": \"8017316-9\",
    \"bank_id\": \"b54ed4ed-3ba3-3374-aecf-54dc76c701d3\",
    \"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 k5D6caeh6PV84vbaEZ3fdg1",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "agency": "Example Agency",
    "account": "8017316-9",
    "bank_id": "b54ed4ed-3ba3-3374-aecf-54dc76c701d3",
    "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 k5D6caeh6PV84vbaEZ3fdg1

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

agency   string     

Agency. Example: Example Agency

account   string     

Account. Example: 8017316-9

bank_id   string     

Bank id. The uuid of an existing record in the banks table. Example: b54ed4ed-3ba3-3374-aecf-54dc76c701d3

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/14" \
    --header "Authorization: Bearer 6P5g6adV183vEhb4eZcfakD" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"agency\": \"Example Agency\",
    \"account\": \"1698718-9\",
    \"bank_id\": \"cdf9cd4b-db2c-3759-ac6e-c0661105ba08\",
    \"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/14"
);

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

let body = {
    "agency": "Example Agency",
    "account": "1698718-9",
    "bank_id": "cdf9cd4b-db2c-3759-ac6e-c0661105ba08",
    "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 6P5g6adV183vEhb4eZcfakD

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

bankAccount   integer     

Example: 14

Body Parameters

agency   string  optional    

Agency. Example: Example Agency

account   string  optional    

Account. Example: 1698718-9

bank_id   string  optional    

Bank id. The uuid of an existing record in the banks table. Example: cdf9cd4b-db2c-3759-ac6e-c0661105ba08

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/10" \
    --header "Authorization: Bearer dg6fD6kea31bh4cv58aVPZE" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/bank-accounts/10"
);

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


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

Example response (200):


{
    "data": {
        "id": "4b62aa65-36ac-328b-a299-1c94f16aee58",
        "agency": "0446",
        "account": "2109213-3",
        "type": "caixa",
        "balance": 3933.5,
        "holder_type": "pj",
        "alias": "et",
        "limit": 7728.6,
        "available_balance": 11662.1,
        "used_limit": 0,
        "available_limit": 7728.6,
        "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 dg6fD6kea31bh4cv58aVPZE

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

bankAccount   integer     

Example: 10

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/10" \
    --header "Authorization: Bearer hZV6efkD1g38EP5b6advac4" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/bank-accounts/10"
);

const headers = {
    "Authorization": "Bearer hZV6efkD1g38EP5b6advac4",
    "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 hZV6efkD1g38EP5b6advac4

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

bankAccount   integer     

Example: 10

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/9/statements/summary" \
    --header "Authorization: Bearer ed4gkEVa85cbDv16aPhf3Z6" \
    --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/9/statements/summary"
);

const headers = {
    "Authorization": "Bearer ed4gkEVa85cbDv16aPhf3Z6",
    "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 ed4gkEVa85cbDv16aPhf3Z6

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

bankAccount   integer     

Example: 9

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/4/statements" \
    --header "Authorization: Bearer 14gcZa8ae3hDd5P6Vkfb6Ev" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"sort_by\": \"aut\",
    \"sort_desc\": false,
    \"page\": 64,
    \"per_page\": 4,
    \"q\": \"zqfblibojlaojabq\",
    \"type\": \"depósito\",
    \"date_start\": \"2026-11-20T15:38:25\",
    \"date_end\": \"2064-06-20\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/bank-accounts/4/statements"
);

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

let body = {
    "sort_by": "aut",
    "sort_desc": false,
    "page": 64,
    "per_page": 4,
    "q": "zqfblibojlaojabq",
    "type": "depósito",
    "date_start": "2026-11-20T15:38:25",
    "date_end": "2064-06-20"
};

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 14gcZa8ae3hDd5P6Vkfb6Ev

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

bankAccount   integer     

Example: 4

Body Parameters

sort_by   string  optional    

Example: aut

sort_desc   boolean  optional    

Example: false

page   integer  optional    

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

per_page   integer  optional    

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

q   string  optional    

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

type   string  optional    

Example: depósito

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-20T15:38:25

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: 2064-06-20

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/20/statements/rerum" \
    --header "Authorization: Bearer a1kD8a6cd3V56fhebvZ4gPE" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/bank-accounts/20/statements/rerum"
);

const headers = {
    "Authorization": "Bearer a1kD8a6cd3V56fhebvZ4gPE",
    "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 a1kD8a6cd3V56fhebvZ4gPE

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

bankAccount   integer     

Example: 20

bankStatement   string     

Example: rerum

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 akaVgPZbv5Dh4e31c6Ef6d8" \
    --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 akaVgPZbv5Dh4e31c6Ef6d8",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": [
        {
            "id": "88383727-bff9-3ea0-9818-79d4a2e25f2b",
            "name": "Campos e Reis",
            "code": "894"
        },
        {
            "id": "928b323a-ca09-32b4-8a4b-5d7a8cd59b44",
            "name": "Azevedo e Ferreira Ltda.",
            "code": "309"
        }
    ],
    "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 akaVgPZbv5Dh4e31c6Ef6d8

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 f6kea86b3Vhcv4Pg1Z5dDEa" \
    --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 f6kea86b3Vhcv4Pg1Z5dDEa",
    "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 f6kea86b3Vhcv4Pg1Z5dDEa

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 deEZ6kfcPa3864DbhVv5ga1" \
    --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 deEZ6kfcPa3864DbhVv5ga1",
    "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 deEZ6kfcPa3864DbhVv5ga1

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 h46af35ekEVPgD61bdcZ8va" \
    --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 h46af35ekEVPgD61bdcZ8va",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": {
        "id": "daa0f086-5c8b-3b7a-a07c-e5337b65e401",
        "name": "Gusmão Comercial Ltda.",
        "code": "35"
    }
}
 

Request      

GET api/banks/{bank}

Headers

Authorization        

Example: Bearer h46af35ekEVPgD61bdcZ8va

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 VkZ6e8cvdE5D6aah3g1b4fP" \
    --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 VkZ6e8cvdE5D6aah3g1b4fP",
    "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 VkZ6e8cvdE5D6aah3g1b4fP

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 cadf6v56D3gb1ehZ48VPkaE" \
    --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 cadf6v56D3gb1ehZ48VPkaE",
    "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 cadf6v56D3gb1ehZ48VPkaE

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=Quibusdam+et+minus+rem+voluptates+velit.&categories[]=rem&date_start=2021-01-01&date_end=2021-01-31&bank_accounts[]=accusamus&customers[]=ut&suppliers[]=ipsum&works[]=ab&cost_centers[]=aliquam" \
    --header "Authorization: Bearer fabhVd5ePk68D6Ea431gZvc" \
    --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": "Quibusdam et minus rem voluptates velit.",
    "categories[0]": "rem",
    "date_start": "2021-01-01",
    "date_end": "2021-01-31",
    "bank_accounts[0]": "accusamus",
    "customers[0]": "ut",
    "suppliers[0]": "ipsum",
    "works[0]": "ab",
    "cost_centers[0]": "aliquam",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer fabhVd5ePk68D6Ea431gZvc",
    "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 fabhVd5ePk68D6Ea431gZvc

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: Quibusdam et minus rem voluptates velit.

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=Libero+nesciunt+amet+eaque+quis.&categories[]=ea&date_start=2021-01-01&date_end=2021-01-31&bank_accounts[]=qui&customers[]=autem&suppliers[]=praesentium&works[]=ab&cost_centers[]=autem" \
    --header "Authorization: Bearer Paac4DE85vZ6hbg6ke1f3dV" \
    --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": "Libero nesciunt amet eaque quis.",
    "categories[0]": "ea",
    "date_start": "2021-01-01",
    "date_end": "2021-01-31",
    "bank_accounts[0]": "qui",
    "customers[0]": "autem",
    "suppliers[0]": "praesentium",
    "works[0]": "ab",
    "cost_centers[0]": "autem",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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


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

Example response (200):


{
    "data": [
        {
            "id": "0223af3a-8828-3201-9da2-b0e016a1d38c",
            "code": "FC-41154410",
            "type": "saída",
            "amount": -6794.72,
            "description": "Optio in incidunt ipsa harum ut quia.",
            "transaction_date": "1980-12-05T03:00:00.000000Z",
            "transaction_category": {
                "id": null,
                "name": null,
                "type": null
            },
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "5b4e4fa5-fd43-3d5d-874f-ac4039dbbbf4",
            "code": "FC-05236183",
            "type": "transferência",
            "amount": -1365.15,
            "description": "Atque temporibus sed consequuntur est ullam molestias.",
            "transaction_date": "1972-06-27T03: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 Paac4DE85vZ6hbg6ke1f3dV

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: Libero nesciunt amet eaque quis.

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 gPcZDEVkvh6ab36d5f81a4e" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"type\": \"Example Type\",
    \"cash_session_id\": \"676c64d5-cabd-306f-9276-22710a90366a\",
    \"transaction_category_id\": \"f7684310-342f-34d4-97ac-e38440e5c6ea\",
    \"bank_account_id\": \"9eeb0fce-a16f-38c8-a976-1a798e56b7c2\",
    \"customer_id\": \"71e032f5-aa86-3dcd-a659-576b1adc12e9\",
    \"supplier_id\": \"fb7e3342-7da2-3dab-bd45-51bbdd10af83\",
    \"work_id\": \"9f843ac0-d39a-3e80-84ea-e9a03f70d95c\",
    \"cost_center_id\": \"dc1eb99a-79fe-310e-b968-e408f7a2adb2\",
    \"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 gPcZDEVkvh6ab36d5f81a4e",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "type": "Example Type",
    "cash_session_id": "676c64d5-cabd-306f-9276-22710a90366a",
    "transaction_category_id": "f7684310-342f-34d4-97ac-e38440e5c6ea",
    "bank_account_id": "9eeb0fce-a16f-38c8-a976-1a798e56b7c2",
    "customer_id": "71e032f5-aa86-3dcd-a659-576b1adc12e9",
    "supplier_id": "fb7e3342-7da2-3dab-bd45-51bbdd10af83",
    "work_id": "9f843ac0-d39a-3e80-84ea-e9a03f70d95c",
    "cost_center_id": "dc1eb99a-79fe-310e-b968-e408f7a2adb2",
    "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 gPcZDEVkvh6ab36d5f81a4e

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: 676c64d5-cabd-306f-9276-22710a90366a

transaction_category_id   string  optional    

Transaction category id. The uuid of an existing record in the transaction_categories table. Example: f7684310-342f-34d4-97ac-e38440e5c6ea

bank_account_id   string  optional    

Bank account id. The uuid of an existing record in the bank_accounts table. Example: 9eeb0fce-a16f-38c8-a976-1a798e56b7c2

customer_id   string  optional    

Customer id. The uuid of an existing record in the customers table. Example: 71e032f5-aa86-3dcd-a659-576b1adc12e9

supplier_id   string  optional    

Supplier id. The uuid of an existing record in the suppliers table. Example: fb7e3342-7da2-3dab-bd45-51bbdd10af83

work_id   string  optional    

Work id. The uuid of an existing record in the works table. Example: 9f843ac0-d39a-3e80-84ea-e9a03f70d95c

cost_center_id   string     

Cost center id. The uuid of an existing record in the cost_centers table. Example: dc1eb99a-79fe-310e-b968-e408f7a2adb2

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/14" \
    --header "Authorization: Bearer hgZa6d4k1E3va6bfVc8DPe5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cash-flows/14"
);

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


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

Example response (200):


{
    "data": {
        "id": "4aaf26fd-fe25-3430-8614-9b318ac2c9d1",
        "code": "FC-85156633",
        "type": "ajuste saída",
        "amount": -4733.22,
        "description": "Laudantium at nemo placeat nam et omnis.",
        "transaction_date": "1994-06-23T03: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 hgZa6d4k1E3va6bfVc8DPe5

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

cashFlow   integer     

Example: 14

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/1" \
    --header "Authorization: Bearer g1acPDZ3h658k6EdVavbf4e" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"type\": \"Example Type\",
    \"cash_session_id\": \"3d99ee7d-3c46-3b21-a261-41147cd1cf3a\",
    \"transaction_category_id\": \"33f01bcb-f468-3578-8f8f-7a12599d8260\",
    \"bank_account_id\": \"3b23adb0-54d5-3cb0-a0dc-f2f01572fdf9\",
    \"customer_id\": \"daef1f8c-8902-314f-b435-c12939482759\",
    \"supplier_id\": \"ce211000-5831-3062-9883-4f7eb93cdaed\",
    \"work_id\": \"83e3e4ab-38cd-3722-bee7-aa7dc18640bf\",
    \"cost_center_id\": \"28a439b2-669b-3956-87ef-7cc67ffa8921\",
    \"amount\": 1,
    \"description\": \"Example Description\",
    \"transaction_date\": \"2024-01-01\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cash-flows/1"
);

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

let body = {
    "type": "Example Type",
    "cash_session_id": "3d99ee7d-3c46-3b21-a261-41147cd1cf3a",
    "transaction_category_id": "33f01bcb-f468-3578-8f8f-7a12599d8260",
    "bank_account_id": "3b23adb0-54d5-3cb0-a0dc-f2f01572fdf9",
    "customer_id": "daef1f8c-8902-314f-b435-c12939482759",
    "supplier_id": "ce211000-5831-3062-9883-4f7eb93cdaed",
    "work_id": "83e3e4ab-38cd-3722-bee7-aa7dc18640bf",
    "cost_center_id": "28a439b2-669b-3956-87ef-7cc67ffa8921",
    "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 g1acPDZ3h658k6EdVavbf4e

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

cashFlow   integer     

Example: 1

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: 3d99ee7d-3c46-3b21-a261-41147cd1cf3a

transaction_category_id   string  optional    

Transaction category id. The uuid of an existing record in the transaction_categories table. Example: 33f01bcb-f468-3578-8f8f-7a12599d8260

bank_account_id   string  optional    

Bank account id. The uuid of an existing record in the bank_accounts table. Example: 3b23adb0-54d5-3cb0-a0dc-f2f01572fdf9

customer_id   string  optional    

Customer id. The uuid of an existing record in the customers table. Example: daef1f8c-8902-314f-b435-c12939482759

supplier_id   string  optional    

Supplier id. The uuid of an existing record in the suppliers table. Example: ce211000-5831-3062-9883-4f7eb93cdaed

work_id   string  optional    

Work id. The uuid of an existing record in the works table. Example: 83e3e4ab-38cd-3722-bee7-aa7dc18640bf

cost_center_id   string     

Cost center id. The uuid of an existing record in the cost_centers table. Example: 28a439b2-669b-3956-87ef-7cc67ffa8921

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/17" \
    --header "Authorization: Bearer 368e4D1dPV56hvakfbZcEga" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cash-flows/17"
);

const headers = {
    "Authorization": "Bearer 368e4D1dPV56hvakfbZcEga",
    "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 368e4D1dPV56hvakfbZcEga

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

cashFlow   integer     

Example: 17

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 1e4ag366DvfdZkPVh85Ebac" \
    --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 1e4ag366DvfdZkPVh85Ebac",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": [
        {
            "id": "93492b00-34ae-3f9c-ab66-fc10e1010c27",
            "code": null,
            "opened_by": null,
            "opened_at": "2021-12-28T03:48:31.000000Z",
            "closed_by": null,
            "closed_at": "1979-05-24T01:21:29.000000Z",
            "opening_balance": 4064.72,
            "closing_balance": 6115.5,
            "total_income": 0,
            "total_expense": 0,
            "total_balance": 0,
            "status": "Fechado",
            "hasSnapshot": false,
            "created_at": "2013-06-05T04:25:53.000000Z",
            "updated_at": "2009-03-10T07:32:48.000000Z"
        },
        {
            "id": "f1bb278b-e1bd-3aee-9f91-d423c146a34c",
            "code": null,
            "opened_by": null,
            "opened_at": "1982-06-12T04:22:51.000000Z",
            "closed_by": null,
            "closed_at": "1986-03-13T18:13:30.000000Z",
            "opening_balance": 1745.01,
            "closing_balance": 4775.03,
            "total_income": 0,
            "total_expense": 0,
            "total_balance": 0,
            "status": "Aberto",
            "hasSnapshot": false,
            "created_at": "1973-01-20T07:05:13.000000Z",
            "updated_at": "2005-12-21T08:50:35.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 1e4ag366DvfdZkPVh85Ebac

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 k13v6P4aDcd5ebZf6gha8EV" \
    --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 k13v6P4aDcd5ebZf6gha8EV",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": {
        "id": "ae44270f-6260-30e0-8e72-9d0ef2a01cb1",
        "code": null,
        "opened_by": null,
        "opened_at": "2020-08-15T01:54:06.000000Z",
        "closed_by": null,
        "closed_at": "1983-09-04T12:29:00.000000Z",
        "opening_balance": 7379.34,
        "closing_balance": 1537.87,
        "total_income": 0,
        "total_expense": 0,
        "total_balance": 0,
        "status": "Aberto",
        "hasSnapshot": false,
        "created_at": "1998-01-08T05:46:38.000000Z",
        "updated_at": "2023-04-17T10:39:37.000000Z"
    }
}
 

Request      

POST api/cash-sessions/open

Headers

Authorization        

Example: Bearer k13v6P4aDcd5ebZf6gha8EV

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/4fe91523-b58c-3b3c-abc1-090c42aded67" \
    --header "Authorization: Bearer DeVabPgahfE663541kcdZ8v" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cash-sessions/close/4fe91523-b58c-3b3c-abc1-090c42aded67"
);

const headers = {
    "Authorization": "Bearer DeVabPgahfE663541kcdZ8v",
    "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 DeVabPgahfE663541kcdZ8v

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

uuid   string     

Example: 4fe91523-b58c-3b3c-abc1-090c42aded67

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/0b61c070-3c1f-31ae-a4d2-e554cc45af87/account-snapshot" \
    --header "Authorization: Bearer 5e6Efav438VZDPbg16kcahd" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cash-sessions/0b61c070-3c1f-31ae-a4d2-e554cc45af87/account-snapshot"
);

const headers = {
    "Authorization": "Bearer 5e6Efav438VZDPbg16kcahd",
    "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 5e6Efav438VZDPbg16kcahd

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

uuid   integer     

Example: 0b61c070-3c1f-31ae-a4d2-e554cc45af87

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/2ef2dc23-2291-30a4-9d46-46925e9d4614" \
    --header "Authorization: Bearer caEhk6VavdgbZf46P381D5e" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cash-sessions/2ef2dc23-2291-30a4-9d46-46925e9d4614"
);

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


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

Example response (200):


{
    "data": {
        "id": "e83a3861-f87a-3f0e-b2a5-f7ff298b0799",
        "code": null,
        "opened_by": null,
        "opened_at": "1979-05-10T16:19:34.000000Z",
        "closed_by": null,
        "closed_at": "2012-02-28T09:34:12.000000Z",
        "opening_balance": 5833.17,
        "closing_balance": 4968.96,
        "total_income": 0,
        "total_expense": 0,
        "total_balance": 0,
        "status": "Aberto",
        "hasSnapshot": false,
        "created_at": "2007-06-13T14:47:26.000000Z",
        "updated_at": "2008-02-18T17:34:03.000000Z"
    }
}
 

Request      

GET api/cash-sessions/{uuid}

Headers

Authorization        

Example: Bearer caEhk6VavdgbZf46P381D5e

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

uuid   integer     

Example: 2ef2dc23-2291-30a4-9d46-46925e9d4614

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/9b281be5-a09d-3feb-95f0-a48c9ad06466" \
    --header "Authorization: Bearer v6VZa8436P5kgfE1Dahdbec" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cash-sessions/9b281be5-a09d-3feb-95f0-a48c9ad06466"
);

const headers = {
    "Authorization": "Bearer v6VZa8436P5kgfE1Dahdbec",
    "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 v6VZa8436P5kgfE1Dahdbec

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

uuid   integer     

Example: 9b281be5-a09d-3feb-95f0-a48c9ad06466

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 P641eafgkZEc8Da3bhv56dV" \
    --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 P641eafgkZEc8Da3bhv56dV",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": [
        {
            "id": "058dd2ae-e822-304e-abf3-a08c40d88788",
            "name": "suscipit eaque",
            "slug": null,
            "abbreviation": "bou",
            "tutorials_count": 0
        },
        {
            "id": "728d98e6-28d0-30a5-9d30-214f36668c71",
            "name": "autem nemo",
            "slug": null,
            "abbreviation": null,
            "tutorials_count": 0
        }
    ]
}
 

Request      

GET api/tutorials/sectors

Headers

Authorization        

Example: Bearer P641eafgkZEc8Da3bhv56dV

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" \
    --header "Authorization: Bearer dc66V3PeDvhga8k4Zf1E5ab" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/tutorials/modules"
);

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


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

Example response (200):


{
    "data": [
        {
            "id": "df0f1d2f-8078-3b8f-8ce7-bc905abd7104",
            "name": "Mollitia ullam",
            "slug": "mollitia-ullam-434893",
            "description": "Necessitatibus mollitia omnis est eos porro dolores deleniti consequatur.",
            "icon": null,
            "color": null,
            "sort_order": 0,
            "is_active": true,
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "681f3564-7f42-38fe-b3ad-841e67073fb6",
            "name": "Quasi voluptatem",
            "slug": "quasi-voluptatem-414990",
            "description": "Qui veritatis minus eos vero.",
            "icon": null,
            "color": null,
            "sort_order": 0,
            "is_active": true,
            "created_at": null,
            "updated_at": null
        }
    ]
}
 

Request      

GET api/tutorials/modules

Headers

Authorization        

Example: Bearer dc66V3PeDvhga8k4Zf1E5ab

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

sector_id   string[]  optional    

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[]=4ddc3a1d-4ac9-3955-8f87-ab575c4d67d1" \
    --header "Authorization: Bearer kagVPbhv4c165a836ZDefdE" \
    --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[0]": "4ddc3a1d-4ac9-3955-8f87-ab575c4d67d1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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


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

Example response (200):


{
    "data": [
        {
            "id": "3a18277c-1268-3bcb-bea0-5347cfd668ea",
            "title": "Rerum rerum eligendi qui",
            "description": "Explicabo consectetur rerum soluta quas quas.",
            "cover_url": null,
            "status": "draft",
            "published_at": null,
            "sort_order": 0,
            "module": {
                "id": "a345c150-9977-4d5a-aec1-a38b47a811f0",
                "name": "Debitis quasi",
                "slug": "debitis-quasi-943726",
                "icon": null,
                "color": null
            },
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "43032ba0-e7fb-3fa9-b22d-cdd9947dfcca",
            "title": "Ut voluptate debitis tenetur",
            "description": "Impedit ut officiis quod unde.",
            "cover_url": null,
            "status": "draft",
            "published_at": null,
            "sort_order": 0,
            "module": {
                "id": "a345c150-a201-49c8-9adc-b2438348980a",
                "name": "Maiores et",
                "slug": "maiores-et-827540",
                "icon": null,
                "color": 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/tutorials

Headers

Authorization        

Example: Bearer kagVPbhv4c165a836ZDefdE

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    

O campo value deve ser um UUID válido. The uuid of an existing record in the tutorial_modules table.

sector_id   string[]  optional    

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 53DP6caeZg16hvEf4akd8Vb" \
    --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 53DP6caeZg16hvEf4akd8Vb",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": {
        "id": "2af4f577-d48b-3f96-812b-b0d35c4fc27d",
        "title": "Itaque ullam velit fugiat",
        "description": "Nulla sit eveniet reprehenderit laudantium nesciunt distinctio tenetur.",
        "cover_url": null,
        "status": "draft",
        "published_at": null,
        "sort_order": 0,
        "module": {
            "id": "a345c150-a847-4164-b6e2-5a955f4ffebd",
            "name": "Doloremque esse",
            "slug": "doloremque-esse-454445",
            "icon": null,
            "color": null
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/tutorials/{id}

Headers

Authorization        

Example: Bearer 53DP6caeZg16hvEf4akd8Vb

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 583ae66ghkDfPE4acvZV1bd" \
    --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 583ae66ghkDfPE4acvZV1bd",
    "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 583ae66ghkDfPE4acvZV1bd

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 Z4aafe6bg3kDh18cdP65vEV" \
    --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\": \"1f0841da-6f62-337a-9dd6-9bef753e3f3c\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/contracts"
);

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

let body = {
    "sort_by": "Example Sort by",
    "sort_desc": true,
    "page": 1,
    "per_page": 1,
    "work_id": "1f0841da-6f62-337a-9dd6-9bef753e3f3c"
};

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

Example response (200):


{
    "data": [
        {
            "id": "6dfceec5-31e2-3653-bcd9-695fd8fdce30",
            "number": "756/2026",
            "started_at": "2026-11-20",
            "deadline_at": "2027-11-20",
            "work": {
                "id": "a345c145-2f86-4e4d-a5c0-77e26471d17f",
                "name": "Benjamin das Dores Quintana Sobrinho"
            },
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "379e43fb-0e39-33a6-a056-155d3791b3eb",
            "number": "596/2026",
            "started_at": "2026-11-20",
            "deadline_at": "2027-11-20",
            "work": {
                "id": "a345c145-3789-49ea-a879-81e842ac32b7",
                "name": "Emiliano Benez Mascarenhas"
            },
            "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 Z4aafe6bg3kDh18cdP65vEV

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: 1f0841da-6f62-337a-9dd6-9bef753e3f3c

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 Z5vgaE83ca1fh6DVPkd6e4b" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"work_id\": \"4356bc69-fb06-34fa-9835-28ffc5040cbc\",
    \"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 Z5vgaE83ca1fh6DVPkd6e4b",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "work_id": "4356bc69-fb06-34fa-9835-28ffc5040cbc",
    "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 Z5vgaE83ca1fh6DVPkd6e4b

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: 4356bc69-fb06-34fa-9835-28ffc5040cbc

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/17" \
    --header "Authorization: Bearer vegEbZd8P3cfDa514ak66Vh" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/contracts/17"
);

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


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

Example response (200):


{
    "data": {
        "id": "89cca673-0376-3f4c-af33-92cf6869847b",
        "number": "468/2026",
        "started_at": "2026-11-20",
        "deadline_at": "2027-11-20",
        "work": {
            "id": "a345c145-439b-4471-8666-bc122001a77d",
            "name": "Sra. Daiana Meireles Matos Jr."
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/contracts/{id}

Headers

Authorization        

Example: Bearer vegEbZd8P3cfDa514ak66Vh

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the contract. Example: 17

contract   string     

Contract UUID Example: blanditiis

Update contract

requires authentication contract update

Update a work contract

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/contracts/12" \
    --header "Authorization: Bearer dZebg5fhP66V8aEavkc4D31" \
    --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/12"
);

const headers = {
    "Authorization": "Bearer dZebg5fhP66V8aEavkc4D31",
    "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 dZebg5fhP66V8aEavkc4D31

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the contract. Example: 12

contract   string     

Contract UUID Example: aut

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/omnis" \
    --header "Authorization: Bearer ebPdVfcvg5E6Dk8Za3h16a4" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/contracts/omnis"
);

const headers = {
    "Authorization": "Bearer ebPdVfcvg5E6Dk8Za3h16a4",
    "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 ebPdVfcvg5E6Dk8Za3h16a4

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

contract   string     

Contract UUID Example: omnis

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=et" \
    --header "Authorization: Bearer Ec3P1gZa6d58DafVke4b6vh" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"parent_id\": \"facilis\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cost-centers/next-code"
);

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

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

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

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 Ec3P1gZa6d58DafVke4b6vh

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: et

Body Parameters

parent_id   string  optional    

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

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 PbDhcaV5vgZe136da46fk8E" \
    --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 PbDhcaV5vgZe136da46fk8E",
    "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 PbDhcaV5vgZe136da46fk8E

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 8a366PfvaDhgEV4bc1dek5Z" \
    --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 8a366PfvaDhgEV4bc1dek5Z",
    "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 8a366PfvaDhgEV4bc1dek5Z

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 481e66hZa5PkfDcgv3aVdbE" \
    --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 481e66hZa5PkfDcgv3aVdbE",
    "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 481e66hZa5PkfDcgv3aVdbE

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 V4ahZ8gE3av61k5bPD6fdce" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"cost_center_id\": \"error\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cost-centers/stock-config"
);

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

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

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 V4ahZ8gE3av61k5bPD6fdce

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

cost_center_id   string     

UUID do centro de custo, ou nulo Example: error

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 3khagEceb5fvP641adV86DZ" \
    --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 3khagEceb5fvP641adV86DZ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": [
        {
            "id": "a6297499-50e7-3c44-b71b-26e236279320",
            "code": "576",
            "name": "rerum reiciendis",
            "level": 1,
            "path": null,
            "is_active": true,
            "selectable": false,
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "6bb6cfb7-7c99-3bcd-85e4-117894517c38",
            "code": "132",
            "name": "expedita qui",
            "level": 1,
            "path": null,
            "is_active": true,
            "selectable": false,
            "created_at": null,
            "updated_at": null
        }
    ]
}
 

Request      

GET api/cost-centers

Headers

Authorization        

Example: Bearer 3khagEceb5fvP641adV86DZ

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/ut" \
    --header "Authorization: Bearer 5dPgka1bc6fDE48e6Zvha3V" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cost-centers/ut"
);

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


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

Example response (200):


{
    "data": {
        "id": "d8a0be3e-86f3-3f81-a6eb-75ebb3410381",
        "code": "769",
        "name": "quibusdam aut",
        "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 5dPgka1bc6fDE48e6Zvha3V

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

costCenter   string     

Cost center UUID Example: ut

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 k6deEbgca31v64DaVP5Zf8h" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"code\": \"Example Code\",
    \"name\": \"Example Name\",
    \"parent_id\": \"12192e3a-5238-30d5-bc00-78853bd5ac1b\",
    \"work_id\": \"8062e25f-4ab3-39c6-881e-d792141b93f3\",
    \"is_active\": true
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cost-centers"
);

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

let body = {
    "code": "Example Code",
    "name": "Example Name",
    "parent_id": "12192e3a-5238-30d5-bc00-78853bd5ac1b",
    "work_id": "8062e25f-4ab3-39c6-881e-d792141b93f3",
    "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 k6deEbgca31v64DaVP5Zf8h

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: 12192e3a-5238-30d5-bc00-78853bd5ac1b

work_id   string  optional    

Obra. The uuid of an existing record in the works table. Example: 8062e25f-4ab3-39c6-881e-d792141b93f3

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/voluptatum" \
    --header "Authorization: Bearer 68E5fbPc3va61VagkD4dZhe" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"code\": \"Example Code\",
    \"name\": \"Example Name\",
    \"parent_id\": \"dff3e3a0-f1b9-3243-b125-cdde304eab27\",
    \"work_id\": \"9828cb0e-f057-34d6-92b6-e80862982338\",
    \"is_active\": true
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cost-centers/voluptatum"
);

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

let body = {
    "code": "Example Code",
    "name": "Example Name",
    "parent_id": "dff3e3a0-f1b9-3243-b125-cdde304eab27",
    "work_id": "9828cb0e-f057-34d6-92b6-e80862982338",
    "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 68E5fbPc3va61VagkD4dZhe

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

costCenter   string     

Cost center UUID Example: voluptatum

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: dff3e3a0-f1b9-3243-b125-cdde304eab27

work_id   string  optional    

Obra. The uuid of an existing record in the works table. Example: 9828cb0e-f057-34d6-92b6-e80862982338

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/cupiditate" \
    --header "Authorization: Bearer Pva3ab186EkhV4ZD5ecfd6g" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cost-centers/cupiditate"
);

const headers = {
    "Authorization": "Bearer Pva3ab186EkhV4ZD5ecfd6g",
    "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 Pva3ab186EkhV4ZD5ecfd6g

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

costCenter   string     

Cost center UUID Example: cupiditate

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 eP4a3c65dh8abE1DgVfv6kZ" \
    --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 eP4a3c65dh8abE1DgVfv6kZ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": [
        {
            "id": "2799b654-8225-30ea-b354-136afb1d9826",
            "name": "Dr. Elias Soares Pacheco",
            "email": "jverdugo@example.net",
            "phone": "(84) 97916-4051",
            "document": "350.234.082-05",
            "type": "pf",
            "responsible": "Dr. Olívia Gusmão Beltrão",
            "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": "b697a378-20d8-3396-bcf5-1c16dc1e1ca7",
            "name": "Sr. Gustavo Assunção",
            "email": "george.brito@example.net",
            "phone": "(92) 3329-3797",
            "document": "365.702.172-83",
            "type": "pf",
            "responsible": "Allison Espinoza Dominato Sobrinho",
            "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 eP4a3c65dh8abE1DgVfv6kZ

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 cEZdabgVk663P15vaehD8f4" \
    --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 cEZdabgVk663P15vaehD8f4",
    "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 cEZdabgVk663P15vaehD8f4

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/1" \
    --header "Authorization: Bearer Pbgefa48avc36D5EkZ6V1dh" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/customers/1"
);

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


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

Example response (200):


{
    "data": {
        "id": "c974e892-8268-3063-af07-1f83bb5c1ce1",
        "name": "Srta. Fabiana Cordeiro Filho",
        "email": "uferreira@example.com",
        "phone": "(62) 97413-7396",
        "document": "245.254.131-15",
        "type": "pf",
        "responsible": "Victor Rangel Sobrinho",
        "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 Pbgefa48avc36D5EkZ6V1dh

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the customer. Example: 1

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/8" \
    --header "Authorization: Bearer kaZ56cb4ge8a3V6hdvEDfP1" \
    --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/8"
);

const headers = {
    "Authorization": "Bearer kaZ56cb4ge8a3V6hdvEDfP1",
    "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 kaZ56cb4ge8a3V6hdvEDfP1

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the customer. Example: 8

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 caf5hkZba16egdVP4D3E6v8" \
    --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 caf5hkZba16egdVP4D3E6v8",
    "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 caf5hkZba16egdVP4D3E6v8

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 8bZfkh3Ea5Vg6dD1a4cPv6e" \
    --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\": \"a8986081-ba7e-3bc6-b571-99a61735abcf\",
    \"contract_id\": \"0f1b3398-b33d-3a07-929a-3514af1b37f8\",
    \"status_id\": \"affef2a7-0209-3199-9007-0618d5d28abb\",
    \"filled_by\": \"249ae3b2-3f26-384c-8578-ab5a6b4c6631\",
    \"responsible_id\": \"1e354100-db35-3515-a2bc-148fff564129\",
    \"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 8bZfkh3Ea5Vg6dD1a4cPv6e",
    "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": "a8986081-ba7e-3bc6-b571-99a61735abcf",
    "contract_id": "0f1b3398-b33d-3a07-929a-3514af1b37f8",
    "status_id": "affef2a7-0209-3199-9007-0618d5d28abb",
    "filled_by": "249ae3b2-3f26-384c-8578-ab5a6b4c6631",
    "responsible_id": "1e354100-db35-3515-a2bc-148fff564129",
    "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": "76e54f11-a512-365d-983f-ff908b58c341",
            "code": "RDO-20-11-26",
            "report_number": 1,
            "date": "2026-11-20",
            "status": {
                "id": "a345c145-a7fc-4933-81e0-3d7478917e57",
                "slug": null,
                "name": null,
                "abbreviation": "debitis",
                "color": "#3bf462",
                "text_color": "#c403ac"
            },
            "work": {
                "id": "a345c145-a023-44c4-8d64-c72e3f1766b1",
                "name": "Sr. Juan Madeira",
                "started_at": "1987-07-30 02:13:15"
            },
            "filled_by": {
                "id": "a345c145-a528-4af6-81e2-909f2a828699",
                "name": "Tate Jaskolski"
            },
            "contract_number": "726/2026",
            "deadline_at": "2027-11-20",
            "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": "8f68c10d-30c9-36d3-a8f2-c2ba14ae9fd8",
            "code": "RDO-20-11-26",
            "report_number": 1,
            "date": "2026-11-20",
            "status": {
                "id": "a345c145-b0fc-4c26-8c36-604a743966b4",
                "slug": null,
                "name": null,
                "abbreviation": "enim",
                "color": "#daf20f",
                "text_color": "#bcd259"
            },
            "work": {
                "id": "a345c145-ab6f-42fd-bb90-1fd4b0a4bd63",
                "name": "Dr. Michelle Melissa Lutero Jr.",
                "started_at": "2008-05-13 15:11:44"
            },
            "filled_by": {
                "id": "a345c145-af42-4a74-98f0-3d5dd46913b9",
                "name": "Miss Leilani Rutherford"
            },
            "contract_number": "521/2026",
            "deadline_at": "2027-11-20",
            "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 8bZfkh3Ea5Vg6dD1a4cPv6e

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: a8986081-ba7e-3bc6-b571-99a61735abcf

contract_id   string  optional    

Contrato. The uuid of an existing record in the contracts table. Example: 0f1b3398-b33d-3a07-929a-3514af1b37f8

status_id   string  optional    

Status. The uuid of an existing record in the statuses table. Example: affef2a7-0209-3199-9007-0618d5d28abb

filled_by   string  optional    

Preenchido por. The uuid of an existing record in the users table. Example: 249ae3b2-3f26-384c-8578-ab5a6b4c6631

responsible_id   string  optional    

Responsável. The uuid of an existing record in the users table. Example: 1e354100-db35-3515-a2bc-148fff564129

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 bg6843k6EDdP1he5cfZVaav" \
    --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 bg6843k6EDdP1he5cfZVaav",
    "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 bg6843k6EDdP1he5cfZVaav

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/maxime" \
    --header "Authorization: Bearer Vb6ek8a6d3cZfgD1aP45hvE" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/daily-logs/maxime"
);

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


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

Example response (200):


{
    "data": {
        "id": "e462a1a0-c3a8-3b56-b4d7-21110e1d51af",
        "code": "RDO-20-11-26",
        "report_number": 1,
        "date": "2026-11-20",
        "status": {
            "id": "a345c145-cb15-412f-b756-b1ff88a7e4c3",
            "slug": null,
            "name": null,
            "abbreviation": "quia",
            "color": "#5e834c",
            "text_color": "#f757eb"
        },
        "work": {
            "id": "a345c145-c3f7-4296-9f81-958092731b09",
            "name": "Dr. Maria Marin Cordeiro Neto",
            "started_at": "1994-09-19 17:29:58"
        },
        "filled_by": {
            "id": "a345c145-c8fa-4ac0-aaaa-b412a310d67b",
            "name": "Stephanie Runolfsdottir"
        },
        "contract_number": "479/2026",
        "deadline_at": "2027-11-20",
        "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 Vb6ek8a6d3cZfgD1aP45hvE

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

dailyLog   string     

Daily Log UUID Example: maxime

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 Ekv6ac3feDZh5a1b4g6dPV8" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"contract_id\": \"Example Contract id\",
    \"date\": \"2024-01-01\",
    \"status_id\": \"d9c1c388-ba68-33db-81c0-2c8b61e96af1\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/daily-logs"
);

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

let body = {
    "contract_id": "Example Contract id",
    "date": "2024-01-01",
    "status_id": "d9c1c388-ba68-33db-81c0-2c8b61e96af1"
};

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 Ekv6ac3feDZh5a1b4g6dPV8

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: d9c1c388-ba68-33db-81c0-2c8b61e96af1

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/ut" \
    --header "Authorization: Bearer c4bEheVk63DZvP1f8g5ada6" \
    --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\": \"92ddbb15-57da-4964-9fcd-07bfa451d90e\",
            \"quantity\": 1
        },
        null
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/daily-logs/ut"
);

const headers = {
    "Authorization": "Bearer c4bEheVk63DZvP1f8g5ada6",
    "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": "92ddbb15-57da-4964-9fcd-07bfa451d90e",
            "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 c4bEheVk63DZvP1f8g5ada6

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

dailyLog   string     

Daily Log UUID Example: ut

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: 92ddbb15-57da-4964-9fcd-07bfa451d90e

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/error/finalize" \
    --header "Authorization: Bearer eE1b63kDd8af56cvg4PZVah" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/daily-logs/error/finalize"
);

const headers = {
    "Authorization": "Bearer eE1b63kDd8af56cvg4PZVah",
    "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 eE1b63kDd8af56cvg4PZVah

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

dailyLog   string     

Daily Log UUID Example: error

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/aut/signed-document" \
    --header "Authorization: Bearer Zg54ac1V6d8DPakb6h3vEfe" \
    --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/aut/signed-document"
);

const headers = {
    "Authorization": "Bearer Zg54ac1V6d8DPakb6h3vEfe",
    "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 Zg54ac1V6d8DPakb6h3vEfe

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

dailyLog   string     

Daily Log UUID Example: aut

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/et/reopen" \
    --header "Authorization: Bearer VkaD568bhZeg4Ed6vfc3Pa1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/daily-logs/et/reopen"
);

const headers = {
    "Authorization": "Bearer VkaD568bhZeg4Ed6vfc3Pa1",
    "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 VkaD568bhZeg4Ed6vfc3Pa1

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

dailyLog   string     

Daily Log UUID Example: et

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/perspiciatis/photos" \
    --header "Authorization: Bearer egE8ba46fa5h6vcZk1dPDV3" \
    --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/perspiciatis/photos"
);

const headers = {
    "Authorization": "Bearer egE8ba46fa5h6vcZk1dPDV3",
    "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 egE8ba46fa5h6vcZk1dPDV3

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

dailyLog   string     

Daily Log UUID Example: perspiciatis

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/et/photos/omnis" \
    --header "Authorization: Bearer h1e5a34b8Vkca6fgvdEP6DZ" \
    --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/et/photos/omnis"
);

const headers = {
    "Authorization": "Bearer h1e5a34b8Vkca6fgvdEP6DZ",
    "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 h1e5a34b8Vkca6fgvdEP6DZ

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

dailyLog   string     

Daily Log UUID Example: et

id   string     

The ID of the photo. Example: omnis

photo   string     

Photo (File) UUID Example: nihil

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/sit/photos/vero" \
    --header "Authorization: Bearer 86VgE1hkPv5Z46fDba3acde" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/daily-logs/sit/photos/vero"
);

const headers = {
    "Authorization": "Bearer 86VgE1hkPv5Z46fDba3acde",
    "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 86VgE1hkPv5Z46fDba3acde

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

dailyLog   string     

Daily Log UUID Example: sit

photo   string     

Photo (File) UUID Example: vero

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/eum" \
    --header "Authorization: Bearer 3gED6hVfb1dZcePa4v65ak8" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/daily-logs/eum"
);

const headers = {
    "Authorization": "Bearer 3gED6hVfb1dZcePa4v65ak8",
    "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 3gED6hVfb1dZcePa4v65ak8

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

dailyLog   string     

Daily Log UUID Example: eum

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 8PD1abd56g46ZEhvac3kfeV" \
    --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 8PD1abd56g46ZEhvac3kfeV",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": [
        {
            "id": "7b628763-5528-3309-b8a5-5f4a7ff849c0",
            "name": "Odit",
            "code": "YMX",
            "description": "Quaerat excepturi consequatur omnis ut sit laborum.",
            "active": true
        },
        {
            "id": "3f97468b-f2e8-3ff1-89ed-ac3100382ee6",
            "name": "Facere",
            "code": "OWY",
            "description": "Impedit molestiae dignissimos repellendus autem.",
            "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 8PD1abd56g46ZEhvac3kfeV

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 hadDk66854cZPf3VbvaE1ge" \
    --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 hadDk66854cZPf3VbvaE1ge",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": {
        "id": "05b34e6f-6073-3895-8e2e-f9b4a3b62377",
        "name": "Iure",
        "code": "WEO",
        "description": "Dicta sed ut amet quia quae ea neque.",
        "active": true
    }
}
 

Request      

GET api/disciplines/{id}

Headers

Authorization        

Example: Bearer hadDk66854cZPf3VbvaE1ge

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: nam

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 51Dc8eavk3dgZahV46bEf6P" \
    --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 51Dc8eavk3dgZahV46bEf6P",
    "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 51Dc8eavk3dgZahV46bEf6P

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 3k5ae41DvV8c6ZfhbdEPga6" \
    --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 3k5ae41DvV8c6ZfhbdEPga6",
    "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 3k5ae41DvV8c6ZfhbdEPga6

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: perferendis

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/asperiores" \
    --header "Authorization: Bearer acPdEbh6513vkaDeV86Zg4f" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/disciplines/asperiores"
);

const headers = {
    "Authorization": "Bearer acPdEbh6513vkaDeV86Zg4f",
    "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 acPdEbh6513vkaDeV86Zg4f

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

discipline   string     

Discipline UUID Example: asperiores

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 1v4a6eVEcDP36Zak5fg8hbd" \
    --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 1v4a6eVEcDP36Zak5fg8hbd",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": [
        {
            "id": "f14b22f8-caa7-3249-92f8-4057f1921f46",
            "name": "Aparecida da Rosa Ortega Filho",
            "description": "Quo corporis consequatur ullam et sed. Qui qui eius ad ab nihil et quas dolores. Et quidem consectetur cupiditate consequatur. Sint natus sed iste blanditiis est odio illo dolore.",
            "module": "document"
        },
        {
            "id": "03391b8b-5bbb-33f7-b172-ad15fade0c21",
            "name": "Rogério Noel Sanches",
            "description": "Voluptas pariatur qui quia et error. Quis numquam quidem non dicta. Rem nobis ducimus impedit saepe atque dicta. Molestiae qui voluptatem dolore.",
            "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 1v4a6eVEcDP36Zak5fg8hbd

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/quae" \
    --header "Authorization: Bearer k6vPa4ge68fba3hcVED1d5Z" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/document-categories/quae"
);

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


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

Example response (200):


{
    "data": {
        "id": "a4a5a4d9-03a3-3942-982a-dc9857f07f9a",
        "name": "Srta. Manoela Tâmara Rezende",
        "description": "Voluptatem soluta rerum amet sequi est. Dicta sed magnam facere modi. Ut repellendus minus repellat tempore quia.",
        "module": "document"
    }
}
 

Request      

GET api/document-categories/{documentCategory}

Headers

Authorization        

Example: Bearer k6vPa4ge68fba3hcVED1d5Z

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

documentCategory   string     

Document category UUID Example: quae

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 54g6kch13DfZvbEV68dePaa" \
    --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 54g6kch13DfZvbEV68dePaa",
    "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 54g6kch13DfZvbEV68dePaa

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/voluptatem" \
    --header "Authorization: Bearer ZEcavf6g58ePD6b3k41hdaV" \
    --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/voluptatem"
);

const headers = {
    "Authorization": "Bearer ZEcavf6g58ePD6b3k41hdaV",
    "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 ZEcavf6g58ePD6b3k41hdaV

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

documentCategory   string     

Document category UUID Example: voluptatem

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/dolorem" \
    --header "Authorization: Bearer 83ec6ZVaPdkE5fD1ha64gvb" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/document-categories/dolorem"
);

const headers = {
    "Authorization": "Bearer 83ec6ZVaPdkE5fD1ha64gvb",
    "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 83ec6ZVaPdkE5fD1ha64gvb

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

documentCategory   string     

Document category UUID Example: dolorem

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[]=est&documentable_type=tempore&customers[]=consectetur&suppliers[]=assumenda" \
    --header "Authorization: Bearer hedb5agV1Eck46vf8PDZ36a" \
    --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]": "est",
    "documentable_type": "tempore",
    "customers[0]": "consectetur",
    "suppliers[0]": "assumenda",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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


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

Example response (200):


{
    "data": [
        {
            "id": "e6976f09-89ee-32b3-b92a-0bbbfc0bcef6",
            "name": "Sr. George Henrique Camacho Filho",
            "file": {
                "id": null,
                "url": null,
                "extension": null
            },
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "a8f4c485-cce7-325d-af7a-4f9a8460b044",
            "name": "Patrícia Rebeca Marés",
            "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 hedb5agV1Eck46vf8PDZ36a

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: tempore

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/19" \
    --header "Authorization: Bearer eEb3Zc64fvdgaVh1856DaPk" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/documents/19"
);

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


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

Example response (200):


{
    "data": {
        "id": "29b10726-064d-3d60-8f8c-b83b5871e443",
        "name": "Dr. Pablo Benedito Quintana",
        "file": {
            "id": null,
            "url": null,
            "extension": null
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/documents/{id}

Headers

Authorization        

Example: Bearer eEb3Zc64fvdgaVh1856DaPk

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the document. Example: 19

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 d16b3a68fhakc54VgEZPeDv" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"category_id\": \"8cd85fd9-54c6-354e-97de-d36435f6ccf5\",
    \"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 d16b3a68fhakc54VgEZPeDv",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "category_id": "8cd85fd9-54c6-354e-97de-d36435f6ccf5",
    "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 d16b3a68fhakc54VgEZPeDv

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: 8cd85fd9-54c6-354e-97de-d36435f6ccf5

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/15" \
    --header "Authorization: Bearer g6cPa3vE5k4edDZfh16Vab8" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"category_id\": \"84daaa51-7b16-3de8-af5b-efe7bf72f1eb\",
    \"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/15"
);

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

let body = {
    "name": "Example Name",
    "category_id": "84daaa51-7b16-3de8-af5b-efe7bf72f1eb",
    "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 g6cPa3vE5k4edDZfh16Vab8

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the document. Example: 15

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: 84daaa51-7b16-3de8-af5b-efe7bf72f1eb

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 c6ZbVPehdavkEa531gD84f6" \
    --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 c6ZbVPehdavkEa531gD84f6",
    "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 c6ZbVPehdavkEa531gD84f6

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 P1va8d4keDZa5b6EfV3hg6c" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"q\": \"voluptas\",
    \"renewal_status\": \"completed\",
    \"urgency\": \"expired\",
    \"employee_id\": \"rem\",
    \"epi_type_id\": \"ut\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/epi-renewals"
);

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

let body = {
    "q": "voluptas",
    "renewal_status": "completed",
    "urgency": "expired",
    "employee_id": "rem",
    "epi_type_id": "ut"
};

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 P1va8d4keDZa5b6EfV3hg6c

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

q   string  optional    

Example: voluptas

renewal_status   string  optional    

Example: completed

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

Example: expired

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: rem

epi_type_id   string  optional    

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

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 gdZeb8E36hkD1a6vf5VPa4c" \
    --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 gdZeb8E36hkD1a6vf5VPa4c",
    "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 gdZeb8E36hkD1a6vf5VPa4c

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/quia/renew" \
    --header "Authorization: Bearer egb5Pka1av8cD4VEdZ63fh6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"quantity\": 1,
    \"condition\": \"new\",
    \"confirm_insufficient_stock\": false
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/epi-renewals/quia/renew"
);

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

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

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

Request      

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

Headers

Authorization        

Example: Bearer egb5Pka1av8cD4VEdZ63fh6

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

EPI delivery UUID Example: quia

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: false

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/natus/ignore" \
    --header "Authorization: Bearer Z1EdPbah568gVk4e36cfaDv" \
    --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/natus/ignore"
);

const headers = {
    "Authorization": "Bearer Z1EdPbah568gVk4e36cfaDv",
    "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 Z1EdPbah568gVk4e36cfaDv

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

EPI delivery UUID Example: natus

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/quia/ignore" \
    --header "Authorization: Bearer ak6V1bDPh5cgE86dZv43efa" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/epi-renewals/quia/ignore"
);

const headers = {
    "Authorization": "Bearer ak6V1bDPh5cgE86dZv43efa",
    "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 ak6V1bDPh5cgE86dZv43efa

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

EPI delivery UUID Example: quia

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 D8v5ebZhdgcE6ak1af463VP" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"q\": \"velit\",
    \"stock_id\": \"natus\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/epi-types"
);

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

let body = {
    "q": "velit",
    "stock_id": "natus"
};

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

Example response (200):


{
    "data": [
        {
            "id": "652f1a37-0433-3eeb-a5ce-db9923622fac",
            "name": "laborum reprehenderit",
            "default_validity_days": 550,
            "requires_signature": false,
            "numero_ca": "44037",
            "product": null,
            "available_quantity": null,
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "7c803c88-acec-3a4d-9760-ad514ae599cf",
            "name": "facilis voluptates",
            "default_validity_days": 265,
            "requires_signature": false,
            "numero_ca": "26203",
            "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 D8v5ebZhdgcE6ak1af463VP

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

q   string  optional    

Example: velit

stock_id   string  optional    

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

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 afv6be5k8V36hZacDgdP4E1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"q\": \"non\",
    \"stock_id\": \"culpa\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/epi-types/candidates"
);

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

let body = {
    "q": "non",
    "stock_id": "culpa"
};

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 afv6be5k8V36hZacDgdP4E1

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

q   string  optional    

Example: non

stock_id   string  optional    

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

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/quis" \
    --header "Authorization: Bearer bc66aZ51dag4EP8fveV3hkD" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/epi-types/quis"
);

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


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

Example response (200):


{
    "data": {
        "id": "c769ddaa-c953-33cc-a692-764d2326b1aa",
        "name": "dignissimos aliquam",
        "default_validity_days": 315,
        "requires_signature": false,
        "numero_ca": "35020",
        "product": null,
        "available_quantity": null,
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/epi-types/{epiType}

Headers

Authorization        

Example: Bearer bc66aZ51dag4EP8fveV3hkD

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

epiType   string     

EPI type UUID Example: quis

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 6Dev4aEdf65kV3ab1ch8ZgP" \
    --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\": \"15c2991b-1cc2-3c35-940b-be10412856b4\",
    \"product_family_id\": \"ae65ff5d-8a75-392f-bf72-250e86e3728e\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/epi-types"
);

const headers = {
    "Authorization": "Bearer 6Dev4aEdf65kV3ab1ch8ZgP",
    "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": "15c2991b-1cc2-3c35-940b-be10412856b4",
    "product_family_id": "ae65ff5d-8a75-392f-bf72-250e86e3728e"
};

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 6Dev4aEdf65kV3ab1ch8ZgP

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: 15c2991b-1cc2-3c35-940b-be10412856b4

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: ae65ff5d-8a75-392f-bf72-250e86e3728e

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 6ZEbcd1av4eDka3P58h6Vgf" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"items\": [
        {
            \"epi_type_id\": \"1b06eb24-7d5a-35dd-a224-894f0345881e\",
            \"action\": \"Example Items * action\",
            \"product_id\": \"38228572-c2f3-37aa-a262-c660aa8ead9f\",
            \"product_family_id\": \"04defd1a-7d92-3345-8d0a-87a54d1c76bc\"
        },
        null
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/epi-types/link-products"
);

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

let body = {
    "items": [
        {
            "epi_type_id": "1b06eb24-7d5a-35dd-a224-894f0345881e",
            "action": "Example Items * action",
            "product_id": "38228572-c2f3-37aa-a262-c660aa8ead9f",
            "product_family_id": "04defd1a-7d92-3345-8d0a-87a54d1c76bc"
        },
        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/illum/product" \
    --header "Authorization: Bearer 6EP615kgv4hebacdDf8aZV3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"action\": \"Example Action\",
    \"product_id\": \"5571e028-dd7f-3653-b516-60f661ac0949\",
    \"product_family_id\": \"82a74edb-2896-3253-aa3a-daf3b60294c2\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/epi-types/illum/product"
);

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

let body = {
    "action": "Example Action",
    "product_id": "5571e028-dd7f-3653-b516-60f661ac0949",
    "product_family_id": "82a74edb-2896-3253-aa3a-daf3b60294c2"
};

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

Request      

PUT api/epi-types/{epiType}/product

Headers

Authorization        

Example: Bearer 6EP615kgv4hebacdDf8aZV3

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

epiType   string     

EPI type UUID Example: illum

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: 5571e028-dd7f-3653-b516-60f661ac0949

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: 82a74edb-2896-3253-aa3a-daf3b60294c2

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/atque" \
    --header "Authorization: Bearer 6fPgEa8V3kavebc46h1dD5Z" \
    --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/atque"
);

const headers = {
    "Authorization": "Bearer 6fPgEa8V3kavebc46h1dD5Z",
    "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 6fPgEa8V3kavebc46h1dD5Z

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

epiType   string     

EPI type UUID Example: atque

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/sit" \
    --header "Authorization: Bearer Ea6D61VkaZfbPc4e5vgd3h8" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/epi-types/sit"
);

const headers = {
    "Authorization": "Bearer Ea6D61VkaZfbPc4e5vgd3h8",
    "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 Ea6D61VkaZfbPc4e5vgd3h8

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

epiType   string     

EPI type UUID Example: sit

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 db4haZE3a18vD6cf56kVePg" \
    --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 db4haZE3a18vD6cf56kVePg",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": [
        {
            "id": "f41d6817-7e3f-4502-b1f7-f56e6dfa198f",
            "name": "vel",
            "description": null,
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "d09eb30a-9f22-4276-bfa0-096913e9d5d2",
            "name": "accusamus",
            "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 db4haZE3a18vD6cf56kVePg

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/est" \
    --header "Authorization: Bearer b6Zck46a1Ev3V8h5fDegdaP" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employee-roles/est"
);

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


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

Example response (200):


{
    "data": {
        "id": "6e2d1bc4-bb90-445e-913a-36f9d6f86bfd",
        "name": "cumque",
        "description": null,
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/employee-roles/{employeeRole}

Headers

Authorization        

Example: Bearer b6Zck46a1Ev3V8h5fDegdaP

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employeeRole   string     

Employee Role UUID Example: est

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 Dagef5hZk166c8PVda4Eb3v" \
    --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 Dagef5hZk166c8PVda4Eb3v",
    "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 Dagef5hZk166c8PVda4Eb3v

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/magnam" \
    --header "Authorization: Bearer P4bacveD18356E6gahVZfkd" \
    --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/magnam"
);

const headers = {
    "Authorization": "Bearer P4bacveD18356E6gahVZfkd",
    "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 P4bacveD18356E6gahVZfkd

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employeeRole   string     

Employee Role UUID Example: magnam

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/rerum" \
    --header "Authorization: Bearer bedvP61ZkhEDf68Va5c3ga4" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employee-roles/rerum"
);

const headers = {
    "Authorization": "Bearer bedvP61ZkhEDf68Va5c3ga4",
    "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 bedvP61ZkhEDf68Va5c3ga4

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employeeRole   string     

Employee Role UUID Example: rerum

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 bf3e4gV6EaZaDPc8k1dv5h6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"sort_by\": \"created_at\",
    \"sort_desc\": true,
    \"page\": 76,
    \"per_page\": 7,
    \"q\": \"est\",
    \"employee_id\": \"recusandae\",
    \"has_term\": false
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/epi-terms"
);

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

let body = {
    "sort_by": "created_at",
    "sort_desc": true,
    "page": 76,
    "per_page": 7,
    "q": "est",
    "employee_id": "recusandae",
    "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 bf3e4gV6EaZaDPc8k1dv5h6

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: true

page   integer  optional    

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

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: est

employee_id   string  optional    

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

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[]=sapiente&admission_date_from=2026-01-01&admission_date_to=2026-12-31" \
    --header "Authorization: Bearer gfPDce361kd56bEvhZaaV84" \
    --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]": "sapiente",
    "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 gfPDce361kd56bEvhZaaV84",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": [
        {
            "id": "b2f82bfa-ca36-434e-afdb-036bf55bd403",
            "name": "Dr. Maraisa Amaral",
            "cpf": "556.853.519-63",
            "rg": "919592902",
            "ctps": null,
            "phone": null,
            "birthdate": null,
            "email": null,
            "pis_pasep": null,
            "admission_date": "2009-12-29",
            "daily_salary": null,
            "monthly_salary": "4801.41",
            "nationality": null,
            "place_of_birth": "Paz 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": "a345c146-472c-496b-8030-d6f84a8b26e5",
                "name": "ad"
            },
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "c02fa0ef-1853-40fe-b300-fc1c35590537",
            "name": "Luis Burgos Sobrinho",
            "cpf": "743.634.378-86",
            "rg": null,
            "ctps": null,
            "phone": null,
            "birthdate": "1991-04-15",
            "email": "denise54@example.org",
            "pis_pasep": "78625339831",
            "admission_date": "2003-07-02",
            "daily_salary": null,
            "monthly_salary": null,
            "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": "a345c146-49e7-4809-a96c-d4f981cb5135",
                "name": "est"
            },
            "created_at": null,
            "updated_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": "/?page=75",
        "next": null
    },
    "meta": {
        "current_page": 76,
        "from": 751,
        "last_page": 1,
        "links": [
            {
                "url": "/?page=75",
                "label": "&laquo; Anterior",
                "page": 75,
                "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": 752,
        "total": 2
    }
}
 

Request      

GET api/employees

Headers

Authorization        

Example: Bearer gfPDce361kd56bEvhZaaV84

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[]=ab&admission_date_from=2026-01-01&admission_date_to=2026-12-31" \
    --header "Authorization: Bearer 1vEVbkgPhfa4Dea5d6Z863c" \
    --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]": "ab",
    "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 1vEVbkgPhfa4Dea5d6Z863c",
    "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 1vEVbkgPhfa4Dea5d6Z863c

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/6" \
    --header "Authorization: Bearer dZ6385caDgkb1hE46PvfeVa" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/6"
);

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


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

Example response (200):


{
    "data": {
        "id": "1ef45c3e-d7c7-4386-af01-69d87031a4c6",
        "name": "César Verdugo Bittencourt Sobrinho",
        "cpf": "267.053.197-71",
        "rg": null,
        "ctps": null,
        "phone": "(17) 4457-3373",
        "birthdate": null,
        "email": null,
        "pis_pasep": "49151520491",
        "admission_date": "1983-01-19",
        "daily_salary": "134.47",
        "monthly_salary": null,
        "nationality": null,
        "place_of_birth": "de Souza 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": "a345c146-5390-47ce-8c20-a832c60ef3c8",
            "name": "quia"
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/employees/{id}

Headers

Authorization        

Example: Bearer dZ6385caDgkb1hE46PvfeVa

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the employee. Example: 6

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 fcdk6ZP51eg8a4V3h6bvEDa" \
    --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\": \"2061b029-acb6-4700-a3a6-960b128c8fac\",
    \"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 fcdk6ZP51eg8a4V3h6bvEDa",
    "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": "2061b029-acb6-4700-a3a6-960b128c8fac",
    "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": "82d7a881-1811-46c7-a1f3-2d08f6940c69",
        "name": "Dr. Roberto Azevedo",
        "cpf": "103.068.959-18",
        "rg": "750581253",
        "ctps": "094856975",
        "phone": null,
        "birthdate": "2009-09-19",
        "email": "xalcantara@example.org",
        "pis_pasep": null,
        "admission_date": "1992-04-14",
        "daily_salary": null,
        "monthly_salary": "1673.53",
        "nationality": null,
        "place_of_birth": "Padrão 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": "a345c146-5ade-4811-a847-87e9dcc47fac",
            "name": "in"
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

POST api/employees

Headers

Authorization        

Example: Bearer fcdk6ZP51eg8a4V3h6bvEDa

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: 2061b029-acb6-4700-a3a6-960b128c8fac

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/9" \
    --header "Authorization: Bearer 5v6a4eV31PDfZkE8cg6dahb" \
    --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\": \"f2affd48-3799-4bf7-a60d-a86c4a38a442\",
    \"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/9"
);

const headers = {
    "Authorization": "Bearer 5v6a4eV31PDfZkE8cg6dahb",
    "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": "f2affd48-3799-4bf7-a60d-a86c4a38a442",
    "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 5v6a4eV31PDfZkE8cg6dahb

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the employee. Example: 9

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: f2affd48-3799-4bf7-a60d-a86c4a38a442

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 5a8e1h3g6afEZVDk6vc4Pdb" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"dismissal_date\": \"2026-11-20\",
    \"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 5a8e1h3g6afEZVDk6vc4Pdb",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "dismissal_date": "2026-11-20",
    "dismissal_reason": "resignation"
};

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

Example response (200):


{
    "data": {
        "id": "3ef0e9bf-22d1-4620-b20f-3580405d8cef",
        "name": "Dr. Roberta Mirela Queirós",
        "cpf": "886.305.881-41",
        "rg": null,
        "ctps": "490184028",
        "phone": null,
        "birthdate": "2006-03-06",
        "email": "gustavo72@example.com",
        "pis_pasep": "80650719217",
        "admission_date": "2021-09-12",
        "daily_salary": null,
        "monthly_salary": "1955.21",
        "nationality": null,
        "place_of_birth": "Serrano 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": "a345c146-6862-41d2-8fd1-9e18cff68aa9",
            "name": "omnis"
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

POST api/employees/{employee}/dismiss

Headers

Authorization        

Example: Bearer 5a8e1h3g6afEZVDk6vc4Pdb

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-20

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 536akg86P1cbvZdf4EDeVha" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"admission_date\": \"2026-11-20\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/019556e7-2e9f-777c-a177-30bbf0646c32/rehire"
);

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

let body = {
    "admission_date": "2026-11-20"
};

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

Example response (200):


{
    "data": {
        "id": "1cd4e2b5-f1b0-4c29-ab91-02d7099f4515",
        "name": "Srta. Karina Flores Cervantes",
        "cpf": "118.204.544-53",
        "rg": null,
        "ctps": "048627488",
        "phone": "(35) 97744-7438",
        "birthdate": null,
        "email": null,
        "pis_pasep": null,
        "admission_date": "1991-10-17",
        "daily_salary": "80.81",
        "monthly_salary": null,
        "nationality": "Finlândia",
        "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": "a345c146-6e26-4655-b70a-0c3d2bb2d339",
            "name": "in"
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

POST api/employees/{employee}/rehire

Headers

Authorization        

Example: Bearer 536akg86P1cbvZdf4EDeVha

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-20

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 VDce86a6f14bv3EPhakZgd5" \
    --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 VDce86a6f14bv3EPhakZgd5",
    "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 VDce86a6f14bv3EPhakZgd5

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/7/bank-account" \
    --header "Authorization: Bearer 6a634PgVhDkZ5veEc8d1bfa" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/7/bank-account"
);

const headers = {
    "Authorization": "Bearer 6a634PgVhDkZ5veEc8d1bfa",
    "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 6a634PgVhDkZ5veEc8d1bfa

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employee_id   integer     

The ID of the employee. Example: 7

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/8/bank-account" \
    --header "Authorization: Bearer v4f5c8PVE136gadebak6ZhD" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"bank_id\": \"reprehenderit\",
    \"agency\": \"cknot\",
    \"account\": \"hudzi\",
    \"account_type\": \"corrente\",
    \"pix_key\": \"vmlwsuapytx\",
    \"favorite\": false
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/8/bank-account"
);

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

let body = {
    "bank_id": "reprehenderit",
    "agency": "cknot",
    "account": "hudzi",
    "account_type": "corrente",
    "pix_key": "vmlwsuapytx",
    "favorite": false
};

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 v4f5c8PVE136gadebak6ZhD

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: 019556e7-2e9f-777c-a177-30bbf0646c32

Body Parameters

bank_id   string     

The uuid of an existing record in the banks table. Example: reprehenderit

agency   string     

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

account   string     

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

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: vmlwsuapytx

favorite   boolean  optional    

Example: false

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/10/bank-account/019556e7-2e9f-777c-a177-30bbf0646c33" \
    --header "Authorization: Bearer Pvf6d3gD4E1Z5haVk8aebc6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"bank_id\": \"et\",
    \"agency\": \"kwen\",
    \"account\": \"oaeshvmamflgpwwsjczllpf\",
    \"account_type\": \"poupança\",
    \"pix_key\": \"wmvxyxjtvqmvbfmqxsqtj\",
    \"favorite\": false
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/10/bank-account/019556e7-2e9f-777c-a177-30bbf0646c33"
);

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

let body = {
    "bank_id": "et",
    "agency": "kwen",
    "account": "oaeshvmamflgpwwsjczllpf",
    "account_type": "poupança",
    "pix_key": "wmvxyxjtvqmvbfmqxsqtj",
    "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 Pvf6d3gD4E1Z5haVk8aebc6

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employee_id   integer     

The ID of the employee. Example: 10

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: et

agency   string  optional    

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

account   string  optional    

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

account_type   string  optional    

Example: poupança

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

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

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 3P5aD4V6kEce8f6gda1Zhbv" \
    --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 3P5aD4V6kEce8f6gda1Zhbv",
    "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 3P5aD4V6kEce8f6gda1Zhbv

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/1/epi-deliveries" \
    --header "Authorization: Bearer DVvca615kZEa46Pefdbhg38" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"q\": \"molestiae\",
    \"status\": \"expired\",
    \"epi_type_id\": \"quas\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/1/epi-deliveries"
);

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

let body = {
    "q": "molestiae",
    "status": "expired",
    "epi_type_id": "quas"
};

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 DVvca615kZEa46Pefdbhg38

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employee_id   integer     

The ID of the employee. Example: 1

employee   string     

Employee UUID Example: harum

Body Parameters

q   string  optional    

Example: molestiae

status   string  optional    

Example: expired

Must be one of:
  • valid
  • expiring
  • expired
epi_type_id   string  optional    

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

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/occaecati/epi-deliveries/pending-renewals-count" \
    --header "Authorization: Bearer 3PDfkZvV5ab6a68Eh4cd1eg" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/occaecati/epi-deliveries/pending-renewals-count"
);

const headers = {
    "Authorization": "Bearer 3PDfkZvV5ab6a68Eh4cd1eg",
    "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 3PDfkZvV5ab6a68Eh4cd1eg

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employee   string     

Employee UUID Example: occaecati

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/5/epi-deliveries/aut" \
    --header "Authorization: Bearer keacg8aD6fPZ6d34bEvV1h5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/5/epi-deliveries/aut"
);

const headers = {
    "Authorization": "Bearer keacg8aD6fPZ6d34bEvV1h5",
    "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 keacg8aD6fPZ6d34bEvV1h5

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employee_id   integer     

The ID of the employee. Example: 5

id   string     

EPI delivery UUID Example: aut

employee   string     

Employee UUID Example: vel

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/16/epi-deliveries" \
    --header "Authorization: Bearer 66345fPcDaagk8Ehdbve1VZ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"epi_type_id\": \"6d150a3a-56eb-349b-8deb-3fd443750f49\",
    \"delivery_date\": \"2024-01-01\",
    \"quantity\": 1,
    \"condition\": \"Example Condition\",
    \"delivered_by_employee_id\": \"515f1f59-4131-4e54-b976-90a5560dbbcd\",
    \"stock_id\": \"66d5c429-bdce-3c7d-b39e-ffb50b3a8e2f\",
    \"confirm_insufficient_stock\": true
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/16/epi-deliveries"
);

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

let body = {
    "epi_type_id": "6d150a3a-56eb-349b-8deb-3fd443750f49",
    "delivery_date": "2024-01-01",
    "quantity": 1,
    "condition": "Example Condition",
    "delivered_by_employee_id": "515f1f59-4131-4e54-b976-90a5560dbbcd",
    "stock_id": "66d5c429-bdce-3c7d-b39e-ffb50b3a8e2f",
    "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 66345fPcDaagk8Ehdbve1VZ

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: voluptatem

Body Parameters

epi_type_id   string     

Tipo de EPI. The uuid of an existing record in the epi_types table. Example: 6d150a3a-56eb-349b-8deb-3fd443750f49

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: 515f1f59-4131-4e54-b976-90a5560dbbcd

stock_id   string  optional    

Estoque. The uuid of an existing record in the stocks table. Example: 66d5c429-bdce-3c7d-b39e-ffb50b3a8e2f

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/laborum/epi-deliveries/kit" \
    --header "Authorization: Bearer DdZeVPghavcE4b65fa8k316" \
    --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\": \"64d31b0b-bdc5-49a4-829a-2b2b02738720\",
    \"stock_id\": \"40cd6077-f240-3190-a768-40e1d9f687cf\",
    \"confirm_insufficient_stock\": true,
    \"items\": [
        {
            \"epi_type_id\": \"1752b7ec-23bc-393c-8a19-32cb04fde3e8\",
            \"quantity\": 1,
            \"condition\": \"Example Items * condition\"
        },
        null
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/laborum/epi-deliveries/kit"
);

const headers = {
    "Authorization": "Bearer DdZeVPghavcE4b65fa8k316",
    "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": "64d31b0b-bdc5-49a4-829a-2b2b02738720",
    "stock_id": "40cd6077-f240-3190-a768-40e1d9f687cf",
    "confirm_insufficient_stock": true,
    "items": [
        {
            "epi_type_id": "1752b7ec-23bc-393c-8a19-32cb04fde3e8",
            "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 DdZeVPghavcE4b65fa8k316

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employee   string     

Employee UUID Example: laborum

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: 64d31b0b-bdc5-49a4-829a-2b2b02738720

stock_id   string  optional    

Estoque. The uuid of an existing record in the stocks table. Example: 40cd6077-f240-3190-a768-40e1d9f687cf

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: 1752b7ec-23bc-393c-8a19-32cb04fde3e8

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/aut/epi-deliveries/harum/promote-to-kit" \
    --header "Authorization: Bearer hkgd8baVeE635aPZ64D1vfc" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/aut/epi-deliveries/harum/promote-to-kit"
);

const headers = {
    "Authorization": "Bearer hkgd8baVeE635aPZ64D1vfc",
    "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 hkgd8baVeE635aPZ64D1vfc

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employee   string     

Employee UUID Example: aut

id   string     

EPI delivery UUID Example: harum

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/11/epi-deliveries/molestiae" \
    --header "Authorization: Bearer 4PgkDa6bV8d53eha61vfZEc" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"epi_type_id\": \"cc3d4e94-abe0-3384-ab1d-fe5c03701e63\",
    \"delivery_date\": \"2024-01-01\",
    \"quantity\": 1,
    \"condition\": \"Example Condition\",
    \"delivered_by_employee_id\": \"f188d7a6-8d82-45cd-abc1-e3e0aa656369\",
    \"stock_id\": \"8c4f84bd-bfd5-315c-92da-7d6a056d44ef\",
    \"confirm_insufficient_stock\": true
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/11/epi-deliveries/molestiae"
);

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

let body = {
    "epi_type_id": "cc3d4e94-abe0-3384-ab1d-fe5c03701e63",
    "delivery_date": "2024-01-01",
    "quantity": 1,
    "condition": "Example Condition",
    "delivered_by_employee_id": "f188d7a6-8d82-45cd-abc1-e3e0aa656369",
    "stock_id": "8c4f84bd-bfd5-315c-92da-7d6a056d44ef",
    "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 4PgkDa6bV8d53eha61vfZEc

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employee_id   integer     

The ID of the employee. Example: 11

id   string     

EPI delivery UUID Example: molestiae

employee   string     

Employee UUID Example: dolorem

Body Parameters

epi_type_id   string  optional    

Tipo de EPI. The uuid of an existing record in the epi_types table. Example: cc3d4e94-abe0-3384-ab1d-fe5c03701e63

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: f188d7a6-8d82-45cd-abc1-e3e0aa656369

stock_id   string  optional    

Estoque. The uuid of an existing record in the stocks table. Example: 8c4f84bd-bfd5-315c-92da-7d6a056d44ef

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/doloremque/epi-deliveries/saepe" \
    --header "Authorization: Bearer bZVEDv46P3ea85gfdc16hak" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/doloremque/epi-deliveries/saepe"
);

const headers = {
    "Authorization": "Bearer bZVEDv46P3ea85gfdc16hak",
    "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 bZVEDv46P3ea85gfdc16hak

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employee   string     

Employee UUID Example: doloremque

id   string     

EPI delivery UUID Example: saepe

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/20/epi-terms" \
    --header "Authorization: Bearer 3Pdag4ah6eE18vc5bZVfk6D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"sort_by\": \"created_at\",
    \"sort_desc\": false,
    \"page\": 70,
    \"per_page\": 25,
    \"q\": \"ea\",
    \"employee_id\": \"ut\",
    \"has_term\": true
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/20/epi-terms"
);

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

let body = {
    "sort_by": "created_at",
    "sort_desc": false,
    "page": 70,
    "per_page": 25,
    "q": "ea",
    "employee_id": "ut",
    "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 3Pdag4ah6eE18vc5bZVfk6D

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employee_id   integer     

The ID of the employee. Example: 20

employee   string     

Employee UUID Example: libero

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: 70

per_page   integer  optional    

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

q   string  optional    

Example: ea

employee_id   string  optional    

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

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/cupiditate/epi-terms/ec6af059-0667-3f9b-99c5-48601af7768d/upload" \
    --header "Authorization: Bearer vZ51begEfa36cVDk86d4haP" \
    --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/cupiditate/epi-terms/ec6af059-0667-3f9b-99c5-48601af7768d/upload"
);

const headers = {
    "Authorization": "Bearer vZ51begEfa36cVDk86d4haP",
    "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 vZ51begEfa36cVDk86d4haP

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employee   string     

Employee UUID Example: cupiditate

kitUuid   string     

Kit UUID Example: ec6af059-0667-3f9b-99c5-48601af7768d

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/sequi/epi-terms/e867bcfe-6cb5-302e-be65-436e2ab172aa/document" \
    --header "Authorization: Bearer 5bdvc6Da1fhega43V8Pk6ZE" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/sequi/epi-terms/e867bcfe-6cb5-302e-be65-436e2ab172aa/document"
);

const headers = {
    "Authorization": "Bearer 5bdvc6Da1fhega43V8Pk6ZE",
    "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 5bdvc6Da1fhega43V8Pk6ZE

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employee   string     

Employee UUID Example: sequi

kitUuid   string     

Kit UUID Example: e867bcfe-6cb5-302e-be65-436e2ab172aa

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/bc314d30-892c-369e-9475-b64ee29078d0" \
    --header "Authorization: Bearer 4dk5aefh3gPD6ZEc81avVb6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/files/bc314d30-892c-369e-9475-b64ee29078d0"
);

const headers = {
    "Authorization": "Bearer 4dk5aefh3gPD6ZEc81avVb6",
    "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 4dk5aefh3gPD6ZEc81avVb6

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

uuid   integer     

Example: bc314d30-892c-369e-9475-b64ee29078d0

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/d3651871-3ce1-3e42-90a7-34a1ce953200/info" \
    --header "Authorization: Bearer h6ZVP68cfae3kg5Dda41vEb" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/files/d3651871-3ce1-3e42-90a7-34a1ce953200/info"
);

const headers = {
    "Authorization": "Bearer h6ZVP68cfae3kg5Dda41vEb",
    "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 h6ZVP68cfae3kg5Dda41vEb

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

uuid   integer     

Example: d3651871-3ce1-3e42-90a7-34a1ce953200

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/e4ec815f-a98f-35b1-9aaf-d82d49e4dc2c/download" \
    --header "Authorization: Bearer efb66DP3E8kc1a4vg5aZVhd" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/files/e4ec815f-a98f-35b1-9aaf-d82d49e4dc2c/download"
);

const headers = {
    "Authorization": "Bearer efb66DP3E8kc1a4vg5aZVhd",
    "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 efb66DP3E8kc1a4vg5aZVhd

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

uuid   string     

The UUID of the file to download Example: e4ec815f-a98f-35b1-9aaf-d82d49e4dc2c

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 3kPDea8f64ZVhabvdg51c6E" \
    --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 3kPDea8f64ZVhabvdg51c6E",
    "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 3kPDea8f64ZVhabvdg51c6E

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 58VvPEDgZf4ak36dehabc61" \
    --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 58VvPEDgZf4ak36dehabc61",
    "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 58VvPEDgZf4ak36dehabc61

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 D1a4ePchkvbfZE865aVg36d" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"q\": \"sunt\",
    \"document_type\": \"nfe\",
    \"supplier_id\": \"natus\",
    \"work_id\": \"nam\",
    \"products_status\": \"imported\",
    \"financial_status\": \"pending\",
    \"start_date\": \"2026-11-20T15:38:27\",
    \"end_date\": \"2077-01-06\",
    \"per_page\": 17,
    \"cost_centers\": [
        \"ratione\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/fiscal-documents"
);

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

let body = {
    "q": "sunt",
    "document_type": "nfe",
    "supplier_id": "natus",
    "work_id": "nam",
    "products_status": "imported",
    "financial_status": "pending",
    "start_date": "2026-11-20T15:38:27",
    "end_date": "2077-01-06",
    "per_page": 17,
    "cost_centers": [
        "ratione"
    ]
};

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

Example response (200):


{
    "data": [
        {
            "id": "26bb508c-ad54-389c-a545-c812d5d24173",
            "document_type": "nfe",
            "document_type_label": "NF-e",
            "service_description": null,
            "nfe_access_key": "24880225462034718411593932915697232236853202",
            "nfe_number": "527603",
            "nfe_series": "11",
            "issue_date": "2016-05-26T03:00:00.000000Z",
            "total_value": "9366.91",
            "emit": {
                "cnpj": "12146645644496",
                "name": "Osinski, Schroeder and Bednar"
            },
            "dest": {
                "document": "39900673150687",
                "name": "Klocko-Wyman"
            },
            "supplier": {
                "id": "a345c147-b730-43bb-9073-38398fd694dd",
                "name": "Dr. Sueli da Cruz",
                "document": "97.900.820/0001-71"
            },
            "financial_status": "pending",
            "products_imported_at": null,
            "created_at": null
        },
        {
            "id": "85ae3716-0bd8-3bfa-b023-1fdeb4f82f93",
            "document_type": "nfe",
            "document_type_label": "NF-e",
            "service_description": null,
            "nfe_access_key": "75720027593144783317860953391499106600628382",
            "nfe_number": "664604",
            "nfe_series": "96",
            "issue_date": "1977-09-17T03:00:00.000000Z",
            "total_value": "5205.30",
            "emit": {
                "cnpj": "38220730859279",
                "name": "Quitzon, O'Kon and Hamill"
            },
            "dest": {
                "document": "07528014297587",
                "name": "Daniel-Rath"
            },
            "supplier": {
                "id": "a345c147-bca4-40a0-a73b-05e875b1a44d",
                "name": "Mila Jimenes",
                "document": "31.736.312/0001-91"
            },
            "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 D1a4ePchkvbfZE865aVg36d

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

q   string  optional    

Example: sunt

document_type   string  optional    

Example: nfe

Must be one of:
  • nfe
  • nfse
supplier_id   string  optional    

The uuid of an existing record in the suppliers table. Example: natus

work_id   string  optional    

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

products_status   string  optional    

Example: imported

Must be one of:
  • imported
  • pending
financial_status   string  optional    

Example: pending

Must be one of:
  • pending
  • partial
  • generated
start_date   string  optional    

O campo value deve ser uma data válida. Example: 2026-11-20T15:38:27

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: 2077-01-06

per_page   integer  optional    

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

cost_centers   string[]  optional    

The uuid of an existing record in the cost_centers table.

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 4Z813fke6EVaDbhvgdc6a5P" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"s3_file_path\": \"voluptate\",
    \"original_filename\": \".xml$\\/i\",
    \"work_ids\": [
        \"est\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/fiscal-documents"
);

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

let body = {
    "s3_file_path": "voluptate",
    "original_filename": ".xml$\/i",
    "work_ids": [
        "est"
    ]
};

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

Example response (201):


{
    "data": {
        "id": "dd2069cc-a8c7-3ce0-ab0f-b03bbbd683b3",
        "document_type": "nfe",
        "document_type_label": "NF-e",
        "service_description": null,
        "nfe_access_key": "83486042086502477902741012312884691693227659",
        "nfe_number": "696029",
        "nfe_series": "62",
        "issue_date": "1989-07-06T03:00:00.000000Z",
        "total_value": "6024.81",
        "emit": {
            "cnpj": "15639682667599",
            "name": "Williamson-Purdy"
        },
        "dest": {
            "document": "54846595288101",
            "name": "Weimann, Toy and Schuppe"
        },
        "supplier": {
            "id": "a345c147-c6b6-4fee-9517-b7fdc13d79b1",
            "name": "Srta. Alexa Betina Teles Filho",
            "document": "13.439.946/0001-09"
        },
        "financial_status": "pending",
        "products_imported_at": null,
        "created_at": null
    }
}
 

Request      

POST api/fiscal-documents

Headers

Authorization        

Example: Bearer 4Z813fke6EVaDbhvgdc6a5P

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

s3_file_path   string     

Example: voluptate

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/omnis" \
    --header "Authorization: Bearer 6cdZaakvD5bE681feV3hgP4" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/fiscal-documents/omnis"
);

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


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

Example response (200):


{
    "data": {
        "id": "d9ceb1bd-206b-3bf6-b341-6c1b189ebb32",
        "document_type": "nfe",
        "document_type_label": "NF-e",
        "service_description": null,
        "nfe_access_key": "79758161579652527070699117735514922566879094",
        "nfe_number": "260239",
        "nfe_series": "37",
        "issue_date": "1982-06-13T03:00:00.000000Z",
        "total_value": "9431.59",
        "emit": {
            "cnpj": "88164782498706",
            "name": "Mills-Bruen"
        },
        "dest": {
            "document": "83309505921193",
            "name": "Sporer-Treutel"
        },
        "supplier": {
            "id": "a345c147-ce57-417f-9033-9382bab2f797",
            "name": "Thalita Raysa Balestero",
            "document": "07.015.772/0001-46"
        },
        "financial_status": "pending",
        "products_imported_at": null,
        "created_at": null
    }
}
 

Request      

GET api/fiscal-documents/{fiscalDocument}

Headers

Authorization        

Example: Bearer 6cdZaakvD5bE681feV3hgP4

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

fiscalDocument   string     

UUID da nota fiscal Example: omnis

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/eum/cost-centers" \
    --header "Authorization: Bearer baa38Dfe4h665PkdgV1vZEc" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/fiscal-documents/eum/cost-centers"
);

const headers = {
    "Authorization": "Bearer baa38Dfe4h665PkdgV1vZEc",
    "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 baa38Dfe4h665PkdgV1vZEc

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

fiscalDocument   string     

UUID da nota fiscal Example: eum

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/sequi" \
    --header "Authorization: Bearer k83ceDZ6fh5vabad46g1PEV" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/fiscal-documents/sequi"
);

const headers = {
    "Authorization": "Bearer k83ceDZ6fh5vabad46g1PEV",
    "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 k83ceDZ6fh5vabad46g1PEV

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

fiscalDocument   string     

UUID da nota fiscal Example: sequi

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/ipsa/files" \
    --header "Authorization: Bearer Vhkf8P163aDe4c6bgdaZv5E" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"file\": {
        \"path\": \"possimus\",
        \"name\": \"aut\",
        \"extension\": \"quas\"
    }
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/fiscal-documents/ipsa/files"
);

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

let body = {
    "file": {
        "path": "possimus",
        "name": "aut",
        "extension": "quas"
    }
};

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

Example response (200):


{
    "data": {
        "id": "a02b6dcf-1704-3f64-a71c-d4d1b0d46131",
        "document_type": "nfe",
        "document_type_label": "NF-e",
        "service_description": null,
        "nfe_access_key": "89592557158932088343633772222828936055382016",
        "nfe_number": "316967",
        "nfe_series": "67",
        "issue_date": "1989-11-29T02:00:00.000000Z",
        "total_value": "7964.50",
        "emit": {
            "cnpj": "62380442983955",
            "name": "Purdy, Rosenbaum and Langworth"
        },
        "dest": {
            "document": "22894945568568",
            "name": "Klein, Price and Bailey"
        },
        "supplier": {
            "id": "a345c147-dad8-40b8-a1c8-bb6d202dfe9c",
            "name": "Isaac Torres Filho",
            "document": "51.333.202/0001-96"
        },
        "financial_status": "pending",
        "products_imported_at": null,
        "created_at": null
    }
}
 

Request      

POST api/fiscal-documents/{fiscalDocument}/files

Headers

Authorization        

Example: Bearer Vhkf8P163aDe4c6bgdaZv5E

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

fiscalDocument   string     

UUID da nota fiscal Example: ipsa

Body Parameters

file   object     
path   string     

Example: possimus

name   string     

Example: aut

extension   string     

Example: quas

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/consequatur/files/et" \
    --header "Authorization: Bearer 4b16a3DZ6egdc5fEaPkh8Vv" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/fiscal-documents/consequatur/files/et"
);

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


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

Example response (200):


{
    "data": {
        "id": "3cba8c84-1e2a-31bf-a2af-a37b73efc042",
        "document_type": "nfe",
        "document_type_label": "NF-e",
        "service_description": null,
        "nfe_access_key": "85389724108319154875324634443427722866096517",
        "nfe_number": "389233",
        "nfe_series": "76",
        "issue_date": "2003-11-02T02:00:00.000000Z",
        "total_value": "9574.44",
        "emit": {
            "cnpj": "24504618919605",
            "name": "Schumm, Daugherty and Mills"
        },
        "dest": {
            "document": "47292115246014",
            "name": "Kautzer Inc"
        },
        "supplier": {
            "id": "a345c147-e357-478e-8095-a915e5cde410",
            "name": "Sra. Thaís Ellen Valentin",
            "document": "49.729.882/0001-10"
        },
        "financial_status": "pending",
        "products_imported_at": null,
        "created_at": null
    }
}
 

Request      

DELETE api/fiscal-documents/{fiscalDocument}/files/{file}

Headers

Authorization        

Example: Bearer 4b16a3DZ6egdc5fEaPkh8Vv

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

fiscalDocument   string     

UUID da nota fiscal Example: consequatur

file   string     

UUID do arquivo anexado Example: et

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/nam/works" \
    --header "Authorization: Bearer 54veaVZagdfk3Eh66P1c8bD" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"work_ids\": [
        \"ipsam\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/fiscal-documents/nam/works"
);

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

let body = {
    "work_ids": [
        "ipsam"
    ]
};

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

Example response (200):


{
    "data": {
        "id": "6dd01628-aaf3-313a-a481-9cf244c441eb",
        "document_type": "nfe",
        "document_type_label": "NF-e",
        "service_description": null,
        "nfe_access_key": "38675701448271050485407953729583724756435987",
        "nfe_number": "184389",
        "nfe_series": "57",
        "issue_date": "1984-03-16T03:00:00.000000Z",
        "total_value": "431.09",
        "emit": {
            "cnpj": "01037487384861",
            "name": "Rau-Corwin"
        },
        "dest": {
            "document": "08788927736116",
            "name": "Weimann Inc"
        },
        "supplier": {
            "id": "a345c147-ea00-47c5-a5b6-ce1e436bb4ed",
            "name": "Téo Anderson Campos Filho",
            "document": "36.844.067/0001-50"
        },
        "financial_status": "pending",
        "products_imported_at": null,
        "created_at": null
    }
}
 

Request      

PUT api/fiscal-documents/{fiscalDocument}/works

Headers

Authorization        

Example: Bearer 54veaVZagdfk3Eh66P1c8bD

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

fiscalDocument   string     

UUID da nota fiscal Example: nam

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/nisi/installments" \
    --header "Authorization: Bearer kehPDE4c6gaZvb8f1a6V5d3" \
    --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/nisi/installments"
);

const headers = {
    "Authorization": "Bearer kehPDE4c6gaZvb8f1a6V5d3",
    "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": "cd42697a-b952-3b5b-a3ae-1a4de1bc3176",
        "document_type": "nfe",
        "document_type_label": "NF-e",
        "service_description": null,
        "nfe_access_key": "90462202027089335103874336789980515996676194",
        "nfe_number": "298496",
        "nfe_series": "82",
        "issue_date": "2011-01-09T02:00:00.000000Z",
        "total_value": "6466.38",
        "emit": {
            "cnpj": "71050699202372",
            "name": "Macejkovic LLC"
        },
        "dest": {
            "document": "31542737035514",
            "name": "Lubowitz-Roob"
        },
        "supplier": {
            "id": "a345c147-f208-4728-bfbc-c90d040eaa8e",
            "name": "Máximo da Rosa Sobrinho",
            "document": "23.806.592/0001-39"
        },
        "financial_status": "pending",
        "products_imported_at": null,
        "created_at": null
    }
}
 

Request      

POST api/fiscal-documents/{fiscalDocument}/installments

Headers

Authorization        

Example: Bearer kehPDE4c6gaZvb8f1a6V5d3

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

fiscalDocument   string     

UUID da nota fiscal Example: nisi

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 Vf6EcP3h61ed8kgab5aD4Zv" \
    --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\": \"c886503b-2223-37ff-818b-bdf1e5ea8be5\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/imports/nfe/products"
);

const headers = {
    "Authorization": "Bearer Vf6EcP3h61ed8kgab5aD4Zv",
    "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": "c886503b-2223-37ff-818b-bdf1e5ea8be5"
};

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 Vf6EcP3h61ed8kgab5aD4Zv

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: c886503b-2223-37ff-818b-bdf1e5ea8be5

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 81ka63geZP4Da5EvfcVdbh6" \
    --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 81ka63geZP4Da5EvfcVdbh6",
    "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 81ka63geZP4Da5EvfcVdbh6

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/ab" \
    --header "Authorization: Bearer Dk6EP1d36ha48gecbf5ZaVv" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/imports/ab"
);

const headers = {
    "Authorization": "Bearer Dk6EP1d36ha48gecbf5ZaVv",
    "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 Dk6EP1d36ha48gecbf5ZaVv

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

importId   string     

Example: ab

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/occaecati" \
    --header "Authorization: Bearer ba4EeV5P6cgka63vdD18Zhf" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/imports/occaecati"
);

const headers = {
    "Authorization": "Bearer ba4EeV5P6cgka63vdD18Zhf",
    "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 ba4EeV5P6cgka63vdD18Zhf

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

importId   string     

Example: occaecati

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/minus/products?sort_by=created_at&sort_desc=1&page=1&per_page=15&status=pending&q=Produto+ABC" \
    --header "Authorization: Bearer 4c1k685EDg6haZbvPfVeda3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/imports/minus/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 4c1k685EDg6haZbvPfVeda3",
    "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 4c1k685EDg6haZbvPfVeda3

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

importId   string     

Example: minus

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/voluptas/distributions" \
    --header "Authorization: Bearer 38c4kD1E5fa6VPgh6aZvdbe" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/imports/voluptas/distributions"
);

const headers = {
    "Authorization": "Bearer 38c4kD1E5fa6VPgh6aZvdbe",
    "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 38c4kD1E5fa6VPgh6aZvdbe

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

importId   string     

Example: voluptas

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/tempora/products/link" \
    --header "Authorization: Bearer fcVaDvbk4Z3g86d6E1Phae5" \
    --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/tempora/products/link"
);

const headers = {
    "Authorization": "Bearer fcVaDvbk4Z3g86d6E1Phae5",
    "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 fP6Zaae4V6E81dDgkh35vcb" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"sort_by\": \"eius\",
    \"sort_desc\": false,
    \"page\": 74,
    \"per_page\": 9
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/locations/states"
);

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

let body = {
    "sort_by": "eius",
    "sort_desc": false,
    "page": 74,
    "per_page": 9
};

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

Example response (200):


{
    "data": [
        {
            "id": null,
            "name": "repellat suscipit",
            "abbreviation": "RA"
        },
        {
            "id": null,
            "name": "voluptatem asperiores",
            "abbreviation": "FB"
        }
    ],
    "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 fP6Zaae4V6E81dDgkh35vcb

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

sort_by   string  optional    

Example: eius

sort_desc   boolean  optional    

Example: false

page   integer  optional    

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

per_page   integer  optional    

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

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 f6Pac5ab3vE48ehk1VDdgZ6" \
    --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 f6Pac5ab3vE48ehk1VDdgZ6",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": [
        {
            "id": null,
            "name": "Ashaberg"
        },
        {
            "id": null,
            "name": "Quitzonton"
        }
    ]
}
 

Request      

GET api/locations/states/{state}/cities

Headers

Authorization        

Example: Bearer f6Pac5ab3vE48ehk1VDdgZ6

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 fVka6v6Z3gEbdPa41ce8hD5" \
    --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 fVka6v6Z3gEbdPa41ce8hD5",
    "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 fVka6v6Z3gEbdPa41ce8hD5

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 VPakEgd61a63hb5ZfD48cve" \
    --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 VPakEgd61a63hb5ZfD48cve",
    "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 VPakEgd61a63hb5ZfD48cve

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 k6ZD3PbaedEcvgh4aV851f6" \
    --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 k6ZD3PbaedEcvgh4aV851f6",
    "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 k6ZD3PbaedEcvgh4aV851f6

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 3vDaZ1b8cdE6Vk4aPgfeh65" \
    --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 3vDaZ1b8cdE6Vk4aPgfeh65",
    "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 3vDaZ1b8cdE6Vk4aPgfeh65

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 4h3EgZ5cakdbPfa6186vVDe" \
    --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 4h3EgZ5cakdbPfa6186vVDe",
    "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 4h3EgZ5cakdbPfa6186vVDe

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=non&document=et&work_id=a01edd80-bf3e-40f7-8613-ccb4be5831b3&cost_center_id=5d392221-f449-3b93-b6ae-fd6efd33412c&bank_account_id=a01edd80-bf3e-40f7-8613-ccb4be5831b3" \
    --header "Authorization: Bearer 563fbaVEvk1dPZDchg68e4a" \
    --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": "non",
    "document": "et",
    "work_id": "a01edd80-bf3e-40f7-8613-ccb4be5831b3",
    "cost_center_id": "5d392221-f449-3b93-b6ae-fd6efd33412c",
    "bank_account_id": "a01edd80-bf3e-40f7-8613-ccb4be5831b3",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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


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

Example response (200):


{
    "data": [
        {
            "id": "65872569-3986-3ba6-bd38-02efbada4181",
            "receipt_number": "REC-8091",
            "receiver_type": "custom",
            "receiver": {
                "id": null,
                "type": null,
                "label": null,
                "name": "Annabell Treutel",
                "document": "889.707.677-59"
            },
            "payment": {
                "amount": 4169.85,
                "amount_in_words": "Valor por extenso de teste",
                "method": "check",
                "description": "Molestiae corrupti velit aspernatur sequi tempore inventore."
            },
            "issuer": {
                "name": "Grimes Ltd",
                "document": "67.319.868/4754-81"
            },
            "issue": {
                "date": "2026-10-26",
                "city": "Port Quincymouth",
                "state": "BA"
            },
            "created_by": {
                "id": "a345c148-23cb-41f0-8885-cb3fda79e409",
                "name": "Elmore Streich"
            },
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "6981645c-a00e-39ea-b6c0-c768ad02e781",
            "receipt_number": "REC-5699",
            "receiver_type": "custom",
            "receiver": {
                "id": null,
                "type": null,
                "label": null,
                "name": "Kaycee Kihn",
                "document": "243.957.219-78"
            },
            "payment": {
                "amount": 8767.86,
                "amount_in_words": "Valor por extenso de teste",
                "method": "bank_transfer",
                "description": "Voluptatem maxime alias ullam cupiditate ad odio."
            },
            "issuer": {
                "name": "Kiehn, Bauch and Denesik",
                "document": "46.401.363/2065-92"
            },
            "issue": {
                "date": "2026-10-27",
                "city": "East Malcolmtown",
                "state": "BA"
            },
            "created_by": {
                "id": "a345c148-26e8-4ef1-8958-682e85d1a5d6",
                "name": "Sheldon Kilback"
            },
            "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 563fbaVEvk1dPZDchg68e4a

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
  • supplier
  • 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: non

document   string  optional    

Example: et

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: 5d392221-f449-3b93-b6ae-fd6efd33412c

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=eum&document=quia&work_id=a01edd80-bf3e-40f7-8613-ccb4be5831b3&cost_center_id=0116e870-8c1b-3aa5-a705-aacf03c0ca23&bank_account_id=a01edd80-bf3e-40f7-8613-ccb4be5831b3" \
    --header "Authorization: Bearer P3fg66Va4kdEaevZcb8hD15" \
    --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": "eum",
    "document": "quia",
    "work_id": "a01edd80-bf3e-40f7-8613-ccb4be5831b3",
    "cost_center_id": "0116e870-8c1b-3aa5-a705-aacf03c0ca23",
    "bank_account_id": "a01edd80-bf3e-40f7-8613-ccb4be5831b3",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer P3fg66Va4kdEaevZcb8hD15",
    "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 P3fg66Va4kdEaevZcb8hD15

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
  • supplier
  • 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: eum

document   string  optional    

Example: quia

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: 0116e870-8c1b-3aa5-a705-aacf03c0ca23

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 PcbZ6dk6v3fea1gDhaVE458" \
    --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 PcbZ6dk6v3fea1gDhaVE458",
    "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 PcbZ6dk6v3fea1gDhaVE458

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 kDhc85bafea314vZP6dEg6V" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"methods\": [
        {
            \"method\": \"bank_transfer\",
            \"eligible\": false
        }
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/payment-receipts/cash-flow-config"
);

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

let body = {
    "methods": [
        {
            "method": "bank_transfer",
            "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 kDhc85bafea314vZP6dEg6V

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: bank_transfer

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 bdD58gka6ZV4P3c6vfEe1ah" \
    --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 bdD58gka6ZV4P3c6vfEe1ah",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": {
        "id": "c4183b72-5338-32fa-94b4-6edf5437c2be",
        "receipt_number": "REC-0686",
        "receiver_type": "custom",
        "receiver": {
            "id": null,
            "type": null,
            "label": null,
            "name": "Raul Abshire",
            "document": "098.328.057-31"
        },
        "payment": {
            "amount": 6876.92,
            "amount_in_words": "Valor por extenso de teste",
            "method": "cash",
            "description": "Aliquam sequi officiis maiores asperiores."
        },
        "issuer": {
            "name": "Doyle-Ortiz",
            "document": "62.620.780/2793-00"
        },
        "issue": {
            "date": "2026-11-02",
            "city": "Lake Ernachester",
            "state": "BA"
        },
        "created_by": {
            "id": "a345c148-3971-45b7-b8a5-a7e6966b3b61",
            "name": "Abbey Wolf"
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/payment-receipts/{receipt}

Headers

Authorization        

Example: Bearer bdD58gka6ZV4P3c6vfEe1ah

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 kec5a8hgEZbPaf4D6v6Vd13" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"receiver_type\": \"Example Receiver type\",
    \"receiver_id\": \"Example Receiver id\",
    \"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\": \"64f82639-0294-3e9c-b646-16d7ee426754\",
    \"cost_center_id\": \"f3daa3b6-5810-3756-a46f-e5e3972a810f\",
    \"bank_account_id\": \"ddf1cb28-bdf2-3a02-b6df-7dfbba658133\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/payment-receipts"
);

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

let body = {
    "receiver_type": "Example Receiver type",
    "receiver_id": "Example Receiver id",
    "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": "64f82639-0294-3e9c-b646-16d7ee426754",
    "cost_center_id": "f3daa3b6-5810-3756-a46f-e5e3972a810f",
    "bank_account_id": "ddf1cb28-bdf2-3a02-b6df-7dfbba658133"
};

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 kec5a8hgEZbPaf4D6v6Vd13

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
  • supplier
  • custom
receiver_id   string  optional    

Recebedor. This field is required when receiver_type is employee or supplier. O campo value deve ser um UUID válido. Example: Example Receiver id

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: 64f82639-0294-3e9c-b646-16d7ee426754

cost_center_id   string     

Cost center id. The uuid of an existing record in the cost_centers table. Example: f3daa3b6-5810-3756-a46f-e5e3972a810f

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: ddf1cb28-bdf2-3a02-b6df-7dfbba658133

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 Z1Pkf68bE36cevhdDVaga54" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"receiver_type\": \"Example Receiver type\",
    \"receiver_id\": \"Example Receiver id\",
    \"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\": \"599d2427-8380-3947-b3bf-e5583e92bf45\",
    \"cost_center_id\": \"58b75c50-36c9-3c31-9090-b2b460219231\",
    \"bank_account_id\": \"429e1ceb-5d44-33ec-80c6-4261fe7e3f97\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/payment-receipts/019556e7-2e9f-777c-a177-30bbf0646c32"
);

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

let body = {
    "receiver_type": "Example Receiver type",
    "receiver_id": "Example Receiver id",
    "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": "599d2427-8380-3947-b3bf-e5583e92bf45",
    "cost_center_id": "58b75c50-36c9-3c31-9090-b2b460219231",
    "bank_account_id": "429e1ceb-5d44-33ec-80c6-4261fe7e3f97"
};

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 Z1Pkf68bE36cevhdDVaga54

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
  • supplier
  • custom
receiver_id   string  optional    

Recebedor. This field is required when receiver_type is employee or supplier. O campo value deve ser um UUID válido. Example: Example Receiver id

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: 599d2427-8380-3947-b3bf-e5583e92bf45

cost_center_id   string     

Cost center id. The uuid of an existing record in the cost_centers table. Example: 58b75c50-36c9-3c31-9090-b2b460219231

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: 429e1ceb-5d44-33ec-80c6-4261fe7e3f97

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 f3E18gD4ec6Zb65VPvadhka" \
    --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 f3E18gD4ec6Zb65VPvadhka",
    "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 f3E18gD4ec6Zb65VPvadhka

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/16/receipts" \
    --header "Authorization: Bearer a6dZkD8V4h5af3v1bEcg6eP" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/employees/16/receipts"
);

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


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

Example response (200):


{
    "data": [
        {
            "id": "f478e8bf-5578-3bba-a942-fe23ef855ebf",
            "receipt_number": "REC-2897",
            "receiver_type": "custom",
            "receiver": {
                "id": null,
                "type": null,
                "label": null,
                "name": "Prof. Adolfo Leannon MD",
                "document": "202.128.826-52"
            },
            "payment": {
                "amount": 7126.96,
                "amount_in_words": "Valor por extenso de teste",
                "method": "pix",
                "description": "Minus voluptates debitis ea aut ullam et est asperiores."
            },
            "issuer": {
                "name": "Quigley Group",
                "document": "65.545.780/6531-26"
            },
            "issue": {
                "date": "2026-10-30",
                "city": "Jaquelinberg",
                "state": "GO"
            },
            "created_by": {
                "id": "a345c148-5136-40c6-88e0-4cf3bdd4f348",
                "name": "Stephon Stoltenberg DDS"
            },
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "d7f84a8e-dc72-330c-af02-bcbbf09700f9",
            "receipt_number": "REC-6816",
            "receiver_type": "custom",
            "receiver": {
                "id": null,
                "type": null,
                "label": null,
                "name": "Mia Bode DDS",
                "document": "116.296.411-88"
            },
            "payment": {
                "amount": 862.05,
                "amount_in_words": "Valor por extenso de teste",
                "method": "pix",
                "description": "Rerum porro vitae repellat corporis."
            },
            "issuer": {
                "name": "Frami, Altenwerth and Hilpert",
                "document": "32.354.578/2049-33"
            },
            "issue": {
                "date": "2026-11-16",
                "city": "Emmerichberg",
                "state": "PR"
            },
            "created_by": {
                "id": "a345c148-5316-4d8a-b334-b79e0e61e134",
                "name": "Claudie Anderson"
            },
            "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 a6dZkD8V4h5af3v1bEcg6eP

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employee_id   integer     

The ID of the employee. Example: 16

employee   string     

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

Payroll Addition Types

Cadastro dos tipos de acréscimo da folha de sexta

List addition types

requires authentication payroll build

Lista ordenada por nome, sem paginação: o cadastro é pequeno e a mesma chamada serve à tela de lista e à lista de escolha do lançamento.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/payroll-addition-types?q=voluptatem&active=1" \
    --header "Authorization: Bearer 1EkP5gDZc6f8e3abdV64vha" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"q\": \"ex\",
    \"active\": false
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/payroll-addition-types"
);

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

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

let body = {
    "q": "ex",
    "active": false
};

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

Example response (200):


{
    "data": [
        {
            "id": "a345c148-5f6e-4f6d-a125-6abdb28a2633",
            "name": "et earum",
            "default_amount": "17.73",
            "includes_in_work_cost": true,
            "is_active": true,
            "in_use": false
        },
        {
            "id": "a345c148-6040-4088-ae68-e8bc35cfd28e",
            "name": "temporibus expedita",
            "default_amount": "41.14",
            "includes_in_work_cost": true,
            "is_active": true,
            "in_use": false
        }
    ]
}
 

Request      

GET api/payroll-addition-types

Headers

Authorization        

Example: Bearer 1EkP5gDZc6f8e3abdV64vha

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

q   string  optional    

Busca por nome. Example: voluptatem

active   boolean  optional    

Só ativos (1) ou só inativos (0). Omitido, traz os dois. Example: 1

Body Parameters

q   string  optional    

Example: ex

active   boolean  optional    

Example: false

Create addition type

requires authentication payroll build

O nome é único. O valor padrão fica vazio quando o valor varia a cada lançamento.

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/payroll-addition-types" \
    --header "Authorization: Bearer kfE8d1a365DZbgaV4hvePc6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"mavs\",
    \"default_amount\": 51,
    \"includes_in_work_cost\": true,
    \"is_active\": true
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/payroll-addition-types"
);

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

let body = {
    "name": "mavs",
    "default_amount": 51,
    "includes_in_work_cost": true,
    "is_active": true
};

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

Example response (201):


{
    "data": {
        "id": "a345c148-6493-41eb-a29d-f09519218821",
        "name": "omnis ut",
        "default_amount": "12.35",
        "includes_in_work_cost": true,
        "is_active": true,
        "in_use": false
    }
}
 

Request      

POST api/payroll-addition-types

Headers

Authorization        

Example: Bearer kfE8d1a365DZbgaV4hvePc6

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

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

default_amount   number  optional    

O campo value deve ser pelo menos 0.01. Example: 51

includes_in_work_cost   boolean  optional    

Example: true

is_active   boolean  optional    

Example: true

Show addition type

requires authentication payroll build

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

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


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

Example response (200):


{
    "data": {
        "id": "a345c148-67c2-48cf-877a-2be4c19128e8",
        "name": "impedit ut",
        "default_amount": "34.01",
        "includes_in_work_cost": true,
        "is_active": true,
        "in_use": false
    }
}
 

Request      

GET api/payroll-addition-types/{payrollAdditionType}

Headers

Authorization        

Example: Bearer eadc5Pkh68avgf34V1D6bZE

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

payrollAdditionType   string     

UUID do tipo. Example: animi

Update addition type

requires authentication payroll build

Alterar o cadastro não muda acréscimo já lançado: ele guarda a cópia do nome, do valor e da marcação de custo do momento do lançamento.

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/payroll-addition-types/accusamus" \
    --header "Authorization: Bearer fhd36eZ8DaE1vcVak5b6g4P" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"zubqco\",
    \"default_amount\": 46,
    \"includes_in_work_cost\": true,
    \"is_active\": false
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/payroll-addition-types/accusamus"
);

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

let body = {
    "name": "zubqco",
    "default_amount": 46,
    "includes_in_work_cost": true,
    "is_active": false
};

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

Example response (200):


{
    "message": "Tipo de acréscimo atualizado com sucesso."
}
 

Request      

PUT api/payroll-addition-types/{payrollAdditionType}

Headers

Authorization        

Example: Bearer fhd36eZ8DaE1vcVak5b6g4P

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

payrollAdditionType   string     

UUID do tipo. Example: accusamus

Body Parameters

name   string  optional    

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

default_amount   number  optional    

O campo value deve ser pelo menos 0.01. Example: 46

includes_in_work_cost   boolean  optional    

Example: true

is_active   boolean  optional    

Example: false

Delete addition type

requires authentication payroll build

Só para tipo sem uso. Tipo já lançado em alguma folha é recusado com orientação para inativar.

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

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


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

Example response (200):


{
    "message": "Tipo de acréscimo excluído com sucesso."
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "name": [
            "Este tipo de acréscimo já foi lançado em alguma folha e não pode ser excluído. Inative-o para parar de usá-lo."
        ]
    }
}
 

Request      

DELETE api/payroll-addition-types/{payrollAdditionType}

Headers

Authorization        

Example: Bearer VebED663a5PakhZdfc48g1v

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

payrollAdditionType   string     

UUID do tipo. Example: accusamus

Payroll Payments

Baixa da folha: caixa, recibo e dinheiro entregue na obra

Payments of the day

requires authentication payroll pay

Os pagamentos agendados para uma data, agrupados por favorecido, com a chave PIX ao lado e o total por pessoa. Sem date, traz o dia de hoje.

Os itens já pagos vêm na lista, marcados: quem paga precisa ver o que já saiu para não pagar duas vezes. Folha em rascunho não aparece — pagamento só depois de conferida.

A chave PIX é a gravada no item; não havendo, cai na favorita do cadastro do funcionário ou do fornecedor.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/payroll-payments/day?date=2026-11-20" \
    --header "Authorization: Bearer ZaEe63hkvaPg1fcb6dD45V8" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"date\": \"2026-11-20\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/payroll-payments/day"
);

const params = {
    "date": "2026-11-20",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

let body = {
    "date": "2026-11-20"
};

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

Example response (200):


{
    "date": "2026-11-20",
    "totals": {
        "grand_total": "530.00",
        "pending_total": "350.00",
        "items_count": 3,
        "pending_count": 2,
        "payees_count": 2
    },
    "payees": [
        {
            "payee": {
                "type": "employee",
                "label": "Funcionário",
                "id": "uuid",
                "name": "José da Silva",
                "document": "390.533.447-05"
            },
            "pix_key": "jose.silva@email.com",
            "total": "180.00",
            "pending_total": "180.00",
            "items_count": 1,
            "pending_count": 1,
            "items": []
        }
    ]
}
 

Request      

GET api/payroll-payments/day

Headers

Authorization        

Example: Bearer ZaEe63hkvaPg1fcb6dD45V8

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

date   string  optional    

Data no formato AAAA-MM-DD. Omitida, usa hoje. Example: 2026-11-20

Body Parameters

date   string     

Must be a valid date in the format Y-m-d. Example: 2026-11-20

Settle several payroll items

requires authentication payroll pay

Baixa vários itens de uma vez. Cada item é liquidado na sua própria transação: um item sem saldo na conta não desfaz os que já foram pagos, e a resposta diz quais passaram e quais não.

Com receipt_mode: per_person sai um recibo por favorecido cobrindo todos os itens dele; com per_payment, um recibo por item.

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/payroll-payments/batch" \
    --header "Authorization: Bearer f3ePa6hkgVZc4a6E8d1Db5v" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"bank_account_id\": \"80519167-6f8c-3390-ba86-5b4c5eb04de7\",
    \"delivered\": true,
    \"delivered_by_name\": \"oknjieobc\",
    \"generate_receipt\": true,
    \"receipt_mode\": \"per_person\",
    \"receipt_description\": \"voluptas\",
    \"issuer_name\": \"bssgrktspegmnbjqfiqmxl\",
    \"issuer_document\": \"kjmvlxflpymezajwhdtuwgc\",
    \"city\": \"wuykgtkmf\",
    \"state\": \"is\",
    \"items\": [
        \"c3870624-ddbe-33d8-be17-17fff58e2cd3\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/payroll-payments/batch"
);

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

let body = {
    "bank_account_id": "80519167-6f8c-3390-ba86-5b4c5eb04de7",
    "delivered": true,
    "delivered_by_name": "oknjieobc",
    "generate_receipt": true,
    "receipt_mode": "per_person",
    "receipt_description": "voluptas",
    "issuer_name": "bssgrktspegmnbjqfiqmxl",
    "issuer_document": "kjmvlxflpymezajwhdtuwgc",
    "city": "wuykgtkmf",
    "state": "is",
    "items": [
        "c3870624-ddbe-33d8-be17-17fff58e2cd3"
    ]
};

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

Example response (200):


{
    "settled": [
        "uuid-1",
        "uuid-2"
    ],
    "failed": [
        {
            "item": "uuid-3",
            "reason": "Saldo insuficiente."
        }
    ]
}
 

Request      

POST api/payroll-payments/batch

Headers

Authorization        

Example: Bearer f3ePa6hkgVZc4a6E8d1Db5v

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

bank_account_id   string     

O campo value deve ser um UUID válido. The uuid of an existing record in the bank_accounts table. Example: 80519167-6f8c-3390-ba86-5b4c5eb04de7

delivered   boolean  optional    

Example: true

delivered_by_name   string  optional    

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

generate_receipt   boolean  optional    

Example: true

receipt_mode   string  optional    

Example: per_person

Must be one of:
  • per_payment
  • per_person
receipt_description   string  optional    

Example: voluptas

issuer_name   string  optional    

This field is required when generate_receipt is true. O campo value não pode ser superior a 255 caracteres. Example: bssgrktspegmnbjqfiqmxl

issuer_document   string  optional    

This field is required when generate_receipt is true. O campo value não pode ser superior a 255 caracteres. Example: kjmvlxflpymezajwhdtuwgc

city   string  optional    

This field is required when generate_receipt is true. O campo value não pode ser superior a 255 caracteres. Example: wuykgtkmf

state   string  optional    

This field is required when generate_receipt is true. O campo value deve ser 2 caracteres. Example: is

items   string[]  optional    

O campo value deve ser um UUID válido. The uuid of an existing record in the payroll_sheet_items table.

Settle a payroll item

requires authentication payroll pay

Marca o item como pago e lança no caixa, com a obra e o centro de custo do item, debitando a conta de saída escolhida.

Com delivered, o item fica como entregue em vez de pago — é o dinheiro entregue na obra, que exige uma conta do tipo caixa e aceita o nome de quem entregou.

O recibo é opcional. Quando pedido, o caixa e o recibo nascem na mesma transação: se um falhar, nenhum dos dois fica gravado.

Sem sessão de caixa aberta, uma é aberta automaticamente — inclusive quando a do dia já foi fechada.

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/payroll-payments/et" \
    --header "Authorization: Bearer PdaVDg461afc53EeZkb6h8v" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"bank_account_id\": \"d1c9155c-12c0-33d3-881b-8f9c1751d168\",
    \"delivered\": true,
    \"delivered_by_name\": \"cbsl\",
    \"generate_receipt\": true,
    \"receipt_mode\": \"per_person\",
    \"receipt_description\": \"omnis\",
    \"issuer_name\": \"bhyvsxkkaqvwbulohyuzhekmy\",
    \"issuer_document\": \"ncgqamlnrbeu\",
    \"city\": \"znwlazhirptabo\",
    \"state\": \"pg\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/payroll-payments/et"
);

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

let body = {
    "bank_account_id": "d1c9155c-12c0-33d3-881b-8f9c1751d168",
    "delivered": true,
    "delivered_by_name": "cbsl",
    "generate_receipt": true,
    "receipt_mode": "per_person",
    "receipt_description": "omnis",
    "issuer_name": "bhyvsxkkaqvwbulohyuzhekmy",
    "issuer_document": "ncgqamlnrbeu",
    "city": "znwlazhirptabo",
    "state": "pg"
};

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

Example response (200):


{
    "data": {
        "id": "a345c148-c48f-4dd9-8d27-5f6f4e2fc27f",
        "payee": {
            "type": null,
            "label": null,
            "id": null,
            "name": "Brody Donnelly III",
            "document": "694.308.036-38"
        },
        "work": null,
        "cost_center": null,
        "amount": "320.65",
        "additions": [],
        "total": "320.65",
        "work_cost_total": "320.65",
        "payment_method": {
            "value": "pix",
            "label": "PIX"
        },
        "pix_key": null,
        "notes": null,
        "scheduled_date": "2026-11-20",
        "status": {
            "value": "pending",
            "label": "Pendente"
        },
        "is_settled": false,
        "paid_at": null,
        "paid_by": null,
        "delivered_by_name": null
    }
}
 

Request      

POST api/payroll-payments/{item}

Headers

Authorization        

Example: Bearer PdaVDg461afc53EeZkb6h8v

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

item   string     

UUID do item da folha. Example: et

Body Parameters

bank_account_id   string     

O campo value deve ser um UUID válido. The uuid of an existing record in the bank_accounts table. Example: d1c9155c-12c0-33d3-881b-8f9c1751d168

delivered   boolean  optional    

Example: true

delivered_by_name   string  optional    

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

generate_receipt   boolean  optional    

Example: true

receipt_mode   string  optional    

Example: per_person

Must be one of:
  • per_payment
  • per_person
receipt_description   string  optional    

Example: omnis

issuer_name   string  optional    

This field is required when generate_receipt is true. O campo value não pode ser superior a 255 caracteres. Example: bhyvsxkkaqvwbulohyuzhekmy

issuer_document   string  optional    

This field is required when generate_receipt is true. O campo value não pode ser superior a 255 caracteres. Example: ncgqamlnrbeu

city   string  optional    

This field is required when generate_receipt is true. O campo value não pode ser superior a 255 caracteres. Example: znwlazhirptabo

state   string  optional    

This field is required when generate_receipt is true. O campo value deve ser 2 caracteres. Example: pg

Payroll Sheets

Folha de sexta: montar, conferir e reabrir

List payroll sheets

requires authentication payroll index

Folhas por semana, da mais recente para a mais antiga, com os totais por forma de pagamento. A mesma semana pode ter mais de uma folha.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/payroll-sheets" \
    --header "Authorization: Bearer Dgdv8cakVaP3fb6e156EZ4h" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"sort_by\": \"sed\",
    \"sort_desc\": false,
    \"page\": 67,
    \"per_page\": 4,
    \"q\": \"itaque\",
    \"status\": \"scheduled\",
    \"period_from\": \"2026-11-20T15:38:28\",
    \"period_to\": \"2032-11-14\",
    \"payment_date_from\": \"2026-11-20T15:38:28\",
    \"payment_date_to\": \"2033-03-26\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/payroll-sheets"
);

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

let body = {
    "sort_by": "sed",
    "sort_desc": false,
    "page": 67,
    "per_page": 4,
    "q": "itaque",
    "status": "scheduled",
    "period_from": "2026-11-20T15:38:28",
    "period_to": "2032-11-14",
    "payment_date_from": "2026-11-20T15:38:28",
    "payment_date_to": "2033-03-26"
};

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

Example response (200):


{
    "data": [
        {
            "id": "a345c148-74e1-49a1-9c11-a04c4b415a11",
            "code": null,
            "name": "Obras",
            "period_start": "2026-11-16",
            "period_end": "2026-11-22",
            "payment_date": "2026-11-20",
            "status": {
                "value": "draft",
                "label": "Rascunho"
            },
            "items_count": 0,
            "grand_total": "0.00",
            "by_payment_method": []
        },
        {
            "id": "a345c148-7739-4740-aa2d-66ce56b9c7c5",
            "code": null,
            "name": "Escritório",
            "period_start": "2026-11-16",
            "period_end": "2026-11-22",
            "payment_date": "2026-11-20",
            "status": {
                "value": "draft",
                "label": "Rascunho"
            },
            "items_count": 0,
            "grand_total": "0.00",
            "by_payment_method": []
        }
    ],
    "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/payroll-sheets

Headers

Authorization        

Example: Bearer Dgdv8cakVaP3fb6e156EZ4h

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

sort_by   string  optional    

Example: sed

sort_desc   boolean  optional    

Example: false

page   integer  optional    

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

per_page   integer  optional    

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

q   string  optional    

Example: itaque

status   string  optional    

Example: scheduled

Must be one of:
  • draft
  • checked
  • scheduled
  • paid
period_from   string  optional    

O campo value deve ser uma data válida. Example: 2026-11-20T15:38:28

period_to   string  optional    

O campo value deve ser uma data válida. O campo value deve ser uma data posterior ou igual a period_from. Example: 2032-11-14

payment_date_from   string  optional    

O campo value deve ser uma data válida. Example: 2026-11-20T15:38:28

payment_date_to   string  optional    

O campo value deve ser uma data válida. O campo value deve ser uma data posterior ou igual a payment_date_from. Example: 2033-03-26

Create payroll sheet

requires authentication payroll build

Nasce em rascunho. O nome distingue folhas da mesma semana, como "Obras" e "Escritório".

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/payroll-sheets" \
    --header "Authorization: Bearer b3hgdaE614fe8ZkPVD5v6ca" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"paannxmelk\",
    \"period_start\": \"2026-11-20T15:38:28\",
    \"period_end\": \"2110-01-27\",
    \"payment_date\": \"2026-11-20T15:38:28\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/payroll-sheets"
);

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

let body = {
    "name": "paannxmelk",
    "period_start": "2026-11-20T15:38:28",
    "period_end": "2110-01-27",
    "payment_date": "2026-11-20T15:38:28"
};

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

Example response (201):


{
    "data": {
        "id": "a345c148-7e0d-46b2-b73f-dd061c3eefad",
        "code": null,
        "name": "Escritório",
        "period_start": "2026-11-16",
        "period_end": "2026-11-22",
        "payment_date": "2026-11-20",
        "status": {
            "value": "draft",
            "label": "Rascunho"
        },
        "accepts_item_changes": true,
        "can_reopen": false,
        "created_by": {
            "id": "a345c148-7e79-4a44-9168-5f43d2fd14a1",
            "name": "Deshaun Schiller"
        },
        "checked_by": null,
        "checked_at": null,
        "reopened_by": null,
        "reopened_at": null,
        "items": [],
        "totals": {
            "grand_total": "0.00",
            "work_cost_total": "0.00",
            "items_count": 0,
            "by_work": [],
            "by_payment_method": []
        }
    }
}
 

Request      

POST api/payroll-sheets

Headers

Authorization        

Example: Bearer b3hgdaE614fe8ZkPVD5v6ca

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

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

period_start   string     

O campo value deve ser uma data válida. Example: 2026-11-20T15:38:28

period_end   string     

O campo value deve ser uma data válida. O campo value deve ser uma data posterior ou igual a period_start. Example: 2110-01-27

payment_date   string     

O campo value deve ser uma data válida. Example: 2026-11-20T15:38:28

Show payroll sheet

requires authentication payroll show

Folha com os itens, os acréscimos e os totais por obra e por forma de pagamento, calculados no servidor.

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

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


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

Example response (200):


{
    "data": {
        "id": "a345c148-8429-4640-a893-30a32a1cda9f",
        "code": null,
        "name": "Escritório",
        "period_start": "2026-11-16",
        "period_end": "2026-11-22",
        "payment_date": "2026-11-20",
        "status": {
            "value": "draft",
            "label": "Rascunho"
        },
        "accepts_item_changes": true,
        "can_reopen": false,
        "created_by": {
            "id": "a345c148-8493-459e-811d-a8512bdd2bf3",
            "name": "Karli Gleichner II"
        },
        "checked_by": null,
        "checked_at": null,
        "reopened_by": null,
        "reopened_at": null,
        "items": [],
        "totals": {
            "grand_total": "0.00",
            "work_cost_total": "0.00",
            "items_count": 0,
            "by_work": [],
            "by_payment_method": []
        }
    }
}
 

Request      

GET api/payroll-sheets/{sheet}

Headers

Authorization        

Example: Bearer ev6EPa1g6h83b4DZfcdkV5a

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

sheet   string     

UUID da folha. Example: ut

Update payroll sheet

requires authentication payroll build

Semana, nome e data de pagamento só mudam em rascunho.

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/payroll-sheets/aperiam" \
    --header "Authorization: Bearer EcVavdP341Zkbef5a68g6hD" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"sazbx\",
    \"period_start\": \"2026-11-20T15:38:28\",
    \"period_end\": \"2095-06-30\",
    \"payment_date\": \"2026-11-20T15:38:28\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/payroll-sheets/aperiam"
);

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

let body = {
    "name": "sazbx",
    "period_start": "2026-11-20T15:38:28",
    "period_end": "2095-06-30",
    "payment_date": "2026-11-20T15:38:28"
};

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

Example response (200):


{
    "message": "Folha atualizada com sucesso."
}
 

Request      

PUT api/payroll-sheets/{sheet}

Headers

Authorization        

Example: Bearer EcVavdP341Zkbef5a68g6hD

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

sheet   string     

UUID da folha. Example: aperiam

Body Parameters

name   string  optional    

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

period_start   string  optional    

O campo value deve ser uma data válida. Example: 2026-11-20T15:38:28

period_end   string  optional    

O campo value deve ser uma data válida. O campo value deve ser uma data posterior ou igual a period_start. Example: 2095-06-30

payment_date   string  optional    

O campo value deve ser uma data válida. Example: 2026-11-20T15:38:28

Delete payroll sheet

requires authentication payroll build

Só em rascunho. Apagar a folha apaga os itens e os acréscimos dela.

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

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


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

Example response (200):


{
    "message": "Folha excluída com sucesso."
}
 

Request      

DELETE api/payroll-sheets/{sheet}

Headers

Authorization        

Example: Bearer 8P6d5h1vbkce6VEfDag4a3Z

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

sheet   string     

UUID da folha. Example: sit

Add item to payroll sheet

requires authentication payroll build

Lança um pagamento na folha. O favorecido vem do cadastro (payee_type mais payee_id) ou digitado à mão (receiver_name, sem payee_type) — este último é o dinheiro entregue na obra para quem não está em cadastro nenhum.

O nome e o documento do favorecido de cadastro são copiados no servidor, para a folha não mudar quando o cadastro mudar. Sem amount, cai na diária do funcionário. Sem scheduled_date, herda a data de pagamento da folha.

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/payroll-sheets/veritatis/items" \
    --header "Authorization: Bearer bevf65kd8VaaE6ghPc41ZD3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"payee_type\": \"employee\",
    \"payee_id\": \"30aa46e6-9de2-3fcf-b26e-aca4b5d84c38\",
    \"receiver_name\": \"pkkfcubpyumothelylmff\",
    \"receiver_document\": \"hamsavunigqgqdvqcrych\",
    \"work_id\": \"424c6ce4-1610-398a-a52f-d63dc1ac9eab\",
    \"cost_center_id\": \"aut\",
    \"amount\": 56,
    \"payment_method\": \"bank_transfer\",
    \"pix_key\": \"i\",
    \"notes\": \"h\",
    \"scheduled_date\": \"2026-11-20T15:38:28\",
    \"additions\": [
        {
            \"type_id\": \"32cbcddd-e6e5-3063-824e-09c8bbdb5807\",
            \"amount\": 59
        }
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/payroll-sheets/veritatis/items"
);

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

let body = {
    "payee_type": "employee",
    "payee_id": "30aa46e6-9de2-3fcf-b26e-aca4b5d84c38",
    "receiver_name": "pkkfcubpyumothelylmff",
    "receiver_document": "hamsavunigqgqdvqcrych",
    "work_id": "424c6ce4-1610-398a-a52f-d63dc1ac9eab",
    "cost_center_id": "aut",
    "amount": 56,
    "payment_method": "bank_transfer",
    "pix_key": "i",
    "notes": "h",
    "scheduled_date": "2026-11-20T15:38:28",
    "additions": [
        {
            "type_id": "32cbcddd-e6e5-3063-824e-09c8bbdb5807",
            "amount": 59
        }
    ]
};

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

Example response (201):


{
    "data": {
        "id": "a345c148-9538-4db7-9fcd-7575bfb813f9",
        "payee": {
            "type": null,
            "label": null,
            "id": null,
            "name": "Prof. Naomi Nikolaus",
            "document": "425.896.730-72"
        },
        "work": null,
        "cost_center": null,
        "amount": "350.23",
        "additions": [],
        "total": "350.23",
        "work_cost_total": "350.23",
        "payment_method": {
            "value": "pix",
            "label": "PIX"
        },
        "pix_key": null,
        "notes": null,
        "scheduled_date": "2026-11-20",
        "status": {
            "value": "pending",
            "label": "Pendente"
        },
        "is_settled": false,
        "paid_at": null,
        "paid_by": null,
        "delivered_by_name": null
    }
}
 

Request      

POST api/payroll-sheets/{sheet}/items

Headers

Authorization        

Example: Bearer bevf65kd8VaaE6ghPc41ZD3

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

sheet   string     

UUID da folha. Example: veritatis

Body Parameters

payee_type   string  optional    

Example: employee

Must be one of:
  • employee
  • supplier
payee_id   string  optional    

This field is required when payee_type is present. O campo value deve ser um UUID válido. Example: 30aa46e6-9de2-3fcf-b26e-aca4b5d84c38

receiver_name   string  optional    

This field is required when payee_type is not present. O campo value não pode ser superior a 255 caracteres. Example: pkkfcubpyumothelylmff

receiver_document   string  optional    

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

work_id   string  optional    

O campo value deve ser um UUID válido. The uuid of an existing record in the works table. Example: 424c6ce4-1610-398a-a52f-d63dc1ac9eab

cost_center_id   string     

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

amount   number     

O campo value deve ser pelo menos 0.01. Example: 56

payment_method   string     

Example: bank_transfer

Must be one of:
  • pix
  • bank_transfer
  • cash
  • check
pix_key   string  optional    

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

notes   string  optional    

O campo value não pode ser superior a 1000 caracteres. Example: h

scheduled_date   string  optional    

O campo value deve ser uma data válida. Example: 2026-11-20T15:38:28

additions   object[]  optional    
type_id   string     

O campo value deve ser um UUID válido. The uuid of an existing record in the payroll_addition_types table. Example: 32cbcddd-e6e5-3063-824e-09c8bbdb5807

amount   number  optional    

O campo value deve ser pelo menos 0.01. Example: 59

Update payroll sheet item

requires authentication payroll build

Só em folha em rascunho e item ainda não pago. Mandar additions substitui a lista inteira de acréscimos do item.

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/payroll-sheets/et/items/iure" \
    --header "Authorization: Bearer PDVgk63a56bdhf1e4Ev8aZc" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"payee_type\": \"supplier\",
    \"payee_id\": \"0ca42295-f658-39b1-a2eb-224ba4a6cb8e\",
    \"receiver_name\": \"uhkrqdlvnp\",
    \"receiver_document\": \"rffhdlmtdehuvgux\",
    \"work_id\": \"4910ca8c-8955-381b-927f-5884f8e73474\",
    \"cost_center_id\": \"quia\",
    \"amount\": 88,
    \"payment_method\": \"cash\",
    \"pix_key\": \"kwxgavkvswfl\",
    \"notes\": \"qfhhsx\",
    \"scheduled_date\": \"2026-11-20T15:38:28\",
    \"additions\": [
        {
            \"type_id\": \"b77cf59c-6901-3859-a162-94a624165a84\",
            \"amount\": 63
        }
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/payroll-sheets/et/items/iure"
);

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

let body = {
    "payee_type": "supplier",
    "payee_id": "0ca42295-f658-39b1-a2eb-224ba4a6cb8e",
    "receiver_name": "uhkrqdlvnp",
    "receiver_document": "rffhdlmtdehuvgux",
    "work_id": "4910ca8c-8955-381b-927f-5884f8e73474",
    "cost_center_id": "quia",
    "amount": 88,
    "payment_method": "cash",
    "pix_key": "kwxgavkvswfl",
    "notes": "qfhhsx",
    "scheduled_date": "2026-11-20T15:38:28",
    "additions": [
        {
            "type_id": "b77cf59c-6901-3859-a162-94a624165a84",
            "amount": 63
        }
    ]
};

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

Example response (200):


{
    "data": {
        "id": "a345c148-a037-4602-aa2b-2010de7d163b",
        "payee": {
            "type": null,
            "label": null,
            "id": null,
            "name": "Vena Sawayn",
            "document": "900.505.543-58"
        },
        "work": null,
        "cost_center": null,
        "amount": "345.79",
        "additions": [],
        "total": "345.79",
        "work_cost_total": "345.79",
        "payment_method": {
            "value": "pix",
            "label": "PIX"
        },
        "pix_key": null,
        "notes": null,
        "scheduled_date": "2026-11-20",
        "status": {
            "value": "pending",
            "label": "Pendente"
        },
        "is_settled": false,
        "paid_at": null,
        "paid_by": null,
        "delivered_by_name": null
    }
}
 

Request      

PUT api/payroll-sheets/{sheet}/items/{id}

Headers

Authorization        

Example: Bearer PDVgk63a56bdhf1e4Ev8aZc

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

sheet   string     

UUID da folha. Example: et

id   string     

The ID of the item. Example: iure

item   string     

UUID do item. Example: debitis

Body Parameters

payee_type   string  optional    

Example: supplier

Must be one of:
  • employee
  • supplier
payee_id   string  optional    

This field is required when payee_type is present. O campo value deve ser um UUID válido. Example: 0ca42295-f658-39b1-a2eb-224ba4a6cb8e

receiver_name   string  optional    

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

receiver_document   string  optional    

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

work_id   string  optional    

O campo value deve ser um UUID válido. The uuid of an existing record in the works table. Example: 4910ca8c-8955-381b-927f-5884f8e73474

cost_center_id   string     

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

amount   number  optional    

O campo value deve ser pelo menos 0.01. Example: 88

payment_method   string  optional    

Example: cash

Must be one of:
  • pix
  • bank_transfer
  • cash
  • check
pix_key   string  optional    

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

notes   string  optional    

O campo value não pode ser superior a 1000 caracteres. Example: qfhhsx

scheduled_date   string  optional    

O campo value deve ser uma data válida. Example: 2026-11-20T15:38:28

additions   object[]  optional    
type_id   string     

O campo value deve ser um UUID válido. The uuid of an existing record in the payroll_addition_types table. Example: b77cf59c-6901-3859-a162-94a624165a84

amount   number  optional    

O campo value deve ser pelo menos 0.01. Example: 63

Delete payroll sheet item

requires authentication payroll build

Só em folha em rascunho e item ainda não pago.

Example request:
curl --request DELETE \
    "https://api.bs-homolog.pensou.app.br/api/payroll-sheets/optio/items/id" \
    --header "Authorization: Bearer vfg4D5kZc6a18bh6Ee3aVPd" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/payroll-sheets/optio/items/id"
);

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


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

Example response (200):


{
    "message": "Pagamento removido da folha."
}
 

Request      

DELETE api/payroll-sheets/{sheet}/items/{item}

Headers

Authorization        

Example: Bearer vfg4D5kZc6a18bh6Ee3aVPd

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

sheet   string     

UUID da folha. Example: optio

item   string     

UUID do item. Example: id

Check payroll sheet

requires authentication payroll check

Confere e trava a folha: a partir daí ela não aceita mais alteração de item. Registra quem conferiu e quando. Folha sem item não é conferível.

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/payroll-sheets/est/check" \
    --header "Authorization: Bearer 3kc4gbdfvDE6h1ZV6aPe5a8" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/payroll-sheets/est/check"
);

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


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

Example response (200):


{
    "data": {
        "id": "a345c148-a9b0-40f4-b279-d2a360cdb345",
        "code": null,
        "name": "Escritório",
        "period_start": "2026-11-16",
        "period_end": "2026-11-22",
        "payment_date": "2026-11-20",
        "status": {
            "value": "draft",
            "label": "Rascunho"
        },
        "accepts_item_changes": true,
        "can_reopen": false,
        "created_by": {
            "id": "a345c148-aa15-4150-bbd2-8128eacce59d",
            "name": "Leda Rogahn"
        },
        "checked_by": null,
        "checked_at": null,
        "reopened_by": null,
        "reopened_at": null,
        "items": [],
        "totals": {
            "grand_total": "0.00",
            "work_cost_total": "0.00",
            "items_count": 0,
            "by_work": [],
            "by_payment_method": []
        }
    }
}
 

Request      

POST api/payroll-sheets/{sheet}/check

Headers

Authorization        

Example: Bearer 3kc4gbdfvDE6h1ZV6aPe5a8

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

sheet   string     

UUID da folha. Example: est

Reopen payroll sheet

requires authentication payroll check

Volta a folha para rascunho e registra quem reabriu e quando. Recusada quando algum item já foi pago ou entregue.

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

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


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

Example response (200):


{
    "data": {
        "id": "a345c148-ae33-48c1-8943-6e8c283f8969",
        "code": null,
        "name": "Obras",
        "period_start": "2026-11-16",
        "period_end": "2026-11-22",
        "payment_date": "2026-11-20",
        "status": {
            "value": "draft",
            "label": "Rascunho"
        },
        "accepts_item_changes": true,
        "can_reopen": false,
        "created_by": {
            "id": "a345c148-aea1-45f6-904d-76a4fcfbf3af",
            "name": "Prof. Lionel Hartmann DVM"
        },
        "checked_by": null,
        "checked_at": null,
        "reopened_by": null,
        "reopened_at": null,
        "items": [],
        "totals": {
            "grand_total": "0.00",
            "work_cost_total": "0.00",
            "items_count": 0,
            "by_work": [],
            "by_payment_method": []
        }
    }
}
 

Request      

POST api/payroll-sheets/{sheet}/reopen

Headers

Authorization        

Example: Bearer f5vkZVa1da63cehP8b64DEg

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

sheet   string     

UUID da folha. Example: debitis

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 ahD8vkaEb4d3c5fg16PeV6Z" \
    --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 ahD8vkaEb4d3c5fg16PeV6Z",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": [
        {
            "id": "b66980fe-90f1-350c-8fc6-dd1ea2b24410",
            "name": "veniam",
            "display_name": "Tenetur fugit modi iusto officia."
        },
        {
            "id": "ad680220-8a13-3670-b1bf-a58456516be6",
            "name": "magni",
            "display_name": "Voluptas iste neque voluptates sed."
        }
    ],
    "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 ahD8vkaEb4d3c5fg16PeV6Z

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 c1b48VeP3kgZ5haED6dfav6" \
    --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 c1b48VeP3kgZ5haED6dfav6",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": [
        {
            "id": "d0f2b6b0-46d0-387b-983f-33e0a3a72f6a",
            "name": "qui-et",
            "display_name": "non qui expedita",
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "3f0ba497-83db-3c4d-96be-25305704452d",
            "name": "natus-ducimus",
            "display_name": "rerum dolor optio",
            "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 c1b48VeP3kgZ5haED6dfav6

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 Pfhk3g5VDZd61b8cEav4a6e" \
    --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 Pfhk3g5VDZd61b8cEav4a6e",
    "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 Pfhk3g5VDZd61b8cEav4a6e

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 61E6b8P3DgkZ4Vvfe5haacd" \
    --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 61E6b8P3DgkZ4Vvfe5haacd",
    "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 61E6b8P3DgkZ4Vvfe5haacd

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 hDva4kV61ba35dgf8Ze6cPE" \
    --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 hDva4kV61ba35dgf8Ze6cPE",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": {
        "id": "6df8cd9b-19fc-3f28-b0e6-231f0b83df63",
        "name": "qui-eveniet",
        "display_name": "at eos consequatur",
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/permission-groups/{permissionGroup}

Headers

Authorization        

Example: Bearer hDva4kV61ba35dgf8Ze6cPE

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 hckgf1DZ366P4be8daavVE5" \
    --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 hckgf1DZ366P4be8daavVE5",
    "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 hckgf1DZ366P4be8daavVE5

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 6EakZd8aDh1bfP354gVce6v" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"permissions\": [
        \"048b1979-a666-3a30-bee1-846a0d50416c\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/permission-groups/1/permissions"
);

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

let body = {
    "permissions": [
        "048b1979-a666-3a30-bee1-846a0d50416c"
    ]
};

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

Example response (200):


{
    "data": {
        "id": "9f327a05-4017-30bf-bc96-d90f309f5eb9",
        "name": "enim-recusandae",
        "display_name": "laborum libero eius",
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

POST api/permission-groups/{permissionGroup}/permissions

Headers

Authorization        

Example: Bearer 6EakZd8aDh1bfP354gVce6v

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 3VeEgP6hbd5D6caa84k1Zfv" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"permissions\": [
        \"88a96716-e233-35ce-b75a-18791215cb05\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/permission-groups/1/permissions"
);

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

let body = {
    "permissions": [
        "88a96716-e233-35ce-b75a-18791215cb05"
    ]
};

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

Example response (200):


{
    "data": {
        "id": "31eaa7d8-955f-3f3d-bf4d-7d32a38d340d",
        "name": "inventore-ab",
        "display_name": "culpa est sint",
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

DELETE api/permission-groups/{permissionGroup}/permissions

Headers

Authorization        

Example: Bearer 3VeEgP6hbd5D6caa84k1Zfv

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 DE86P6Vcdfa4vg31hkeba5Z" \
    --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 DE86P6Vcdfa4vg31hkeba5Z",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": [
        {
            "id": "7305ff89-40c4-36d6-bf08-7121c65e58db",
            "name": "Dr. Noa Lira D'ávila Filho",
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "d0fb3cdd-5f4b-3f86-9000-958f3c3c6f50",
            "name": "Miriam Dirce Maia Sobrinho",
            "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 DE86P6Vcdfa4vg31hkeba5Z

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/placeat" \
    --header "Authorization: Bearer 61hEdecPZkf3vaa6b5V48Dg" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-brands/placeat"
);

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


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

Example response (200):


{
    "data": {
        "id": "b9d60094-189b-35d0-8eac-daf4bca299d5",
        "name": "Dr. Matias Guerra Arruda",
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/product-brands/{productBrand}

Headers

Authorization        

Example: Bearer 61hEdecPZkf3vaa6b5V48Dg

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productBrand   string     

Product brand UUID Example: placeat

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 1E6468fc5vhagDVePkZbad3" \
    --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 1E6468fc5vhagDVePkZbad3",
    "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 1E6468fc5vhagDVePkZbad3

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/vel" \
    --header "Authorization: Bearer 1kPcEVb5ag6D3va6f8Zdh4e" \
    --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/vel"
);

const headers = {
    "Authorization": "Bearer 1kPcEVb5ag6D3va6f8Zdh4e",
    "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 1kPcEVb5ag6D3va6f8Zdh4e

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productBrand   string     

Product brand UUID Example: vel

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/iusto" \
    --header "Authorization: Bearer b183akgh6PD5dvae46VZfcE" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-brands/iusto"
);

const headers = {
    "Authorization": "Bearer b183akgh6PD5dvae46VZfcE",
    "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 b183akgh6PD5dvae46VZfcE

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productBrand   string     

Product brand UUID Example: iusto

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=&q=Structure" \
    --header "Authorization: Bearer 6Dagd81k3hf4bcvZVEe5Pa6" \
    --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": "0",
    "q": "Structure",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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


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

Example response (200):


{
    "data": [
        {
            "id": "2e28f233-c9ac-3062-9281-0b3befb5f04e",
            "name": "Aurora Rios Ortega",
            "is_epi": false,
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "57eef4ae-d836-344a-a043-f0badea001ed",
            "name": "Dr. Thales Sepúlveda Padilha",
            "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 6Dagd81k3hf4bcvZVEe5Pa6

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

is_epi   boolean  optional    

Example: false

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/illum" \
    --header "Authorization: Bearer a5chZE61Vb3gfd84vkDaP6e" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-families/illum"
);

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


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

Example response (200):


{
    "data": {
        "id": "3e383d97-f817-37b2-b75e-6e36e99e34ac",
        "name": "Michelle Patrícia Cortês Neto",
        "is_epi": false,
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/product-families/{productFamily}

Headers

Authorization        

Example: Bearer a5chZE61Vb3gfd84vkDaP6e

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productFamily   string     

Product family UUID Example: illum

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 ZVP3adbefEg481kca65vDh6" \
    --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 ZVP3adbefEg481kca65vDh6",
    "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 ZVP3adbefEg481kca65vDh6

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/non" \
    --header "Authorization: Bearer 8a3aP1g5EVh6ec6bDkfdZ4v" \
    --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/non"
);

const headers = {
    "Authorization": "Bearer 8a3aP1g5EVh6ec6bDkfdZ4v",
    "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 8a3aP1g5EVh6ec6bDkfdZ4v

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productFamily   string     

Product family UUID Example: non

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/sunt" \
    --header "Authorization: Bearer kdg3DfbVhaP6ac1e5E64Z8v" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-families/sunt"
);

const headers = {
    "Authorization": "Bearer kdg3DfbVhaP6ac1e5E64Z8v",
    "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 kdg3DfbVhaP6ac1e5E64Z8v

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productFamily   string     

Product family UUID Example: sunt

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 4vdfEP51386bahgD6eVckZa" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"q\": \"Example Q\",
    \"work_id\": \"04690c4c-68a9-3165-a302-12a26350e940\",
    \"user_id\": \"f1ff9e6b-0234-35f6-ab8f-cd419dc903e6\",
    \"responsible_id\": \"67f5daf0-8184-3318-8909-906f2a261a0c\",
    \"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 4vdfEP51386bahgD6eVckZa",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "q": "Example Q",
    "work_id": "04690c4c-68a9-3165-a302-12a26350e940",
    "user_id": "f1ff9e6b-0234-35f6-ab8f-cd419dc903e6",
    "responsible_id": "67f5daf0-8184-3318-8909-906f2a261a0c",
    "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": "489cab7f-ebee-3582-ae58-40032d0237ac",
            "name": "Pariatur ratione vero dolores qui.",
            "description": "Modi quasi sunt eos ea autem cumque nobis nostrum. Eaque animi animi doloremque distinctio omnis eum expedita. Iste facere sunt quis ut.",
            "work": {
                "id": "a345c149-4183-4c4d-b544-974980b5e742",
                "name": "Dr. Irene Toledo"
            },
            "user": {
                "id": "a345c149-444b-4518-82c2-0032cb099e4f",
                "name": "Bridgette Kshlerin"
            },
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "bf7c92f6-f3b6-3c0d-9b04-d6696cb21628",
            "name": "Quasi corporis qui.",
            "description": null,
            "work": {
                "id": "a345c149-4757-4973-8994-67765df98b3b",
                "name": "Malu Molina Arruda Filho"
            },
            "user": {
                "id": "a345c149-49ba-4a63-9a93-bfa30de45b2c",
                "name": "Abelardo Grimes"
            },
            "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 4vdfEP51386bahgD6eVckZa

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: 04690c4c-68a9-3165-a302-12a26350e940

user_id   string  optional    

Usuário. The uuid of an existing record in the users table. Example: f1ff9e6b-0234-35f6-ab8f-cd419dc903e6

responsible_id   string  optional    

Responsável. The uuid of an existing record in the users table. Example: 67f5daf0-8184-3318-8909-906f2a261a0c

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/culpa" \
    --header "Authorization: Bearer gkDf1vZad6e653E4VbchaP8" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-quantity-lists/culpa"
);

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


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

Example response (200):


{
    "data": {
        "id": "d8c570bd-e3ac-3560-bede-b6a5d2cacc92",
        "name": "Consectetur ex quasi.",
        "description": "Odio dolorum et corporis occaecati quidem. Ratione itaque explicabo ut nobis nobis sit fugit impedit. Odit porro totam eius voluptatem maxime. Suscipit sit iure et rem at fugiat. Voluptas autem sunt quia quibusdam corporis.",
        "work": {
            "id": "a345c149-50a3-4f41-8e00-bffdbf6ab99d",
            "name": "Saulo Teles Neto"
        },
        "user": {
            "id": "a345c149-5333-49a5-b709-52d9b4001db3",
            "name": "Lucienne Mohr"
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/product-quantity-lists/{productQuantityList}

Headers

Authorization        

Example: Bearer gkDf1vZad6e653E4VbchaP8

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productQuantityList   string     

Product Quantity List UUID Example: culpa

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/omnis/items" \
    --header "Authorization: Bearer a8aE1k66P45dhg3vecbZDfV" \
    --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/omnis/items"
);

const headers = {
    "Authorization": "Bearer a8aE1k66P45dhg3vecbZDfV",
    "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": "1908f19f-e596-3b05-9c21-41feb6f01586",
            "product": {
                "id": "a345c149-6618-4ead-b9c4-33b36aca40ff",
                "name": "Rafael Teobaldo Jimenes",
                "code": "PRD-011381",
                "unit": {
                    "id": "a345c149-642d-4d44-8e5e-8ded7e5d30e7",
                    "name": "Srta. Jasmin Sepúlveda Faro Filho",
                    "abbreviation": "Gian Adriel Santana Jr."
                }
            },
            "quantity": 936.5423,
            "observation": null,
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "ba87a561-4b3e-39b4-97fd-c2a1df2fb7fe",
            "product": {
                "id": "a345c149-7373-4d3e-a973-022c4283a4ce",
                "name": "Thalissa Tatiana Escobar Jr.",
                "code": "PRD-696371",
                "unit": {
                    "id": "a345c149-725b-4679-ab45-a81ab48874f6",
                    "name": "Gabriel Paes Galvão",
                    "abbreviation": "Mônica Leal"
                }
            },
            "quantity": 762.5298,
            "observation": "Adipisci et ea aut praesentium consectetur et fugiat iure.",
            "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 a8aE1k66P45dhg3vecbZDfV

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productQuantityList   string     

Product Quantity List UUID Example: omnis

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 c5134gDPa66kbZd8fhavEeV" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"description\": \"Example Description\",
    \"work_id\": \"d5a192c1-2cc3-3361-8d4f-cd426c5ecb93\",
    \"items\": [
        {
            \"product_id\": \"b463e22d-9770-38f3-b355-06367ef3f5df\",
            \"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 c5134gDPa66kbZd8fhavEeV",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "description": "Example Description",
    "work_id": "d5a192c1-2cc3-3361-8d4f-cd426c5ecb93",
    "items": [
        {
            "product_id": "b463e22d-9770-38f3-b355-06367ef3f5df",
            "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 c5134gDPa66kbZd8fhavEeV

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: d5a192c1-2cc3-3361-8d4f-cd426c5ecb93

items   object[]  optional    

Itens.

product_id   string     

Produto. The uuid of an existing record in the products table. Example: b463e22d-9770-38f3-b355-06367ef3f5df

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/commodi" \
    --header "Authorization: Bearer 6aed41EfaDkv6P53Zcbgh8V" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"description\": \"Example Description\",
    \"items\": [
        {
            \"id\": \"c077b1b3-689d-30d1-b40f-56d52e0ad84c\",
            \"product_id\": \"42b647de-6035-3e6c-a62c-c58554cd6126\",
            \"quantity\": 1,
            \"observation\": \"Example Items * observation\"
        },
        null
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-quantity-lists/commodi"
);

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

let body = {
    "name": "Example Name",
    "description": "Example Description",
    "items": [
        {
            "id": "c077b1b3-689d-30d1-b40f-56d52e0ad84c",
            "product_id": "42b647de-6035-3e6c-a62c-c58554cd6126",
            "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 6aed41EfaDkv6P53Zcbgh8V

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productQuantityList   string     

Product Quantity List UUID Example: commodi

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: c077b1b3-689d-30d1-b40f-56d52e0ad84c

product_id   string     

Produto. The uuid of an existing record in the products table. Example: 42b647de-6035-3e6c-a62c-c58554cd6126

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/praesentium" \
    --header "Authorization: Bearer vVDg1dEc5ahZbePkf8636a4" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-quantity-lists/praesentium"
);

const headers = {
    "Authorization": "Bearer vVDg1dEc5ahZbePkf8636a4",
    "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 vVDg1dEc5ahZbePkf8636a4

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productQuantityList   string     

Product Quantity List UUID Example: praesentium

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/et/items" \
    --header "Authorization: Bearer 486EgVDbca3kd6evhZfaP15" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"items\": [
        {
            \"product_id\": \"ed3265f7-000c-383c-ad40-f2bf91e024e3\",
            \"quantity\": 1,
            \"observation\": \"Example Items * observation\"
        },
        null
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-quantity-lists/et/items"
);

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

let body = {
    "items": [
        {
            "product_id": "ed3265f7-000c-383c-ad40-f2bf91e024e3",
            "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 486EgVDbca3kd6evhZfaP15

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productQuantityList   string     

Product Quantity List UUID Example: et

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: ed3265f7-000c-383c-ad40-f2bf91e024e3

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/nemo" \
    --header "Authorization: Bearer 5vaebZd8c3E1Vhg6aPfD46k" \
    --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/nemo"
);

const headers = {
    "Authorization": "Bearer 5vaebZd8c3E1Vhg6aPfD46k",
    "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 5vaebZd8c3E1Vhg6aPfD46k

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the item. Example: nemo

item   string     

Product Quantity List Item UUID Example: laudantium

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/quis/items" \
    --header "Authorization: Bearer kE46f31vab68hcdDZ5PeagV" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"items\": [
        \"57906793-e7cd-391a-9ddc-63dfdbc00ec9\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-quantity-lists/quis/items"
);

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

let body = {
    "items": [
        "57906793-e7cd-391a-9ddc-63dfdbc00ec9"
    ]
};

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 kE46f31vab68hcdDZ5PeagV

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productQuantityList   string     

Product Quantity List UUID Example: quis

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/et/sync-items" \
    --header "Authorization: Bearer kbh45PadEea3c1g8fV6v6ZD" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"items\": [
        {
            \"id\": \"489dbd98-d933-3149-b11e-ce9c77d9d83a\",
            \"product_id\": \"06dcada0-bb6b-368a-82fc-fb76548219ae\",
            \"quantity\": 1,
            \"observation\": \"Example Items * observation\"
        },
        null
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-quantity-lists/et/sync-items"
);

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

let body = {
    "items": [
        {
            "id": "489dbd98-d933-3149-b11e-ce9c77d9d83a",
            "product_id": "06dcada0-bb6b-368a-82fc-fb76548219ae",
            "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 kbh45PadEea3c1g8fV6v6ZD

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productQuantityList   string     

Product Quantity List UUID Example: et

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: 489dbd98-d933-3149-b11e-ce9c77d9d83a

product_id   string     

Produto. The uuid of an existing record in the products table. Example: 06dcada0-bb6b-368a-82fc-fb76548219ae

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/ut/fulfill" \
    --header "Authorization: Bearer g8PEa663c5VZ4hdkbvDfa1e" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"fulfillment_type\": \"Example Fulfillment type\",
    \"stock_id\": \"d25373a1-0d51-3e68-99e1-46301c51c928\",
    \"quantity\": 1,
    \"source_stock_id\": \"7f293939-c3b6-3012-89f6-9d9be56c7d16\",
    \"reason\": \"Example Reason\",
    \"origins\": [
        {
            \"supplier_product_id\": \"ec5004a2-8dfe-3c4c-9da8-d026a00a6d27\",
            \"quantity\": 1
        },
        null
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-requests/items/ut/fulfill"
);

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

let body = {
    "fulfillment_type": "Example Fulfillment type",
    "stock_id": "d25373a1-0d51-3e68-99e1-46301c51c928",
    "quantity": 1,
    "source_stock_id": "7f293939-c3b6-3012-89f6-9d9be56c7d16",
    "reason": "Example Reason",
    "origins": [
        {
            "supplier_product_id": "ec5004a2-8dfe-3c4c-9da8-d026a00a6d27",
            "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 g8PEa663c5VZ4hdkbvDfa1e

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

item   string     

Product Request Item UUID Example: ut

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: d25373a1-0d51-3e68-99e1-46301c51c928

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: 7f293939-c3b6-3012-89f6-9d9be56c7d16

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: ec5004a2-8dfe-3c4c-9da8-d026a00a6d27

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/eveniet/fulfillments" \
    --header "Authorization: Bearer 1364kEegdZD8Vfcha65Pavb" \
    --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/eveniet/fulfillments"
);

const headers = {
    "Authorization": "Bearer 1364kEegdZD8Vfcha65Pavb",
    "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": "199fc952-a745-36d9-870e-787dadccd3a6",
            "quantity": 55.4461,
            "fulfilled_at": "2026-11-14T23:22:51.000000Z",
            "created_at": null
        },
        {
            "id": "f6b73295-6398-3539-92e9-1eb441086cca",
            "quantity": 38.1678,
            "fulfilled_at": "2026-10-28T00:06:52.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 1364kEegdZD8Vfcha65Pavb

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

item   string     

Product Request Item UUID Example: eveniet

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/eius" \
    --header "Authorization: Bearer 1Ev6Dac8k3e6gaP4fZ5Vdbh" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-requests/items/eius"
);

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


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

Example response (200):


{
    "data": {
        "id": "83bb70cb-0a78-3d3a-bc18-0ffb16f604cd",
        "product": {
            "id": "a345c14c-b108-4a72-b7cc-eeed4a05bb66",
            "name": "Demian Godói Esteves Filho",
            "code": "PRD-833622",
            "unit": {
                "id": "a345c14c-aff6-4d5c-8854-6beae5b7ad25",
                "name": "Dr. Cauan Montenegro",
                "abbreviation": "Srta. Noelí Isis Maia"
            }
        },
        "quantity": 425.475,
        "quantity_fulfilled": 0,
        "quantity_pending": 425.475,
        "is_fulfilled": false,
        "is_partially_fulfilled": false,
        "observation": "Possimus maiores ratione sed doloremque sunt ab eius.",
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/product-requests/items/{id}

Headers

Authorization        

Example: Bearer 1Ev6Dac8k3e6gaP4fZ5Vdbh

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the item. Example: eius

item   string     

Product Request Item UUID Example: sit

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/iure/pending-items" \
    --header "Authorization: Bearer DfcVgP4eahEZd15a6b36v8k" \
    --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/iure/pending-items"
);

const headers = {
    "Authorization": "Bearer DfcVgP4eahEZd15a6b36v8k",
    "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": "7fc0dd67-f565-323a-bd17-955157542b32",
            "product": {
                "id": "a345c14c-e486-42db-8bb8-e87a8d94129c",
                "name": "Srta. Malena Ivana Beltrão Jr.",
                "code": "PRD-558714",
                "unit": {
                    "id": "a345c14c-e33e-46e7-935c-8f52747dd212",
                    "name": "Sra. Vanessa Ariane Oliveira",
                    "abbreviation": "Sr. Máximo Walter Barros Neto"
                }
            },
            "quantity": 713.3417,
            "quantity_fulfilled": 0,
            "quantity_pending": 713.3417,
            "is_fulfilled": false,
            "is_partially_fulfilled": false,
            "observation": null,
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "2a65a170-1a6c-3275-a074-07b5daf89cef",
            "product": {
                "id": "a345c14c-f41c-4067-b948-29b487d52a90",
                "name": "Mauro Alexandre Fonseca",
                "code": "PRD-471042",
                "unit": {
                    "id": "a345c14c-f30e-4655-a832-b073a69abe6c",
                    "name": "Sr. Heitor Esteves",
                    "abbreviation": "Augusto Gean Guerra Filho"
                }
            },
            "quantity": 753.3987,
            "quantity_fulfilled": 0,
            "quantity_pending": 753.3987,
            "is_fulfilled": false,
            "is_partially_fulfilled": false,
            "observation": "Ullam error sequi ex.",
            "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 DfcVgP4eahEZd15a6b36v8k

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productRequest   string     

Product Request UUID Example: iure

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/omnis" \
    --header "Authorization: Bearer 56hc6vPfa8VbaeE3ZgD41dk" \
    --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/omnis"
);

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


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

Example response (200):


{
    "data": [
        {
            "id": "b1499fe3-0784-3a97-bf79-739914b316cf",
            "product": {
                "id": "a345c14d-0788-461f-8892-395b0c3668b9",
                "name": "Sr. Máximo Sergio Mendes Sobrinho",
                "code": "PRD-928539",
                "unit": {
                    "id": "a345c14d-0654-4ff4-9d65-7cbd3727789d",
                    "name": "Sara Prado Camacho",
                    "abbreviation": "Ziraldo Michael Alves"
                }
            },
            "quantity": 341.7937,
            "quantity_fulfilled": 0,
            "quantity_pending": 341.7937,
            "is_fulfilled": false,
            "is_partially_fulfilled": false,
            "observation": "Voluptatem animi sunt est et doloremque.",
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "2a4c7862-2c36-349d-8cdd-413767fb1d05",
            "product": {
                "id": "a345c14d-2359-45fd-b3ed-9c9e204b42a3",
                "name": "Bárbara Faria Azevedo Jr.",
                "code": "PRD-802058",
                "unit": {
                    "id": "a345c14d-206e-4654-8e19-c8f34b911e1f",
                    "name": "Dr. Ziraldo Wellington Rocha",
                    "abbreviation": "Sr. Aaron Chaves"
                }
            },
            "quantity": 453.5654,
            "quantity_fulfilled": 0,
            "quantity_pending": 453.5654,
            "is_fulfilled": false,
            "is_partially_fulfilled": false,
            "observation": "Sit aspernatur optio tempora dignissimos non.",
            "created_at": null,
            "updated_at": null
        }
    ]
}
 

Request      

GET api/product-requests/pending-by-product/{product}

Headers

Authorization        

Example: Bearer 56hc6vPfa8VbaeE3ZgD41dk

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

product   string     

Product UUID Example: omnis

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 4vDad1VfP6b8cg3e5E6Zakh" \
    --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\": \"1fef9dd3-542c-3964-b95f-46ae28edf73e\",
    \"work_location_id\": \"a958e2c1-82ec-3ce5-81d4-1896deabb4da\",
    \"user_id\": \"409e14ec-1982-3776-8b4b-41228416f3a6\",
    \"status_id\": \"62a76496-91c6-38cd-87da-4490f1dd9ed7\",
    \"priority\": \"Example Priority\",
    \"needed_at_from\": \"Example Needed at from\",
    \"needed_at_to\": \"Example Needed at to\",
    \"responsible_id\": \"bb03d52d-3145-3bb2-bc60-4f120e6d887d\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-requests"
);

const headers = {
    "Authorization": "Bearer 4vDad1VfP6b8cg3e5E6Zakh",
    "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": "1fef9dd3-542c-3964-b95f-46ae28edf73e",
    "work_location_id": "a958e2c1-82ec-3ce5-81d4-1896deabb4da",
    "user_id": "409e14ec-1982-3776-8b4b-41228416f3a6",
    "status_id": "62a76496-91c6-38cd-87da-4490f1dd9ed7",
    "priority": "Example Priority",
    "needed_at_from": "Example Needed at from",
    "needed_at_to": "Example Needed at to",
    "responsible_id": "bb03d52d-3145-3bb2-bc60-4f120e6d887d"
};

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

Example response (200):


{
    "data": [
        {
            "id": "516c3107-4e8b-32f8-a931-081c039c7b6b",
            "code": null,
            "name": "Nostrum id et.",
            "description": "Est reprehenderit doloribus laborum autem ex. Totam delectus mollitia odit ipsum voluptatem velit. Debitis non in assumenda quaerat.",
            "work": {
                "id": "a345c14a-6476-42e1-b91c-e2abccec93d3",
                "name": "Matias Gil Jr."
            },
            "user": {
                "id": "a345c14a-6701-4d42-bf00-e77b3be89ea2",
                "name": "Dr. Mckenzie Jerde"
            },
            "status": {
                "id": "a345c14a-6892-4558-aca6-062c0bd3471b",
                "slug": null,
                "name": null,
                "description": "Cláudia Letícia Pedrosa",
                "abbreviation": "corrupti",
                "color": "#b821c3",
                "text_color": "#1ed819"
            },
            "priority": "high",
            "priority_label": "Alta",
            "needed_at": null,
            "approved_at": null,
            "rejection_reason": null,
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "ba355d69-d262-3231-b749-3686624ccd1d",
            "code": null,
            "name": "Nesciunt eos occaecati illum.",
            "description": null,
            "work": {
                "id": "a345c14a-6bae-45cf-8562-9881c4384865",
                "name": "Dr. Isis Helena Faria Filho"
            },
            "user": {
                "id": "a345c14a-6df8-4ba3-9136-2be688cfacaf",
                "name": "Candice Heidenreich"
            },
            "status": {
                "id": "a345c14a-6f77-4da2-81db-4814e7336282",
                "slug": null,
                "name": null,
                "description": "Giovane Leal Faria",
                "abbreviation": "hic",
                "color": "#f0ee48",
                "text_color": "#495523"
            },
            "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 4vDad1VfP6b8cg3e5E6Zakh

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: 1fef9dd3-542c-3964-b95f-46ae28edf73e

work_location_id   string  optional    

Local da obra. The uuid of an existing record in the work_locations table. Example: a958e2c1-82ec-3ce5-81d4-1896deabb4da

user_id   string  optional    

Usuário. The uuid of an existing record in the users table. Example: 409e14ec-1982-3776-8b4b-41228416f3a6

status_id   string  optional    

Status. The uuid of an existing record in the statuses table. Example: 62a76496-91c6-38cd-87da-4490f1dd9ed7

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: bb03d52d-3145-3bb2-bc60-4f120e6d887d

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/dolorum" \
    --header "Authorization: Bearer 6vEcDek635faaVb1PZ8dh4g" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-requests/dolorum"
);

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


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

Example response (200):


{
    "data": {
        "id": "86c49cb8-9663-329d-978f-280935be507e",
        "code": null,
        "name": "Voluptatum reiciendis aspernatur.",
        "description": "Consequatur qui error distinctio et numquam. Enim nihil in quaerat nisi aut consectetur. Occaecati ut quidem aliquam qui.",
        "work": {
            "id": "a345c14a-77a0-4d77-a732-e1e7a582926b",
            "name": "Vitor Ricardo Domingues"
        },
        "user": {
            "id": "a345c14a-7a39-4bd6-978d-ae9179da1831",
            "name": "Dr. Amparo Marks I"
        },
        "status": {
            "id": "a345c14a-7be7-4458-ad2d-08a90744c26a",
            "slug": null,
            "name": null,
            "description": "Srta. Luna Fidalgo Deverso",
            "abbreviation": "maiores",
            "color": "#3a39bf",
            "text_color": "#235f1f"
        },
        "priority": "high",
        "priority_label": "Alta",
        "needed_at": null,
        "approved_at": null,
        "rejection_reason": null,
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/product-requests/{productRequest}

Headers

Authorization        

Example: Bearer 6vEcDek635faaVb1PZ8dh4g

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productRequest   string     

Product Request UUID Example: dolorum

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/sunt/items" \
    --header "Authorization: Bearer v1gDe8c5P46fdZVEbaa3kh6" \
    --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/sunt/items"
);

const headers = {
    "Authorization": "Bearer v1gDe8c5P46fdZVEbaa3kh6",
    "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": "a6780f93-8028-3a77-b71e-2385ed1c09c6",
            "product": {
                "id": "a345c14a-9933-4660-a214-541a44853375",
                "name": "Jerônimo Pedro Benites Neto",
                "code": "PRD-999897",
                "unit": {
                    "id": "a345c14a-97f6-4e54-add1-dd56c5ca5f89",
                    "name": "Michelle Maldonado Flores Neto",
                    "abbreviation": "Marília Flávia da Cruz Filho"
                }
            },
            "quantity": 721.9271,
            "quantity_fulfilled": 0,
            "quantity_pending": 721.9271,
            "is_fulfilled": false,
            "is_partially_fulfilled": false,
            "observation": null,
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "f073cc6d-a36e-326e-a838-3d1ac92b0e9c",
            "product": {
                "id": "a345c14a-a978-435e-9746-be69acd6c259",
                "name": "Sra. Nicole Azevedo Mendes",
                "code": "PRD-354701",
                "unit": {
                    "id": "a345c14a-a834-432a-a637-a1089174948e",
                    "name": "Sra. Mia Marisa Feliciano",
                    "abbreviation": "Sr. Fábio Christian Pacheco"
                }
            },
            "quantity": 247.0379,
            "quantity_fulfilled": 0,
            "quantity_pending": 247.0379,
            "is_fulfilled": false,
            "is_partially_fulfilled": false,
            "observation": "Perspiciatis pariatur facilis impedit repellendus.",
            "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 v1gDe8c5P46fdZVEbaa3kh6

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productRequest   string     

Product Request UUID Example: sunt

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 Z6VaeaPdf43E51hkDg8vb6c" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"description\": \"Example Description\",
    \"work_id\": \"b556770a-dabd-353c-ab4b-1d0352ab88c5\",
    \"work_location_id\": \"79b9348c-c47f-3b5c-8c1e-ad9c7cd996ad\",
    \"status_id\": \"b257dc86-69fa-3068-a75b-6bdb28da54f5\",
    \"priority\": \"Example Priority\",
    \"needed_at\": \"Example Needed at\",
    \"items\": [
        {
            \"product_id\": \"c02cdffb-8433-308e-bc42-bf0e60a45b85\",
            \"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 Z6VaeaPdf43E51hkDg8vb6c",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "description": "Example Description",
    "work_id": "b556770a-dabd-353c-ab4b-1d0352ab88c5",
    "work_location_id": "79b9348c-c47f-3b5c-8c1e-ad9c7cd996ad",
    "status_id": "b257dc86-69fa-3068-a75b-6bdb28da54f5",
    "priority": "Example Priority",
    "needed_at": "Example Needed at",
    "items": [
        {
            "product_id": "c02cdffb-8433-308e-bc42-bf0e60a45b85",
            "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 Z6VaeaPdf43E51hkDg8vb6c

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: b556770a-dabd-353c-ab4b-1d0352ab88c5

work_location_id   string  optional    

Local da obra. The uuid of an existing record in the work_locations table. Example: 79b9348c-c47f-3b5c-8c1e-ad9c7cd996ad

status_id   string  optional    

Status. The uuid of an existing record in the statuses table. Example: b257dc86-69fa-3068-a75b-6bdb28da54f5

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: c02cdffb-8433-308e-bc42-bf0e60a45b85

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/non" \
    --header "Authorization: Bearer 5d6cD1eEbhZk3Pfa4Vav6g8" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"description\": \"Example Description\",
    \"work_id\": \"1dfb5d93-7b26-3672-bea2-68d253b0dfb9\",
    \"work_location_id\": \"af55cf57-923c-3546-9079-00ee6236b4b2\",
    \"status_id\": \"83c090fb-3012-3690-9980-3447742b25f1\",
    \"priority\": \"Example Priority\",
    \"needed_at\": \"Example Needed at\",
    \"items\": [
        {
            \"id\": \"3ffd8cde-1dbf-32c7-bd7c-d13f07a46420\",
            \"product_id\": \"6f79a6c2-22a2-3a41-8c60-5885f2fbbeaf\",
            \"quantity\": 1,
            \"observation\": \"Example Items * observation\"
        },
        null
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-requests/non"
);

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

let body = {
    "name": "Example Name",
    "description": "Example Description",
    "work_id": "1dfb5d93-7b26-3672-bea2-68d253b0dfb9",
    "work_location_id": "af55cf57-923c-3546-9079-00ee6236b4b2",
    "status_id": "83c090fb-3012-3690-9980-3447742b25f1",
    "priority": "Example Priority",
    "needed_at": "Example Needed at",
    "items": [
        {
            "id": "3ffd8cde-1dbf-32c7-bd7c-d13f07a46420",
            "product_id": "6f79a6c2-22a2-3a41-8c60-5885f2fbbeaf",
            "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 5d6cD1eEbhZk3Pfa4Vav6g8

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productRequest   string     

Product Request UUID Example: non

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: 1dfb5d93-7b26-3672-bea2-68d253b0dfb9

work_location_id   string  optional    

Local da obra. The uuid of an existing record in the work_locations table. Example: af55cf57-923c-3546-9079-00ee6236b4b2

status_id   string  optional    

Status. The uuid of an existing record in the statuses table. Example: 83c090fb-3012-3690-9980-3447742b25f1

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: 3ffd8cde-1dbf-32c7-bd7c-d13f07a46420

product_id   string     

Produto. The uuid of an existing record in the products table. Example: 6f79a6c2-22a2-3a41-8c60-5885f2fbbeaf

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/nobis" \
    --header "Authorization: Bearer cv5fZVD6bhgEdk1a386P4ae" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-requests/nobis"
);

const headers = {
    "Authorization": "Bearer cv5fZVD6bhgEdk1a386P4ae",
    "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 cv5fZVD6bhgEdk1a386P4ae

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productRequest   string     

Product Request UUID Example: nobis

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/quibusdam/approve" \
    --header "Authorization: Bearer DgEh43vPd8Za61bf6aceVk5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-requests/quibusdam/approve"
);

const headers = {
    "Authorization": "Bearer DgEh43vPd8Za61bf6aceVk5",
    "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 DgEh43vPd8Za61bf6aceVk5

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productRequest   string     

Product Request UUID Example: quibusdam

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/exercitationem/reject" \
    --header "Authorization: Bearer Vc645v1fa86ahZDdkPbg3eE" \
    --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/exercitationem/reject"
);

const headers = {
    "Authorization": "Bearer Vc645v1fa86ahZDdkPbg3eE",
    "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 Vc645v1fa86ahZDdkPbg3eE

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productRequest   string     

Product Request UUID Example: exercitationem

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/commodi/items" \
    --header "Authorization: Bearer EP6gkh8ea3va1fVb54D6dZc" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"items\": [
        {
            \"product_id\": \"3c255be7-1288-37d1-ac0b-3208cb6714cc\",
            \"quantity\": 1,
            \"observation\": \"Example Items * observation\"
        },
        null
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-requests/commodi/items"
);

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

let body = {
    "items": [
        {
            "product_id": "3c255be7-1288-37d1-ac0b-3208cb6714cc",
            "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 EP6gkh8ea3va1fVb54D6dZc

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productRequest   string     

Product Request UUID Example: commodi

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: 3c255be7-1288-37d1-ac0b-3208cb6714cc

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/iure" \
    --header "Authorization: Bearer dVha6fZD5k1va468Ec3Pbeg" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"quantity\": 1,
    \"observation\": \"Example Observation\",
    \"status_id\": \"a1846df6-573c-3696-9300-ce63ce0930e1\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-requests/items/iure"
);

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

let body = {
    "quantity": 1,
    "observation": "Example Observation",
    "status_id": "a1846df6-573c-3696-9300-ce63ce0930e1"
};

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 dVha6fZD5k1va468Ec3Pbeg

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the item. Example: iure

item   string     

Product Request Item UUID Example: molestiae

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: a1846df6-573c-3696-9300-ce63ce0930e1

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/aut/items" \
    --header "Authorization: Bearer fDbPd836Z5Eaa1hgc46evkV" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"items\": [
        \"98be1787-bb60-3c61-9289-4b76da8e494a\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-requests/aut/items"
);

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

let body = {
    "items": [
        "98be1787-bb60-3c61-9289-4b76da8e494a"
    ]
};

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 fDbPd836Z5Eaa1hgc46evkV

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productRequest   string     

Product Request UUID Example: aut

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/sint/sync-items" \
    --header "Authorization: Bearer Paa6ghE4V315b8cevZDdf6k" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"items\": [
        {
            \"id\": \"ad7d602b-db6d-37ca-95fb-4523dbcf8048\",
            \"product_id\": \"28c463ba-324a-3b6b-a31b-f00c7ad037c2\",
            \"quantity\": 1,
            \"observation\": \"Example Items * observation\"
        },
        null
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-requests/sint/sync-items"
);

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

let body = {
    "items": [
        {
            "id": "ad7d602b-db6d-37ca-95fb-4523dbcf8048",
            "product_id": "28c463ba-324a-3b6b-a31b-f00c7ad037c2",
            "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 Paa6ghE4V315b8cevZDdf6k

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productRequest   string     

Product Request UUID Example: sint

Body Parameters

items   object[]     

Itens.

id   string  optional    

ID do Item. The uuid of an existing record in the product_request_items table. Example: ad7d602b-db6d-37ca-95fb-4523dbcf8048

product_id   string     

Produto. The uuid of an existing record in the products table. Example: 28c463ba-324a-3b6b-a31b-f00c7ad037c2

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 adfEaDZ6V54vgPek3c6bh81" \
    --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 adfEaDZ6V54vgPek3c6bh81",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": [
        {
            "id": "fd7c20b2-44c3-3f0e-abc9-be721781c156",
            "name": "Sr. Gabriel Leon",
            "code": "PRD-685127",
            "stock": 3236,
            "product_family": {
                "id": "a345c148-e992-4ac1-8f1f-ddab34f0fca7",
                "name": "Sr. Cristóvão Tamoio"
            },
            "product_brand": {
                "id": "a345c148-eaf2-40cb-a3dc-6d9814c5c25a",
                "name": "Sra. Maya Verdugo Paz"
            },
            "unit": {
                "id": "a345c148-ec34-48c3-9261-d92c8e6fbbae",
                "name": "Sr. Nelson Vieira Neto",
                "abbreviation": "Sr. Máximo Rios Franco Jr."
            },
            "image": {
                "id": null,
                "url": null
            },
            "epi_type": null,
            "description": "Voluptas dolorem ipsam aut.",
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "d258f989-a25d-3ecd-8dd2-c06f8c9c2505",
            "name": "Fátima Campos Lira Filho",
            "code": "PRD-466917",
            "stock": 2,
            "product_family": {
                "id": "a345c148-ee9c-4e9f-8ce0-5d7bb85c60ba",
                "name": "Horácio Lozano Filho"
            },
            "product_brand": {
                "id": "a345c148-eff4-49be-9730-82f19e40c89f",
                "name": "Dr. Gilberto Carvalho Neto"
            },
            "unit": {
                "id": "a345c148-f166-4cb7-a212-f69b95fe024a",
                "name": "Kamila Jimenes Carvalho Jr.",
                "abbreviation": "Rayane Sheila Santiago"
            },
            "image": {
                "id": null,
                "url": null
            },
            "epi_type": null,
            "description": "Repellendus sed natus iusto et delectus asperiores harum.",
            "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 adfEaDZ6V54vgPek3c6bh81

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 fDZ81a3c65g4Edbka6ePvhV" \
    --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 fDZ81a3c65g4Edbka6ePvhV",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": {
        "id": "8d1c21b6-a0b2-3f48-b7f0-5ea7e8ed9d60",
        "name": "Sr. Gustavo Carvalho",
        "code": "PRD-021905",
        "stock": 66,
        "product_family": {
            "id": "a345c148-f8d8-4940-ab72-1103266916e2",
            "name": "Maximiano Godói Burgos"
        },
        "product_brand": {
            "id": "a345c148-fa39-4c67-9ec2-74ce745efa23",
            "name": "Adriano Salgado"
        },
        "unit": {
            "id": "a345c148-fba6-4e51-92f1-b66f4ea96b92",
            "name": "Sr. Sandro Ramos da Cruz",
            "abbreviation": "Malena Thaís Esteves"
        },
        "image": {
            "id": null,
            "url": null
        },
        "epi_type": null,
        "description": "Sit error et sit dolorem consequatur placeat.",
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/products/{id}

Headers

Authorization        

Example: Bearer fDZ81a3c65g4Edbka6ePvhV

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: nam

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/tenetur/available-origins" \
    --header "Authorization: Bearer dEke5Vc863P1vhf6gaZaDb4" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/products/tenetur/available-origins"
);

const headers = {
    "Authorization": "Bearer dEke5Vc863P1vhf6gaZaDb4",
    "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 dEke5Vc863P1vhf6gaZaDb4

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

product   string     

Product UUID Example: tenetur

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 4V6h5eD6bkf8ZEagPavcd31" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"product_family_id\": \"d25ed4a5-1639-3ad7-8d31-4ee77df221fe\",
    \"product_brand_id\": \"76a16429-7dd0-397a-ba29-513efbbc857b\",
    \"unit_id\": \"58f9e596-06a6-3670-a975-99913289d2a8\",
    \"description\": \"Example Description\",
    \"stock\": 1
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/products"
);

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

let body = {
    "name": "Example Name",
    "product_family_id": "d25ed4a5-1639-3ad7-8d31-4ee77df221fe",
    "product_brand_id": "76a16429-7dd0-397a-ba29-513efbbc857b",
    "unit_id": "58f9e596-06a6-3670-a975-99913289d2a8",
    "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 4V6h5eD6bkf8ZEagPavcd31

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: d25ed4a5-1639-3ad7-8d31-4ee77df221fe

product_brand_id   string     

Marca do Produto. The uuid of an existing record in the product_brands table. Example: 76a16429-7dd0-397a-ba29-513efbbc857b

unit_id   string     

Unidade. The uuid of an existing record in the units table. Example: 58f9e596-06a6-3670-a975-99913289d2a8

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 k6gEVcfe4haDab6P53v8Z1d" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"product_family_id\": \"14ac7a61-c5aa-3c45-a779-d937c2685d01\",
    \"product_brand_id\": \"db29be2e-b829-32d1-a373-66d3222d3fca\",
    \"unit_id\": \"e09d1ebe-1340-3ef9-9563-21fd32026e3a\",
    \"stock\": 1,
    \"description\": \"Example Description\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/products/1"
);

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

let body = {
    "name": "Example Name",
    "product_family_id": "14ac7a61-c5aa-3c45-a779-d937c2685d01",
    "product_brand_id": "db29be2e-b829-32d1-a373-66d3222d3fca",
    "unit_id": "e09d1ebe-1340-3ef9-9563-21fd32026e3a",
    "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 k6gEVcfe4haDab6P53v8Z1d

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: 14ac7a61-c5aa-3c45-a779-d937c2685d01

product_brand_id   string  optional    

Marca do Produto. The uuid of an existing record in the product_brands table. Example: db29be2e-b829-32d1-a373-66d3222d3fca

unit_id   string  optional    

Unidade. The uuid of an existing record in the units table. Example: e09d1ebe-1340-3ef9-9563-21fd32026e3a

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/rerum" \
    --header "Authorization: Bearer cadP6Z8hEke53fbaDVvg416" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/products/rerum"
);

const headers = {
    "Authorization": "Bearer cadP6Z8hEke53fbaDVvg416",
    "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 cadP6Z8hEke53fbaDVvg416

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

product   string     

Product UUID Example: rerum

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/0f34aa13-e88e-34e9-b1bc-48604e9f1625/versions" \
    --header "Authorization: Bearer ZgPhEc8Vaavek64d3615fDb" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"notes\": \"Example Notes\",
    \"responsible_user_id\": \"5a2d4c01-ed3f-34ae-ae80-953a697a9d9d\",
    \"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/0f34aa13-e88e-34e9-b1bc-48604e9f1625/versions"
);

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

let body = {
    "notes": "Example Notes",
    "responsible_user_id": "5a2d4c01-ed3f-34ae-ae80-953a697a9d9d",
    "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 ZgPhEc8Vaavek64d3615fDb

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

projectUuid   string     

Project UUID Example: 0f34aa13-e88e-34e9-b1bc-48604e9f1625

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: 5a2d4c01-ed3f-34ae-ae80-953a697a9d9d

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/e0340dcc-59c1-3cee-8ce1-566145aeb581/versions" \
    --header "Authorization: Bearer cE46aZhkDPafed83g6Vv1b5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/projects/e0340dcc-59c1-3cee-8ce1-566145aeb581/versions"
);

const headers = {
    "Authorization": "Bearer cE46aZhkDPafed83g6Vv1b5",
    "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 cE46aZhkDPafed83g6Vv1b5

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

projectUuid   string     

Project UUID Example: e0340dcc-59c1-3cee-8ce1-566145aeb581

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/b2c13920-5552-335f-ac0c-7768fe890823" \
    --header "Authorization: Bearer f6V8ag1acEehD3k56bPdZv4" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/project-versions/b2c13920-5552-335f-ac0c-7768fe890823"
);

const headers = {
    "Authorization": "Bearer f6V8ag1acEehD3k56bPdZv4",
    "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 f6V8ag1acEehD3k56bPdZv4

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

versionUuid   string     

Revision UUID Example: b2c13920-5552-335f-ac0c-7768fe890823

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/fef403ee-f3ee-3349-9e37-15bae8691b90/download" \
    --header "Authorization: Bearer 3baZ68dfvP4h1cV5aDegkE6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/project-versions/fef403ee-f3ee-3349-9e37-15bae8691b90/download"
);

const headers = {
    "Authorization": "Bearer 3baZ68dfvP4h1cV5aDegkE6",
    "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 3baZ68dfvP4h1cV5aDegkE6

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

versionUuid   string     

Revision UUID Example: fef403ee-f3ee-3349-9e37-15bae8691b90

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/a87e1d24-80cf-3409-ad45-ecf3c0f2c7a4/restore" \
    --header "Authorization: Bearer ga5kvcV86hdeD4E16fZ3aPb" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/project-versions/a87e1d24-80cf-3409-ad45-ecf3c0f2c7a4/restore"
);

const headers = {
    "Authorization": "Bearer ga5kvcV86hdeD4E16fZ3aPb",
    "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 ga5kvcV86hdeD4E16fZ3aPb

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

versionUuid   string     

Revision UUID Example: a87e1d24-80cf-3409-ad45-ecf3c0f2c7a4

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/b801d9af-98d1-3876-8358-faf22548f103" \
    --header "Authorization: Bearer gEfh65ea4vcZ1kDV6P83bda" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/project-versions/b801d9af-98d1-3876-8358-faf22548f103"
);

const headers = {
    "Authorization": "Bearer gEfh65ea4vcZ1kDV6P83bda",
    "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 gEfh65ea4vcZ1kDV6P83bda

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

versionUuid   string     

Revision UUID Example: b801d9af-98d1-3876-8358-faf22548f103

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=71ae4aeb-286e-3f08-aeaf-e2103d5c49d4&work_id=beb0b5f4-9253-3761-8e19-92660d0904ed&status_id=e210af80-3563-38c5-bfc7-6d8da589bdf1&responsible_id=ecd38b4b-6aa3-3e61-a1e4-fef0e0ee2e45" \
    --header "Authorization: Bearer chbZ6dEDa5186g4vfk3VPae" \
    --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": "71ae4aeb-286e-3f08-aeaf-e2103d5c49d4",
    "work_id": "beb0b5f4-9253-3761-8e19-92660d0904ed",
    "status_id": "e210af80-3563-38c5-bfc7-6d8da589bdf1",
    "responsible_id": "ecd38b4b-6aa3-3e61-a1e4-fef0e0ee2e45",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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


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

Example response (200):


{
    "data": [
        {
            "id": "8a497e2f-85ef-390f-b319-9e182131ab1f",
            "name": "Dolorem veritatis dolorem",
            "description": "Molestias voluptas illum et ipsa dolores quasi reprehenderit.",
            "current_version": 1,
            "file": {
                "path": "projects/65c91832-acc8-338b-aaa9-595ba28da972.pdf",
                "size": "4755072",
                "extension": "pdf"
            },
            "discipline": {
                "id": "a345c14d-35e0-40bf-bddc-2ce3bc73882e",
                "name": "Et",
                "code": "TIM"
            },
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "b0a1ac3f-4fa9-361f-94f4-13ea0952e3cc",
            "name": "Omnis at quasi",
            "description": "In sed vitae saepe et eum illum exercitationem.",
            "current_version": 1,
            "file": {
                "path": "projects/23c30932-c27a-3da3-ad1b-ad33baf5e0a8.pdf",
                "size": "1255305",
                "extension": "pdf"
            },
            "discipline": {
                "id": "a345c14d-3b2f-4ab1-a1e0-f70d98ab9b4a",
                "name": "Blanditiis",
                "code": "MDU"
            },
            "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 chbZ6dEDa5186g4vfk3VPae

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: 71ae4aeb-286e-3f08-aeaf-e2103d5c49d4

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: beb0b5f4-9253-3761-8e19-92660d0904ed

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: e210af80-3563-38c5-bfc7-6d8da589bdf1

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: ecd38b4b-6aa3-3e61-a1e4-fef0e0ee2e45

Show project

requires authentication project show

Show a project

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

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


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

Example response (200):


{
    "data": {
        "id": "a7537b30-e989-3b9d-9cf8-ef2729a42614",
        "name": "Cum fuga ab",
        "description": "Quam tempore in sit rerum.",
        "current_version": 1,
        "file": {
            "path": "projects/b61673b8-4895-3038-b8b3-33a2ce5562c8.pdf",
            "size": "2800543",
            "extension": "pdf"
        },
        "discipline": {
            "id": "a345c14d-4a03-43cf-82d4-9a132903d288",
            "name": "Aut",
            "code": "DXL"
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/projects/{id}

Headers

Authorization        

Example: Bearer g6D3akacbf8hd1vZ65V4eEP

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the project. Example: 14

project   string     

Project UUID Example: cumque

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 51Z8aEg3b6haVPveDd6k4fc" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"description\": \"Example Description\",
    \"discipline_id\": \"0a735cce-6a58-3a33-9b0a-4b56f74eb1d1\",
    \"work_id\": \"8dc92ead-eb41-3804-bc5c-9908da93bca7\",
    \"responsible_user_id\": \"8d009795-f59f-38a5-a65a-2330a14388f0\",
    \"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 51Z8aEg3b6haVPveDd6k4fc",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "description": "Example Description",
    "discipline_id": "0a735cce-6a58-3a33-9b0a-4b56f74eb1d1",
    "work_id": "8dc92ead-eb41-3804-bc5c-9908da93bca7",
    "responsible_user_id": "8d009795-f59f-38a5-a65a-2330a14388f0",
    "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 51Z8aEg3b6haVPveDd6k4fc

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: 0a735cce-6a58-3a33-9b0a-4b56f74eb1d1

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: 8dc92ead-eb41-3804-bc5c-9908da93bca7

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: 8d009795-f59f-38a5-a65a-2330a14388f0

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/2" \
    --header "Authorization: Bearer cZ513VgPf4k6hb86eEDvaad" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"description\": \"Example Description\",
    \"discipline_id\": \"1615c458-c5ca-37b5-8e67-3ad5219e9a3f\",
    \"work_id\": \"8e7e9b5e-c79e-335a-946a-5f5ee45c5984\",
    \"responsible_user_id\": \"4c3e89a2-56d9-39c5-af1f-c26ef0497689\",
    \"status_id\": \"a53f1b99-0446-3181-9f73-1d2dc79fbc41\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/projects/2"
);

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

let body = {
    "name": "Example Name",
    "description": "Example Description",
    "discipline_id": "1615c458-c5ca-37b5-8e67-3ad5219e9a3f",
    "work_id": "8e7e9b5e-c79e-335a-946a-5f5ee45c5984",
    "responsible_user_id": "4c3e89a2-56d9-39c5-af1f-c26ef0497689",
    "status_id": "a53f1b99-0446-3181-9f73-1d2dc79fbc41"
};

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 cZ513VgPf4k6hb86eEDvaad

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the project. Example: 2

project   string     

Project UUID Example: magni

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: 1615c458-c5ca-37b5-8e67-3ad5219e9a3f

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: 8e7e9b5e-c79e-335a-946a-5f5ee45c5984

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: 4c3e89a2-56d9-39c5-af1f-c26ef0497689

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: a53f1b99-0446-3181-9f73-1d2dc79fbc41

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/et" \
    --header "Authorization: Bearer h4681fdk63bgaaePZDvEcV5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/projects/et"
);

const headers = {
    "Authorization": "Bearer h4681fdk63bgaaePZDvEcV5",
    "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 h4681fdk63bgaaePZDvEcV5

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

project   string     

Project UUID Example: et

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 65ge8kaEZa1vD3P6cbd4hfV" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"daily_log\": \"modi\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/reports/daily-log"
);

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

let body = {
    "daily_log": "modi"
};

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 65ge8kaEZa1vD3P6cbd4hfV

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: modi

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 EakVbhcagd4ZP68De13vf65" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"employee\": \"dolorum\",
    \"kit_uuid\": \"227b29df-9390-3c16-abd5-7042c01d0663\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/reports/epi-term"
);

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

let body = {
    "employee": "dolorum",
    "kit_uuid": "227b29df-9390-3c16-abd5-7042c01d0663"
};

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 EakVbhcagd4ZP68De13vf65

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

employee   string     

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

kit_uuid   string     

O campo value deve ser um UUID válido. Example: 227b29df-9390-3c16-abd5-7042c01d0663

Generate payroll sheets PDF

requires authentication No specific permission required

Gera o PDF das folhas cuja data de pagamento cai no período, com os itens por pessoa e obra e os subtotais por obra e por forma de pagamento. Folha ainda em rascunho sai marcada como não conferida. A geração é assíncrona: o front é avisado por Pusher quando fica pronto.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/reports/payroll-sheet" \
    --header "Authorization: Bearer 53Z8hEa6cPVafde4D6kg1bv" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"start\": \"2026-11-20\",
    \"end\": \"2034-04-08\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/reports/payroll-sheet"
);

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

let body = {
    "start": "2026-11-20",
    "end": "2034-04-08"
};

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

Example response (202):


{
    "message": "PDF da folha sendo gerado. Você será notificado quando estiver pronto.",
    "channel": "reports.uuid",
    "event": "pdf-report.completed"
}
 

Request      

GET api/reports/payroll-sheet

Headers

Authorization        

Example: Bearer 53Z8hEa6cPVafde4D6kg1bv

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

start   string     

Must be a valid date in the format Y-m-d. Example: 2026-11-20

end   string     

Must be a valid date in the format Y-m-d. O campo value deve ser uma data posterior ou igual a start. Example: 2034-04-08

Generate day payments Excel

requires authentication payroll pay

Gera a planilha de "Pagamentos do dia": uma linha por item, com favorecido, documento, chave PIX, obra, centro de custo, folha, forma, valor (diária mais acréscimos) e situação. Sem date, usa o dia de hoje. A geração é assíncrona: o front é avisado por Pusher quando fica pronta.

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/reports/payroll-day/excel" \
    --header "Authorization: Bearer VegEbadkh6Za5cPfD381v46" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"date\": \"2026-11-20\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/reports/payroll-day/excel"
);

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

let body = {
    "date": "2026-11-20"
};

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

Example response (202):


{
    "message": "Planilha sendo gerada. Você será notificado quando estiver pronta.",
    "channel": "reports.uuid",
    "event": "excel-report.completed"
}
 

Request      

GET api/reports/payroll-day/excel

Headers

Authorization        

Example: Bearer VegEbadkh6Za5cPfD381v46

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

date   string     

Must be a valid date in the format Y-m-d. Example: 2026-11-20

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 e6Edka1P46vg5hbaDfZcV83" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"employee\": \"eos\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/reports/employee-sheet"
);

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

let body = {
    "employee": "eos"
};

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 e6Edka1P46vg5hbaDfZcV83

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

employee   string     

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

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[]=0606e7ee-657f-3bdd-b3d9-737e537c1f12&cost_centers[]=5b1bdcbf-c67e-37a5-806b-1102b94c635c&format=xlsx" \
    --header "Authorization: Bearer gd1e6a4VZ68bEDva3c5fkhP" \
    --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]": "0606e7ee-657f-3bdd-b3d9-737e537c1f12",
    "cost_centers[0]": "5b1bdcbf-c67e-37a5-806b-1102b94c635c",
    "format": "xlsx",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer gd1e6a4VZ68bEDva3c5fkhP",
    "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 gd1e6a4VZ68bEDva3c5fkhP

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=non&sort_by=date&sort_desc=1&per_page=14" \
    --header "Authorization: Bearer 6D8efv6Vgka1ZbdPEach435" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"date_start\": \"2026-11-20\",
    \"date_end\": \"2094-01-12\",
    \"block\": \"disbursement\",
    \"cost_center_id\": \"d70c66a3-e1b6-3835-a6b8-3763ccea8236\",
    \"without_cost_center\": true,
    \"type\": \"other\",
    \"per_page\": 6,
    \"search\": \"dbomyjoyqikntplchq\",
    \"sort_by\": \"date\",
    \"sort_desc\": true
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/reports/cost-center/entries"
);

const params = {
    "search": "non",
    "sort_by": "date",
    "sort_desc": "1",
    "per_page": "14",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

let body = {
    "date_start": "2026-11-20",
    "date_end": "2094-01-12",
    "block": "disbursement",
    "cost_center_id": "d70c66a3-e1b6-3835-a6b8-3763ccea8236",
    "without_cost_center": true,
    "type": "other",
    "per_page": 6,
    "search": "dbomyjoyqikntplchq",
    "sort_by": "date",
    "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 6D8efv6Vgka1ZbdPEach435

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: non

sort_by   string  optional    

date ou amount. Padrão: date. Example: date

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: 14

Body Parameters

date_start   string     

Must be a valid date in the format Y-m-d. Example: 2026-11-20

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: 2094-01-12

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: d70c66a3-e1b6-3835-a6b8-3763ccea8236

without_cost_center   boolean  optional    

This field is required when cost_center_id is not present. Example: true

type   string  optional    

Example: other

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: 6

search   string  optional    

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

sort_by   string  optional    

Example: date

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[]=cc87eb37-701a-3990-96e7-82e0dbba48d5&cost_centers[]=b8e0390e-1326-31cc-b446-9bb387e34b3b&format=xlsx" \
    --header "Authorization: Bearer c4hevPV5aZk361gE6bdfD8a" \
    --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]": "cc87eb37-701a-3990-96e7-82e0dbba48d5",
    "cost_centers[0]": "b8e0390e-1326-31cc-b446-9bb387e34b3b",
    "format": "xlsx",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer c4hevPV5aZk361gE6bdfD8a",
    "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 c4hevPV5aZk361gE6bdfD8a

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=dolores&type=entrada&description=Debitis+repellendus+facere+rerum+libero.&categories[]=566ca360-05d0-3aa0-896d-f09b74b9c1f9&exclude_categories[]=c2aeb91c-f147-3e70-89ad-2df0941f7ed6&date_start=2026-01-01&date_end=2026-12-31&bank_accounts[]=24951bb2-9454-31a4-b8fa-5f56f6860b87&customers[]=76138917-9742-3fd9-83bb-1ae17ff805d4&suppliers[]=abbb4bad-4c83-3941-8c5c-be0e2d7bfa2c&cash_session=e0f176cf-ed1c-3363-a111-86728cc6e789&works[]=64119067-d211-3c68-9332-f3b67ec8d94b" \
    --header "Authorization: Bearer Zc6kV3g5DahE86dbePva41f" \
    --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": "dolores",
    "type": "entrada",
    "description": "Debitis repellendus facere rerum libero.",
    "categories[0]": "566ca360-05d0-3aa0-896d-f09b74b9c1f9",
    "exclude_categories[0]": "c2aeb91c-f147-3e70-89ad-2df0941f7ed6",
    "date_start": "2026-01-01",
    "date_end": "2026-12-31",
    "bank_accounts[0]": "24951bb2-9454-31a4-b8fa-5f56f6860b87",
    "customers[0]": "76138917-9742-3fd9-83bb-1ae17ff805d4",
    "suppliers[0]": "abbb4bad-4c83-3941-8c5c-be0e2d7bfa2c",
    "cash_session": "e0f176cf-ed1c-3363-a111-86728cc6e789",
    "works[0]": "64119067-d211-3c68-9332-f3b67ec8d94b",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer Zc6kV3g5DahE86dbePva41f",
    "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 Zc6kV3g5DahE86dbePva41f

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

q   string  optional    

Example: dolores

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: Debitis repellendus facere rerum libero.

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: e0f176cf-ed1c-3363-a111-86728cc6e789

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=et&type=entrada&description=Libero+quo+qui+enim+non+sint+dolores+eius.&categories[]=39f08311-4139-3f48-8c65-1bf0df56f9f1&exclude_categories[]=522a109a-fcaf-3ae8-92b7-7ca79df131aa&date_start=2026-01-01&date_end=2026-12-31&bank_accounts[]=e066d422-f891-3294-b882-cd7a74a3867c&customers[]=d04ead29-a92b-3b67-8814-bdad65f87048&suppliers[]=7e563616-3f90-3da2-b6a1-5ad6e93d1a63&cash_session=c81103b5-f05d-3a6a-9786-3664260c6492&works[]=064f690b-2b0f-3e9a-997c-371ca56039ae" \
    --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": "et",
    "type": "entrada",
    "description": "Libero quo qui enim non sint dolores eius.",
    "categories[0]": "39f08311-4139-3f48-8c65-1bf0df56f9f1",
    "exclude_categories[0]": "522a109a-fcaf-3ae8-92b7-7ca79df131aa",
    "date_start": "2026-01-01",
    "date_end": "2026-12-31",
    "bank_accounts[0]": "e066d422-f891-3294-b882-cd7a74a3867c",
    "customers[0]": "d04ead29-a92b-3b67-8814-bdad65f87048",
    "suppliers[0]": "7e563616-3f90-3da2-b6a1-5ad6e93d1a63",
    "cash_session": "c81103b5-f05d-3a6a-9786-3664260c6492",
    "works[0]": "064f690b-2b0f-3e9a-997c-371ca56039ae",
};
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: et

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: Libero quo qui enim non sint dolores eius.

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: c81103b5-f05d-3a6a-9786-3664260c6492

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 ZVafh1dva46EbP5Dcek63g8" \
    --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 ZVafh1dva46EbP5Dcek63g8",
    "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 ZVafh1dva46EbP5Dcek63g8

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 4fceVhDEavak6gPb6Z815d3" \
    --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 4fceVhDEavak6gPb6Z815d3",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": [
        {
            "id": "03e5b11a-bd35-3959-9b83-dd116b28f5b5",
            "name": "autem voluptatem",
            "slug": null,
            "description": "Beatae magni quia iure quos porro omnis. Quisquam iusto quam consequatur deserunt. Aut est excepturi sed dolores placeat temporibus rerum.",
            "abbreviation": null,
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "a9e3e7ab-ff6e-3b6e-af05-3d4903722ae2",
            "name": "ut et",
            "slug": null,
            "description": "Enim illum numquam ex velit ut maxime. Voluptatem est occaecati quas sed corporis. Maxime commodi ut laudantium eius blanditiis aut.",
            "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 4fceVhDEavak6gPb6Z815d3

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 e6a3hVZg5d1bPacfD68vE4k" \
    --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 e6a3hVZg5d1bPacfD68vE4k",
    "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 e6a3hVZg5d1bPacfD68vE4k

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/7" \
    --header "Authorization: Bearer hb64kfPEDv3daeV86g5ac1Z" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/sectors/7"
);

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


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

Example response (200):


{
    "data": {
        "id": "b654b406-e7b8-3ef8-8d1a-faf39c094cee",
        "name": "occaecati vitae",
        "slug": null,
        "description": "Alias ea rem culpa accusamus vel voluptas accusantium ipsum. Veniam doloremque corrupti aut neque ipsa voluptas cupiditate. Qui ipsum voluptatum non ut vel esse. Sit ea accusantium nisi quaerat.",
        "abbreviation": null,
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/sectors/{id}

Headers

Authorization        

Example: Bearer hb64kfPEDv3daeV86g5ac1Z

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the sector. Example: 7

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/12" \
    --header "Authorization: Bearer vV136kf68ag4hZcEDPd5abe" \
    --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/12"
);

const headers = {
    "Authorization": "Bearer vV136kf68ag4hZcEDPd5abe",
    "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 vV136kf68ag4hZcEDPd5abe

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the sector. Example: 12

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/4" \
    --header "Authorization: Bearer 6hE6aPZve4cg8bdD1aV35fk" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/sectors/4"
);

const headers = {
    "Authorization": "Bearer 6hE6aPZve4cg8bdD1aV35fk",
    "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 6hE6aPZve4cg8bdD1aV35fk

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the sector. Example: 4

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 Z5fhcba16vgVDdEka843e6P" \
    --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 Z5fhcba16vgVDdEka843e6P",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": [
        {
            "id": "96c1b16b-2297-3d28-b52f-bdecf17946c7",
            "name": "Michaela Daugherty",
            "username": "hill.kennedy",
            "email": "kovacek.deon@example.net",
            "certification": null,
            "crea": null,
            "last_login_at": null,
            "image": {
                "id": null,
                "url": null
            },
            "sectors": [],
            "roles": []
        },
        {
            "id": "85573ba0-1345-33dd-a811-dd777391a429",
            "name": "Mrs. Rachael Dietrich",
            "username": "ritchie.verlie",
            "email": "cole.fannie@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 Z5fhcba16vgVDdEka843e6P

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 ka6bZEd8gP4a6Vhv5cDf3e1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"users\": [
        \"4154fb0d-e753-3afe-9e00-7156c34e751f\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/sectors/019556e7-2e9f-777c-a177-30bbf0646c32/users/attach"
);

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

let body = {
    "users": [
        "4154fb0d-e753-3afe-9e00-7156c34e751f"
    ]
};

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 ka6bZEd8gP4a6Vhv5cDf3e1

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 a4vbc1ea835fV6gd6kPEZDh" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"users\": [
        \"73f667eb-d1a5-31ec-b243-637247f8ae7f\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/sectors/019556e7-2e9f-777c-a177-30bbf0646c32/users/detach"
);

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

let body = {
    "users": [
        "73f667eb-d1a5-31ec-b243-637247f8ae7f"
    ]
};

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 a4vbc1ea835fV6gd6kPEZDh

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 65g4da1Pa6EkfchbvV8DZ3e" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"users\": [
        \"57fbe1f2-bcef-337b-8078-b622c7301326\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/sectors/019556e7-2e9f-777c-a177-30bbf0646c32/users/sync"
);

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

let body = {
    "users": [
        "57fbe1f2-bcef-337b-8078-b622c7301326"
    ]
};

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 65g4da1Pa6EkfchbvV8DZ3e

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 vcg381a5f4ehkP6ZDV6bdEa" \
    --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 vcg381a5f4ehkP6ZDV6bdEa",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": [
        {
            "name": "aspernatur eos",
            "slug": "dolorem-et-nam-quos-dolores-a-vitae"
        },
        {
            "name": "quia laudantium",
            "slug": "vel-itaque-distinctio-nemo-ut-et-nisi-deserunt-maxime"
        }
    ]
}
 

Request      

GET api/status-modules

Headers

Authorization        

Example: Bearer vcg381a5f4ehkP6ZDV6bdEa

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 68kgcE3PdabZ56VvafhDe14" \
    --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 68kgcE3PdabZ56VvafhDe14",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": [
        {
            "id": "14b5e79c-9baf-3d45-b227-c368018a91ab",
            "slug": null,
            "name": null,
            "description": "Natan Cervantes Maia",
            "abbreviation": "possimus",
            "color": "#2177ec",
            "text_color": "#dabc47",
            "module": {
                "name": "Solicitação de Produtos",
                "slug": "product_request"
            },
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "9610207d-c078-3b74-97ac-17c5b2d35fa4",
            "slug": null,
            "name": null,
            "description": "Ana Cynthia Padrão",
            "abbreviation": "ut",
            "color": "#8e457f",
            "text_color": "#8a45eb",
            "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 68kgcE3PdabZ56VvafhDe14

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 345cVgvPb1keZdaEaDf668h" \
    --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\": \"3c2d343e-d09a-3c5e-b10e-988e78d537d6\",
    \"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 345cVgvPb1keZdaEaDf668h",
    "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": "3c2d343e-d09a-3c5e-b10e-988e78d537d6",
    "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 345cVgvPb1keZdaEaDf668h

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: 3c2d343e-d09a-3c5e-b10e-988e78d537d6

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 aP8dcDZf66hg5eE4kb3V1va" \
    --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 aP8dcDZf66hg5eE4kb3V1va",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": {
        "id": "d5200c19-fffc-3580-8c4c-4fb1aa190c09",
        "slug": null,
        "name": null,
        "description": "Cristiano Leo Tamoio Sobrinho",
        "abbreviation": "earum",
        "color": "#937759",
        "text_color": "#185957",
        "module": {
            "name": "Obras",
            "slug": "work"
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/statuses/{id}

Headers

Authorization        

Example: Bearer aP8dcDZf66hg5eE4kb3V1va

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 Ef8Zv31gbaa6e5VcDP6kd4h" \
    --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\": \"3491d6a5-8a03-359e-bfe8-737e661bcac9\",
    \"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 Ef8Zv31gbaa6e5VcDP6kd4h",
    "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": "3491d6a5-8a03-359e-bfe8-737e661bcac9",
    "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 Ef8Zv31gbaa6e5VcDP6kd4h

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: 3491d6a5-8a03-359e-bfe8-737e661bcac9

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 PDa6d5h1f4kcE63avb8ZVeg" \
    --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 PDa6d5h1f4kcE63avb8ZVeg",
    "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 PDa6d5h1f4kcE63avb8ZVeg

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 6hbVgf1da8E5P46aZDv3ekc" \
    --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 6hbVgf1da8E5P46aZDv3ekc",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": [
        {
            "id": "40c11f4b-7031-3e5a-a1c7-26ef9d591afa",
            "quantity": 496.1538,
            "min_quantity": null,
            "max_quantity": null,
            "below_minimum": false,
            "above_maximum": false,
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "65622c35-7db8-3d97-8a5e-b77fa159ae44",
            "quantity": 173.9023,
            "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 6hbVgf1da8E5P46aZDv3ekc

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 PeVc86hEgab135a6fDk4vZd" \
    --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 PeVc86hEgab135a6fDk4vZd",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": [
        {
            "id": "dfaadc4c-ebc3-3656-84f4-dac664541c4e",
            "name": "Estoque Maldonado e Mendonça e Associados",
            "module": "work",
            "is_active": true,
            "is_main": false,
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "f4a973a4-6b8c-3443-a32b-32f795b24f41",
            "name": "Estoque Delvalle-Meireles",
            "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 PeVc86hEgab135a6fDk4vZd

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 hdafPb5veEZ6g3V84c1Dak6" \
    --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 hdafPb5veEZ6g3V84c1Dak6",
    "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": "0abd18fe-ca74-35ef-9bc6-2a70ef20ff61",
        "name": "Estoque Meireles-Rangel",
        "module": "work",
        "is_active": true,
        "is_main": false,
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

POST api/stocks

Headers

Authorization        

Example: Bearer hdafPb5veEZ6g3V84c1Dak6

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 h6e8a3k5EDZdc6g4aVv1bPf" \
    --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 h6e8a3k5EDZdc6g4aVv1bPf",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": {
        "id": "f0491f30-e537-3833-9e3c-3d330e43249b",
        "name": "Estoque Medina e Associados",
        "module": "work",
        "is_active": true,
        "is_main": false,
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/stocks/main

Headers

Authorization        

Example: Bearer h6e8a3k5EDZdc6g4aVv1bPf

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 d345kgaD6eVf8vPEZa61bhc" \
    --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 d345kgaD6eVf8vPEZa61bhc",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": {
        "id": "904d3e59-f50a-353a-baed-e6cd5dd303c1",
        "name": "Estoque Soto 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 d345kgaD6eVf8vPEZa61bhc

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 v6gdcZ8e36aa4PDkhf1bE5V" \
    --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 v6gdcZ8e36aa4PDkhf1bE5V",
    "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": "09ee1080-aa0a-3378-bc9f-4098760b64d0",
        "name": "Estoque Carrara e Colaço",
        "module": "work",
        "is_active": true,
        "is_main": false,
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

PUT api/stocks/{id}

Headers

Authorization        

Example: Bearer v6gdcZ8e36aa4PDkhf1bE5V

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 4abf3kec6vDdVa8EgZP561h" \
    --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 4abf3kec6vDdVa8EgZP561h",
    "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 4abf3kec6vDdVa8EgZP561h

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 8Z36c1ebDv5afdhV46gaPkE" \
    --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 8Z36c1ebDv5afdhV46gaPkE",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": [
        {
            "id": "f003322f-f5d7-3cb6-afee-aaee0814cb1f",
            "quantity": 302.4355,
            "min_quantity": null,
            "max_quantity": null,
            "below_minimum": false,
            "above_maximum": false,
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "6a404291-ae90-3f88-a2a1-a1b14279e522",
            "quantity": 126.3623,
            "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 8Z36c1ebDv5afdhV46gaPkE

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/excepturi" \
    --header "Authorization: Bearer hVd8cbe6vg5a61kZPD3aE4f" \
    --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/excepturi"
);

const headers = {
    "Authorization": "Bearer hVd8cbe6vg5a61kZPD3aE4f",
    "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": "10847027-443a-3aa6-b7a6-1983ac5f6fb4",
        "quantity": 261.512,
        "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 hVd8cbe6vg5a61kZPD3aE4f

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: excepturi

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 f5V3vgDP6hkaaZ1b4de8cE6" \
    --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 f5V3vgDP6hkaaZ1b4de8cE6",
    "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 f5V3vgDP6hkaaZ1b4de8cE6

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 P1eha6vkc6Df3bEV548Zadg" \
    --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 P1eha6vkc6Df3bEV548Zadg",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": [
        {
            "id": "9dda0753-9981-394d-8363-77a6c17edd6e",
            "code": "MOV-509853",
            "type": "saída transferência",
            "type_name": "TRANSFER_OUT",
            "is_entry": false,
            "is_exit": true,
            "quantity": 4.9254,
            "previous_quantity": 7.4816,
            "new_quantity": 2.5562,
            "reason": "Voluptatem iure modi eveniet quibusdam magnam vel officiis unde.",
            "movement_date": "2026-11-10T22:54:35.000000Z",
            "created_at": null
        },
        {
            "id": "9b334afc-3f7e-3a97-be73-e88593ae0478",
            "code": "MOV-376054",
            "type": "vencido",
            "type_name": "EXPIRED",
            "is_entry": false,
            "is_exit": true,
            "quantity": 79.9761,
            "previous_quantity": 346.2277,
            "new_quantity": 266.2516,
            "reason": null,
            "movement_date": "2026-11-11T07:20:22.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 P1eha6vkc6Df3bEV548Zadg

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 Pbg5h36Zced6D1aV4Evk8fa" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"product_id\": \"21cbc07c-0074-3d53-bece-3dcffa4efefd\",
    \"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 Pbg5h36Zced6D1aV4Evk8fa",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "product_id": "21cbc07c-0074-3d53-bece-3dcffa4efefd",
    "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": "6a3b008d-f7e0-32cf-8d4e-6a8267240bc8",
        "code": "MOV-125190",
        "type": "vencido",
        "type_name": "EXPIRED",
        "is_entry": false,
        "is_exit": true,
        "quantity": 17.6861,
        "previous_quantity": 416.0152,
        "new_quantity": 398.3291,
        "reason": null,
        "movement_date": "2026-11-02T17:04:19.000000Z",
        "created_at": null
    }
}
 

Request      

POST api/stocks/{stock_id}/movements

Headers

Authorization        

Example: Bearer Pbg5h36Zced6D1aV4Evk8fa

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: 21cbc07c-0074-3d53-bece-3dcffa4efefd

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 a4cehfD85v63ZbEPgV16adk" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"product_id\": \"dd666593-1bf3-3314-9850-552e09a0733f\",
    \"destination_stock_id\": \"891ad494-11ee-3571-85c0-a5aa542f9aaa\",
    \"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 a4cehfD85v63ZbEPgV16adk",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "product_id": "dd666593-1bf3-3314-9850-552e09a0733f",
    "destination_stock_id": "891ad494-11ee-3571-85c0-a5aa542f9aaa",
    "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": "c62402e0-5f4c-3637-a6b1-c45d86df5b7d",
        "code": "MOV-166299",
        "type": "perda",
        "type_name": "LOSS",
        "is_entry": false,
        "is_exit": true,
        "quantity": 38.5916,
        "previous_quantity": 241.3567,
        "new_quantity": 202.7651,
        "reason": "Laudantium placeat explicabo facere non.",
        "movement_date": "2026-10-24T20:37:22.000000Z",
        "created_at": null
    }
}
 

Request      

POST api/stocks/{stock}/movements/transfer

Headers

Authorization        

Example: Bearer a4cehfD85v63ZbEPgV16adk

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: dd666593-1bf3-3314-9850-552e09a0733f

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: 891ad494-11ee-3571-85c0-a5aa542f9aaa

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 ZDfvPa168edbkch4Vg6a53E" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"product_id\": \"7f2beb16-1364-3802-9909-94d480dfde0d\",
    \"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 ZDfvPa168edbkch4Vg6a53E",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "product_id": "7f2beb16-1364-3802-9909-94d480dfde0d",
    "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": "f035b972-87a2-38b7-b78d-9dd748189464",
        "code": "MOV-729938",
        "type": "perda",
        "type_name": "LOSS",
        "is_entry": false,
        "is_exit": true,
        "quantity": 77.6015,
        "previous_quantity": 492.715,
        "new_quantity": 415.1135,
        "reason": null,
        "movement_date": "2026-11-09T07:56:22.000000Z",
        "created_at": null
    }
}
 

Request      

POST api/stocks/{stock}/movements/inventory

Headers

Authorization        

Example: Bearer ZDfvPa168edbkch4Vg6a53E

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: 7f2beb16-1364-3802-9909-94d480dfde0d

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 beZDdv5gaVakPfc16643E8h" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"product_id\": \"d47de58b-3eef-39a9-8843-1f50bb0ba235\",
    \"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 beZDdv5gaVakPfc16643E8h",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "product_id": "d47de58b-3eef-39a9-8843-1f50bb0ba235",
    "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": "8bc4e612-49a6-30a8-945b-ceae522e58ee",
        "code": "MOV-082175",
        "type": "venda",
        "type_name": "SALE",
        "is_entry": false,
        "is_exit": true,
        "quantity": 84.9341,
        "previous_quantity": 330.8441,
        "new_quantity": 245.91,
        "reason": "Qui aliquid laudantium voluptatum recusandae praesentium.",
        "movement_date": "2026-11-14T22:55:42.000000Z",
        "created_at": null
    }
}
 

Request      

POST api/stock-movements/purchase

Headers

Authorization        

Example: Bearer beZDdv5gaVakPfc16643E8h

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: d47de58b-3eef-39a9-8843-1f50bb0ba235

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 ved5E8fahZ1Dcka6P34bgV6" \
    --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 ved5E8fahZ1Dcka6P34bgV6",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": {
        "id": "6ecd9551-28c8-3f3c-9647-2e80a014bd0f",
        "code": "MOV-665144",
        "type": "entrada transferência",
        "type_name": "TRANSFER_IN",
        "is_entry": true,
        "is_exit": false,
        "quantity": 85.3573,
        "previous_quantity": 24.7996,
        "new_quantity": 110.1569,
        "reason": "Sint ut quod autem est cumque velit consectetur.",
        "movement_date": "2026-10-28T10:58:16.000000Z",
        "created_at": null
    }
}
 

Request      

GET api/stock-movements/{movement}

Headers

Authorization        

Example: Bearer ved5E8fahZ1Dcka6P34bgV6

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 Vghe4Paf6da6kcD35Z1b8vE" \
    --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 Vghe4Paf6da6kcD35Z1b8vE",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": [
        {
            "id": "1798bee2-e4b5-3af1-aba9-4aacd4fd9e4d",
            "name": "Dr. Sarah Pacheco Galhardo",
            "email": "simon70@example.org",
            "phone": "(74) 90642-6293",
            "document": "50.051.430/0001-00",
            "type": "pf",
            "responsible": "Cristóvão Faria Carvalho",
            "image": {
                "id": null,
                "url": null
            },
            "address": {
                "street": null,
                "number": null,
                "complement": null,
                "neighborhood": null,
                "city": null,
                "state": null,
                "zip_code": null
            }
        },
        {
            "id": "d7386e73-9470-3200-85b7-3fc06d57802b",
            "name": "Sra. Patrícia Noa Rocha Jr.",
            "email": "campos.rebeca@example.net",
            "phone": "(67) 95582-6954",
            "document": "89.125.746/0001-35",
            "type": "pj",
            "responsible": "Suellen Verdara",
            "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 Vghe4Paf6da6kcD35Z1b8vE

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 bVD166cEZPdh43e5vkaf8ga" \
    --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 bVD166cEZPdh43e5vkaf8ga",
    "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 bVD166cEZPdh43e5vkaf8ga

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 vhdae8f66g1VaEZP45Dkc3b" \
    --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 vhdae8f66g1VaEZP45Dkc3b",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": {
        "id": "fa4978a0-35e4-3fc1-aa40-5897ca74accf",
        "name": "Dr. Maurício Ramires Matias",
        "email": "branco.daniele@example.com",
        "phone": "(13) 2094-6237",
        "document": "58.584.421/0001-97",
        "type": "pf",
        "responsible": "Sr. Tomás Toledo",
        "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 vhdae8f66g1VaEZP45Dkc3b

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 aPd6DhaVfbe14k68gE3vcZ5" \
    --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 aPd6DhaVfbe14k68gE3vcZ5",
    "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 aPd6DhaVfbe14k68gE3vcZ5

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 PheE8kaV46vgbZ5fDd1a36c" \
    --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 PheE8kaV46vgbZ5fDd1a36c",
    "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 PheE8kaV46vgbZ5fDd1a36c

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

supplier   string     

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

List supplier bank accounts

requires authentication suppliers show

Contas e chaves PIX do fornecedor, com a favorita primeiro.

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

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


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

Example response (200):


{
    "data": [
        {
            "id": "a345c14f-f77a-4573-8776-94f164b3d722",
            "bank": null,
            "agency": null,
            "account": null,
            "account_type": null,
            "pix_key": "mary78@zboncak.com",
            "favorite": false
        },
        {
            "id": "a345c14f-fa3f-4474-bf0c-5d7b96def401",
            "bank": null,
            "agency": null,
            "account": null,
            "account_type": null,
            "pix_key": "brianne.rice@hotmail.com",
            "favorite": false
        }
    ]
}
 

Request      

GET api/suppliers/{supplier_id}/bank-account

Headers

Authorization        

Example: Bearer 8a5E6PZf436h1edDgkvcabV

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

supplier_id   integer     

The ID of the supplier. Example: 1

supplier   string     

UUID do fornecedor. Example: et

Add supplier bank account

requires authentication suppliers update

Agência e conta são opcionais: o prestador costuma ter só a chave PIX. Marcar como favorita desmarca as outras.

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/suppliers/1/bank-account" \
    --header "Authorization: Bearer 8cZ1beVE5ka66vf3PahdD4g" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"bank_id\": \"732ef946-57db-323a-b02f-fb994250ac49\",
    \"agency\": \"xaalgafyyqtgo\",
    \"account\": \"htmq\",
    \"account_type\": \"wevkcaijsra\",
    \"pix_key\": \"thywbykgvayztrfporibg\",
    \"favorite\": false
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/suppliers/1/bank-account"
);

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

let body = {
    "bank_id": "732ef946-57db-323a-b02f-fb994250ac49",
    "agency": "xaalgafyyqtgo",
    "account": "htmq",
    "account_type": "wevkcaijsra",
    "pix_key": "thywbykgvayztrfporibg",
    "favorite": false
};

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

Example response (201):


{
    "data": {
        "id": "a345c150-0144-4975-9388-fc6e909b6c7f",
        "bank": null,
        "agency": null,
        "account": null,
        "account_type": null,
        "pix_key": "branson55@yahoo.com",
        "favorite": false
    }
}
 

Request      

POST api/suppliers/{supplier_id}/bank-account

Headers

Authorization        

Example: Bearer 8cZ1beVE5ka66vf3PahdD4g

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

supplier_id   integer     

The ID of the supplier. Example: 1

supplier   string     

UUID do fornecedor. Example: laudantium

Body Parameters

bank_id   string  optional    

O campo value deve ser um UUID válido. The uuid of an existing record in the banks table. Example: 732ef946-57db-323a-b02f-fb994250ac49

agency   string  optional    

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

account   string  optional    

This field is required when pix_key is not present. O campo value não pode ser superior a 255 caracteres. Example: htmq

account_type   string  optional    

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

pix_key   string  optional    

This field is required when account is not present. O campo value não pode ser superior a 255 caracteres. Example: thywbykgvayztrfporibg

favorite   boolean  optional    

Example: false

Update supplier bank account

requires authentication suppliers update

Example request:
curl --request PUT \
    "https://api.bs-homolog.pensou.app.br/api/suppliers/1/bank-account/magnam" \
    --header "Authorization: Bearer 143gdDPEa66ah8fcekV5vbZ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"bank_id\": \"d95cc89f-1e7b-3637-808b-eaae93f6d29b\",
    \"agency\": \"jgdxpcortxdujuknitjf\",
    \"account\": \"few\",
    \"account_type\": \"tqxvtasylextndbaz\",
    \"pix_key\": \"xwa\",
    \"favorite\": false
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/suppliers/1/bank-account/magnam"
);

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

let body = {
    "bank_id": "d95cc89f-1e7b-3637-808b-eaae93f6d29b",
    "agency": "jgdxpcortxdujuknitjf",
    "account": "few",
    "account_type": "tqxvtasylextndbaz",
    "pix_key": "xwa",
    "favorite": false
};

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

Example response (200):


{
    "data": {
        "id": "a345c150-08e4-4071-b45d-60714fb8e2bd",
        "bank": null,
        "agency": null,
        "account": null,
        "account_type": null,
        "pix_key": "clowe@hotmail.com",
        "favorite": false
    }
}
 

Request      

PUT api/suppliers/{supplier_id}/bank-account/{bankAccount}

Headers

Authorization        

Example: Bearer 143gdDPEa66ah8fcekV5vbZ

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

supplier_id   integer     

The ID of the supplier. Example: 1

bankAccount   string     

UUID da conta. Example: magnam

supplier   string     

UUID do fornecedor. Example: necessitatibus

Body Parameters

bank_id   string  optional    

O campo value deve ser um UUID válido. The uuid of an existing record in the banks table. Example: d95cc89f-1e7b-3637-808b-eaae93f6d29b

agency   string  optional    

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

account   string  optional    

This field is required when pix_key is not present. O campo value não pode ser superior a 255 caracteres. Example: few

account_type   string  optional    

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

pix_key   string  optional    

This field is required when account is not present. O campo value não pode ser superior a 255 caracteres. Example: xwa

favorite   boolean  optional    

Example: false

Delete supplier bank account

requires authentication suppliers update

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

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


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

Example response (200):


{
    "message": "Conta removida com sucesso."
}
 

Request      

DELETE api/suppliers/{supplier}/bank-account/{bankAccount}

Headers

Authorization        

Example: Bearer 4aabfc3e16gZPDVdhEv658k

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

supplier   string     

UUID do fornecedor. Example: beatae

bankAccount   string     

UUID da conta. Example: aut

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 hv8gEbPDak6c45f6ea13dZV" \
    --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 hv8gEbPDak6c45f6ea13dZV",
    "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 hv8gEbPDak6c45f6ea13dZV

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 dV3kv61Pface6Z5D8abEhg4" \
    --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 dV3kv61Pface6Z5D8abEhg4",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": [
        {
            "id": "2d7b2266-40df-3fa8-9214-92fc01a0a1a6",
            "name": "Maitê Rezende Jr.",
            "description": "Fuga dolorem et et tenetur facilis quam quisquam. Eveniet et asperiores dolor dicta ea sint. Aut velit tempore assumenda quas eum.",
            "type": "saída"
        },
        {
            "id": "e64bb10a-b284-384e-8b93-30f0ef24ac85",
            "name": "Sr. Gilberto Queirós",
            "description": "Quo et qui occaecati rerum et. Tempore enim et deleniti ullam. Vel impedit ducimus odio et et sit.",
            "type": "depósito"
        }
    ],
    "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 dV3kv61Pface6Z5D8abEhg4

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/omnis" \
    --header "Authorization: Bearer 84a6bZk1PeDvcEdV36ah5fg" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/transaction-categories/omnis"
);

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


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

Example response (200):


{
    "data": {
        "id": "c9f3e4d3-9263-316d-9500-74b78b212cf3",
        "name": "Andressa Delvalle Filho",
        "description": "Quia id sit porro quia distinctio. Fugit quia dicta qui eligendi. Doloribus aspernatur aut unde ab sint in nesciunt. Cupiditate quas aut dicta eveniet excepturi et.",
        "type": "tarifa"
    }
}
 

Request      

GET api/transaction-categories/{transactionCategory}

Headers

Authorization        

Example: Bearer 84a6bZk1PeDvcEdV36ah5fg

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

transactionCategory   string     

Transaction category UUID Example: omnis

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 aDh15Pbvcfg834VkaE6e6dZ" \
    --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 aDh15Pbvcfg834VkaE6e6dZ",
    "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 aDh15Pbvcfg834VkaE6e6dZ

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/quidem" \
    --header "Authorization: Bearer 8VaE5Dg63ecdh1fb4kv6PaZ" \
    --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/quidem"
);

const headers = {
    "Authorization": "Bearer 8VaE5Dg63ecdh1fb4kv6PaZ",
    "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 8VaE5Dg63ecdh1fb4kv6PaZ

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

transactionCategory   string     

Transaction category UUID Example: quidem

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/quia" \
    --header "Authorization: Bearer 5ckv3gha6eDfdVEP6ba8Z14" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/transaction-categories/quia"
);

const headers = {
    "Authorization": "Bearer 5ckv3gha6eDfdVEP6ba8Z14",
    "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 5ckv3gha6eDfdVEP6ba8Z14

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

transactionCategory   string     

Transaction category UUID Example: quia

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 g5cehEP16Zf63daak4DVbv8" \
    --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 g5cehEP16Zf63daak4DVbv8",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": [
        {
            "id": "767f0f66-734d-3390-917a-5c123cebf7b2",
            "name": "Voluptatem explicabo",
            "slug": "voluptatem-explicabo-172830",
            "description": "Nihil quo numquam aspernatur impedit.",
            "icon": null,
            "color": null,
            "sort_order": 0,
            "is_active": true,
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "2e2a2d9d-fe28-3455-8df7-cd6ace3c5cf7",
            "name": "Velit suscipit",
            "slug": "velit-suscipit-520117",
            "description": "Ut rerum magnam molestiae et.",
            "icon": null,
            "color": null,
            "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 g5cehEP16Zf63daak4DVbv8

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 6641fkDheE83Zabgvac5PVd" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"slug\": \"Example Slug\",
    \"description\": \"Example Description\",
    \"icon\": \"Example Icon\",
    \"color\": \"Example Color\",
    \"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 6641fkDheE83Zabgvac5PVd",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "slug": "Example Slug",
    "description": "Example Description",
    "icon": "Example Icon",
    "color": "Example Color",
    "sort_order": 1,
    "is_active": true
};

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

Example response (201):


{
    "data": {
        "id": "6220a9ad-6bc1-3ac7-93a9-67c4da2b99ec",
        "name": "Rerum id",
        "slug": "rerum-id-799968",
        "description": "Dolor dolorem dolores eveniet iusto natus ut enim.",
        "icon": null,
        "color": null,
        "sort_order": 0,
        "is_active": true,
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

POST api/admin/tutorial-modules

Headers

Authorization        

Example: Bearer 6641fkDheE83Zabgvac5PVd

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

icon   string  optional    

Ícone. O campo value não pode ser superior a 64 caracteres. Example: Example Icon

color   string  optional    

Cor. Must match the regex /^#[0-9a-fA-F]{6}$/. Example: Example Color

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 P8vDZVcbd645a36f1Ehkgea" \
    --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 P8vDZVcbd645a36f1Ehkgea",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": {
        "id": "12b5026a-e2f9-30dc-a573-bdb39c2d85e5",
        "name": "Accusantium qui",
        "slug": "accusantium-qui-208613",
        "description": "Sed sunt sapiente laborum delectus ipsa animi.",
        "icon": null,
        "color": null,
        "sort_order": 0,
        "is_active": true,
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/admin/tutorial-modules/{tutorialModule}

Headers

Authorization        

Example: Bearer P8vDZVcbd645a36f1Ehkgea

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 P5fZDV6e83gkcbd1aavh64E" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"slug\": \"Example Slug\",
    \"description\": \"Example Description\",
    \"icon\": \"Example Icon\",
    \"color\": \"Example Color\",
    \"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 P5fZDV6e83gkcbd1aavh64E",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "slug": "Example Slug",
    "description": "Example Description",
    "icon": "Example Icon",
    "color": "Example Color",
    "sort_order": 1,
    "is_active": true
};

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

Example response (200):


{
    "data": {
        "id": "4766f774-9be1-38bb-8c85-67ae96f15002",
        "name": "Quas corporis",
        "slug": "quas-corporis-110514",
        "description": "Aut sed possimus id temporibus sequi similique.",
        "icon": null,
        "color": null,
        "sort_order": 0,
        "is_active": true,
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

PUT api/admin/tutorial-modules/{tutorialModule}

Headers

Authorization        

Example: Bearer P5fZDV6e83gkcbd1aavh64E

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

icon   string  optional    

Ícone. O campo value não pode ser superior a 64 caracteres. Example: Example Icon

color   string  optional    

Cor. Must match the regex /^#[0-9a-fA-F]{6}$/. Example: Example Color

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 318aPeg46ZVfEDhdbac6k5v" \
    --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 318aPeg46ZVfEDhdbac6k5v",
    "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 318aPeg46ZVfEDhdbac6k5v

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[]=51ae01d8-2457-3e52-96a2-05f5676e22a7&status=published" \
    --header "Authorization: Bearer 5aaP16k4ZgfEDvh68V3ebdc" \
    --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[0]": "51ae01d8-2457-3e52-96a2-05f5676e22a7",
    "status": "published",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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


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

Example response (200):


{
    "data": [
        {
            "id": "e0d3dad4-42df-3132-8cc9-b65a79c0ce7f",
            "title": "Quas dolorum aut modi",
            "description": "Facilis ea consequatur natus ex non.",
            "cover_url": null,
            "status": "draft",
            "published_at": null,
            "sort_order": 0,
            "module": {
                "id": "a345c150-42f7-4d28-b52e-9a492bb1a1cd",
                "name": "Soluta placeat",
                "slug": "soluta-placeat-52441",
                "icon": null,
                "color": null
            },
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "8dcfa49f-af96-33b9-8ca9-7e89dad0cee2",
            "title": "Labore sed ullam porro",
            "description": "Incidunt voluptatem pariatur incidunt.",
            "cover_url": null,
            "status": "draft",
            "published_at": null,
            "sort_order": 0,
            "module": {
                "id": "a345c150-45e6-4c7f-8099-a1a5fa648c2d",
                "name": "Nam vitae",
                "slug": "nam-vitae-95660",
                "icon": null,
                "color": 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/admin/tutorials

Headers

Authorization        

Example: Bearer 5aaP16k4ZgfEDvh68V3ebdc

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    

O campo value deve ser um UUID válido. The uuid of an existing record in the tutorial_modules table.

sector_id   string[]  optional    
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 kaDZgb468Pe1Vhd3a6cfvE5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"module_id\": \"9b19a019-dde6-3433-a0ac-08790c4ccaa7\",
    \"title\": \"Example Title\",
    \"description\": \"Example Description\",
    \"cover_path\": \"Example Cover path\",
    \"sort_order\": 1,
    \"sectors\": [
        \"43a1b594-8a01-3369-a1f7-7faec4fdff83\"
    ],
    \"permissions\": [
        \"d681959c-e488-3811-8b37-f3199c4db72a\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/admin/tutorials"
);

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

let body = {
    "module_id": "9b19a019-dde6-3433-a0ac-08790c4ccaa7",
    "title": "Example Title",
    "description": "Example Description",
    "cover_path": "Example Cover path",
    "sort_order": 1,
    "sectors": [
        "43a1b594-8a01-3369-a1f7-7faec4fdff83"
    ],
    "permissions": [
        "d681959c-e488-3811-8b37-f3199c4db72a"
    ]
};

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

Example response (201):


{
    "data": {
        "id": "37817c4e-09f7-3e9b-b3c9-1eede404ff44",
        "title": "Perspiciatis dicta fugiat blanditiis",
        "description": "Laboriosam esse dicta tenetur minus qui veritatis omnis possimus.",
        "cover_url": null,
        "status": "draft",
        "published_at": null,
        "sort_order": 0,
        "module": {
            "id": "a345c150-4dc4-4698-92fd-82bccc6cd291",
            "name": "Sit magni",
            "slug": "sit-magni-935783",
            "icon": null,
            "color": null
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

POST api/admin/tutorials

Headers

Authorization        

Example: Bearer kaDZgb468Pe1Vhd3a6cfvE5

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: 9b19a019-dde6-3433-a0ac-08790c4ccaa7

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 d6vh5acb4fPk6aZDg1V8E3e" \
    --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 d6vh5acb4fPk6aZDg1V8E3e",
    "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 d6vh5acb4fPk6aZDg1V8E3e

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 Va1EcP5akeZ34h86dfDg6vb" \
    --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 Va1EcP5akeZ34h86dfDg6vb",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": {
        "id": "538364f9-d2f9-365f-9d76-0c1bcb082465",
        "title": "Aut non numquam adipisci",
        "description": "Earum excepturi impedit laborum iste.",
        "cover_url": null,
        "status": "draft",
        "published_at": null,
        "sort_order": 0,
        "module": {
            "id": "a345c150-5521-44ea-b72a-1c4a8763c9f3",
            "name": "Accusamus esse",
            "slug": "accusamus-esse-318854",
            "icon": null,
            "color": null
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/admin/tutorials/{id}

Headers

Authorization        

Example: Bearer Va1EcP5akeZ34h86dfDg6vb

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 3vZdVf66bkgch4DP8eE5a1a" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"module_id\": \"73e524df-b8ed-3525-97e7-36d475f9a109\",
    \"title\": \"Example Title\",
    \"description\": \"Example Description\",
    \"cover_path\": \"Example Cover path\",
    \"sort_order\": 1,
    \"sectors\": [
        \"20eba93a-03ca-3437-b366-43455087cca5\"
    ],
    \"permissions\": [
        \"965ea159-b66d-3dc8-93ca-b06ee410f6dd\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/admin/tutorials/1"
);

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

let body = {
    "module_id": "73e524df-b8ed-3525-97e7-36d475f9a109",
    "title": "Example Title",
    "description": "Example Description",
    "cover_path": "Example Cover path",
    "sort_order": 1,
    "sectors": [
        "20eba93a-03ca-3437-b366-43455087cca5"
    ],
    "permissions": [
        "965ea159-b66d-3dc8-93ca-b06ee410f6dd"
    ]
};

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

Example response (200):


{
    "data": {
        "id": "baa1ddbe-fd95-3e30-933f-c7f2effc3dfb",
        "title": "Ea et illo nam",
        "description": "Consectetur nostrum nihil aliquam fugiat ea.",
        "cover_url": null,
        "status": "draft",
        "published_at": null,
        "sort_order": 0,
        "module": {
            "id": "a345c150-5d56-4914-9592-5724842d7c49",
            "name": "Dignissimos voluptatem",
            "slug": "dignissimos-voluptatem-233192",
            "icon": null,
            "color": null
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

PUT api/admin/tutorials/{id}

Headers

Authorization        

Example: Bearer 3vZdVf66bkgch4DP8eE5a1a

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: 73e524df-b8ed-3525-97e7-36d475f9a109

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 1bVa35aDEhZgd8Pek6f6v4c" \
    --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 1bVa35aDEhZgd8Pek6f6v4c",
    "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 1bVa35aDEhZgd8Pek6f6v4c

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 Dcfh1ae3v48d56a6ZbkVgPE" \
    --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 Dcfh1ae3v48d56a6ZbkVgPE",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": {
        "id": "ebc18348-0535-3e95-913a-fb4308758fb4",
        "title": "Ut maiores atque fuga",
        "description": "Est ut numquam sunt.",
        "cover_url": null,
        "status": "draft",
        "published_at": null,
        "sort_order": 0,
        "module": {
            "id": "a345c150-654e-40a4-9288-4475a5a998f7",
            "name": "Modi tempore",
            "slug": "modi-tempore-224862",
            "icon": null,
            "color": null
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

POST api/admin/tutorials/{tutorial}/publish

Headers

Authorization        

Example: Bearer Dcfh1ae3v48d56a6ZbkVgPE

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 d6Vv3geb1acfEhP58D6aZk4" \
    --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 d6Vv3geb1acfEhP58D6aZk4",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": {
        "id": "d1333bef-3571-36fe-b1bd-d788a683a7cc",
        "title": "Fugiat non quasi atque",
        "description": "Fugiat dolores qui rerum qui.",
        "cover_url": null,
        "status": "draft",
        "published_at": null,
        "sort_order": 0,
        "module": {
            "id": "a345c150-6a85-417a-91e6-e1df327c74ce",
            "name": "Quaerat ipsam",
            "slug": "quaerat-ipsam-214242",
            "icon": null,
            "color": null
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

POST api/admin/tutorials/{tutorial}/unpublish

Headers

Authorization        

Example: Bearer d6Vv3geb1acfEhP58D6aZk4

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 haE6bD5e13Zk8fcd4gVPv6a" \
    --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 haE6bD5e13Zk8fcd4gVPv6a",
    "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": "252286c3-41f5-3e07-b9ad-77d334b4871d",
        "type": "pdf",
        "title": "Et enim vero",
        "mime_type": "application/pdf",
        "size_bytes": 3493399,
        "duration_seconds": null,
        "sort_order": 0,
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

POST api/admin/tutorials/{tutorial_id}/items

Headers

Authorization        

Example: Bearer haE6bD5e13Zk8fcd4gVPv6a

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 Phkada6f6ED5cveV341g8bZ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"items\": [
        \"f05045aa-5408-337a-b1de-54b9dd4508b2\"
    ]
}"
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 Phkada6f6ED5cveV341g8bZ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "items": [
        "f05045aa-5408-337a-b1de-54b9dd4508b2"
    ]
};

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 Phkada6f6ED5cveV341g8bZ

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 b3a4gZv1Dk86chEda65eVPf" \
    --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 b3a4gZv1Dk86chEda65eVPf",
    "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": "c5da5650-54ef-3725-b810-a42973005e0a",
        "type": "pdf",
        "title": "Aperiam eaque libero",
        "mime_type": "application/pdf",
        "size_bytes": 1289685,
        "duration_seconds": null,
        "sort_order": 0,
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

PUT api/admin/tutorial-items/{tutorialItem}

Headers

Authorization        

Example: Bearer b3a4gZv1Dk86chEda65eVPf

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 Dvg86514PEaVabfckd6h3Ze" \
    --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 Dvg86514PEaVabfckd6h3Ze",
    "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 Dvg86514PEaVabfckd6h3Ze

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 hv8ba4c6E6VZae15P3Dkgdf" \
    --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 hv8ba4c6E6VZae15P3Dkgdf",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": [
        {
            "id": "09f6ddad-637b-315f-b989-2c64ade03f5b",
            "name": "Elias Serrano",
            "abbreviation": "Dr. Ricardo Roque Brito",
            "description": "Ut voluptatem rem cum eos et.",
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "87c14527-8e08-3086-b9cc-27e26d3489e9",
            "name": "Sr. Martinho Delatorre Valdez",
            "abbreviation": "Dr. Jorge Cristóvão Cruz",
            "description": "Numquam qui reiciendis 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/units

Headers

Authorization        

Example: Bearer hv8ba4c6E6VZae15P3Dkgdf

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 1daZ6e38cgvfkh5PE64aVDb" \
    --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 1daZ6e38cgvfkh5PE64aVDb",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": {
        "id": "8d07d02e-5404-353f-84e2-39ce9e2a14e9",
        "name": "Gabrielly Uchoa Verdara",
        "abbreviation": "Sra. Patrícia Grego Filho",
        "description": "Ab sunt officia alias.",
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/units/{id}

Headers

Authorization        

Example: Bearer 1daZ6e38cgvfkh5PE64aVDb

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: ullam

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 1d6gfVPa4bcDh8E5kae63Zv" \
    --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 1d6gfVPa4bcDh8E5kae63Zv",
    "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 1d6gfVPa4bcDh8E5kae63Zv

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 gd136aeZvchV4Efa6kDbP58" \
    --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 gd136aeZvchV4Efa6kDbP58",
    "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 gd136aeZvchV4Efa6kDbP58

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: ut

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/sint" \
    --header "Authorization: Bearer 1g8e6a6bZc5fVa43DhvPEdk" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/units/sint"
);

const headers = {
    "Authorization": "Bearer 1g8e6a6bZc5fVa43DhvPEdk",
    "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 1g8e6a6bZc5fVa43DhvPEdk

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

unit   string     

Unit UUID Example: sint

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 d3a8EPhb5gf64cvaZkVD61e" \
    --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 d3a8EPhb5gf64cvaZkVD61e",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": [
        {
            "id": "9d674118-e05e-3f7c-9988-3718a5cb5085",
            "name": "Mrs. Marjory Ernser DVM",
            "username": "clifton.streich",
            "email": "erenner@example.net",
            "certification": null,
            "crea": null,
            "last_login_at": null,
            "image": {
                "id": null,
                "url": null
            },
            "sectors": [],
            "roles": []
        },
        {
            "id": "519a7c8b-217a-38c3-ac0e-bbb1e876049a",
            "name": "Dayna Glover Jr.",
            "username": "jerry39",
            "email": "fortiz@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 d3a8EPhb5gf64cvaZkVD61e

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 cV6av51ahbPe3EZkdgD4f68" \
    --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 cV6av51ahbPe3EZkdgD4f68",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": {
        "id": "090745d1-9371-3c12-828b-4d77e33628cd",
        "name": "Stefanie Schneider",
        "username": "tess.cassin",
        "email": "nels13@example.net",
        "certification": null,
        "crea": null,
        "last_login_at": null,
        "image": {
            "id": null,
            "url": null
        },
        "sectors": [],
        "roles": []
    }
}
 

Request      

GET api/users/{id}

Headers

Authorization        

Example: Bearer cV6av51ahbPe3EZkdgD4f68

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 6Z6EVava8D13gfedbPc45hk" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"certification\": \"Example Certification\",
    \"crea\": \"Example Crea\",
    \"email\": \"user@example.com\",
    \"username\": \"chilpert\",
    \"image\": {
        \"0\": \"example1\",
        \"1\": \"example2\",
        \"path\": \"Example Image path\",
        \"name\": \"Example Name\",
        \"extension\": \"Example Image extension\",
        \"size\": \"Example Image size\"
    },
    \"sectors\": [
        \"3877364d-9337-39b0-89da-075c9dcf74c6\"
    ],
    \"roles\": [
        \"36a0e672-22c1-3ed4-b9d8-38cbf7153290\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/users"
);

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

let body = {
    "name": "Example Name",
    "certification": "Example Certification",
    "crea": "Example Crea",
    "email": "user@example.com",
    "username": "chilpert",
    "image": {
        "0": "example1",
        "1": "example2",
        "path": "Example Image path",
        "name": "Example Name",
        "extension": "Example Image extension",
        "size": "Example Image size"
    },
    "sectors": [
        "3877364d-9337-39b0-89da-075c9dcf74c6"
    ],
    "roles": [
        "36a0e672-22c1-3ed4-b9d8-38cbf7153290"
    ]
};

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 6Z6EVava8D13gfedbPc45hk

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: chilpert

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 vE6g5ebZ3P61adckVf4a8hD" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"certification\": \"Example Certification\",
    \"crea\": \"Example Crea\",
    \"email\": \"user@example.com\",
    \"username\": \"kuhic.coleman\",
    \"password\": \"password123\",
    \"image\": {
        \"0\": \"example1\",
        \"1\": \"example2\",
        \"path\": \"Example Image path\",
        \"name\": \"Example Name\",
        \"extension\": \"Example Image extension\",
        \"size\": \"Example Image size\"
    },
    \"sectors\": [
        \"11fcd391-91e7-338e-b107-076f72c09225\"
    ],
    \"roles\": [
        \"c6b3ad30-828c-3fc9-983b-7683167a75e1\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/users/1"
);

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

let body = {
    "name": "Example Name",
    "certification": "Example Certification",
    "crea": "Example Crea",
    "email": "user@example.com",
    "username": "kuhic.coleman",
    "password": "password123",
    "image": {
        "0": "example1",
        "1": "example2",
        "path": "Example Image path",
        "name": "Example Name",
        "extension": "Example Image extension",
        "size": "Example Image size"
    },
    "sectors": [
        "11fcd391-91e7-338e-b107-076f72c09225"
    ],
    "roles": [
        "c6b3ad30-828c-3fc9-983b-7683167a75e1"
    ]
};

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 vE6g5ebZ3P61adckVf4a8hD

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: kuhic.coleman

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 8EahDkgbd5fVeZ66P43vca1" \
    --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 8EahDkgbd5fVeZ66P43vca1",
    "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 8EahDkgbd5fVeZ66P43vca1

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 fbcdgavk3aV1D5PeEh68Z64" \
    --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 fbcdgavk3aV1D5PeEh68Z64",
    "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 fbcdgavk3aV1D5PeEh68Z64

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 5Z368PeD6havfgbdka14EVc" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"permissions\": [
        \"0c87fcf6-7d42-3f0d-8c5e-9bfaf52c2523\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/users/1/permissions"
);

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

let body = {
    "permissions": [
        "0c87fcf6-7d42-3f0d-8c5e-9bfaf52c2523"
    ]
};

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 5Z368PeD6havfgbdka14EVc

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 Eb4c8aZ6kfeV5P1ahgDd36v" \
    --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 Eb4c8aZ6kfeV5P1ahgDd36v",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": [
        {
            "id": null,
            "name": "perferendis",
            "display_name": "Alias labore exercitationem quis molestias sed."
        },
        {
            "id": null,
            "name": "placeat",
            "display_name": "Laborum perferendis eum aperiam aut."
        }
    ]
}
 

Request      

GET api/users/{user}/permissions

Headers

Authorization        

Example: Bearer Eb4c8aZ6kfeV5P1ahgDd36v

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 vePg1685fV3kdaZaE6cDh4b" \
    --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 vePg1685fV3kdaZaE6cDh4b",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": [
        {
            "id": "e4177e5c-af83-3d2c-881f-158ee009ec6a",
            "description": "Reinaldo Pontes",
            "work": {
                "id": null,
                "name": null
            },
            "documents": [],
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "2a26d158-9f3c-3a79-a85e-cc8416e00933",
            "description": "Sr. Natal Cruz Aguiar",
            "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 vePg1685fV3kdaZaE6cDh4b

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 VEfeg4D6kvhcba63Z1a5Pd8" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"description\": \"Example Description\",
    \"work_id\": \"717981ae-fc3f-3fce-85e1-6e570780a4f7\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/work-locations"
);

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

let body = {
    "description": "Example Description",
    "work_id": "717981ae-fc3f-3fce-85e1-6e570780a4f7"
};

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 VEfeg4D6kvhcba63Z1a5Pd8

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: 717981ae-fc3f-3fce-85e1-6e570780a4f7

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 vhZkbg54eaaED6f6c3VPd81" \
    --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 vhZkbg54eaaED6f6c3VPd81",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": {
        "id": "56415b89-0692-3c7c-8259-e0473c195729",
        "description": "Sr. Anderson Dominato Madeira",
        "work": {
            "id": null,
            "name": null
        },
        "documents": [],
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/work-locations/{workLocation}

Headers

Authorization        

Example: Bearer vhZkbg54eaaED6f6c3VPd81

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 cea865hfV43kgdPE1bZaD6v" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"description\": \"Example Description\",
    \"work_id\": \"b887d747-83b1-3a34-8e97-ee598a127704\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/work-locations/019556e7-2e9f-777c-a177-30bbf0646c32"
);

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

let body = {
    "description": "Example Description",
    "work_id": "b887d747-83b1-3a34-8e97-ee598a127704"
};

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 cea865hfV43kgdPE1bZaD6v

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: b887d747-83b1-3a34-8e97-ee598a127704

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 k8d65eh1VavgcbDP4ZEaf63" \
    --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 k8d65eh1VavgcbDP4ZEaf63",
    "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 k8d65eh1VavgcbDP4ZEaf63

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 k6ghEV1P345c6vebadDa8fZ" \
    --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 k6ghEV1P345c6vebadDa8fZ",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": [
        {
            "id": "c65251c5-ea0c-33fb-94aa-30b31a59e00d",
            "name": "Betina Ketlin Ortega",
            "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": "2024-03-19 09:26:49.000000",
                "timezone_type": 3,
                "timezone": "America/Sao_Paulo"
            },
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "6923ae09-4c05-3cc6-bce8-da1652bf6e2e",
            "name": "Marco Carmona",
            "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": "2025-10-24 03:19:58.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 k6ghEV1P345c6vebadDa8fZ

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 1d3ZE65V6fgahkvPD8bae4c" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"customer_id\": \"011e2035-5336-36cc-a9eb-46aa2562128f\",
    \"status_id\": \"97b36b63-56a1-31a1-ad27-0e20c20bc9e5\",
    \"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 1d3ZE65V6fgahkvPD8bae4c",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "customer_id": "011e2035-5336-36cc-a9eb-46aa2562128f",
    "status_id": "97b36b63-56a1-31a1-ad27-0e20c20bc9e5",
    "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 1d3ZE65V6fgahkvPD8bae4c

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: 011e2035-5336-36cc-a9eb-46aa2562128f

status_id   string     

Status id. The uuid of an existing record in the statuses table. Example: 97b36b63-56a1-31a1-ad27-0e20c20bc9e5

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 ZDh65fdc8vaV1aPe6b34Egk" \
    --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 ZDh65fdc8vaV1aPe6b34Egk",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": {
        "id": "e674a87d-740d-34dc-af45-d7309e6c752b",
        "name": "Sra. Maya Marés",
        "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": "1985-06-03 16:44:03.000000",
            "timezone_type": 3,
            "timezone": "America/Sao_Paulo"
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/works/{id}

Headers

Authorization        

Example: Bearer ZDh65fdc8vaV1aPe6b34Egk

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 P614b5dcZae3afkEVgv6Dh8" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"customer_id\": \"c2c26fd5-cfb7-34c0-88fe-21a3ba9c4883\",
    \"status_id\": \"a93f3ee7-b6b7-38ba-83f4-0937abd74d55\",
    \"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 P614b5dcZae3afkEVgv6Dh8",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "customer_id": "c2c26fd5-cfb7-34c0-88fe-21a3ba9c4883",
    "status_id": "a93f3ee7-b6b7-38ba-83f4-0937abd74d55",
    "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 P614b5dcZae3afkEVgv6Dh8

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: c2c26fd5-cfb7-34c0-88fe-21a3ba9c4883

status_id   string  optional    

Status id. The uuid of an existing record in the statuses table. Example: a93f3ee7-b6b7-38ba-83f4-0937abd74d55

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 Z66gE3cVb14hedaPf5kv8Da" \
    --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 Z66gE3cVb14hedaPf5kv8Da",
    "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 Z66gE3cVb14hedaPf5kv8Da

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 6f6baEvc8ahk3eZgd4DPV15" \
    --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 6f6baEvc8ahk3eZgd4DPV15",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


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

Example response (200):


{
    "data": [
        {
            "id": "ffdeaaad-20ad-363c-b042-6d853923733f",
            "name": "Prof. Jamison Lueilwitz DVM",
            "username": "burnice.skiles",
            "email": "jasen35@example.org",
            "certification": null,
            "crea": null,
            "last_login_at": null,
            "image": {
                "id": null,
                "url": null
            },
            "sectors": [],
            "roles": []
        },
        {
            "id": "cd70960c-5379-3ab7-b26c-47f97713ea9b",
            "name": "Margarette Greenholt",
            "username": "owolf",
            "email": "noemie41@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/works/{work}/responsibles

Headers

Authorization        

Example: Bearer 6f6baEvc8ahk3eZgd4DPV15

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 ck56ehgva4bP68dZEf31VDa" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"users\": [
        \"308cbbb5-7b56-3e27-9ef3-d817853e6967\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/works/019556e7-2e9f-777c-a177-30bbf0646c32/responsibles/attach"
);

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

let body = {
    "users": [
        "308cbbb5-7b56-3e27-9ef3-d817853e6967"
    ]
};

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 ck56ehgva4bP68dZEf31VDa

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 a4kD8gd3hvc651EeVa6ZPbf" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"users\": [
        \"b283fd11-0984-3d2c-8ab3-c6147ef551e7\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/works/019556e7-2e9f-777c-a177-30bbf0646c32/responsibles/detach"
);

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

let body = {
    "users": [
        "b283fd11-0984-3d2c-8ab3-c6147ef551e7"
    ]
};

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 a4kD8gd3hvc651EeVa6ZPbf

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 cgv6dZa6fheE13bPk4aV58D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"users\": [
        \"ac3b4657-7f2c-3768-8cf5-dd7b00921d00\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/works/019556e7-2e9f-777c-a177-30bbf0646c32/responsibles/sync"
);

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

let body = {
    "users": [
        "ac3b4657-7f2c-3768-8cf5-dd7b00921d00"
    ]
};

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 cgv6dZa6fheE13bPk4aV58D

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.