> For the complete documentation index, see [llms.txt](https://docs.p4.software/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.p4.software/p4-warehouse-spanish/api-rest/p4warehouse-rest-api.md).

# P4Warehouse REST API

## Autenticación

Todas las llamadas y consultas a la API REST requieren una clave de API del sistema. Para obtener la clave, vaya a Configuración > Sistema > Usuario, como se muestra a continuación.

<figure><img src="https://content.gitbook.com/content/PMR15ZlnsCE8Kl2RyAci/blobs/FejXlqvh39c3BTH52nAG/image.png" alt=""><figcaption><p>P4Warehouse Rest API</p></figcaption></figure>

En la lista de usuarios disponibles, haga clic en el usuario «sistema».

In the user detail page, click the drop down icon to access API key for your tenant.

{% hint style="info" %}
If this is for a 3PL client, be sure the API is for a user that is specifically assigned to the 3PL client.
{% endhint %}

<figure><img src="https://content.gitbook.com/content/PMR15ZlnsCE8Kl2RyAci/blobs/wX51U5fNR8lYK4NLPL47/image.png" alt=""><figcaption><p>P4 Warehouse Rest API</p></figcaption></figure>

## Endpoints and Requests

API endpoints are organized by resource type. Use different endpoints depending on your API call requirements.

Here are couple example of API endpoints used throughout the P4W system.

#### **'CreateOrUpdate'** and **'DeleteBatch'** follow this pattern:[&#xD;](<&#xD;&#xA;https://doc1.p4warehouse.com/api/>)

```json
https://{tenant_name}.p4warehouse.com/api/{Resource}Api/CreateOrUpdate

https://{tenant_name}.p4warehouse.com/api/{Resource}Api/DeleteBatch
```

Replace {Resource} with Product, Client, Vendor, PickTicket, PurchaseOrder, etc.

Replace `{tenant_name}` with your tenant's domain.

#### **OData**

For querying database, P4W uses OData protocol.[](<&#xD;&#xA;https://doc1.p4warehouse.com/odata/PickTicket?$expand=>)

<pre class="language-json"><code class="lang-json"><strong>"https://{tenant_name}.p4warehouse.com/odata/PickTicket?$expand={Resources&#x26;Parameters}
</strong></code></pre>

&#x20;Replace `{tenant_name}` with your tenant's domain.

All requests produce HTTP response status code.

#### Four Wall Report

FourWallReport endpoint provides a simple way to retrieve full inventory list including individual products quantities.&#x20;

```json
https://{tenant_name}.p4warehouse.com/api/Report/FourWallReport
```

Replace `{tenant_name}` with your tenant's domain.

#### Execute&#x20;

'Execute' endpoint is used in conjunction with Audit reports.&#x20;

## Payload

API calls containing payload utilize JSON format across the board.
