Skip to main content

Get Product by ID

Get detailed information about a specific product and all its variants.

Endpoint

GET /v1/products/delivery-partners/{dpID}/{productID}

Headers

HeaderTypeDescriptionRequired
x-client-idStringYour clientID✅ Yes
x-client-secretStringYour clientSecret✅ Yes

Path Parameters

ParameterTypeDescriptionRequired
dpIDStringYour delivery partner ID✅ Yes
productIDStringProduct identifier✅ Yes
Product ID Format

Product IDs follow the pattern: PROD-{UUID} (e.g., PROD-cd250a2a-2b27-40e0)

Example Request

curl --location 'https://stage-platform-exlr8.exlr8now.com/v1/products/delivery-partners/YOUR_DP_ID/PROD-cd250a2a-2b27-40e0' \
--header 'x-client-id: YOUR_CLIENT_ID' \
--header 'x-client-secret: YOUR_CLIENT_SECRET'

Response

Successful Response

{
"productID": "PROD-cd250a2a-2b27-40e0",
"attachments": [
"https://storage.googleapis.com/stage-platform-exlr8-public/assets/exlr8/products/0e6fffdd-67e7-41f1-bf87-12adc597d4cb/images/products/default_voucher.jpg"
],
"currency": "AED",
"applicableCountries": ["AE"],
"categories": [
{
"categoryID": "CAT-e0bc01c8-a9b2-4d3a",
"categoryName": "Gaming"
}
],
"descriptionText": "Get this voucher for instant savings on your next purchase. Simply redeem it at the time of checkout to apply the discount. It's the perfect way to make your money go further",
"productDisplayName": "TEST_PRODUCT_1_DP_APIS",
"productName": "TEST_PRODUCT_1_DP_APIS",
"redemptionInstructions": "To redeem your voucher, follow these steps:\n\nClick on the unique redemption URL provided in your email or on the voucher page.\n\nAdd your desired products to the cart on the partner's website.\n\nThe discount will be automatically applied at checkout, or you may need to enter a unique code found on your voucher.\n\nComplete your purchase and enjoy your savings!",
"termsAndConditions": "This voucher is valid for one-time use only. 2. It cannot be combined with any other offers, discounts, or promotions. 3. This voucher is non-refundable and cannot be exchanged for cash. 4. The voucher is valid until its stated expiration date. 5. Lost, stolen, or damaged vouchers will not be replaced. 6. The merchant reserves the right to modify these terms and conditions at any time without prior notice",
"variants": [
{
"variantID": "VAR-23c2a475-06cb-4118",
"variantName": "TEST_PRODUCT_1_DP_APIS INR 100",
"variantDisplayName": "₹ 100",
"mrp": 100,
"price": 99,
"margin": 1,
"stock": 10000,
"convertedSellingPrice": 2423.9556
}
]
}
Currency Conversion

In the example above, the product is in AED currency, so its convertedSellingPrice (2423.9556) is calculated using the current FX rate from AED to INR (your selected wallet currency), including any applicable markup. If the product currency matches your selected wallet currency, no FX conversion is applied, and convertedSellingPrice equals the price.

Response Fields

Product Information

FieldTypeDescription
productIDStringUnique product identifier
productNameStringInternal product name
productDisplayNameStringDisplay name for customers
descriptionTextStringProduct description
redemptionInstructionsStringHow to redeem the product
termsAndConditionsStringTerms and conditions
attachmentsArrayProduct images and assets
categoriesArrayProduct categories
currencyStringProduct currency
applicableCountriesArrayThe list of countries the product is available in
variantsArrayAvailable product variants

Variant Fields

FieldTypeDescription
variantIDStringUnique variant identifier
variantNameStringInternal variant name
variantDisplayNameStringDisplay name for customers
mrpNumberMaximum retail price in product currency
priceNumberYour cost price in product currency
marginNumberMargin percentage
stockNumberAvailable stock quantity
convertedSellingPriceNumberConverted selling price in DP selected wallet currency

Category Fields

FieldTypeDescription
categoryIDStringCategory identifier
categoryNameStringCategory display name

Product Details Usage

This endpoint is ideal for:

1. Product Detail Pages

Show comprehensive product information to customers before purchase.

2. Variant Selection

Display all available denominations/variants for a product.

3. Pricing Information

Get current pricing for specific products.

Integration Example

// Example: Create product detail page
async function getProductDetails(productID) {
try {
const response = await fetch(
`${baseUrl}/products/delivery-partners/${dpID}/${productID}`,
{
headers: {
"x-client-id": clientId,
"x-client-secret": clientSecret,
},
}
);

if (!response.ok) {
const error = await response.json();
throw new Error(`${error.errCode}: ${error.error}`);
}

const product = await response.json();

// Format for display
return {
...product,
formattedVariants: product.variants.map((variant) => ({
...variant,
displayPrice: `${variant.price.toLocaleString()}`,
originalPrice:
variant.mrp > 0 ? `${variant.mrp.toLocaleString()}` : null,
discount:
variant.mrp > variant.price
? Math.round(((variant.mrp - variant.price) / variant.mrp) * 100)
: 0,
})),
categoryNames: product.categories
.map((cat) => cat.categoryName)
.join(", "),
};
} catch (error) {
console.error("Error fetching product details:", error);
throw error;
}
}

Error Responses

Product Not Found

{
"error": "product not found for dpID: YOUR_DP_ID, productID: PRODUCT_ID",
"errCode": "RECORD_NOT_FOUND"
}

Unauthorized Access

{
"error": "unauthenticated",
"errCode": "UNAUTHORIZED"
}

Access Denied

{
"error": "forbidden: param: admin user does not have access to DP: INVALID_DP_ID",
"errCode": "FORBIDDEN"
}

Best Practices

  1. Cache Product Details: Product information changes infrequently
  2. Handle Missing Images: Gracefully handle products without attachments
  3. Display Variants Clearly: Show all available denominations/options
  4. Format Pricing: Present pricing in user-friendly formats
  5. Show Redemption Info: Clearly display how customers can use the product

Use Cases

1. Product Comparison

Compare different variants of the same product.

2. Customer Education

Show detailed product information and redemption instructions.

3. Inventory Planning

Understand available variants for inventory planning.