Docs

Create Variants

POST /resourceTypes/{resourceTypeId}/variants

POST/resourceTypes/{resourceTypeId}/variants

Required Tokens

FieldTypeRequiredDescription
BearerAuthorization: Bearer <api-key>OptionalYour API key. Pass it as the Bearer token on every request.
Event tokenx-Event-TokenOptionalRun **Get Tokens** in the Authorization folder, or call `GET /Events/{eventId}/authorize` manually.

Creates one or more variants. Every Variant-role attribute on the type needs a value, and no two variants may pin the same combination.

Event scoping: This endpoint does not include {eventId} in the URL. The event is determined automatically from your x-Event-Token.

Path Parameters

FieldTypeRequiredDescription
resourceTypeIdGuidRequiredThe resource type.

Request Body

FieldTypeRequiredDescription
variantsarrayRequired`{ name, rateCardId, values: [{ resourceAttributeId, value }] }`. One per combination of the type's `Variant` attributes.

Response

201 Created. No response body.

Error Codes

HTTP StatusDescription
400No variants, a missing or duplicate combination, or a card from another type.
404Resource type not found.