Vouchery API supports three types of campaigns. Main campaigns are used to group other campaign types. Discount campaigns need to belong to a main campaign and can in turn include vouchers as well as a broad selection of rules and limitations. Lastly, standalone campaigns can be used for one-off vouchers, for example created by customer support, and will not be covered in this walkthrough.
The only required property for a main campaign is it's name.
curl --request POST \
--user "username:password" \
--url "https://preview.vouchery.io/api/v1.0/campaigns" \
--header "Content-Type: application/json" \
--data \
'
{
"campaign_type": "main",
"name": "Fall Clearance Sale"
}
'
{
"id": 2,
"parent_id": null,
"campaign_type": "main",
"name": "Fall Clearance Sale",
"created_at": "2018-10-16T14:57:49.123Z",
"updated_at": "2018-10-16T14:57:49.123Z",
}