Working with Deep Links
Generate trackable affiliate links that direct users to specific product pages on Drapier.
Deep links are trackable URLs that route a user from your site to a specific product page on one of our marketplace storefronts (Italist, HEWI, Verishop). Every click through a deep link is recorded for attribution, so you earn commission when the user completes a purchase within the 30-day cookie window.
Link structure
A deep link follows this pattern:
https://click.drapier.io/{publisher_id}/{product_id}?sub_id={sub_id}| Segment | Description |
|---|---|
publisher_id | Your unique publisher identifier (e.g. pub_123) |
product_id | The product being linked to (e.g. prod_456) |
sub_id | Optional tracking parameter you define for campaign segmentation |
When a user clicks the link, the click handler logs the event, sets a 30-day attribution cookie, and issues a 302 redirect to the product page on the destination storefront.
Generating links via API
Use the deep link endpoint to generate a trackable URL from any product page URL:
curl -X POST https://api.drapier.io/api/v1/publishers/me/deep-link \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"productUrl": "https://italist.com/product/gucci-marmont-bag",
"subId": "homepage-banner"
}'Response:
{
"url": "https://click.drapier.io/pub_123/prod_456?sub_id=homepage-banner",
"publisherId": "pub_123",
"productId": "prod_456"
}The API resolves the product URL to an internal product ID and constructs the click URL with your publisher ID. If you include a subId, it is appended as a query parameter.
Using sub-IDs for campaign tracking
Sub-IDs let you segment clicks and commissions by placement, campaign, or any dimension you define. They flow through the entire attribution pipeline and appear on your commission reports.
Common sub-ID strategies:
| Strategy | Example subId | Use case |
|---|---|---|
| Placement | homepage-hero | Track which site sections convert best |
| Campaign | spring-sale-2026 | Measure campaign-level performance |
| Content type | blog-gucci-review | Attribute commissions to specific content |
| A/B variant | cta-red-v2 | Compare creative performance |
Sub-IDs are free-form strings up to 128 characters. Use lowercase with hyphens for consistency.
Common link patterns
Product links
Link directly to a specific product — the highest-converting pattern:
https://click.drapier.io/pub_123/prod_456?sub_id=pdp-sidebarCategory links
Link to a category page using the deep link API with the category URL:
curl -X POST https://api.drapier.io/api/v1/publishers/me/deep-link \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"productUrl": "https://italist.com/collections/bags", "subId": "nav-bags"}'Brand links
Link to a brand landing page:
curl -X POST https://api.drapier.io/api/v1/publishers/me/deep-link \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"productUrl": "https://italist.com/collections/gucci", "subId": "brand-gucci"}'Best practices
- Always use deep links — generic homepage links lose product context and convert poorly.
- Tag every link with a sub-ID — without sub-IDs you cannot attribute commissions to specific placements or campaigns.
- Test links before publishing — click the generated URL in an incognito window and verify you land on the correct product page.
- Rotate stale links — products go out of stock. Use the product feed to keep your links current.
- Prefer API-generated links — manually constructing click URLs is error-prone. The API validates the product exists and returns a well-formed URL.