Liffio sends your first automated DM in under 5 minutes - Get Started Free Get Started Free →

Partner docs · v1.1

Know the moment your customers claim

Liffio tells your system when a customer claims the perk you gave them, so you never send a second link to someone who already has it.

How it works

From link to claim in five steps

The status changes as your customer moves through the claim. You only need to act on the last one.

  1. 1You send a link

    A signed link with your customer's ref, or a code.

    not_claimed
  2. 2They open it

    We hold the perk for them for 30 minutes.

    pending
  3. 3They sign up

    They sign up or log in to Liffio by email, then connect Instagram.

    pending
  4. 4Perk applied

    Their offer starts: free time right away, or the discount waits for their first payment.

    claimed
  5. 5We tell you

    A claim.claimed webhook. Stop sending links. Later payments send claim.paid.

    claim.claimed

Statuses

Five statuses, one simple rule

Webhooks and the status API use the same words. Only not_claimed means it's OK to send a link.

not_claimed

Never claimed, or a 30 minute hold ran out.

OK to send a link
pending

On the 30 minute hold, or the customer is signing up.

Wait, check later
claimed

The perk was applied, even after the free time ends.

Stop sending links
blocked

Their Instagram account already used a Liffio perk, or they already pay for Liffio.

Stop sending links
revoked

Liffio cancelled this claim.

Stop, ask Liffio

Webhooks · push

We POST to you when a claim changes

Give your Liffio contact an https URL, and we tell you about claims and payments. You get a signing secret (whsec_...) once, to check every request really came from us.

Events

Pick one to see its payload.

No events are sent for a link being opened or a hold running out. Use the status API for those.

Revenue share. claim.paid is sent for every payment from a customer you brought. payment.earning is your cut (excluding GST, after any discount, in the payment's currency), or null when that payment doesn't earn (no revenue share, or the first payment came after your window). Earnings sit on_hold for 20 days, then become available. A refund sends claim.refunded and the earning becomes clawed_back.

What we do with your reply

Any 2xx within 10 s
→
Delivered
4xx, 5xx, timeout, server down
→
Retry later
A redirect (3xx)
→
Retry. We don't follow redirects

The reply body is ignored. A plain 200 OK is enough.

Your side

  1. 1Check the signature and reject anything that fails.
  2. 2Skip duplicates. Retries reuse the same Liffio-Event-Id.
  3. 3Save the status against data.ref (or data.code).
  4. 4Reply 200 fast and do slow work afterwards.

Events can arrive out of order. Trust data.status, not the order they arrive in.

Request headers
POST https://your-server.example/liffio-webhook
Content-Type: application/json
User-Agent: Liffio-Webhooks/1.0
Liffio-Event-Id: evt_3f9a1c7e5b2d4a6c8e0f1a2b
Liffio-Signature: t=1793963201,v1=5f2b9c...
claim.claimed
{
  "id": "evt_3f9a1c7e5b2d4a6c8e0f1a2b",
  "type": "claim.claimed",
  "created_at": "2026-11-06T10:00:01Z",
  "data": {
    "ref": "123456789",
    "code": null,
    "status": "claimed",
    "claimed_at": "2026-11-06T10:00:00Z",
    "plan": "starter",
    "access_ends_at": "2026-12-06T10:00:00Z",
    "pending_until": null
  }
}
Every data has the same six fields as the status API, plus code, and payment on paid and refunded
If you don't reply 2xx, we keep trying for about 33 hoursThe wait after each failed try. Not to scale.
  1. Try 1right away
  2. Try 2+1 min
  3. Try 3+5 min
  4. Try 4+30 min
  5. Try 5+2 h
  6. Try 6+6 h
  7. Try 7+24 h
  8. FailedLiffio can resend
Same event id every timeSo you can safely skip ones you've seen.
Turned off after 3 daysWith no success and at least 20 failed tries.
Back on when fixedLiffio turns it on again once your URL works.

Security

Check every webhook is really from Liffio

v1 is an HMAC-SHA256 of <t>.<raw body> with your signing secret, in hex. Use the raw body, before parsing JSON.

  1. 1Read t and every v1 from the Liffio-Signature header.
  2. 2Reject old requests. If t is more than 5 minutes from now, drop it.
  3. 3Compute the HMAC of t, a dot, and the raw body.
  4. 4Compare safely with a constant-time compare. Any matching v1 passes.

When Liffio rotates your secret, the header carries two v1= values for 24 hours. The code here accepts either, so nothing breaks.

const crypto = require("crypto");

function isFromLiffio(rawBody, header, secret) {
  const parts = header.split(",");
  const t = Number((parts.find((p) => p.startsWith("t=")) || "").slice(2));
  // reject anything older than 5 minutes
  if (!t || Math.abs(Date.now() / 1000 - t) > 300) return false;

  const expected = crypto
    .createHmac("sha256", secret)
    .update(`${t}.${rawBody}`)
    .digest("hex");

  return parts
    .filter((p) => p.startsWith("v1="))
    .map((p) => p.slice(3))
    .some((s) =>
      s.length === expected.length &&
      crypto.timingSafeEqual(Buffer.from(s), Buffer.from(expected))
    );
}

Status API · pull

Ask about one customer, any time

Call it from your server just before you send a link, or to catch a webhook you missed. Your API key (lf_partner_...) comes from your Liffio contact.

GEThttps://api.liffio.com/partner/v1/claims/{ref}

Headers

Authorizationstringrequired

Bearer lf_partner_.... Server side only, never in a web page or app.

Path

refstring · max 200required

Your customer reference, URL-encoded (a space becomes %20, a slash %2F). A ref we've never seen returns not_claimed, not a 404.

Responses

200

Always the same six fields. Fields that don't apply are null.

400

{"error":"invalid_ref"} The ref is empty or too long.

401

{"error":"unauthorized"} Key missing, wrong or revoked.

429

{"error":"rate_limited"} Over 60 a minute. Wait the seconds in Retry-After.

Using codes? Look up by code

GEThttps://api.liffio.com/partner/v1/codes/{code}

Same key, same limit, same six fields, with code (as issued) in place of ref, plus code_state: active, expired or voided. Works for one-time codes. A shared code is used by many customers, so it returns 400 {"error":"shared_code"}. A code that isn't yours returns 404 {"error":"unknown_code"}, and one that isn't a code at all 400 {"error":"invalid_code"}.

curl https://api.liffio.com/partner/v1/claims/123456789 \
  -H "Authorization: Bearer $LIFFIO_API_KEY"
200
{
  "ref": "123456789",
  "status": "claimed",
  "claimed_at": "2026-11-06T10:00:00Z",
  "plan": "starter",
  "access_ends_at": "2026-12-06T10:00:00Z",
  "pending_until": null
}

Good to know

Limits and rules

60/min

Status API requests per key. Headers show what's left.

10s

Time your server has to reply to a webhook.

7tries

Per webhook, over about 33 hours.

UTC

Every time ends in Z. 10:00Z is 3:30 PM in India.

Use bothWebhooks keep your records current. Check the status API right before sending, in case one was missed.
One perk per customerA re-sent link never gives a second perk. It only shows your customer "already claimed".
No customer dataWe never send emails, names or Instagram handles. Only the ref or code, status, plan and times.
Keys shown onceIf a key or secret leaks, ask Liffio to revoke or rotate it. To test, ask Liffio to press Send test.
Liffio Partner API · v1.1Download this guide as a PDFLast updated 9 Nov 2026