Skip to content

API reference

Marketing

Run promotions and manage affiliates.

List promotions

GET/api/v1/promotions

The shop’s ad campaigns, running ones first, with budget, spend, impressions, clicks, conversions, and click-through rate (`ctr`, clicks per impression, 0-1).

Scope
marketing:read
MCP tool
promotions_list
Changes data
No

Parameters

NameTypeDescription
statusquery · optionalenumOnly campaigns with this statusone of draft, active, paused, ended
limitquery · optionalintegerResults per page, 1-1001-100default 25
cursorquery · optionalstringThe `next_cursor` from the previous page

Request

curl "https://3commerce.com/api/v1/promotions" \
  -H "Authorization: Bearer 3c_live_…"

Response

200 OK
{
  "data": [
    {
      "id": "5d3a…",
      "channel": "instagram",
      "headline": "Linen season is here",
      "status": "active",
      "budget": 250,
      "spent": 84.2,
      "impressions": 12840,
      "clicks": 412,
      "conversions": 19,
      "ctr": 0.0321,
      "starts_at": "2026-11-18T00:00:00.000Z",
      "ends_at": null,
      "created_at": "2026-11-17T21:40:00.000Z",
      "product": {
        "id": "2a9d…",
        "slug": "linen-overshirt",
        "title": "Linen overshirt"
      }
    }
  ],
  "next_cursor": null
}

Create a promotion

POST/api/v1/promotions

Starts an active ad campaign for 1 of the shop’s published products on 1 channel. Pro plan only: a Free shop gets a 403 `plan_required`.

Scope
marketing:write
MCP tool
promotions_create
Changes data
Yes
Idempotency-Key
Accepted

Parameters

NameTypeDescription
product_idbody · requiredstring (uuid)A published product of this shop
channelbody · requiredenumWhere the campaign runsone of instagram, facebook, x, pinterest, email, storefront
headlinebody · requiredstringThe ad headline, 3-90 characters3-90 chars
budgetbody · requirednumberTotal budget in USD, 1-100001-10000
starts_atbody · requiredstring (date)The start date, YYYY-MM-DD

Request

curl -X POST "https://3commerce.com/api/v1/promotions" \
  -H "Authorization: Bearer 3c_live_…" \
  -H "Content-Type: application/json" \
  -d '{
  "product_id": "6f1c2a4e-8b3d-4c5e-9a7f-1d2e3f4a5b6c",
  "channel": "instagram",
  "headline": "Example headline",
  "budget": 48,
  "starts_at": "2026-12-01"
}'

Response

201 Created
{
  "id": "5d3a…",
  "channel": "instagram",
  "headline": "Linen season is here",
  "status": "active",
  "budget": 250,
  "spent": 84.2,
  "impressions": 12840,
  "clicks": 412,
  "conversions": 19,
  "ctr": 0.0321,
  "starts_at": "2026-11-18T00:00:00.000Z",
  "ends_at": null,
  "created_at": "2026-11-17T21:40:00.000Z",
  "product": {
    "id": "2a9d…",
    "slug": "linen-overshirt",
    "title": "Linen overshirt"
  }
}

Update a promotion

PATCH/api/v1/promotions/{id}

Pauses, resumes, or ends a campaign, or changes its budget or headline. A paused or draft campaign can resume, an active one can pause, and any can end. An ended campaign cannot change (409).

Scope
marketing:write
MCP tool
promotions_update
Changes data
Yes

Parameters

NameTypeDescription
idpath · requiredstring (uuid)The resource id
statusbody · optionalenum`active` resumes, `paused` pauses, `ended` endsone of active, paused, ended
budgetbody · optionalnumberTotal budget in USD, 1-100001-10000
headlinebody · optionalstringThe ad headline, 3-90 characters3-90 chars

Request

curl -X PATCH "https://3commerce.com/api/v1/promotions/6f1c2a4e-8b3d-4c5e-9a7f-1d2e3f4a5b6c" \
  -H "Authorization: Bearer 3c_live_…" \
  -H "Content-Type: application/json" \
  -d '{}'

Response

200 OK
{
  "id": "5d3a…",
  "channel": "instagram",
  "headline": "Linen season is here",
  "status": "paused",
  "budget": 250,
  "spent": 84.2,
  "impressions": 12840,
  "clicks": 412,
  "conversions": 19,
  "ctr": 0.0321,
  "starts_at": "2026-11-18T00:00:00.000Z",
  "ends_at": null,
  "created_at": "2026-11-17T21:40:00.000Z",
  "product": {
    "id": "2a9d…",
    "slug": "linen-overshirt",
    "title": "Linen overshirt"
  }
}

List affiliates

GET/api/v1/affiliates

People who refer shoppers for a cut of each sale, top earners first, with their referral code, `referral_url` to share, commission rate, clicks, conversions, and earnings.

Scope
marketing:read
MCP tool
affiliates_list
Changes data
No

Parameters

NameTypeDescription
statusquery · optionalenumOnly affiliates with this statusone of invited, active, paused
limitquery · optionalintegerResults per page, 1-1001-100default 25
cursorquery · optionalstringThe `next_cursor` from the previous page

Request

curl "https://3commerce.com/api/v1/affiliates" \
  -H "Authorization: Bearer 3c_live_…"

Response

200 OK
{
  "data": [
    {
      "id": "e81f…",
      "name": "Jordan Blake",
      "email": "jordan@example.com",
      "code": "JORDAN42",
      "commission_rate": 0.1,
      "clicks": 318,
      "conversions": 12,
      "earnings": 96.4,
      "status": "active",
      "referral_url": "https://3commerce.com/?ref=JORDAN42",
      "created_at": "2026-10-02T14:20:00.000Z"
    }
  ],
  "next_cursor": null
}

Invite an affiliate

POST/api/v1/affiliates

Adds an affiliate with status `invited` and a unique referral code built from their first name. Pro plan only: a Free shop gets a 403 `plan_required`. An email already in the program is a 409.

Scope
marketing:write
MCP tool
affiliates_invite
Changes data
Yes
Idempotency-Key
Accepted

Parameters

NameTypeDescription
namebody · requiredstringTheir name, 2-80 characters2-80 chars
emailbody · requiredstringTheir email address
commission_ratebody · requirednumberCommission per sale as a rate, 0.05-0.30 in whole percents (0.1 is 10%)0.05-0.3

Request

curl -X POST "https://3commerce.com/api/v1/affiliates" \
  -H "Authorization: Bearer 3c_live_…" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Northline Studio",
  "email": "ada@example.com",
  "commission_rate": 0.3
}'

Response

201 Created
{
  "id": "e81f…",
  "name": "Jordan Blake",
  "email": "jordan@example.com",
  "code": "JORDAN42",
  "commission_rate": 0.1,
  "clicks": 0,
  "conversions": 0,
  "earnings": 0,
  "status": "invited",
  "referral_url": "https://3commerce.com/?ref=JORDAN42",
  "created_at": "2026-10-02T14:20:00.000Z"
}

Update an affiliate

PATCH/api/v1/affiliates/{id}

Pauses an affiliate’s link or turns it on (which also accepts a pending invite for them), or changes their commission rate.

Scope
marketing:write
MCP tool
affiliates_update
Changes data
Yes

Parameters

NameTypeDescription
idpath · requiredstring (uuid)The resource id
statusbody · optionalenum`active` turns the link on, `paused` stops itone of active, paused
commission_ratebody · optionalnumberCommission per sale as a rate, 0.05-0.30 in whole percents (0.1 is 10%)0.05-0.3

Request

curl -X PATCH "https://3commerce.com/api/v1/affiliates/6f1c2a4e-8b3d-4c5e-9a7f-1d2e3f4a5b6c" \
  -H "Authorization: Bearer 3c_live_…" \
  -H "Content-Type: application/json" \
  -d '{}'

Response

200 OK
{
  "id": "e81f…",
  "name": "Jordan Blake",
  "email": "jordan@example.com",
  "code": "JORDAN42",
  "commission_rate": 0.1,
  "clicks": 318,
  "conversions": 12,
  "earnings": 96.4,
  "status": "paused",
  "referral_url": "https://3commerce.com/?ref=JORDAN42",
  "created_at": "2026-10-02T14:20:00.000Z"
}