Créer un produit
curl --request POST \
--url https://qwoty.app/api/products \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"api_name": "<string>",
"recurrence_type": "<string>",
"name": "<string>",
"reference": "<string>",
"description": "<string>",
"is_active": true,
"catalog_ids": [
"<string>"
],
"category_ids": [
"<string>"
],
"inventory[sku]": "<string>",
"settings[unit_per_pack]": 123,
"accounting[ledger_account]": "<string>",
"identifiers[crm]": "<string>",
"identifiers[erp]": "<string>",
"identifiers[accounting]": "<string>",
"shipping[weight]": 123,
"shipping[weight_unit]": "<string>",
"shipping[height]": 123,
"shipping[length]": 123,
"shipping[width]": 123,
"shipping[length_unit]": "<string>",
"shipping[country_of_origin]": "<string>",
"shipping[harmonized_system_code]": "<string>"
}
'import requests
url = "https://qwoty.app/api/products"
payload = {
"api_name": "<string>",
"recurrence_type": "<string>",
"name": "<string>",
"reference": "<string>",
"description": "<string>",
"is_active": True,
"catalog_ids": ["<string>"],
"category_ids": ["<string>"],
"inventory[sku]": "<string>",
"settings[unit_per_pack]": 123,
"accounting[ledger_account]": "<string>",
"identifiers[crm]": "<string>",
"identifiers[erp]": "<string>",
"identifiers[accounting]": "<string>",
"shipping[weight]": 123,
"shipping[weight_unit]": "<string>",
"shipping[height]": 123,
"shipping[length]": 123,
"shipping[width]": 123,
"shipping[length_unit]": "<string>",
"shipping[country_of_origin]": "<string>",
"shipping[harmonized_system_code]": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
api_name: '<string>',
recurrence_type: '<string>',
name: '<string>',
reference: '<string>',
description: '<string>',
is_active: true,
catalog_ids: ['<string>'],
category_ids: ['<string>'],
'inventory[sku]': '<string>',
'settings[unit_per_pack]': 123,
'accounting[ledger_account]': '<string>',
'identifiers[crm]': '<string>',
'identifiers[erp]': '<string>',
'identifiers[accounting]': '<string>',
'shipping[weight]': 123,
'shipping[weight_unit]': '<string>',
'shipping[height]': 123,
'shipping[length]': 123,
'shipping[width]': 123,
'shipping[length_unit]': '<string>',
'shipping[country_of_origin]': '<string>',
'shipping[harmonized_system_code]': '<string>'
})
};
fetch('https://qwoty.app/api/products', 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://qwoty.app/api/products",
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([
'api_name' => '<string>',
'recurrence_type' => '<string>',
'name' => '<string>',
'reference' => '<string>',
'description' => '<string>',
'is_active' => true,
'catalog_ids' => [
'<string>'
],
'category_ids' => [
'<string>'
],
'inventory[sku]' => '<string>',
'settings[unit_per_pack]' => 123,
'accounting[ledger_account]' => '<string>',
'identifiers[crm]' => '<string>',
'identifiers[erp]' => '<string>',
'identifiers[accounting]' => '<string>',
'shipping[weight]' => 123,
'shipping[weight_unit]' => '<string>',
'shipping[height]' => 123,
'shipping[length]' => 123,
'shipping[width]' => 123,
'shipping[length_unit]' => '<string>',
'shipping[country_of_origin]' => '<string>',
'shipping[harmonized_system_code]' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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://qwoty.app/api/products"
payload := strings.NewReader("{\n \"api_name\": \"<string>\",\n \"recurrence_type\": \"<string>\",\n \"name\": \"<string>\",\n \"reference\": \"<string>\",\n \"description\": \"<string>\",\n \"is_active\": true,\n \"catalog_ids\": [\n \"<string>\"\n ],\n \"category_ids\": [\n \"<string>\"\n ],\n \"inventory[sku]\": \"<string>\",\n \"settings[unit_per_pack]\": 123,\n \"accounting[ledger_account]\": \"<string>\",\n \"identifiers[crm]\": \"<string>\",\n \"identifiers[erp]\": \"<string>\",\n \"identifiers[accounting]\": \"<string>\",\n \"shipping[weight]\": 123,\n \"shipping[weight_unit]\": \"<string>\",\n \"shipping[height]\": 123,\n \"shipping[length]\": 123,\n \"shipping[width]\": 123,\n \"shipping[length_unit]\": \"<string>\",\n \"shipping[country_of_origin]\": \"<string>\",\n \"shipping[harmonized_system_code]\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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://qwoty.app/api/products")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"api_name\": \"<string>\",\n \"recurrence_type\": \"<string>\",\n \"name\": \"<string>\",\n \"reference\": \"<string>\",\n \"description\": \"<string>\",\n \"is_active\": true,\n \"catalog_ids\": [\n \"<string>\"\n ],\n \"category_ids\": [\n \"<string>\"\n ],\n \"inventory[sku]\": \"<string>\",\n \"settings[unit_per_pack]\": 123,\n \"accounting[ledger_account]\": \"<string>\",\n \"identifiers[crm]\": \"<string>\",\n \"identifiers[erp]\": \"<string>\",\n \"identifiers[accounting]\": \"<string>\",\n \"shipping[weight]\": 123,\n \"shipping[weight_unit]\": \"<string>\",\n \"shipping[height]\": 123,\n \"shipping[length]\": 123,\n \"shipping[width]\": 123,\n \"shipping[length_unit]\": \"<string>\",\n \"shipping[country_of_origin]\": \"<string>\",\n \"shipping[harmonized_system_code]\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://qwoty.app/api/products")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"api_name\": \"<string>\",\n \"recurrence_type\": \"<string>\",\n \"name\": \"<string>\",\n \"reference\": \"<string>\",\n \"description\": \"<string>\",\n \"is_active\": true,\n \"catalog_ids\": [\n \"<string>\"\n ],\n \"category_ids\": [\n \"<string>\"\n ],\n \"inventory[sku]\": \"<string>\",\n \"settings[unit_per_pack]\": 123,\n \"accounting[ledger_account]\": \"<string>\",\n \"identifiers[crm]\": \"<string>\",\n \"identifiers[erp]\": \"<string>\",\n \"identifiers[accounting]\": \"<string>\",\n \"shipping[weight]\": 123,\n \"shipping[weight_unit]\": \"<string>\",\n \"shipping[height]\": 123,\n \"shipping[length]\": 123,\n \"shipping[width]\": 123,\n \"shipping[length_unit]\": \"<string>\",\n \"shipping[country_of_origin]\": \"<string>\",\n \"shipping[harmonized_system_code]\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "880e8400-e29b-41d4-a716-446655440003",
"product_parent_id": "550e8400-e29b-41d4-a716-446655440000",
"workspace_id": "990e8400-e29b-41d4-a716-446655440004",
"name": "Premium Widget",
"api_name": "premium_widget",
"reference": "PROD-001",
"description": "High-quality widget for professional use",
"description_inherit_from_product": true,
"primary_image_inherit_from_product": true,
"is_active": true,
"is_default": true,
"catalog_ids": ["660e8400-e29b-41d4-a716-446655440001"],
"category_ids": ["770e8400-e29b-41d4-a716-446655440002"],
"product_ids": ["880e8400-e29b-41d4-a716-446655440003"],
"settings": {
"unit_per_pack": 1,
"product_type": null,
"language_id": null,
"unit_of_measure": null,
"recurrence_type": "one_off"
},
"shipping": {
"weight": 2.5,
"weight_unit": "kg",
"height": 10,
"length": 30,
"width": 20,
"length_unit": "cm",
"country_of_origin": "FR",
"harmonized_system_code": "8471.30"
},
"inventory": {
"sku": "WID-PRE-001"
},
"identifiers": {
"crm": "crm_123",
"erp": "erp_456",
"accounting": "acc_789"
},
"accounting": {
"ledger_account": "4010"
},
"options": [],
"prices": [
{
"id": "price-001",
"pricebook_id": "pb-001",
"pricebook_api_name": "standard"
}
],
"primary_image_id": null,
"parent_primary_image_id": null,
"created_at": "2024-12-21T10:30:00Z",
"updated_at": "2024-12-21T10:30:00Z"
}
}
Produits
Créer un produit
Créer un nouveau produit (master + variante par défaut) dans votre espace de travail
POST
/
api
/
products
Créer un produit
curl --request POST \
--url https://qwoty.app/api/products \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"api_name": "<string>",
"recurrence_type": "<string>",
"name": "<string>",
"reference": "<string>",
"description": "<string>",
"is_active": true,
"catalog_ids": [
"<string>"
],
"category_ids": [
"<string>"
],
"inventory[sku]": "<string>",
"settings[unit_per_pack]": 123,
"accounting[ledger_account]": "<string>",
"identifiers[crm]": "<string>",
"identifiers[erp]": "<string>",
"identifiers[accounting]": "<string>",
"shipping[weight]": 123,
"shipping[weight_unit]": "<string>",
"shipping[height]": 123,
"shipping[length]": 123,
"shipping[width]": 123,
"shipping[length_unit]": "<string>",
"shipping[country_of_origin]": "<string>",
"shipping[harmonized_system_code]": "<string>"
}
'import requests
url = "https://qwoty.app/api/products"
payload = {
"api_name": "<string>",
"recurrence_type": "<string>",
"name": "<string>",
"reference": "<string>",
"description": "<string>",
"is_active": True,
"catalog_ids": ["<string>"],
"category_ids": ["<string>"],
"inventory[sku]": "<string>",
"settings[unit_per_pack]": 123,
"accounting[ledger_account]": "<string>",
"identifiers[crm]": "<string>",
"identifiers[erp]": "<string>",
"identifiers[accounting]": "<string>",
"shipping[weight]": 123,
"shipping[weight_unit]": "<string>",
"shipping[height]": 123,
"shipping[length]": 123,
"shipping[width]": 123,
"shipping[length_unit]": "<string>",
"shipping[country_of_origin]": "<string>",
"shipping[harmonized_system_code]": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
api_name: '<string>',
recurrence_type: '<string>',
name: '<string>',
reference: '<string>',
description: '<string>',
is_active: true,
catalog_ids: ['<string>'],
category_ids: ['<string>'],
'inventory[sku]': '<string>',
'settings[unit_per_pack]': 123,
'accounting[ledger_account]': '<string>',
'identifiers[crm]': '<string>',
'identifiers[erp]': '<string>',
'identifiers[accounting]': '<string>',
'shipping[weight]': 123,
'shipping[weight_unit]': '<string>',
'shipping[height]': 123,
'shipping[length]': 123,
'shipping[width]': 123,
'shipping[length_unit]': '<string>',
'shipping[country_of_origin]': '<string>',
'shipping[harmonized_system_code]': '<string>'
})
};
fetch('https://qwoty.app/api/products', 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://qwoty.app/api/products",
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([
'api_name' => '<string>',
'recurrence_type' => '<string>',
'name' => '<string>',
'reference' => '<string>',
'description' => '<string>',
'is_active' => true,
'catalog_ids' => [
'<string>'
],
'category_ids' => [
'<string>'
],
'inventory[sku]' => '<string>',
'settings[unit_per_pack]' => 123,
'accounting[ledger_account]' => '<string>',
'identifiers[crm]' => '<string>',
'identifiers[erp]' => '<string>',
'identifiers[accounting]' => '<string>',
'shipping[weight]' => 123,
'shipping[weight_unit]' => '<string>',
'shipping[height]' => 123,
'shipping[length]' => 123,
'shipping[width]' => 123,
'shipping[length_unit]' => '<string>',
'shipping[country_of_origin]' => '<string>',
'shipping[harmonized_system_code]' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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://qwoty.app/api/products"
payload := strings.NewReader("{\n \"api_name\": \"<string>\",\n \"recurrence_type\": \"<string>\",\n \"name\": \"<string>\",\n \"reference\": \"<string>\",\n \"description\": \"<string>\",\n \"is_active\": true,\n \"catalog_ids\": [\n \"<string>\"\n ],\n \"category_ids\": [\n \"<string>\"\n ],\n \"inventory[sku]\": \"<string>\",\n \"settings[unit_per_pack]\": 123,\n \"accounting[ledger_account]\": \"<string>\",\n \"identifiers[crm]\": \"<string>\",\n \"identifiers[erp]\": \"<string>\",\n \"identifiers[accounting]\": \"<string>\",\n \"shipping[weight]\": 123,\n \"shipping[weight_unit]\": \"<string>\",\n \"shipping[height]\": 123,\n \"shipping[length]\": 123,\n \"shipping[width]\": 123,\n \"shipping[length_unit]\": \"<string>\",\n \"shipping[country_of_origin]\": \"<string>\",\n \"shipping[harmonized_system_code]\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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://qwoty.app/api/products")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"api_name\": \"<string>\",\n \"recurrence_type\": \"<string>\",\n \"name\": \"<string>\",\n \"reference\": \"<string>\",\n \"description\": \"<string>\",\n \"is_active\": true,\n \"catalog_ids\": [\n \"<string>\"\n ],\n \"category_ids\": [\n \"<string>\"\n ],\n \"inventory[sku]\": \"<string>\",\n \"settings[unit_per_pack]\": 123,\n \"accounting[ledger_account]\": \"<string>\",\n \"identifiers[crm]\": \"<string>\",\n \"identifiers[erp]\": \"<string>\",\n \"identifiers[accounting]\": \"<string>\",\n \"shipping[weight]\": 123,\n \"shipping[weight_unit]\": \"<string>\",\n \"shipping[height]\": 123,\n \"shipping[length]\": 123,\n \"shipping[width]\": 123,\n \"shipping[length_unit]\": \"<string>\",\n \"shipping[country_of_origin]\": \"<string>\",\n \"shipping[harmonized_system_code]\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://qwoty.app/api/products")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"api_name\": \"<string>\",\n \"recurrence_type\": \"<string>\",\n \"name\": \"<string>\",\n \"reference\": \"<string>\",\n \"description\": \"<string>\",\n \"is_active\": true,\n \"catalog_ids\": [\n \"<string>\"\n ],\n \"category_ids\": [\n \"<string>\"\n ],\n \"inventory[sku]\": \"<string>\",\n \"settings[unit_per_pack]\": 123,\n \"accounting[ledger_account]\": \"<string>\",\n \"identifiers[crm]\": \"<string>\",\n \"identifiers[erp]\": \"<string>\",\n \"identifiers[accounting]\": \"<string>\",\n \"shipping[weight]\": 123,\n \"shipping[weight_unit]\": \"<string>\",\n \"shipping[height]\": 123,\n \"shipping[length]\": 123,\n \"shipping[width]\": 123,\n \"shipping[length_unit]\": \"<string>\",\n \"shipping[country_of_origin]\": \"<string>\",\n \"shipping[harmonized_system_code]\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "880e8400-e29b-41d4-a716-446655440003",
"product_parent_id": "550e8400-e29b-41d4-a716-446655440000",
"workspace_id": "990e8400-e29b-41d4-a716-446655440004",
"name": "Premium Widget",
"api_name": "premium_widget",
"reference": "PROD-001",
"description": "High-quality widget for professional use",
"description_inherit_from_product": true,
"primary_image_inherit_from_product": true,
"is_active": true,
"is_default": true,
"catalog_ids": ["660e8400-e29b-41d4-a716-446655440001"],
"category_ids": ["770e8400-e29b-41d4-a716-446655440002"],
"product_ids": ["880e8400-e29b-41d4-a716-446655440003"],
"settings": {
"unit_per_pack": 1,
"product_type": null,
"language_id": null,
"unit_of_measure": null,
"recurrence_type": "one_off"
},
"shipping": {
"weight": 2.5,
"weight_unit": "kg",
"height": 10,
"length": 30,
"width": 20,
"length_unit": "cm",
"country_of_origin": "FR",
"harmonized_system_code": "8471.30"
},
"inventory": {
"sku": "WID-PRE-001"
},
"identifiers": {
"crm": "crm_123",
"erp": "erp_456",
"accounting": "acc_789"
},
"accounting": {
"ledger_account": "4010"
},
"options": [],
"prices": [
{
"id": "price-001",
"pricebook_id": "pb-001",
"pricebook_api_name": "standard"
}
],
"primary_image_id": null,
"parent_primary_image_id": null,
"created_at": "2024-12-21T10:30:00Z",
"updated_at": "2024-12-21T10:30:00Z"
}
}
Autorisation
string
requis
Token Bearer pour l’authentification. Format :
Bearer qwoty_your_tokenCorps de la requête
string
requis
Identifiant API unique (snake_case). Ne peut contenir que des lettres minuscules,
des chiffres et des underscores.
string
requis
Modèle de facturation. Valeurs autorisées :
one_off, recurringstring
requis
Nom du produit
string
Code de référence interne pour la variante par défaut
string
Description du produit
boolean
défaut:"true"
Statut actif
string[]
Tableau d’UUIDs de catalogues auxquels lier le produit. Le catalogue par défaut
de l’espace de travail est toujours inclus automatiquement.
string[]
Tableau d’UUIDs de catégories de produits à associer à ce produit.
string
Unité de gestion des stocks (SKU)
number
Nombre d’unités par pack
string
Code du compte comptable
string
Identifiant CRM externe
string
Identifiant ERP externe
string
Identifiant comptable externe
number
Poids d’expédition
string
Unité de poids. Valeurs autorisées :
kg, lbsnumber
Hauteur d’expédition
number
Longueur d’expédition
number
Largeur d’expédition
string
Unité de longueur (ex. :
cm, in)string
Code pays ISO d’origine
string
Code SH pour les douanes
Exemples
curl -X POST https://qwoty.app/api/products \
-H "Authorization: Bearer qwoty_your_token" \
-H "Content-Type: application/json" \
-d '{
"api_name": "premium_widget",
"recurrence_type": "one_off",
"name": "Premium Widget",
"description": "High-quality widget for professional use",
"reference": "PROD-001",
"is_active": true,
"catalog_ids": ["660e8400-e29b-41d4-a716-446655440001"],
"category_ids": ["770e8400-e29b-41d4-a716-446655440002"],
"inventory[sku]": "WID-PRE-001",
"settings[unit_per_pack]": 1,
"accounting[ledger_account]": "4010",
"identifiers[crm]": "crm_123",
"identifiers[erp]": "erp_456",
"identifiers[accounting]": "acc_789",
"shipping[weight]": 2.5,
"shipping[weight_unit]": "kg",
"shipping[height]": 10,
"shipping[length]": 30,
"shipping[width]": 20,
"shipping[length_unit]": "cm",
"shipping[country_of_origin]": "FR",
"shipping[harmonized_system_code]": "8471.30"
}'
const response = await fetch('https://qwoty.app/api/products', {
method: 'POST',
headers: {
Authorization: 'Bearer qwoty_your_token',
'Content-Type': 'application/json',
},
body: JSON.stringify({
api_name: 'premium_widget',
recurrence_type: 'one_off',
name: 'Premium Widget',
description: 'High-quality widget for professional use',
reference: 'PROD-001',
is_active: true,
catalog_ids: ['660e8400-e29b-41d4-a716-446655440001'],
category_ids: ['770e8400-e29b-41d4-a716-446655440002'],
'inventory[sku]': 'WID-PRE-001',
'settings[unit_per_pack]': 1,
'accounting[ledger_account]': '4010',
'identifiers[crm]': 'crm_123',
'identifiers[erp]': 'erp_456',
'identifiers[accounting]': 'acc_789',
'shipping[weight]': 2.5,
'shipping[weight_unit]': 'kg',
'shipping[height]': 10,
'shipping[length]': 30,
'shipping[width]': 20,
'shipping[length_unit]': 'cm',
'shipping[country_of_origin]': 'FR',
'shipping[harmonized_system_code]': '8471.30',
}),
})
const data = await response.json()
import requests
response = requests.post(
'https://qwoty.app/api/products',
headers={
'Authorization': 'Bearer qwoty_your_token',
'Content-Type': 'application/json'
},
json={
'api_name': 'premium_widget',
'recurrence_type': 'one_off',
'name': 'Premium Widget',
'description': 'High-quality widget for professional use',
'reference': 'PROD-001',
'is_active': True,
'catalog_ids': ['660e8400-e29b-41d4-a716-446655440001'],
'category_ids': ['770e8400-e29b-41d4-a716-446655440002'],
'inventory[sku]': 'WID-PRE-001',
'settings[unit_per_pack]': 1,
'accounting[ledger_account]': '4010',
'identifiers[crm]': 'crm_123',
'identifiers[erp]': 'erp_456',
'identifiers[accounting]': 'acc_789',
'shipping[weight]': 2.5,
'shipping[weight_unit]': 'kg',
'shipping[height]': 10,
'shipping[length]': 30,
'shipping[width]': 20,
'shipping[length_unit]': 'cm',
'shipping[country_of_origin]': 'FR',
'shipping[harmonized_system_code]': '8471.30',
}
)
data = response.json()
Réponse
boolean
Indique si la requête a été effectuée avec succès
object
L’objet produit créé (structure de variante, identique à
GET /api/products/{id})Afficher Objet produit
Afficher Objet produit
string
ID du produit (UUID) — il s’agit de l’ID de la variante par défaut
string
ID du produit parent (UUID)
string
ID de l’espace de travail (UUID)
string
Nom du produit
string
Identifiant API (défini à la création uniquement, ne peut pas être modifié)
string
Référence interne
string
Description du produit
boolean
Statut actif
boolean
Toujours
true pour la variante par défautarray
IDs des catalogues auxquels le produit a été lié (inclut le catalogue par défaut de l’espace de travail)
array
IDs des catégories liées à ce produit
array
Tableau contenant l’ID de la variante par défaut (identique à
id)object
Paramètres :
unit_per_pack, product_type, language_id, unit_of_measure, recurrence_typeobject
Informations d’expédition :
weight, weight_unit, height, length, width, length_unit, country_of_origin, harmonized_system_codeobject
Informations de stock :
skuobject
Identifiants externes :
crm, erp, accountingobject
Informations comptables :
ledger_accountarray
Valeurs d’options (tableau vide pour la variante par défaut)
array
string | null
ID de l’image principale (null à la création)
string | null
ID de l’image principale du produit parent
{
"success": true,
"data": {
"id": "880e8400-e29b-41d4-a716-446655440003",
"product_parent_id": "550e8400-e29b-41d4-a716-446655440000",
"workspace_id": "990e8400-e29b-41d4-a716-446655440004",
"name": "Premium Widget",
"api_name": "premium_widget",
"reference": "PROD-001",
"description": "High-quality widget for professional use",
"description_inherit_from_product": true,
"primary_image_inherit_from_product": true,
"is_active": true,
"is_default": true,
"catalog_ids": ["660e8400-e29b-41d4-a716-446655440001"],
"category_ids": ["770e8400-e29b-41d4-a716-446655440002"],
"product_ids": ["880e8400-e29b-41d4-a716-446655440003"],
"settings": {
"unit_per_pack": 1,
"product_type": null,
"language_id": null,
"unit_of_measure": null,
"recurrence_type": "one_off"
},
"shipping": {
"weight": 2.5,
"weight_unit": "kg",
"height": 10,
"length": 30,
"width": 20,
"length_unit": "cm",
"country_of_origin": "FR",
"harmonized_system_code": "8471.30"
},
"inventory": {
"sku": "WID-PRE-001"
},
"identifiers": {
"crm": "crm_123",
"erp": "erp_456",
"accounting": "acc_789"
},
"accounting": {
"ledger_account": "4010"
},
"options": [],
"prices": [
{
"id": "price-001",
"pricebook_id": "pb-001",
"pricebook_api_name": "standard"
}
],
"primary_image_id": null,
"parent_primary_image_id": null,
"created_at": "2024-12-21T10:30:00Z",
"updated_at": "2024-12-21T10:30:00Z"
}
}
Réponses d’erreur
{
"success": false,
"error": "Validation error",
"details": [
"Field 'api_name' is required",
"Field 'recurrence_type' is required (one_off | recurring)"
]
}
{
"success": false,
"error": "Validation error",
"details": ["A product with api_name 'premium_widget' already exists"]
}
{
"success": false,
"error": "Validation error",
"details": ["Catalog(s) not found: 660e8400-e29b-41d4-a716-446655440001"]
}
{
"success": false,
"error": "Invalid API token"
}
Cette page vous a-t-elle été utile ?
⌘I

