Create Variants

Adds one or more variants to a product. This is a bulk create: the whole batch is validated first, and if any variant fails, none are created. A variant carries the price and stock of a product, and a product can't be published until it has at least one active variant with a cost. Requires a producer access token for the application.

The product must not be published. A product can have at most 15 active variants. Products of type konekt, unique_code and common_code can have only one. Labels must be unique within the product.

Which variant fields you set depends on the product's product_type, and every other one must be left out:

  • badge, multiplier, flair: builtin_source_id, the ID of an active badge, user-activated reward multiplier or flair in this application.
  • common_code: common_coupon_code.
  • unique_code: none. Add codes with coupon_codes, or with Upload Coupon Codes.
  • merchandise: color_label, color_hexcode or size. At least one is required.
  • experience: event_start and event_end.
  • konekt: provider_product_id.

Send JSON, or multipart/form-data when you upload variant images.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
required

The client ID of the application.

uuid
required

The ID of the product to add variants to.

Body Params
variants
array of objects
required
length ≥ 1

The variants to create.

variants*
string
required
length ≤ 255

Name of the variant, for example Medium, Black. Must be unique within the product.

integer | null
≥ 0

Cost to redeem, in units of the product's reward item. Can be empty while the product is a draft, but every active variant needs one to publish.

integer | null
0 to 100

Percentage taken off the cost. Setting it gives the variant a discount.

integer | null
≥ 0

Redeemable stock. Leave empty for unlimited.

integer | null
≥ 0

Stock level at or below which the variant reads as few_left.

boolean

Whether this is the default variant shown for the product.

string
length ≤ 50

Merchandise products only. Colour name, for example Midnight Blue.

string
length ≤ 7

Merchandise products only. Colour hex code, for example #1A2B3C.

string
length ≤ 25

Merchandise products only. Size label, for example M or 42.

date-time

Experience products only. Start of the event.

date-time

Experience products only. End of the event. Must be after event_start.

string
length ≤ 255

Common-code products only. The shared code handed out on every redemption.

coupon_codes
array of strings

Unique-code products only. Codes to load. A code already used on another variant in the store fails the whole request.

coupon_codes
uuid | null

Konekt products only. An active provider product in this application whose provider matches the product's redemption_provider.

uuid | null

Badge, multiplier and flair products only. The built-in entity this variant is fulfilled from.

attributes
array of objects

Key and value pairs. Both are required, and the same pair can't repeat.

attributes
images
array of objects

Variant images. Upload files with multipart/form-data, as variants[0]images[0]image and variants[0]images[0]display_order. display_order is required. Accepts JPG, PNG, GIF, WEBP and GLB, up to 3 MB each by default.

images
string

Free text, for example serialized JSON.

Responses

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json