younifyd
Menu

Update Product Variation By Id

This API lets you make changes to a product variation.

PUT/products/{productId}/variations/{variationId}

Use it in a workflow

  1. Add a step and choose the WooCommerce connector.
  2. Pick the Update Product Variation By Id action (under Product variations).
  3. Fill in the fields below, then reference the result from later steps as {{updateProductVariationById.response.data}}.

Request

Path parameters

productIdintegerrequired

ID of parent product for variation to update

variationIdintegerrequired

ID of variation to update

Request body

Enter the body as JSON in the step's Body field.

idinteger

Unique identifier for the resource. read-only

date_createdstring (date-time)

The date the variation was created, in the site's timezone. read-only

date_created_gmtstring (date-time)

The date the variation was created, as GMT. read-only

date_modifiedstring (date-time)

The date the variation was last modified, in the site's timezone. read-only

date_modified_gmtstring (date-time)

The date the variation was last modified, as GMT. read-only

descriptionstring

Variation description.

permalinkstring

Variation URL. read-only

skustring

Unique identifier.

pricestring

Current variation price. read-only

regular_pricestring

Variation product price.

sale_pricestring

Variation sale price.

date_on_sale_fromstring (date-time)

Start date of sale price, in the site's timezone.

date_on_sale_from_gmtstring (date-time)

Start date of sale price, as GMT.

date_on_sale_tostring (date-time)

End date of sale price, in the site's timezone.

date_on_sale_to_gmtstring (date-time)

End date of sale price, as GMT.

on_saleboolean

Shows if the variation is on sale. read-only

statusstring

Variation status. Options: draft, pending, private and publish. Default is publish.

purchasableboolean

Shows if the variation can be bought. read-only

virtualboolean

If the variation is virtual. Default is false.

downloadableboolean

If the variation is downloadable. Default is false.

downloadsarray<object>

List of downloadable files.

idstring

File ID.

namestring

File name.

filestring

File URL.

download_limitinteger

Number of times downloadable files can be downloaded after purchase. Default is -1.

download_expiryinteger

Number of days until access to downloadable files expires. Default is -1.

tax_statusstring

Tax status. Options: taxable, shipping and none. Default is taxable.

tax_classstring

Tax class.

manage_stockboolean

Stock management at variation level. Default is false.

stock_quantityinteger

Stock quantity.

stock_statusstring

Controls the stock status of the product. Options: instock, outofstock, onbackorder. Default is instock.

backordersstring

If managing stock, this controls if backorders are allowed. Options: no, notify and yes. Default is no.

backorders_allowedboolean

Shows if backorders are allowed. read-only

backorderedboolean

Shows if the variation is on backordered. read-only

weightstring

Variation weight.

dimensionsobject
lengthstring

Product length.

widthstring

Product width.

heightstring

Product height.

shipping_classstring

Shipping class slug.

shipping_class_idinteger

Shipping class ID.

imageobject
idinteger

Image ID.

date_createdstring (date-time)

The date the image was created, in the site's timezone. read-only

date_created_gmtstring (date-time)

The date the image was created, as GMT. read-only

date_modifiedstring (date-time)

The date the image was last modified, in the site's timezone. read-only

date_modified_gmtstring (date-time)

The date the image was last modified, as GMT. read-only

srcstring

Image URL.

namestring

Image name.

altstring

Image alternative text.

attributesarray<object>

List of attributes.

idinteger

Attribute ID.

namestring

Attribute name.

optionstring

Selected attribute term name. Applicable only for Product represents SKU (variation)

slugstring

Attribute slug.

typestring

Attribute type.

order_bystring

Sort order.

has_archivesboolean

Enable/Disable attribute archives.

menu_orderinteger

Menu order, used to custom sort products.

meta_dataarray<object>

Meta data properties.

idinteger

Meta ID.

keystring

Meta key.

valueobject

Meta value.

display_keystring

Meta key for UI display.

display_valueobject

Meta value for UI display.

json
{
  "id": 0,
  "date_created": "2025-01-01T00:00:00Z",
  "date_created_gmt": "2025-01-01T00:00:00Z",
  "date_modified": "2025-01-01T00:00:00Z",
  "date_modified_gmt": "2025-01-01T00:00:00Z",
  "description": "string",
  "permalink": "string",
  "sku": "string",
  "price": "string",
  "regular_price": "string",
  "sale_price": "string",
  "date_on_sale_from": "2025-01-01T00:00:00Z"
}

Response

Returns 200 with an object. Read it in later steps with {{updateProductVariationById.response.data.<field>}}.

idinteger

Unique identifier for the resource. read-only

date_createdstring (date-time)

The date the variation was created, in the site's timezone. read-only

date_created_gmtstring (date-time)

The date the variation was created, as GMT. read-only

date_modifiedstring (date-time)

The date the variation was last modified, in the site's timezone. read-only

date_modified_gmtstring (date-time)

The date the variation was last modified, as GMT. read-only

descriptionstring

Variation description.

permalinkstring

Variation URL. read-only

skustring

Unique identifier.

pricestring

Current variation price. read-only

regular_pricestring

Variation product price.

sale_pricestring

Variation sale price.

date_on_sale_fromstring (date-time)

Start date of sale price, in the site's timezone.

date_on_sale_from_gmtstring (date-time)

Start date of sale price, as GMT.

date_on_sale_tostring (date-time)

End date of sale price, in the site's timezone.

date_on_sale_to_gmtstring (date-time)

End date of sale price, as GMT.

on_saleboolean

Shows if the variation is on sale. read-only

statusstring

Variation status. Options: draft, pending, private and publish. Default is publish.

purchasableboolean

Shows if the variation can be bought. read-only

virtualboolean

If the variation is virtual. Default is false.

downloadableboolean

If the variation is downloadable. Default is false.

downloadsarray<object>

List of downloadable files.

idstring

File ID.

namestring

File name.

filestring

File URL.

download_limitinteger

Number of times downloadable files can be downloaded after purchase. Default is -1.

download_expiryinteger

Number of days until access to downloadable files expires. Default is -1.

tax_statusstring

Tax status. Options: taxable, shipping and none. Default is taxable.

tax_classstring

Tax class.

manage_stockboolean

Stock management at variation level. Default is false.

stock_quantityinteger

Stock quantity.

stock_statusstring

Controls the stock status of the product. Options: instock, outofstock, onbackorder. Default is instock.

backordersstring

If managing stock, this controls if backorders are allowed. Options: no, notify and yes. Default is no.

backorders_allowedboolean

Shows if backorders are allowed. read-only

backorderedboolean

Shows if the variation is on backordered. read-only

weightstring

Variation weight.

dimensionsobject
lengthstring

Product length.

widthstring

Product width.

heightstring

Product height.

shipping_classstring

Shipping class slug.

shipping_class_idinteger

Shipping class ID.

imageobject
idinteger

Image ID.

date_createdstring (date-time)

The date the image was created, in the site's timezone. read-only

date_created_gmtstring (date-time)

The date the image was created, as GMT. read-only

date_modifiedstring (date-time)

The date the image was last modified, in the site's timezone. read-only

date_modified_gmtstring (date-time)

The date the image was last modified, as GMT. read-only

srcstring

Image URL.

namestring

Image name.

altstring

Image alternative text.

attributesarray<object>

List of attributes.

idinteger

Attribute ID.

namestring

Attribute name.

optionstring

Selected attribute term name. Applicable only for Product represents SKU (variation)

slugstring

Attribute slug.

typestring

Attribute type.

order_bystring

Sort order.

has_archivesboolean

Enable/Disable attribute archives.

menu_orderinteger

Menu order, used to custom sort products.

meta_dataarray<object>

Meta data properties.

idinteger

Meta ID.

keystring

Meta key.

valueobject

Meta value.

display_keystring

Meta key for UI display.

display_valueobject

Meta value for UI display.

json
{
  "id": 0,
  "date_created": "2025-01-01T00:00:00Z",
  "date_created_gmt": "2025-01-01T00:00:00Z",
  "date_modified": "2025-01-01T00:00:00Z",
  "date_modified_gmt": "2025-01-01T00:00:00Z",
  "description": "string",
  "permalink": "string",
  "sku": "string",
  "price": "string",
  "regular_price": "string",
  "sale_price": "string",
  "date_on_sale_from": "2025-01-01T00:00:00Z"
}

Need more? See the WooCommerce guide for connection setup and behaviour shared by every action.