Create product
curl --request POST \
--url https://dashboard.scango.ch/api/v1/products \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Orange juice 1L",
"price": 349,
"taxCategory": "2.6",
"description": "Fresh orange juice",
"supplier": "sup_01",
"category": "cat_beverages",
"barcode": "7610800009999",
"showOnHomescreen": true,
"showOnScreen": true,
"ageRestriction": false,
"showOnScale": false,
"saleStop": false
}
'import requests
url = "https://dashboard.scango.ch/api/v1/products"
payload = {
"name": "Orange juice 1L",
"price": 349,
"taxCategory": "2.6",
"description": "Fresh orange juice",
"supplier": "sup_01",
"category": "cat_beverages",
"barcode": "7610800009999",
"showOnHomescreen": True,
"showOnScreen": True,
"ageRestriction": False,
"showOnScale": False,
"saleStop": False
}
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: 'Orange juice 1L',
price: 349,
taxCategory: '2.6',
description: 'Fresh orange juice',
supplier: 'sup_01',
category: 'cat_beverages',
barcode: '7610800009999',
showOnHomescreen: true,
showOnScreen: true,
ageRestriction: false,
showOnScale: false,
saleStop: false
})
};
fetch('https://dashboard.scango.ch/api/v1/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://dashboard.scango.ch/api/v1/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([
'name' => 'Orange juice 1L',
'price' => 349,
'taxCategory' => '2.6',
'description' => 'Fresh orange juice',
'supplier' => 'sup_01',
'category' => 'cat_beverages',
'barcode' => '7610800009999',
'showOnHomescreen' => true,
'showOnScreen' => true,
'ageRestriction' => false,
'showOnScale' => false,
'saleStop' => false
]),
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://dashboard.scango.ch/api/v1/products"
payload := strings.NewReader("{\n \"name\": \"Orange juice 1L\",\n \"price\": 349,\n \"taxCategory\": \"2.6\",\n \"description\": \"Fresh orange juice\",\n \"supplier\": \"sup_01\",\n \"category\": \"cat_beverages\",\n \"barcode\": \"7610800009999\",\n \"showOnHomescreen\": true,\n \"showOnScreen\": true,\n \"ageRestriction\": false,\n \"showOnScale\": false,\n \"saleStop\": false\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://dashboard.scango.ch/api/v1/products")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Orange juice 1L\",\n \"price\": 349,\n \"taxCategory\": \"2.6\",\n \"description\": \"Fresh orange juice\",\n \"supplier\": \"sup_01\",\n \"category\": \"cat_beverages\",\n \"barcode\": \"7610800009999\",\n \"showOnHomescreen\": true,\n \"showOnScreen\": true,\n \"ageRestriction\": false,\n \"showOnScale\": false,\n \"saleStop\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dashboard.scango.ch/api/v1/products")
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\": \"Orange juice 1L\",\n \"price\": 349,\n \"taxCategory\": \"2.6\",\n \"description\": \"Fresh orange juice\",\n \"supplier\": \"sup_01\",\n \"category\": \"cat_beverages\",\n \"barcode\": \"7610800009999\",\n \"showOnHomescreen\": true,\n \"showOnScreen\": true,\n \"ageRestriction\": false,\n \"showOnScale\": false,\n \"saleStop\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"id": "newProductId"
}{
"error": "Forbidden"
}Products
Create Product
Create a new product in your organization
POST
/
products
Create product
curl --request POST \
--url https://dashboard.scango.ch/api/v1/products \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Orange juice 1L",
"price": 349,
"taxCategory": "2.6",
"description": "Fresh orange juice",
"supplier": "sup_01",
"category": "cat_beverages",
"barcode": "7610800009999",
"showOnHomescreen": true,
"showOnScreen": true,
"ageRestriction": false,
"showOnScale": false,
"saleStop": false
}
'import requests
url = "https://dashboard.scango.ch/api/v1/products"
payload = {
"name": "Orange juice 1L",
"price": 349,
"taxCategory": "2.6",
"description": "Fresh orange juice",
"supplier": "sup_01",
"category": "cat_beverages",
"barcode": "7610800009999",
"showOnHomescreen": True,
"showOnScreen": True,
"ageRestriction": False,
"showOnScale": False,
"saleStop": False
}
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: 'Orange juice 1L',
price: 349,
taxCategory: '2.6',
description: 'Fresh orange juice',
supplier: 'sup_01',
category: 'cat_beverages',
barcode: '7610800009999',
showOnHomescreen: true,
showOnScreen: true,
ageRestriction: false,
showOnScale: false,
saleStop: false
})
};
fetch('https://dashboard.scango.ch/api/v1/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://dashboard.scango.ch/api/v1/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([
'name' => 'Orange juice 1L',
'price' => 349,
'taxCategory' => '2.6',
'description' => 'Fresh orange juice',
'supplier' => 'sup_01',
'category' => 'cat_beverages',
'barcode' => '7610800009999',
'showOnHomescreen' => true,
'showOnScreen' => true,
'ageRestriction' => false,
'showOnScale' => false,
'saleStop' => false
]),
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://dashboard.scango.ch/api/v1/products"
payload := strings.NewReader("{\n \"name\": \"Orange juice 1L\",\n \"price\": 349,\n \"taxCategory\": \"2.6\",\n \"description\": \"Fresh orange juice\",\n \"supplier\": \"sup_01\",\n \"category\": \"cat_beverages\",\n \"barcode\": \"7610800009999\",\n \"showOnHomescreen\": true,\n \"showOnScreen\": true,\n \"ageRestriction\": false,\n \"showOnScale\": false,\n \"saleStop\": false\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://dashboard.scango.ch/api/v1/products")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Orange juice 1L\",\n \"price\": 349,\n \"taxCategory\": \"2.6\",\n \"description\": \"Fresh orange juice\",\n \"supplier\": \"sup_01\",\n \"category\": \"cat_beverages\",\n \"barcode\": \"7610800009999\",\n \"showOnHomescreen\": true,\n \"showOnScreen\": true,\n \"ageRestriction\": false,\n \"showOnScale\": false,\n \"saleStop\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dashboard.scango.ch/api/v1/products")
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\": \"Orange juice 1L\",\n \"price\": 349,\n \"taxCategory\": \"2.6\",\n \"description\": \"Fresh orange juice\",\n \"supplier\": \"sup_01\",\n \"category\": \"cat_beverages\",\n \"barcode\": \"7610800009999\",\n \"showOnHomescreen\": true,\n \"showOnScreen\": true,\n \"ageRestriction\": false,\n \"showOnScale\": false,\n \"saleStop\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"id": "newProductId"
}{
"error": "Forbidden"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Product to create
Firestore document id (present in list and get responses)
Name of the product
Price in cents
Supplier of the product
Tax category
Available options:
8.1, 2.6, 3.8, 0 Category ID of the product
Product declarations
Product barcode
Deposit amount in cents
Product description
Sale price in cents
Sale percentage
Sale start date
Sale end date
Cost price in cents
Product margin
Show on homescreen
Show on screen
Age restriction
Show on scale
Sale stop
Product index
Was this page helpful?
⌘I