curl --request PATCH \
--url https://api.shoppex.io/dev/v1/products/{id}/variants/{variantId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"file_id": null,
"dynamic_webhook": null
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({file_id: null, dynamic_webhook: null})
};
fetch('https://api.shoppex.io/dev/v1/products/{id}/variants/{variantId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.shoppex.io/dev/v1/products/{id}/variants/{variantId}"
payload = {
"file_id": None,
"dynamic_webhook": None
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.shoppex.io/dev/v1/products/{id}/variants/{variantId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'file_id' => null,
'dynamic_webhook' => null
]),
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.shoppex.io/dev/v1/products/{id}/variants/{variantId}"
payload := strings.NewReader("{\n \"file_id\": null,\n \"dynamic_webhook\": null\n}")
req, _ := http.NewRequest("PATCH", 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))
}{
"data": {
"id": "variant_1",
"uniqid": "variant_1",
"product_uniqid": "prod_1",
"file_id": null,
"dynamic_webhook": null,
"title": "Updated",
"description": null,
"price": 15,
"price_modifier": null,
"stock": 4,
"stock_delimiter": null,
"license_period": null,
"option_values": null,
"is_default": false,
"is_featured": false,
"sort_order": 1,
"created_at": 1711953600,
"updated_at": 1711953900
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"subcode": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"subcode": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"subcode": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"subcode": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"subcode": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"subcode": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"subcode": "<string>"
}
}Update variant
Updates one variant of a product. Only the fields present in the request body are changed. Omit price to keep it unchanged; null is not a valid price.
curl --request PATCH \
--url https://api.shoppex.io/dev/v1/products/{id}/variants/{variantId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"file_id": null,
"dynamic_webhook": null
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({file_id: null, dynamic_webhook: null})
};
fetch('https://api.shoppex.io/dev/v1/products/{id}/variants/{variantId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.shoppex.io/dev/v1/products/{id}/variants/{variantId}"
payload = {
"file_id": None,
"dynamic_webhook": None
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.shoppex.io/dev/v1/products/{id}/variants/{variantId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'file_id' => null,
'dynamic_webhook' => null
]),
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.shoppex.io/dev/v1/products/{id}/variants/{variantId}"
payload := strings.NewReader("{\n \"file_id\": null,\n \"dynamic_webhook\": null\n}")
req, _ := http.NewRequest("PATCH", 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))
}{
"data": {
"id": "variant_1",
"uniqid": "variant_1",
"product_uniqid": "prod_1",
"file_id": null,
"dynamic_webhook": null,
"title": "Updated",
"description": null,
"price": 15,
"price_modifier": null,
"stock": 4,
"stock_delimiter": null,
"license_period": null,
"option_values": null,
"is_default": false,
"is_featured": false,
"sort_order": 1,
"created_at": 1711953600,
"updated_at": 1711953900
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"subcode": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"subcode": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"subcode": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"subcode": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"subcode": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"subcode": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
],
"subcode": "<string>"
}
}Authorizations
Body
URL Shoppex calls to deliver this option. A new value must be a public https URL without a username or password, at most 2048 characters. A URL the option, its product or another of its options already stores is accepted unchanged, so an http URL read from the API can be sent back. Send null or an empty string to remove the webhook.
Subscription products: what a paid renewal of this variant delivers. new issues a new license, key, files or text each renewal; extend and first_only keep what the buyer has (the license is extended). Null: the same as the product (renewal_delivery on the product). Only subscription products accept a value. A change applies to the next renewal of every running subscription of this variant.
extend, new, first_only, null