Salla Docs
Merchant API
  • Merchant API
  • Salla OAuth 2.0
Partner APIs
  • App API
  • Shipment API
Storefront
  • Twilight Engine
  • Twilight SDK
  • Web Components
  • Change Log
Salla CLI
Merchant API
  • Merchant API
  • Salla OAuth 2.0
Partner APIs
  • App API
  • Shipment API
Storefront
  • Twilight Engine
  • Twilight SDK
  • Web Components
  • Change Log
Salla CLI
Salla - Opensource
Salla - Developers Community
  1. Product Variants
  • Welcome 👋
  • Get Started
  • Create Your First App
  • Authorization
  • Webhooks
  • Conditional Webhooks
  • Security Considerations
  • Multi-Language Support
  • Responses
  • Pagination
  • Rate Limiting
  • Versioning
  • Change Log
  • Support
  • APIs
    • Orders
      • Create Order
      • List Orders
      • Order Details
      • Create Drafted Order
      • Update Order
      • Duplicate Order
      • Order Actions
    • Order Status
      • Update Order Status
      • Create Custom Order Status
      • List Order Statuses
      • Order Status Details
      • Update Custom Order Status
      • Update Bulk Orders Statuses
      • Sort Orders Statuses
    • Order Histories
      • List Order Histories
      • Create Order History
    • Order Tags
      • Create Order Tag
      • List Order Tags
      • Delete Order Tag
    • Order Invoice
      • Create Invoice
      • List Invoices
      • Invoice Details
      • Send Order Invoice
      • Create Order Invoice
    • Order Reservations
      • List Order Reservations
    • Order Items
      • List Order Items
      • Create Order Item
      • Update Order Item
      • Delete Order Item
    • Products
      • Create Product
      • List Products
      • Product Details
      • Update Product
      • Delete Product
      • Change Product Status
      • Product Details By SKU
      • Update Product By SKU
      • Delete Product By SKU
      • Update Product Price By SKU
      • Update Bulk Product Prices
      • Import Products
      • Bulk Product Actions
    • Product Options
      • Create Product Option
      • Product Option Details
      • Update Product Option
      • Delete Product Option
    • Product Quantity
      • List Product Quantities
      • Update Bulk Quantities
      • List Quantity Change Reasons
      • List Quantity Audit
      • Update Bulk Quantities by SKU
      • Update Quantity
      • Update Quantity By SKU
    • Product Variants
      • List Product Variants
        GET
      • Product Variant Details
        GET
      • Update Product Variant
        PUT
      • Update Product Variant Quantity
        PUT
    • Product Tags
      • Create Product Tag
      • List Product Tags
    • Product Images
      • Attach Image by SKU
      • Attach Video by SKU
      • Attach Youtube Video
      • Attach Image
      • Update Image
      • Delete Image
    • Product Option Values
      • Create Product Option Value
      • Product Option Value Details
      • Update Product Option Value
      • Delete Product Option Value
    • Abandoned Carts
      • List Abandoned Carts
      • Abandoned Cart Details
    • Customer Groups
      • Create Customer Group
      • List Customer Groups
      • Add Customers To Group Customer
      • Update Default Customer Group
      • Update Customer Group
      • Delete Customer Group
    • Customers
      • Create Customer
      • List Customers
      • Customer Details
      • Update Customer
      • Delete Customer
      • Ban Customer
      • Un-Ban customer
      • Import Customers
    • Digitals Product
      • Attach Digital Code
      • Attach Digital File
      • Delete Digital File
    • Categories
      • Create Category
      • List Categories
      • Category Details
      • Update Category
      • Delete Category
      • Category Children
      • Categories Search
      • List Category Products
    • Exports
      • Export Orders
      • Exports Logs
      • List Export Templates
      • Create Export Template
      • Update Export Template
      • Delete Export Template
      • List Export Columns
      • Export Customers
      • Export Custom URLs
      • Export Products
    • Shipments
      • Create Shipment
      • List Shipments
      • Shipment Details
      • Shipment Tracking
      • Update Shipment Details
      • Cancel Shipment
      • Return Shipment
    • Shipping Companies
      • List Shipping Companies
      • Shipping Company Details
      • List Estimate Rates
      • Create Shipping Company
      • Update Shipping Company
      • Delete Shipping Company
      • Shipping Company Options
    • Shipping Zones
      • Create Shipping Zone
      • List Shipping Zones
      • Shipping Zone Details
      • Update Shipping Zone
      • Delete Shipping Zone
    • Shipping Rules
      • List Shipping Rules
      • Shipping Rule Details
      • Delete Shipping Rule
    • Countries
      • List Countries
      • Country Details
    • Product Option Templates
      • List Option Templates
      • Option Template Details
      • Delete Option Template
      • Update Option Template
      • Create Option Template
    • Taxes
      • Create Tax
      • List Taxes
      • Tax Details
      • Update Tax
      • Delete Tax
    • Coupons
      • Create Coupon
      • List Coupons
      • Coupon Details
      • Update Coupon
      • Delete Coupon
      • List Coupon Codes
    • Affiliates
      • List Affiliates
      • Affiliate Details
      • Create Affiliate
      • Update Affiliate
      • Delete Affiliate
    • Order Assignment
      • List Auto Assignment Rules
      • Order Assigned Employees Details
      • Update Auto Assignment Rule
      • Create Auto Assignment Rules
    • Special Offers
      • Create Special Offer
      • List Special Offers
      • Special Offer Details
      • Update Special Offer
      • Delete Special Offer
      • Change Special Offer Status
    • Transactions
      • List Transactions
      • Transaction Details
      • Update Transaction
    • Payments
      • Available Payment Methods
      • List Banks
      • Payment Bank Details
    • Settlements
      • List Instant Settlements
      • Create Instant Settlement
      • Update Instant Settlement
      • Instant Settlement Details
    • Settings
      • Settings List
      • Update Setting Slug
      • Setting Details
    • Merchant
      • User Information Details
      • Store Information
    • Brands
      • Create Brand
      • List Brands
      • Brand Details
      • Update Brand
      • Delete Brand
    • Branches
      • Create Branch
      • List Branches
      • Branch Details
      • Update Branch
      • Delete Branch
    • Currencies
      • Activate Currencies
      • List Currencies
      • List Available Currencies
    • SEO
      • List SEO Settings
      • Update SEO Settings
    • Cities
      • List Cities
    • DNS Records
      • List DNS Records
      • Create DNS Record
      • Delete DNS Record
    • Languages
      • Add Language
      • List Languages
      • Update Language
    • Employees
      • List Employees
    • Advertisements
      • Create Advertisement
      • List Advertisements
      • Advertisement Details
      • Update Advertisement
      • Delete Advertisement
    • Webhooks
      • List Active Webhooks
      • List Events
      • Register Webhook
      • Deactivate Webhook
      • Update Webhook
    • Custom URLs
      • Import Custom URLs
    • Loyalty Points
      • Customer Loyalty Points
      • Update Customer Loyalty Points
    • Reviews
      • List Reviews
      • Review Details
      • Update Review
  • Webhooks - Store Events
    • Order
    • Product
    • Customer
    • Shippings
    • Shipments
    • Brand
    • Invoice
    • Category
    • Store
    • Special Offer
    • Cart
    • Miscellaneous
  1. Product Variants

Update Product Variant

Production
https://api.salla.dev/admin/v2
Production
https://api.salla.dev/admin/v2
PUT
https://api.salla.dev/admin/v2
/products/variants/{variant}
Product Variants
Last modified:2025-02-02 12:23:10
This endpoint allows you to update variant details by passing the variant as a path parameter.
Important
All variables in the update variant body request are optional.
Updating one variable at a time is possible, but at least one of the variables must be in the body request payload. Otherwise, an error will be shown if you send an empty body request payload.
Scopes
products.read_write- Products Read & Write

Request

Authorization
Add the parameter
Authorization
to Headers
,whose value is to concatenate the Token after the Bearer.
Example:
Authorization: Bearer ********************
Path Params
variant
string 
required
Unique identification number assigned to a Product SKU Variant . List of Product SKU IDscan be found here.
Body Params application/json
sku
string 
required
Stock Keeping Unit is a unique alphanumeric code used to identify and manage specific product variant within a company's inventory system.
barcode
string 
required
The barcode value of product variant.
price
number 
required
The price of the product variant.
sale_price
number 
required
The sale price of the product variant. Example: 90.50
cost_price
number 
required
The original or purchase price at which a product variant or item was acquired by a business or individual, excluding any additional expenses or markups.
stock_quantity
integer 
required
Amount of the product variant total stock quantity for the default branch, it well ignored if the quantities has been used in the body
weight
integer 
required
Product Variant Weight.
mpn
integer 
required
Manufacturer Part Number.
gtin
integer 
required
Global Trade Item Number, a unique and standardized identifier used to uniquely represent products, items, or services in the global marketplace, to enable efficient tracking and management across supply chains and retail sector. If product_type is set to any of the following: product, group_products, codes, digital, donating then value can be set. Otherwise, it can be set to null
notify_low
integer 
optional
Sets a threshold value to trigger notifications when inventory falls below.
quantities
array [object {3}] 
optional
Optional for manage multi-branch quanaties
branch
integer 
required
The branch id where you need to update the quantity
quantity
integer 
required
The new quantity
reason_id
integer 
optional
The reason ID of the quantity change
Example
{
  "sku": "23-TD23-32",
  "barcode": "abc01",
  "price": 96.33,
  "sale_price": 90.5,
  "cost_price": 100.33,
  "stock_quantity": 4,
  "weight": 3,
  "mpn": 43242342,
  "gtin": 54353453,
  "quantities": [
    {
      "branch": 863926575,
      "quantity": 100,
      "reason_id": 303342349
    },
    {
      "branch": 989845784,
      "quantity": 89,
      "reason_id": 303342349
    }
  ]
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request PUT 'https://api.salla.dev/admin/v2/products/variants/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "sku": "23-TD23-32",
    "barcode": "abc01",
    "price": 96.33,
    "sale_price": 90.5,
    "cost_price": 100.33,
    "stock_quantity": 4,
    "weight": 3,
    "mpn": 43242342,
    "gtin": 54353453,
    "quantities": [
        {
            "branch": 863926575,
            "quantity": 100,
            "reason_id": 303342349
        },
        {
            "branch": 989845784,
            "quantity": 89,
            "reason_id": 303342349
        }
    ]
}'

Responses

🟢201Updated Successfully
application/json
Body
status
number 
optional
Response status code, a numeric or alphanumeric identifier used to convey the outcome or status of a request, operation, or transaction in various systems and applications, typically indicating whether the action was successful, encountered an error, or resulted in a specific condition.
success
boolean 
optional
Response flag, boolean indicator used to signal a particular condition or state in the response of a system or application, often representing the presence or absence of certain conditions or outcomes.
data
object (ProductVariant) 
optional
Detailed structure of the product variant model object showing its fields and data types.
id
number 
required
A unique identifier associated with a specific variant of a product or item.
price
object 
required
The price of the product variant.
regular_price
object 
required
The regular price of the product variant.
cost_price
object 
required
The purchase price excluding any additional expenses.
sale_price
object 
required
The sale price of the product variant.
has_special_price
boolean 
read-onlyrequired
Whether or not the product variant has a special price.
stock_quantity
integer 
required
The amount of the product variant total stock quantity. Only updated if the store feature manage product by branches is not activated.
Example:
4
unlimited_quantity
boolean 
required
Whether or not the product variant is of unlimit quantity.
notify_low
integer 
required
Sets a threshold value to trigger notifications when inventory falls below.
barcode
string 
required
The barcode value of product variant.
Example:
abc01
sku
string 
required
A unique Stock Keeping Unit (SKU) identifier assigned to a specific variant of a product.
Example:
23-TD23-32
mpn
string 
required
Manufacturer Part Number, a unique identifier assigned by a manufacturer to a specific product or component.
gtin
string 
required
Global Trade Item Number, a unique and standardized identifier used to uniquely represent products, in the global marketplace, to enable efficient tracking and management across supply chains and retail sectors. If product_type is set to any of the following: product, group_products, codes, digital, donating then value can be set. Otherwise, it can be set to null
updated_at
object (Date) 
required
The date and time product variant is updated.
related_options
array[integer]
required
An array for the related options to this variant.
related_option_values
array[integer]
required
An array for the values of the related options to this variant.
weight
number 
required
The numerical value that represents the mass or weight of a specific variant of a product.
Example:
3
weight_type
string 
required
Product variant weight type
Example:
kg
weight_label
string 
required
Product variant weight label representing the type of the weight.
Example:
٣ كجم
is_user_subscribed_to_sku
boolean 
read-onlyrequired
Whether or not the user subscribed for the sku.
is_default
boolean 
required
Whether or not enable showing that the product variant is the default
Example
{
  "status": 201,
  "success": true,
  "data": {
    "id": 652911549,
    "price": {
      "amount": 13.5,
      "currency": "SAR"
    },
    "sale_price": {
      "amount": 0,
      "currency": "SAR"
    },
    "cost_price": {
      "amount": 0,
      "currency": "SAR"
    },
    "stock_quantity": 3000,
    "barcode": "barcode-ABC",
    "sku": "sku-variant-1551119600",
    "related_option_values": [
      667315336
    ]
  }
}
🟠404Not Found
🟠422Error Validation
Modified at 2025-02-02 12:23:10
Previous
Product Variant Details
Next
Update Product Variant Quantity