Copy-paste examples for integrating with Attribloom — commission-only
affiliate attribution for Shopify stores and iOS (StoreKit 2) apps. You pay a commission only
on conversions your affiliates actually drive; attribution is native (Shopify order/checkout webhooks;
StoreKit 2 appAccountToken + App Store Server Notifications v2), not fingerprinting.
These examples are intentionally small and dependency-free so you can drop them into any stack.
signed-postback/— report a conversion from your own server with an HMAC-signed postback (the generic surface: any web/app backend).shopify-ref-preservation/— capture the affiliaterefon a Shopify storefront so it rides the cart into the order (if you are not using the Attribloom Shopify app embed).storekit-bind/— bind an App Store purchase to the affiliate who drove it via the Attribloom-issuedappAccountToken(Swift / StoreKit 2).
Create a campaign in Attribloom — it provisions a surface with an identifier (x-ea-surface,
not a secret) and a postback secret (your HMAC key, kept server-side). For each completed
conversion you POST a small JSON body to https://api.attribloom.com/v1/conversions, signed as:
signature = "sha256=" + HMAC_SHA256(secret, `${timestamp}.${rawBody}`) // hex
Sent as three headers:
| Header | Value |
|---|---|
x-ea-surface |
your surface identifier |
x-ea-timestamp |
current unix time in seconds (must be within ±5 min of the server) |
x-ea-signature |
sha256= + the hex HMAC above |
Sign the raw bytes you send — serialize the JSON once and reuse that exact string for both the signature and the request body (re-serializing can change key order/whitespace and break the signature).
Attribloom matches each conversion to the affiliate (via the clickId from the tracking-link
redirect, or a referral/discount code) and credits commission. Refunds are handled by a signed
refund postback (see the docs) which claws back the commission.
Attribloom is built for disclosed affiliate/creator content. If you generate or distribute AI creator/affiliate content, disclose the material connection and the synthetic nature of the endorser. Don't post undisclosed-AI or spam affiliate content — it violates FTC guidance and platform ToS. Attribloom bakes disclosure into generated content by design.
- API + integration docs: https://attribloom.com
- Machine-readable index for AI agents: https://attribloom.com/llms.txt
- Agent onboarding steps: https://attribloom.com/agent
Issues and PRs welcome. MIT licensed.