ItsPerfect Get Warehouses
Summary of Changes: (The purpose of this table is to keep traceability and Product team to highlight the things that were changed into the scope, based on comments or discussions)
Version | Date | Created / Updated | Notes |
---|---|---|---|
v1.0 | N/A | Hristiyan | First publish |
v1.1 | 19.03.2024 | Bogomil Pavlov | Instead of enum we will store the warehouse details into a table |
API Docs : https://www.itsperfect-solutions.com/api-v2/warehouses
API Call : GET /api/v2/warehouses
We need to submit a warehouse ID when creating an order in ItsPerfect in order to send it to the correct warehouse. For this, we will need to have a GET Warehouses call which will provide us with the needed information about the warehouses.
Since we don’t expect to have many warehouses and for them to change often, we will not have a button or trigger for this. Instead we will treat it like any other cron - it will run based on the times/settings set in the crontab group.
We will need an enumeration form table in Account ItsPerfect
with a dropdown field with all the warehouses.
table name | notes |
---|---|
ItsPerfect Warehouses | This should be a drop-down field with the warehouses which we get from the GET warehouses call |
Example response :
{
"warehouses": [
{
"id": 1,
"active": 1,
"warehouse": "Bleckmann Amsterdam",
"street": "",
"housenumber": "",
"housenumberExtension": "",
"address2": "",
"postalCode": "",
"city": "",
"country": {
"id": 1,
"iso": "NL",
"country": "Netherlands"
},
"phone": "",
"email": "",
"subsidiary": {
"id": 1,
"subsidiary": "Martens Fashion Group B.V."
},
"retail": 0,
"retailStock": 1,
"retailTransit": 1,
"retailDropshipment": 0
},
{
"id": 2,
"active": 1,
"warehouse": "B2C Voorraad",
"street": "",
"housenumber": "",
"housenumberExtension": "",
"address2": "",
"postalCode": "",
"city": "",
"country": {
"id": 1,
"iso": "NL",
"country": "Netherlands"
},
"phone": "",
"email": "",
"subsidiary": {
"id": 1,
"subsidiary": "Martens Fashion Group B.V."
},
"retail": 0,
"retailStock": 1,
"retailTransit": 1,
"retailDropshipment": 0
},
]
}
From the response we want to store the id
and the warehouse
for all active warehouses (they should be active
= 1 in the response).
We want to display the warehouse
in the Account ItsPerfect
> Warehouses
, but send the id
with the create orders call. We want to dynamically update and store all the warehouses but we want to display only the active ones in ItsPerfect in the dropdown menu. If a warehouse was active, but became inactive, we need to remove it from the dropdown menu and vice versa.
<v1.1>All the details will be store into a new table with suggested structure and mapping:
ItsPerfect Field | Hemi Field | Comment | |
---|---|---|---|
id | ItsPerfect Warehouse > Warehouse_Id | ||
active | ItsPerfect Warehouse > Active | We want to display only the active warehouses in the UI | |
warehouse | ItsPerfect Warehouse > Name | ||
street | N/A | ||
housenumber | N/A | ||
housenumberExtension | N/A | ||
address2 | N/A | ||
postalcode | N/A | ||
city | N/A | ||
country | |||
id | N/A | ||
iso | N/A | ||
country | N/A | ||
phone | N/A | ||
N/A | |||
subsidiary | |||
id | N/A | ||
subsidiary | N/A | ||
retail | N/A | ||
retailStock | N/A | ||
retailTransit | N/A | ||
retailDropshipment | N/A |
</v1.1>