curl --request PUT \
--url https://api.exowpee.com/v1/catalog/products/{product}/variants/{variant} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"weight": 123,
"weight_unit_id": "<string>",
"volume": 123,
"volume_unit_id": "<string>",
"is_taxable": true,
"vat_rate_id": "<string>",
"max_sellable_quantity": 123,
"max_sellable_unit_id": "<string>",
"image_id": "<string>",
"options": [
{
"name": "<string>",
"value": "<string>"
}
]
}
'import requests
url = "https://api.exowpee.com/v1/catalog/products/{product}/variants/{variant}"
payload = {
"weight": 123,
"weight_unit_id": "<string>",
"volume": 123,
"volume_unit_id": "<string>",
"is_taxable": True,
"vat_rate_id": "<string>",
"max_sellable_quantity": 123,
"max_sellable_unit_id": "<string>",
"image_id": "<string>",
"options": [
{
"name": "<string>",
"value": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
weight: 123,
weight_unit_id: '<string>',
volume: 123,
volume_unit_id: '<string>',
is_taxable: true,
vat_rate_id: '<string>',
max_sellable_quantity: 123,
max_sellable_unit_id: '<string>',
image_id: '<string>',
options: [{name: '<string>', value: '<string>'}]
})
};
fetch('https://api.exowpee.com/v1/catalog/products/{product}/variants/{variant}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.exowpee.com/v1/catalog/products/{product}/variants/{variant}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'weight' => 123,
'weight_unit_id' => '<string>',
'volume' => 123,
'volume_unit_id' => '<string>',
'is_taxable' => true,
'vat_rate_id' => '<string>',
'max_sellable_quantity' => 123,
'max_sellable_unit_id' => '<string>',
'image_id' => '<string>',
'options' => [
[
'name' => '<string>',
'value' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.exowpee.com/v1/catalog/products/{product}/variants/{variant}"
payload := strings.NewReader("{\n \"weight\": 123,\n \"weight_unit_id\": \"<string>\",\n \"volume\": 123,\n \"volume_unit_id\": \"<string>\",\n \"is_taxable\": true,\n \"vat_rate_id\": \"<string>\",\n \"max_sellable_quantity\": 123,\n \"max_sellable_unit_id\": \"<string>\",\n \"image_id\": \"<string>\",\n \"options\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.exowpee.com/v1/catalog/products/{product}/variants/{variant}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"weight\": 123,\n \"weight_unit_id\": \"<string>\",\n \"volume\": 123,\n \"volume_unit_id\": \"<string>\",\n \"is_taxable\": true,\n \"vat_rate_id\": \"<string>\",\n \"max_sellable_quantity\": 123,\n \"max_sellable_unit_id\": \"<string>\",\n \"image_id\": \"<string>\",\n \"options\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/products/{product}/variants/{variant}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"weight\": 123,\n \"weight_unit_id\": \"<string>\",\n \"volume\": 123,\n \"volume_unit_id\": \"<string>\",\n \"is_taxable\": true,\n \"vat_rate_id\": \"<string>\",\n \"max_sellable_quantity\": 123,\n \"max_sellable_unit_id\": \"<string>\",\n \"image_id\": \"<string>\",\n \"options\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"stockable_id": "<string>",
"title": "<string>",
"weight": 123,
"weight_unit_id": "<string>",
"volume": 123,
"volume_unit_id": "<string>",
"is_tracked": true,
"is_taxable": true,
"max_sellable_quantity": 123,
"max_sellable_unit_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"image": {},
"options": {},
"inventoryItem": {},
"levels": "<array>",
"units": "<array>",
"organization_id": "<string>",
"vat_rate_id": "<string>",
"tax_configuration_mode": "<string>",
"vat_rate": {},
"taxes": "<array>"
}{
"message": "<string>",
"errors": {}
}Edit a product variant
Changes the details of one variant, such as its linked image or stock item settings.
curl --request PUT \
--url https://api.exowpee.com/v1/catalog/products/{product}/variants/{variant} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"weight": 123,
"weight_unit_id": "<string>",
"volume": 123,
"volume_unit_id": "<string>",
"is_taxable": true,
"vat_rate_id": "<string>",
"max_sellable_quantity": 123,
"max_sellable_unit_id": "<string>",
"image_id": "<string>",
"options": [
{
"name": "<string>",
"value": "<string>"
}
]
}
'import requests
url = "https://api.exowpee.com/v1/catalog/products/{product}/variants/{variant}"
payload = {
"weight": 123,
"weight_unit_id": "<string>",
"volume": 123,
"volume_unit_id": "<string>",
"is_taxable": True,
"vat_rate_id": "<string>",
"max_sellable_quantity": 123,
"max_sellable_unit_id": "<string>",
"image_id": "<string>",
"options": [
{
"name": "<string>",
"value": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
weight: 123,
weight_unit_id: '<string>',
volume: 123,
volume_unit_id: '<string>',
is_taxable: true,
vat_rate_id: '<string>',
max_sellable_quantity: 123,
max_sellable_unit_id: '<string>',
image_id: '<string>',
options: [{name: '<string>', value: '<string>'}]
})
};
fetch('https://api.exowpee.com/v1/catalog/products/{product}/variants/{variant}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.exowpee.com/v1/catalog/products/{product}/variants/{variant}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'weight' => 123,
'weight_unit_id' => '<string>',
'volume' => 123,
'volume_unit_id' => '<string>',
'is_taxable' => true,
'vat_rate_id' => '<string>',
'max_sellable_quantity' => 123,
'max_sellable_unit_id' => '<string>',
'image_id' => '<string>',
'options' => [
[
'name' => '<string>',
'value' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.exowpee.com/v1/catalog/products/{product}/variants/{variant}"
payload := strings.NewReader("{\n \"weight\": 123,\n \"weight_unit_id\": \"<string>\",\n \"volume\": 123,\n \"volume_unit_id\": \"<string>\",\n \"is_taxable\": true,\n \"vat_rate_id\": \"<string>\",\n \"max_sellable_quantity\": 123,\n \"max_sellable_unit_id\": \"<string>\",\n \"image_id\": \"<string>\",\n \"options\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.exowpee.com/v1/catalog/products/{product}/variants/{variant}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"weight\": 123,\n \"weight_unit_id\": \"<string>\",\n \"volume\": 123,\n \"volume_unit_id\": \"<string>\",\n \"is_taxable\": true,\n \"vat_rate_id\": \"<string>\",\n \"max_sellable_quantity\": 123,\n \"max_sellable_unit_id\": \"<string>\",\n \"image_id\": \"<string>\",\n \"options\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/products/{product}/variants/{variant}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"weight\": 123,\n \"weight_unit_id\": \"<string>\",\n \"volume\": 123,\n \"volume_unit_id\": \"<string>\",\n \"is_taxable\": true,\n \"vat_rate_id\": \"<string>\",\n \"max_sellable_quantity\": 123,\n \"max_sellable_unit_id\": \"<string>\",\n \"image_id\": \"<string>\",\n \"options\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"stockable_id": "<string>",
"title": "<string>",
"weight": 123,
"weight_unit_id": "<string>",
"volume": 123,
"volume_unit_id": "<string>",
"is_tracked": true,
"is_taxable": true,
"max_sellable_quantity": 123,
"max_sellable_unit_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"image": {},
"options": {},
"inventoryItem": {},
"levels": "<array>",
"units": "<array>",
"organization_id": "<string>",
"vat_rate_id": "<string>",
"tax_configuration_mode": "<string>",
"vat_rate": {},
"taxes": "<array>"
}{
"message": "<string>",
"errors": {}
}product_variants.update
Conditions
- image_id must be an image of the same product and organization.
- Fiscal fields additionally require the permission to update item taxes.
- Weight, volume and maximum sellable quantity are sent together with their unit; the unit must match the kind of measure or the product’s unit category and the value must be exactly representable in the reference unit.
- When options are sent, the new combination must not match another variant of the product.
- Sending options replaces all existing options of the variant and recomputes its option signature.
- Updates the variant’s item (measurements, tax settings); tracking is not changed by this call, it follows the product.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Identifier of the product that owns the variant (27-character KSUID).
Identifier of the variant to update (27-character KSUID). It must belong to the product.
Query Parameters
Response mode. Default none; none answers 204 No Content.
none, resource Comma-separated JSON keys of the root resource (id is always rendered). Available: vat_rate_id, tax_configuration_mode, id, stockable_id, title, weight, weight_unit_id, volume, volume_unit_id, is_tracked, is_taxable, max_sellable_quantity, max_sellable_unit_id, created_at, updated_at, options, organization_id.
Comma-separated include paths, each optionally followed by its fields in parentheses: units(id,sku),units.uomUnit(id,name). Max depth 6, max 40 paths. Available: vat_rate, taxes, image, inventoryItem, inventoryItem.stockable, inventoryItem.inventoryLevels, levels, levels.inventoryItem, levels.asset, levels.stocks, units, units.uomUnit, units.prices, units.stockable.
Body
Weight of one unit, in the unit given by weight_unit_id (an integer greater than zero). Must be sent together with weight_unit_id; send both as null to clear. Must be exactly representable in the reference unit.
Identifier of a measurement unit of the weight category (27-character KSUID). Required when weight is sent.
27Volume of one unit, in the unit given by volume_unit_id (an integer greater than zero). Must be sent together with volume_unit_id; send both as null to clear.
Identifier of a measurement unit of the volume category (27-character KSUID). Required when volume is sent.
27inherit takes the tax settings from the product category; custom sets them on the variant and then requires is_taxable. Needs the permission to update item taxes.
inherit, custom Whether the variant is taxable. Required when the mode is custom. Needs the permission to update item taxes.
Identifier of the VAT rate (27-character KSUID). It must be active and match the company's country and fiscal status.
27Largest quantity sellable in one line, in the unit given by max_sellable_unit_id (an integer greater than zero). Must be sent together with the unit.
Identifier of a unit of the product's own unit-of-measure category (27-character KSUID). Required when max_sellable_quantity is sent.
27Identifier of one of the product's images to link to this variant. Null or omitted keeps the current image.
New complete list of option name and value pairs of the variant; replaces the existing ones. The combination must be unique among the product's variants and option names must be distinct.
Show child attributes
Show child attributes
Response
Resource (only with response=resource).
Identifier of the variant (27-character KSUID).
Identifier of the item behind the variant (27-character KSUID).
Display title of the variant: the product title followed by its option values.
Weight of one unit of the variant, expressed in the unit given by weight_unit_id (converted back from the reference unit). Null when not set.
Identifier of the weight unit of weight (27-character KSUID), or null.
Volume of one unit of the variant, expressed in the unit given by volume_unit_id. Null when not set.
Identifier of the volume unit of volume (27-character KSUID), or null.
Whether stock is tracked for this variant.
Whether the variant is taxable according to its tax configuration (own or inherited).
Largest quantity that can be sold in one line, expressed in the unit given by max_sellable_unit_id. Null when there is no limit.
Identifier of the unit of max_sellable_quantity (27-character KSUID), or null.
Date and time the record was created (ISO 8601, UTC).
Date and time the record was last changed (ISO 8601, UTC).
Picture linked to this variant, or null. Present only when requested with include=image.
Option values of the variant keyed option1, option2, ... in position order, each with name and value.
Stock record of the variant, when stock is tracked. Present only when requested with include=inventoryItem.
Stock levels of the variant per asset, limited to those the current actor may see. Present only when requested with include=levels.
Sellable units of the variant with SKU, barcode and prices. Present only when requested with include=units.
Identifier of the organization the record belongs to.
Identifier of the VAT rate set on the variant, or null (27-character KSUID).
inherit when the variant takes its tax settings from its product category, custom when they are set on the variant itself.
VAT rate details. Present only when requested with include=vat_rate.
Taxes applied to the variant. Present only when requested with include=taxes.