Create a product/service catalog record
curl --request POST \
--url http://localhost:8000/products \
--header 'Content-Type: application/json' \
--data '
{
"main_code": "<string>",
"name": "<string>",
"unit_price": 1,
"tax_code": "<string>",
"iva_rate_code": "<string>",
"aux_code": "<string>",
"default_discount": "0.00",
"applies_tourism_iva": false,
"applies_ice": false,
"ice_code": "<string>",
"additional_fields": {}
}
'import requests
url = "http://localhost:8000/products"
payload = {
"main_code": "<string>",
"name": "<string>",
"unit_price": 1,
"tax_code": "<string>",
"iva_rate_code": "<string>",
"aux_code": "<string>",
"default_discount": "0.00",
"applies_tourism_iva": False,
"applies_ice": False,
"ice_code": "<string>",
"additional_fields": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
main_code: '<string>',
name: '<string>',
unit_price: 1,
tax_code: '<string>',
iva_rate_code: '<string>',
aux_code: '<string>',
default_discount: '0.00',
applies_tourism_iva: false,
applies_ice: false,
ice_code: '<string>',
additional_fields: {}
})
};
fetch('http://localhost:8000/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_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/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([
'main_code' => '<string>',
'name' => '<string>',
'unit_price' => 1,
'tax_code' => '<string>',
'iva_rate_code' => '<string>',
'aux_code' => '<string>',
'default_discount' => '0.00',
'applies_tourism_iva' => false,
'applies_ice' => false,
'ice_code' => '<string>',
'additional_fields' => [
]
]),
CURLOPT_HTTPHEADER => [
"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 := "http://localhost:8000/products"
payload := strings.NewReader("{\n \"main_code\": \"<string>\",\n \"name\": \"<string>\",\n \"unit_price\": 1,\n \"tax_code\": \"<string>\",\n \"iva_rate_code\": \"<string>\",\n \"aux_code\": \"<string>\",\n \"default_discount\": \"0.00\",\n \"applies_tourism_iva\": false,\n \"applies_ice\": false,\n \"ice_code\": \"<string>\",\n \"additional_fields\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
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("http://localhost:8000/products")
.header("Content-Type", "application/json")
.body("{\n \"main_code\": \"<string>\",\n \"name\": \"<string>\",\n \"unit_price\": 1,\n \"tax_code\": \"<string>\",\n \"iva_rate_code\": \"<string>\",\n \"aux_code\": \"<string>\",\n \"default_discount\": \"0.00\",\n \"applies_tourism_iva\": false,\n \"applies_ice\": false,\n \"ice_code\": \"<string>\",\n \"additional_fields\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/products")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"main_code\": \"<string>\",\n \"name\": \"<string>\",\n \"unit_price\": 1,\n \"tax_code\": \"<string>\",\n \"iva_rate_code\": \"<string>\",\n \"aux_code\": \"<string>\",\n \"default_discount\": \"0.00\",\n \"applies_tourism_iva\": false,\n \"applies_ice\": false,\n \"ice_code\": \"<string>\",\n \"additional_fields\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"main_code": "<string>",
"aux_code": "<string>",
"name": "<string>",
"unit_price": "<string>",
"default_discount": "<string>",
"tax_code": "<string>",
"iva_rate_code": "<string>",
"applies_tourism_iva": true,
"applies_ice": true,
"ice_code": "<string>",
"additional_fields": {},
"is_active": true,
"deleted_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Products
Create a product/service catalog record
POST
/
products
Create a product/service catalog record
curl --request POST \
--url http://localhost:8000/products \
--header 'Content-Type: application/json' \
--data '
{
"main_code": "<string>",
"name": "<string>",
"unit_price": 1,
"tax_code": "<string>",
"iva_rate_code": "<string>",
"aux_code": "<string>",
"default_discount": "0.00",
"applies_tourism_iva": false,
"applies_ice": false,
"ice_code": "<string>",
"additional_fields": {}
}
'import requests
url = "http://localhost:8000/products"
payload = {
"main_code": "<string>",
"name": "<string>",
"unit_price": 1,
"tax_code": "<string>",
"iva_rate_code": "<string>",
"aux_code": "<string>",
"default_discount": "0.00",
"applies_tourism_iva": False,
"applies_ice": False,
"ice_code": "<string>",
"additional_fields": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
main_code: '<string>',
name: '<string>',
unit_price: 1,
tax_code: '<string>',
iva_rate_code: '<string>',
aux_code: '<string>',
default_discount: '0.00',
applies_tourism_iva: false,
applies_ice: false,
ice_code: '<string>',
additional_fields: {}
})
};
fetch('http://localhost:8000/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_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/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([
'main_code' => '<string>',
'name' => '<string>',
'unit_price' => 1,
'tax_code' => '<string>',
'iva_rate_code' => '<string>',
'aux_code' => '<string>',
'default_discount' => '0.00',
'applies_tourism_iva' => false,
'applies_ice' => false,
'ice_code' => '<string>',
'additional_fields' => [
]
]),
CURLOPT_HTTPHEADER => [
"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 := "http://localhost:8000/products"
payload := strings.NewReader("{\n \"main_code\": \"<string>\",\n \"name\": \"<string>\",\n \"unit_price\": 1,\n \"tax_code\": \"<string>\",\n \"iva_rate_code\": \"<string>\",\n \"aux_code\": \"<string>\",\n \"default_discount\": \"0.00\",\n \"applies_tourism_iva\": false,\n \"applies_ice\": false,\n \"ice_code\": \"<string>\",\n \"additional_fields\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
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("http://localhost:8000/products")
.header("Content-Type", "application/json")
.body("{\n \"main_code\": \"<string>\",\n \"name\": \"<string>\",\n \"unit_price\": 1,\n \"tax_code\": \"<string>\",\n \"iva_rate_code\": \"<string>\",\n \"aux_code\": \"<string>\",\n \"default_discount\": \"0.00\",\n \"applies_tourism_iva\": false,\n \"applies_ice\": false,\n \"ice_code\": \"<string>\",\n \"additional_fields\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/products")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"main_code\": \"<string>\",\n \"name\": \"<string>\",\n \"unit_price\": 1,\n \"tax_code\": \"<string>\",\n \"iva_rate_code\": \"<string>\",\n \"aux_code\": \"<string>\",\n \"default_discount\": \"0.00\",\n \"applies_tourism_iva\": false,\n \"applies_ice\": false,\n \"ice_code\": \"<string>\",\n \"additional_fields\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"main_code": "<string>",
"aux_code": "<string>",
"name": "<string>",
"unit_price": "<string>",
"default_discount": "<string>",
"tax_code": "<string>",
"iva_rate_code": "<string>",
"applies_tourism_iva": true,
"applies_ice": true,
"ice_code": "<string>",
"additional_fields": {},
"is_active": true,
"deleted_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Cookies
Body
application/json
HTTP request body for catalog product/service creation.
Required string length:
1 - 25Required string length:
1 - 300Required range:
x >= 0Required string length:
1 - 10Required string length:
1 - 10Maximum string length:
25Required range:
x >= 0Maximum string length:
10Show child attributes
Show child attributes
Response
Successful Response
API/domain response for a product/service catalog record.
Pattern:
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Pattern:
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Show child attributes
Show child attributes
⌘I