Visit Main Site
Join Partner Program
Login
     
Introduction
Authentication
Documentation
Category
GET
POST
PUT
DELETE
Products
GET
POST
PUT
DELETE
Carts
GET
POST
PATCH
DELETE
Variations
GET
POST
PUT
DELETE
Currency
GET
POST
PUT
DELETE
Tax
Tax Profile
GET
POST
PUT
DELETE
Tax Rule
GET
POST
PUT
DELETE
Tax Code
GET
POST
PUT
DELETE
Tax Zone
GET
POST
PUT
DELETE
Discount
GET
POST
PUT
DELETE
Shipping
Shipping Profile
GET
POST
PUT
DELETE
Shipping Rate
GET
POST
PUT
DELETE
Shipping Rules
GET
POST
PUT
DELETE
Customer
GET
POST
PUT
DELETE
Orders
GET
POST
PATCH
Blog
GET
POST
PUT
DELETE
Settings
GET
» Variation PUT API Documentation

Updating Variation 

Endpoint: PUT /admin/variations/{variation_id}

Purpose

The PUT/admin/variations/{variation_id} allows administrators to update an existing variation by its unique ID. It supports modifying the variation's name, standard type, disposability status, and associated options. This is useful for maintaining accuracy and relevance when managing variation data.

Path Parameters

ParameterTypeDescription
variation_idIntegerThe unique ID of the variation to update.

Query Parameters

No query parameters for this endpoint.

Use Case

Administrators use this endpoint to edit existing variations. For instance, updating a variation name, changing the order of options, or setting a default option. This ensures that the system always reflects the latest and correct variation configurations.

Request Body

Parameter
Type
Description
name
String
The name of the variation.
standard
String
The type of input for the variation (text).
is_disposable
Boolean
Indicates whether the variation can be discarded after use.
options
Array
A list of variation options.
JSON
{
  "variation": {
    "name": "VARIATION_NAME",
    "standard": "VARIATION_STANDARD",
    "is_disposable": "VARIATION_IS_DISPOSABLE",
    "options": [
      {
        "id": "VARIATION_OPTION_ID",
        "label": "VARIATION_OPTION_LABEL",
        "value": "VARIATION_OPTION_VALUE",
        "order": "VARIATION_OPTION_ORDER",
        "default": "VARIATION_OPTION_DEFAULT"
      }
    ]
  }
}

Response

The response delivers the updated variation object with all associated properties, including the variation ID, name, standard type, and disposability flag. The options array reflects the current list of variation choices, each containing identifiers, labels, values, default status, order, and image placeholders. This ensures the client application is synchronized with the updated variation configuration, enabling accurate product management and display of variations on the storefront.

PUT
https://{your_site_domain}/api/v4/admin/variations/{variation_id}
Try It Out
JSON
{
  "variation": {
    "id": "VARIATION_ID",
    "name": "VARIATION_NAME",
    "standard": "VARIATION_STANDARD",
    "is_disposable": "VARIATION_IS_DISPOSABLE",
    "options": [
      {
        "id": "VARIATION_OPTION_ID",
        "label": "VARIATION_OPTION_LABEL",
        "value": "VARIATION_OPTION_VALUE",
        "order": "VARIATION_OPTION_ORDER",
        "default": "VARIATION_OPTION_DEFAULT",
        "image": "VARIATION_OPTION_IMAGE"
      }
    ]
  }
}
Terms and Conditions
Privacy Policy

© 2024 WebCommander | All Rights Reserved

contact@webcommander.com
1300 797 571

WebCommander
About Us
Features
Pricing
Compare
Partners
Contact Us
Resource
Find a Partner
Help Centre
Community
Blog
Solutions
Inventory Management
Omnichannel Sales
Ecommerce Automation
B2B Ecommerce
Headless Commerce
Website Design and Performance