LogoLogo
REST APIWebhooksHelp Center →
  • Introduction
  • JavaScript API
    • Overview
  • REST API
    • Overview
    • Campaigns
      • The campaign object
      • List campaigns
      • Create campaign
      • Retrieve campaign
      • Update campaign
    • Affiliates
      • The affiliate object
      • List affiliates
      • Create affiliate
      • Retrieve affiliate
      • Update affiliate
      • Magic Link (SSO)
    • Affiliate Links
      • The affiliate link object
      • List affiliate links
      • Create affiliate link
      • Retrieve affiliate link
      • Update affiliate link
    • Affiliate Coupons
      • The affiliate coupon object
      • List affiliate coupons
      • Create affiliate coupon
      • Retrieve affiliate coupon
    • Referrals
      • The referral object
      • List referrals
    • Commissions
      • The commission object
      • List commissions
      • Retrieve commission
      • Update commission
      • Delete commission
    • Payouts
      • The payout object
      • List payouts
      • Retrieve a payout
      • Mark a payout as paid
  • Webhooks
    • Overview
    • Endpoints
    • Requests
    • Event types
    • Signed webhooks
  • Links
    • Help Center
    • Sign up
    • Login
    • Learn more about Rewardful
Powered by GitBook
On this page
  • Request
  • Parameters
  • Example
  • Response

Was this helpful?

Export as PDF
  1. REST API
  2. Affiliate Coupons

Create affiliate coupon

Creates a new affiliate coupon in your account with the specified parameters.

Affiliate coupons can only be created for affiliates belonging to campaigns that have a campaign coupon associated with them. This must be done via the Rewardful dashboard.

Request

Method
URL

POST

https://api.getrewardful.com/v1/affiliate_coupons

Parameters

Parameter
Required
Description

affiliate_id

yes

The ID of the affiliate this coupon will be created for

token

yes

The actual alphanumeric coupon or promo code. It must be identical to one defined in Stripe, otherwise sales won't be tracked in Rewardful.

Example

curl --request POST \
  --url https://api.getrewardful.com/v1/affiliate_coupons \
  -u YOUR_API_SECRET: \
  -d affiliate_id=f46a912b-08bc-4332-8771-c857e11ad9dd \
  -d token=MYCODE

Response

Response code
Body

200

Invalid parameters

Response code
body

422

JSON object describing validation errors.

{
  "error": "Could not create affiliate coupon.",
  "details": ["Token can't be blank. "]
}

Authentication failure

Response code
Body

401

JSON object describing authentication error.

{  "error": "Invalid API Secret." }

PreviousList affiliate couponsNextRetrieve affiliate coupon

Last updated 9 months ago

Was this helpful?

The created (JSON)

affiliate coupon object