Create a category
curl --request POST \
--url https://api.salesive.com/api/v1/categories \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Electronics",
"description": "Phones, audio and accessories",
"image": "https://cdn.example.com/c/electronics.png"
}
'import requests
url = "https://api.salesive.com/api/v1/categories"
payload = {
"name": "Electronics",
"description": "Phones, audio and accessories",
"image": "https://cdn.example.com/c/electronics.png"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Electronics',
description: 'Phones, audio and accessories',
image: 'https://cdn.example.com/c/electronics.png'
})
};
fetch('https://api.salesive.com/api/v1/categories', 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.salesive.com/api/v1/categories",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Electronics',
'description' => 'Phones, audio and accessories',
'image' => 'https://cdn.example.com/c/electronics.png'
]),
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.salesive.com/api/v1/categories"
payload := strings.NewReader("{\n \"name\": \"Electronics\",\n \"description\": \"Phones, audio and accessories\",\n \"image\": \"https://cdn.example.com/c/electronics.png\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.salesive.com/api/v1/categories")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Electronics\",\n \"description\": \"Phones, audio and accessories\",\n \"image\": \"https://cdn.example.com/c/electronics.png\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salesive.com/api/v1/categories")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Electronics\",\n \"description\": \"Phones, audio and accessories\",\n \"image\": \"https://cdn.example.com/c/electronics.png\"\n}"
response = http.request(request)
puts response.read_body{
"status": 201,
"success": true,
"message": "Category created successfully",
"data": {
"_id": "6651ab12cd34ef56ab78cd90",
"name": "Electronics",
"slug": "electronics",
"description": "Phones, audio and accessories",
"image": "https://cdn.example.com/c/electronics.png",
"deleted": false,
"deletedAt": null,
"shop": "664f0e2a1c2b3d4e5f6a7b8c",
"createdAt": "2026-06-28T08:00:00.000Z",
"updatedAt": "2026-06-28T08:00:00.000Z",
"id": "6651ab12cd34ef56ab78cd90"
}
}{
"status": 401,
"success": false,
"message": "Authentication required",
"data": null
}{
"status": 403,
"success": false,
"message": "Insufficient scope",
"data": null
}Categories
Create a category
Create a new product category in the store. Requires the WRITE_CATEGORIES scope.
POST
/
categories
Create a category
curl --request POST \
--url https://api.salesive.com/api/v1/categories \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Electronics",
"description": "Phones, audio and accessories",
"image": "https://cdn.example.com/c/electronics.png"
}
'import requests
url = "https://api.salesive.com/api/v1/categories"
payload = {
"name": "Electronics",
"description": "Phones, audio and accessories",
"image": "https://cdn.example.com/c/electronics.png"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Electronics',
description: 'Phones, audio and accessories',
image: 'https://cdn.example.com/c/electronics.png'
})
};
fetch('https://api.salesive.com/api/v1/categories', 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.salesive.com/api/v1/categories",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Electronics',
'description' => 'Phones, audio and accessories',
'image' => 'https://cdn.example.com/c/electronics.png'
]),
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.salesive.com/api/v1/categories"
payload := strings.NewReader("{\n \"name\": \"Electronics\",\n \"description\": \"Phones, audio and accessories\",\n \"image\": \"https://cdn.example.com/c/electronics.png\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.salesive.com/api/v1/categories")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Electronics\",\n \"description\": \"Phones, audio and accessories\",\n \"image\": \"https://cdn.example.com/c/electronics.png\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salesive.com/api/v1/categories")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Electronics\",\n \"description\": \"Phones, audio and accessories\",\n \"image\": \"https://cdn.example.com/c/electronics.png\"\n}"
response = http.request(request)
puts response.read_body{
"status": 201,
"success": true,
"message": "Category created successfully",
"data": {
"_id": "6651ab12cd34ef56ab78cd90",
"name": "Electronics",
"slug": "electronics",
"description": "Phones, audio and accessories",
"image": "https://cdn.example.com/c/electronics.png",
"deleted": false,
"deletedAt": null,
"shop": "664f0e2a1c2b3d4e5f6a7b8c",
"createdAt": "2026-06-28T08:00:00.000Z",
"updatedAt": "2026-06-28T08:00:00.000Z",
"id": "6651ab12cd34ef56ab78cd90"
}
}{
"status": 401,
"success": false,
"message": "Authentication required",
"data": null
}{
"status": 403,
"success": false,
"message": "Insufficient scope",
"data": null
}Creates a new product category in the store; a URL-friendly slug is generated automatically from the name. The store is bound to your app token server-side — never send a shop id.
Authorizations
Installed-app access token (prefix app_), issued by the OAuth install flow. The store is bound to the token server-side — never send a shop id.
Body
application/json
Response
The created category.
Standard Salesive response envelope. The operation-specific payload is carried in data.
Was this page helpful?
⌘I

