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

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

Example response (200):


{
    "data": [
        {
            "id": "cda4d5e3-0776-388d-aa5b-6014e8142777",
            "name": "quos",
            "display_name": "Laborum sunt eveniet itaque praesentium.",
            "permissions_count": null
        },
        {
            "id": "ec0e424e-b458-3929-8c50-89a4d167c5cd",
            "name": "laudantium",
            "display_name": "Qui in omnis vel.",
            "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 5fkZe8D6Vcd3ha6ga41PEbv

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 dVaaZ5k61vbhfDEP6g3e8c4" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"display_name\": \"Example Name\",
    \"permissions\": [
        \"553b79c4-2183-3497-87e0-8c8c4e4cd4fd\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/acl/roles"
);

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

let body = {
    "name": "Example Name",
    "display_name": "Example Name",
    "permissions": [
        "553b79c4-2183-3497-87e0-8c8c4e4cd4fd"
    ]
};

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 dVaaZ5k61vbhfDEP6g3e8c4

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 6kZ1hPdc6a3VefaE8vgDb45" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"display_name\": \"Example Name\",
    \"permissions\": [
        \"19648207-5359-3ad0-848f-d978da2dccdc\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/acl/roles/1"
);

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

let body = {
    "name": "Example Name",
    "display_name": "Example Name",
    "permissions": [
        "19648207-5359-3ad0-848f-d978da2dccdc"
    ]
};

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

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

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

Example response (200):


{
    "data": {
        "id": "3a2eec29-558b-30ce-853a-ded4ccbb957f",
        "name": "id",
        "display_name": "At minima quia consequuntur vel.",
        "permissions_count": null
    }
}
 

Request      

GET api/acl/roles/{id}

Headers

Authorization        

Example: Bearer 6dDahg3V5fbkav1Ee86Z4Pc

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

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

Example response (200):


{
    "data": [
        {
            "id": null,
            "name": "qui",
            "display_name": "Voluptatem adipisci perferendis alias non reprehenderit esse labore."
        },
        {
            "id": null,
            "name": "accusantium",
            "display_name": "Iure quas iusto omnis id expedita."
        }
    ]
}
 

Request      

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

Headers

Authorization        

Example: Bearer keP3EfgdDb6aV4ha5618vZc

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

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

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

Example response (200):


{
    "data": [
        {
            "id": null,
            "name": "dolorem",
            "display_name": "Ut eligendi rerum ducimus maiores soluta eos blanditiis."
        },
        {
            "id": null,
            "name": "ducimus",
            "display_name": "Sunt voluptate eos tempore velit."
        }
    ],
    "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 Vc658D36aea1PkEgvfbZdh4

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

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

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

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

Example response (200):


{
    "data": {
        "id": null,
        "name": "ad",
        "display_name": "Eveniet ea alias cumque quisquam sint."
    }
}
 

Request      

GET api/acl/permissions/{id}

Headers

Authorization        

Example: Bearer Dgk1dZ6fcVPa3av5Ebe46h8

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

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

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

Example response (200):


{
    "data": [
        {
            "id": "3e4bb76b-2510-30ba-8ca7-0f95a35e8e9c",
            "type": "entrada",
            "payment_method": "boleto",
            "amount": 5950.65,
            "due_date": "2026-03-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": "Consequatur qui est fuga repellat et qui doloribus.",
            "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": "dolore",
            "field2": 92,
            "field3": true,
            "notes": "Doloribus consequuntur eaque sed non.",
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "6af1cc4a-2109-34a3-9380-a67f829fe08b",
            "type": "saída",
            "payment_method": "cheque",
            "amount": 9973.97,
            "due_date": "2026-04-19T03: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": "Fugiat similique minima qui quis quasi cumque.",
            "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": "vero",
            "field2": 46,
            "field3": true,
            "notes": "Recusandae est minus non ea itaque quos.",
            "created_at": null,
            "updated_at": null
        }
    ]
}
 

Request      

GET api/accounts-payable-receivable/reminders

Headers

Authorization        

Example: Bearer eEkDha4386P5davcVgfZb16

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

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

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 1gZb66PehE4c5Df8adkvVa3" \
    --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 1gZb66PehE4c5Df8adkvVa3",
    "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 1gZb66PehE4c5Df8adkvVa3

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&type=entrada&customers[]=nihil&suppliers[]=necessitatibus&statuses[]=a+vencer&payment_method=cheque&date_start=2023-01-01&date_end=2023-12-31&protest_date_start=2026-03-19T11%3A11%3A15&protest_date_end=2026-03-19T11%3A11%3A15&has_protest=&has_children=&is_recurring=" \
    --header "Authorization: Bearer g61k3fc8Ea4PDdvZ5Vh6aeb" \
    --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",
    "type": "entrada",
    "customers[0]": "nihil",
    "suppliers[0]": "necessitatibus",
    "statuses[0]": "a vencer",
    "payment_method": "cheque",
    "date_start": "2023-01-01",
    "date_end": "2023-12-31",
    "protest_date_start": "2026-03-19T11:11:15",
    "protest_date_end": "2026-03-19T11:11:15",
    "has_protest": "0",
    "has_children": "0",
    "is_recurring": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

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

Example response (200):


{
    "data": [
        {
            "id": "4ae0b5ca-bae7-365e-802b-71335a802046",
            "type": "entrada",
            "payment_method": "boleto",
            "amount": 119.04,
            "due_date": "2026-04-14T03: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": "Minus dolores enim voluptas ea nostrum illum voluptas suscipit autem.",
            "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": "cupiditate",
            "field2": 20,
            "field3": true,
            "notes": "Qui aspernatur ut vel aut fugiat.",
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "206bb0ac-a3d8-35cd-815c-3391b5ebdbfb",
            "type": "saída",
            "payment_method": "boleto",
            "amount": 8475.09,
            "due_date": "2026-04-02T03:00:00.000000Z",
            "status": null,
            "payment_date": null,
            "protest_date": null,
            "paid_amount": null,
            "interest_amount": null,
            "penalty_amount": null,
            "notary_fee_amount": null,
            "description": "Veniam ab nihil iusto odio sapiente est.",
            "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": "ut",
            "field2": 27,
            "field3": true,
            "notes": "Possimus explicabo et laudantium sit.",
            "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 g61k3fc8Ea4PDdvZ5Vh6aeb

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

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.

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

Payment method. Example: cheque

Must be one of:
  • cheque
  • boleto
  • 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-03-19T11:11:15

protest_date_end   string  optional    

O campo value deve ser uma data válida. Example: 2026-03-19T11:11:15

has_protest   boolean  optional    

Example: false

has_children   boolean  optional    

Filter accounts that have recurring children. Example: false

is_recurring   boolean  optional    

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

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&type=entrada&customers[]=eum&suppliers[]=itaque&statuses[]=protestado&payment_method=cheque&date_start=2023-01-01&date_end=2023-12-31&protest_date_start=2026-03-19T11%3A11%3A15&protest_date_end=2026-03-19T11%3A11%3A15&has_protest=1&has_children=&is_recurring=" \
    --header "Authorization: Bearer d6kfvgEbVa1Z5chDP8ae463" \
    --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",
    "type": "entrada",
    "customers[0]": "eum",
    "suppliers[0]": "itaque",
    "statuses[0]": "protestado",
    "payment_method": "cheque",
    "date_start": "2023-01-01",
    "date_end": "2023-12-31",
    "protest_date_start": "2026-03-19T11:11:15",
    "protest_date_end": "2026-03-19T11:11:15",
    "has_protest": "1",
    "has_children": "0",
    "is_recurring": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

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

Example response (200):


{
    "data": [
        {
            "id": "a2eb7cc3-8a0a-35a1-abf5-569ca0cd5c0f",
            "type": "saída",
            "payment_method": "boleto",
            "amount": 2749.8,
            "due_date": "2026-04-16T03:00:00.000000Z",
            "status": null,
            "payment_date": null,
            "protest_date": null,
            "paid_amount": null,
            "interest_amount": null,
            "penalty_amount": null,
            "notary_fee_amount": null,
            "description": "Adipisci a quas est veritatis et 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": "quia",
            "field2": 69,
            "field3": true,
            "notes": "Dolor provident quae ut culpa culpa ipsum.",
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "9bde7971-9b40-3617-aadd-4401f7d627a4",
            "type": "entrada",
            "payment_method": "boleto",
            "amount": 2639,
            "due_date": "2026-04-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": "Impedit facilis blanditiis illo ratione aliquid nisi.",
            "is_recurring": null,
            "recurrence_config": null,
            "parent_id": null,
            "recurrence_order": 1,
            "total_recurrences": null,
            "children_count": 0,
            "remaining_recurrences": null,
            "has_children": false,
            "field1": "qui",
            "field2": 64,
            "field3": true,
            "notes": "Nobis eos eaque natus quis dolores esse.",
            "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 d6kfvgEbVa1Z5chDP8ae463

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

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.

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

Payment method. Example: cheque

Must be one of:
  • cheque
  • boleto
  • 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-03-19T11:11:15

protest_date_end   string  optional    

O campo value deve ser uma data válida. Example: 2026-03-19T11:11:15

has_protest   boolean  optional    

Example: true

has_children   boolean  optional    

Filter accounts that have recurring children. Example: false

is_recurring   boolean  optional    

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

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 aeaEPkd856fvc1gD463bZhV" \
    --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\": \"10a1f79c-6c4a-3084-b5f3-247966c276ea\",
    \"customer_id\": \"daf65a2c-4322-3042-a815-0ccf89271f9b\",
    \"status\": \"Example Status\",
    \"protest_date\": \"2024-01-01\",
    \"bank_account_id\": \"c6dbaaf8-69a0-33d7-9c6b-466c932ca5b8\",
    \"custom_fields\": [
        \"example1\",
        \"example2\"
    ],
    \"is_recurring\": false,
    \"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 aeaEPkd856fvc1gD463bZhV",
    "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": "10a1f79c-6c4a-3084-b5f3-247966c276ea",
    "customer_id": "daf65a2c-4322-3042-a815-0ccf89271f9b",
    "status": "Example Status",
    "protest_date": "2024-01-01",
    "bank_account_id": "c6dbaaf8-69a0-33d7-9c6b-466c932ca5b8",
    "custom_fields": [
        "example1",
        "example2"
    ],
    "is_recurring": false,
    "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 aeaEPkd856fvc1gD463bZhV

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
  • 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: 10a1f79c-6c4a-3084-b5f3-247966c276ea

customer_id   string  optional    

Cliente. The uuid of an existing record in the customers table. Example: daf65a2c-4322-3042-a815-0ccf89271f9b

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: c6dbaaf8-69a0-33d7-9c6b-466c932ca5b8

custom_fields   object  optional    

Custom fields.

is_recurring   boolean  optional    

Is recurring. Example: false

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

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

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

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

accountPayableReceivable   string     

Example: et

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

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

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

Example response (200):


{
    "data": {
        "id": "f336fb73-52dd-3047-b148-9351c8810c8c",
        "type": "entrada",
        "payment_method": "boleto",
        "amount": 9333.1,
        "due_date": "2026-04-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": "Consequuntur at in mollitia quo minima harum voluptatibus consequatur.",
        "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": "perferendis",
        "field2": 75,
        "field3": false,
        "notes": "Quidem ut quia deleniti et quia fugit.",
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

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

Headers

Authorization        

Example: Bearer 1v36EfePadZb46DaV5chgk8

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

accountPayableReceivable   string     

Example: laborum

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/blanditiis" \
    --header "Authorization: Bearer 6e6gPVc518Eb3aDkfvZda4h" \
    --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\": \"b55de4a6-781d-340f-abcd-647d41c238ff\",
    \"customer_id\": \"2bbc2885-ab29-386f-b117-c85745e70caf\",
    \"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\": \"2b4cdd35-b354-3d63-80e1-36ebf8bd93f0\",
    \"custom_fields\": [
        \"example1\",
        \"example2\"
    ],
    \"is_recurring\": false,
    \"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/blanditiis"
);

const headers = {
    "Authorization": "Bearer 6e6gPVc518Eb3aDkfvZda4h",
    "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": "b55de4a6-781d-340f-abcd-647d41c238ff",
    "customer_id": "2bbc2885-ab29-386f-b117-c85745e70caf",
    "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": "2b4cdd35-b354-3d63-80e1-36ebf8bd93f0",
    "custom_fields": [
        "example1",
        "example2"
    ],
    "is_recurring": false,
    "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 6e6gPVc518Eb3aDkfvZda4h

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

accountPayableReceivable   string     

Example: blanditiis

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
  • 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: b55de4a6-781d-340f-abcd-647d41c238ff

customer_id   string  optional    

Customer id. The uuid of an existing record in the customers table. Example: 2bbc2885-ab29-386f-b117-c85745e70caf

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: 2b4cdd35-b354-3d63-80e1-36ebf8bd93f0

custom_fields   object  optional    

Custom fields.

is_recurring   boolean  optional    

Is recurring. Example: false

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

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

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

accountPayableReceivable   string     

Example: dolor

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\": \"georgiana81@example.com\",
    \"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": "georgiana81@example.com",
    "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: georgiana81@example.com

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

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

Example response (200):


{
    "data": {
        "id": "7b0904f5-7577-3d55-b37d-6c62dbe9c213",
        "name": "Benjamin Reichert",
        "username": "spinka.michelle",
        "email": "maximo.abbott@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 4aPD1bc3hfZedv5g6k8a6VE

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 Dcabh8Z3EeP4gkav61Vf6d5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"email\": \"user@example.com\",
    \"username\": \"alize.botsford\",
    \"password\": \"password123\",
    \"image\": {
        \"0\": \"example1\",
        \"1\": \"example2\",
        \"path\": \"Example Image path\",
        \"name\": \"Example Name\",
        \"extension\": \"Example Image extension\",
        \"size\": \"Example Image size\"
    },
    \"sectors\": [
        \"ad6981f8-8c04-3fc3-9684-66ebc6dd6c79\"
    ],
    \"roles\": [
        \"4bffd408-6db1-3f8e-b402-284d75192096\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/auth/user"
);

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

let body = {
    "name": "Example Name",
    "email": "user@example.com",
    "username": "alize.botsford",
    "password": "password123",
    "image": {
        "0": "example1",
        "1": "example2",
        "path": "Example Image path",
        "name": "Example Name",
        "extension": "Example Image extension",
        "size": "Example Image size"
    },
    "sectors": [
        "ad6981f8-8c04-3fc3-9684-66ebc6dd6c79"
    ],
    "roles": [
        "4bffd408-6db1-3f8e-b402-284d75192096"
    ]
};

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 Dcabh8Z3EeP4gkav61Vf6d5

Content-Type        

Example: application/json

Accept        

Example: application/json

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

username   string  optional    

Usuário. Example: alize.botsford

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

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 6faa84dZhVe56bD1vk3PEgc" \
    --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 6faa84dZhVe56bD1vk3PEgc",
    "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 6faa84dZhVe56bD1vk3PEgc

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

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

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

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

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

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

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

key   string     

Example: aut

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

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

user   string     

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

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

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

Example response (200):


{
    "data": {
        "totalBalancePositive": "number",
        "totalBalanceNegative": "number",
        "totalLimit": "number",
        "sumLimitAndBalancePositive": "number",
        "accounts": {
            "*": {
                "id": "string",
                "bank": "string",
                "balance": "number",
                "limit": "number"
            }
        }
    }
}
 

Request      

GET api/bank-accounts/balance-summary

Headers

Authorization        

Example: Bearer 86cebD153aV46PahdvgfkEZ

Content-Type        

Example: application/json

Accept        

Example: application/json

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

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

Example response (200):


{
    "data": [
        {
            "id": "587eb9ab-fc74-3603-8308-e43b1b0fb63b",
            "agency": "2389",
            "account": "3073157-6",
            "type": "poupança",
            "balance": 6505.23,
            "holder_type": "pj",
            "alias": "laudantium",
            "limit": 9359.89,
            "available_balance": 15865.119999999999,
            "used_limit": 0,
            "is_default": null,
            "bank": {
                "id": null,
                "name": null,
                "code": null
            },
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "6c4aa966-40ea-3fe6-b095-27030f8ffd6e",
            "agency": "0053",
            "account": "8881499-3",
            "type": "corrente",
            "balance": 5813.85,
            "holder_type": "pf",
            "alias": "quia",
            "limit": 3069.14,
            "available_balance": 8882.99,
            "used_limit": 0,
            "is_default": 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 ceEZV5f8P4ag16Ddha63vbk

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 v4hb16ZDakV3g6d8cfPaEe5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"agency\": \"Example Agency\",
    \"account\": \"3459637-9\",
    \"bank_id\": \"18ad7d0d-60eb-3044-986f-1ad3bbf3354b\",
    \"type\": \"Example Type\",
    \"holder_type\": \"Example Holder type\",
    \"alias\": \"Example Alias\",
    \"balance\": 1,
    \"limit\": 1,
    \"is_default\": false
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/bank-accounts"
);

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

let body = {
    "agency": "Example Agency",
    "account": "3459637-9",
    "bank_id": "18ad7d0d-60eb-3044-986f-1ad3bbf3354b",
    "type": "Example Type",
    "holder_type": "Example Holder type",
    "alias": "Example Alias",
    "balance": 1,
    "limit": 1,
    "is_default": false
};

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 v4hb16ZDakV3g6d8cfPaEe5

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

agency   string     

Agency. Example: Example Agency

account   string     

Account. Example: 3459637-9

bank_id   string     

Bank id. The uuid of an existing record in the banks table. Example: 18ad7d0d-60eb-3044-986f-1ad3bbf3354b

type   string     

Type. Example: Example Type

Must be one of:
  • corrente
  • poupança
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: false

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/10" \
    --header "Authorization: Bearer b1E46DfdePcVhv5a3gk6Za8" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"agency\": \"Example Agency\",
    \"account\": \"5713831-7\",
    \"bank_id\": \"841e79c9-a34e-3a18-bed6-39a787d8989c\",
    \"type\": \"Example Type\",
    \"holder_type\": \"Example Holder type\",
    \"alias\": \"Example Alias\",
    \"balance\": 1,
    \"limit\": 1,
    \"is_default\": false
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/bank-accounts/10"
);

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

let body = {
    "agency": "Example Agency",
    "account": "5713831-7",
    "bank_id": "841e79c9-a34e-3a18-bed6-39a787d8989c",
    "type": "Example Type",
    "holder_type": "Example Holder type",
    "alias": "Example Alias",
    "balance": 1,
    "limit": 1,
    "is_default": false
};

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 b1E46DfdePcVhv5a3gk6Za8

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

bankAccount   integer     

Example: 10

Body Parameters

agency   string  optional    

Agency. Example: Example Agency

account   string  optional    

Account. Example: 5713831-7

bank_id   string  optional    

Bank id. The uuid of an existing record in the banks table. Example: 841e79c9-a34e-3a18-bed6-39a787d8989c

type   string  optional    

Type. Example: Example Type

Must be one of:
  • corrente
  • poupança
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: false

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

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

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

Example response (200):


{
    "data": {
        "id": "e762955f-c2ca-30be-a61d-e441f4f1ccb6",
        "agency": "8239",
        "account": "0507646-0",
        "type": "poupança",
        "balance": 795.84,
        "holder_type": "pf",
        "alias": "dolor",
        "limit": 2843.09,
        "available_balance": 3638.9300000000003,
        "used_limit": 0,
        "is_default": null,
        "bank": {
            "id": null,
            "name": null,
            "code": null
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/bank-accounts/{bankAccount}

Headers

Authorization        

Example: Bearer e4Z3Ddhav651gfcPkEV8b6a

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

bankAccount   integer     

Example: 14

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

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

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

bankAccount   integer     

Example: 6

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

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

Example response (200):


{
    "data": [
        {
            "id": "a1318190-a882-37f8-a2d5-b380112120a8",
            "name": "Ramos Comercial Ltda.",
            "code": "732"
        },
        {
            "id": "f21913c4-4c0b-310e-99ba-8c566bac7a64",
            "name": "Assunção S.A.",
            "code": "128"
        }
    ],
    "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 a6DchfEZd6V3bk81P54evag

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

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

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

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

Example response (200):


{
    "data": {
        "id": "4f7e206a-38bd-3675-bc98-b9677b6ad728",
        "name": "Fonseca e Associados",
        "code": "604"
    }
}
 

Request      

GET api/banks/{bank}

Headers

Authorization        

Example: Bearer D68h6fabd5Veckg13vaE4ZP

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

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 415vVfZhbkcgDdE6e386aaP" \
    --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 415vVfZhbkcgDdE6e386aaP",
    "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 415vVfZhbkcgDdE6e386aaP

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=Excepturi+et+hic+iure+rerum+consequatur.&categories[]=excepturi&date_start=2021-01-01&date_end=2021-01-31&bank_accounts[]=unde&customers[]=illo&suppliers[]=molestiae&works[]=quia" \
    --header "Authorization: Bearer v5ek34Z8fadcE1bg6aVhPD6" \
    --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": "Excepturi et hic iure rerum consequatur.",
    "categories[0]": "excepturi",
    "date_start": "2021-01-01",
    "date_end": "2021-01-31",
    "bank_accounts[0]": "unde",
    "customers[0]": "illo",
    "suppliers[0]": "molestiae",
    "works[0]": "quia",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

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
description   string  optional    

Description . Example: Excepturi et hic iure rerum consequatur.

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.

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=Quis+dolor+tenetur+ea+et.&categories[]=sequi&date_start=2021-01-01&date_end=2021-01-31&bank_accounts[]=dolores&customers[]=dolores&suppliers[]=iusto&works[]=rem" \
    --header "Authorization: Bearer fakPvVc5DZ1eEb86dga463h" \
    --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": "Quis dolor tenetur ea et.",
    "categories[0]": "sequi",
    "date_start": "2021-01-01",
    "date_end": "2021-01-31",
    "bank_accounts[0]": "dolores",
    "customers[0]": "dolores",
    "suppliers[0]": "iusto",
    "works[0]": "rem",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

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

Example response (200):


{
    "data": [
        {
            "id": "eeedbd25-1651-3e94-bb0c-a5aac6ef071a",
            "code": "FC-19477305",
            "type": "transferência",
            "amount": -7179.18,
            "description": "Dignissimos aut et ipsam rerum.",
            "transaction_date": "1986-06-04T03:00:00.000000Z",
            "transaction_category": {
                "id": null,
                "name": null,
                "type": null
            },
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "7755ac1f-9f73-30a1-ba1d-b43f8c23229b",
            "code": "FC-07968132",
            "type": "entrada",
            "amount": 9611.76,
            "description": "Et id porro architecto at sunt maiores voluptatem.",
            "transaction_date": "2008-11-05T02: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 fakPvVc5DZ1eEb86dga463h

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
description   string  optional    

Description . Example: Quis dolor tenetur ea et.

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.

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 Dfd5ae1cZPEka6v86hb43gV" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"type\": \"Example Type\",
    \"cash_session_id\": \"dbd2f98a-c205-35d0-912d-3980d6157187\",
    \"transaction_category_id\": \"c297bb8e-6eef-37da-bfa6-27f36119ddad\",
    \"bank_account_id\": \"b5460136-22a9-3279-98f5-7b0533dda077\",
    \"customer_id\": \"81ea5082-0b9a-34ca-8916-86b43a399730\",
    \"supplier_id\": \"e4862b74-2e00-33a4-ab98-08f003b7afde\",
    \"work_id\": \"0e8243f2-0126-3f37-aa02-208eb02fc8cf\",
    \"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 Dfd5ae1cZPEka6v86hb43gV",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "type": "Example Type",
    "cash_session_id": "dbd2f98a-c205-35d0-912d-3980d6157187",
    "transaction_category_id": "c297bb8e-6eef-37da-bfa6-27f36119ddad",
    "bank_account_id": "b5460136-22a9-3279-98f5-7b0533dda077",
    "customer_id": "81ea5082-0b9a-34ca-8916-86b43a399730",
    "supplier_id": "e4862b74-2e00-33a4-ab98-08f003b7afde",
    "work_id": "0e8243f2-0126-3f37-aa02-208eb02fc8cf",
    "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 Dfd5ae1cZPEka6v86hb43gV

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
cash_session_id   string     

Cash session id. The uuid of an existing record in the cash_sessions table. Example: dbd2f98a-c205-35d0-912d-3980d6157187

transaction_category_id   string  optional    

Transaction category id. The uuid of an existing record in the transaction_categories table. Example: c297bb8e-6eef-37da-bfa6-27f36119ddad

bank_account_id   string  optional    

Bank account id. The uuid of an existing record in the bank_accounts table. Example: b5460136-22a9-3279-98f5-7b0533dda077

customer_id   string  optional    

Customer id. The uuid of an existing record in the customers table. Example: 81ea5082-0b9a-34ca-8916-86b43a399730

supplier_id   string  optional    

Supplier id. The uuid of an existing record in the suppliers table. Example: e4862b74-2e00-33a4-ab98-08f003b7afde

work_id   string  optional    

Work id. The uuid of an existing record in the works table. Example: 0e8243f2-0126-3f37-aa02-208eb02fc8cf

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

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

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

Example response (200):


{
    "data": {
        "id": "45c7f0e2-4c35-3762-bd91-0d54d811e3e8",
        "code": "FC-10705303",
        "type": "transferência",
        "amount": -5320.95,
        "description": "Eum minus fuga voluptatibus libero.",
        "transaction_date": "2002-03-09T03: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 dk646hac1D3Pvaeb5fVgZ8E

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

cashFlow   integer     

Example: 3

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/14" \
    --header "Authorization: Bearer kcab5DVd6hg3Ev4PZe18fa6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"type\": \"Example Type\",
    \"cash_session_id\": \"2a9b7c19-3e2b-3154-97f6-ec1dcf8d9c24\",
    \"transaction_category_id\": \"c6b05339-11ce-3689-8605-c6d47e9ff8c6\",
    \"bank_account_id\": \"8b0abb57-dfca-3040-9a3d-e93542bcc76e\",
    \"customer_id\": \"8e6733e6-ccdf-33f4-abc7-25e64d8290d0\",
    \"supplier_id\": \"175aa39a-0f77-3f85-a772-d92dda522163\",
    \"work_id\": \"0196683d-a5a8-30d0-a073-7f6c1f7aa8cb\",
    \"amount\": 1,
    \"description\": \"Example Description\",
    \"transaction_date\": \"2024-01-01\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cash-flows/14"
);

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

let body = {
    "type": "Example Type",
    "cash_session_id": "2a9b7c19-3e2b-3154-97f6-ec1dcf8d9c24",
    "transaction_category_id": "c6b05339-11ce-3689-8605-c6d47e9ff8c6",
    "bank_account_id": "8b0abb57-dfca-3040-9a3d-e93542bcc76e",
    "customer_id": "8e6733e6-ccdf-33f4-abc7-25e64d8290d0",
    "supplier_id": "175aa39a-0f77-3f85-a772-d92dda522163",
    "work_id": "0196683d-a5a8-30d0-a073-7f6c1f7aa8cb",
    "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 kcab5DVd6hg3Ev4PZe18fa6

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

cashFlow   integer     

Example: 14

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
cash_session_id   string  optional    

Cash session id. The uuid of an existing record in the cash_sessions table. Example: 2a9b7c19-3e2b-3154-97f6-ec1dcf8d9c24

transaction_category_id   string  optional    

Transaction category id. The uuid of an existing record in the transaction_categories table. Example: c6b05339-11ce-3689-8605-c6d47e9ff8c6

bank_account_id   string  optional    

Bank account id. The uuid of an existing record in the bank_accounts table. Example: 8b0abb57-dfca-3040-9a3d-e93542bcc76e

customer_id   string  optional    

Customer id. The uuid of an existing record in the customers table. Example: 8e6733e6-ccdf-33f4-abc7-25e64d8290d0

supplier_id   string  optional    

Supplier id. The uuid of an existing record in the suppliers table. Example: 175aa39a-0f77-3f85-a772-d92dda522163

work_id   string  optional    

Work id. The uuid of an existing record in the works table. Example: 0196683d-a5a8-30d0-a073-7f6c1f7aa8cb

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

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

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

cashFlow   integer     

Example: 15

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

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

Example response (200):


{
    "data": [
        {
            "id": "cab5c1e4-8a02-388a-b2ad-c490feb94289",
            "code": null,
            "opened_by": null,
            "opened_at": "1998-05-02T12:50:25.000000Z",
            "closed_by": null,
            "closed_at": "1984-06-04T06:53:22.000000Z",
            "opening_balance": 6560.07,
            "closing_balance": 3684.97,
            "total_income": 0,
            "total_expense": 0,
            "total_balance": 0,
            "status": "Fechado",
            "created_at": "2020-03-15T02:21:23.000000Z",
            "updated_at": "2012-11-05T23:54:32.000000Z"
        },
        {
            "id": "30a6cf9f-9e74-3694-8e0e-dbf4562ffeca",
            "code": null,
            "opened_by": null,
            "opened_at": "2011-01-04T08:57:31.000000Z",
            "closed_by": null,
            "closed_at": "1989-12-05T07:56:27.000000Z",
            "opening_balance": 6580.36,
            "closing_balance": 111.79,
            "total_income": 0,
            "total_expense": 0,
            "total_balance": 0,
            "status": "Aberto",
            "created_at": "2023-03-19T02:43:08.000000Z",
            "updated_at": "1983-11-03T19:37:46.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 1g4bDavEk5VadcP8hf3e6Z6

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

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

Example response (200):


{
    "data": {
        "id": "20204c5a-450d-376b-9763-48971c61a9df",
        "code": null,
        "opened_by": null,
        "opened_at": "1971-12-27T12:46:35.000000Z",
        "closed_by": null,
        "closed_at": "2004-01-01T17:24:34.000000Z",
        "opening_balance": 5084.01,
        "closing_balance": 7431.26,
        "total_income": 0,
        "total_expense": 0,
        "total_balance": 0,
        "status": "Aberto",
        "created_at": "2004-05-28T01:12:27.000000Z",
        "updated_at": "1975-12-03T23:45:52.000000Z"
    }
}
 

Request      

POST api/cash-sessions/open

Headers

Authorization        

Example: Bearer 4hcd8a16DaV3PZge6fbvEk5

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/7195b0e7-4283-317d-adad-2b69857c2fdb" \
    --header "Authorization: Bearer g3Vfceav8akdD1EhP46Z65b" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cash-sessions/close/7195b0e7-4283-317d-adad-2b69857c2fdb"
);

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

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

uuid   string     

Example: 7195b0e7-4283-317d-adad-2b69857c2fdb

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/ebe19618-6df4-3a3f-bde6-f52c79756c4a" \
    --header "Authorization: Bearer bd68D4aEc1vZ3hk5Pga6Vef" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cash-sessions/ebe19618-6df4-3a3f-bde6-f52c79756c4a"
);

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

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

Example response (200):


{
    "data": {
        "id": "fe42e45b-5adf-3d7d-8389-6c2364bbeaf1",
        "code": null,
        "opened_by": null,
        "opened_at": "1970-12-02T14:28:52.000000Z",
        "closed_by": null,
        "closed_at": "2011-12-22T09:59:16.000000Z",
        "opening_balance": 7256.76,
        "closing_balance": 3796.67,
        "total_income": 0,
        "total_expense": 0,
        "total_balance": 0,
        "status": "Aberto",
        "created_at": "2021-12-31T17:49:23.000000Z",
        "updated_at": "1999-05-31T17:04:05.000000Z"
    }
}
 

Request      

GET api/cash-sessions/{uuid}

Headers

Authorization        

Example: Bearer bd68D4aEc1vZ3hk5Pga6Vef

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

uuid   integer     

Example: ebe19618-6df4-3a3f-bde6-f52c79756c4a

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/73c2a009-8a2f-3fbc-b513-ed6b5442e7d6" \
    --header "Authorization: Bearer bv61a4kZVgDce365dPafE8h" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/cash-sessions/73c2a009-8a2f-3fbc-b513-ed6b5442e7d6"
);

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

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

uuid   integer     

Example: 73c2a009-8a2f-3fbc-b513-ed6b5442e7d6

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

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

Example response (200):


{
    "data": [
        {
            "id": "5f62bc82-4b08-3c33-a637-26e83d343bfe",
            "name": "André Cruz Filho",
            "email": "kserna@example.net",
            "phone": "(14) 4830-5586",
            "document": "637.575.497-67",
            "type": "pj",
            "responsible": "Emiliano Rosa Maldonado",
            "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": "ce52d755-a812-3b1e-9e25-4e65d7370491",
            "name": "Gabriel Kléber Meireles",
            "email": "dasilva.pablo@example.net",
            "phone": "(82) 98624-7655",
            "document": "324.497.262-41",
            "type": "pj",
            "responsible": "Hernani Soto",
            "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 kEP5bDdhV6eac34vfa1Z6g8

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

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

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

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

Example response (200):


{
    "data": {
        "id": "999e49be-2f47-3599-914b-573b2c24b03d",
        "name": "Benício Dias Sobrinho",
        "email": "pablo00@example.net",
        "phone": "(28) 3285-5081",
        "document": "678.091.504-13",
        "type": "pf",
        "responsible": "Stephany Galindo Queirós 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 3e1fahcPgZ5D6bd68aEv4kV

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the customer. Example: 2

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/19" \
    --header "Authorization: Bearer 4vEaa5PkDe6fdgch318VZ6b" \
    --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/19"
);

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

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the customer. Example: 19

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

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

customer   string     

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

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

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

Example response (200):


{
    "data": [
        {
            "id": "ef97ae9f-0484-3bf7-b427-701d34f27c7a",
            "name": "Sr. Aaron Walter Amaral Neto",
            "description": "Sint et iste officia enim commodi rerum maiores accusamus. Laborum rerum necessitatibus itaque deleniti facilis. Consequuntur quia nostrum ipsum voluptatem dicta.",
            "module": "document"
        },
        {
            "id": "e7535aff-3ae5-36ac-96c6-d45d5f696f47",
            "name": "Sra. Allison Domingues Montenegro",
            "description": "Itaque labore suscipit nisi consequatur similique at qui sint. Ut similique aut rem quia velit qui. Numquam dolores eum id aliquam.",
            "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 83Vv6EdcPgbZfha1e4Dk65a

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/dolorem" \
    --header "Authorization: Bearer vE1a6b4DfedP5g3ca8ZV6kh" \
    --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 vE1a6b4DfedP5g3ca8ZV6kh",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

Example response (200):


{
    "data": {
        "id": "a1cc9b47-742d-3d36-879c-16a81eb62034",
        "name": "Srta. Sofia Souza Pereira Sobrinho",
        "description": "Doloremque repellat ab a et sed molestias. Maiores voluptates eaque dicta quam dolorum nostrum. In sit similique temporibus soluta omnis quis id. Ut cumque velit qui sit quam.",
        "module": "document"
    }
}
 

Request      

GET api/document-categories/{documentCategory}

Headers

Authorization        

Example: Bearer vE1a6b4DfedP5g3ca8ZV6kh

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

documentCategory   string     

Document category UUID Example: dolorem

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

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

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

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

documentCategory   string     

Document category UUID Example: quos

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

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

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

documentCategory   string     

Document category UUID Example: doloribus

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[]=dignissimos&documentable_type=eum&customers[]=veniam&suppliers[]=harum" \
    --header "Authorization: Bearer 1hZEfgc5PVa4k6aDb6v83ed" \
    --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]": "dignissimos",
    "documentable_type": "eum",
    "customers[0]": "veniam",
    "suppliers[0]": "harum",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

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

Example response (200):


{
    "data": [
        {
            "id": "480557a9-c056-325b-a7b2-d02381507f50",
            "name": "Sra. Janaina Zambrano Paz",
            "file": {
                "id": null,
                "url": null,
                "extension": null
            },
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "1cb192b4-b3ee-3159-b518-80ba26395b09",
            "name": "Dr. Simão Montenegro",
            "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 1hZEfgc5PVa4k6aDb6v83ed

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

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

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

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

Example response (200):


{
    "data": {
        "id": "829a1a1d-35ef-31b7-8b66-f8cc970b4d54",
        "name": "Carol de Souza Sobrinho",
        "file": {
            "id": null,
            "url": null,
            "extension": null
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/documents/{id}

Headers

Authorization        

Example: Bearer 8ecD3h1EkPVavd6abfZg456

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the document. Example: 16

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 6ae84Ekb6vdhZgP5DcVaf31" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"category_id\": \"dde85b18-f586-3c34-891e-347bfff1ced8\",
    \"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 6ae84Ekb6vdhZgP5DcVaf31",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "category_id": "dde85b18-f586-3c34-891e-347bfff1ced8",
    "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 6ae84Ekb6vdhZgP5DcVaf31

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: dde85b18-f586-3c34-891e-347bfff1ced8

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 Pda5b8vD63eV4ZE1hkgc6af" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"category_id\": \"3cd81c6f-93a2-3364-89bb-b305c3882391\",
    \"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 Pda5b8vD63eV4ZE1hkgc6af",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "category_id": "3cd81c6f-93a2-3364-89bb-b305c3882391",
    "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 Pda5b8vD63eV4ZE1hkgc6af

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: 3cd81c6f-93a2-3364-89bb-b305c3882391

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

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

document   string     

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

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

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

Example response (200):


{
    "data": [
        {
            "id": "9c3dc89e-3c98-48e3-8c41-e9d2de0808a7",
            "name": "molestias",
            "description": null,
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "ae2f6c5d-b6c5-4532-866e-3d09dbf24650",
            "name": "quaerat",
            "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 5fa1ZDekd84c6gbhaE63VPv

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

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

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

Example response (200):


{
    "data": {
        "id": "4a394740-817b-4474-9a62-24c064a096f3",
        "name": "ut",
        "description": null,
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/employee-roles/{employeeRole}

Headers

Authorization        

Example: Bearer 6e45gbdvVkfa86P3c1haEZD

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employeeRole   string     

Employee Role UUID Example: sit

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

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/fugit" \
    --header "Authorization: Bearer 66h38ZE4edPckaDfVvga1b5" \
    --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/fugit"
);

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

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employeeRole   string     

Employee Role UUID Example: fugit

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

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

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employeeRole   string     

Employee Role UUID Example: ipsa

Employees

Endpoints for employees

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

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

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

Example response (200):


{
    "data": [
        {
            "id": "cb30caf7-d508-49fd-ae8a-865a9354ce61",
            "name": "Dr. Pietra Vasques Carrara Filho",
            "cpf": "304.338.681-38",
            "rg": "972405109",
            "ctps": "661496770",
            "phone": null,
            "birthdate": null,
            "email": "pedro78@example.net",
            "address": {
                "street": null,
                "number": null,
                "complement": null,
                "neighborhood": null,
                "city": null,
                "state": null,
                "zip_code": null
            },
            "employee_role": {
                "id": null,
                "name": null
            },
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "7b8cfc4b-2c2c-423e-9493-51e57df13d73",
            "name": "Srta. Gisela Sepúlveda Neto",
            "cpf": "091.332.333-36",
            "rg": null,
            "ctps": "824381815",
            "phone": null,
            "birthdate": null,
            "email": "elis.carrara@example.com",
            "address": {
                "street": null,
                "number": null,
                "complement": null,
                "neighborhood": null,
                "city": null,
                "state": null,
                "zip_code": null
            },
            "employee_role": {
                "id": null,
                "name": 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/employees

Headers

Authorization        

Example: Bearer kcEdZ654bf1ha36DavgV8Pe

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

Show employee

requires authentication employee show

Show an employee

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

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

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

Example response (200):


{
    "data": {
        "id": "927b7352-c3d2-4ad2-a37b-1960e1a33c7c",
        "name": "Aurora Arruda Godói Neto",
        "cpf": "143.905.765-35",
        "rg": null,
        "ctps": null,
        "phone": "(12) 99825-8876",
        "birthdate": "1989-04-16",
        "email": null,
        "address": {
            "street": null,
            "number": null,
            "complement": null,
            "neighborhood": null,
            "city": null,
            "state": null,
            "zip_code": null
        },
        "employee_role": {
            "id": null,
            "name": null
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/employees/{id}

Headers

Authorization        

Example: Bearer 8c45aDE13hVZ6fbvPa6gked

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

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 h5g461aEkaPvdc6VD8bef3Z" \
    --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\": \"373476c8-fd35-4fbb-9a6e-3abbb01b49e1\",
    \"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 h5g461aEkaPvdc6VD8bef3Z",
    "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": "373476c8-fd35-4fbb-9a6e-3abbb01b49e1",
    "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/employees

Headers

Authorization        

Example: Bearer h5g461aEkaPvdc6VD8bef3Z

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: 373476c8-fd35-4fbb-9a6e-3abbb01b49e1

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/8" \
    --header "Authorization: Bearer 64EZbdDPkcafaV35ev861hg" \
    --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\": \"116910c4-9d65-46e9-a538-06a3ebf27f67\",
    \"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/8"
);

const headers = {
    "Authorization": "Bearer 64EZbdDPkcafaV35ev861hg",
    "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": "116910c4-9d65-46e9-a538-06a3ebf27f67",
    "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 64EZbdDPkcafaV35ev861hg

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the employee. Example: 8

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: 116910c4-9d65-46e9-a538-06a3ebf27f67

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

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employee   string     

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

Endpoints

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

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/fea75d01-16d5-3138-a750-e4f2a1edddba" \
    --header "Authorization: Bearer kh3d546g8Z6aDfEV1cbPeav" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/files/fea75d01-16d5-3138-a750-e4f2a1edddba"
);

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

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

uuid   integer     

Example: fea75d01-16d5-3138-a750-e4f2a1edddba

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/c7dffb24-ee7f-376a-abd9-8faf1ec01bfe/info" \
    --header "Authorization: Bearer vPZDkedaVh4gEb36ca6f581" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/files/c7dffb24-ee7f-376a-abd9-8faf1ec01bfe/info"
);

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

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

uuid   integer     

Example: c7dffb24-ee7f-376a-abd9-8faf1ec01bfe

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/7325a863-f921-36a4-80ea-541c9b4f5fb2/download" \
    --header "Authorization: Bearer 1f6Ev8VZag5P4Dh3k6abdec" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/files/7325a863-f921-36a4-80ea-541c9b4f5fb2/download"
);

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

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

uuid   string     

The UUID of the file to download Example: 7325a863-f921-36a4-80ea-541c9b4f5fb2

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 cvbV8afd35gZ4aDe6P16kEh" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"path\": \"Example Path\",
    \"mimetype\": \"Example Mimetype\",
    \"public\": false
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/files/generate-upload-url"
);

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

let body = {
    "path": "Example Path",
    "mimetype": "Example Mimetype",
    "public": false
};

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 cvbV8afd35gZ4aDe6P16kEh

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

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 kac6ZabdgDv5P4h6E8eV3f1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"files\": [
        {
            \"path\": \"Example Files * path\",
            \"mimetype\": \"Example Files * mimetype\",
            \"public\": false
        },
        null
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/files/generate-bulk-upload-url"
);

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

let body = {
    "files": [
        {
            "path": "Example Files * path",
            "mimetype": "Example Files * mimetype",
            "public": false
        },
        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 kac6ZabdgDv5P4h6E8eV3f1

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

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 ZaE6P5h3k46ac81dbeVvgfD" \
    --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\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/imports/nfe/products"
);

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

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 ZaE6P5h3k46ac81dbeVvgfD

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

List User Imports

requires authentication imports index

List all NFe imports for the authenticated user 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 4hdca8P3E6gZ1aefk5DvV6b" \
    --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 4hdca8P3E6gZ1aefk5DvV6b",
    "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 4hdca8P3E6gZ1aefk5DvV6b

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

const headers = {
    "Authorization": "Bearer hEae3bc1gvkf46DZ68daVP5",
    "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,
    "imported_by": "João Silva",
    "imported_at": "2023-12-01T10:30:00.000Z",
    "supplier": {
        "id": "supplier-uuid",
        "name": "Fornecedor Ltda",
        "document": "12345678000199"
    },
    "channel": "import-progress.9d2f8e4a-1b3c-4d5e-6f7a-8b9c0d1e2f3a"
}
 

Request      

GET api/imports/{importId}

Headers

Authorization        

Example: Bearer hEae3bc1gvkf46DZ68daVP5

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

importId   string     

Example: beatae

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

Request      

GET api/imports/{importId}/products

Headers

Authorization        

Example: Bearer aD4fa8gZk6ch5EP1b3Vvd6e

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

importId   string     

Example: necessitatibus

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

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/voluptatem/products/link" \
    --header "Authorization: Bearer 66PahfaeDgbEd14vkVZ358c" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"mappings\": [
        \"nulla\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/imports/voluptatem/products/link"
);

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

let body = {
    "mappings": [
        "nulla"
    ]
};

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"
}
 

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

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

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

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 483D5vfbh1gdkacZP6aVE6e" \
    --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 483D5vfbh1gdkacZP6aVE6e",
    "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 483D5vfbh1gdkacZP6aVE6e

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

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=vel&document=praesentium&work_id=a01edd80-bf3e-40f7-8613-ccb4be5831b3&bank_account_id=a01edd80-bf3e-40f7-8613-ccb4be5831b3" \
    --header "Authorization: Bearer 3Paa4be1k5DZ6dv6EgVf8hc" \
    --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": "vel",
    "document": "praesentium",
    "work_id": "a01edd80-bf3e-40f7-8613-ccb4be5831b3",
    "bank_account_id": "a01edd80-bf3e-40f7-8613-ccb4be5831b3",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

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

Example response (200):


{
    "data": [
        {
            "id": "c1506b4e-d810-3a7d-a702-e0aed365b6d9",
            "receipt_number": "REC-7417",
            "receiver_type": "custom",
            "receiver": {
                "id": null,
                "name": "Timmothy O'Connell MD",
                "document": "737.546.191-78"
            },
            "payment": {
                "amount": 8293.94,
                "amount_in_words": "Valor por extenso de teste",
                "method": "pix",
                "description": "Ea quis quia et laborum rerum dignissimos quo."
            },
            "issuer": {
                "name": "Koelpin Ltd",
                "document": "46.341.011/0544-57"
            },
            "issue": {
                "date": "2026-03-05",
                "city": "South Tommietown",
                "state": "RS"
            },
            "created_by": {
                "id": "a15683a1-7755-4704-8ca9-c9b5f5f739f4",
                "name": "Thalia Feeney"
            },
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "8b695a8c-576e-3f0f-aff0-7775df0d00c2",
            "receipt_number": "REC-6766",
            "receiver_type": "custom",
            "receiver": {
                "id": null,
                "name": "Ahmad Jones Jr.",
                "document": "145.908.267-74"
            },
            "payment": {
                "amount": 4032.31,
                "amount_in_words": "Valor por extenso de teste",
                "method": "cash",
                "description": "Impedit voluptas qui qui ipsum rerum."
            },
            "issuer": {
                "name": "Berge-Welch",
                "document": "42.641.227/4062-19"
            },
            "issue": {
                "date": "2026-03-01",
                "city": "Homenicktown",
                "state": "PR"
            },
            "created_by": {
                "id": "a15683a1-815d-4407-a24b-5c72d3f1d5d2",
                "name": "Karlee Hegmann"
            },
            "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 3Paa4be1k5DZ6dv6EgVf8hc

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

sort_by   string  optional    

Field to sort by. Example: created_at

sort_desc   boolean  optional    

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

page   integer  optional    

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

per_page   integer  optional    

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

q   string  optional    

Search query (searches in receiver name, document, and receipt number). Example: João Silva

employee_id   string  optional    

Filter by employee UUID. The uuid of an existing record in the employees table. Example: a01edd80-bf3e-40f7-8613-ccb4be5831b3

receiver_type   string  optional    

Filter by receiver type. Example: employee

Must be one of:
  • employee
  • custom
start_date   string  optional    

Filter by issue date (start). O campo value deve ser uma data válida. Example: 2025-01-01

end_date   string  optional    

Filter by issue date (end). O campo value deve ser uma data válida. O campo value deve ser uma data posterior ou igual a start_date. Example: 2025-12-31

min_amount   number  optional    

Filter by minimum amount. O campo value deve ser pelo menos 0. Example: 100

max_amount   number  optional    

Filter by maximum amount. O campo value deve ser pelo menos 0. Example: 1000

payment_method   string  optional    

Filter by payment method. Example: PIX

city   string  optional    

Filter by city. Example: São Paulo

search   string  optional    

Example: vel

document   string  optional    

Example: praesentium

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

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

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

Example response (200):


{
    "data": {
        "id": "f9930629-6487-3795-82bc-63504809230a",
        "receipt_number": "REC-6769",
        "receiver_type": "custom",
        "receiver": {
            "id": null,
            "name": "Sofia Labadie",
            "document": "998.779.882-18"
        },
        "payment": {
            "amount": 9752.69,
            "amount_in_words": "Valor por extenso de teste",
            "method": "cash",
            "description": "Dolore vel fugit veniam harum architecto aut."
        },
        "issuer": {
            "name": "Muller Group",
            "document": "39.938.944/7392-33"
        },
        "issue": {
            "date": "2026-03-03",
            "city": "New Katelynborough",
            "state": "PR"
        },
        "created_by": {
            "id": "a15683a1-8874-4b83-9f32-a5de95cd2f2c",
            "name": "Dr. Cortez Hayes DVM"
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/payment-receipts/{receipt}

Headers

Authorization        

Example: Bearer hd84E5Vak1fe36aZPg6bcvD

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 PEd8hav51V3Dcfa6be6gkZ4" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"receiver_type\": \"Example Receiver type\",
    \"employee_id\": \"354fd8a0-0518-46f2-ba7e-de37f0264c03\",
    \"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\": \"de93338a-455c-31fb-a164-abb0084c0e95\",
    \"bank_account_id\": \"0bb00308-c467-3130-8700-b492e9d97bc2\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/payment-receipts"
);

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

let body = {
    "receiver_type": "Example Receiver type",
    "employee_id": "354fd8a0-0518-46f2-ba7e-de37f0264c03",
    "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": "de93338a-455c-31fb-a164-abb0084c0e95",
    "bank_account_id": "0bb00308-c467-3130-8700-b492e9d97bc2"
};

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 PEd8hav51V3Dcfa6be6gkZ4

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

receiver_type   string     

Tipo de Recebedor. Example: Example Receiver type

Must be one of:
  • employee
  • custom
employee_id   string  optional    

Funcionário. This field is required when receiver_type is employee. The uuid of an existing record in the employees table. Example: 354fd8a0-0518-46f2-ba7e-de37f0264c03

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: de93338a-455c-31fb-a164-abb0084c0e95

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: 0bb00308-c467-3130-8700-b492e9d97bc2

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 v6DdE85cg4efVhaZb1k3Pa6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"receiver_type\": \"Example Receiver type\",
    \"employee_id\": \"2af50117-6a42-474a-8c95-915ddcc65333\",
    \"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\": \"2884c208-8911-3604-9881-991171a0a0a7\",
    \"bank_account_id\": \"14641154-25bf-37e0-8637-b5e6579bd55b\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/payment-receipts/019556e7-2e9f-777c-a177-30bbf0646c32"
);

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

let body = {
    "receiver_type": "Example Receiver type",
    "employee_id": "2af50117-6a42-474a-8c95-915ddcc65333",
    "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": "2884c208-8911-3604-9881-991171a0a0a7",
    "bank_account_id": "14641154-25bf-37e0-8637-b5e6579bd55b"
};

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 v6DdE85cg4efVhaZb1k3Pa6

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

receipt   string     

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

Body Parameters

receiver_type   string  optional    

Tipo de Recebedor. Example: Example Receiver type

Must be one of:
  • employee
  • custom
employee_id   string  optional    

Funcionário. This field is required when receiver_type is employee. The uuid of an existing record in the employees table. Example: 2af50117-6a42-474a-8c95-915ddcc65333

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: 2884c208-8911-3604-9881-991171a0a0a7

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: 14641154-25bf-37e0-8637-b5e6579bd55b

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

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

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

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

Example response (200):


{
    "data": [
        {
            "id": "eb8fed49-a31a-30f3-b69b-d30b2579b7ba",
            "receipt_number": "REC-1958",
            "receiver_type": "custom",
            "receiver": {
                "id": null,
                "name": "Prof. Eldon Weissnat II",
                "document": "833.825.457-42"
            },
            "payment": {
                "amount": 6736.92,
                "amount_in_words": "Valor por extenso de teste",
                "method": "cash",
                "description": "Inventore consequuntur dolor debitis reiciendis laborum impedit."
            },
            "issuer": {
                "name": "Crooks, Bergstrom and Konopelski",
                "document": "44.886.624/9025-11"
            },
            "issue": {
                "date": "2026-02-27",
                "city": "Gottliebville",
                "state": "SP"
            },
            "created_by": {
                "id": "a15683a1-9ed4-433b-afe8-b7708b060819",
                "name": "Miss Camylle King"
            },
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "a272aced-2dc9-3df9-9ca6-1eac2062b9aa",
            "receipt_number": "REC-1010",
            "receiver_type": "custom",
            "receiver": {
                "id": null,
                "name": "Raegan Heidenreich II",
                "document": "784.600.769-90"
            },
            "payment": {
                "amount": 7075.22,
                "amount_in_words": "Valor por extenso de teste",
                "method": "cash",
                "description": "Omnis voluptatem iste harum a neque."
            },
            "issuer": {
                "name": "Quitzon, Kreiger and Nader",
                "document": "89.360.379/0501-77"
            },
            "issue": {
                "date": "2026-03-12",
                "city": "Sanfordmouth",
                "state": "MG"
            },
            "created_by": {
                "id": "a15683a1-a15c-470d-9064-1791bab81bb9",
                "name": "Daphnee Koelpin"
            },
            "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 vbfh8dPD5aEgea1k3c6Z4V6

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

employee_id   integer     

The ID of the employee. Example: 7

employee   string     

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

Permission Groups

Endpoints for permission groups

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

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

Example response (200):


{
    "data": [
        {
            "id": "f2c2866e-836d-32fb-a083-9640c4c82e87",
            "name": "dolor-excepturi",
            "display_name": "magnam id aliquid",
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "aa29d44c-4b4d-3789-8a1d-c2031bded339",
            "name": "quis-in",
            "display_name": "eius quidem unde",
            "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 1fPVe5Z8d6hakE4agbc36vD

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

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

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

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

Example response (200):


{
    "data": {
        "id": "271872f1-8aa0-3724-8497-bc45d3600ff7",
        "name": "debitis-dolorem",
        "display_name": "distinctio aut vitae",
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/permission-groups/{permissionGroup}

Headers

Authorization        

Example: Bearer d465k18a6Vc3EbegDhfvZaP

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

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

permissionGroup   integer     

Example: 1

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

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

Example response (200):


{
    "data": [
        {
            "id": "c8532708-5fd6-383a-8452-b9dd71361ae1",
            "name": "Dr. Eliane Santos",
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "a2a1562c-0643-30f5-8eb3-6145c30be9b4",
            "name": "Fátima Balestero Jr.",
            "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 hfD4V6adEkvP3eagZ8cb165

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

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

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

Example response (200):


{
    "data": {
        "id": "ce116639-4060-33e5-b7be-148f7d35e2ac",
        "name": "Dr. Saulo Renan Padrão",
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/product-brands/{productBrand}

Headers

Authorization        

Example: Bearer fP8Z4c6ea3g5VhbD61Edkav

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productBrand   string     

Product brand UUID Example: ut

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

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

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

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productBrand   string     

Product brand UUID Example: est

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

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

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productBrand   string     

Product brand UUID Example: consequatur

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?q=Structure" \
    --header "Authorization: Bearer 8DZ5fkve3hda6bgE4PV1c6a" \
    --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 = {
    "q": "Structure",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

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

Example response (200):


{
    "data": [
        {
            "id": "7c2eed1c-b112-3af7-8f20-3392cca2b8a7",
            "name": "Sr. Juan Furtado",
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "4efd71f3-f7fb-3ff1-852b-54d7462b2721",
            "name": "Srta. Mônica Ortiz Carmona Filho",
            "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 8DZ5fkve3hda6bgE4PV1c6a

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

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

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

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

Example response (200):


{
    "data": {
        "id": "7136faf2-55b2-314a-a426-06f5c6829d44",
        "name": "Dr. Camila Mendes Assunção",
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/product-families/{productFamily}

Headers

Authorization        

Example: Bearer 13fcavaDV8d6ek45Ehg6ZbP

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productFamily   string     

Product family UUID Example: ratione

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 b6ZDk6dcahg35EvVf4P1ae8" \
    --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-families"
);

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

Headers

Authorization        

Example: Bearer b6ZDk6dcahg35EvVf4P1ae8

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Nome. Example: Example Name

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/qui" \
    --header "Authorization: Bearer VZE6fg1aeh3a846vckPDbd5" \
    --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-families/qui"
);

const headers = {
    "Authorization": "Bearer VZE6fg1aeh3a846vckPDbd5",
    "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-families/{productFamily}

Headers

Authorization        

Example: Bearer VZE6fg1aeh3a846vckPDbd5

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productFamily   string     

Product family UUID Example: qui

Body Parameters

name   string     

Nome. Example: Example Name

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

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

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productFamily   string     

Product family UUID Example: qui

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 vcf81k6dEZbaha6VPe45gD3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"q\": \"Example Q\",
    \"work_id\": \"a02a3451-0119-3d95-813e-6729c2f150ce\",
    \"user_id\": \"8720cea6-57ec-344e-8f36-876d4621712e\",
    \"responsible_id\": \"a9035e97-1fa2-3472-bc83-b892e6e0c718\",
    \"per_page\": 1,
    \"sort\": \"Example Sort\",
    \"sort_desc\": false
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-quantity-lists"
);

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

let body = {
    "q": "Example Q",
    "work_id": "a02a3451-0119-3d95-813e-6729c2f150ce",
    "user_id": "8720cea6-57ec-344e-8f36-876d4621712e",
    "responsible_id": "a9035e97-1fa2-3472-bc83-b892e6e0c718",
    "per_page": 1,
    "sort": "Example Sort",
    "sort_desc": false
};

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

Example response (200):


{
    "data": [
        {
            "id": "e6c319a3-2a54-35f9-8fa2-e4e37530eb73",
            "name": "Maxime et.",
            "description": null,
            "work": {
                "id": "a15683a2-1aa4-42bc-9a14-1234007e93f0",
                "name": "Mirela Mendes Sobrinho"
            },
            "user": {
                "id": "a15683a2-2079-41dd-8830-2586a6a2b295",
                "name": "Anibal Bartell"
            },
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "44836da1-17c1-3d02-a66d-a87d41799a7b",
            "name": "Numquam dolore quia iusto.",
            "description": "Iure eius dolorem ut repudiandae. Quia doloremque vel et dolores voluptatum aut. Doloremque possimus et ipsa voluptatem quis magnam.",
            "work": {
                "id": "a15683a2-2582-453d-b0a6-02f5dc9d7528",
                "name": "Artur Rivera Jr."
            },
            "user": {
                "id": "a15683a2-2825-40f5-abd4-889cbae41f44",
                "name": "Gretchen Miller"
            },
            "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 vcf81k6dEZbaha6VPe45gD3

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: a02a3451-0119-3d95-813e-6729c2f150ce

user_id   string  optional    

Usuário. The uuid of an existing record in the users table. Example: 8720cea6-57ec-344e-8f36-876d4621712e

responsible_id   string  optional    

Responsável. The uuid of an existing record in the users table. Example: a9035e97-1fa2-3472-bc83-b892e6e0c718

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

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

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

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

Example response (200):


{
    "data": {
        "id": "fc39723c-27dc-3ef2-9ac0-b786d38fa687",
        "name": "Hic nemo accusamus dignissimos.",
        "description": "Dolorem non deleniti sunt tempore inventore iusto. Magni magnam placeat praesentium omnis aut ut libero. Veritatis suscipit odio amet aut ea quia.",
        "work": {
            "id": "a15683a2-2e3f-4b47-a1cd-2531b3d73ede",
            "name": "Sr. Evandro Franco Faria Jr."
        },
        "user": {
            "id": "a15683a2-311b-4d43-964e-37f060baa456",
            "name": "Therese Renner"
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/product-quantity-lists/{productQuantityList}

Headers

Authorization        

Example: Bearer fvb31Va8k4ZPdEg56each6D

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productQuantityList   string     

Product Quantity List UUID Example: excepturi

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/dolorem/items" \
    --header "Authorization: Bearer k6d83ZDfgh15VEevcPab6a4" \
    --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/dolorem/items"
);

const headers = {
    "Authorization": "Bearer k6d83ZDfgh15VEevcPab6a4",
    "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": "edfb61d1-dd8a-3fb5-8af8-269a0ea631f8",
            "product": {
                "id": "a15683a2-4718-40db-a4a8-96dc8c661b21",
                "name": "Srta. Isabel Burgos Grego",
                "code": "PRD-787880",
                "unit": {
                    "id": "a15683a2-450a-49c2-8fbe-28343618df3f",
                    "name": "Nero Pedro Urias",
                    "abbreviation": "Adriel Serrano Neto"
                }
            },
            "quantity": 26.8669,
            "observation": "Et et quia expedita.",
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "40cc76ad-f4ba-394e-8020-e0c44e52baf9",
            "product": {
                "id": "a15683a2-5cf1-4d80-8e1c-ff6fe4cd94bb",
                "name": "Ronaldo Gil Benez",
                "code": "PRD-259004",
                "unit": {
                    "id": "a15683a2-5bb9-434c-931f-63f56f88ab16",
                    "name": "Srta. Kamila Rivera Perez",
                    "abbreviation": "Sr. Thales Saraiva Bonilha Jr."
                }
            },
            "quantity": 500.1374,
            "observation": null,
            "created_at": null,
            "updated_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/product-quantity-lists/{productQuantityList}/items

Headers

Authorization        

Example: Bearer k6d83ZDfgh15VEevcPab6a4

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productQuantityList   string     

Product Quantity List UUID Example: dolorem

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 E68h46cPDVv15bdk3Zafega" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"description\": \"Example Description\",
    \"work_id\": \"448c6ba0-ff7d-3041-ba1e-da37bb8f8848\",
    \"items\": [
        {
            \"product_id\": \"5c9cdf6c-6cf9-3dc0-9466-4ad1045178ce\",
            \"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 E68h46cPDVv15bdk3Zafega",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "description": "Example Description",
    "work_id": "448c6ba0-ff7d-3041-ba1e-da37bb8f8848",
    "items": [
        {
            "product_id": "5c9cdf6c-6cf9-3dc0-9466-4ad1045178ce",
            "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 E68h46cPDVv15bdk3Zafega

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: 448c6ba0-ff7d-3041-ba1e-da37bb8f8848

items   object[]  optional    

Itens.

product_id   string     

Produto. The uuid of an existing record in the products table. Example: 5c9cdf6c-6cf9-3dc0-9466-4ad1045178ce

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/optio" \
    --header "Authorization: Bearer kv6g438eVPEZdabf516Dcah" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"description\": \"Example Description\",
    \"items\": [
        {
            \"id\": \"dcc99ff2-18eb-3111-8d2e-d9f2b1e583da\",
            \"product_id\": \"81b99baf-871d-3487-a6b2-c444a2b041ee\",
            \"quantity\": 1,
            \"observation\": \"Example Items * observation\"
        },
        null
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-quantity-lists/optio"
);

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

let body = {
    "name": "Example Name",
    "description": "Example Description",
    "items": [
        {
            "id": "dcc99ff2-18eb-3111-8d2e-d9f2b1e583da",
            "product_id": "81b99baf-871d-3487-a6b2-c444a2b041ee",
            "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 kv6g438eVPEZdabf516Dcah

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productQuantityList   string     

Product Quantity List UUID Example: optio

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: dcc99ff2-18eb-3111-8d2e-d9f2b1e583da

product_id   string     

Produto. The uuid of an existing record in the products table. Example: 81b99baf-871d-3487-a6b2-c444a2b041ee

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

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

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productQuantityList   string     

Product Quantity List UUID Example: sint

Add items to list

requires authentication product-quantity-list update

Add one or more product items to the list

Example request:
curl --request POST \
    "https://api.bs-homolog.pensou.app.br/api/product-quantity-lists/autem/items" \
    --header "Authorization: Bearer DP1vgb5a436VdhE8fe6kaZc" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"items\": [
        {
            \"product_id\": \"8818cac0-cfa6-31f5-8ba6-36ec45090aa8\",
            \"quantity\": 1,
            \"observation\": \"Example Items * observation\"
        },
        null
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-quantity-lists/autem/items"
);

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

let body = {
    "items": [
        {
            "product_id": "8818cac0-cfa6-31f5-8ba6-36ec45090aa8",
            "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 DP1vgb5a436VdhE8fe6kaZc

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productQuantityList   string     

Product Quantity List UUID Example: autem

Body Parameters

items   object[]     

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

product_id   string     

Produto. The uuid of an existing record in the products table. Example: 8818cac0-cfa6-31f5-8ba6-36ec45090aa8

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

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

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the item. Example: consequatur

item   string     

Product Quantity List Item UUID Example: sunt

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/et/items" \
    --header "Authorization: Bearer fZ3g86dvbc1DkeV4a5aEh6P" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"items\": [
        \"43ecc353-3039-34eb-9287-b4f1a274d32d\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-quantity-lists/et/items"
);

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

let body = {
    "items": [
        "43ecc353-3039-34eb-9287-b4f1a274d32d"
    ]
};

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 fZ3g86dvbc1DkeV4a5aEh6P

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productQuantityList   string     

Product Quantity List UUID Example: et

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/quae/sync-items" \
    --header "Authorization: Bearer Dcdhea38v6a16PVkg54ZfbE" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"items\": [
        {
            \"id\": \"e8a95629-568e-3541-b756-b984e825421e\",
            \"product_id\": \"be6df36f-2202-36d9-8c96-e451adb345f5\",
            \"quantity\": 1,
            \"observation\": \"Example Items * observation\"
        },
        null
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-quantity-lists/quae/sync-items"
);

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

let body = {
    "items": [
        {
            "id": "e8a95629-568e-3541-b756-b984e825421e",
            "product_id": "be6df36f-2202-36d9-8c96-e451adb345f5",
            "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 Dcdhea38v6a16PVkg54ZfbE

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productQuantityList   string     

Product Quantity List UUID Example: quae

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: e8a95629-568e-3541-b756-b984e825421e

product_id   string     

Produto. The uuid of an existing record in the products table. Example: be6df36f-2202-36d9-8c96-e451adb345f5

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/fuga/fulfill" \
    --header "Authorization: Bearer 13P6EfVe568hagkaZDv4dbc" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"fulfillment_type\": \"Example Fulfillment type\",
    \"stock_id\": \"f8b9cb98-d642-3775-8cb6-ec5a3ed8d058\",
    \"quantity\": 1,
    \"source_stock_id\": \"73815ff9-d7d1-3b6f-a47b-58d0bdffb9a7\",
    \"reason\": \"Example Reason\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-requests/items/fuga/fulfill"
);

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

let body = {
    "fulfillment_type": "Example Fulfillment type",
    "stock_id": "f8b9cb98-d642-3775-8cb6-ec5a3ed8d058",
    "quantity": 1,
    "source_stock_id": "73815ff9-d7d1-3b6f-a47b-58d0bdffb9a7",
    "reason": "Example Reason"
};

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 13P6EfVe568hagkaZDv4dbc

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

item   string     

Product Request Item UUID Example: fuga

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: f8b9cb98-d642-3775-8cb6-ec5a3ed8d058

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: 73815ff9-d7d1-3b6f-a47b-58d0bdffb9a7

reason   string  optional    

Motivo. O campo value não pode ser superior a 500 caracteres. Example: Example Reason

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/ipsa/fulfillments" \
    --header "Authorization: Bearer kvEP8V6cfbhaZg1D5d43a6e" \
    --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/ipsa/fulfillments"
);

const headers = {
    "Authorization": "Bearer kvEP8V6cfbhaZg1D5d43a6e",
    "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": "47fd56e3-6b14-3db6-86ea-81205dfbd8c3",
            "quantity": 30.0353,
            "fulfilled_at": "2026-03-09T10:11:16.000000Z",
            "created_at": null
        },
        {
            "id": "062856ba-8b4f-3347-a630-25e1c0aac8ac",
            "quantity": 12.39,
            "fulfilled_at": "2026-02-19T15:04:30.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 kvEP8V6cfbhaZg1D5d43a6e

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

item   string     

Product Request Item UUID Example: ipsa

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

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

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

Example response (200):


{
    "data": {
        "id": "21768133-82b5-31df-b551-e686e98aee98",
        "product": {
            "id": "a15683a6-5e18-4917-a499-b06ed2381ce5",
            "name": "Dr. Téo Neves Sobrinho",
            "code": "PRD-866297",
            "unit": {
                "id": "a15683a6-5cc6-4088-9dfe-82e4f4f78048",
                "name": "Clarice Abgail Guerra Sobrinho",
                "abbreviation": "Srta. Julieta Sepúlveda Neto"
            }
        },
        "quantity": 693.8267,
        "quantity_fulfilled": 0,
        "quantity_pending": 693.8267,
        "is_fulfilled": false,
        "is_partially_fulfilled": false,
        "observation": "Nobis harum odit provident impedit.",
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/product-requests/items/{id}

Headers

Authorization        

Example: Bearer h1EdkPcf4V3vgb8ZD6aa56e

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the item. Example: cum

item   string     

Product Request Item UUID Example: voluptatibus

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/doloribus/pending-items" \
    --header "Authorization: Bearer 6hf41dg5kca3vDEVbe68PaZ" \
    --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/doloribus/pending-items"
);

const headers = {
    "Authorization": "Bearer 6hf41dg5kca3vDEVbe68PaZ",
    "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": "10d4b706-d4ec-35c0-acac-f1f4f02c768f",
            "product": {
                "id": "a15683a6-7408-4e0d-8ff6-d9a6204c4e25",
                "name": "André Gomes Pereira",
                "code": "PRD-049114",
                "unit": {
                    "id": "a15683a6-72a5-4e66-b1f5-e6f0fbe2dd42",
                    "name": "Dr. Isis Cristina Bittencourt",
                    "abbreviation": "Allison Mirella Prado"
                }
            },
            "quantity": 648.6636,
            "quantity_fulfilled": 0,
            "quantity_pending": 648.6636,
            "is_fulfilled": false,
            "is_partially_fulfilled": false,
            "observation": "Odit sunt ipsum repudiandae temporibus at similique est.",
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "576bbb65-fe62-3cd7-9ce9-e8a277f0b751",
            "product": {
                "id": "a15683a6-85de-4735-96a6-ef13d5b302d3",
                "name": "Daniella Aline Galhardo Jr.",
                "code": "PRD-633063",
                "unit": {
                    "id": "a15683a6-847e-44bd-832d-50034a519d45",
                    "name": "Sr. Sebastião Francisco Guerra Jr.",
                    "abbreviation": "Carlos Mendonça das Dores Filho"
                }
            },
            "quantity": 944.9236,
            "quantity_fulfilled": 0,
            "quantity_pending": 944.9236,
            "is_fulfilled": false,
            "is_partially_fulfilled": false,
            "observation": "Ratione officiis laborum eum minima.",
            "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 6hf41dg5kca3vDEVbe68PaZ

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productRequest   string     

Product Request UUID Example: doloribus

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

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

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

Example response (200):


{
    "data": [
        {
            "id": "77c5d898-af78-3531-ad3c-f4aaa2807ac8",
            "product": {
                "id": "a15683a6-9d14-45c2-b5e0-8356f837e06c",
                "name": "Emilly Lira Aguiar Jr.",
                "code": "PRD-863488",
                "unit": {
                    "id": "a15683a6-9ba9-4e06-8687-663cdf4efb29",
                    "name": "Ketlin Valente",
                    "abbreviation": "Sr. Bruno Fontes Quintana"
                }
            },
            "quantity": 910.0893,
            "quantity_fulfilled": 0,
            "quantity_pending": 910.0893,
            "is_fulfilled": false,
            "is_partially_fulfilled": false,
            "observation": null,
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "eef7e969-4ee9-3844-bf90-5aa34f1cf557",
            "product": {
                "id": "a15683a6-afeb-49c4-a506-391c602e9ffd",
                "name": "Jefferson Solano Lutero",
                "code": "PRD-936631",
                "unit": {
                    "id": "a15683a6-ae9c-4455-9bc5-3cd42e531e9a",
                    "name": "Sr. Andres Ferraz",
                    "abbreviation": "Mari Marta Bezerra Filho"
                }
            },
            "quantity": 267.5177,
            "quantity_fulfilled": 0,
            "quantity_pending": 267.5177,
            "is_fulfilled": false,
            "is_partially_fulfilled": false,
            "observation": "Harum voluptas itaque sed accusamus excepturi voluptatem.",
            "created_at": null,
            "updated_at": null
        }
    ]
}
 

Request      

GET api/product-requests/pending-by-product/{product}

Headers

Authorization        

Example: Bearer V1cbe38Ehd5kD4Zfga6aPv6

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

product   string     

Product UUID Example: nihil

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 keDaE1fb564d3VPc6haZv8g" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"sort_by\": \"Example Sort by\",
    \"sort_desc\": false,
    \"page\": 1,
    \"per_page\": 1,
    \"q\": \"Example Q\",
    \"work_id\": \"2633bb5b-79d0-36f5-9472-0f06292f8ebb\",
    \"work_location_id\": \"57312419-3f84-3311-acec-af4d3a07976f\",
    \"user_id\": \"688ffdf8-3953-39f6-a682-60dcf3bc3483\",
    \"status_id\": \"b00dae76-fc94-38a9-ace4-74e725e9f4b4\",
    \"priority\": \"Example Priority\",
    \"needed_at_from\": \"Example Needed at from\",
    \"needed_at_to\": \"Example Needed at to\",
    \"responsible_id\": \"bb646099-6ef1-3293-90fe-8d939068816b\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-requests"
);

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

let body = {
    "sort_by": "Example Sort by",
    "sort_desc": false,
    "page": 1,
    "per_page": 1,
    "q": "Example Q",
    "work_id": "2633bb5b-79d0-36f5-9472-0f06292f8ebb",
    "work_location_id": "57312419-3f84-3311-acec-af4d3a07976f",
    "user_id": "688ffdf8-3953-39f6-a682-60dcf3bc3483",
    "status_id": "b00dae76-fc94-38a9-ace4-74e725e9f4b4",
    "priority": "Example Priority",
    "needed_at_from": "Example Needed at from",
    "needed_at_to": "Example Needed at to",
    "responsible_id": "bb646099-6ef1-3293-90fe-8d939068816b"
};

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

Example response (200):


{
    "data": [
        {
            "id": "314a6403-9d51-310d-9c12-acd9410fb3fb",
            "code": null,
            "name": "Facilis vero quis illum.",
            "description": null,
            "work": {
                "id": "a15683a3-d950-49b3-807d-ea493c859b05",
                "name": "Dr. Mateus Flávio Rocha Sobrinho"
            },
            "user": {
                "id": "a15683a3-dc52-49ea-afe0-0c608f6d0891",
                "name": "Shemar Zemlak"
            },
            "status": {
                "id": "a15683a3-df47-43aa-beca-adaf3b68f6ed",
                "description": "Sra. Giovana Luna Vila",
                "color": "#965baa",
                "text_color": "#2f9df1"
            },
            "priority": "low",
            "priority_label": "Baixa",
            "needed_at": "2026-04-09",
            "approved_at": null,
            "rejection_reason": null,
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "53284107-b6e3-3c1a-a6ee-87fd706dd0dc",
            "code": null,
            "name": "Omnis id explicabo iusto.",
            "description": "Numquam eos consequuntur veniam error consequuntur et dignissimos. Velit enim dolor optio dolores dolorem laudantium non. Unde odit sit illum sed. Libero ratione alias necessitatibus molestiae.",
            "work": {
                "id": "a15683a3-e4cf-42fe-8601-349f27d5985d",
                "name": "Dr. Jerônimo Teles Ferreira Sobrinho"
            },
            "user": {
                "id": "a15683a3-e825-4fc0-8446-39dedafdbefc",
                "name": "Stacey Donnelly"
            },
            "status": {
                "id": "a15683a3-ea0f-4ed5-90a7-f0318a504657",
                "description": "Juliane Zamana Filho",
                "color": "#3135a1",
                "text_color": "#bc2e43"
            },
            "priority": "urgent",
            "priority_label": "Urgente",
            "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 keDaE1fb564d3VPc6haZv8g

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

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: 2633bb5b-79d0-36f5-9472-0f06292f8ebb

work_location_id   string  optional    

Local da obra. The uuid of an existing record in the work_locations table. Example: 57312419-3f84-3311-acec-af4d3a07976f

user_id   string  optional    

Usuário. The uuid of an existing record in the users table. Example: 688ffdf8-3953-39f6-a682-60dcf3bc3483

status_id   string  optional    

Status. The uuid of an existing record in the statuses table. Example: b00dae76-fc94-38a9-ace4-74e725e9f4b4

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: bb646099-6ef1-3293-90fe-8d939068816b

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

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

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

Example response (200):


{
    "data": {
        "id": "f52a94eb-26a9-365e-9b70-3fc9edf7bacf",
        "code": null,
        "name": "A mollitia earum unde.",
        "description": null,
        "work": {
            "id": "a15683a3-f1ef-4aa3-b7ed-3265870d9ea9",
            "name": "Srta. Karen de Aguiar"
        },
        "user": {
            "id": "a15683a3-f516-4bec-9d0e-0cb0180f4062",
            "name": "Mr. Avery Aufderhar DDS"
        },
        "status": {
            "id": "a15683a3-f726-48a8-ab8c-0eace33b58ff",
            "description": "Antonieta Angélica Torres",
            "color": "#db9251",
            "text_color": "#e8f927"
        },
        "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 1E386Dh46VZegPfkvbaa5dc

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productRequest   string     

Product Request UUID Example: harum

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

const headers = {
    "Authorization": "Bearer aEf16hbdP35V8kv4ZcegD6a",
    "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": "fdaa20d1-c3ad-3028-b94e-132a87d93cb6",
            "product": {
                "id": "a15683a4-1466-4d15-98f1-819b30df5c0b",
                "name": "Dr. Raysa Patrícia Sepúlveda Filho",
                "code": "PRD-206865",
                "unit": {
                    "id": "a15683a4-12f4-4185-859c-0f564d07cd22",
                    "name": "Sr. Arthur Fernandes Verdara Sobrinho",
                    "abbreviation": "Guilherme Colaço Delatorre"
                }
            },
            "quantity": 267.4979,
            "quantity_fulfilled": 0,
            "quantity_pending": 267.4979,
            "is_fulfilled": false,
            "is_partially_fulfilled": false,
            "observation": "Non perferendis minima aspernatur saepe occaecati qui earum.",
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "839ceaa9-e3f4-3ea8-b529-0d09aa8d3a14",
            "product": {
                "id": "a15683a4-2741-4915-b648-812b2e22588b",
                "name": "Hugo Wagner Perez",
                "code": "PRD-885560",
                "unit": {
                    "id": "a15683a4-25a7-4ec1-8488-e04eb6c6015d",
                    "name": "Sr. Joaquin Davi Ramos Neto",
                    "abbreviation": "Srta. Alana Samanta das Neves Jr."
                }
            },
            "quantity": 981.1102,
            "quantity_fulfilled": 0,
            "quantity_pending": 981.1102,
            "is_fulfilled": false,
            "is_partially_fulfilled": false,
            "observation": null,
            "created_at": null,
            "updated_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/product-requests/{productRequest}/items

Headers

Authorization        

Example: Bearer aEf16hbdP35V8kv4ZcegD6a

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productRequest   string     

Product Request UUID Example: voluptatem

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 c1D5EbZPVvahkda6g3e8f64" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"description\": \"Example Description\",
    \"work_id\": \"c0c9ea7c-20f8-3bed-a485-6081f7b688ff\",
    \"work_location_id\": \"3365705d-65ea-35b1-a38e-9cb4ee299cf0\",
    \"status_id\": \"82cfbf82-8b52-3d37-a91f-72cd541ca482\",
    \"priority\": \"Example Priority\",
    \"needed_at\": \"Example Needed at\",
    \"items\": [
        {
            \"product_id\": \"ff420aa6-3ae1-3330-806f-a6ba69408c02\",
            \"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 c1D5EbZPVvahkda6g3e8f64",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "description": "Example Description",
    "work_id": "c0c9ea7c-20f8-3bed-a485-6081f7b688ff",
    "work_location_id": "3365705d-65ea-35b1-a38e-9cb4ee299cf0",
    "status_id": "82cfbf82-8b52-3d37-a91f-72cd541ca482",
    "priority": "Example Priority",
    "needed_at": "Example Needed at",
    "items": [
        {
            "product_id": "ff420aa6-3ae1-3330-806f-a6ba69408c02",
            "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 c1D5EbZPVvahkda6g3e8f64

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: c0c9ea7c-20f8-3bed-a485-6081f7b688ff

work_location_id   string  optional    

Local da obra. The uuid of an existing record in the work_locations table. Example: 3365705d-65ea-35b1-a38e-9cb4ee299cf0

status_id   string  optional    

Status. The uuid of an existing record in the statuses table. Example: 82cfbf82-8b52-3d37-a91f-72cd541ca482

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: ff420aa6-3ae1-3330-806f-a6ba69408c02

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/fuga" \
    --header "Authorization: Bearer Zv8gce6b4Dkha1Va6dP5E3f" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"description\": \"Example Description\",
    \"work_id\": \"e53e97d8-ec00-3b53-8654-abeb9199d48f\",
    \"work_location_id\": \"9f059dcd-0bd0-3fe2-a4ec-4198152da62a\",
    \"status_id\": \"24f54d7f-3feb-37f9-851d-20bc5b05f8b7\",
    \"priority\": \"Example Priority\",
    \"needed_at\": \"Example Needed at\",
    \"items\": [
        {
            \"id\": \"cab5748a-4436-3d5c-9678-151a1b3b2fe1\",
            \"product_id\": \"5de229ed-70b9-3d75-b52e-606751f16a8f\",
            \"quantity\": 1,
            \"observation\": \"Example Items * observation\"
        },
        null
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-requests/fuga"
);

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

let body = {
    "name": "Example Name",
    "description": "Example Description",
    "work_id": "e53e97d8-ec00-3b53-8654-abeb9199d48f",
    "work_location_id": "9f059dcd-0bd0-3fe2-a4ec-4198152da62a",
    "status_id": "24f54d7f-3feb-37f9-851d-20bc5b05f8b7",
    "priority": "Example Priority",
    "needed_at": "Example Needed at",
    "items": [
        {
            "id": "cab5748a-4436-3d5c-9678-151a1b3b2fe1",
            "product_id": "5de229ed-70b9-3d75-b52e-606751f16a8f",
            "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 Zv8gce6b4Dkha1Va6dP5E3f

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productRequest   string     

Product Request UUID Example: fuga

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: e53e97d8-ec00-3b53-8654-abeb9199d48f

work_location_id   string  optional    

Local da obra. The uuid of an existing record in the work_locations table. Example: 9f059dcd-0bd0-3fe2-a4ec-4198152da62a

status_id   string  optional    

Status. The uuid of an existing record in the statuses table. Example: 24f54d7f-3feb-37f9-851d-20bc5b05f8b7

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: cab5748a-4436-3d5c-9678-151a1b3b2fe1

product_id   string     

Produto. The uuid of an existing record in the products table. Example: 5de229ed-70b9-3d75-b52e-606751f16a8f

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

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

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productRequest   string     

Product Request UUID Example: et

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

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

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productRequest   string     

Product Request UUID Example: possimus

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/quis/reject" \
    --header "Authorization: Bearer 3dDv8EPeafga46V516bhZck" \
    --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/quis/reject"
);

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

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productRequest   string     

Product Request UUID Example: quis

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/non/items" \
    --header "Authorization: Bearer e4g36dVacEf8hP6vkD1aZ5b" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"items\": [
        {
            \"product_id\": \"193540b6-73c1-3ffe-a9c6-9669a40b878e\",
            \"quantity\": 1,
            \"observation\": \"Example Items * observation\"
        },
        null
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-requests/non/items"
);

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

let body = {
    "items": [
        {
            "product_id": "193540b6-73c1-3ffe-a9c6-9669a40b878e",
            "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 e4g36dVacEf8hP6vkD1aZ5b

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productRequest   string     

Product Request UUID Example: non

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: 193540b6-73c1-3ffe-a9c6-9669a40b878e

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/ut" \
    --header "Authorization: Bearer 45E3a1PekcvfV6d8gbhZ6Da" \
    --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-requests/items/ut"
);

const headers = {
    "Authorization": "Bearer 45E3a1PekcvfV6d8gbhZ6Da",
    "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-requests/items/{id}

Headers

Authorization        

Example: Bearer 45E3a1PekcvfV6d8gbhZ6Da

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the item. Example: ut

item   string     

Product Request Item UUID Example: tempore

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-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/eum/items" \
    --header "Authorization: Bearer 68dVPv5ea6E4ZfD3g1hkcba" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"items\": [
        \"5786a30f-4d51-3085-87b2-cf9186acb5f2\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-requests/eum/items"
);

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

let body = {
    "items": [
        "5786a30f-4d51-3085-87b2-cf9186acb5f2"
    ]
};

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 68dVPv5ea6E4ZfD3g1hkcba

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productRequest   string     

Product Request UUID Example: eum

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/minus/sync-items" \
    --header "Authorization: Bearer kfa61PE84ZeD3v5habdcV6g" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"items\": [
        {
            \"id\": \"88e8972b-5302-3301-974b-d810a9b08cfc\",
            \"product_id\": \"2306c201-b99d-30e8-938e-b1d4985c0c0a\",
            \"quantity\": 1,
            \"observation\": \"Example Items * observation\"
        },
        null
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/product-requests/minus/sync-items"
);

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

let body = {
    "items": [
        {
            "id": "88e8972b-5302-3301-974b-d810a9b08cfc",
            "product_id": "2306c201-b99d-30e8-938e-b1d4985c0c0a",
            "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 kfa61PE84ZeD3v5habdcV6g

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

productRequest   string     

Product Request UUID Example: minus

Body Parameters

items   object[]     

Itens.

id   string  optional    

ID do Item. The uuid of an existing record in the product_request_items table. Example: 88e8972b-5302-3301-974b-d810a9b08cfc

product_id   string     

Produto. The uuid of an existing record in the products table. Example: 2306c201-b99d-30e8-938e-b1d4985c0c0a

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

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

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

Example response (200):


{
    "data": [
        {
            "id": "aac98e0b-eae7-31ff-b2e4-f13a71b503bf",
            "name": "Ingrid Rocha Vale Sobrinho",
            "code": "PRD-216413",
            "stock": 8,
            "product_family": {
                "id": "a15683a1-b965-4e85-aa97-1faca865e2e5",
                "name": "Dr. Márcio Marinho Cortês Neto"
            },
            "product_brand": {
                "id": "a15683a1-be12-42ec-a84b-ca617bd8bbcf",
                "name": "Sr. Moisés Delatorre"
            },
            "unit": {
                "id": "a15683a1-c0d1-497c-a8a8-2e9756759b66",
                "name": "Filipe Santiago Cruz",
                "abbreviation": "Srta. Sophia Bonilha"
            },
            "image": {
                "id": null,
                "url": null
            },
            "description": "Amet corporis et pariatur praesentium vel autem.",
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "92f008d9-2abd-3a35-a2ba-dc4dbda1d253",
            "name": "Sr. Valentin Felipe Marin Neto",
            "code": "PRD-073528",
            "stock": 746,
            "product_family": {
                "id": "a15683a1-c894-4ed3-80d2-d77a28ffd0fc",
                "name": "Dr. Cléber Delgado"
            },
            "product_brand": {
                "id": "a15683a1-d252-4950-a3ef-844353063e5f",
                "name": "Dr. Eliane Maya Faro"
            },
            "unit": {
                "id": "a15683a1-d40e-45d9-8acc-f714292ee192",
                "name": "Moisés David Balestero",
                "abbreviation": "Willian Verdugo Neto"
            },
            "image": {
                "id": null,
                "url": null
            },
            "description": "Quis dolor neque quibusdam.",
            "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 64gPekbcf6ZhvaEdVaD1385

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

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

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

Example response (200):


{
    "data": {
        "id": "cf02d541-1ab8-39fa-b140-b4d2001e2d03",
        "name": "Sr. Henrique Santacruz Matias",
        "code": "PRD-993594",
        "stock": 824156,
        "product_family": {
            "id": "a15683a1-e0a4-41e3-ab16-b7c3d9697791",
            "name": "Sr. Vicente Yuri Corona Filho"
        },
        "product_brand": {
            "id": "a15683a1-e29f-4c2d-8404-079f0c28443c",
            "name": "Regina Bonilha Amaral"
        },
        "unit": {
            "id": "a15683a1-e484-4cb0-906a-6b808fef234e",
            "name": "Dr. Teobaldo Cristiano Beltrão",
            "abbreviation": "Srta. Léia Daiana da Cruz Neto"
        },
        "image": {
            "id": null,
            "url": null
        },
        "description": "Eum quo sed est ex delectus omnis nisi illo.",
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/products/{id}

Headers

Authorization        

Example: Bearer Z51P4v6aa36hfeDbVgdE8kc

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

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 dZPVcEkh54b361ae8avDgf6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"product_family_id\": \"336d22f2-a3cb-3330-b0ec-bde6fc2f73a2\",
    \"product_brand_id\": \"8f12789a-f5e6-3a21-b64b-e0177c88bb8a\",
    \"unit_id\": \"d875a169-a01a-387b-9e4d-931a17598ee1\",
    \"description\": \"Example Description\",
    \"stock\": 1
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/products"
);

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

let body = {
    "name": "Example Name",
    "product_family_id": "336d22f2-a3cb-3330-b0ec-bde6fc2f73a2",
    "product_brand_id": "8f12789a-f5e6-3a21-b64b-e0177c88bb8a",
    "unit_id": "d875a169-a01a-387b-9e4d-931a17598ee1",
    "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 dZPVcEkh54b361ae8avDgf6

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: 336d22f2-a3cb-3330-b0ec-bde6fc2f73a2

product_brand_id   string     

Marca do Produto. The uuid of an existing record in the product_brands table. Example: 8f12789a-f5e6-3a21-b64b-e0177c88bb8a

unit_id   string     

Unidade. The uuid of an existing record in the units table. Example: d875a169-a01a-387b-9e4d-931a17598ee1

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 81af43dv5kaEc6eVg6bDhZP" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"product_family_id\": \"e4a9929a-1854-3785-819c-6e78bca0ea26\",
    \"product_brand_id\": \"d6df1885-8828-37ca-b235-a135127eb8bf\",
    \"unit_id\": \"ebd0e86c-8b87-3c1b-94f6-7edb94c3560b\",
    \"stock\": 1,
    \"description\": \"Example Description\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/products/1"
);

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

let body = {
    "name": "Example Name",
    "product_family_id": "e4a9929a-1854-3785-819c-6e78bca0ea26",
    "product_brand_id": "d6df1885-8828-37ca-b235-a135127eb8bf",
    "unit_id": "ebd0e86c-8b87-3c1b-94f6-7edb94c3560b",
    "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 81af43dv5kaEc6eVg6bDhZP

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

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: e4a9929a-1854-3785-819c-6e78bca0ea26

product_brand_id   string  optional    

Marca do Produto. The uuid of an existing record in the product_brands table. Example: d6df1885-8828-37ca-b235-a135127eb8bf

unit_id   string  optional    

Unidade. The uuid of an existing record in the units table. Example: ebd0e86c-8b87-3c1b-94f6-7edb94c3560b

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

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

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

product   string     

Product UUID Example: reprehenderit

Reports

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

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

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

Example response (200):


{
    "data": [
        {
            "id": "3be4d0b3-6faa-3f11-b29c-1e2d6efa6678",
            "name": "cum ad",
            "slug": null,
            "description": null,
            "abbreviation": null,
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "9c432654-3944-3026-8266-5d8b6a13384f",
            "name": "dolores error",
            "slug": null,
            "description": null,
            "abbreviation": null,
            "created_at": null,
            "updated_at": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Anterior",
                "page": null,
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "page": 1,
                "active": true
            },
            {
                "url": null,
                "label": "Próximo &raquo;",
                "page": null,
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET api/sectors

Headers

Authorization        

Example: Bearer h1ca5VZeadv34kEb6gDP8f6

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

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

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

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

Example response (200):


{
    "data": {
        "id": "d6d8a547-df16-3b85-9f18-51ad9ec0c5bd",
        "name": "eveniet saepe",
        "slug": null,
        "description": "Doloremque culpa architecto dolor iste quis in. Quos voluptatem voluptatem amet nobis at. Ipsum itaque reprehenderit magni consequatur pariatur est officiis.",
        "abbreviation": null,
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/sectors/{id}

Headers

Authorization        

Example: Bearer d81DE6baVvkfPZ4ceg36ha5

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the sector. Example: 15

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

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

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the sector. Example: 8

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

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

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the sector. Example: 5

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

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

Example response (200):


{
    "data": [
        {
            "id": "f5aee927-a8b4-31a2-90c8-3c3a9790b46d",
            "name": "Annalise Hills V",
            "username": "gloria54",
            "email": "santiago95@example.org",
            "image": {
                "id": null,
                "url": null
            },
            "sectors": [],
            "roles": []
        },
        {
            "id": "1319aab9-660e-39ee-819c-cd5878953cbd",
            "name": "Zion Russel",
            "username": "linnie46",
            "email": "lmarks@example.org",
            "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 Z83gf4keDV5vh616PdaaEcb

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 5hda8bc6V46v3DfagZPE1ke" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"users\": [
        \"7167542c-e51d-3996-8329-bcd54716d41b\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/sectors/019556e7-2e9f-777c-a177-30bbf0646c32/users/attach"
);

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

let body = {
    "users": [
        "7167542c-e51d-3996-8329-bcd54716d41b"
    ]
};

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 5hda8bc6V46v3DfagZPE1ke

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 Db56f43ZPvega8Eh6cd1Vak" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"users\": [
        \"621d4325-c28b-3591-82c3-e5932fde133f\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/sectors/019556e7-2e9f-777c-a177-30bbf0646c32/users/detach"
);

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

let body = {
    "users": [
        "621d4325-c28b-3591-82c3-e5932fde133f"
    ]
};

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 Db56f43ZPvega8Eh6cd1Vak

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 a6541bg3f8vPeaVhckEdZD6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"users\": [
        \"087b9634-9c90-39a0-b208-c501cb487be1\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/sectors/019556e7-2e9f-777c-a177-30bbf0646c32/users/sync"
);

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

let body = {
    "users": [
        "087b9634-9c90-39a0-b208-c501cb487be1"
    ]
};

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 a6541bg3f8vPeaVhckEdZD6

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

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

Example response (200):


{
    "data": [
        {
            "name": "a adipisci",
            "slug": "cupiditate-fuga-quas-nemo"
        },
        {
            "name": "veniam qui",
            "slug": "quaerat-ea-dicta-laudantium-magnam-atque-et-suscipit-ullam"
        }
    ]
}
 

Request      

GET api/status-modules

Headers

Authorization        

Example: Bearer 84Eac5ZgVefhD3dka61bP6v

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

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

Example response (200):


{
    "data": [
        {
            "id": "e0bfa388-0cbf-3061-ba49-a124297256fa",
            "description": "Dr. Jefferson de Aguiar Jr.",
            "abbreviation": "explicabo",
            "color": "#ab3637",
            "text_color": "#9c084c",
            "module": {
                "name": "Solicitação de Produtos",
                "slug": "product_request"
            },
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "20f1069b-49db-3257-81cf-159e37dad071",
            "description": "Dr. Giovana Corona",
            "abbreviation": "voluptatem",
            "color": "#a27bfa",
            "text_color": "#b6d4a0",
            "module": {
                "name": "Solicitação de Produtos",
                "slug": "product_request"
            },
            "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 685PZcDEe3gda41V6fkvbha

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 41c6EZ8hkd63bvfVa5DPage" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"description\": \"Example Description\",
    \"abbreviation\": \"Example Abbreviation\",
    \"module\": \"Example Module\",
    \"sector_id\": \"3651f3da-0a80-3d0a-85a9-f91aaca8b661\",
    \"color\": \"Example Color\",
    \"text_color\": \"Example Text color\",
    \"order\": 1,
    \"is_initial\": false,
    \"is_final\": false
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/statuses"
);

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

let body = {
    "description": "Example Description",
    "abbreviation": "Example Abbreviation",
    "module": "Example Module",
    "sector_id": "3651f3da-0a80-3d0a-85a9-f91aaca8b661",
    "color": "Example Color",
    "text_color": "Example Text color",
    "order": 1,
    "is_initial": false,
    "is_final": false
};

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 41c6EZ8hkd63bvfVa5DPage

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

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: 3651f3da-0a80-3d0a-85a9-f91aaca8b661

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

is_final   boolean  optional    

Status final. Example: false

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

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

Example response (200):


{
    "data": {
        "id": "2ba227d1-c293-30f0-a0de-4de06f03a331",
        "description": "Sr. Horácio das Neves Jr.",
        "abbreviation": "neque",
        "color": "#36d8d8",
        "text_color": "#03c0b1",
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/statuses/{id}

Headers

Authorization        

Example: Bearer PaVa1egf6k84b3dEc6hZv5D

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 g6DVvcEakhd8e3bafP1564Z" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"description\": \"Example Description\",
    \"abbreviation\": \"Example Abbreviation\",
    \"module\": \"Example Module\",
    \"sector_id\": \"0515d182-3bfe-3d5a-a517-4fd09d25a75e\",
    \"color\": \"Example Color\",
    \"text_color\": \"Example Text color\",
    \"order\": 1,
    \"is_initial\": false,
    \"is_final\": false
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/statuses/1"
);

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

let body = {
    "description": "Example Description",
    "abbreviation": "Example Abbreviation",
    "module": "Example Module",
    "sector_id": "0515d182-3bfe-3d5a-a517-4fd09d25a75e",
    "color": "Example Color",
    "text_color": "Example Text color",
    "order": 1,
    "is_initial": false,
    "is_final": false
};

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 g6DVvcEakhd8e3bafP1564Z

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

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: 0515d182-3bfe-3d5a-a517-4fd09d25a75e

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

is_final   boolean  optional    

Status final. Example: false

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

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

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

Example response (200):


{
    "data": [
        {
            "id": "464a1cd2-774f-377c-a8c6-893e4e27d8b7",
            "quantity": 689.1483,
            "min_quantity": null,
            "max_quantity": null,
            "below_minimum": false,
            "above_maximum": false,
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "065a4742-d7bd-3e0c-be4e-bed7a30ce3f0",
            "quantity": 928.1726,
            "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 h8d6caDvkeP65b41VgZfaE3

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

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

Example response (200):


{
    "data": [
        {
            "id": "b4acf997-c949-3481-a35d-b9effacf0147",
            "name": "Estoque da Cruz Comercial Ltda.",
            "module": "work",
            "is_active": true,
            "is_main": false,
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "92686143-0cb7-34f1-a367-3d5ebc7f5719",
            "name": "Estoque Ramires Comercial Ltda.",
            "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 85DZ6g3f1a4v6EbdchekaPV

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 veakbD8fgPdEaZ31h46cV65" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"module\": \"Example Module\",
    \"id\": \"Example Id\",
    \"is_active\": false
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/stocks"
);

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

let body = {
    "name": "Example Name",
    "module": "Example Module",
    "id": "Example Id",
    "is_active": false
};

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

Example response (201):


{
    "data": {
        "id": "a8de835a-5fe8-3970-a380-20c64848ed9f",
        "name": "Estoque Alves-Amaral",
        "module": "work",
        "is_active": true,
        "is_main": false,
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

POST api/stocks

Headers

Authorization        

Example: Bearer veakbD8fgPdEaZ31h46cV65

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

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

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

Example response (200):


{
    "data": {
        "id": "5531e5af-ad46-3e3d-827a-967981c67a60",
        "name": "Estoque Cruz 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 e61P5bEfaahkZD3d6g84cvV

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

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

Example response (200):


{
    "data": {
        "id": "f16ca245-23ac-3662-a918-6e938f9b3116",
        "name": "Estoque Ortega 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 D1f8ac466dEhbkg5vaP3VZe

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 vhdP1E68a64fb5kaVgD3ceZ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"is_active\": false
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/stocks/1"
);

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

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

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

Example response (200):


{
    "data": {
        "id": "6aadd9e0-fa00-312b-92bf-f06560efc263",
        "name": "Estoque de Arruda Ltda.",
        "module": "work",
        "is_active": true,
        "is_main": false,
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

PUT api/stocks/{id}

Headers

Authorization        

Example: Bearer vhdP1E68a64fb5kaVgD3ceZ

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

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

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

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

Example response (200):


{
    "data": [
        {
            "id": "93dcc964-55c8-3a69-ad67-338883eba0c3",
            "quantity": 957.9268,
            "min_quantity": null,
            "max_quantity": null,
            "below_minimum": false,
            "above_maximum": false,
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "d3032898-abfc-359b-a702-18a6a3ffc74d",
            "quantity": 614.0622,
            "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 DvbPgZ481Vde6ahca3Efk65

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

const headers = {
    "Authorization": "Bearer 6EZ83h1vk4DgVacdaPb5ef6",
    "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": "47604a63-f4e4-3d3f-84fb-c6f01044027a",
        "quantity": 745.0105,
        "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 6EZ83h1vk4DgVacdaPb5ef6

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

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 da1ca6Z568VPEDvghke34bf" \
    --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 da1ca6Z568VPEDvghke34bf",
    "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,
        "items_below_minimum": 3,
        "items_above_maximum": 1
    }
}
 

Request      

GET api/stocks/{stock}/summary

Headers

Authorization        

Example: Bearer da1ca6Z568VPEDvghke34bf

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

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

Example response (200):


{
    "data": [
        {
            "id": "9f0d2bbe-5b80-35bc-8dbd-124e0597d6f3",
            "code": "MOV-165496",
            "type": "compra",
            "type_name": "PURCHASE",
            "is_entry": true,
            "is_exit": false,
            "quantity": 75.1244,
            "previous_quantity": 155.4476,
            "new_quantity": 230.572,
            "reason": null,
            "movement_date": "2026-03-03T12:32:51.000000Z",
            "created_at": null
        },
        {
            "id": "dad2635f-1d8c-342c-9587-33dbb5fac37d",
            "code": "MOV-808769",
            "type": "vencido",
            "type_name": "EXPIRED",
            "is_entry": false,
            "is_exit": true,
            "quantity": 97.7412,
            "previous_quantity": 867.073,
            "new_quantity": 769.3318,
            "reason": "Natus commodi itaque et.",
            "movement_date": "2026-02-26T02:00:02.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 5avE664ghPV8Db1Zeakd3cf

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 gDhP3c5aaf6dbeZVv8kE641" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"product_id\": \"13d7ef40-7c52-319f-95c3-2fa3667f6814\",
    \"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 gDhP3c5aaf6dbeZVv8kE641",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "product_id": "13d7ef40-7c52-319f-95c3-2fa3667f6814",
    "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": "be7276f6-b841-3538-ba23-61c78139fef7",
        "code": "MOV-295253",
        "type": "consumo",
        "type_name": "CONSUMPTION",
        "is_entry": false,
        "is_exit": true,
        "quantity": 3.6879,
        "previous_quantity": 245.0911,
        "new_quantity": 241.4032,
        "reason": "Pariatur rerum modi aut illo.",
        "movement_date": "2026-03-19T09:14:37.000000Z",
        "created_at": null
    }
}
 

Request      

POST api/stocks/{stock_id}/movements

Headers

Authorization        

Example: Bearer gDhP3c5aaf6dbeZVv8kE641

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: 13d7ef40-7c52-319f-95c3-2fa3667f6814

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 8ecV5k6D6Zfdb4g13EvaPah" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"product_id\": \"81cc7144-1e03-3197-8d96-f782f5385910\",
    \"destination_stock_id\": \"d2c81aee-0bff-3479-9735-2d5f27ca9adc\",
    \"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 8ecV5k6D6Zfdb4g13EvaPah",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "product_id": "81cc7144-1e03-3197-8d96-f782f5385910",
    "destination_stock_id": "d2c81aee-0bff-3479-9735-2d5f27ca9adc",
    "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": "607b0d70-3a9f-3d12-9e10-a7b89432b73e",
        "code": "MOV-952690",
        "type": "entrada transferência",
        "type_name": "TRANSFER_IN",
        "is_entry": true,
        "is_exit": false,
        "quantity": 24.9807,
        "previous_quantity": 111.2531,
        "new_quantity": 136.2338,
        "reason": "Earum consequatur beatae quidem autem ut aut.",
        "movement_date": "2026-02-22T13:15:52.000000Z",
        "created_at": null
    }
}
 

Request      

POST api/stocks/{stock}/movements/transfer

Headers

Authorization        

Example: Bearer 8ecV5k6D6Zfdb4g13EvaPah

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: 81cc7144-1e03-3197-8d96-f782f5385910

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: d2c81aee-0bff-3479-9735-2d5f27ca9adc

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 8D6vk4e1c6hfZa5gdVEbP3a" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"product_id\": \"d85d86ae-2515-3315-9e93-3b7b858635b5\",
    \"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 8D6vk4e1c6hfZa5gdVEbP3a",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "product_id": "d85d86ae-2515-3315-9e93-3b7b858635b5",
    "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": "56f215c6-6169-3496-ad71-ac210d508c9d",
        "code": "MOV-723157",
        "type": "produção",
        "type_name": "PRODUCTION",
        "is_entry": true,
        "is_exit": false,
        "quantity": 90.521,
        "previous_quantity": 523.8371,
        "new_quantity": 614.3581,
        "reason": null,
        "movement_date": "2026-02-21T05:25:11.000000Z",
        "created_at": null
    }
}
 

Request      

POST api/stocks/{stock}/movements/inventory

Headers

Authorization        

Example: Bearer 8D6vk4e1c6hfZa5gdVEbP3a

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: d85d86ae-2515-3315-9e93-3b7b858635b5

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 1Dke4bhva35afV6gd6EcZP8" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"product_id\": \"2c5c7cf7-d932-31ab-af29-2aed144891ea\",
    \"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 1Dke4bhva35afV6gd6EcZP8",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "product_id": "2c5c7cf7-d932-31ab-af29-2aed144891ea",
    "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": "69459f0e-0ad2-3ded-b2af-6214a091fe3d",
        "code": "MOV-507787",
        "type": "ajuste entrada",
        "type_name": "ADJUSTMENT_IN",
        "is_entry": true,
        "is_exit": false,
        "quantity": 63.1152,
        "previous_quantity": 740.9906,
        "new_quantity": 804.1058,
        "reason": null,
        "movement_date": "2026-03-15T09:40:11.000000Z",
        "created_at": null
    }
}
 

Request      

POST api/stock-movements/purchase

Headers

Authorization        

Example: Bearer 1Dke4bhva35afV6gd6EcZP8

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: 2c5c7cf7-d932-31ab-af29-2aed144891ea

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

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

Example response (200):


{
    "data": {
        "id": "7d31ff83-4c91-363b-9014-c4f260dee943",
        "code": "MOV-849927",
        "type": "ajuste saída",
        "type_name": "ADJUSTMENT_OUT",
        "is_entry": false,
        "is_exit": true,
        "quantity": 28.0366,
        "previous_quantity": 574.3788,
        "new_quantity": 546.3422,
        "reason": null,
        "movement_date": "2026-03-10T08:30:59.000000Z",
        "created_at": null
    }
}
 

Request      

GET api/stock-movements/{movement}

Headers

Authorization        

Example: Bearer k5ca3E64egP6fhvdaZ1VD8b

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

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

Example response (200):


{
    "data": [
        {
            "id": "3ddacd3f-5392-3ab8-b11e-c68e7a1175cd",
            "name": "Srta. Beatriz Amaral Perez Jr.",
            "email": "gabrielle86@example.com",
            "phone": "(17) 3261-8815",
            "document": "86.661.419/0001-00",
            "type": "pf",
            "responsible": "Srta. Raquel Lúcia Santiago",
            "image": {
                "id": null,
                "url": null
            },
            "address": {
                "street": null,
                "number": null,
                "complement": null,
                "neighborhood": null,
                "city": null,
                "state": null,
                "zip_code": null
            }
        },
        {
            "id": "d9ec08e4-9bf9-3fa8-80c2-648945dc0786",
            "name": "Dr. Saulo Benício Zambrano",
            "email": "cristian.delvalle@example.net",
            "phone": "(55) 96088-9840",
            "document": "58.796.614/0001-01",
            "type": "pj",
            "responsible": "Dr. Davi Filipe Azevedo Filho",
            "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 ZD5Vkad6fPbE146c3gahe8v

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

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

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

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

Example response (200):


{
    "data": {
        "id": "f9009bcc-47f3-30d0-92ab-75dcee50a40d",
        "name": "Sr. Roberto Maldonado Sepúlveda",
        "email": "gael.lovato@example.org",
        "phone": "(33) 91760-3565",
        "document": "49.587.975/0001-57",
        "type": "pj",
        "responsible": "Mari Rodrigues da Rosa",
        "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 aPgv65a8V4EZ3k1bdh6efDc

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the supplier. Example: 9

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

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

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the supplier. Example: 19

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

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

supplier   string     

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

System Types

Endpoints for system types

System Types

requires authentication No specific permission required

Get the system types

Example request:
curl --request GET \
    --get "https://api.bs-homolog.pensou.app.br/api/system-types" \
    --header "Authorization: Bearer dgP1Vhef3586DZa6ca4kvEb" \
    --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 dgP1Vhef3586DZa6ca4kvEb",
    "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 dgP1Vhef3586DZa6ca4kvEb

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

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

Example response (200):


{
    "data": [
        {
            "id": "53c61372-54a4-3127-8302-aef9e453ba71",
            "name": "Emerson Santiago",
            "description": "Et fuga sunt perferendis ut quos. Mollitia earum maiores voluptatem minima veniam. Cupiditate commodi at similique quis. Velit recusandae perferendis sunt quia eveniet.",
            "type": "ajuste"
        },
        {
            "id": "54d54f5d-a663-35c4-ac8f-f8276679e660",
            "name": "Dr. Arthur Luiz Benez",
            "description": "Officia a deserunt et cupiditate. Possimus vel dolorum distinctio dolor qui temporibus. Aspernatur et sit sit consequatur reiciendis labore eum at.",
            "type": "entrada"
        }
    ],
    "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 g4ZaD183ch6b65EefVPadvk

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

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

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

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

Example response (200):


{
    "data": {
        "id": "3bfdd296-dad3-3f3e-9cd7-53637528f446",
        "name": "Vanessa Grego Filho",
        "description": "Voluptas tempore recusandae dolore placeat dolore harum. Autem placeat porro quibusdam sed ratione cum pariatur iste. Molestiae voluptatem labore voluptas sed.",
        "type": "juros"
    }
}
 

Request      

GET api/transaction-categories/{transactionCategory}

Headers

Authorization        

Example: Bearer 6Da8ZEeP5fgbkV64d1vh3ca

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

transactionCategory   string     

Transaction category UUID Example: ex

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

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

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

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

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

transactionCategory   string     

Transaction category UUID Example: possimus

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

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

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

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

transactionCategory   string     

Transaction category UUID Example: rerum

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

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

Example response (200):


{
    "data": [
        {
            "id": "efe81744-9b7c-3e42-b39c-6f28b771aa1e",
            "name": "Dr. Emerson Anderson Paz",
            "abbreviation": "Dr. Davi Horácio Fonseca",
            "description": "In in commodi qui.",
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "c67a0600-2837-3d6e-adb8-0c88ed0f0760",
            "name": "Sra. Danielle Maia",
            "abbreviation": "Dr. Pietra Josefina Gil Filho",
            "description": "Est qui quibusdam ut qui.",
            "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 6P4a5gfdZ6vaDVek8c3h1bE

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

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

Example response (200):


{
    "data": {
        "id": "58cce464-8801-3f07-b846-49057e43d396",
        "name": "Joana Sepúlveda Sobrinho",
        "abbreviation": "Karina Branco Quintana",
        "description": "Ut exercitationem aut et.",
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/units/{id}

Headers

Authorization        

Example: Bearer DPcf8E664vagaV53heZdb1k

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

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 65DecEv64gPbak3ha8ZfdV1" \
    --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 65DecEv64gPbak3ha8ZfdV1",
    "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 65DecEv64gPbak3ha8ZfdV1

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

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

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

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

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

unit   string     

Unit UUID Example: dignissimos

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

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

Example response (200):


{
    "data": [
        {
            "id": "452e03ca-852f-3c2d-bdde-e84fc296463e",
            "name": "Sandra Prosacco",
            "username": "schuppe.baron",
            "email": "bspencer@example.org",
            "image": {
                "id": null,
                "url": null
            },
            "sectors": [],
            "roles": []
        },
        {
            "id": "5db5f63f-2912-309a-98c3-e059cc211a39",
            "name": "Braden Ledner DDS",
            "username": "doug01",
            "email": "lenore.reilly@example.org",
            "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 V6cZvEfa8b5De16ahg4dPk3

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

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

Example response (200):


{
    "data": {
        "id": "f7fa6658-2bc5-3613-a742-5f4a19a0db7a",
        "name": "Dr. Lukas Bradtke",
        "username": "steuber.maximillian",
        "email": "adaline66@example.org",
        "image": {
            "id": null,
            "url": null
        },
        "sectors": [],
        "roles": []
    }
}
 

Request      

GET api/users/{id}

Headers

Authorization        

Example: Bearer 56ZbVkvhfP4dcg831eDaEa6

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 gekaZfP8DEbdcha5V3v1466" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"email\": \"user@example.com\",
    \"username\": \"hector.rohan\",
    \"image\": {
        \"0\": \"example1\",
        \"1\": \"example2\",
        \"path\": \"Example Image path\",
        \"name\": \"Example Name\",
        \"extension\": \"Example Image extension\",
        \"size\": \"Example Image size\"
    },
    \"sectors\": [
        \"1033309b-d5a8-3ea6-9eeb-8b8a7021464d\"
    ],
    \"roles\": [
        \"c3e42a6a-b159-36b0-b9b1-4c6bceec579a\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/users"
);

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

let body = {
    "name": "Example Name",
    "email": "user@example.com",
    "username": "hector.rohan",
    "image": {
        "0": "example1",
        "1": "example2",
        "path": "Example Image path",
        "name": "Example Name",
        "extension": "Example Image extension",
        "size": "Example Image size"
    },
    "sectors": [
        "1033309b-d5a8-3ea6-9eeb-8b8a7021464d"
    ],
    "roles": [
        "c3e42a6a-b159-36b0-b9b1-4c6bceec579a"
    ]
};

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 gekaZfP8DEbdcha5V3v1466

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Nome. Example: Example Name

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: hector.rohan

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 gP8a6E45f6dVZe1vkbDha3c" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"email\": \"user@example.com\",
    \"username\": \"liza03\",
    \"password\": \"password123\",
    \"image\": {
        \"0\": \"example1\",
        \"1\": \"example2\",
        \"path\": \"Example Image path\",
        \"name\": \"Example Name\",
        \"extension\": \"Example Image extension\",
        \"size\": \"Example Image size\"
    },
    \"sectors\": [
        \"818328af-b661-3425-978a-b6f997181e95\"
    ],
    \"roles\": [
        \"d256ea56-4389-3553-aae1-a9eb1024b2d4\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/users/1"
);

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

let body = {
    "name": "Example Name",
    "email": "user@example.com",
    "username": "liza03",
    "password": "password123",
    "image": {
        "0": "example1",
        "1": "example2",
        "path": "Example Image path",
        "name": "Example Name",
        "extension": "Example Image extension",
        "size": "Example Image size"
    },
    "sectors": [
        "818328af-b661-3425-978a-b6f997181e95"
    ],
    "roles": [
        "d256ea56-4389-3553-aae1-a9eb1024b2d4"
    ]
};

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 gP8a6E45f6dVZe1vkbDha3c

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

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

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 65eafvbVZD1gch83EaP6d4k" \
    --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 65eafvbVZD1gch83EaP6d4k",
    "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 65eafvbVZD1gch83EaP6d4k

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

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 8vg4edP3aZc61DVh56fakEb" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"permissions\": [
        \"0c9c59da-406c-3333-8f32-29f4c6e776cc\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/users/1/permissions"
);

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

let body = {
    "permissions": [
        "0c9c59da-406c-3333-8f32-29f4c6e776cc"
    ]
};

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 8vg4edP3aZc61DVh56fakEb

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

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

Example response (200):


{
    "data": [
        {
            "id": null,
            "name": "omnis",
            "display_name": "Nemo omnis et odit sapiente sunt quibusdam."
        },
        {
            "id": null,
            "name": "est",
            "display_name": "Eos perferendis sed sunt libero voluptatem."
        }
    ]
}
 

Request      

GET api/users/{user}/permissions

Headers

Authorization        

Example: Bearer d31Pe8V4b6ha5aDfEvkc6Zg

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

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

Example response (200):


{
    "data": [
        {
            "id": "985f6d0c-42e3-3a5f-9384-13bf9589df33",
            "description": "Dr. Maria Saraiva",
            "work": {
                "id": null,
                "name": null
            },
            "documents": [],
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "3c541f9f-c7f8-3166-b0c6-74e54f4f8904",
            "description": "Cláudio Aranda D'ávila Neto",
            "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 Ve6d8f1Zvba3ak654ghDcPE

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 bdcahE1av546Z3ePDgVk8f6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"description\": \"Example Description\",
    \"work_id\": \"d36c779d-f2a1-3792-bf97-d6c0e83c3a23\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/work-locations"
);

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

let body = {
    "description": "Example Description",
    "work_id": "d36c779d-f2a1-3792-bf97-d6c0e83c3a23"
};

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 bdcahE1av546Z3ePDgVk8f6

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: d36c779d-f2a1-3792-bf97-d6c0e83c3a23

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

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

Example response (200):


{
    "data": {
        "id": "f2ed4441-5530-3f04-afd6-9cc38cead7fd",
        "description": "James Delvalle Soto",
        "work": {
            "id": null,
            "name": null
        },
        "documents": [],
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/work-locations/{workLocation}

Headers

Authorization        

Example: Bearer 6e1PEf8ZaVa3hc6bkd5gDv4

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 kc4fga83Dd6Vb5ehP61vaEZ" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"description\": \"Example Description\",
    \"work_id\": \"b2676e24-c36c-347f-8d09-f86bc3666508\"
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/work-locations/019556e7-2e9f-777c-a177-30bbf0646c32"
);

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

let body = {
    "description": "Example Description",
    "work_id": "b2676e24-c36c-347f-8d09-f86bc3666508"
};

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 kc4fga83Dd6Vb5ehP61vaEZ

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: b2676e24-c36c-347f-8d09-f86bc3666508

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

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

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

Example response (200):


{
    "data": [
        {
            "id": "04ab3e70-667b-313a-898b-16e84c651cfa",
            "name": "Márcia Torres",
            "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,
            "documents_count": 0,
            "locations_documents_count": 0,
            "total_documents_count": 0,
            "started_at": {
                "date": "2017-01-30 12:35:22.000000",
                "timezone_type": 3,
                "timezone": "America/Sao_Paulo"
            },
            "created_at": null,
            "updated_at": null
        },
        {
            "id": "44777f76-8432-32d3-9601-83f747af9525",
            "name": "Sr. Pedro Thales Mendonça Sobrinho",
            "address": {
                "street": null,
                "number": null,
                "complement": null,
                "neighborhood": null,
                "city": null,
                "state": null,
                "zip_code": null
            },
            "documents": [],
            "locations": [],
            "product_quantity_lists_count": 0,
            "product_quantity_list_items_count": 0,
            "documents_count": 0,
            "locations_documents_count": 0,
            "total_documents_count": 0,
            "started_at": {
                "date": "2004-07-25 01:24:44.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 58Z43bkPDdacvehVEga66f1

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 ZD8eVv5EhPb4g6cdf6a1ka3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"customer_id\": \"f84ad2fb-de6a-36c6-b7b6-93a66c296f0e\",
    \"status_id\": \"db70950a-ba2c-3214-bf23-fca8c375f799\",
    \"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 ZD8eVv5EhPb4g6cdf6a1ka3",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "customer_id": "f84ad2fb-de6a-36c6-b7b6-93a66c296f0e",
    "status_id": "db70950a-ba2c-3214-bf23-fca8c375f799",
    "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 ZD8eVv5EhPb4g6cdf6a1ka3

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: f84ad2fb-de6a-36c6-b7b6-93a66c296f0e

status_id   string     

Status id. The uuid of an existing record in the statuses table. Example: db70950a-ba2c-3214-bf23-fca8c375f799

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

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

Example response (200):


{
    "data": {
        "id": "634af523-eccb-3c4b-aa7f-5961e2e3687a",
        "name": "Dr. Leo Ian Ramos Neto",
        "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,
        "documents_count": 0,
        "locations_documents_count": 0,
        "total_documents_count": 0,
        "started_at": {
            "date": "2019-05-13 07:25:39.000000",
            "timezone_type": 3,
            "timezone": "America/Sao_Paulo"
        },
        "created_at": null,
        "updated_at": null
    }
}
 

Request      

GET api/works/{id}

Headers

Authorization        

Example: Bearer ed5cPva6Z6Dfkbh13gaEV48

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 D5hZgE3cP16fea6Vdkbv8a4" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Example Name\",
    \"customer_id\": \"1a268495-2aaa-3ed6-8f12-ccde3e54b9c1\",
    \"status_id\": \"70f338ea-aaaa-3987-a98c-ea04072a87af\",
    \"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 D5hZgE3cP16fea6Vdkbv8a4",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Example Name",
    "customer_id": "1a268495-2aaa-3ed6-8f12-ccde3e54b9c1",
    "status_id": "70f338ea-aaaa-3987-a98c-ea04072a87af",
    "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 D5hZgE3cP16fea6Vdkbv8a4

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: 1a268495-2aaa-3ed6-8f12-ccde3e54b9c1

status_id   string  optional    

Status id. The uuid of an existing record in the statuses table. Example: 70f338ea-aaaa-3987-a98c-ea04072a87af

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

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

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

Example response (200):


{
    "data": [
        {
            "id": "e582723a-17f7-35c7-bc1f-49e9ae44a13a",
            "name": "Mr. Troy Bernier DDS",
            "username": "goodwin.thurman",
            "email": "jroberts@example.org",
            "image": {
                "id": null,
                "url": null
            },
            "sectors": [],
            "roles": []
        },
        {
            "id": "bf9b17a6-7680-3c3b-9161-fd0d1760bcf8",
            "name": "Brody Simonis",
            "username": "agoyette",
            "email": "xhauck@example.net",
            "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 DVvZ8h45fada13ebk6c6PEg

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 cg366kDdvPaZ5ab4feVEh18" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"users\": [
        \"900d0526-2ef3-3189-b604-d19d73168a86\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/works/019556e7-2e9f-777c-a177-30bbf0646c32/responsibles/attach"
);

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

let body = {
    "users": [
        "900d0526-2ef3-3189-b604-d19d73168a86"
    ]
};

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 cg366kDdvPaZ5ab4feVEh18

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 aZeV4P3cD1fvb6kE8dg5h6a" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"users\": [
        \"15789213-a6c8-3183-84b7-21c0ab5f99d5\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/works/019556e7-2e9f-777c-a177-30bbf0646c32/responsibles/detach"
);

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

let body = {
    "users": [
        "15789213-a6c8-3183-84b7-21c0ab5f99d5"
    ]
};

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 aZeV4P3cD1fvb6kE8dg5h6a

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 fEDVadbZ4h35kg6Pa8e6cv1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"users\": [
        \"560a52d6-e3f9-3405-a6ab-1db1e52cae77\"
    ]
}"
const url = new URL(
    "https://api.bs-homolog.pensou.app.br/api/works/019556e7-2e9f-777c-a177-30bbf0646c32/responsibles/sync"
);

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

let body = {
    "users": [
        "560a52d6-e3f9-3405-a6ab-1db1e52cae77"
    ]
};

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 fEDVadbZ4h35kg6Pa8e6cv1

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.