PXM Products/
PXM Product Variations/
PXM Product Variation Options API/
Create an Option

Create an Option

POST Create a Product Variation Option

https://api.moltin.com/pcm/variations/:variationID/options

Parameters

Path parameters

NameRequiredTypeDescription
variationIDRequiredstringThe ID of the variation for which you want to create options.

Headers

NameRequiredTypeDescription
AuthorizationRequiredstringThe Bearer token required to get access to the API.

Body

NameRequiredTypeDescription
typeRequiredstringThe type of the resource object. You must use product-variation-option.
nameRequiredstringThe name of the option displayed in the storefront.
descriptionRequiredstringThe description for the option.

Request Example

curl -X POST https://api.moltin.com/pcm/variations/684bceee-0ee3-4f43-ac32-50bb44c1eee5/options \
     -H "Authorization: Bearer XXXX" \
     -H "Content-Type: application/json" \
     -d $'{
        "data": {
           "type": "product-variation-option"
           "attributes": {
              "description": "Our most popular color",
              "name": "Black"
            }
		     }
    }'

Response Example

201 Created

{
    "data": {
        "type": "product-variation-option",
        "id": "eb84ffe3-a723-4790-8019-d28e4695da14",
        "attributes": {
            "description": "Our most popular color",
            "name": "Black"
        }
    }
}

Was this helpful?

Previous
Get an Option

Learn

Docs