Get product by ID with sales and stock analytics
curl --request GET \
--url https://app.solya.app/api/products/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.solya.app/api/products/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.solya.app/api/products/{id}', 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://app.solya.app/api/products/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.solya.app/api/products/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.solya.app/api/products/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.solya.app/api/products/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"averagePrice": 122.6,
"avgGrossMarginPct": 55,
"avgSellingPrice": 122.65,
"brandId": "brand-uuid-sezane",
"brandName": "Sézane",
"family": "Robes",
"id": "product-uuid-1",
"imageUrl": "https://cdn.example.com/products/robe-angele.jpg",
"monthlySales": 23,
"name": "Robe Angèle",
"shopCount": 6,
"sizesAvailable": [
"XS",
"S",
"M",
"L"
],
"stockValue": 2473.49,
"tags": [
"Overstock - +30 jours"
],
"totalCogs": 1269.38,
"totalDiscount": 0,
"totalGrossMargin": 1551.52,
"totalGrossSales": 2820.9,
"totalNetSales": 2820.9,
"totalQuantity": 217,
"totalTransactions": 17,
"totalUnitsSold": 23,
"variantCount": 4
}Products
Get product by ID with sales and stock analytics
Returns a single product by its ID, enriched with the same analytics summary as the product list: units sold, gross/net sales (revenue), gross margin and margin %, monthly sales, average selling price, stock value, on-hand quantity, and merchandising tags. Use this to inspect one product’s sales performance and stock position.
GET
/
api
/
products
/
{id}
Get product by ID with sales and stock analytics
curl --request GET \
--url https://app.solya.app/api/products/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.solya.app/api/products/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.solya.app/api/products/{id}', 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://app.solya.app/api/products/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.solya.app/api/products/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.solya.app/api/products/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.solya.app/api/products/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"averagePrice": 122.6,
"avgGrossMarginPct": 55,
"avgSellingPrice": 122.65,
"brandId": "brand-uuid-sezane",
"brandName": "Sézane",
"family": "Robes",
"id": "product-uuid-1",
"imageUrl": "https://cdn.example.com/products/robe-angele.jpg",
"monthlySales": 23,
"name": "Robe Angèle",
"shopCount": 6,
"sizesAvailable": [
"XS",
"S",
"M",
"L"
],
"stockValue": 2473.49,
"tags": [
"Overstock - +30 jours"
],
"totalCogs": 1269.38,
"totalDiscount": 0,
"totalGrossMargin": 1551.52,
"totalGrossSales": 2820.9,
"totalNetSales": 2820.9,
"totalQuantity": 217,
"totalTransactions": 17,
"totalUnitsSold": 23,
"variantCount": 4
}Authorizations
User session token issued by NextAuth. For human users accessing Solya via the web application.
Path Parameters
Unique identifier of the resource (UUID)
⌘I

