/warehouses
endpoint¶
The /warehouses
endpoint provides methods for listing, creating, and updating the properties of DropStream warehouses.
List¶
To get a list of existing warehouses and their properties, make a GET
request to /warehouses
.
Endpoint | /warehouses |
---|---|
Method | GET |
Auth | JWT |
Success status | HTTP 200 |
Response (JSON) | Array of warehouses |
Example
curl -H "Authorization: Bearer $JWT_TOKEN" \
https://api.getdropstream.com/warehouses
Response:
[
{
"id": 4609,
"customer_id": 3775,
"description": "My Warehouse",
"platform": "dropstream",
"created_at": "2020-08-19T14:57:20.000Z",
"enabled_at": "2020-08-19T14:57:20.000Z",
"order_status_imported_at": null,
"inventory_updated_at": null
},
...
{
"id": 4636,
...
}
]
HTTP/1.1 200 OK
Create¶
To create a new warehouse, make a POST
request to /warehouses
with the new warehouse properties.
Endpoint | /warehouses |
---|---|
Method | POST |
Auth | JWT |
Payload | Properties of the new warehouse object |
Required properties |
|
Success status | HTTP 201 |
Response (JSON) | id of the new warehouse |
Example
curl -X POST \
-H "Authorization: Bearer $JWT_TOKEN" \
-H "Content-Type: application/json" \
https://api.getdropstream.com/warehouses \
-d @- <<EOF
{"customer_id":"1234",
"description":"My Skubana Warehouse",
"platform":"skubana",
"adapter":{"access_token":"abcdef123456"}}
EOF
curl -X POST \
-H "Authorization: Bearer $JWT_TOKEN" \
https://api.getdropstream.com/warehouses \
-d @- <<EOF
customer_id=1234&
description=My New Warehouse&
platform=skubana&
adapter[access_token]=abcdef123456
EOF
Response:
{"id":2345}
HTTP/1.1 201 Created
Update¶
To update an existing warehouse, make a PATCH
request to /warehouses/{id}
with the updated properties.
Endpoint | /warehouses/{warehouse_id} |
---|---|
Method | PATCH |
Auth | JWT |
Payload | the updated warehouse properties |
Success status | HTTP 204 |
Example
curl -X PATCH \
-H "Authorization: Bearer $JWT_TOKEN" \
-H "Content-Type: application/json" \
https://api.getdropstream.com/warehouses/1234 \
-d @- <<EOF
{"description":"My default warehouse"}
EOF
curl -X PATCH \
-H "Authorization: Bearer $JWT_TOKEN" \
https://api.getdropstream.com/warehouses/1234 \
-d @- <<EOF
description=My default warehouse
EOF
Response:
HTTP/1.1 204 No Content
Enable¶
To enable a warehouse, make a PATCH
request to /warehouses
with a new "enabled_at"
dateString value.
Endpoint | /warehouses/{warehouse_id} |
---|---|
Method | PATCH |
Auth | JWT |
Payload | "enabled_at" : dateString |
Success status | 204 |
Example
curl -X PATCH \
-H "Authorization: Bearer $JWT_TOKEN" \
-H "Content-Type: application/json" \
https://api.getdropstream.com/warehouses/5185 \
-d @- <<EOF
{ "enabled_at" : "2020-08-19T14:57:20.000Z" }
EOF
curl -X PATCH \
-H "Authorization: Bearer $JWT_TOKEN" \
https://api.getdropstream.com/warehouses/5185 \
-d @- <<EOF
enabled_at=2020-08-19T14:57:20.000Z
EOF
Response:
HTTP/1.1 204 No Content
Disable¶
To disable a warehouse, set its "enabled_at"
value to null
.
Endpoint | /warehouses/{warehouse_id} |
---|---|
Method | PATCH |
Auth | JWT |
Payload | "enabled_at" : null |
Success status | 204 |
Example
curl -X PATCH \
-H "Authorization: Bearer $JWT_TOKEN" \
-H "Content-Type: application/json" \
https://api.getdropstream.com/warehouses/5185 \
-d @- <<EOF
{ "enabled_at" : null }
EOF
curl -X PATCH \
-H "Authorization: Bearer $JWT_TOKEN" \
https://api.getdropstream.com/warehouses/5185 \
-d @- <<EOF
enabled_at=
EOF
Response:
HTTP/1.1 204 No Content