PXM Products/
PXM Product Variations/
PXM Product Variations API/
Create a Variation

Create a Variation

POST Create a Variation

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

Parameters

Headers

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

Body

NameRequiredTypeDescription
typeRequiredstringThe type of resource object. You must use product-variation.
attributes.nameRequiredstringThe variation name.

Request Example

curl -X POST https://api.moltin.com/pcm/variations \
     -H "Authorization: Bearer XXXX" \
     -H "Content-Type: application/json" \
     -d $'{
        "data": {
            "type": "product-variation",
            "attributes": {
                "name": "color"
            }
        }
    }'

Response Example

201 Created

{
    "data": {
        "type": "product-variation",
        "id": "8b9f9d4d-6d17-4113-b028-d54de3555bdf",
        "attributes": {
            "name": "color"
        },
        "meta": {
            "owner": "store"
        }
    }
}

Was this helpful?

Previous
Get a Variation

Learn

Docs