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

Coupons

1-to-1 affiliate discount codes used for attribution.

List coupons

GET/v1/programs/:programId/couponsread scope

Lists every affiliate coupon code in the program, with its owner and usage count.

Path parameters

programIdrequuidFrom `GET /v1/me`.

Response

json
{
  "coupons": [
    {
      "id": "5c8a...",
      "code": "KRISTIN10",
      "discountType": "percentage",
      "discountValue": 10,
      "isActive": true,
      "usageCount": 42,
      "externalCouponId": "wc_881",
      "affiliate": { "name": "Kristin Richards", "email": "...", "referralCode": "a8f2k1x9" }
    }
  ]
}

Assign a coupon

POST/v1/programs/:programId/couponswrite scope

Maps a coupon code to an affiliate so orders using it are attributed to them.

Path parameters

programIdrequuidFrom `GET /v1/me`.

Body parameters

affiliateIdrequuidMust belong to this program.
codereqstring2–32 chars, `A-Z 0-9 _ -`.
discountType'percentage' | 'flat'Defaults to `percentage`.
discountValuenumberDefaults to 20.
externalCouponIdstringYour store's coupon id, for reconciliation.

Response

json
{
  "id": "5c8a...",
  "code": "KRISTIN10",
  "discountType": "percentage",
  "discountValue": 10,
  "isActive": true,
  "storeSyncRequired": true
}
  • **This does not create the discount in your store.** SmoothProfit records the code→affiliate mapping for attribution; creating the actual coupon is your store's job. Pass `externalCouponId` once you have.