Coupons

Create a coupon

Scope: partners:write (or write)

post/v1/coupons

Request

  • Base URL: https://api.affiliaterail.com
  • URL: https://api.affiliaterail.com/v1/coupons
  • Auth: HTTP bearer

Request body

program_idstring required

Prefixed id (prg_…)

codestring required
partner_idstring

Prefixed id (part_…)

group_idstring

Prefixed id (grp_…)

external_idstring

Example request

{
  "program_id": "prg_7uSyy9FqVLCFWrdPeZaK",
  "partner_id": "part_7uSyy9FqVLCFWrdPeZaK",
  "group_id": "grp_7uSyy9FqVLCFWrdPeZaK"
}

Response

The new coupon

idstring required

Prefixed id (cpn_…)

object'coupon' required
program_idstring required

Prefixed id (prg_…)

partner_idstring nullable required

Prefixed id (part_…)

group_idstring nullable required

Prefixed id (grp_…)

codestring required
external_idstring nullable required

The processor's own promotion id, and the only thing a sale is matched on

created_atstring date-time required

ISO-8601, UTC

updated_atstring date-time required

ISO-8601, UTC

Example response

{
  "id": "cpn_7uSyy9FqVLCFWrdPeZaK",
  "program_id": "prg_7uSyy9FqVLCFWrdPeZaK",
  "partner_id": "part_7uSyy9FqVLCFWrdPeZaK",
  "group_id": "grp_7uSyy9FqVLCFWrdPeZaK",
  "created_at": "2026-08-21T10:15:30.000Z",
  "updated_at": "2026-08-21T10:15:30.000Z"
}

Changes

No recorded changes to this operation across all 1 revision of this API.