Retrieve Product Data
This guide explains how to extract product information from a specific Version in DealHub. Depending on your needs, whether you want a simple list of SKUs, a full configuration dump for editing, or an Excel file for business users, there are different API endpoints suited for the task.
Choosing the Right Endpoint
DealHub provides three primary methods for retrieving product data:
| Method | Best For... | Endpoint |
|---|---|---|
| Get Products of a Version | Lightweight retrieval of basic details (Attributes, Price). Ideal for syncing SKU lists to an external system. | GET /version/{id}/products |
| Get Product Catalog | Full retrieval of all configuration logic (Assignments, Rules, Pricing). Use this before editing products via API. | GET /version/{id}/products_catalog |
| Extract Products to Excel | Retrieving the binary Excel file used by business admins. | GET /version/products_excel/{id} |
Retrieving Basic Product Details
Use the Get Products of a Version endpoint when you need a simple list of products, their attributes, and basic pricing, without the heavy configuration logic.
When using the Get Products of a Version endpoint, you have the following filtering options:
-
product_option: Set toMODIFIEDto retrieve only products that were added or updated in this version compared to the previous one. This is useful for incremental syncs . -
pricing_option: If a product has multiple price rules, specifyMIN,MAX, orFIRSTto determine which price value is returned.
curl --location 'https://api.dealhub.io/api/v1/version/160EDBdA51E28FAA/products?product_option=MODIFIED&pricing_option=MAX' \
--header 'Authorization: Bearer <YOUR_TOKEN>'
The endpoint returns a simplified list of products and bundles.
{
"products": [
{
"sku": "56545",
"name": "Product A",
"type": "PRODUCT",
"price": { "USD": "12.5" },
"attributes": [
{ "attr_x": "value X" }
]
}
]
}
Pagination
This endpoint supports pagination using
offsetandlimit. The default limit is 1,000 items.
Retrieving the Full Product Catalog
Use the Get Product Catalog endpoint when you need the complete definition of a product, including Assignment Rules, Pricing Rules, and Conditional Names. This is essential if you plan to update a product, as you must re-upload the full structure to avoid accidental data loss .
You can request specific products by appending ?sku={SKU} to the URL. This allows you to fetch just the items you intend to modify.
curl --location 'https://api.dealhub.io/api/v1/version/160EDBdA51E28FAA/products_catalog?sku=SKU001&sku=SKU002' \
--header 'Authorization: Bearer <YOUR_TOKEN>'
The endpoint response returns the deep configuration object for each product.
{
"products": [
{
"sku": "ABC-12345-S-BL",
"product_assignments": [
{
"assignment": "RULE_BASED",
"assignment_rules": [
{ "rule": "[General.Region] = \"US\"", "product_factors": [...] }
]
}
],
"product_pricing": {
"advanced": true,
"pricing_rules": [...]
}
}
]
}
Data Safety
When updating a product, you must provide its entire definition. Always perform a
GETrequest first to retrieve the current state, modify the JSON, and thenPOSTit back. Omitting fields (like tags or attributes) in your upload will cause them to be deleted .
Exporting to Excel
For business users who prefer to work in spreadsheets, you can retrieve the product configuration as an Excel file directly via the API. To receive the Excel file, use the Extract Products to Excel endpoint. This generates the same file available through the "Export to Excel" button in the DealHub UI .
The API returns a byte array representing the .xlsx file. You should save this output with an .xlsx extension.
Next Steps
- Updating the Product Catalog: Learn how to use the JSON data you retrieved to modify and upload product definitions.
- Managing Versions: Understand how to create the Draft version required for making these updates.
Updated 18 days ago
