addInventoryWarehouseLocation
The method allows you to add or update a warehouse location in a Base inventory warehouse.
Input parameters
Output data:
A sample request in PHP:
| location_id | int | (optional) ID of the location to update. Omit this parameter to create a new location. |
| warehouse_id | int | Warehouse identifier returned by getInventoryWarehouses (the warehouse_id field). |
| warehouse_type | varchar(20) | Warehouse type returned by getInventoryWarehouses (the warehouse_type field). |
| name | varchar(20) | Location name (e.g. "A-01-A-1"). Required when creating a new location, optional when updating. Must be unique within the warehouse, max 20 characters, cannot contain a semicolon (";"). |
| color | char(6) | (optional) Location label color as a 6-character hex string, e.g. "5cb85c". The value is normalized to lowercase. Default for new locations: "4285f4". |
| is_pickable | bool | (optional) Whether the location is pickable (can be used during pick & pack). Default for new locations: true. |
| priority | int | (optional) Priority value, integer in range 1..99999. Lower values are picked first. Default for new locations: 1. |
| location_type_id | int | (optional) Identifier of the location type. Must be an existing location type for the user. Omit to use the user's default location type when creating. |
| zone_id | int | (optional) Identifier of the zone. Pass 0 to leave the location unassigned to any zone. When updating, changing zone_id without also passing rack_id resets rack_id to 0 (the previous rack would not match the new zone). If a non-zero rack_id is provided, zone_id can be omitted (the rack's zone will be used automatically); when explicitly provided, it must match the rack's zone. |
| rack_id | int | (optional) Identifier of the rack. Pass 0 to leave the location unassigned to any rack. If a non-zero rack_id is provided, the location's zone is set to the rack's zone (an explicitly provided zone_id must match it). |
Output data
The method returns the data in JSON format.
| status | varchar(30) | SUCCESS - request executed correctly ERROR - an error occurred during an API request. Error details will be described in 2 additional returned fields: error_message and error_code |
| location_id | int | ID of the created or updated location. |
Sample
Input data:Output data:
A sample request in PHP: