The “Get Product by ID” API allows to retrieve information for a specific product using its unique identifier. Use this endpoint to fetch details for a single product based on the provided product ID.
GET https://services.leadconnectorhq.com/products/{productId}
Autorización
Bearer token generado desde el portal Leadway. Ver Autenticación .
Version
string
default: "2021-07-28"
required
Versión de la API.
Path parameters
productId
string
default: "6578278e879ad2646715ba9c"
required
ID or the slug of the product that needs to be returned
Query parameters
locationId
string
default: "6578278e879ad2646715ba9c"
required
account Id
Parameter which will decide whether to show the wishlisting status of products
Respuestas
200 - Successful response
_id
string
default: "655b33a82209e60b6adb87a5"
required
The unique identifier for the product.
description
string
default: "This is a really awesome product"
product description
An array of variants for the product. id
string
default: "38s63qmxfr4"
required
A unique identifier for the variant.
name
string
default: "Size"
required
The name of the variant.
An array of options for the variant. id
string
default: "h4z7u0im2q8"
required
The unique identifier for the option.
name
string
default: "XL"
required
The name of the option.
locationId
string
default: "3SwdhCsvxI8Au3KsPJt6"
required
The unique identifier for the account.
name
string
default: "Awesome Product"
required
The name of the product.
productType
string
default: "PHYSICAL"
required
The type of the product (e.g., PHYSICAL).
Indicates whether the product is available in-store.
createdAt
string
default: "2023-11-20T10:23:36.515Z"
required
The creation timestamp of the product.
updatedAt
string
default: "2024-01-23T09:57:04.846Z"
required
The last update timestamp of the product.
The statement descriptor for the product.
The URL for the product image.
An array of category Ids for the product
The field indicates whether taxes are enabled for the product or not.
An array of ids of Taxes attached to the Product. If the expand query includes tax, the taxes will be of type ProductTaxDto. Please refer to the ProductTaxDto for additional details.
automaticTaxCategoryId
string
default: "65d71377c326ea78e1c47df5"
Tax category ID for Automatic taxes calculation.
The Product label details
slug
string
default: "washing-machine"
The slug of the product by which the product will be navigated
{
"_id" : "655b33a82209e60b6adb87a5" ,
"description" : "This is a really awesome product" ,
"variants" : [
{
"id" : "38s63qmxfr4" ,
"name" : "Size" ,
"options" : [
{}
]
}
],
"locationId" : "3SwdhCsvxI8Au3KsPJt6" ,
"name" : "Awesome Product" ,
"productType" : "PHYSICAL" ,
"availableInStore" : true ,
"createdAt" : "2023-11-20T10:23:36.515Z" ,
"updatedAt" : "2024-01-23T09:57:04.846Z" ,
"statementDescriptor" : "abcde" ,
"image" : "https://storage.googleapis.com/ghl-test/3SwdhCsvxI8Au3KsPJt6/media/65af8d5df88bdb4b1022ee90.png" ,
"collectionIds" : [
"65d71377c326ea78e1c47df5" ,
"65d71377c326ea78e1c47d34"
],
"isTaxesEnabled" : true ,
"taxes" : [
"654492a4e6bef380114de15a"
],
"automaticTaxCategoryId" : "65d71377c326ea78e1c47df5" ,
"slug" : "washing-machine"
}
422 - Unprocessable Entity
Ejemplo
curl -X GET 'https://services.leadconnectorhq.com/products/YOUR_productId' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28'
const response = await fetch ( 'https://services.leadconnectorhq.com/products/YOUR_productId' , {
method: 'GET' ,
headers: {
Authorization: `Bearer ${ process . env . LEADWAY_TOKEN } ` ,
Version: '2021-07-28' ,
},
});
const data = await response . json ();
import os, requests
response = requests.request(
'GET' ,
'https://services.leadconnectorhq.com/products/YOUR_productId' ,
headers = {
'Authorization' : f "Bearer { os.environ[ 'LEADWAY_TOKEN' ] } " ,
'Version' : '2021-07-28' ,
},
)
data = response.json()
<? php
$ch = curl_init ( 'https://services.leadconnectorhq.com/products/YOUR_productId' );
curl_setopt_array ( $ch , [
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_CUSTOMREQUEST => 'GET' ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv ( 'LEADWAY_TOKEN' ),
'Version: 2021-07-28' ,
],
]);
$data = json_decode ( curl_exec ( $ch ), true );