Skip to main content
DrapierDrapier

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.

A deep link follows this pattern:

https://click.drapier.io/{publisher_id}/{product_id}?sub_id={sub_id}
SegmentDescription
publisher_idYour unique publisher identifier (e.g. pub_123)
product_idThe product being linked to (e.g. prod_456)
sub_idOptional 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.

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:

StrategyExample subIdUse case
Placementhomepage-heroTrack which site sections convert best
Campaignspring-sale-2026Measure campaign-level performance
Content typeblog-gucci-reviewAttribute commissions to specific content
A/B variantcta-red-v2Compare creative performance

Sub-IDs are free-form strings up to 128 characters. Use lowercase with hyphens for consistency.

Link directly to a specific product — the highest-converting pattern:

https://click.drapier.io/pub_123/prod_456?sub_id=pdp-sidebar

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"}'

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.

On this page