Skip to main content
POST
/
products
/
{productId}
/
variant-options
cURL
curl --request POST \
  --url https://admin.fanfare.io/api/products/{productId}/variant-options \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "options": [
    {
      "optionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "required": true,
      "sortOrder": 123
    }
  ]
}
'
{
  "assignments": [
    {
      "option": {
        "archived": true,
        "createdAt": "2023-11-07T05:31:56Z",
        "createdBy": "<string>",
        "displayName": "<string>",
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "isRestricted": true,
        "name": "<string>",
        "organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "sortOrder": 123,
        "updatedAt": "2023-11-07T05:31:56Z",
        "updatedBy": "<string>"
      },
      "optionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "required": true,
      "sortOrder": 123,
      "values": [
        {
          "archived": true,
          "colorHex": "<string>",
          "createdAt": "2023-11-07T05:31:56Z",
          "createdBy": "<string>",
          "displayValue": "<string>",
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "isCentrallyManaged": true,
          "optionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "sortOrder": 123,
          "value": "<string>",
          "updatedAt": "2023-11-07T05:31:56Z",
          "updatedBy": "<string>"
        }
      ]
    }
  ]
}

Authorizations

Authorization
string
header
required

Fanfare secret key. Keep secret credentials on your server.

Path Parameters

productId
string
required

Body

application/json
options
object[]
required

Response

Variant options assigned successfully

assignments
object[]
required