Creating Custom Coupon Rewards via API

With API-powered coupon rewards, SiteVibes will request a coupon code from your system when a customer redeems a reward. This ensures coupon codes are generated in real time and remain unique. This is especially useful for rewards that are not directly connected to your ecommerce platform, such as external systems, in-store offers, or custom fulfillment workflows.

Step 1: Configure the Reward

When creating a reward:

  • Set Reward Type to Custom Coupon
  • Set Source to API Coupon

Step 2: Configure API Settings

Fill out the following fields:

  • API Endpoint
    Enter the endpoint URL that will generate the coupon
    Example:
    http://example.com/coupon-manager/test-coupon-1
  • Request Headers
    Add any required headers (for example, authentication tokens)

Step 3: API Requirements

Your endpoint must meet the following requirements:

  • Accept POST requests
  • Accept a JSON request body containing the customer’s email address
  • Return a valid JSON response
  • Return a successful HTTP status code (200–299)

Step 4: How the API Request Works

When a customer redeems the reward:

  • A POST request is sent to your API endpoint
  • The request includes the customer’s email in the JSON body:
{
  "email": "john.smith@email.com"
}

Step 5: Expected API Response

Your API must return:

  • A successful HTTP status code (200–299)
  • A JSON response containing a coupon_code field

Example response:

{
  "coupon_code": "COUPON-1001"
}

Important Requirements

  • The coupon_code field is required
  • Coupon codes must be unique
  • If:
    • The response status is not successful, or
    • The coupon_code field is missing, or
    • The coupon code already exists

👉 The reward will not be created

Optional: Rewards Without Coupon Codes

If your reward does not require a coupon code:

  • Enable Reward without coupon code
  • Your API must still return the coupon_code field, but it can be empty

Example:

{
  "coupon_code": ""
}

In this case, the value will be ignored.

Was this article helpful?
0 out of 0 found this helpful