Obtenir un producte per ID
inventory:products.readhttps://api.holded.com/api/v2/products/{productId}Recupera tots els detalls d'un producte específic pel seu identificador únic.
Paràmetres
Paràmetres de ruta
stringobligatoriID del producte (ObjectId hexadecimal de 24 caràcters)
Petició
import requests
url = "https://api.holded.com/api/v2/products/{productId}"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/json",
}
response = requests.get(url, headers=headers)
print(response.json())Respostes
Resposta
{
"id": "507f1f77bcf86cd799439011",
"kind": "simple",
"name": "string",
"description": "string",
"type_id": "string",
"price": "99.95",
"taxes": [
"string"
],
"total": "string",
"has_stock": false,
"stock": "15.3",
"barcode": "string",
"sku": "string",
"cost": "50.00",
"purchase_price": "string",
"weight": "3.2",
"tags": [
"string"
],
"category_id": "string",
"factory_code": "string",
"for_sale": false,
"for_purchase": false,
"sales_channel_id": "string",
"exp_account_id": "string",
"warehouse_id": "string",
"archived": false,
"purchase_taxes": [
"string"
],
"min_stock": "5",
"min_stock_alarm": false,
"in_pos": false,
"supplier_id": "string",
"translations": [
{}
],
"rates": [
{
"id": "string",
"subtotal": "string",
"taxes": [
"string"
]
}
],
"attributes": [
{
"id": "string",
"name": "string",
"value": "string"
}
],
"variants": [
{
"id": "string",
"sku": "string",
"barcode": "string",
"price": "19.99",
"cost": "string",
"purchase_price": "string",
"stock": "10.00",
"description": "string",
"weight": "string",
"factory_code": "string",
"archived": false,
"options": [
{
"name": "...",
"value": "...",
"originId": "..."
}
],
"category_fields": [
{
"id": "...",
"name": "...",
"value": "..."
}
],
"sales_rates": [
{
"id": "...",
"subtotal": "...",
"taxes": "..."
}
]
}
],
"pack_items": [
{
"product_selection": "507f1f77bcf86cd799439011",
"units": 2
}
],
"stocks": [
{
"warehouse_id": "string",
"stock": "10",
"variant_id": "string"
}
],
"image": {}
}Respostes exitoses
200Producte trobatapplication/jsonUnique identifier of the product
Type of item
simplevariantslotsserialnumberspackName of the product
Description of the product
Identifier of the product type
Sale price as a decimal string
List of tax identifiers applied to the product
Total price including taxes as a decimal string
Whether the product has stock tracking enabled
Current total stock across all warehouses as a decimal string
Barcode value (EAN, UPC, etc.)
Stock Keeping Unit code
Cost price as a decimal string
Purchase price as a decimal string
Weight in the account default unit as a decimal string
List of tags attached to the product
Identifier of the product category
Manufacturer or factory reference code
Whether the product is available for sale
Whether the product is available for purchase
Identifier of the sales channel assigned to this product
Identifier of the expenses account
Identifier of the default warehouse
Whether the product is archived
List of tax identifiers applied to purchases
Minimum stock threshold as a decimal string
Whether the minimum stock alarm is enabled
Whether the product is available in point of sale
Identifier of the default supplier
Product name translations by locale
Price rates with different subtotals and taxes
Product attributes
Variants of the product. Present for kinds: variants, lots, serialnumbers. Each item contains fields relevant to the kind.
Attribute options for this variant (e.g. Color=Red, Size=M). Only present for variants products.
Values of your own variant-group fields for this variant (e.g. Size=M, Color=Red) — the fields you configure under your product categories. Unrelated to `options`, which is ecommerce-synced data. Only present for variants products.
Price rates with tax breakdown for this variant.
Component items included in this pack product. Only present for pack products.
Product ID or "productId#variantId"
Stock per warehouse. Each entry has warehouse_id and stock. Variant products also include variant_id.
Only present for variant/lots/serialnumbers products.
Main product image with its resolved URLs. Null when the product has no images.
Respostes d'error
401API key no vàlida o no proporcionadaapplication/json403Permisos insuficientsapplication/json404Producte no trobatapplication/json429Límit de sol·licituds exceditapplication/json