Categories
Update category
Updates an existing category. The response keeps returning the current cdn_image_url so clients can continue rendering the category cover after non-image edits.
PATCH
/
dev
/
v1
/
categories
/
{id}
Update category
curl --request PATCH \
--url https://api.shoppex.io/dev/v1/categories/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"unlisted": true,
"products_bound": [
"<string>"
],
"groups_bound": [
"<string>"
],
"sort_priority": 123
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
unlisted: true,
products_bound: ['<string>'],
groups_bound: ['<string>'],
sort_priority: 123
})
};
fetch('https://api.shoppex.io/dev/v1/categories/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.shoppex.io/dev/v1/categories/{id}"
payload = {
"title": "<string>",
"unlisted": True,
"products_bound": ["<string>"],
"groups_bound": ["<string>"],
"sort_priority": 123
}
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/categories/{id}",
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([
'title' => '<string>',
'unlisted' => true,
'products_bound' => [
'<string>'
],
'groups_bound' => [
'<string>'
],
'sort_priority' => 123
]),
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/categories/{id}"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"unlisted\": true,\n \"products_bound\": [\n \"<string>\"\n ],\n \"groups_bound\": [\n \"<string>\"\n ],\n \"sort_priority\": 123\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": "<string>",
"uniqid": "<string>",
"shop_id": "<string>",
"title": "<string>",
"unlisted": true,
"sort_order": 123,
"cloudflare_image_id": "<string>",
"cdn_image_url": "<string>",
"products_bound": [
{
"uniqid": "<string>",
"title": "<string>",
"price": 123,
"price_display": 123,
"discount_percent": 123,
"currency": "<string>",
"unlisted": true,
"image_id": "<string>",
"image_url": "<string>",
"description": "<string>",
"quantity_min": 123,
"quantity_max": 123,
"quantity_warning": 123,
"custom_fields": [
{}
],
"type": "<string>",
"shop_id": "<string>",
"gateways": [
"<string>"
],
"crypto_confirmations": 123,
"private": true,
"stock": 123,
"sort_priority": 123,
"on_hold": true,
"video_link": "<string>",
"created_at": 123,
"updated_at": 123
}
],
"products_count": 123,
"groups_bound": [
{
"uniqid": "<string>",
"title": "<string>",
"created_at": 123,
"updated_at": 123
}
],
"groups_count": 123,
"created_at": 123,
"updated_at": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}Authorizations
Use your Shoppex API key in the Authorization header.
Path Parameters
Body
application/jsonmultipart/form-datatext/plain
Response
Successful response
Show child attributes
Show child attributes
⌘I
Update category
curl --request PATCH \
--url https://api.shoppex.io/dev/v1/categories/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"unlisted": true,
"products_bound": [
"<string>"
],
"groups_bound": [
"<string>"
],
"sort_priority": 123
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
unlisted: true,
products_bound: ['<string>'],
groups_bound: ['<string>'],
sort_priority: 123
})
};
fetch('https://api.shoppex.io/dev/v1/categories/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.shoppex.io/dev/v1/categories/{id}"
payload = {
"title": "<string>",
"unlisted": True,
"products_bound": ["<string>"],
"groups_bound": ["<string>"],
"sort_priority": 123
}
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/categories/{id}",
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([
'title' => '<string>',
'unlisted' => true,
'products_bound' => [
'<string>'
],
'groups_bound' => [
'<string>'
],
'sort_priority' => 123
]),
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/categories/{id}"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"unlisted\": true,\n \"products_bound\": [\n \"<string>\"\n ],\n \"groups_bound\": [\n \"<string>\"\n ],\n \"sort_priority\": 123\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": "<string>",
"uniqid": "<string>",
"shop_id": "<string>",
"title": "<string>",
"unlisted": true,
"sort_order": 123,
"cloudflare_image_id": "<string>",
"cdn_image_url": "<string>",
"products_bound": [
{
"uniqid": "<string>",
"title": "<string>",
"price": 123,
"price_display": 123,
"discount_percent": 123,
"currency": "<string>",
"unlisted": true,
"image_id": "<string>",
"image_url": "<string>",
"description": "<string>",
"quantity_min": 123,
"quantity_max": 123,
"quantity_warning": 123,
"custom_fields": [
{}
],
"type": "<string>",
"shop_id": "<string>",
"gateways": [
"<string>"
],
"crypto_confirmations": 123,
"private": true,
"stock": 123,
"sort_priority": 123,
"on_hold": true,
"video_link": "<string>",
"created_at": 123,
"updated_at": 123
}
],
"products_count": 123,
"groups_bound": [
{
"uniqid": "<string>",
"title": "<string>",
"created_at": 123,
"updated_at": 123
}
],
"groups_count": 123,
"created_at": 123,
"updated_at": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}