Update a Product

Update by ID

PUT https://api.moltin.com/v2/products/:id

Updating an existing product.

Path Parameters

NameTypeDescription

id

string

The ID of the product you wish to update

Headers

NameTypeDescription

X-Moltin-Language

string

If set, the system will store a record of the translation in the specific language

Authorization

string

The Bearer token to grant the API access

Request Body

NameTypeDescription

id

string

Represents the id of object being updated.

type

string

Represents the type of object being updated. (should be product)

name

string

A human readable name for this product

slug

string

A unique slug for this product

sku

string

A unique SKU for this product

mange_stock

boolean

True if moltin should manage stock, false if not

description

string

A human readable description of the product

price

array

An array of prices, one for each currency

price.amount

string

Value of the price

price.currency

string

Currency of this price. (3 letter ISO)

price.includes_tax

boolean

true if relevant taxes have been included in the price. false if not

status

string

draft, live

commodity_type

string

physical/digital

{
    "data": {
        "type": "product",
        "id": "b47372eb-6f13-4bcb-ad06-329f4ffee69d",
        "name": "A Product",
        "slug": "a-product-1",
        "sku": "SP01-{COLOUR}-new-2",
        "manage_stock": false,
        "description": "Some description",
        "price": [
            {
                "amount": 6999,
                "currency": "GBP",
                "includes_tax": true
            },
            {
                "amount": 7499,
                "currency": "USD",
                "includes_tax": true
            }
        ],
        "status": "live",
        "commodity_type": "physical",
        "meta": {
            "timestamps": {
                "created_at": "2018-05-11T20:07:56+00:00",
                "updated_at": "2018-05-12T00:50:11+00:00"
            },
            "display_price": {
                "with_tax": {
                    "amount": 7499,
                    "currency": "USD",
                    "formatted": "$74.99"
                },
                "without_tax": {
                    "amount": 7499,
                    "currency": "USD",
                    "formatted": "$74.99"
                }
            },
            "stock": {
                "level": 0,
                "availability": "out-stock"
            }
        },
        "relationships": {
            "categories": {
                "data": [
                    {
                        "type": "category",
                        "id": "3acf1815-ef09-44df-a6d3-e3e702663524"
                    }
                ]
            },
            "collections": {
                "data": [
                    {
                        "type": "collection",
                        "id": "10229491-7dbb-424d-be08-80c5735795cc"
                    }
                ]
            }
        }
    }
}
curl -X "PUT" https://api.moltin.com/v2/products/:id \
     -H "Authorization: Bearer XXXX" \
     -H "Content-Type: application/json" \
     -H "X-Moltin-Language: en" \ # Optional language header
     -d $'{
        "data": {
            "type": "product",
            "id": "XXXX",
            "name": "Updated product name"
        }
    }'

Last updated