These docs are for v1.0. Click to read the latest docs for v2.1.

Create a discount campaign

To create vouchers that your customers will be able to redeem we need to create a discount campaign. As previously mentioned, this type of campaign needs to have a parent which will be the main campaign we just created.

While creating a discount campaign a number of important decisions need to be taken. Will the voucher codes be unique or generic? Is the discount given a fixed monetary value or a percentage, and how big is it? Is there a minimum transaction value or a limit to how big the discount can be (in case of percentage discounts). Once all of those questions are answered we can go forward and create a discount campaign.

In our example vouchers will be unique and we will apply a fixed discount with a value of 5.00.

curl --request POST \
     --user "username:password" \
     --url "https://preview.vouchery.io/api/v1.0/campaigns" \
     --header "Content-Type: application/json" \
     --data \ 
'
{
  "parent_id": 1,
  "campaign_type": "discount",
  "name": "Fall Haul",
  "discount_type": "numeric",
  "voucher_type": "unique",
  "discount_value": 5.00
}
'
{
  "id": 3,
  "parent_id": 2,
  "campaign_type": "discount",
  "name": "Fall Haul",
  "voucher_type": "unique",
  "description": null,
  "max_total_budget": null,
  "discount_type": "numeric",
  "max_redemptions": null,
  "minimum_value": null,
  "maximum_value": null,
  "discount_value": "5.0",
  "created_at": "2018-10-16T15:13:36.554Z",
  "updated_at": "2018-10-16T15:13:36.554Z",
  "timeframe_rules": [],
  "time_of_order_rules": [],
  "redemptions_count": 0,
  "total_budget_spent": 0,
  "status": "draft",
}