ClonifyDevelopersOpen panel

Getting started

  • Authentication
  • Errors
  • Pagination
  • Rate limits
  • Webhooks
  • For AI agents
  • MCP server

API reference

  • Outgoing webhooks3
  • Student learning activity8
  • External API deliveries6
  • Chat with the clone1
  • Contacts & tags5
  • Academy access4
  • Conversations4
  • Product catalogue13
  • External sales3
  • Content12
  • Multimedia4
  • Clones (versions in the API)3
  • Meetings & bookings3
  • Sales pipeline6
  • Webinars6
  • Account & usage1
Clonify

External sales

GET/api/v1/sales

Read purchases and attribution

Read native and external purchases in your account. Filter by purchase_id or order_ref and paginate with limit (1–200) and starting_after, preserving filters. id identifies the purchase and visitor_id the buyer; email is the current address. attribution is the snapshot saved with the purchase, not the current contact profile. Historical purchases without data return null. New native payments retain UTM and ref carried by the payment without reconstructing first_touch or last_touch. This query does not calculate commissions or pay affiliates. billing is null unless you turn on “Include the buyer's billing details (tax ID and address) in the sale notice” (send_purchase_billing in /api/v1/webhook): then it carries the invoice details saved with the sale, whether paid by card, installments, subscription or PayPal: name, email, tax_id (the form's “Fiscal ID”), vat_id (EU VAT number) and address (line1, line2, city, postal_code, state, country). Also null when the account didn't ask for them or for sales before 10 Nov 2026.

Query parameters

limitinteger 1..200
starting_afterinteger
purchase_idinteger
order_refstring 1..120
bash
curl "https://www.clonify.com/api/v1/sales" \
  -H "Authorization: Bearer clk_live_…"
json
{
  "object": "list",
  "data": [
    {
      "id": 91,
      "visitor_id": 54,
      "contact_id": 70,
      "email": "buyer@example.com",
      "product_id": 12,
      "product_title": "Curso",
      "amount_cents": 19900,
      "refunded_amount_cents": 0,
      "currency": "eur",
      "source_ref": "ext:PED-1042",
      "order_ref": "PED-1042",
      "created_at": "2026-10-27T10:00:00.000Z",
      "attribution": {
        "utm_source": "newsletter",
        "ref": "partner-7",
        "first_touch": {
          "utm_source": "partner",
          "ref": "partner-7",
          "occurred_at": "2026-10-20T08:00:00Z"
        },
        "last_touch": {
          "utm_source": "newsletter",
          "occurred_at": "2026-10-27T09:00:00Z"
        }
      },
      "billing": {
        "name": "Ejemplo Formación S.L.",
        "email": "buyer@example.com",
        "tax_id": "12345678Z",
        "vat_id": null,
        "address": {
          "line1": "Calle Mayor 1",
          "line2": null,
          "city": "Madrid",
          "postal_code": "28001",
          "state": null,
          "country": "ES"
        }
      }
    }
  ],
  "has_more": false,
  "next_starting_after": null
}
POST/api/v1/sales

Record a sale charged elsewhere

Record a sale already charged elsewhere. Does not charge or enroll; use /api/v1/access/sync for access. Does not require enabling the affiliate program and preserves existing private integrations. order_ref identifies the sale: retries return original data without duplicating or changing amounts or attribution. Send UTM, ref and first and last touch to reconcile with your external system. Your system decides commissions and payouts.

Write permission

Body (JSON)

emailstring (email)required

Buyer email, used to find or create their identity in this account.

amount_centsintegerrequired

Amount charged, in cents (€1,997 → 199700).

order_refstring 1..120required

Your system’s order number: the sale’s identity. Resending never duplicates, and the refund is recorded against it.

product_idintegerrequired

The Clonify product card for what was sold (GET /api/v1/products for ids). Selling elsewhere? The external-link card works.

refstring

External reference or affiliate code, up to 60 characters, preserved without truncation. Must match attribution.ref when both are sent.

currencystring ISO-3

EUR only (eur or omitted). Send the actual amount charged; other currencies return 400.

namestring
attributionobject

Object with utm_source, utm_medium, utm_campaign, utm_term, utm_content (up to 200 characters) and ref (up to 60). gclid and fbclid, both optional, are the Google Ads and Meta click ids exactly as they arrived (letters, digits, hyphen and underscore; up to 500); native purchases fill them in with the click that closed the sale. first_touch and last_touch accept these fields plus occurred_at in ISO 8601 with timezone; last touch cannot precede first touch. Caller-supplied data, not verified clicks. All fields are optional or null. Saved when the purchase is created and unchanged on retries. Clonify cookies belong to each host (campaigns up to 90 days, ref up to 60); they are not shared with an external checkout, which must send its own attribution.

bash
curl -X POST "https://www.clonify.com/api/v1/sales" \
  -H "Authorization: Bearer clk_live_…" \
  -H "Content-Type: application/json" \
  -d '{"email":"…","amount_cents":1,"order_ref":"…","product_id":1}'
json
{
  "object": "sale",
  "id": 91,
  "visitor_id": 54,
  "contact_id": 70,
  "order_ref": "PED-1042",
  "product_id": 12,
  "product_title": "Máster Ejecutivo",
  "amount_cents": 199700,
  "already_recorded": false,
  "affiliate": null,
  "attribution": { "utm_source": "newsletter", "ref": "partner-7" }
}
POST/api/v1/sales/refund

Record a refund

Record the cumulative amount already refunded by your gateway for an external sale. Does not move money, delete the sale or change attribution. Existing private affiliate integrations keep their adjustments.

Write permission

Body (JSON)

order_refstring 1..120required

The same order number the sale was recorded with.

refunded_amount_centsintegerrequired

The ACCUMULATED amount refunded for that sale, in cents — not the delta. Sending the same value twice leaves it unchanged, and the accumulated amount CAN ONLY GROW: a recorded refund cannot be undone, so double-check the order_ref before sending. Full refund = the whole amount.

bash
curl -X POST "https://www.clonify.com/api/v1/sales/refund" \
  -H "Authorization: Bearer clk_live_…" \
  -H "Content-Type: application/json" \
  -d '{"order_ref":"…","refunded_amount_cents":1}'
json
{
  "object": "refund",
  "order_ref": "PED-1042",
  "refunded_amount_cents": 199700
}