Warehouse Endpoints
The Warehouse entity is associated with a product and a stock. Each warehouse includes a series of attributes that describe it, as well as relevant information about the country.
Common Warehouse Characteristicsβ
-
Unique Identification: Each warehouse has a unique identifier
idthat distinguishes them from other warehouses in the system. It also has anidRemotefield, which refers to the id that may be stored in the client's ERP database. -
Warehouse Data: A warehouse has associated information such as name, address, city, state, zip code, associated country data, and other details.
-
Activities and Sign up Activities performed by a warehouse within the system, such as creation or modification of resources, may be logged.
-
Country: Basic information about the country to which the store belongs is stored, such as
idRemote,descriptionandiso.
Endpointsβ
GET/Warehouse/getWarehouseβ
Retrieve a paginated list of warehouses.
Descriptionβ
This endpoint retrieves a paginated list of warehouse from the system. It allows clients to fetch warehouse data based on pagination parameters such as page number (page) and items per page (pageSize). The response includes detailed information about each warehouse, including its ID, name, address, city, state, zip code, last updated timestamp, and country information.
Parametersβ
| Name | Description | Type | Default Value |
|---|---|---|---|
id | Warehouse Id | String optional | id |
page | Page number | Integer | 1 |
pageSize | Number of items per page | Integer | 10 |
Responsesβ
JSONβ
{
"data": [
{
"id": "string",
"idRemote": "string",
"name": "string",
"address": "string",
"city": "string",
"state": {
"id": "string",
"description": "string",
"iso": "string"
},
"postalCode": "string",
"country": {
"id": "string",
"idRemote": "string",
"description": "string",
"iso": "string"
},
"createdAt": "string",
"updatedAt": "string"
}
],
"pagination": {
"totalItems": 0,
"itemsPerPage": 0,
"currentPage": 0,
"totalPages": 0,
"nextPageUrl": "string"
}
}
XMLβ
<?xml version="1.0" encoding="UTF-8"?>
<export>
<data>
<item>
<id>string</id>
<idRemote>string</idRemote>
<name>string</name>
<address>string</address>
<city>string</city>
<state>
<id>string</id>
<description>string</description>
<iso>string</iso>
</state>
<postalCode>string</postalCode>
<country>
<id>string</id>
<idRemote>string</idRemote>
<description>string</description>
<iso>string</iso>
</country>
<createdAt>string</createdAt>
<updatedAt>string</updatedAt>
</item>
</data>
<pagination>
<totalItems>0</totalItems>
<itemsPerPage>0</itemsPerPage>
<currentPage>0</currentPage>
<totalPages>0</totalPages>
<nextPageUrl>string</nextPageUrl>
</pagination>
</export>
πTry it outπ±
POST/Warehouse/createβ
Warehouse Registration in the API: Using the POST Methodβ
Currently, our POST method in the API exclusively handles JSON format. To effectively register warehouses, it is crucial to follow a process that ensures data integrity and proper system functionality.
Registration Process:β
- Creation of Country: In order to register a warehouse, we must verify that an associated country exists. A country must exist in order to create a warehouse. πRegister Countryπ±
Details of the POST Method:β
You must take into account that the State that you are going to add as a location for the new Warehouse must be related to the Country that corresponds to it. For example, you cannot associate the province Madrid with France.
All parameters in the request body are mandatory.
The request must follow the following scheme:
[
{
"idRemote": "string",
"name": "string",
"address": "string",
"city": "string",
"stateId": "string",
"postalCode": "string",
"countryId": "string"
}
]
It is possible to add multiple warehouses through the same request by separating them with commas within the array in the body of the request.
πTry it outπ±
PUT/Warehouse/update/{id}β
Updating warehouses
Descriptionβ
The PUT method of our API allows clients to update warehouses data using the id parameter. This id field can be either the B2B system's own identifier or the idRemote you provide when registering warehouses on our platform. In this way, our platform guarantees efficient and accurate warehouse information management.
It is not necessary to include the entire JSON structure, you just have to send what you want to modify
Parametersβ
| Name | Description | Type |
|---|---|---|
id | Warehouse identifier | String required |
Request Bodyβ
The request body must follow the following schema in JSON format:
{
"idRemote": "string",
"name": "string",
"address": "string",
"city": "string",
"stateId": "string",
"postalCode": "string",
"countryId": "string"
}
πTry it outπ±
DELETE/Warehouse/delete/{id}β
Removing Warehouse
Descriptionβ
The method DELETE allows the deletion of warehouses using their unique identifier. This id field can be either the identifier generated by the B2B database or the idRemote you provide when registering warehouses. It is important to note that when a warehouse is deleted, it is also removed in the corresponding Stock. Once deleted, the Warehouse is recorded in the Deleted History.
Parametersβ
| Name | Description | Type |
|---|---|---|
id | Warehouse identifier | String required |
πTry it outπ±
Possible Response Errorsβ
| Error | Response Status | Response Body |
|---|---|---|
| This error occurs when a connection to the database cannot be established. It is an internal server problem. | 500 | {"code": 500,"error": "Database connection failed."} |
| This error occurs when you cannot insert or update items into the database. | 500 | {"code": 500,"error": "Invalid connection name, you cannot insert in default"} |
| This error occurs when a parameter is missing. | 400 | {"code": 400,"error": "Parameter $parameter is required"} |
| This error occurs when you are not authorized. | 401 | {"code": 401,"error": "Unauthorized."} |
| This error occurs when the Warehouse could not be found. | 404 | {"code": 404,"error": "No entity found for Warehouse with $id."} |
| This error occurs when you try to insert a Warehouse that already exists. | 409 | {"code": 409,"error": "Duplicate entry"} |
| This error occurs when you try to send too many requests in a short period of time. | 429 | {"code": 429,"error": "Too Many Requests"} |