Create Warehouse
<h2>Overview</h2>
<p>This endpoint allows you to create warehouses with various details including name, address, contacts, working hours, and appointment settings.</p>
<h2>Request</h2>
<ul>
<li>Method: <strong>POST</strong></li>
<li>URI: <code>/warehouses</code></li>
</ul>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>name (*)</td>
<td>String</td>
<td>Warehouse Name</td>
</tr>
<tr>
<td>code</td>
<td>String</td>
<td>Warehouse Code</td>
</tr>
<tr>
<td>address (*)</td>
<td>String</td>
<td>The Stree Address</td>
</tr>
<tr>
<td>is_residential (*)</td>
<td>Boolean</td>
<td>Residential indicator, Default False</td>
</tr>
<tr>
<td>zipcode (*)</td>
<td>String</td>
<td>Warehouse Zipcode</td>
</tr>
<tr>
<td>city_id (*)</td>
<td>Integer</td>
<td>The id of City</td>
</tr>
<tr>
<td>appointment_by</td>
<td>Integer</td>
<td>0: Unknown, 1: No apt needed, 2: Customer, 3: DrayEasy</td>
</tr>
<tr>
<td>live_or_drop</td>
<td>Integer</td>
<td>0: Unknown, 1: Live, 2: Drop</td>
</tr>
<tr>
<td>customer_memo</td>
<td>String</td>
<td>Customer Memo</td>
</tr>
<tr>
<td>working_day_from</td>
<td>Integer</td>
<td>0: Sunday, 1: Monday, 2: Tuesday, 3: Wednesday, 4: Thursday, 5: Friday, 6: Saturday</td>
</tr>
<tr>
<td>working_day_to</td>
<td>Integer</td>
<td>0: Sunday, 1: Monday, 2: Tuesday, 3: Wednesday, 4: Thursday, 5: Friday, 6: Saturday</td>
</tr>
<tr>
<td>working_hour_from</td>
<td>String</td>
<td>Working Hour Begin</td>
</tr>
<tr>
<td>working_hour_to</td>
<td>String</td>
<td>Working Hour End</td>
</tr>
<tr>
<td>time_zone</td>
<td>String</td>
<td>AST, EST, CST, MST, PST, AKST, HST</td>
</tr>
<tr>
<td>contacts (*)</td>
<td>Array</td>
<td>Array of Contacts</td>
</tr>
<tr>
<td>contacts[tye]</td>
<td>Array</td>
<td>One or more of this set of data: APT, SALES, DISPATCH, ACCOUNTING</td>
</tr>
<tr>
<td>contacts[name] (*)</td>
<td>String</td>
<td>Contact Name</td>
</tr>
<tr>
<td>contacts[role]</td>
<td>String</td>
<td>Contact Role</td>
</tr>
<tr>
<td>contacts[phone]</td>
<td>String</td>
<td>Contact Phone</td>
</tr>
<tr>
<td>contacts[fax]</td>
<td>String</td>
<td>Contact Fax</td>
</tr>
<tr>
<td>contacts[email]</td>
<td>String</td>
<td>Contact Email</td>
</tr>
<tr>
<td>contacts[remark]</td>
<td>String</td>
<td>Contact Remark</td>
</tr>
<tr>
<td><!--</td>
<td>files</td>
<td>File</td>
<td>Array of File, Max Size 10M. Please add Header "Content-Type": "multipart/form-data" if applicable</td>
<td>--></td>
</tr>
</tbody>
</table>
<p>> <code>(*)</code> it means the field is required.
> <code>(*?)</code> it means the field is conditionally required.</p>
<h2>Code Example</h2>
<pre><code>Request:
curl --location --request POST 'https://api.drayeasy.com/api/v2/warehouses' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer xxxxxxxxx'
--data-raw '{
&quot;name&quot;: &quot;Test Create Warehouse&quot;,
&quot;code&quot;: &quot;10222&quot;,
&quot;address&quot;: &quot;Test Create Warehouse Stree Address&quot;,
&quot;is_residential&quot;: true,
&quot;time_zone&quot;: &quot;MST&quot;,
&quot;zipcode&quot;: &quot;90001&quot;,
&quot;appointment_by&quot;: 0,
&quot;live_or_drop&quot;: 0,
&quot;customer_memo&quot;: &quot;&quot;,
&quot;working_day_from&quot;: &quot;2&quot;,
&quot;working_day_to&quot;: &quot;2&quot;,
&quot;working_hour_from&quot;: &quot;20:41&quot;,
&quot;working_hour_to&quot;: &quot;20:41&quot;,
&quot;contacts&quot;: [
{
&quot;email&quot;: &quot;john@test.com&quot;,
&quot;emailable&quot;: false,
&quot;request_rate&quot;: false,
&quot;fax&quot;: &quot;&quot;,
&quot;name&quot;: &quot;John&quot;,
&quot;phone&quot;: &quot;11112345677&quot;,
&quot;remark&quot;: &quot;&quot;,
&quot;role&quot;: &quot;&quot;,
&quot;type&quot;: [
&quot;APT&quot;,
&quot;SALES&quot;,
&quot;ACCOUNTING&quot;
]
},
{
&quot;email&quot;: &quot;whes@test.com&quot;,
&quot;emailable&quot;: false,
&quot;request_rate&quot;: false,
&quot;fax&quot;: &quot;&quot;,
&quot;name&quot;: &quot;whes&quot;,
&quot;phone&quot;: &quot;11113333333&quot;,
&quot;remark&quot;: &quot;&quot;,
&quot;role&quot;: &quot;&quot;,
&quot;type&quot;: [
&quot;APT&quot;,
&quot;SALES&quot;,
&quot;ACCOUNTING&quot;
]
}
],
&quot;city_id&quot;: 1
}'
Response:
HTTP/1.1 201 OK
Content-Type: application/json; charset=utf-8
{
&quot;data&quot;: {
&quot;id&quot;: 2376,
&quot;name&quot;: &quot;Test Create Warehouse&quot;,
&quot;code&quot;: &quot;10222&quot;,
&quot;zipcode&quot;: &quot;90001&quot;,
&quot;working_hour_from&quot;: &quot;20:41&quot;,
&quot;working_hour_to&quot;: &quot;20:41&quot;,
&quot;working_day_from&quot;: &quot;2&quot;,
&quot;working_day_to&quot;: &quot;2&quot;,
&quot;time_zone&quot;: &quot;MST&quot;,
&quot;appointment_by&quot;: 0,
&quot;internal_memo&quot;: null,
&quot;is_residential&quot;: true,
&quot;customer_memo&quot;: null,
&quot;live_or_drop&quot;: 0,
&quot;address&quot;: &quot;Test Create Warehouse Stree Address&quot;,
&quot;delivery_order_address&quot;: &quot;TEST CREATE WAREHOUSE STREE ADDRESS\nLOS ANGELES, CA, USA 90001\nJOHN(11112345677)\nWHES(11113333333)&quot;,
&quot;created_at&quot;: &quot;2023-06-02T12:16:34.000000Z&quot;,
&quot;user&quot;: {
&quot;name&quot;: &quot;Name1&quot;,
&quot;email&quot;: &quot;email1@email.com&quot;,
&quot;company&quot;: &quot;Company1&quot;
},
&quot;city&quot;: {
&quot;id&quot;: 1,
&quot;country&quot;: &quot;USA&quot;,
&quot;full_name&quot;: &quot;Los Angeles, CA, USA&quot;,
&quot;name&quot;: &quot;LOS ANGELES&quot;,
&quot;state&quot;: &quot;CA&quot;,
&quot;alias&quot;: null,
&quot;latitude&quot;: 33.973093,
&quot;longitude&quot;: -118.247896
},
&quot;contacts&quot;: [
{
&quot;id&quot;: 1387,
&quot;name&quot;: &quot;John&quot;,
&quot;type&quot;: [
&quot;APT&quot;,
&quot;SALES&quot;,
&quot;ACCOUNTING&quot;
],
&quot;role&quot;: null,
&quot;phone&quot;: &quot;11112345677&quot;,
&quot;fax&quot;: null,
&quot;email&quot;: &quot;john@test.com&quot;,
&quot;remark&quot;: null
},
{
&quot;id&quot;: 1388,
&quot;name&quot;: &quot;whes&quot;,
&quot;type&quot;: [
&quot;APT&quot;,
&quot;SALES&quot;,
&quot;ACCOUNTING&quot;
],
&quot;role&quot;: null,
&quot;phone&quot;: &quot;11113333333&quot;,
&quot;fax&quot;: null,
&quot;email&quot;: &quot;whes@test.com&quot;,
&quot;remark&quot;: null
}
]
}
}</code></pre>
<h2>Response Fields Description</h2>
<table>
<thead>
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>The unique identifier of the created warehouse.</td>
</tr>
<tr>
<td>name</td>
<td>The name of the warehouse.</td>
</tr>
<tr>
<td>code</td>
<td>The code associated with the warehouse.</td>
</tr>
<tr>
<td>zipcode</td>
<td>The postal code of the warehouse.</td>
</tr>
<tr>
<td>working_hour_from</td>
<td>The starting working hour of the warehouse.</td>
</tr>
<tr>
<td>working_hour_to</td>
<td>The ending working hour of the warehouse.</td>
</tr>
<tr>
<td>working_day_from</td>
<td>The starting working day of the warehouse.</td>
</tr>
<tr>
<td>working_day_to</td>
<td>The ending working day of the warehouse.</td>
</tr>
<tr>
<td>time_zone</td>
<td>The time zone of the warehouse.</td>
</tr>
<tr>
<td>appointment_by</td>
<td>The method by which appointments are made for the warehouse.</td>
</tr>
<tr>
<td>internal_memo</td>
<td>Internal memo associated with the warehouse.</td>
</tr>
<tr>
<td>is_residential</td>
<td>Indicates if the warehouse is a residential address (true/false).</td>
</tr>
<tr>
<td>customer_memo</td>
<td>Customer memo associated with the warehouse.</td>
</tr>
<tr>
<td>live_or_drop</td>
<td>Indicates if the warehouse is for live or drop shipments.</td>
</tr>
<tr>
<td>address</td>
<td>The street address of the warehouse.</td>
</tr>
<tr>
<td>delivery_order_address</td>
<td>The delivery order address of the warehouse.</td>
</tr>
<tr>
<td>created_at</td>
<td>The timestamp when the warehouse was created.</td>
</tr>
<tr>
<td>user</td>
<td>Information about the user associated with the warehouse.</td>
</tr>
<tr>
<td>city</td>
<td>Information about the city where the warehouse is located.</td>
</tr>
<tr>
<td>contacts</td>
<td>Contact information associated with the warehouse.</td>
</tr>
</tbody>
</table>
<h2>User Object</h2>
<table>
<thead>
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>name</td>
<td>The name of the user.</td>
</tr>
<tr>
<td>email</td>
<td>The email address of the user.</td>
</tr>
<tr>
<td>company</td>
<td>The company associated with the user.</td>
</tr>
</tbody>
</table>
<h2>City Object</h2>
<table>
<thead>
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>The unique identifier for the city.</td>
</tr>
<tr>
<td>country</td>
<td>The country where the city is located.</td>
</tr>
<tr>
<td>full_name</td>
<td>The full name of the city, including state and country.</td>
</tr>
<tr>
<td>name</td>
<td>The name of the city.</td>
</tr>
<tr>
<td>state</td>
<td>The state where the city is located (if applicable).</td>
</tr>
<tr>
<td>alias</td>
<td>An alias for the city (if available).</td>
</tr>
<tr>
<td>latitude</td>
<td>The latitude coordinate of the city.</td>
</tr>
<tr>
<td>longitude</td>
<td>The longitude coordinate of the city.</td>
</tr>
</tbody>
</table>
<h2>Contact Object</h2>
<table>
<thead>
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>The unique identifier for the contact.</td>
</tr>
<tr>
<td>name</td>
<td>The name of the contact.</td>
</tr>
<tr>
<td>type</td>
<td>The type or roles associated with the contact.</td>
</tr>
<tr>
<td>role</td>
<td>The role of the contact (if applicable).</td>
</tr>
<tr>
<td>phone</td>
<td>The phone number of the contact.</td>
</tr>
<tr>
<td>fax</td>
<td>The fax number of the contact (if available).</td>
</tr>
<tr>
<td>email</td>
<td>The email address of the contact.</td>
</tr>
<tr>
<td>remark</td>
<td>Any additional remarks or notes about the contact.</td>
</tr>
</tbody>
</table>