Back to home

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.

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,
        "image": "https://www.magazaniz.com/img/1001.jpg",
        "purchaseLink": "https://www.magazaniz.com/kasmir-kazak",
        "stock": 12,
        "isActive": true,
        "categories": [{ "id": "12", "name": "Kazak" }]
      }
    ]
  }'

4. Report orders

When an order completes, report it from your server. 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-productsPush your product catalog (the full list — what you send replaces the catalog).
POST/integrations/track-saleReport an order as an affiliate sale.
POST/integrations/track-refundReport a refund; the commission is reversed (partial refunds pro rata).
POST/integrations/track-cancellationReport a cancellation; the commission is reversed.
GET/integrations/statusReturn the current state of the connection.
POST/integrations/verifyConfirm the key works and mark the connection active.

End-to-end example

Code to run from your server when an order completes. Read the cookie in the browser, store it on your own order record, then report it.

// On your server, once the order is paid.
// `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.paidTotal, // what the customer actually paid
    currency: "TRY",
    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

  • 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.
  • 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