Skip to main content
POST
/
v1
/
product-collections
Create Product Collection
curl --request POST \
  --url https://{cluster}.voucherify.io/v1/product-collections \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-App-Id: <api-key>' \
  --header 'X-App-Token: <api-key>' \
  --data '{
  "type": "STATIC",
  "name": "<string>",
  "products": [
    {
      "id": "prod_0a41bcf807c5fcaaf6",
      "product_id": "<string>",
      "object": "sku"
    }
  ]
}'
{
  "id": "<string>",
  "name": "All Products",
  "type": "STATIC",
  "filter": {
    "junction": "and"
  },
  "products": [
    {
      "id": "prod_0a41bcf807c5fcaaf6",
      "product_id": "<string>",
      "object": "sku"
    }
  ],
  "created_at": "2021-12-09T12:51:29.898Z",
  "object": "products_collection"
}

Authorizations

X-App-Id
string
header
required
X-App-Token
string
header
required
Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Body

application/json
  • Product Collections Create Static Request Body
  • Product Collections Create Dynamic (Auto Update) Request Body

Response body schema for POST v1/product-collections.

type
enum<string>
default:STATIC
required

Show that the product collection is static (manually selected products).

Available options:
STATIC
name
string
required

Unique user-defined product collection name.

products
Product Collections Create Dynamic Request Body Products Item · object[]

Defines a set of products for a STATIC product collection type.

Response

200 - application/json

Returns information about the newly created collection, as well as an array containing the products.

Response body schema for POST v1/product-collections. This is an object representing a product collection base.

id
string
required

Product collection ID.

name
string
required

Unique user-defined product collection name.

Example:

"All Products"

type
enum<string>
required

Describes whether the product collection is dynamic (products come in and leave based on set criteria) or static (manually selected products).

Available options:
STATIC,
AUTO_UPDATE
created_at
string<date-time>
required

Timestamp representing the date and time when the product collection was created. The value is shown in the ISO 8601 format.

Example:

"2021-12-09T12:51:29.898Z"

object
enum<string>
default:products_collection
required

The type of the object represented by JSON. This object stores information about the static product collection.

Available options:
products_collection
filter
object

Defines a set of criteria and boundary conditions for an AUTO_UPDATE product collection type.

products
Product Collections Item Products Item · object[]

Defines a set of products for a STATIC product collection type.

I