Skip to main content
GET
/
v1
/
campaigns
List Campaigns
curl --request GET \
  --url https://{cluster}.voucherify.io/v1/campaigns \
  --header 'Authorization: Bearer <token>' \
  --header 'X-App-Id: <api-key>' \
  --header 'X-App-Token: <api-key>'
{
  "object": "list",
  "data_ref": "campaigns",
  "campaigns": [
    {
      "id": "camp_SibPsDRKQvg3SUtptgPZCNZb",
      "name": "Voucher Metadata",
      "campaign_type": "DISCOUNT_COUPONS",
      "type": "AUTO_UPDATE",
      "voucher": {
        "type": "DISCOUNT_VOUCHER",
        "discount": {
          "type": "PERCENT",
          "amount_limit": 4400,
          "percent_off": 30,
          "effect": "APPLY_TO_ORDER"
        },
        "redemption": {
          "quantity": null
        },
        "code_config": {
          "length": 9,
          "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
          "pattern": "#########",
          "prefix": "Discount-",
          "postfix": "YY"
        },
        "is_referral_code": false,
        "start_date": "2022-09-20T00:00:00.000Z",
        "expiration_date": "2022-09-30T00:00:00.000Z",
        "validity_timeframe": {
          "interval": "P3D",
          "duration": "P1D"
        }
      },
      "auto_join": false,
      "join_once": false,
      "use_voucher_metadata_schema": false,
      "start_date": "2022-09-20T00:00:00.000Z",
      "expiration_date": "2022-09-30T00:00:00.000Z",
      "validity_timeframe": {
        "interval": "P3D",
        "duration": "P1D"
      },
      "validity_day_of_week": [
        1,
        2,
        3,
        4
      ],
      "activity_duration_after_publishing": "P24D",
      "vouchers_count": 1,
      "active": true,
      "metadata": {
        "region": "AMER"
      },
      "created_at": "2022-09-20T09:32:29.530Z",
      "creation_status": "DONE",
      "vouchers_generation_status": "DONE",
      "protected": false,
      "category_id": null,
      "object": "campaign"
    },
    {
      "id": "camp_HgsbCKauXmEoPnnh8aas0ISe",
      "name": "Static Campaign",
      "campaign_type": "DISCOUNT_COUPONS",
      "type": "STATIC",
      "voucher": {
        "type": "DISCOUNT_VOUCHER",
        "discount": {
          "type": "AMOUNT",
          "amount_off": 3000,
          "effect": "APPLY_TO_ORDER"
        },
        "redemption": {
          "quantity": 1
        },
        "code_config": {
          "length": 8,
          "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
          "pattern": "########"
        },
        "is_referral_code": false
      },
      "auto_join": false,
      "join_once": true,
      "use_voucher_metadata_schema": true,
      "vouchers_count": 1,
      "active": true,
      "metadata": {},
      "created_at": "2022-09-20T07:52:34.499Z",
      "updated_at": "2022-09-20T11:38:13.501Z",
      "creation_status": "DONE",
      "vouchers_generation_status": "DONE",
      "protected": false,
      "category_id": null,
      "object": "campaign"
    },
    {
      "id": "camp_f7fBbQxUuTN7dI7tGOo5XMDA",
      "name": "Loyalty Program Fall 2022",
      "campaign_type": "LOYALTY_PROGRAM",
      "type": "AUTO_UPDATE",
      "voucher": {
        "type": "LOYALTY_CARD",
        "loyalty_card": {
          "points": 0,
          "expiration_rules": {
            "period_type": "MONTH",
            "period_value": 7,
            "rounding_type": "END_OF_YEAR"
          }
        },
        "redemption": {
          "quantity": null
        },
        "code_config": {
          "length": 8,
          "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
          "pattern": "########",
          "prefix": "LOYALTY-CARD-"
        },
        "is_referral_code": false
      },
      "auto_join": true,
      "join_once": true,
      "use_voucher_metadata_schema": true,
      "vouchers_count": 1,
      "active": true,
      "metadata": {},
      "created_at": "2022-09-19T07:56:22.103Z",
      "creation_status": "DONE",
      "vouchers_generation_status": "DONE",
      "protected": false,
      "category_id": "cat_0bb343dee3cdb5ec0c",
      "object": "campaign"
    },
    {
      "id": "camp_4tHsQEDUOER6PeW8SoMdnHH6",
      "name": "Dynamic Discounts",
      "campaign_type": "DISCOUNT_COUPONS",
      "type": "AUTO_UPDATE",
      "voucher": {
        "type": "DISCOUNT_VOUCHER",
        "discount": {
          "type": "PERCENT",
          "percent_off": 5,
          "percent_off_formula": "IF(ORDER_AMOUNT > 300;15;5)",
          "effect": "APPLY_TO_ORDER"
        },
        "redemption": {
          "quantity": null
        },
        "code_config": {
          "length": 8,
          "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
          "pattern": "########",
          "prefix": "DYNAMIC-"
        },
        "is_referral_code": false
      },
      "auto_join": false,
      "join_once": false,
      "use_voucher_metadata_schema": true,
      "vouchers_count": 1,
      "active": true,
      "metadata": {
        "marketing_text": "Purchases above $300 are eligible for a 15% discount."
      },
      "created_at": "2022-07-12T15:12:02.575Z",
      "updated_at": "2022-07-20T10:48:05.617Z",
      "category": "test",
      "creation_status": "DONE",
      "vouchers_generation_status": "DONE",
      "protected": false,
      "category_id": "cat_0b688929a2476386a8",
      "object": "campaign"
    },
    {
      "id": "camp_JlsseNSDO7l4neFtev6p6945",
      "name": "$20 OFF Entire Order",
      "campaign_type": "DISCOUNT_COUPONS",
      "type": "AUTO_UPDATE",
      "voucher": {
        "type": "DISCOUNT_VOUCHER",
        "discount": {
          "type": "AMOUNT",
          "amount_off": 2000,
          "effect": "APPLY_TO_ORDER"
        },
        "redemption": {
          "quantity": null
        },
        "code_config": {
          "length": 8,
          "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
          "pattern": "########",
          "prefix": "$20OFFORDER-"
        },
        "is_referral_code": false
      },
      "auto_join": false,
      "join_once": false,
      "use_voucher_metadata_schema": true,
      "vouchers_count": 1,
      "active": true,
      "metadata": {},
      "created_at": "2022-07-11T09:43:36.057Z",
      "creation_status": "DONE",
      "vouchers_generation_status": "DONE",
      "protected": false,
      "category_id": null,
      "object": "campaign"
    },
    {
      "id": "camp_Uj3cNbWSgt7Zl4AyHM7Sa5Qk",
      "name": "3% OFF Entire Order",
      "campaign_type": "DISCOUNT_COUPONS",
      "type": "AUTO_UPDATE",
      "voucher": {
        "type": "DISCOUNT_VOUCHER",
        "discount": {
          "type": "PERCENT",
          "percent_off": 3,
          "effect": "APPLY_TO_ORDER"
        },
        "redemption": {
          "quantity": null
        },
        "code_config": {
          "length": 8,
          "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
          "pattern": "########",
          "prefix": "3%OFFORDER-"
        },
        "is_referral_code": false
      },
      "auto_join": false,
      "join_once": false,
      "use_voucher_metadata_schema": true,
      "vouchers_count": 1,
      "active": true,
      "metadata": {},
      "created_at": "2022-07-11T09:41:12.087Z",
      "creation_status": "DONE",
      "vouchers_generation_status": "DONE",
      "protected": false,
      "category_id": null,
      "object": "campaign"
    }
  ],
  "total": 6
}

Authorizations

X-App-Id
string
header
required
X-App-Token
string
header
required
Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Query Parameters

limit
integer

Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items.

Required range: 1 <= x <= 100
page
integer

Which page of results to return. The lowest value is 1.

Required range: 1 <= x <= 100
campaign_type
enum<string>

This attribute allows filtering by campaign type.

Available options:
PROMOTION,
GIFT_VOUCHERS,
REFERRAL_PROGRAM,
DISCOUNT_COUPONS,
LOYALTY_PROGRAM
expand
enum<string>

Includes an expanded categories object in the response. If the Areas and Stores Enterprise feature is enabled, add access_settings_assignments to return assigned areas and stores.

Available options:
category,
access_settings_assignments
campaign_status
enum<string>

Sorts the results by the status of the campaign.

Available options:
DONE,
IN_PROGRESS,
FAILED,
DRAFT,
MODIFYING
is_referral_code
boolean

Sorts the results that are or are not referral campaigns.

order
enum<string>

Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order.

Available options:
created_at,
-created_at,
updated_at,
-updated_at
filters
object

Filters the results by various campaign properties.

access_settings
object

Filter by areas and stores IDs to return campaigns that are assigned to areas, stores, and all stores in an area.

Response

200 - application/json

Returns a dictionary with a campaign property that contains an array of campaigns. The maximum number of campaigns returned is determined by the limit query parameter. Each entry in the array is a separate campaign object. If no more campaigns are available, the resulting array on a given page will be empty.

Schema model for GET v1/campaigns.

object
string
default:list

The type of the object represented by JSON. This object stores information about campaigns in a dictionary.

data_ref
string
default:campaigns

Identifies the name of the attribute that contains the array of campaign objects.

campaigns
Campaign Base · object[]

Contains array of campaign objects.

total
integer

Total number of campaigns.

I