SmoothProfitDocs
ProductStart free

Getting started

  • Introduction
  • Quickstart
  • Authentication
  • Errors & rate limits

Core concepts

  • Tenancy model
  • Attribution
  • Commission resolution
  • Payout lifecycle

Guides

  • Install the tracker
  • Connect a storefront
  • Affiliate storefronts

API reference

  • Context
  • Affiliates
  • Conversions
  • Landing pages
  • Coupons
  • Payouts
  • Providers
  • Tracking

API reference

Conversions

Report sales and reverse them.

Record a conversion

POST/v1/conversionswrite scope

Attributes a completed order to an affiliate and records the commission. Call this from your checkout once payment is confirmed.

Body parameters

orderIdreqstringYour order id. Used for idempotency.
orderAmountCentsreqintOrder total in cents.
clickIduuidFrom the tracking cookie. Most accurate.
referralCodestringFrom `?ref=`.
couponCodestringAn affiliate's 1-to-1 code.
customerEmailstringEnables self-referral blocking and lifetime attribution.
customerNamestringEnables optional name-match fraud checks.
externalProductIdstringYour product id. Enables per-product commission rules.
metadataobjectStored verbatim.

Response

json
{
  "conversionId": "9d2f...",
  "affiliateId": "c41a...",
  "commissionCents": 5980,
  "status": "pending"
}
  • Attribution priority: `clickId` → `referralCode` → `couponCode` → lifetime email. The first that resolves wins.
  • Idempotent on `orderId` — a retry returns `409`, it does not double-credit.
  • A 2-tier program creates a second conversion for the upline automatically. You do not report it.

Reverse a commission

POST/v1/conversions/clawbackwrite scope

Reverses commission after a refund, cancellation, or dispute. Call this when you refund an order.

Body parameters

orderIdreqstringThe order being reversed.
reasonenum`refund` · `cancellation` · `dispute` · `fraud` · `other`. Defaults to `refund`.
notestringFree text kept on the record.

Response

json
{
  "orderId": "ord_10422",
  "reversedCount": 2,
  "reversedCommissionCents": 7180,
  "alreadyPaidCents": 5980,
  "reason": "refund"
}
  • A tier-2 MLM override is reversed alongside its parent — hence `reversedCount: 2` above.
  • `alreadyPaidCents` is commission that had already been disbursed. Recover it out of band; this endpoint cannot un-pay it.