/stores
endpoint¶
The /stores
endpoint provides methods for listing, creating, and updating the properties of DropStream stores.
List¶
To get a list of stores and their properties, make a GET
request to /stores
.
Endpoint | /stores |
---|---|
Method | GET |
Auth | JWT |
Success status | HTTP 200 |
Response (JSON) | array of stores |
Example
curl -H "Authorization: Bearer $JWT_TOKEN" \
https://api.getdropstream.com/stores
Response:
[
{
"id": 4567,
"customer_id": 1234,
"name": "My Store",
"description": "My Amazon Store",
"url": null,
"platform": "amazon",
"created_at": "2020-08-19T14:57:20.000Z",
"enabled_at": "2020-08-19T14:57:20.000Z",
"order_imported_at": null,
"inventory_updated_at": null
},
...
{
"id": 5678,
...
}
]
HTTP/1.1 200 OK
Create¶
To create a new store, make a POST
request to /store
with the store properties.
Endpoint | /stores |
---|---|
Method | POST |
Auth | JWT |
Payload | Properties of the new store object |
Required properties |
|
Success status | HTTP 201 |
Response (JSON) | id of the new store |
Example
curl -X POST \
-H "Authorization: Bearer $JWT_TOKEN" \
-H "Content-Type: application/json" \
https://api.getdropstream.com/stores \
-d @- <<EOF
{"customer_id":"1234",
"name":"My Store",
"description":"My Sellbrite Store",
"platform":"sellbrite",
"adapter":
{"auth_token":"abc123xyz890",
"secret_key":"mysecret"}}
EOF
curl -X POST \
-H "Authorization: Bearer $JWT_TOKEN" \
https://api.getdropstream.com/stores \
-d @- <<EOF
customer_id=1234&
name=My New Store&
platform=sellbrite&
adapter[auth_token]=abc123xyz890&
adapter[secret_key]=mysecret
EOF
Response:
{"id":2345}
HTTP/1.1 201 Created
Update¶
To update an existing store, make a PATCH
request to /stores/{id}
with the updated properties.
Endpoint | /stores/{store_id} |
---|---|
Method | PATCH |
Auth | JWT |
Payload | the updated store properties |
Success status | HTTP 204 |
Example
curl -X PATCH \
-H "Authorization: Bearer $JWT_TOKEN" \
-H "Content-Type: application/json" \
https://api.getdropstream.com/stores/1234 \
-d @- <<EOF
{"description":"My Updated Store"}
EOF
curl -X PATCH \
-H "Authorization: Bearer $JWT_TOKEN" \
https://api.getdropstream.com/stores/1234 \
-d @- <<EOF
description=My Updated Store
EOF
Response:
HTTP/1.1 204 No Content
Enable¶
To enable a store, make a PATCH
request to /stores
with a new "enabled_at"
dateString value.
Endpoint | /stores/{store_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/stores/5603 \
-d @- <<EOF
{ "enabled_at" : "2020-08-19T14:57:20.000Z" }
EOF
curl -X PATCH \
-H "Authorization: Bearer $JWT_TOKEN" \
https://api.getdropstream.com/stores/5603 \
-d @- <<EOF
enabled_at=2020-08-19T14:57:20.000Z
EOF
Response:
HTTP/1.1 204 No Content
Disable¶
To disable a store, set its "enabled_at"
value to null
.
Endpoint | /stores/{store_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/stores/5603 \
-d @- <<EOF
{ "enabled_at" : null }
EOF
curl -X PATCH \
-H "Authorization: Bearer $JWT_TOKEN" \
https://api.getdropstream.com/stores/5603 \
-d @- <<EOF
enabled_at=
EOF
Response:
HTTP/1.1 204 No Content