Infumar Store API
Not on ikas, Shopify, IdeaSoft or WooCommerce? Connect your own e-commerce software with this API — the same one our ready-made integrations speak.
Getting started
1. Connect your store
In the Infumar panel: My Brands → integrations → “Custom software”. Enter your store address and you are issued an API key. Treat it as a password: keep it on your server.
2. Add the tracking script
This one line runs on every page. It records which influencer the visitor came from in a first-party cookie and confirms they reached your store (the influencer's click earning depends on it). No configuration.
<script src="https://api.infumar.com/api/v1/integrations/track.js" async></script>3. Push your products
These are the products the advertiser picks for a campaign and the influencer shares. Re-send the list whenever prices or stock move. The list you send IS the whole catalog: a product missing from it counts as removed from the store and stops being shown to influencers. Three optional fields earn their place: when a promo is running send the list price as `price` and the promo price as `discountPrice` (the price the customer pays is shown, with the list price struck through beside it); `description` is your product copy, and it is the only thing the AI creative draft may take the product's properties from (send HTML, we strip it); `images` are the product's extra angles.
curl -X POST https://api.infumar.com/api/v1/integrations/sync-products \
-H "X-API-Key: inf_..." \
-H "Content-Type: application/json" \
-d '{
"products": [
{
"id": "SKU-1001",
"name": "Kaşmir Kazak",
"price": 1450,
"discountPrice": 1190,
"description": "<p>%100 kaşmir, iki iplik örgü.</p>",
"image": "https://www.magazaniz.com/img/1001.jpg",
"images": ["https://www.magazaniz.com/img/1001-arka.jpg"],
"purchaseLink": "https://www.magazaniz.com/kasmir-kazak",
"stock": 12,
"isActive": true,
"categories": [{ "id": "12", "name": "Kazak" }]
}
]
}'4. Report orders
Report each order from your server the moment it is placed — don't wait for payment, cash on delivery included. You send the short code from the cookie; we resolve the influencer and the project.
Authentication
Every request carries an `X-API-Key` header. The key represents your STORE — you do not state which influencer earns, and you could not if you tried. Disconnect from the panel and the key stops working the same moment.
X-API-Key: inf_a1b2c3d4e5f6…How attribution works
marketing.developers.attribution
Endpoints
| POST | /integrations/sync-products | Push your product catalog (the full list — what you send replaces the catalog). |
| POST | /integrations/track-sale | Report an order as an affiliate sale. |
| POST | /integrations/track-refund | Report a refund; the commission is reversed (partial refunds pro rata). |
| POST | /integrations/track-cancellation | Report a cancellation; the commission is reversed. |
| POST | /integrations/track-delivery | Reports an order delivered (for cash on delivery: collected); a pay-on-delivery sale confirms sooner. |
| GET | /integrations/status | Return the current state of the connection. |
| POST | /integrations/verify | Confirm the key works and mark the connection active. |
End-to-end example
Code to run from your server the moment an order is placed. Read the cookie in the browser, store it on your own order record, then report it.
// On your server, the moment the order is PLACED — don't wait for
// payment (cash on delivery included). Cancel/refund reverse it later.
// `shortCode` is the value you stored from the infumar_aff cookie.
await fetch("https://api.infumar.com/api/v1/integrations/track-sale", {
method: "POST",
headers: {
"X-API-Key": process.env.INFUMAR_API_KEY, // never in the browser
"Content-Type": "application/json",
},
body: JSON.stringify({
shortCode, // e.g. "a1b2c3d4"
orderId: order.id, // your own id — retries are idempotent on it
orderTotal: order.total, // what the customer pays, after discounts
currency: "TRY",
paymentOnDelivery: order.payment === "cod", // cash/card at the door
products: order.lines.map((l) => ({
productId: l.sku, // same id you sent to sync-products
name: l.name,
price: l.unitPrice,
quantity: l.quantity,
})),
}),
});
// → { success: true, attributed: true, duplicate: false }
// → { success: true, attributed: false, reason: "unknown_short_code" }// Full refund — omit refundAmount.
await fetch("https://api.infumar.com/api/v1/integrations/track-refund", {
method: "POST",
headers: { "X-API-Key": process.env.INFUMAR_API_KEY, "Content-Type": "application/json" },
body: JSON.stringify({ orderId: order.id }),
});
// Partial refund — the commission is clawed back pro rata.
await fetch("https://api.infumar.com/api/v1/integrations/track-refund", {
method: "POST",
headers: { "X-API-Key": process.env.INFUMAR_API_KEY, "Content-Type": "application/json" },
body: JSON.stringify({ orderId: order.id, refundAmount: 250, isFullRefund: false }),
});What to know
- Verify the connection first: send "infumar-test" as the short code to track-sale. The response is test: true and no sale is recorded. Until your store sends its first sale report (the test included), no e-commerce affiliate project can open on it.
- Reporting the same order twice is harmless — the second answers `duplicate` and no commission is written again. Retry freely after a timeout.
- Commission is computed from `orderTotal`: what the customer actually paid, after discounts and coupons.
- An order whose short code resolves to nothing is not an error — you get `attributed: false` and nothing is recorded.
- A sale's commission waits out a 14-day refund window before the influencer is paid. That is why reporting refunds matters.
- Report cash-on-delivery orders when they are placed too, with paymentOnDelivery: true; don't wait for collection. Such a sale is paid to the creator after a longer waiting period; report it delivered with track-delivery and the wait shortens to the ordinary refund window from delivery. Report an undelivered or refused order with track-cancellation and a return with track-refund, and the commission is reversed — even after the waiting period.
- Never put the key in the browser. A key in page JavaScript is a key anyone can read and use to report fabricated orders. Always report from your server.
If you get stuck
Open a support thread from the panel while integrating — we know which store you are, so we can follow your requests in the logs with you.
Connect my store in the panel