Skip to content

/variant_collections endpoint

The /variant_collections endpoint provides methods for listing, creating, and updating variant collections in DropStream.

List

To get a list of variant collections and their properties, make a GET request to /variant_collections.

Endpoint/variant_collections
MethodGET
AuthJWT
Success statusHTTP 200
Response (JSON)Array of all variant_collection objects
Example
curl -H "Authorization: Bearer $JWT_TOKEN" \
    https://api.getdropstream.com/variant_collections

Response:

[
  {
    "name": "Shoes",
    "product_ids": [
      12345,
      23456,
      34567
    ]
  }
]
HTTP/1.1 200 OK

Create

To create a new variant collection, make a POST request to /variant_collections with the properties of the new variant_collection.

Endpoint/variant_collection
MethodPOST
AuthJWT
PayloadProperties of the new variant_collection object
Required properties
  • name — string, the name of the new collection
  • product_ids — array of product ids that belong to this collection
Success statusHTTP 201
Response (JSON)id of the new variant_collection object
Example
curl -X POST \
    -H "Authorization: Bearer $JWT_TOKEN" \
    -H "Content-Type: application/json" \
    https://api.getdropstream.com/variant_collections \
    -d @- <<EOF
{
  "name": "Shoes",
  "product_ids": [
    12345,
    23456,
    34567
  ]
}
EOF
curl -X POST \
    -H "Authorization: Bearer $JWT_TOKEN" \
    https://api.getdropstream.com/variant_collections \
    -d @- <<EOF
name=Shoes&
product_ids=[12345,23456,34567]
EOF

Response:

{"id":45678}
HTTP/1.1 201 Created

Update

To update an existing variant collection, make a PATCH request to /variant_collections/{id} with the updated properties.

Endpoint/variant_collections/{variant_collection_id}
MethodPATCH
AuthJWT
Payloadthe updated variant_collection properties
Success statusHTTP 204
Example
curl -X PATCH \
    -H "Authorization: Bearer $JWT_TOKEN" \
    -H "Content-Type: application/json" \
    https://api.getdropstream.com/variant_collections/1234 \
    -d @- <<EOF
{
  "name": "Sandals",
  "product_ids": [
    56789,
    67890
  ]
}
EOF
curl -X PATCH \
    -H "Authorization: Bearer $JWT_TOKEN" \
    https://api.getdropstream.com/variant_collections/1234 \
    -d @- <<EOF
name=Sandals&
product_ids=[56789,67890]
EOF

Response:

HTTP/1.1 204 No Content