{
  "openapi": "3.0.1",
  "info": {
    "title": "Voucherify API - Campaigns",
    "version": "v2018-08-01",
    "description": "Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details.",
    "contact": {
      "name": "Voucherify Team",
      "url": "https://www.voucherify.io/contact-support",
      "email": "support@voucherify.io"
    },
    "termsOfService": "https://www.voucherify.io/legal/subscription-agreement",
    "license": {
      "name": "MIT",
      "url": "https://github.com/voucherifyio/voucherify-js-sdk/blob/main/LICENSE"
    }
  },
  "servers": [
    {
      "url": "https://{cluster}.voucherify.io",
      "description": "Base URL",
      "variables": {
        "cluster": {
          "default": "api",
          "enum": [
            "api",
            "us1.api",
            "as1.api",
            "download",
            "us1.download",
            "as1.download"
          ]
        }
      }
    }
  ],
  "paths": {
    "/v1/campaigns": {
      "post": {
        "operationId": "create-campaign",
        "tags": [
          "Campaigns"
        ],
        "summary": "Create Campaign",
        "description": "Method to create a batch of vouchers aggregated in one campaign. You can choose a variety of voucher types and define a unique pattern for generating codes.  \n\n\n<Note>\n\n<Badge color=\"blue\">Global uniqueness</Badge>\n\nAll campaign codes are unique across the whole project. Voucherify will not allow you to generate 2 campaigns with the same coupon code.\n\n</Note>\n\n<Warning>\n\n<Badge color=\"yellow\">Code generation status</Badge>\n\nThis is an asynchronous action; you can't read or modify a newly created campaign until the code generation is completed. See the `creation_status` field in the [campaign object](/api-reference/campaigns/campaign-object) description.\n\n</Warning>",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "campaigns"
            ]
          }
        ],
        "requestBody": {
          "description": "Specify the details of the campaign that you would like to create.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignsCreateRequestBody"
              },
              "examples": {
                "Discount Campaign": {
                  "value": {
                    "name": "Discount Campaign 4",
                    "campaign_type": "DISCOUNT_COUPONS",
                    "join_once": true,
                    "type": "AUTO_UPDATE",
                    "start_date": "2020-08-16T00:00:00Z",
                    "expiration_date": "2023-12-26T00:00:00Z",
                    "vouchers_count": 3,
                    "voucher": {
                      "type": "DISCOUNT_VOUCHER",
                      "discount": {
                        "percent_off": 10,
                        "type": "PERCENT"
                      },
                      "redemption": {
                        "quantity": 10
                      },
                      "code_config": {
                        "pattern": "10OFF-#######"
                      }
                    },
                    "validity_timeframe": {
                      "interval": "P2D",
                      "duration": "P1D"
                    },
                    "validity_day_of_week": [
                      0,
                      1,
                      2
                    ],
                    "activity_duration_after_publishing": "P24D",
                    "use_voucher_metadata_schema": false,
                    "metadata": {
                      "region": "AMER"
                    }
                  }
                },
                "Gift Card Campaign": {
                  "value": {
                    "name": "Gift Card Campaign",
                    "campaign_type": "GIFT_VOUCHERS",
                    "join_once": true,
                    "type": "AUTO_UPDATE",
                    "start_date": "2020-08-16T00:00:00Z",
                    "expiration_date": "2023-12-26T00:00:00Z",
                    "vouchers_count": 2,
                    "voucher": {
                      "type": "GIFT_VOUCHER",
                      "gift": {
                        "amount": 1000,
                        "effect": "APPLY_TO_ORDER"
                      },
                      "redemption": {
                        "quantity": 10
                      },
                      "code_config": {
                        "pattern": "GIFT-CARD-#######"
                      }
                    },
                    "validity_timeframe": {
                      "interval": "P2D",
                      "duration": "P1D"
                    },
                    "validity_day_of_week": [
                      0,
                      1,
                      2
                    ],
                    "activity_duration_after_publishing": "P24D",
                    "use_voucher_metadata_schema": false,
                    "metadata": {
                      "region": "APAC"
                    }
                  }
                },
                "Loyalty Program": {
                  "value": {
                    "name": "Loyalty Campaign",
                    "campaign_type": "LOYALTY_PROGRAM",
                    "auto_join": true,
                    "join_once": true,
                    "type": "AUTO_UPDATE",
                    "start_date": "2020-08-16T00:00:00Z",
                    "expiration_date": "2023-12-26T00:00:00Z",
                    "vouchers_count": 2,
                    "voucher": {
                      "type": "LOYALTY_CARD",
                      "loyalty_card": {
                        "points": 1000,
                        "expiration_rules": {
                          "period_type": "MONTH",
                          "period_value": 3,
                          "rounding_type": "END_OF_YEAR"
                        }
                      },
                      "redemption": {
                        "quantity": 10
                      },
                      "code_config": {
                        "pattern": "LOYALTY-CARD-#######"
                      }
                    },
                    "validity_timeframe": {
                      "interval": "P2D",
                      "duration": "P1D"
                    },
                    "validity_day_of_week": [
                      0,
                      1,
                      2
                    ],
                    "activity_duration_after_publishing": "P24D",
                    "use_voucher_metadata_schema": false,
                    "metadata": {
                      "region": "APAC"
                    }
                  }
                },
                "Promotion": {
                  "value": {
                    "name": "Promotion - API - 4",
                    "campaign_type": "PROMOTION",
                    "type": "STATIC",
                    "use_voucher_metadata_schema": false,
                    "start_date": "2020-08-16T00:00:00Z",
                    "expiration_date": "2023-12-26T00:00:00Z",
                    "active": false,
                    "promotion": {
                      "tiers": [
                        {
                          "name": "Percent Discount",
                          "banner": "Get 40% off",
                          "action": {
                            "discount": {
                              "type": "PERCENT",
                              "percent_off": 40,
                              "effect": "APPLY_TO_ORDER"
                            }
                          },
                          "metadata": {
                            "level": "B"
                          },
                          "active": false,
                          "start_date": "2022-09-21T00:00:00.000Z",
                          "expiration_date": "2022-09-30T00:00:00.000Z",
                          "validity_timeframe": {
                            "interval": "P2D",
                            "duration": "P1D"
                          },
                          "validity_day_of_week": [
                            1,
                            2,
                            3,
                            4
                          ],
                          "validation_rules": [
                            "val_q8qUBMOh5qIQ"
                          ]
                        },
                        {
                          "name": "Order more than $100",
                          "banner": "Get $30 off",
                          "action": {
                            "discount": {
                              "type": "AMOUNT",
                              "amount_off": 3000,
                              "effect": "APPLY_TO_ORDER"
                            }
                          },
                          "metadata": {
                            "level": "A"
                          },
                          "active": false,
                          "start_date": "2022-09-21T00:00:00.000Z",
                          "expiration_date": "2022-09-30T00:00:00.000Z",
                          "validity_timeframe": {
                            "interval": "P2D",
                            "duration": "P1D"
                          },
                          "validity_day_of_week": [
                            1,
                            2,
                            3,
                            4
                          ],
                          "validation_rules": [
                            "val_q8qUBMOh5qIQ"
                          ]
                        }
                      ]
                    },
                    "validity_timeframe": {
                      "interval": "P2D",
                      "duration": "P1D"
                    },
                    "validity_day_of_week": [
                      0,
                      1,
                      2
                    ],
                    "activity_duration_after_publishing": "P24D",
                    "metadata": {
                      "region": "APAC"
                    }
                  }
                },
                "Referral Program": {
                  "value": {
                    "name": "Referral Campaign 2",
                    "campaign_type": "REFERRAL_PROGRAM",
                    "join_once": true,
                    "type": "AUTO_UPDATE",
                    "start_date": "2020-08-16T00:00:00Z",
                    "expiration_date": "2023-12-26T00:00:00Z",
                    "vouchers_count": 2,
                    "referral_program": {
                      "conversion_event_type": "redemption"
                    },
                    "voucher": {
                      "type": "DISCOUNT_VOUCHER",
                      "discount": {
                        "type": "PERCENT",
                        "percent_off": 45,
                        "effect": "APPLY_TO_ORDER",
                        "amount_limit": 15
                      },
                      "redemption": {
                        "quantity": 10
                      },
                      "code_config": {
                        "pattern": "REFERRAL-CODE-#######"
                      },
                      "is_referral_code": true
                    },
                    "validity_timeframe": {
                      "interval": "P2D",
                      "duration": "P1D"
                    },
                    "validity_day_of_week": [
                      0,
                      1,
                      2
                    ],
                    "activity_duration_after_publishing": "P24D",
                    "use_voucher_metadata_schema": false,
                    "metadata": {
                      "region": "APAC"
                    }
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Returns a campaign object if the call succeeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignsCreateResponseBody"
                },
                "examples": {
                  "Discount Campaign": {
                    "value": {
                      "id": "camp_NdBCAQk1AAZcMcv6kt6X164Q",
                      "name": "Discount Campaign 4",
                      "campaign_type": "DISCOUNT_COUPONS",
                      "type": "AUTO_UPDATE",
                      "voucher": {
                        "type": "DISCOUNT_VOUCHER",
                        "discount": {
                          "type": "PERCENT",
                          "percent_off": 10
                        },
                        "redemption": {
                          "quantity": 10
                        },
                        "code_config": {
                          "length": 7,
                          "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
                          "pattern": "10OFF-#######"
                        },
                        "is_referral_code": false,
                        "start_date": "2020-08-16T00:00:00.000Z",
                        "expiration_date": "2023-12-26T00:00:00.000Z",
                        "validity_timeframe": {
                          "interval": "P2D",
                          "duration": "P1D"
                        }
                      },
                      "auto_join": false,
                      "join_once": true,
                      "use_voucher_metadata_schema": false,
                      "start_date": "2020-08-16T00:00:00.000Z",
                      "expiration_date": "2023-12-26T00:00:00.000Z",
                      "validity_timeframe": {
                        "interval": "P2D",
                        "duration": "P1D"
                      },
                      "validity_day_of_week": [
                        0,
                        1,
                        2
                      ],
                      "activity_duration_after_publishing": "P24D",
                      "vouchers_count": 0,
                      "active": true,
                      "metadata": {
                        "region": "AMER"
                      },
                      "created_at": "2022-09-21T09:25:49.617Z",
                      "category": "First",
                      "creation_status": "IN_PROGRESS",
                      "vouchers_generation_status": "IN_PROGRESS",
                      "protected": false,
                      "validation_rules_assignments": {
                        "object": "list",
                        "data_ref": "data",
                        "data": [],
                        "total": 0
                      },
                      "category_id": "cat_0bb343dee3cdb5ec0c",
                      "categories": [
                        {
                          "id": "cat_0bb343dee3cdb5ec0c",
                          "name": "First",
                          "hierarchy": 1,
                          "created_at": "2022-09-16T11:47:19.568Z",
                          "object": "category"
                        }
                      ],
                      "object": "campaign"
                    }
                  },
                  "Gift Card Campaign": {
                    "value": {
                      "id": "camp_B2Gx83JsSbmvj05MOwxYbNm6",
                      "name": "Gift Card Campaign",
                      "campaign_type": "GIFT_VOUCHERS",
                      "type": "AUTO_UPDATE",
                      "voucher": {
                        "type": "GIFT_VOUCHER",
                        "gift": {
                          "amount": 1000,
                          "effect": "APPLY_TO_ORDER"
                        },
                        "redemption": {
                          "quantity": 10
                        },
                        "code_config": {
                          "length": 7,
                          "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
                          "pattern": "GIFT-CARD-#######"
                        },
                        "is_referral_code": false,
                        "start_date": "2020-08-16T00:00:00.000Z",
                        "expiration_date": "2023-12-26T00:00:00.000Z",
                        "validity_timeframe": {
                          "interval": "P2D",
                          "duration": "P1D"
                        }
                      },
                      "auto_join": false,
                      "join_once": true,
                      "use_voucher_metadata_schema": false,
                      "start_date": "2020-08-16T00:00:00.000Z",
                      "expiration_date": "2023-12-26T00:00:00.000Z",
                      "validity_timeframe": {
                        "interval": "P2D",
                        "duration": "P1D"
                      },
                      "validity_day_of_week": [
                        0,
                        1,
                        2
                      ],
                      "activity_duration_after_publishing": "P24D",
                      "vouchers_count": 0,
                      "active": true,
                      "metadata": {
                        "region": "APAC"
                      },
                      "created_at": "2022-09-21T09:31:16.266Z",
                      "category": "First",
                      "creation_status": "IN_PROGRESS",
                      "vouchers_generation_status": "IN_PROGRESS",
                      "protected": false,
                      "validation_rules_assignments": {
                        "object": "list",
                        "data_ref": "data",
                        "data": [],
                        "total": 0
                      },
                      "category_id": "cat_0bb343dee3cdb5ec0c",
                      "categories": [
                        {
                          "id": "cat_0bb343dee3cdb5ec0c",
                          "name": "First",
                          "hierarchy": 1,
                          "created_at": "2022-09-16T11:47:19.568Z",
                          "object": "category"
                        }
                      ],
                      "object": "campaign"
                    }
                  },
                  "Loyalty Program": {
                    "value": {
                      "id": "camp_FZL4iTTdZw36nZOoXYQ172fQ",
                      "name": "Loyalty Campaign",
                      "campaign_type": "LOYALTY_PROGRAM",
                      "type": "AUTO_UPDATE",
                      "voucher": {
                        "type": "LOYALTY_CARD",
                        "loyalty_card": {
                          "points": 1000,
                          "expiration_rules": {
                            "period_type": "MONTH",
                            "period_value": 3,
                            "rounding_type": "END_OF_YEAR"
                          }
                        },
                        "redemption": {
                          "quantity": 10
                        },
                        "code_config": {
                          "length": 7,
                          "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
                          "pattern": "LOYALTY-CARD-#######"
                        },
                        "is_referral_code": false,
                        "start_date": "2020-08-16T00:00:00.000Z",
                        "expiration_date": "2023-12-26T00:00:00.000Z",
                        "validity_timeframe": {
                          "interval": "P2D",
                          "duration": "P1D"
                        }
                      },
                      "auto_join": true,
                      "join_once": true,
                      "use_voucher_metadata_schema": false,
                      "start_date": "2020-08-16T00:00:00.000Z",
                      "expiration_date": "2023-12-26T00:00:00.000Z",
                      "validity_timeframe": {
                        "interval": "P2D",
                        "duration": "P1D"
                      },
                      "validity_day_of_week": [
                        0,
                        1,
                        2
                      ],
                      "activity_duration_after_publishing": "P24D",
                      "vouchers_count": 0,
                      "active": true,
                      "metadata": {
                        "region": "APAC"
                      },
                      "created_at": "2022-09-21T09:39:45.479Z",
                      "category": "First",
                      "creation_status": "IN_PROGRESS",
                      "vouchers_generation_status": "IN_PROGRESS",
                      "protected": false,
                      "validation_rules_assignments": {
                        "object": "list",
                        "data_ref": "data",
                        "data": [],
                        "total": 0
                      },
                      "category_id": "cat_0bb343dee3cdb5ec0c",
                      "categories": [
                        {
                          "id": "cat_0bb343dee3cdb5ec0c",
                          "name": "First",
                          "hierarchy": 1,
                          "created_at": "2022-09-16T11:47:19.568Z",
                          "object": "category"
                        }
                      ],
                      "object": "campaign"
                    }
                  },
                  "Promotion": {
                    "value": {
                      "id": "camp_ru1B8mQjY75KxXupt7RPZcb8",
                      "name": "Promotion - API - 4",
                      "campaign_type": "PROMOTION",
                      "type": "STATIC",
                      "auto_join": false,
                      "join_once": false,
                      "use_voucher_metadata_schema": false,
                      "start_date": "2020-08-16T00:00:00.000Z",
                      "expiration_date": "2023-12-26T00:00:00.000Z",
                      "validity_timeframe": {
                        "interval": "P2D",
                        "duration": "P1D"
                      },
                      "validity_day_of_week": [
                        0,
                        1,
                        2
                      ],
                      "activity_duration_after_publishing": "P24D",
                      "active": true,
                      "metadata": {
                        "region": "APAC"
                      },
                      "created_at": "2022-09-23T08:54:38.281Z",
                      "category": "First",
                      "creation_status": "DONE",
                      "vouchers_generation_status": "DONE",
                      "protected": false,
                      "promotion": {
                        "object": "list",
                        "data_ref": "tiers",
                        "tiers": [
                          {
                            "id": "promo_M4OfmMgSUyN12JPAw3l4hWjD",
                            "created_at": "2022-09-23T08:54:38.286Z",
                            "name": "Percent Discount",
                            "banner": "Get 40% off",
                            "action": {
                              "discount": {
                                "type": "PERCENT",
                                "percent_off": 40,
                                "effect": "APPLY_TO_ORDER"
                              }
                            },
                            "metadata": {
                              "level": "B"
                            },
                            "hierarchy": 1,
                            "promotion_id": "camp_ru1B8mQjY75KxXupt7RPZcb8",
                            "campaign": {
                              "id": "camp_ru1B8mQjY75KxXupt7RPZcb8",
                              "start_date": "2020-08-16T00:00:00.000Z",
                              "expiration_date": "2023-12-26T00:00:00.000Z",
                              "validity_timeframe": {
                                "interval": "P2D",
                                "duration": "P1D"
                              },
                              "validity_day_of_week": [
                                0,
                                1,
                                2
                              ],
                              "active": true,
                              "category_id": "cat_0bb343dee3cdb5ec0c",
                              "object": "campaign"
                            },
                            "campaign_id": "camp_ru1B8mQjY75KxXupt7RPZcb8",
                            "active": false,
                            "start_date": "2022-09-21T00:00:00.000Z",
                            "expiration_date": "2022-09-30T00:00:00.000Z",
                            "validity_timeframe": {
                              "interval": "P2D",
                              "duration": "P1D"
                            },
                            "validity_day_of_week": [
                              1,
                              2,
                              3,
                              4
                            ],
                            "summary": {
                              "redemptions": {
                                "total_redeemed": 0
                              },
                              "orders": {
                                "total_amount": 0,
                                "total_discount_amount": 0
                              }
                            },
                            "object": "promotion_tier",
                            "validation_rule_assignments": {
                              "object": "list",
                              "data_ref": "data",
                              "data": [
                                {
                                  "id": "asgm_dr3oXeN98YfiTF60",
                                  "rule_id": "val_q8qUBMOh5qIQ",
                                  "related_object_id": "promo_M4OfmMgSUyN12JPAw3l4hWjD",
                                  "related_object_type": "promotion_tier",
                                  "created_at": "2022-09-23T08:54:38.286Z",
                                  "object": "validation_rules_assignment"
                                }
                              ],
                              "total": 1
                            }
                          },
                          {
                            "id": "promo_uMSxvzhxXDp3Ijs3659npqb2",
                            "created_at": "2022-09-23T08:54:38.314Z",
                            "name": "Order more than $100",
                            "banner": "Get $30 off",
                            "action": {
                              "discount": {
                                "type": "AMOUNT",
                                "amount_off": 3000,
                                "effect": "APPLY_TO_ORDER"
                              }
                            },
                            "metadata": {
                              "level": "A"
                            },
                            "hierarchy": 2,
                            "promotion_id": "camp_ru1B8mQjY75KxXupt7RPZcb8",
                            "campaign": {
                              "id": "camp_ru1B8mQjY75KxXupt7RPZcb8",
                              "start_date": "2020-08-16T00:00:00.000Z",
                              "expiration_date": "2023-12-26T00:00:00.000Z",
                              "validity_timeframe": {
                                "interval": "P2D",
                                "duration": "P1D"
                              },
                              "validity_day_of_week": [
                                0,
                                1,
                                2
                              ],
                              "active": true,
                              "category_id": "cat_0bb343dee3cdb5ec0c",
                              "object": "campaign"
                            },
                            "campaign_id": "camp_ru1B8mQjY75KxXupt7RPZcb8",
                            "active": false,
                            "start_date": "2022-09-21T00:00:00.000Z",
                            "expiration_date": "2022-09-30T00:00:00.000Z",
                            "validity_timeframe": {
                              "interval": "P2D",
                              "duration": "P1D"
                            },
                            "validity_day_of_week": [
                              1,
                              2,
                              3,
                              4
                            ],
                            "summary": {
                              "redemptions": {
                                "total_redeemed": 0
                              },
                              "orders": {
                                "total_amount": 0,
                                "total_discount_amount": 0
                              }
                            },
                            "object": "promotion_tier",
                            "validation_rule_assignments": {
                              "object": "list",
                              "data_ref": "data",
                              "data": [
                                {
                                  "id": "asgm_jgJlWms7GVK59iNR",
                                  "rule_id": "val_q8qUBMOh5qIQ",
                                  "related_object_id": "promo_uMSxvzhxXDp3Ijs3659npqb2",
                                  "related_object_type": "promotion_tier",
                                  "created_at": "2022-09-23T08:54:38.314Z",
                                  "object": "validation_rules_assignment"
                                }
                              ],
                              "total": 1
                            }
                          }
                        ],
                        "total": 2,
                        "has_more": false
                      },
                      "category_id": "cat_0bb343dee3cdb5ec0c",
                      "categories": [
                        {
                          "id": "cat_0bb343dee3cdb5ec0c",
                          "name": "First",
                          "hierarchy": 1,
                          "created_at": "2022-09-16T11:47:19.568Z",
                          "object": "category"
                        }
                      ],
                      "object": "campaign"
                    }
                  },
                  "Referral Program": {
                    "value": {
                      "id": "camp_N8rztKAqOYIdFxNLr9eNIjyB",
                      "name": "Referral Campaign 2",
                      "campaign_type": "REFERRAL_PROGRAM",
                      "type": "AUTO_UPDATE",
                      "voucher": {
                        "type": "DISCOUNT_VOUCHER",
                        "discount": {
                          "type": "PERCENT",
                          "amount_limit": 15,
                          "percent_off": 45,
                          "effect": "APPLY_TO_ORDER"
                        },
                        "redemption": {
                          "quantity": 10
                        },
                        "code_config": {
                          "length": 7,
                          "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
                          "pattern": "REFERRAL-CODE-#######"
                        },
                        "is_referral_code": true,
                        "start_date": "2020-08-16T00:00:00.000Z",
                        "expiration_date": "2023-12-26T00:00:00.000Z",
                        "validity_timeframe": {
                          "interval": "P2D",
                          "duration": "P1D"
                        }
                      },
                      "referral_program": {
                        "conversion_event_type": "redemption"
                      },
                      "auto_join": false,
                      "join_once": true,
                      "use_voucher_metadata_schema": false,
                      "start_date": "2020-08-16T00:00:00.000Z",
                      "expiration_date": "2023-12-26T00:00:00.000Z",
                      "validity_timeframe": {
                        "interval": "P2D",
                        "duration": "P1D"
                      },
                      "validity_day_of_week": [
                        0,
                        1,
                        2
                      ],
                      "activity_duration_after_publishing": "P24D",
                      "vouchers_count": 0,
                      "active": true,
                      "metadata": {
                        "region": "APAC"
                      },
                      "created_at": "2022-09-23T09:06:41.757Z",
                      "category": "First",
                      "creation_status": "IN_PROGRESS",
                      "vouchers_generation_status": "IN_PROGRESS",
                      "protected": false,
                      "validation_rules_assignments": {
                        "object": "list",
                        "data_ref": "data",
                        "data": [],
                        "total": 0
                      },
                      "category_id": "cat_0bb343dee3cdb5ec0c",
                      "categories": [
                        {
                          "id": "cat_0bb343dee3cdb5ec0c",
                          "name": "First",
                          "hierarchy": 1,
                          "created_at": "2022-09-16T11:47:19.568Z",
                          "object": "category"
                        }
                      ],
                      "object": "campaign"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Returns an error if an incomplete request body is provided.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "code": 400,
                      "key": "invalid_campaign",
                      "message": "Invalid Campaign",
                      "details": "Property 'discount' is required for REFERRAL_PROGRAM campaign",
                      "request_id": "v-0bb99c9213425fa250"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "When a payload value is not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "Not Found": {
                    "value": {
                      "code": 404,
                      "key": "not_found",
                      "message": "Resource not found",
                      "details": "Cannot find category with id cat_0bb343dee3cdb5ec0c",
                      "request_id": "v-0c55671ed1cb0f1a27",
                      "resource_id": "cat_0bb343dee3cdb5ec0c",
                      "resource_type": "category"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Returns an error if a campaign with the same name already exists.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "code": 409,
                      "key": "duplicate_found",
                      "message": "Duplicated resource found",
                      "details": "Duplicated campaign exists with name Discount Campaign",
                      "request_id": "v-0bb98f8c6552250aab",
                      "resource_id": "Discount Campaign",
                      "resource_type": "campaign"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "list-campaigns",
        "tags": [
          "Campaigns"
        ],
        "summary": "List Campaigns",
        "description": "Retrieve a list of campaigns in a project. \n\nThe campaigns are returned sorted by creation date, with the most recent campaigns appearing first.  \n\nWhen you get a list of campaigns, you can optionally specify query parameters to customize the amount of campaigns returned per call using `limit`, which page of campaigns to return using `page`, sort the campaigns using the `order` query parameter and filter the results by the `campaign_type`.\n\nThis method will return an error when trying to return a limit of more than 100 campaigns.",
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/page"
          },
          {
            "$ref": "#/components/parameters/campaign_type"
          },
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterExpandListCampaigns"
            },
            "in": "query",
            "name": "expand",
            "description": "Includes an expanded `categories` object in the response. If the [Areas and Stores](/orchestrate/areas-and-stores) Enterprise feature is enabled, add `access_settings_assignments` to return assigned areas and stores."
          },
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterCampaignStatusListCampaigns"
            },
            "in": "query",
            "name": "campaign_status",
            "description": "Sorts the results by the status of the campaign."
          },
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterIsReferralCodeListCampaigns"
            },
            "in": "query",
            "name": "is_referral_code",
            "description": "Sorts the results that are or are not referral campaigns."
          },
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterOrderListCampaigns"
            },
            "in": "query",
            "name": "order",
            "description": "Sorts the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order."
          },
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterFiltersListCampaigns"
            },
            "in": "query",
            "name": "filters",
            "description": "Filters the results by various campaign properties.",
            "style": "deepObject",
            "explode": true
          },
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterCampaignsAccessSetttings"
            },
            "in": "query",
            "name": "access_settings",
            "description": "Filter by areas and stores IDs to return campaigns that are assigned to areas, stores, and all stores in an area.",
            "style": "deepObject",
            "explode": true
          }
        ],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "campaigns"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "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.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignsListResponseBody"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "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
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/campaigns/{campaignId}": {
      "parameters": [
        {
          "in": "path",
          "name": "campaignId",
          "description": "You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value.",
          "schema": {
            "$ref": "#/components/schemas/ParameterCampaignId"
          },
          "required": true
        }
      ],
      "get": {
        "operationId": "get-campaign",
        "tags": [
          "Campaigns"
        ],
        "summary": "Get Campaign",
        "description": "Retrieves the campaign with the given campaign ID or campaign name.",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "campaigns"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a campaign object if a valid identifier was provided.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignsGetResponseBody"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "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,
                      "validation_rules_assignments": {
                        "object": "list",
                        "data_ref": "data",
                        "data": [],
                        "total": 0
                      },
                      "category_id": null,
                      "object": "campaign"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Returns an error if the restricted user is missing the access to an area or a store to which the campaign with this ID has been assigned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "code": 403,
                      "key": "forbidden",
                      "message": "Forbidden",
                      "details": "Resource campaign with id camp_7u3ZPLSByANMXjBkAs4kT2nS is not accessible in given context",
                      "request_id": "v-0f005192bfce923bb7",
                      "resource_id": "camp_7u3ZPLSByANMXjBkAs4kT2nS",
                      "resource_type": "campaign"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Returns an error when requesting the campaign that has been deleted or cannot be found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "Not Found": {
                    "value": {
                      "code": 404,
                      "key": "not_found",
                      "message": "Resource not found",
                      "details": "Cannot find campaign with id camp_jcErmtGAOmHUAy0oUgkwKnP",
                      "request_id": "v-0bb8694614d58bf2a8",
                      "resource_id": "camp_jcErmtGAOmHUAy0oUgkwKnP",
                      "resource_type": "campaign"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "update-campaign",
        "tags": [
          "Campaigns"
        ],
        "summary": "Update Campaign",
        "description": "Updates the specified campaign by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged. \n\nFields other than the ones listed in the request body won't be modified. Even if provided, they will be silently skipped.   \n\n<Warning>\n\n<Badge color=\"yellow\">Vouchers will be affected</Badge>\n\nThis method will update vouchers aggregated in the campaign. It will affect all vouchers that are not published or redeemed yet.\n\n</Warning>",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "campaigns"
            ]
          }
        ],
        "requestBody": {
          "description": "Specify the campaign parameters to be updated.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignsUpdateRequestBody"
              },
              "examples": {
                "Example": {
                  "value": {
                    "description": "New description"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Returns the campaign object if the update succeeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignsUpdateResponseBody"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "id": "camp_FZL4iTTdZw36nZOoXYQ172fQ",
                      "name": "Loyalty Campaign",
                      "campaign_type": "LOYALTY_PROGRAM",
                      "type": "AUTO_UPDATE",
                      "voucher": {
                        "type": "LOYALTY_CARD",
                        "loyalty_card": {
                          "points": 1000,
                          "expiration_rules": {
                            "period_type": "MONTH",
                            "period_value": 3,
                            "rounding_type": "END_OF_YEAR"
                          }
                        },
                        "redemption": {
                          "quantity": 10
                        },
                        "code_config": {
                          "length": 7,
                          "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
                          "pattern": "LOYALTY-CARD-#######"
                        },
                        "is_referral_code": false,
                        "start_date": "2020-08-16T00:00:00.000Z",
                        "expiration_date": "2023-12-26T00:00:00.000Z",
                        "validity_timeframe": {
                          "interval": "P2D",
                          "duration": "P1D"
                        }
                      },
                      "auto_join": false,
                      "join_once": false,
                      "use_voucher_metadata_schema": false,
                      "description": "New description",
                      "start_date": "2020-08-16T00:00:00.000Z",
                      "expiration_date": "2023-12-26T00:00:00.000Z",
                      "validity_timeframe": {
                        "interval": "P2D",
                        "duration": "P1D"
                      },
                      "validity_day_of_week": [
                        0,
                        1,
                        2
                      ],
                      "activity_duration_after_publishing": "P24D",
                      "vouchers_count": 2,
                      "active": true,
                      "metadata": {
                        "region": "APAC"
                      },
                      "created_at": "2022-09-21T09:39:45.479Z",
                      "updated_at": "2022-09-23T09:47:00.205Z",
                      "category": "First",
                      "creation_status": "MODIFYING",
                      "vouchers_generation_status": "MODIFYING",
                      "protected": false,
                      "validation_rules_assignments": {
                        "object": "list",
                        "data_ref": "data",
                        "data": [],
                        "total": 0
                      },
                      "category_id": "cat_0bb343dee3cdb5ec0c",
                      "categories": [
                        {
                          "id": "cat_0bb343dee3cdb5ec0c",
                          "name": "First",
                          "hierarchy": 1,
                          "created_at": "2022-09-16T11:47:19.568Z",
                          "object": "category"
                        }
                      ],
                      "object": "campaign"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Returns an error if the restricted user does not have the permission to modify the campaign, because the campaign is `readonly` for them.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "code": 400,
                      "key": "resource_protected",
                      "message": "Resource is protected",
                      "details": "Resource campaign with id camp_oazbyS2Y3SxKLCh9yQ3pqFr6 is protected and cannot be modified",
                      "request_id": "v-0f7548b67cc7ed8dff",
                      "resource_id": "camp_oazbyS2Y3SxKLCh9yQ3pqFr6",
                      "resource_type": "campaign"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Returns an error if the restricted user is missing the access to an area or a store to which the campaign with this ID has been assigned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "code": 403,
                      "key": "forbidden",
                      "message": "Forbidden",
                      "details": "Resource campaign with id camp_7u3ZPLSByANMXjBkAs4kT2nS is not accessible in given context",
                      "request_id": "v-0f005192bfce923bb7",
                      "resource_id": "camp_7u3ZPLSByANMXjBkAs4kT2nS",
                      "resource_type": "campaign"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "delete-campaign",
        "tags": [
          "Campaigns"
        ],
        "summary": "Delete Campaign",
        "description": "Deletes a campaign and all related vouchers. This action cannot be undone. Also, this method immediately removes any redemptions on the voucher.\n\nIf the `force` parameter is set to `false` or not set at all, the campaign and all related vouchers will be moved to [the bin](/api-reference/bin/list-bin-entries).\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](/api-reference/async-actions/get-async-action).",
        "parameters": [
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterBoolean"
            },
            "in": "query",
            "description": "If this flag is set to `true`, the campaign and related vouchers will be removed permanently. If it is set to `false` or not set at all, the campaign and related vouchers will be moved to the bin. Going forward, the user will be able to create the next campaign with exactly the same name.",
            "name": "force"
          }
        ],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "campaigns"
            ]
          }
        ],
        "responses": {
          "202": {
            "description": "Returns the ID of the scheduled asynchronous action, informing you that your request has been accepted and the campaign will be deleted from the repository asynchronously. To check the deletion status and result, copy the `async_action_id` from the response and pass it using [Get Async Action](/api-reference/async-actions/get-async-action) endpoint.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignsDeleteResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Returns an error if the restricted user is missing the access to an area or a store to which the campaign with this ID has been assigned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "code": 403,
                      "key": "forbidden",
                      "message": "Forbidden",
                      "details": "Resource campaign with id camp_7u3ZPLSByANMXjBkAs4kT2nS is not accessible in given context",
                      "request_id": "v-0f005192bfce923bb7",
                      "resource_id": "camp_7u3ZPLSByANMXjBkAs4kT2nS",
                      "resource_type": "campaign"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Returns an error indicating that the campaign with given ID was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "Campaign Not Found": {
                    "value": {
                      "code": 404,
                      "key": "not_found",
                      "message": "Resource not found",
                      "details": "Cannot find campaign with id Spring Campaign",
                      "request_id": "v-0adac46be8cdbfd921",
                      "resource_id": "Spring Campaign",
                      "resource_type": "campaign"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/campaigns/{campaignId}/vouchers": {
      "parameters": [
        {
          "schema": {
            "$ref": "#/components/schemas/ParameterCampaignId"
          },
          "name": "campaignId",
          "in": "path",
          "required": true,
          "description": "The campaign ID or name of the campaign to which voucher(s) will be added. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value."
        }
      ],
      "post": {
        "operationId": "add-vouchers-to-campaign",
        "tags": [
          "Campaigns"
        ],
        "summary": "Add Vouchers to Campaign",
        "description": "This method gives the possibility to push new vouchers to an existing campaign. New vouchers will inherit properties from the campaign profile. However, it is possible to overwrite some of them in the request body. If you provide an optional `code_config` parameter with a voucher code configuration, then it will be used to generate new voucher codes. Otherwise, the voucher code configuration from the campaign will be used.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](/api-reference/async-actions/get-async-action).",
        "parameters": [
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterInteger"
            },
            "in": "query",
            "name": "vouchers_count",
            "description": "Number of vouchers that should be added."
          }
        ],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "campaigns"
            ]
          }
        ],
        "requestBody": {
          "description": "Specify the voucher parameters that you would like to overwrite.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignsVouchersCreateInBulkRequestBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Returns a voucher object if the call succeeded for a voucher count of 1.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignsVouchersCreateResponseBody"
                }
              }
            }
          },
          "202": {
            "description": "Returns an `async_action_id` if the request was made to create more than 1 voucher.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignsVouchersCreateInBulkResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/campaigns/{campaignId}/vouchers/{code}": {
      "parameters": [
        {
          "schema": {
            "$ref": "#/components/schemas/ParameterCampaignId"
          },
          "name": "campaignId",
          "in": "path",
          "required": true,
          "description": "The campaign ID or name of the campaign to which voucher will be added. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value."
        },
        {
          "schema": {
            "$ref": "#/components/schemas/ParameterCode"
          },
          "name": "code",
          "in": "path",
          "required": true,
          "description": "A custom **code** that identifies the voucher."
        }
      ],
      "post": {
        "operationId": "add-voucher-with-specific-code-to-campaign",
        "tags": [
          "Campaigns"
        ],
        "summary": "Add Voucher with Specific Code to Campaign",
        "description": "This method gives a possibility to add a new voucher to an existing campaign. The voucher definition will be inherited from the definition kept in the campaign profile. However, you are able to overwrite a few properties inherited from the campaign.",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "campaigns"
            ]
          }
        ],
        "requestBody": {
          "description": "Specify the voucher parameters that you would like to overwrite.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignsVouchersCreateRequestBody"
              },
              "examples": {
                "Example": {
                  "value": {
                    "category_id": "cat_0bb81a481615a37b5e",
                    "start_date": "2022-09-24T00:00:00Z",
                    "expiration_date": "2022-09-25T23:59:59Z",
                    "active": false,
                    "redemption": {
                      "quantity": null
                    },
                    "additional_info": "Voucher added using API",
                    "metadata": {
                      "Season": "Fall"
                    }
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Returns a voucher object if the call succeeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignsVouchersCreateResponseBody"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "id": "v_EJwB9Wy2aOIsDpWhnl2QBY51OqjQ5Ukg",
                      "code": "Code3",
                      "campaign": "Add Voucher to Campaign",
                      "campaign_id": "camp_xxpmFyWO9h9s5cEe7HtmOK5B",
                      "category": null,
                      "category_id": "cat_0bb81a481615a37b5e",
                      "type": "DISCOUNT_VOUCHER",
                      "discount": {
                        "type": "PERCENT",
                        "amount_limit": 2000,
                        "percent_off": 30,
                        "effect": "APPLY_TO_ORDER"
                      },
                      "gift": null,
                      "loyalty_card": null,
                      "start_date": "2022-09-24T00:00:00.000Z",
                      "expiration_date": "2022-09-25T23:59:59.000Z",
                      "validity_timeframe": null,
                      "validity_day_of_week": [
                        1,
                        2,
                        3,
                        4,
                        5
                      ],
                      "active": true,
                      "additional_info": "Voucher added using API",
                      "metadata": {
                        "Season": "Fall"
                      },
                      "assets": {
                        "qr": {
                          "id": "U2FsdGVkX1+p2kdatp7KAUZxgSATC1gRWgsb1Q3RQyClNOBrfUrRKpTjSPSzBuUSZzb45TIpfWRISSiaz1QXGh8z9sVSHIWQsGLO6+1N81zXuY6/pnC7gRBa4edwMaRoCAwzqO9JDw148AGk4XrXLg==",
                          "url": "{{internalVoucherifyURL}}"
                        },
                        "barcode": {
                          "id": "U2FsdGVkX19wrLVWzIOgoVd9an76OxiJWB5/u9yWGoD7cqN6Qd1K9noNyR1YwvHnBrcN5fa5qtY+sOXonn7WsynAWeR289gA0XobsHHE2VWe8BzNZ7h2kH90SsiW+NCQg6Ts8clYWWP5lrGyV/fzoA==",
                          "url": "{{internalVoucherifyURL}}"
                        }
                      },
                      "is_referral_code": false,
                      "created_at": "2022-09-21T07:14:28.217Z",
                      "updated_at": null,
                      "validation_rules_assignments": {
                        "object": "list",
                        "data_ref": "data",
                        "data": [],
                        "total": 0
                      },
                      "redemption": {
                        "quantity": null,
                        "redeemed_quantity": 0,
                        "object": "list",
                        "url": "/v1/vouchers/Code3/redemptions?page=1&limit=10"
                      },
                      "publish": {
                        "object": "list",
                        "count": 0,
                        "url": "/v1/vouchers/Code3/publications?page=1&limit=10"
                      },
                      "object": "voucher"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Returns an error if a voucher with the same code already exists.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "Duplicate": {
                    "value": {
                      "code": 409,
                      "key": "duplicate_found",
                      "message": "Duplicated resource found",
                      "details": "Duplicated voucher exists with id Code1",
                      "request_id": "v-0bb974be99d22504cd",
                      "resource_id": "Code1",
                      "resource_type": "voucher"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/campaigns/{campaignId}/import": {
      "parameters": [
        {
          "schema": {
            "$ref": "#/components/schemas/ParameterCampaignId"
          },
          "name": "campaignId",
          "in": "path",
          "required": true,
          "description": "The ID of an existing campaign to which you're importing the codes. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value."
        }
      ],
      "post": {
        "operationId": "import-vouchers-to-campaign",
        "tags": [
          "Campaigns"
        ],
        "summary": "Import Vouchers to Campaign",
        "description": "Imports vouchers to an **existing** campaign.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](/api-reference/async-actions/get-async-action).",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "campaigns"
            ]
          }
        ],
        "requestBody": {
          "description": "Discount type, expiration date and the remaining attributes will be taken from the [Campaign](/api-reference/campaigns/get-campaign) settings.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignsImportCreateRequestBody"
              },
              "examples": {
                "Example": {
                  "value": [
                    {
                      "code": "CODE7",
                      "category": "First",
                      "redemption": {
                        "quantity": 1
                      },
                      "metadata": {
                        "season": "Fall"
                      },
                      "additional_info": "secret-code1",
                      "active": true
                    },
                    {
                      "code": "CODE8",
                      "category": "Second",
                      "redemption": {
                        "quantity": 18
                      },
                      "metadata": {
                        "season": "Fall"
                      },
                      "additional_info": "secret-code1",
                      "active": true
                    },
                    {
                      "code": "CODE9",
                      "redemption": {
                        "quantity": 4
                      },
                      "metadata": {
                        "season": "Fall"
                      },
                      "additional_info": "secret-code1",
                      "active": true
                    }
                  ]
                },
                "Gift Cards": {
                  "value": [
                    {
                      "code": "CODE13",
                      "category": "First",
                      "redemption": {
                        "quantity": 1
                      },
                      "metadata": {
                        "season": "Fall"
                      },
                      "additional_info": "secret-code1",
                      "gift": {
                        "amount": 500
                      },
                      "active": true
                    },
                    {
                      "code": "CODE14",
                      "category": "Second",
                      "redemption": {
                        "quantity": 18
                      },
                      "metadata": {
                        "season": "Fall"
                      },
                      "additional_info": "secret-code1",
                      "gift": {
                        "amount": 2000
                      },
                      "active": true
                    },
                    {
                      "code": "CODE15",
                      "redemption": {
                        "quantity": 4
                      },
                      "metadata": {
                        "season": "Fall"
                      },
                      "additional_info": "secret-code1",
                      "active": false
                    }
                  ]
                },
                "Loyalty Cards": {
                  "value": [
                    {
                      "code": "CODE10",
                      "category": "First",
                      "redemption": {
                        "quantity": 1
                      },
                      "metadata": {
                        "season": "Fall"
                      },
                      "additional_info": "secret-code1",
                      "loyalty_card": {
                        "points": 300
                      },
                      "active": true
                    },
                    {
                      "code": "CODE11",
                      "category": "Second",
                      "redemption": {
                        "quantity": 18
                      },
                      "metadata": {
                        "season": "Fall"
                      },
                      "additional_info": "secret-code1",
                      "loyalty_card": {
                        "points": 2000
                      },
                      "active": true
                    },
                    {
                      "code": "CODE12",
                      "redemption": {
                        "quantity": 4
                      },
                      "metadata": {
                        "season": "Fall"
                      },
                      "additional_info": "secret-code1",
                      "active": true
                    }
                  ]
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Returns the ID of the scheduled asynchronous action, informing you that your request has been accepted and the vouchers will be imported to the repository asynchronously. To check the status and result, copy the `async_action_id` from the response and pass it using [Get Async Action](/api-reference/async-actions/get-async-action) endpoint.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignsImportCreateResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Returns an error if the request includes incorrect data, e.g. a wrong data type or duplicated codes.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/e_400_invalid_voucher"
                    },
                    {
                      "$ref": "#/components/schemas/e_400_duplicate_key"
                    }
                  ]
                },
                "examples": {
                  "Duplicate Codes": {
                    "value": {
                      "code": 400,
                      "key": "duplicate_key",
                      "message": "Duplicate codes",
                      "details": "2 voucher codes(s) already exist.",
                      "request_id": "v-0adaccaba61502e4b3"
                    }
                  },
                  "Missing Code": {
                    "value": {
                      "code": 400,
                      "key": "invalid_voucher",
                      "message": "Invalid Voucher",
                      "details": "Found 1 voucher(s) without 'code' value",
                      "request_id": "v-0bbc38ce088c8b2f9a"
                    }
                  },
                  "Invalid Payload": {
                    "value": {
                      "code": 400,
                      "key": "invalid_payload",
                      "message": "Invalid payload",
                      "details": "Property .redemption.quantity should be number,null",
                      "request_id": "v-0c545db3808418908f"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/campaigns/{campaignId}/importCSV": {
      "parameters": [
        {
          "schema": {
            "$ref": "#/components/schemas/ParameterCampaignId"
          },
          "name": "campaignId",
          "in": "path",
          "required": true,
          "description": "The campaign ID or name of the campaign being enabled. You can either pass the campaign ID, which was assigned by Voucherify or the name of the campaign as the path parameter value."
        }
      ],
      "post": {
        "operationId": "import-vouchers-to-campaign-using-csv",
        "tags": [
          "Campaigns"
        ],
        "summary": "Import Vouchers to Campaign by CSV",
        "description": "Imports vouchers to an **existing** campaign.  \n\n\nThe CSV file has to include headers in the first line. \n\nCurl Example\n\n```cURL\ncurl -X **POST** \\\n  https://api.voucherify.io/v1/campaigns/TEST-CAMPAIGN/importCSV \\\n  -F file=@/path/to/campaigns.csv \\\n  -H \"X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b\" \\\n  -H \"X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c\"\n```\n\nYou can import values for the following fields: `Code` (**required**), `Category`, `Active`. In a gift cards import, you can also include the current card balance using the `Gift Amount` header and the amount that was redeemed using the `Redeemed Amount` header. In a loyalty cards import, you can also include the current loyalty card score in points using the `Loyalty Points` header. Remaining CSV columns will be mapped to metadata properties. \n\nDiscount type, time limits, and validation rules will be taken from the [campaign object](/api-reference/campaigns/campaign-object) settings. \n\n\n| **Active** | **Code** | **Loyalty Points** | **Gift Amount** | **Redeemed Amount** | **Redeemed Quantity** | **Category** | **Custom_metadata_property** |\n|---|---|---|---|---|---|---|---|\n| Use `true` or `false` to enable or disable the voucher; this flag can be used to turn off the ability to redeem a voucher even though it is within the campaign's start/end validity timeframe. | The unique voucher code. | The number of points to be added to the loyalty card. If you leave this undefined, then the initial number of points will be set according to the campaign settings.<br />Context: `LOYALTY_PROGRAM` | The initial gift card balance.<br />Context: `GIFT_VOUCHERS` | The amount that was redeemed from the available balance on a gift card. | The number of times the voucher has been redeemed. | A custom tag for the voucher to help you filter codes; you can either import the category name or a unique Voucherify-assigned category ID. | Any additional data that you would like to store for the given loyalty card as a Custom attribute. Remember to define the metadata schema in the Dashboard prior to importing codes. |\n|\n\n<Note>\n\n<Badge color=\"blue\">Active</Badge>\n\nThe CSV file is allowed in two versions; either with or without a column titled `Active`. It indicates whether the voucher is enabled after the import event.\n\n</Note>\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](/api-reference/async-actions/get-async-action).",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "campaigns"
            ]
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/CampaignsVouchersImportCSVRequestBody"
              }
            }
          },
          "description": "The file path is stored in the form `file` header.",
          "required": true
        },
        "responses": {
          "200": {
            "description": "Returns the ID of the scheduled asynchronous action, informing you that your request has been accepted and the vouchers will be imported to the repository asynchronously. To check the status and result, copy the `async_action_id` from the response and pass it using [Get Async Action](/api-reference/async-actions/get-async-action) endpoint.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignsImportCsvCreateResponseBody"
                },
                "examples": {
                  "Example": {
                    "$ref": "#/components/examples/res_async_actions"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Returns an error if the campaign cannot be found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "code": 404,
                      "key": "not_found",
                      "message": "Resource not found",
                      "details": "Cannot find campaign with id camp_FZL4iTTdZw36nZOoXYQ172fQ",
                      "request_id": "v-0bc26adad888b6fed1",
                      "resource_id": "camp_FZL4iTTdZw36nZOoXYQ172fQ",
                      "resource_type": "campaign"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/campaigns/qualification": {
      "post": {
        "operationId": "examine-campaign-qualification",
        "deprecated": true,
        "tags": [
          "Campaigns"
        ],
        "summary": "Examine Campaign Qualification",
        "description": "\n<Danger>\n\n<Badge color=\"red\">Deprecated</Badge>\n\nThis endpoint represents the deprecated version of the API responsible for qualification, and we do not recommend using it. The new [Qualifications API](/api-reference/qualifications/check-eligibility) introduces additional features and improvements while maintaining backward compatibility. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint.\n\n</Danger>\n\nThe method can be used for sending a request to display all campaigns qualified to the given customer and context (e.g., order). \n\nThe maximum number of **returned campaigns is 50**.\n\n## What campaign types are included in the response?\n\n- `DISCOUNT_COUPONS`\n- `GIFT_VOUCHERS`\n- `REFERRAL_PROGRAM`\n\n## What's excluded?\n\nA checking logic will be run only among campaigns and will ignore _generic (standalone) vouchers_. For generic (standalone) vouchers, you should run a [dedicated endpoint](/api-reference/vouchers/examine-voucher-qualification) for searching and identifing vouchers. \n\n## Subsequent Steps\n\nAs a recommended subsequent step after selecting a qualified campaign is to publish a voucher code from that campaign. The [API method for publishing](/api-reference/publications/create-publication) will return a unique code which will belong to a given customer.\n\n## Sample use case\n\nAs a sample use case, you can imagine a requirement of displaying coupons (grouped in campaigns) that a customer is eligible to use. The customer should get assigned to the particular voucher from the campaign and then may redeem that particular code when he/she places an order.\n\n[Read](/guides/checking-eligibility) about Qualification API limits before you start.",
        "parameters": [
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterBoolean"
            },
            "in": "query",
            "name": "audienceRulesOnly",
            "description": "This parameter set to true will ask only for verifying vouchers' validation rules only against conditions applied to audiences' attributes (belonging into segment and Customer metadata)"
          },
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterLimitExamineCampaignsQualification"
            },
            "in": "query",
            "name": "limit",
            "description": "The number of campaigns to be qualified. The maximum number is 50."
          },
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterOrderExamineCampaignsQualification"
            },
            "in": "query",
            "name": "order",
            "description": "Sorts the results using one of the filtering options, where the dash `-` means sorting in a descending order."
          }
        ],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "campaigns"
            ]
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/2_req_examine_qualification"
              },
              "examples": {
                "Example": {
                  "value": {
                    "customer": {
                      "source_id": "source-id",
                      "metadata": {
                        "key": "value"
                      }
                    },
                    "order": {
                      "amount": 10000,
                      "items": [
                        {
                          "product_id": "product-id",
                          "quantity": "1",
                          "price": 10000,
                          "related_object": "product",
                          "product": {
                            "metadata": {
                              "key": "value"
                            }
                          }
                        }
                      ]
                    },
                    "metadata": {
                      "key": "value"
                    }
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "This operation returns the list of valid and active campaigns based on the qualification of a given context (e.g., customer profile, redemptions metadata, order).\n\n[Read](/guides/checking-eligibility) about Qualification API limits before you start.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/2_res_examine_qualification"
                }
              }
            }
          }
        }
      }
    },
    "/v1/campaigns/{campaignId}/enable": {
      "parameters": [
        {
          "schema": {
            "$ref": "#/components/schemas/ParameterCampaignId"
          },
          "name": "campaignId",
          "in": "path",
          "required": true,
          "description": "The campaign ID or name of the campaign being enabled. You can either pass the campaign ID, which was assigned by Voucherify or the name of the campaign as the path parameter value."
        }
      ],
      "post": {
        "operationId": "enable-campaign",
        "tags": [
          "Campaigns"
        ],
        "summary": "Enable Campaign",
        "description": "Sets campaign state to **active**. The vouchers in this campaign can be redeemed - only if the redemption occurs after the start date of the campaign and voucher and the voucher and campaign are not expired.",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "campaigns"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Returns an empty json `{}`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignsEnableResponseBody"
                },
                "examples": {
                  "Empty JSON": {
                    "value": {}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Returns an error if the campaign cannot be found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "Not Found": {
                    "value": {
                      "code": 404,
                      "key": "not_found",
                      "message": "Resource not found",
                      "details": "Cannot find campaign with id camp_h8RyP6FV94F3Ev2odP24j5p",
                      "request_id": "v-0adaf4847c9502879b",
                      "resource_id": "camp_h8RyP6FV94F3Ev2odP24j5p",
                      "resource_type": "campaign"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/campaigns/{campaignId}/disable": {
      "parameters": [
        {
          "schema": {
            "$ref": "#/components/schemas/ParameterCampaignId"
          },
          "name": "campaignId",
          "in": "path",
          "required": true,
          "description": "The campaign ID or name of the campaign being disabled. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value."
        }
      ],
      "post": {
        "operationId": "disable-campaign",
        "tags": [
          "Campaigns"
        ],
        "summary": "Disable Campaign",
        "description": "Sets campaign state to **inactive**. The vouchers in this campaign can no longer be redeemed.",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "campaigns"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Returns an empty json `{}`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignsDisableResponseBody"
                },
                "examples": {
                  "Empty JSON": {
                    "value": {}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Returns an error if the campaign cannot be found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "Not Found": {
                    "value": {
                      "code": 404,
                      "key": "not_found",
                      "message": "Resource not found",
                      "details": "Cannot find campaign with id Spring Campaign",
                      "request_id": "v-0adaf3735116bb298b",
                      "resource_id": "Spring Campaign",
                      "resource_type": "campaign"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/campaigns/{campaignId}/transactions": {
      "parameters": [
        {
          "in": "path",
          "name": "campaignId",
          "description": "You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value.",
          "schema": {
            "$ref": "#/components/schemas/ParameterCampaignId"
          },
          "required": true
        }
      ],
      "get": {
        "operationId": "list-campaign-transactions",
        "tags": [
          "Campaigns"
        ],
        "summary": "List Campaign Transactions",
        "description": "Retrieves all transactions for the campaign with the given campaign ID or campaign name. The `id` filter denotes the unique transaction identifier.\n\n<Warning>\n\nThe endpoint works only for gift card and loyalty campaigns.\n\n</Warning>",
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterOrderListTransactions"
            },
            "in": "query",
            "name": "order",
            "description": "Sorts the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order."
          },
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterString"
            },
            "in": "query",
            "name": "starting_after_id",
            "description": "A cursor for pagination. It retrieves the transactions starting after a transaction with the given ID."
          },
          {
            "name": "filters",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/ParametersFiltersListCampaignTransactions"
            },
            "description": "Filters for listing responses.",
            "style": "deepObject",
            "explode": true
          }
        ],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "campaigns"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a dictionary with a `data` property that contains an array of transactions. The maximum number of transactions returned is determined by the `limit` query parameter. Each entry in the array is a separate transaction object. If more results are available, the `has_more` flag has value `true` and the value of the `more_starting_after` property can be used to retrieve another page of results.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignsTransactionsListResponseBody"
                },
                "examples": {
                  "Gift or loyalty campaign": {
                    "value": {
                      "object": "list",
                      "data_ref": "data",
                      "data": [
                        {
                          "id": "vtx_0f9159e2a055e41e16",
                          "source_id": null,
                          "voucher_id": "v_GNSRFoVlW2ny8uTOHhXRGvkwocR9jQ44",
                          "campaign_id": "camp_5Hn0NM3Uf77tC3IV3kX5un36",
                          "source": null,
                          "reason": null,
                          "type": "POINTS_REDEMPTION",
                          "details": {
                            "balance": {
                              "type": "loyalty_card",
                              "total": 283,
                              "object": "balance",
                              "points": -50,
                              "balance": 23,
                              "operation_type": "AUTOMATIC",
                              "related_object": {
                                "id": "v_GNSRFoVlW2ny8uTOHhXRGvkwocR9jQ44",
                                "type": "voucher"
                              }
                            },
                            "redemption": {
                              "id": "r_0f9159e29815e41e08"
                            },
                            "reward": {
                              "id": "rew_GCq9usMjLffVacs0mlyMmDZo",
                              "name": "Material"
                            }
                          },
                          "related_transaction_id": null,
                          "created_at": "2024-10-24T12:19:45.597Z"
                        },
                        {
                          "id": "vtx_0f9159e1a48b219c95",
                          "source_id": null,
                          "voucher_id": "v_GNSRFoVlW2ny8uTOHhXRGvkwocR9jQ44",
                          "campaign_id": "camp_5Hn0NM3Uf77tC3IV3kX5un36",
                          "source": "voucherify-web-ui",
                          "reason": "Apology addition",
                          "type": "POINTS_ADDITION",
                          "details": {
                            "balance": {
                              "type": "loyalty_card",
                              "total": 283,
                              "object": "balance",
                              "points": 50,
                              "balance": 73,
                              "operation_type": "MANUAL",
                              "related_object": {
                                "id": "v_GNSRFoVlW2ny8uTOHhXRGvkwocR9jQ44",
                                "type": "voucher"
                              }
                            }
                          },
                          "related_transaction_id": null,
                          "created_at": "2024-10-24T12:19:44.902Z"
                        }
                      ],
                      "has_more": true,
                      "more_starting_after": "vtx_0f9159e1a48b219c95"
                    }
                  },
                  "Other campaign types - empty data": {
                    "value": {
                      "object": "list",
                      "data_ref": "data",
                      "data": [],
                      "total": 0
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/campaigns/{campaignId}/transactions/export": {
      "parameters": [
        {
          "in": "path",
          "name": "campaignId",
          "description": "You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value.",
          "schema": {
            "$ref": "#/components/schemas/ParameterCampaignId"
          },
          "required": true
        }
      ],
      "post": {
        "operationId": "export-campaign-transactions",
        "tags": [
          "Campaigns"
        ],
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "campaigns"
            ]
          }
        ],
        "summary": "Export Campaign Transactions",
        "description": "Export transactions is an asynchronous process that generates a CSV file with the data about credit movements on all gift cards or point movements on all loyalty cards in a given campaign.\n\nTo export transactions:\n1. In the export request, use parameters to select which fields will be exported, in what order, and which data will be filtered.\n2. Use the returned `id` to track the export status with the [GET Export](/api-reference/exports/get-export) method.\n3. In the GET Export method, when the returned `status` field has the `DONE` value, the export file has been generated.\n4. Use the URL in the `result` property to download the file. You must be logged to your Voucherify account on a given cluster in the browser to be able to download the file.\n\nAn export request will almost always result in a single file being generated by the system. However, when the data volume is large, the system may split the results into multiple files.\n\nAn example export file can look as follows:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| `id` | Unique transaction ID. | `vtx_0cb7811f1c07765800` |\n| `type` | Transaction type. |**Gift cards**:<br />- `CREDITS_REMOVAL`<br />- `CREDITS_ADDITION`<br />- `CREDITS_REFUND`<br />- `CREDITS_REDEMPTION`<br />**Loyalty cards**:<br />- `POINTS_ACCRUAL`<br />- `POINTS_REDEMPTION`<br />- `POINTS_REFUND`<br />- `POINTS_ADDITION`<br />- `POINTS_REMOVAL`<br />- `POINTS_EXPIRATION`<br />- `POINTS_TRANSFER_IN`<br />- `POINTS_TRANSFER_OUT` |\n| `source_id` | Unique transaction source ID. Optional and only in manual operations: `CREDITS_ADDITION`, `CREDITS_REMOVAL`, `POINTS_ADDITION`, `POINTS_REMOVAL`, `POINTS_TRANSFER_OUT`. | 8638 |\n| `reason` | Contains the reason for the transaction if one was included originally. Optional and only in the following manual operations: `CREDITS_ADDITION`, `CREDITS_REMOVAL`, `POINTS_ADDITION`, `POINTS_REMOVAL`, `POINTS_TRANSFER_OUT`, `POINTS_TRANSFER_IN`. | `Apology for sending a broken item` |\n| `balance` | The gift card or loyalty card balance after the transaction. |  |\n| `amount` | The amount of gift card or loyalty card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. |  |\n| `created_at` | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | `2024-10-09T09:16:32.521Z`  |\n| `voucher_id` | Unique voucher ID. | `v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp` |\n| `source`|  Channel through which the transaction was initiated. | `API` |\n| `details` | More detailed information stored in the form of JSON. | Provides more details related to the transaction in the form of an object. |\n| `related_transaction_id` | Unique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card. | `vtx_0c9afe802593b34b80` |\n\n<Tip>\n\n<Badge color=\"green\">Export Loyalty Campaign Transactions</Badge>\n\nFor loyalty campaigns, this method works in the same way the [POST Export Loyalty Campaign Transactions](/api-reference/loyalties/export-loyalty-campaign-transactions) does.\n\n</Tip>",
        "requestBody": {
          "description": "Specify the parameters for the transaction export.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignsTransactionsExportCreateRequestBody"
              },
              "examples": {
                "Example": {
                  "value": {
                    "order": "-created_at",
                    "parameters": {
                      "fields": [
                        "id",
                        "type",
                        "source_id",
                        "created_at"
                      ],
                      "filters": {
                        "created_at": {
                          "conditions": {
                            "$after": [
                              "2024-10-01T00:00:00.000Z"
                            ]
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "An object representing an export.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignsTransactionsExportCreateResponseBody"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "id": "exp_KBunyG5vwkuF3jSWD03kmnLx",
                      "object": "export",
                      "created_at": "2024-10-25T14:35:12.019Z",
                      "status": "SCHEDULED",
                      "channel": "API",
                      "exported_object": "voucher_transactions",
                      "parameters": {
                        "fields": [
                          "id",
                          "type",
                          "source_id",
                          "created_at"
                        ],
                        "filters": {
                          "junction": "AND",
                          "created_at": {
                            "conditions": {
                              "$after": [
                                "2024-10-01T00:00:00.000Z"
                              ]
                            }
                          },
                          "campaign_id": {
                            "conditions": {
                              "$in": [
                                "camp_5pgKwSKsAeQtFkRz6mfKpxxD"
                              ]
                            }
                          }
                        }
                      },
                      "result": null,
                      "user_id": null
                    }
                  },
                  "No request body": {
                    "value": {
                      "id": "exp_FE04bvkl4J5GQCb99Q5o7Gxa",
                      "object": "export",
                      "created_at": "2024-10-25T15:15:11.698Z",
                      "status": "SCHEDULED",
                      "channel": "API",
                      "exported_object": "voucher_transactions",
                      "parameters": {
                        "filters": {
                          "campaign_id": {
                            "conditions": {
                              "$in": [
                                "camp_5pgKwSKsAeQtFkRz6mfKpxxD"
                              ]
                            }
                          }
                        }
                      },
                      "result": null,
                      "user_id": null
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Returns an error if an ID of a campaign with a wrong type is sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "code": 403,
                      "key": "forbidden",
                      "message": "Forbidden",
                      "details": "Transactions are allowed only for loyalty or gift campaigns",
                      "request_id": "v-0f92ce8ff74946d25f"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Returns an error if the campaign does not exist or has been deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "Not Found": {
                    "value": {
                      "code": 404,
                      "key": "not_found",
                      "message": "Resource not found",
                      "details": "Cannot find campaign with id camp_5pgKwSKsAeQtFkRzmfKpxxD",
                      "request_id": "v-0f92ccbb058946d005",
                      "resource_id": "camp_5pgKwSKsAeQtFkRzmfKpxxD",
                      "resource_type": "campaign"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/campaigns/{campaignId}/summary": {
      "parameters": [
        {
          "in": "path",
          "name": "campaignId",
          "description": "You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value.",
          "schema": {
            "$ref": "#/components/schemas/ParameterCampaignId"
          },
          "required": true
        }
      ],
      "get": {
        "operationId": "get-campaign-summary",
        "tags": [
          "Campaigns"
        ],
        "summary": "Get Campaign Summary",
        "description": "Returns data for campaign analytics, covering validations, redemptions, publications, and other details specific to a given campaign type.\n\nUse `start_date` and `end_date` to narrow down the data to specific periods.\n\n<Warning>\n\n<Badge color=\"yellow\">Campaigns created before 17 June 2025</Badge>\n\nThis endpoint returns analytics data for campaigns that were created after 17 June 2025. Older campaigns return empty data.\n\n</Warning>",
        "parameters": [
          {
            "name": "start_date",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/ParameterDateOnly"
            },
            "description": "Timestamp representing the date which results must begin on. Represented in ISO 8601 format."
          },
          {
            "name": "end_date",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/ParameterDateOnly"
            },
            "description": "Timestamp representing the date which results must end on. Represented in ISO 8601 format."
          }
        ],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "campaigns"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Returns campaign analytics data. Returns different data depending on the campaign type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignsSummaryGetResponseBody"
                },
                "examples": {
                  "Generic code discount campaign": {
                    "value": {
                      "object": "campaign_summary",
                      "campaign": {
                        "id": "camp_WaZ6r4LSF1alRaIwJVKS07bs",
                        "name": "Summer-2025",
                        "campaign_type": "DISCOUNT_COUPONS",
                        "type": "STANDALONE",
                        "voucher": {
                          "type": "DISCOUNT_VOUCHER",
                          "discount": {
                            "type": "AMOUNT",
                            "amount_off": 2000,
                            "effect": "APPLY_TO_ORDER"
                          },
                          "redemption": {
                            "quantity": null
                          },
                          "is_referral_code": false
                        },
                        "auto_join": false,
                        "join_once": false,
                        "use_voucher_metadata_schema": true,
                        "vouchers_count": 1,
                        "active": true,
                        "metadata": {},
                        "created_at": "2025-06-17T08:05:57.720Z",
                        "creation_status": "DONE",
                        "vouchers_generation_status": "DONE",
                        "protected": false,
                        "category_id": null,
                        "categories": [],
                        "object": "campaign"
                      },
                      "redemptions": 10,
                      "redemptions_succeeded": 8,
                      "redemptions_failed": 2,
                      "rollbacks": 1,
                      "rollbacks_succeeded": 1,
                      "rollbacks_failed": 0,
                      "validations": 10,
                      "validations_succeeded": 8,
                      "validations_failed": 2,
                      "vouchers_created": 1,
                      "vouchers_deleted": 0,
                      "publications": 0,
                      "publications_succeeded": 0,
                      "publications_failed": 0,
                      "discounted_amount": 20000,
                      "rolledback_discounted_amount": 200,
                      "orders_amount": 19453,
                      "orders_rolledback_amount": 800
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Returns an error if a campaign is not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "Campaign not found": {
                    "value": {
                      "code": 404,
                      "key": "not_found",
                      "message": "Resource not found",
                      "details": "Cannot find campaign with id DOES_NOT_EXIST",
                      "request_id": "v-10cb77ea020c70aa60",
                      "resource_id": "DOES_NOT_EXIST",
                      "resource_type": "campaign"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CampaignsCreateRequestBody": {
        "type": "object",
        "title": "Campaigns Create Request Body",
        "description": "Request body schema for **POST** `v1/campaigns`.",
        "oneOf": [
          {
            "$ref": "#/components/schemas/CampaignsCreateDiscountCouponsCampaign"
          },
          {
            "$ref": "#/components/schemas/CampaignsCreateReferralCampaign"
          },
          {
            "$ref": "#/components/schemas/CampaignsCreateGiftCampaign"
          },
          {
            "$ref": "#/components/schemas/CampaignsCreateLoyaltyCampaign"
          },
          {
            "$ref": "#/components/schemas/CampaignsCreatePromotionCampaign"
          }
        ]
      },
      "CampaignsCreateResponseBody": {
        "type": "object",
        "title": "Campaigns Create Response Body",
        "description": "Response body schema for **POST** `v1/campaigns/{campaignId}`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/Campaign"
          }
        ]
      },
      "Error": {
        "title": "Error Object",
        "type": "object",
        "description": "Error details",
        "properties": {
          "code": {
            "type": "integer",
            "description": "Error's HTTP status code."
          },
          "key": {
            "type": "string",
            "description": "Short string describing the kind of error which occurred."
          },
          "message": {
            "type": "string",
            "description": "A human-readable message providing a short description of the error."
          },
          "details": {
            "type": "string",
            "description": "A human-readable message providing more details about the error."
          },
          "request_id": {
            "type": "string",
            "example": "v-0a885062c80375740f",
            "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team."
          },
          "resource_id": {
            "type": "string",
            "description": "Unique resource ID that can be used in another endpoint to get more details.",
            "example": "rf_0c5d710a87c8a31f86"
          },
          "resource_type": {
            "type": "string",
            "description": "The resource type.",
            "example": "voucher"
          },
          "error": {
            "type": "object",
            "description": "Includes additional information about the error.",
            "properties": {
              "message": {
                "type": "string",
                "description": "The message configured by the user in a validation rule."
              }
            }
          }
        },
        "required": [
          "code",
          "message"
        ]
      },
      "ParameterExpandListCampaigns": {
        "type": "string",
        "enum": [
          "category",
          "access_settings_assignments"
        ]
      },
      "ParameterCampaignStatusListCampaigns": {
        "type": "string",
        "description": "Status of the campaign. Allowed values:\n`DONE`,\n`IN_PROGRESS`,\n`DRAFT`,\n`FAILED`\n`MODIFYING`",
        "enum": [
          "DONE",
          "IN_PROGRESS",
          "FAILED",
          "DRAFT",
          "MODIFYING"
        ]
      },
      "ParameterIsReferralCodeListCampaigns": {
        "type": "boolean",
        "description": "Lists campaigns that have or do not have referral codes."
      },
      "ParameterOrderListCampaigns": {
        "type": "string",
        "enum": [
          "created_at",
          "-created_at",
          "updated_at",
          "-updated_at"
        ]
      },
      "ParameterFiltersListCampaigns": {
        "type": "object",
        "properties": {
          "campaigns": {
            "type": "object",
            "description": "Name of the campaign.",
            "properties": {
              "conditions": {
                "$ref": "#/components/schemas/FilterConditionsString"
              }
            }
          },
          "campaigns_id": {
            "type": "object",
            "description": "Unique identifier of the campaign. It is assigned by Voucherify.",
            "properties": {
              "conditions": {
                "$ref": "#/components/schemas/FilterConditionsString"
              }
            }
          },
          "campaign_status": {
            "type": "object",
            "description": "Status of the campaign. Allowed values:\n`DONE`,\n`IN_PROGRESS`,\n`DRAFT`,\n`FAILED`\n`MODIFYING`",
            "properties": {
              "conditions": {
                "type": "object",
                "description": "Data conditions used to narrow down the data records to be returned in the result.",
                "properties": {
                  "$in": {
                    "type": "array",
                    "description": "Array of resource values that should be included in the results (multiple values).",
                    "items": {
                      "type": "string",
                      "enum": [
                        "DONE",
                        "IN_PROGRESS",
                        "FAILED",
                        "DRAFT",
                        "MODIFYING"
                      ]
                    }
                  },
                  "$not_in": {
                    "type": "array",
                    "description": "Array of resource values that should be included in the results (multiple values).",
                    "items": {
                      "type": "string",
                      "enum": [
                        "DONE",
                        "IN_PROGRESS",
                        "FAILED",
                        "DRAFT",
                        "MODIFYING"
                      ]
                    }
                  },
                  "$is": {
                    "type": "string",
                    "description": "Value is exactly this value (single value).",
                    "enum": [
                      "DONE",
                      "IN_PROGRESS",
                      "FAILED",
                      "DRAFT",
                      "MODIFYING"
                    ]
                  },
                  "$is_not": {
                    "type": "string",
                    "description": "Results omit this value (single value).",
                    "enum": [
                      "DONE",
                      "IN_PROGRESS",
                      "FAILED",
                      "DRAFT",
                      "MODIFYING"
                    ]
                  },
                  "$has_value": {
                    "type": "string",
                    "description": "Value is NOT null. The value for this parameter is an empty string."
                  },
                  "$is_unknown": {
                    "type": "string",
                    "description": "Value is null. The value for this parameter is an empty string."
                  },
                  "$starts_with": {
                    "type": "string",
                    "description": "Value starts with the specified string."
                  },
                  "$ends_with": {
                    "type": "string",
                    "description": "Value ends with the specified string."
                  }
                }
              }
            }
          },
          "status": {
            "type": "object",
            "description": "Filters campaigns by their code generation status. Pass the filter as an empty object, for example `filters[status][conditions][$active]=`",
            "properties": {
              "conditions": {
                "type": "object",
                "description": "Data conditions used to narrow down the data records to be returned in the result.",
                "properties": {
                  "$active": {
                    "type": "object",
                    "description": "Campaigns finished generation codes. This also returns campaigns regardless of their `expiration_date` and `start_date`.",
                    "additionalProperties": false
                  },
                  "$failed": {
                    "type": "object",
                    "description": "Campaigs failed to generated codes.",
                    "additionalProperties": false
                  },
                  "$in_progress": {
                    "type": "object",
                    "description": "Campaigns are generating codes or they are updating.",
                    "additionalProperties": false
                  },
                  "$expired": {
                    "type": "object",
                    "description": "Campaigns generated codes, but their `expiration_date` is in the past.",
                    "additionalProperties": false
                  },
                  "before_start": {
                    "type": "object",
                    "description": "Campaigns generated codes, but their `start_date` is in the future.",
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "active": {
            "type": "object",
            "description": "Filters campaigns by their `active` state. Pass the filter as an empty object, for example `filters[active][conditions][$enabled]=`.",
            "properties": {
              "$enabled": {
                "type": "object",
                "description": "Campaigns are enabled.",
                "additionalProperties": false
              },
              "$disabled": {
                "type": "object",
                "description": "Campaigns are disabled.",
                "additionalProperties": false
              },
              "$expired": {
                "type": "object",
                "description": "Campaign `expiration_date` is in the past.",
                "additionalProperties": false
              },
              "$active": {
                "type": "object",
                "description": "Campaigns are active, `start_date` is `null` or in the past, and `expiration_date` is `null` or in the future.",
                "additionalProperties": false
              }
            }
          },
          "is_referral_code": {
            "type": "object",
            "description": "Determines if the campaign is or is not a referral campaign.",
            "properties": {
              "conditions": {
                "type": "object",
                "properties": {
                  "$is": {
                    "type": "string",
                    "description": "Value is exactly this value (single value).",
                    "enum": [
                      "TRUE",
                      "FALSE"
                    ]
                  },
                  "$is_not": {
                    "type": "string",
                    "description": "Results omit this value (single value).",
                    "enum": [
                      "TRUE",
                      "FALSE"
                    ]
                  }
                }
              }
            }
          },
          "validity_timeframe": {
            "description": "Filter by validity timeframe",
            "type": "object",
            "properties": {
              "conditions": {
                "$ref": "#/components/schemas/FilterConditionsDateTime"
              }
            }
          },
          "voucher_type": {
            "type": "object",
            "description": "Type of the voucher. Allowed values:\n`DISCOUNT_VOUCHER`,\n`GIFT_VOUCHER`,\n`LOYALTY_CARD`.",
            "properties": {
              "conditions": {
                "properties": {
                  "$in": {
                    "type": "array",
                    "description": "Array of resource values that should be included in the results (multiple values).",
                    "items": {
                      "type": "string",
                      "enum": [
                        "GIFT_VOUCHER",
                        "DISCOUNT_VOUCHER",
                        "LOYALTY_CARD"
                      ]
                    }
                  },
                  "$not_in": {
                    "type": "array",
                    "description": "Array of resource values that should be included in the results (multiple values).",
                    "items": {
                      "type": "string",
                      "enum": [
                        "GIFT_VOUCHER",
                        "DISCOUNT_VOUCHER",
                        "LOYALTY_CARD"
                      ]
                    }
                  },
                  "$is": {
                    "type": "string",
                    "description": "Value is exactly this value (single value).",
                    "enum": [
                      "GIFT_VOUCHER",
                      "DISCOUNT_VOUCHER",
                      "LOYALTY_CARD"
                    ]
                  },
                  "$is_not": {
                    "type": "string",
                    "description": "Results omit this value (single value).",
                    "enum": [
                      "GIFT_VOUCHER",
                      "DISCOUNT_VOUCHER",
                      "LOYALTY_CARD"
                    ]
                  },
                  "$has_value": {
                    "type": "string",
                    "description": "Value is NOT null. The value for this parameter is an empty string."
                  },
                  "$is_unknown": {
                    "type": "string",
                    "description": "Value is null. The value for this parameter is an empty string."
                  },
                  "$starts_with": {
                    "type": "string",
                    "description": "Value starts with the specified string."
                  },
                  "$ends_with": {
                    "type": "string",
                    "description": "Value ends with the specified string."
                  }
                }
              }
            }
          },
          "categories": {
            "type": "object",
            "description": "Filter by categories names",
            "properties": {
              "conditions": {
                "$ref": "#/components/schemas/FilterConditionsString"
              }
            }
          },
          "category_ids": {
            "type": "object",
            "description": "Filter by categories IDs",
            "properties": {
              "conditions": {
                "$ref": "#/components/schemas/FilterConditionsString"
              }
            }
          },
          "type": {
            "type": "object",
            "description": "Type of the campaign. Allowed values:\n`AUTO_UPDATE`,\n`BULK`,\n`STANDALONE`,\n`STATIC`.\n`BULK` is a virtual type that returns campaigns with the `AUTO_UPDATE` or `STATIC` type.",
            "properties": {
              "conditions": {
                "properties": {
                  "$in": {
                    "type": "array",
                    "description": "Array of resource values that should be included in the results (multiple values).",
                    "items": {
                      "type": "string",
                      "enum": [
                        "AUTO_UPDATE",
                        "BULK",
                        "STANDALONE",
                        "STATIC"
                      ]
                    }
                  },
                  "$not_in": {
                    "type": "array",
                    "description": "Array of resource values that should be included in the results (multiple values).",
                    "items": {
                      "type": "string",
                      "enum": [
                        "AUTO_UPDATE",
                        "BULK",
                        "STANDALONE",
                        "STATIC"
                      ]
                    }
                  }
                }
              }
            }
          },
          "created_date": {
            "description": "Timestamp representing the date and time when the campaign was created. The value is shown in the ISO 8601 format.",
            "type": "object",
            "properties": {
              "conditions": {
                "$ref": "#/components/schemas/FilterConditionsDateTime"
              }
            }
          },
          "updated_at": {
            "type": "object",
            "description": "Timestamp representing the date and time when the campaign was last updated. The value is shown in the ISO 8601 format.",
            "properties": {
              "conditions": {
                "$ref": "#/components/schemas/FilterConditionsDateTime"
              }
            }
          },
          "start_date": {
            "type": "object",
            "description": "Timestamp representing the date and time when the campaign starts to be active. Campaign is *inactive before* this date. The value is shown in the ISO 8601 format.",
            "properties": {
              "conditions": {
                "$ref": "#/components/schemas/FilterConditionsDateTime"
              }
            }
          },
          "expiration_date": {
            "description": "Timestamp representing the date and time when the campaign expired. The value is shown in the ISO 8601 format.",
            "type": "object",
            "properties": {
              "conditions": {
                "$ref": "#/components/schemas/FilterConditionsDateTime"
              }
            }
          },
          "validity_day_of_week": {
            "description": "Filters days of week when the campaign is active. The value is an integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday\n- `1` Monday\n- `2` Tuesday\n- `3` Wednesday\n- `4` Thursday\n- `5` Friday\n- `6` Saturday\n\nIf the campaign is valid throughout all week days, it is always returned.",
            "type": "object",
            "properties": {
              "conditions": {
                "type": "object",
                "description": "Data conditions used to narrow down the data records to be returned in the result.",
                "properties": {
                  "$is": {
                    "type": "array",
                    "description": "Array of resource values that should be included in the results (multiple values).",
                    "items": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 6,
                      "enum": [
                        0,
                        1,
                        2,
                        3,
                        4,
                        5,
                        6
                      ]
                    }
                  }
                }
              }
            }
          },
          "junction": {
            "$ref": "#/components/schemas/Junction"
          }
        }
      },
      "ParameterCampaignsAccessSetttings": {
        "type": "object",
        "properties": {
          "filter": {
            "type": "object",
            "properties": {
              "areas_ids": {
                "type": "array",
                "description": "Add area IDs to list all campaigns that are assigned to those areas.",
                "items": {
                  "type": "string",
                  "example": "ar_0ab12cde3456789fgh"
                }
              },
              "area_all_stores_ids": {
                "type": "array",
                "description": "Add area IDs to list all campaigns that are assigned to all stores in those areas.",
                "items": {
                  "type": "string",
                  "example": "ar_0ab12cde3456789fgh"
                }
              },
              "area_stores_ids": {
                "type": "array",
                "description": "Add store IDs to list all campaigns that are assigned to those stores. The response returns also those campaigns that are assigned to those stores with the assignment to all stores.",
                "items": {
                  "type": "string",
                  "example": "ars_0ab12cde3456789fgh"
                }
              }
            }
          }
        }
      },
      "CampaignsListResponseBody": {
        "type": "object",
        "description": "Schema model for **GET** `v1/campaigns`.",
        "title": "Campaigns List Response Body",
        "properties": {
          "object": {
            "type": "string",
            "description": "The type of the object represented by JSON. This object stores information about campaigns in a dictionary.",
            "default": "list"
          },
          "data_ref": {
            "type": "string",
            "description": "Identifies the name of the attribute that contains the array of campaign objects.",
            "default": "campaigns"
          },
          "campaigns": {
            "type": "array",
            "description": "Contains array of campaign objects.",
            "items": {
              "$ref": "#/components/schemas/CampaignBase"
            }
          },
          "total": {
            "type": "integer",
            "description": "Total number of campaigns."
          }
        }
      },
      "CampaignsGetResponseBody": {
        "type": "object",
        "title": "Campaigns Get Response Body",
        "description": "Response body schema for **GET** `v1/campaigns/{campaignId}`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/Campaign"
          }
        ]
      },
      "ParameterCampaignId": {
        "type": "string",
        "example": "camp_rRsfatlwN7unSeUIJDCYedal"
      },
      "CampaignsUpdateRequestBody": {
        "type": "object",
        "title": "Campaigns Update Request Body",
        "description": "Request body schema for **PUT** `v1/campaigns/{campaignId}`.",
        "oneOf": [
          {
            "$ref": "#/components/schemas/CampaignsUpdateDiscountCouponsCampaign"
          },
          {
            "$ref": "#/components/schemas/CampaignsUpdateReferralCampaign"
          },
          {
            "$ref": "#/components/schemas/CampaignsUpdateGiftCampaign"
          },
          {
            "$ref": "#/components/schemas/CampaignsUpdateLoyaltyCampaign"
          },
          {
            "$ref": "#/components/schemas/CampaignsUpdatePromotionCampaign"
          }
        ]
      },
      "CampaignsUpdateResponseBody": {
        "type": "object",
        "title": "Campaigns Update Response Body",
        "description": "Response body schema for **PUT** `v1/campaigns/{campaignId}`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/Campaign"
          }
        ]
      },
      "ParameterBoolean": {
        "type": "boolean"
      },
      "CampaignsDeleteResponseBody": {
        "type": "object",
        "title": "Campaigns Delete Response Body",
        "description": "Response body schema for **DELETE** `/campaigns/{campaignId}`.",
        "properties": {
          "async_action_id": {
            "type": "string",
            "example": "aa_0a875d56c805df6601",
            "description": "The ID of the scheduled asynchronous action."
          }
        }
      },
      "ParameterInteger": {
        "type": "integer"
      },
      "CampaignsVouchersCreateInBulkRequestBody": {
        "type": "object",
        "title": "Campaigns Vouchers Create In Bulk Request Body",
        "description": "Request body schema for **POST** `v1/campaigns/{campaignId}/vouchers`.",
        "allOf": [
          {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Unique voucher code."
              },
              "code_config": {
                "$ref": "#/components/schemas/CodeConfig"
              }
            }
          },
          {
            "$ref": "#/components/schemas/CampaignsVouchersCreateBaseRequestBody"
          }
        ]
      },
      "CampaignsVouchersCreateResponseBody": {
        "type": "object",
        "title": "Campaigns Vouchers Create Response Body",
        "description": "Response body schema for **POST** `v1/campaigns/{campaignId}/vouchers/{code}` and **POST** `v1/campaigns/{campaignId}/vouchers`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/Voucher"
          }
        ]
      },
      "CampaignsVouchersCreateInBulkResponseBody": {
        "type": "object",
        "title": "Campaigns Vouchers Create In Bulk Response Body",
        "description": "Response body schema for **POST** `v1/campaigns/{campaignId}/vouchers/{code}`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/AsyncActions"
          }
        ]
      },
      "CampaignsVouchersCreateRequestBody": {
        "type": "object",
        "title": "Campaigns Vouchers Create Request Body",
        "description": "Request body schema for **POST** `v1/campaigns/{campaignId}/vouchers/{code}`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/CampaignsVouchersCreateBaseRequestBody"
          }
        ]
      },
      "ParameterCode": {
        "type": "string",
        "example": "2CpRCE2c"
      },
      "CampaignsImportCreateRequestBody": {
        "type": "array",
        "title": "Campaigns Import Create Request Body",
        "description": "Request body schema for **POST** `v1/campaigns/{campaignId}/import`.",
        "items": {
          "$ref": "#/components/schemas/CampaignsImportVoucherItem"
        }
      },
      "CampaignsImportCreateResponseBody": {
        "type": "object",
        "title": "Campaigns Import Create Response Body",
        "description": "Response body schema for **POST** `v1/campaigns/{campaignId}/import`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/AsyncActions"
          }
        ]
      },
      "e_400_invalid_voucher": {
        "title": "Invalid Voucher",
        "type": "object",
        "description": "Error: Bad Request &rarr; Invalid Voucher",
        "properties": {
          "code": {
            "type": "integer",
            "default": 400,
            "description": "Error's HTTP status code."
          },
          "key": {
            "type": "string",
            "default": "invalid_voucher",
            "description": "Short string describing the kind of error which occurred."
          },
          "message": {
            "type": "string",
            "default": "Invalid Voucher",
            "description": "A human-readable message providing a short description of the error."
          },
          "details": {
            "type": "string",
            "description": "A human-readable message providing more details about the error."
          },
          "request_id": {
            "type": "string",
            "example": "v-0a884c6be8c3756f42",
            "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team."
          }
        }
      },
      "e_400_duplicate_key": {
        "title": "Duplicated Key",
        "type": "object",
        "description": "Error: Conflict &rarr; Duplicated key found",
        "properties": {
          "code": {
            "type": "integer",
            "default": 400,
            "description": "Error's HTTP status code."
          },
          "key": {
            "type": "string",
            "default": "duplicate_key",
            "description": "Short string describing the kind of error which occurred."
          },
          "message": {
            "type": "string",
            "default": "Duplicate codes",
            "description": "A human-readable message providing a short description of the error."
          },
          "details": {
            "type": "string",
            "description": "A human-readable message providing more details about the error."
          },
          "request_id": {
            "type": "string",
            "example": "v-0aa36e570e44cb3bdd",
            "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team."
          }
        }
      },
      "CampaignsVouchersImportCSVRequestBody": {
        "type": "object",
        "title": "Campaigns Vouchers Import CSV Request Body",
        "description": "Request body schema for **POST** `v1/campaigns/{campaignId}/importCSV`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/ImportCSVRequestBody"
          }
        ]
      },
      "CampaignsImportCsvCreateResponseBody": {
        "type": "object",
        "title": "Campaigns Import Csv Create Response Body",
        "description": "Response body schema for **POST** `v1/campaigns/{campaignId}/importCSV`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/AsyncActions"
          }
        ]
      },
      "ParameterLimitExamineCampaignsQualification": {
        "type": "integer",
        "maximum": 50,
        "minimum": 1
      },
      "ParameterOrderExamineCampaignsQualification": {
        "type": "string",
        "enum": [
          "created_at",
          "-created_at",
          "updated_at",
          "-updated_at",
          "type",
          "-type",
          "code",
          "-code",
          "category",
          "-category",
          "campaign",
          "-campaign"
        ]
      },
      "2_req_examine_qualification": {
        "type": "object",
        "title": "Examine Qualification Request Body",
        "description": "Request body schema for **POST** `v1/campaigns/qualification`.",
        "properties": {
          "customer": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/6_req_validate_voucher_customer_id"
              },
              {
                "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id"
              },
              {
                "$ref": "#/components/schemas/9_req_create_customer"
              }
            ],
            "description": "Customer's information."
          },
          "order": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/6_req_validate_voucher_order_id"
              },
              {
                "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id"
              },
              {
                "$ref": "#/components/schemas/OrdersCreateRequestBody"
              }
            ],
            "description": "Order information. This object enables you to pass purchase transaction data. Read what properties you can use in the [Order object](/api-reference/orders/order-calculated-object)."
          }
        }
      },
      "2_res_examine_qualification": {
        "type": "object",
        "title": "Examine Qualification Response Body",
        "description": "Response body schema for **POST** `v1/campaigns/qualification`.",
        "properties": {
          "object": {
            "type": "string",
            "description": "The type of the object represented by JSON. This object stores information about campaigns in a dictionary.",
            "default": "list"
          },
          "data_ref": {
            "type": "string",
            "description": "Identifies the name of the attribute that contains the array of campaign objects.",
            "default": "data"
          },
          "data": {
            "type": "array",
            "description": "Contains array of campaign objects.",
            "items": {
              "$ref": "#/components/schemas/2_obj_campaign_object_campaigns_qualification"
            }
          },
          "total": {
            "type": "integer",
            "description": "Total valid and active campaigns matching the qualification criteria in given context."
          },
          "id": {
            "type": "string",
            "description": "Unique qualification ID.",
            "example": "qfl_dNZ3gWfKVNa8Zw15hn30uqdU"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp representing the date and time when the qualification was created. The value is shown in the ISO 8601 format.",
            "example": "2023-04-04T13:13:03.119Z"
          },
          "tracking_id": {
            "type": "string",
            "description": "Hashed customer source ID."
          }
        }
      },
      "CampaignsEnableResponseBody": {
        "type": "object",
        "title": "Campaigns Enable Response Body",
        "description": "Response body schema for **POST** `v1/campaigns/{campaignId}/enable`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EmptyJson"
          }
        ]
      },
      "CampaignsDisableResponseBody": {
        "type": "object",
        "title": "Campaigns Disable Response Body",
        "description": "Response body schema for **POST** `v1/campaigns/{campaignId}/disable`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EmptyJson"
          }
        ]
      },
      "ParameterOrderListTransactions": {
        "type": "string",
        "enum": [
          "id",
          "-id"
        ]
      },
      "ParameterString": {
        "type": "string"
      },
      "ParametersFiltersListCampaignTransactions": {
        "type": "object",
        "properties": {
          "junction": {
            "$ref": "#/components/schemas/Junction"
          },
          "id": {
            "type": "object",
            "properties": {
              "conditions": {
                "$ref": "#/components/schemas/FilterConditionsString"
              }
            }
          },
          "voucher_id": {
            "type": "object",
            "properties": {
              "conditions": {
                "$ref": "#/components/schemas/FilterConditionsString"
              }
            }
          }
        }
      },
      "CampaignsTransactionsListResponseBody": {
        "type": "object",
        "title": "Campaigns Transactions List Response Body",
        "description": "Response body schema for **GET** `v1/campaigns/{campaignId}/transactions`.",
        "properties": {
          "object": {
            "type": "string",
            "default": "list",
            "description": "The type of the object represented by JSON.",
            "enum": [
              "list"
            ]
          },
          "data_ref": {
            "type": "string",
            "default": "data",
            "description": "Identifies the name of the attribute that contains the array of transaction objects.",
            "enum": [
              "data"
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VoucherTransaction"
            },
            "description": "A dictionary that contains an array of transactions. Each entry in the array is a separate transaction object."
          },
          "has_more": {
            "type": "boolean",
            "description": "As query results are always limited (by the limit parameter), the `has_more` flag indicates if there are more records for given filter parameters. This lets you know if you can run another request (with a different paging or a different start date filter) to get more records returned in the results."
          },
          "more_starting_after": {
            "type": "string",
            "description": "Returns an ID that can be used to return another page of results. Use the transaction ID in the `starting_after_id` query parameter to display another page of the results starting after the transaction with that ID."
          }
        },
        "required": [
          "object",
          "data_ref",
          "data",
          "has_more"
        ]
      },
      "CampaignsTransactionsExportCreateRequestBody": {
        "title": "Campaign Transactions Export Create Request Body",
        "description": "Request body schema for **POST** `v1/campaigns/{campaignId}/transactions/export`.",
        "type": "object",
        "properties": {
          "parameters": {
            "description": "List of available parameters containing fields and filters that can be exported for transactions in a gift card or loyalty card campaign, along with the sorting order of the returned data.",
            "allOf": [
              {
                "$ref": "#/components/schemas/CampaignsTransactionsExportParameters"
              },
              {
                "type": "object",
                "properties": {
                  "filters": {
                    "$ref": "#/components/schemas/ExportCampaignTransactionsFilters"
                  }
                }
              }
            ]
          }
        }
      },
      "CampaignsTransactionsExportCreateResponseBody": {
        "type": "object",
        "title": "Campaigns Transactions Export Create Response Body",
        "description": "Response body schema for **POST** `v1/campaigns/{campaignId}/transactions/export`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/CampaignsTransactionsExport"
          }
        ]
      },
      "ParameterDateOnly": {
        "type": "string",
        "example": "2023-12-22T10:13:06.487Z",
        "format": "date"
      },
      "CampaignsSummaryGetResponseBody": {
        "title": "Campaigns Summary Get Response Body",
        "type": "object",
        "description": "Response body schema for **GET** `/v1/campaigns/{campaignId}/summary`.",
        "oneOf": [
          {
            "$ref": "#/components/schemas/CampaignsSummaryDiscountCampaign"
          },
          {
            "$ref": "#/components/schemas/CampaignsSummaryPromotionCampaign"
          },
          {
            "$ref": "#/components/schemas/CampaignsSummaryGiftCampaign"
          },
          {
            "$ref": "#/components/schemas/CampaignsSummaryLoyaltyCampaign"
          },
          {
            "$ref": "#/components/schemas/CampaignsSummaryReferralCampaign"
          }
        ]
      },
      "CampaignsCreateDiscountCouponsCampaign": {
        "title": "Create Discount Coupons Campaign",
        "allOf": [
          {
            "$ref": "#/components/schemas/CampaignsCreateBaseValidationRules"
          },
          {
            "type": "object",
            "title": "Schema that contains unique properties for Discount Coupons Campaign",
            "description": "Body schema for creating a campaign of discount coupons type using **POST** `v1/campaigns`.",
            "properties": {
              "campaign_type": {
                "type": "string",
                "default": "DISCOUNT_COUPONS",
                "enum": [
                  "DISCOUNT_COUPONS"
                ],
                "description": "Type of campaign."
              },
              "voucher": {
                "$ref": "#/components/schemas/DiscountCouponsCampaignVoucher"
              }
            }
          }
        ]
      },
      "CampaignsCreateReferralCampaign": {
        "title": "Create Referral Program",
        "allOf": [
          {
            "$ref": "#/components/schemas/CampaignsCreateBaseValidationRules"
          },
          {
            "type": "object",
            "title": "Schema that contains unique properties for Referral Program",
            "description": "Body schema for creating a campaign of referral type using **POST** `v1/campaigns`.",
            "properties": {
              "campaign_type": {
                "type": "string",
                "default": "REFERRAL_PROGRAM",
                "enum": [
                  "REFERRAL_PROGRAM"
                ],
                "description": "Type of campaign."
              },
              "referral_program": {
                "$ref": "#/components/schemas/ReferralProgram"
              },
              "voucher": {
                "$ref": "#/components/schemas/ReferralCampaignVoucher"
              }
            }
          }
        ]
      },
      "CampaignsCreateGiftCampaign": {
        "title": "Create Gift Campaign",
        "allOf": [
          {
            "$ref": "#/components/schemas/CampaignsCreateBaseValidationRules"
          },
          {
            "type": "object",
            "title": "Schema that contains unique properties for Gift Campaign",
            "description": "Body schema for creating a campaign of gift type using **POST** `v1/campaigns`.",
            "properties": {
              "campaign_type": {
                "type": "string",
                "default": "GIFT_VOUCHERS",
                "enum": [
                  "GIFT_VOUCHERS"
                ],
                "description": "Type of campaign."
              },
              "voucher": {
                "$ref": "#/components/schemas/GiftCampaignVoucher"
              }
            }
          }
        ]
      },
      "CampaignsCreateLoyaltyCampaign": {
        "title": "Create Loyalty Campaign",
        "allOf": [
          {
            "$ref": "#/components/schemas/CampaignsCreateBase"
          },
          {
            "type": "object",
            "title": "Schema that contains unique properties for Loyalty Campaign",
            "description": "Body schema for creating a campaign of loyalty type using **POST** `v1/campaigns`.",
            "properties": {
              "campaign_type": {
                "type": "string",
                "default": "LOYALTY_PROGRAM",
                "enum": [
                  "LOYALTY_PROGRAM"
                ],
                "description": "Type of campaign."
              },
              "voucher": {
                "$ref": "#/components/schemas/CampaignLoyaltyVoucher"
              }
            }
          }
        ]
      },
      "CampaignsCreatePromotionCampaign": {
        "title": "Create Promotion Campaign",
        "allOf": [
          {
            "$ref": "#/components/schemas/CampaignsCreateBaseValidationRules"
          },
          {
            "type": "object",
            "title": "Schema that contains unique properties for Promotion Campaign",
            "description": "Body schema for creating a campaign of promotion type using **POST** `v1/campaigns`.",
            "properties": {
              "campaign_type": {
                "type": "string",
                "default": "PROMOTION",
                "enum": [
                  "PROMOTION"
                ],
                "description": "Type of campaign."
              },
              "promotion": {
                "type": "object",
                "properties": {
                  "tiers": {
                    "type": "array",
                    "nullable": true,
                    "items": {
                      "$ref": "#/components/schemas/PromotionTierCreateParams"
                    }
                  }
                }
              }
            }
          }
        ]
      },
      "Campaign": {
        "title": "Campaign",
        "allOf": [
          {
            "$ref": "#/components/schemas/CampaignBase"
          },
          {
            "title": "Campaign Additional Data",
            "type": "object",
            "properties": {
              "promotion": {
                "$ref": "#/components/schemas/PromotionTiersList"
              },
              "validation_rules_assignments": {
                "$ref": "#/components/schemas/ValidationRulesAssignmentsList"
              }
            }
          }
        ]
      },
      "ParameterLimit": {
        "type": "integer",
        "maximum": 100,
        "minimum": 1
      },
      "ParameterPage": {
        "type": "integer",
        "minimum": 1,
        "maximum": 100
      },
      "ParameterCampaignType": {
        "type": "string",
        "enum": [
          "PROMOTION",
          "GIFT_VOUCHERS",
          "REFERRAL_PROGRAM",
          "DISCOUNT_COUPONS",
          "LOYALTY_PROGRAM"
        ]
      },
      "FilterConditionsString": {
        "title": "Filter by conditions",
        "type": "object",
        "description": "Data filters used to narrow down the data records to be returned in the result.",
        "properties": {
          "$in": {
            "type": "array",
            "description": "Array of resource values that should be included in the results (multiple values).",
            "items": {
              "type": "string"
            }
          },
          "$not_in": {
            "type": "array",
            "description": "Array of resource values that should be included in the results (multiple values).",
            "items": {
              "type": "string"
            }
          },
          "$is": {
            "type": "string",
            "description": "Value is exactly this value (single value)."
          },
          "$is_not": {
            "type": "string",
            "description": "Results omit this value (single value)."
          },
          "$has_value": {
            "type": "string",
            "description": "Value is NOT null. The value for this parameter is an empty string."
          },
          "$is_unknown": {
            "type": "string",
            "description": "Value is null. The value for this parameter is an empty string."
          },
          "$starts_with": {
            "type": "string",
            "description": "Value starts with the specified string."
          },
          "$ends_with": {
            "type": "string",
            "description": "Value ends with the specified string."
          },
          "$contains": {
            "type": "string",
            "description": "Value includes the specified string."
          },
          "$not_contain": {
            "type": "string",
            "description": "Value does NOT include the specified string."
          }
        }
      },
      "FilterConditionsDateTime": {
        "title": "Filter by conditions",
        "type": "object",
        "description": "Data filters used to narrow down the data records to be returned in the result.",
        "properties": {
          "$after": {
            "type": "string",
            "description": "Value is after this date. The value for this parameter is shown in the ISO 8601 format.",
            "format": "date-time",
            "example": "2024-01-01T00:00:00.000Z"
          },
          "$before": {
            "type": "string",
            "description": "Value is before this date. The value for this parameter is shown in the ISO 8601 format.",
            "format": "date-time",
            "example": "2024-01-01T00:00:00.000Z"
          },
          "$has_value": {
            "type": "string",
            "description": "Value is NOT null. The value for this parameter is an empty string."
          },
          "$is_unknown": {
            "type": "string",
            "description": "Value is null. The value for this parameter is an empty string."
          },
          "$more_than": {
            "type": "integer",
            "description": "Value is more days ago before the current date and time, e.g. more than `10` days ago."
          },
          "$less_than": {
            "type": "integer",
            "description": "Value is less days before the current date and time, e.g. less than `10` days ago."
          }
        }
      },
      "Junction": {
        "title": "Junction",
        "description": "Logical Operator Between Filters. Filter by conditions set on the `junction` parameter indicating how the `conditions` should be accounted for in the query. An `AND` is an all-inclusive logical operator, meaning the `AND` operator displays a record if **ALL** the conditions separated by AND are TRUE, while  an `OR` operator displays a record if **ANY** of the conditions separated by OR is TRUE.",
        "enum": [
          "and",
          "or"
        ],
        "type": "string"
      },
      "CampaignBase": {
        "type": "object",
        "title": "Campaign Base",
        "description": "This is an object representing a campaign.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique campaign ID, assigned by Voucherify.",
            "example": "camp_f7fBbQxUuTN7dI7tGOo5XMDA"
          },
          "name": {
            "type": "string",
            "description": "Campaign name."
          },
          "description": {
            "type": "string",
            "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details."
          },
          "campaign_type": {
            "type": "string",
            "enum": [
              "LOYALTY_PROGRAM",
              "GIFT_VOUCHERS",
              "DISCOUNT_COUPONS",
              "PROMOTION",
              "REFERRAL_PROGRAM"
            ],
            "description": "Type of campaign."
          },
          "type": {
            "type": "string",
            "description": "Defines whether the campaign can be updated with new vouchers after campaign creation or if the campaign consists of generic (standalone) vouchers.\n\n- `AUTO_UPDATE`: the campaign is dynamic, i.e. vouchers will generate based on set criteria\n-  `STATIC`: vouchers need to be manually published\n- `STANDALONE`: campaign for single vouchers",
            "enum": [
              "AUTO_UPDATE",
              "STATIC",
              "STANDALONE"
            ]
          },
          "voucher": {
            "$ref": "#/components/schemas/CampaignVoucher"
          },
          "auto_join": {
            "type": "boolean",
            "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled."
          },
          "join_once": {
            "type": "boolean",
            "description": "If this value is set to `true`, customers will be able to join the campaign only once. It is always `false` for generic (standalone) vouchers campaigns and it cannot be changed in them. It is always `true` for loyalty campaigns and it cannot be changed in them."
          },
          "use_voucher_metadata_schema": {
            "type": "boolean",
            "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema."
          },
          "validity_timeframe": {
            "$ref": "#/components/schemas/ValidityTimeframe"
          },
          "validity_day_of_week": {
            "$ref": "#/components/schemas/ValidityDayOfWeek"
          },
          "validity_hours": {
            "$ref": "#/components/schemas/ValidityHours"
          },
          "activity_duration_after_publishing": {
            "type": "string",
            "description": "Defines the amount of time the vouchers will be active after publishing. The value is shown in the ISO 8601 format. For example, a voucher with the value of P24D will be valid for a duration of 24 days."
          },
          "vouchers_count": {
            "type": "integer",
            "description": "Total number of unique vouchers in campaign."
          },
          "start_date": {
            "type": "string",
            "format": "date-time",
            "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ",
            "example": "2022-09-20T00:00:00.000Z"
          },
          "expiration_date": {
            "type": "string",
            "format": "date-time",
            "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format.  Campaign is *inactive after* this date.",
            "example": "2022-09-30T00:00:00.000Z"
          },
          "active": {
            "type": "boolean",
            "description": "A flag to toggle the campaign on or off. You can disable a campaign even though it's within the active period defined by the `start_date` and `expiration_date`.  \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign"
          },
          "metadata": {
            "type": "object",
            "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2021-12-01T08:00:50.038Z",
            "description": "Timestamp representing the date and time when the campaign was created. The value is shown in the ISO 8601 format."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "example": "2022-09-20T09:18:19.623Z",
            "description": "Timestamp representing the date and time when the campaign was last updated in ISO 8601 format."
          },
          "category": {
            "type": "string",
            "description": "Unique category name."
          },
          "creation_status": {
            "type": "string",
            "enum": [
              "DONE",
              "IN_PROGRESS",
              "FAILED",
              "DRAFT",
              "MODIFYING"
            ],
            "description": "Indicates the status of the campaign creation."
          },
          "vouchers_generation_status": {
            "type": "string",
            "description": "Indicates the status of the campaign's voucher generation.",
            "enum": [
              "DONE",
              "IN_PROGRESS",
              "FAILED",
              "DRAFT",
              "MODIFYING"
            ]
          },
          "readonly": {
            "type": "boolean",
            "description": "Indicates whether the campaign can be only read by a restricted user in the Areas and Stores enterprise feature. It is returned only to restricted users; this field is not returned for users with other roles. It is also not returned for restricted users who use the [GET Campaign summary](/api-reference/campaigns/get-campaign-summary) endpoint."
          },
          "protected": {
            "type": "boolean",
            "description": "Indicates whether the resource can be deleted."
          },
          "category_id": {
            "type": "string",
            "nullable": true,
            "description": "Unique category ID that this campaign belongs to.",
            "example": "cat_0b688929a2476386a7"
          },
          "categories": {
            "type": "array",
            "description": "Contains details about the campaign category. For the GET [List campaigns](/api-reference/campaigns/list-campaigns) endpoint, this is returned only if the `expand=category` query parameter is passed in the request. Otherwise, it is returned as an empty array. For GET [Campaign summary](/api-reference/campaigns/get-campaign-summary) endpoint, it is always returned as an empty array.",
            "items": {
              "$ref": "#/components/schemas/Category"
            }
          },
          "object": {
            "type": "string",
            "default": "campaign",
            "description": "The type of the object represented by JSON. This object stores information about the campaign."
          },
          "referral_program": {
            "$ref": "#/components/schemas/ReferralProgram"
          },
          "loyalty_tiers_expiration": {
            "$ref": "#/components/schemas/LoyaltyTiersExpirationAll"
          },
          "access_settings_assignments": {
            "$ref": "#/components/schemas/AccessSettingsCampaignAssignmentsList"
          }
        },
        "required": [
          "id",
          "name",
          "campaign_type",
          "type",
          "auto_join",
          "join_once",
          "use_voucher_metadata_schema",
          "created_at",
          "creation_status",
          "vouchers_generation_status",
          "protected",
          "category_id",
          "categories",
          "object"
        ]
      },
      "CampaignsUpdateDiscountCouponsCampaign": {
        "type": "object",
        "title": "Update Discount Coupons Campaign",
        "allOf": [
          {
            "$ref": "#/components/schemas/CampaignsUpdateCouponCampaignBase"
          },
          {
            "type": "object",
            "title": "Properties For Discount Coupons Campaign",
            "description": "Body schema for update a campaign of discount coupons type using **PUT** `v1/campaigns`.",
            "properties": {
              "discount": {
                "description": "Defines the voucher discount type and details.",
                "allOf": [
                  {
                    "$ref": "#/components/schemas/Discount"
                  }
                ]
              }
            }
          }
        ]
      },
      "CampaignsUpdateReferralCampaign": {
        "type": "object",
        "title": "Update Referral Campaign",
        "allOf": [
          {
            "$ref": "#/components/schemas/CampaignsUpdateCouponCampaignBase"
          },
          {
            "type": "object",
            "title": "Properties For Referral Campaign",
            "description": "Body schema for update a campaign of referral type using **PUT** `v1/campaigns`.",
            "properties": {
              "discount": {
                "description": "Defines the voucher discount type and details.",
                "allOf": [
                  {
                    "$ref": "#/components/schemas/Discount"
                  }
                ]
              },
              "referral_program": {
                "$ref": "#/components/schemas/ReferralProgram"
              }
            }
          }
        ]
      },
      "CampaignsUpdateGiftCampaign": {
        "type": "object",
        "title": "Update Gift Campaign",
        "allOf": [
          {
            "$ref": "#/components/schemas/CampaignsUpdateCouponCampaignBase"
          },
          {
            "type": "object",
            "title": "Properties For Gift Campaign",
            "description": "Body schema for update a campaign of give type using **PUT** `v1/campaigns`.",
            "properties": {
              "gift": {
                "description": "Defines the voucher gift details.",
                "allOf": [
                  {
                    "$ref": "#/components/schemas/Gift"
                  }
                ]
              }
            }
          }
        ]
      },
      "CampaignsUpdateLoyaltyCampaign": {
        "type": "object",
        "title": "Update Loyalty Campaign",
        "allOf": [
          {
            "$ref": "#/components/schemas/CampaignsUpdateCouponCampaignBase"
          },
          {
            "type": "object",
            "title": "Properties For Loyalty Campaign",
            "description": "Body schema for update a campaign of loyalty type using **PUT** `v1/campaigns`.",
            "properties": {
              "loyalty_tiers_expiration": {
                "$ref": "#/components/schemas/LoyaltyTiersExpirationAll"
              },
              "options": {
                "type": "object",
                "properties": {
                  "recalculate_tiers": {
                    "type": "boolean",
                    "description": "Determine if tiers should be recalculated or no."
                  }
                }
              }
            }
          }
        ]
      },
      "CampaignsUpdatePromotionCampaign": {
        "type": "object",
        "title": "Update Promotion Campaign",
        "allOf": [
          {
            "$ref": "#/components/schemas/CampaignsUpdateBase"
          }
        ]
      },
      "CodeConfig": {
        "title": "Code Config",
        "type": "object",
        "description": "Contains information about the config used for the voucher code. Defines the code's pattern (prefix, postfix, length, charset, etc).",
        "properties": {
          "length": {
            "type": "number",
            "description": "Number of characters in a generated code (excluding prefix and postfix)."
          },
          "charset": {
            "type": "string",
            "description": "Characters that can appear in the code.  \n\nExamples:\n\n- Alphanumeric: `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic: `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic Lowercase: `abcdefghijklmnopqrstuvwxyz` \n- Alphabetic Uppercase: `ABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Numbers: `0123456789`  \n- Custom: a custom character set"
          },
          "prefix": {
            "type": "string",
            "description": "A text appended before the code."
          },
          "postfix": {
            "type": "string",
            "description": "A text appended after the code."
          },
          "pattern": {
            "type": "string",
            "description": "A pattern for codes where hashes (#) will be replaced with random characters. Overrides `length`."
          },
          "initial_count": {
            "type": "integer",
            "description": "Internal value, does not change anything if provided."
          }
        }
      },
      "CampaignsVouchersCreateBaseRequestBody": {
        "type": "object",
        "title": "Campaigns Vouchers Create Base Request Body",
        "properties": {
          "category": {
            "type": "string",
            "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`."
          },
          "metadata": {
            "type": "object",
            "description": "The metadata object stores all custom attributes assigned to the voucher. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format."
          },
          "redemption": {
            "type": "object",
            "description": "Stores the quantity of redemptions that can be applied to the voucher.",
            "properties": {
              "quantity": {
                "type": "integer",
                "description": "How many times a voucher can be redeemed. A `null` value means unlimited."
              }
            }
          },
          "additional_info": {
            "type": "string",
            "description": "An optional field to keep any extra textual information about the code such as a code description and details."
          },
          "start_date": {
            "type": "string",
            "format": "date-time",
            "description": "Activation timestamp defines when the voucher starts to be active in ISO 8601 format. Voucher is *inactive before* this date. ",
            "example": "2022-09-20T00:00:00.000Z"
          },
          "expiration_date": {
            "type": "string",
            "format": "date-time",
            "description": "Expiration timestamp defines when the voucher expires in ISO 8601 format.  Voucher is *inactive after* this date.",
            "example": "2022-09-30T00:00:00.000Z"
          }
        }
      },
      "Voucher": {
        "title": "Voucher",
        "description": "This is an object representing a voucher with categories and validation rules assignments.",
        "allOf": [
          {
            "$ref": "#/components/schemas/VoucherBase"
          },
          {
            "type": "object",
            "properties": {
              "categories": {
                "type": "array",
                "description": "Contains details about the category.",
                "items": {
                  "$ref": "#/components/schemas/Category"
                }
              },
              "validation_rules_assignments": {
                "$ref": "#/components/schemas/ValidationRulesAssignmentsList"
              }
            }
          }
        ]
      },
      "AsyncActions": {
        "type": "object",
        "title": "Asynchronous Actions",
        "description": "Response to requests that are processed asynchronously.",
        "properties": {
          "async_action_id": {
            "type": "string",
            "example": "aa_0a875d56c805df6601",
            "description": "The ID of the scheduled asynchronous action."
          }
        },
        "required": [
          "async_action_id"
        ]
      },
      "CampaignsImportVoucherItem": {
        "title": "Campaigns Import Voucher Item",
        "oneOf": [
          {
            "$ref": "#/components/schemas/VoucherImportLoyaltyCard"
          },
          {
            "$ref": "#/components/schemas/VoucherImportGift"
          },
          {
            "$ref": "#/components/schemas/VoucherImportDiscount"
          }
        ]
      },
      "ImportCSVRequestBody": {
        "type": "object",
        "title": "Import CSV file",
        "description": "Request body schema for importing data using a CSV file.",
        "format": "binary",
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "description": "File path."
          }
        },
        "required": [
          "file"
        ]
      },
      "6_req_validate_voucher_customer_id": {
        "title": "Customer ID",
        "description": "You can pass the unique customer ID that was assigned by Voucherify.",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of an existing customer that will be linked to redemption in this request.",
            "example": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv"
          }
        }
      },
      "6_req_validate_voucher_customer_source_id": {
        "title": "Customer Source ID",
        "description": "You can send the source ID that you used to create the customer in Voucherify.",
        "type": "object",
        "properties": {
          "source_id": {
            "type": "string",
            "description": "A unique identifier of the customer who validates a voucher. It can be a customer ID or email from a CRM system, database, or a third-party service. If you also pass a customer ID (unique ID assigned by Voucherify), the source ID will be ignored."
          }
        }
      },
      "9_req_create_customer": {
        "type": "object",
        "title": "Customer",
        "description": "This is an object containing information about the customer.",
        "properties": {
          "source_id": {
            "type": "string",
            "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service. \n\nPlease note that if you would like your data to sync based on the `source_id` of the customer, you need to define the `source_id` upfront. You will not be able to change or update the `source_id` later on."
          },
          "name": {
            "type": "string",
            "description": "Customer's first and last name."
          },
          "description": {
            "type": "string",
            "description": "An arbitrary string that you can attach to a customer object."
          },
          "email": {
            "type": "string",
            "description": "Customer's email address."
          },
          "phone": {
            "type": "string",
            "description": "Customer's phone number.  This parameter is mandatory when you try to send out codes to customers via an SMS channel."
          },
          "address": {
            "type": "object",
            "description": "Customer's address.",
            "properties": {
              "city": {
                "type": "string",
                "description": "City"
              },
              "state": {
                "type": "string",
                "description": "State"
              },
              "line_1": {
                "type": "string",
                "description": "First line of address."
              },
              "line_2": {
                "type": "string",
                "description": "Second line of address."
              },
              "country": {
                "type": "string",
                "description": "Country."
              },
              "postal_code": {
                "type": "string",
                "description": "Postal code."
              }
            }
          },
          "birthdate": {
            "type": "string",
            "description": "Customer's birthdate; format `YYYY-MM-DD`.",
            "format": "date"
          },
          "birthday": {
            "type": "string",
            "description": "`Deprecated`. ~~Customer's birthdate; format `YYYY-MM-DD`~~.",
            "format": "date"
          },
          "metadata": {
            "type": "object",
            "description": "A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments. "
          }
        }
      },
      "6_req_validate_voucher_order_id": {
        "title": "Order ID",
        "description": "You can pass the unique order ID that was assigned by Voucherify.",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request."
          }
        }
      },
      "6_req_validate_voucher_order_source_id": {
        "title": "Order Source ID",
        "description": "You can send the source ID that you used to create the order in Voucherify.",
        "type": "object",
        "properties": {
          "source_id": {
            "type": "string",
            "description": "Unique source ID of an existing order that will be linked to the redemption of this request."
          }
        }
      },
      "OrdersCreateRequestBody": {
        "title": "Orders Create Request Body",
        "type": "object",
        "description": "Request body schema for **POST** `v1/orders`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/Order"
          },
          {
            "title": "Order Customer And Referrer Ids Objects",
            "type": "object",
            "description": "Order information.",
            "properties": {
              "created_at": {
                "type": "string",
                "example": "2021-12-22T10:13:06.487Z",
                "description": "Timestamp representing the date and time when the order was created. The value is shown in the ISO 8601 format.",
                "format": "date-time"
              },
              "referrer_id": {
                "type": "string",
                "nullable": true,
                "description": "Unique referrer ID.",
                "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix"
              },
              "customer": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/Customer"
                  }
                ]
              },
              "referrer": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/Referrer"
                  }
                ]
              }
            }
          }
        ]
      },
      "2_obj_campaign_object_campaigns_qualification": {
        "type": "object",
        "title": "Campaign Object",
        "description": "This is an object representing a campaign.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique campaign ID, assigned by Voucherify.",
            "example": "camp_f7fBbQxUuTN7dI7tGOo5XMDA"
          },
          "name": {
            "type": "string",
            "description": "Campaign name."
          },
          "description": {
            "type": "string",
            "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details."
          },
          "campaign_type": {
            "type": "string",
            "enum": [
              "GIFT_VOUCHERS",
              "DISCOUNT_COUPONS",
              "REFERRAL_PROGRAM"
            ],
            "description": "Type of campaign."
          },
          "type": {
            "type": "string",
            "description": "Defines whether the campaign can be updated with new vouchers after campaign creation.    \n\n- `AUTO_UPDATE`: the campaign is dynamic, i.e. vouchers will generate based on set criteria    \n-  `STATIC`: vouchers need to be manually published",
            "enum": [
              "AUTO_UPDATE",
              "STATIC"
            ]
          },
          "voucher": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_DISCOUNT"
              },
              {
                "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_GIFT_CARD"
              },
              {
                "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_LOYALTY_CARD"
              }
            ]
          },
          "auto_join": {
            "type": "boolean",
            "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled."
          },
          "join_once": {
            "type": "boolean",
            "description": "If this value is set to `true`, customers will be able to join the campaign only once."
          },
          "use_voucher_metadata_schema": {
            "type": "boolean",
            "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema."
          },
          "validity_timeframe": {
            "$ref": "#/components/schemas/ValidityTimeframe"
          },
          "validity_day_of_week": {
            "$ref": "#/components/schemas/ValidityDayOfWeek"
          },
          "validity_hours": {
            "$ref": "#/components/schemas/ValidityHours"
          },
          "activity_duration_after_publishing": {
            "type": "string",
            "description": "Defines the amount of time the vouchers will be active after publishing. The value is shown in the ISO 8601 format. For example, a voucher with the value of P24D will be valid for a duration of 24 days."
          },
          "vouchers_count": {
            "type": "integer",
            "description": "Total number of unique vouchers in campaign."
          },
          "start_date": {
            "type": "string",
            "format": "date-time",
            "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ",
            "example": "2022-09-20T00:00:00.000Z"
          },
          "expiration_date": {
            "type": "string",
            "format": "date-time",
            "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format.  Campaign is *inactive after* this date.",
            "example": "2022-09-30T00:00:00.000Z"
          },
          "active": {
            "type": "boolean",
            "description": "A flag to toggle the campaign on or off. You can disable a campaign even though it's within the active period defined by the `start_date` and `expiration_date`.  \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign"
          },
          "metadata": {
            "type": "object",
            "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2021-12-01T08:00:50.038Z",
            "description": "Timestamp representing the date and time when the campaign was created. The value is shown in the ISO 8601 format."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "example": "2022-09-20T09:18:19.623Z",
            "description": "Timestamp representing the date and time when the voucher was updated. The value is shown in the ISO 8601 format."
          },
          "category": {
            "type": "string",
            "description": "Unique category name."
          },
          "creation_status": {
            "type": "string",
            "enum": [
              "DONE",
              "IN_PROGRESS",
              "FAILED",
              "DRAFT",
              "MODIFYING"
            ],
            "description": "Indicates the status of the campaign creation."
          },
          "vouchers_generation_status": {
            "type": "string",
            "description": "Indicates the status of the campaign's vouchers.",
            "enum": [
              "DONE",
              "IN_PROGRESS",
              "FAILED",
              "DRAFT"
            ]
          },
          "protected": {
            "type": "boolean",
            "description": "Indicates whether the resource can be deleted."
          },
          "validation_rules_assignments": {
            "type": "object",
            "description": "Stores information about validation rules assigned to the campaign.",
            "properties": {
              "object": {
                "type": "string",
                "description": "The type of the object represented is by default `list`.",
                "default": "list"
              },
              "data_ref": {
                "type": "string",
                "description": "Identifies the name of the attribute that contains the array of validation rule assignments.",
                "default": "data"
              },
              "data": {
                "type": "array",
                "description": "Array of validation rule assignment objects. Each validation rule assignment object contains details about the rule.",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "example": "asgm_N7t39epaQR2SkQcW",
                      "description": "Assigned by the Voucherify API, identifies the validation rule assignment."
                    },
                    "rule_id": {
                      "type": "string",
                      "example": "val_ssbxf1L9aKri",
                      "description": "Assigned by the Voucherify API, identifies the validation rule."
                    },
                    "related_object_id": {
                      "type": "string",
                      "example": "camp_AaP9MC1Y0GpBII84UTIuasvb",
                      "description": "ID of the object from which the rule originates."
                    },
                    "related_object_type": {
                      "type": "string",
                      "example": "campaign",
                      "description": "Which object does the rule originate from: the  `voucher` itself or inherited from its parent `campaign`."
                    },
                    "created_at": {
                      "type": "string",
                      "example": "2022-02-14T15:12:06.817Z",
                      "description": "Timestamp representing the date and time when the validation rule was created. The value is shown in the ISO 8601 format.",
                      "format": "date-time"
                    },
                    "object": {
                      "type": "string",
                      "default": "validation_rules_assignment",
                      "description": "The type of resource represented by the object. Default is `validation_rules_assignment`."
                    },
                    "rule": {
                      "type": "object",
                      "description": "Describes the details of the rule."
                    }
                  }
                }
              },
              "total": {
                "type": "integer",
                "description": "Total number of validation rules assigned to the campaign."
              }
            }
          },
          "category_id": {
            "type": "string",
            "description": "Unique category ID that this campaign belongs to.",
            "example": "cat_0b688929a2476386a7"
          },
          "categories": {
            "$ref": "#/components/schemas/Category"
          },
          "object": {
            "type": "string",
            "default": "campaign",
            "description": "The type of the object represented by JSON. This object stores information about the campaign."
          },
          "referral_program": {
            "type": "object",
            "description": "Defines the referee reward and the way a referral is triggered. Context: `REFERRAL_PROGRAM`.",
            "properties": {
              "conversion_event_type": {
                "type": "string",
                "enum": [
                  "redemption",
                  "custom_event"
                ],
                "description": "How a referral is triggered."
              },
              "custom_event": {
                "type": "object",
                "description": "Contains details about the custom event.",
                "properties": {
                  "id": {
                    "type": "string",
                    "example": "ms_fi47Dcu5T0m3v3nT5ch3ma",
                    "description": "Unique custom event ID."
                  },
                  "name": {
                    "type": "string",
                    "description": "Custom event name."
                  }
                }
              },
              "referee_reward": {
                "type": "object",
                "description": "Defines the referee reward.",
                "properties": {
                  "related_object_parent": {
                    "type": "object",
                    "description": "Details of the resource from which the reward originates.",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Unique ID of the reward source."
                      },
                      "name": {
                        "type": "string",
                        "description": "Name of the reward source."
                      },
                      "object": {
                        "type": "string",
                        "description": "Type of resource represented by the source of the reward."
                      }
                    }
                  },
                  "type": {
                    "type": "string",
                    "description": "Type of reward.",
                    "enum": [
                      "LOYALTY_CARD",
                      "GIFT_VOUCHER"
                    ]
                  },
                  "amount": {
                    "type": "string",
                    "description": "The number of `points` to add to a loyalty card or `credits` to the balance on a gift card. In case of the gift card, the value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000."
                  }
                }
              }
            }
          }
        }
      },
      "EmptyJson": {
        "type": "object",
        "description": "Schema model for an empty json.",
        "title": "Empty JSON"
      },
      "VoucherTransaction": {
        "title": "Voucher Transaction",
        "allOf": [
          {
            "$ref": "#/components/schemas/VoucherTransactionBase"
          },
          {
            "type": "object",
            "properties": {
              "details": {
                "type": "object",
                "description": "Contains the detailed information about the transaction.",
                "properties": {
                  "balance": {
                    "$ref": "#/components/schemas/VoucherBalance"
                  },
                  "order": {
                    "type": "object",
                    "description": "Contains information about the original order.",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Unique order ID."
                      },
                      "source_id": {
                        "type": "string",
                        "description": "The merchant's order ID if it is different from the Voucherify order ID. It is really useful in case of integration between multiple systems. It can be an order ID from CRM, database or 3rd party service."
                      }
                    },
                    "required": [
                      "id",
                      "source_id"
                    ]
                  },
                  "event": {
                    "type": "object",
                    "description": "Contains information about the event that triggers the point accrual.",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Unique event ID."
                      },
                      "type": {
                        "type": "string",
                        "description": "Type of event."
                      }
                    },
                    "required": [
                      "id",
                      "type"
                    ]
                  },
                  "earning_rule": {
                    "type": "object",
                    "description": "Contains information about the earning rule.",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Unique identifier of an earning rule, assigned by Voucherify."
                      },
                      "source": {
                        "type": "object",
                        "required": [
                          "banner"
                        ],
                        "description": "Contains the custom earning rule name.",
                        "properties": {
                          "banner": {
                            "type": "string",
                            "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard."
                          }
                        }
                      }
                    },
                    "required": [
                      "id",
                      "source"
                    ]
                  },
                  "segment": {
                    "type": "object",
                    "description": "Contains information about the segment.",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Unique identifier of the segment."
                      },
                      "name": {
                        "type": "string",
                        "description": "Name of the segment."
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ]
                  },
                  "loyalty_tier": {
                    "type": "object",
                    "description": "Contains information about the loyalty tier that is mapped for the earning rule and used in the transaction.",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Unique identifier of the loyalty tier, assigned by Voucherify."
                      },
                      "name": {
                        "type": "string",
                        "description": "User-defined name of the loyalty tier."
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ]
                  },
                  "redemption": {
                    "type": "object",
                    "description": "Contains information about the original redemption.",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Unique redemption ID."
                      }
                    },
                    "required": [
                      "id"
                    ]
                  },
                  "rollback": {
                    "type": "object",
                    "description": "Contains information about the redemption rollback.",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Unique identifier of the redemption rollback."
                      }
                    },
                    "required": [
                      "id"
                    ]
                  },
                  "custom_event": {
                    "type": "object",
                    "description": "Contains information about the custom event that triggers the point accrual.",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Unique identifier of the event."
                      },
                      "type": {
                        "type": "string",
                        "description": "Type of the custom event."
                      }
                    },
                    "required": [
                      "id",
                      "type"
                    ]
                  },
                  "event_schema": {
                    "type": "object",
                    "description": "Contains information about the custom event metadata schema.",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Unique identifier of the metadata schema."
                      },
                      "name": {
                        "type": "string",
                        "description": "Type of the custom event."
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ]
                  },
                  "holder_loyalty_tier": {
                    "type": "object",
                    "description": "Loyalty tier of the loyalty card holder at the moment when the transaction occurred. The loyalty tier is the tier in which the holder was before the loyalty point balance changed.",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Unique identifier of the loyalty tier, assigned by Voucherify."
                      },
                      "name": {
                        "type": "string",
                        "description": "User-defined name of the loyalty tier."
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ]
                  },
                  "pending_points": {
                    "$ref": "#/components/schemas/LoyaltyPendingPoints"
                  },
                  "reward": {
                    "type": "object",
                    "description": "Contains information about the pay with points reward.",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Unique reward ID."
                      },
                      "name": {
                        "type": "string",
                        "description": "Reward name."
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ]
                  },
                  "source_voucher": {
                    "description": "Contains information on how the balance on the donor loyalty card was affected by the transaction.",
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/SimpleVoucher"
                      }
                    ]
                  },
                  "destination_voucher": {
                    "description": "Contains information on how the balance on the receiving loyalty card was affected by the transaction.",
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/SimpleVoucher"
                      }
                    ]
                  }
                }
              },
              "type": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/GiftVoucherTransactionsType"
                  },
                  {
                    "$ref": "#/components/schemas/LoyaltyCardTransactionsType"
                  }
                ]
              }
            }
          }
        ]
      },
      "CampaignsTransactionsExportParameters": {
        "title": "Export Campaign Transactions",
        "type": "object",
        "properties": {
          "order": {
            "type": "string",
            "description": "How the export is ordered, where the dash `-` preceding a sorting option means sorting in a descending order.",
            "enum": [
              "-created_at",
              "created_at"
            ]
          },
          "fields": {
            "type": "array",
            "description": "Data fields that will be exported for the transactions that are associated with balance movements on cards in a campaign.",
            "items": {
              "type": "string",
              "enum": [
                "id",
                "type",
                "source_id",
                "reason",
                "balance",
                "amount",
                "created_at",
                "voucher_id",
                "source",
                "details",
                "related_transaction_id"
              ]
            }
          }
        }
      },
      "ExportCampaignTransactionsFilters": {
        "title": "Export Campaign Transactions Filters",
        "description": "Data filters and their conditions to narrow down the returned data.",
        "type": "object",
        "properties": {
          "junction": {
            "$ref": "#/components/schemas/Junction"
          },
          "created_at": {
            "type": "object",
            "properties": {
              "conditions": {
                "$ref": "#/components/schemas/FilterConditionsDateTime"
              }
            }
          },
          "voucher_id": {
            "type": "object",
            "properties": {
              "conditions": {
                "$ref": "#/components/schemas/FilterConditionsString"
              }
            }
          }
        }
      },
      "CampaignsTransactionsExport": {
        "title": "Campaigns Transactions Export",
        "type": "object",
        "description": "This is an object representing an export.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique export ID.",
            "example": "exp_FFfp9o7daWuJqJCKp5xqqli4"
          },
          "object": {
            "type": "string",
            "default": "export",
            "description": "The type of object being represented. This object stores information about the `export`.",
            "enum": [
              "export"
            ]
          },
          "created_at": {
            "type": "string",
            "example": "2022-04-28T11:23:20.922Z",
            "description": "Timestamp representing the date and time when the export was scheduled in ISO 8601 format.",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "description": "Status of the export. Informs you whether the export has already been completed, i.e. indicates whether the file containing the exported data has been generated.",
            "default": "SCHEDULED",
            "enum": [
              "SCHEDULED"
            ]
          },
          "channel": {
            "type": "string",
            "description": "The channel through which the export was triggered.",
            "default": "API",
            "enum": [
              "API"
            ]
          },
          "exported_object": {
            "type": "string",
            "description": "The type of exported object.",
            "default": "voucher_transactions",
            "enum": [
              "voucher_transactions"
            ]
          },
          "parameters": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CampaignsTransactionsExportParameters"
              },
              {
                "type": "object",
                "properties": {
                  "filters": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/ExportCampaignTransactionsFilters"
                      },
                      {
                        "$ref": "#/components/schemas/TransactionsExportFilterConditionsWithCampaign"
                      }
                    ]
                  }
                }
              }
            ]
          },
          "result": {
            "type": "object",
            "nullable": true,
            "description": "Contains the URL of the CSV file.",
            "required": [
              "url"
            ],
            "properties": {
              "url": {
                "type": "string",
                "description": "URL of the CSV file location. It contains the `token` used for authorization in the [Download export](/api-reference/exports/download-export) method."
              }
            }
          },
          "user_id": {
            "type": "string",
            "nullable": true,
            "description": "Identifies the specific user who initiated the export through the Voucherify Dashboard; returned when the `channel` value is `WEBSITE`.",
            "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH"
          }
        },
        "required": [
          "id",
          "object",
          "created_at",
          "status",
          "channel",
          "exported_object",
          "parameters",
          "result",
          "user_id"
        ]
      },
      "CampaignsSummaryDiscountCampaign": {
        "type": "object",
        "title": "Campaigns Summary - Discount Campaign details",
        "description": "Campaign summary data for discount campaigns.",
        "allOf": [
          {
            "$ref": "#/components/schemas/CampaignsSummaryCampaignBase"
          },
          {
            "$ref": "#/components/schemas/CampaignsSummaryVouchersPublications"
          },
          {
            "$ref": "#/components/schemas/CampaignsSummaryDiscounts"
          }
        ]
      },
      "CampaignsSummaryPromotionCampaign": {
        "type": "object",
        "title": "Campaigns Summary - Promotion Campaign details",
        "description": "Campaign summary data for promotion campaigns.",
        "allOf": [
          {
            "$ref": "#/components/schemas/CampaignsSummaryCampaignBase"
          },
          {
            "$ref": "#/components/schemas/CampaignsSummaryDiscounts"
          }
        ]
      },
      "CampaignsSummaryGiftCampaign": {
        "type": "object",
        "title": "Campaigns Summary - Gift Campaign details",
        "description": "Campaign summary data for gift campaigns.",
        "allOf": [
          {
            "$ref": "#/components/schemas/CampaignsSummaryCampaignBase"
          },
          {
            "$ref": "#/components/schemas/CampaignsSummaryVouchersPublications"
          },
          {
            "$ref": "#/components/schemas/CampaignsSummaryGift"
          }
        ]
      },
      "CampaignsSummaryLoyaltyCampaign": {
        "type": "object",
        "title": "Campaigns Summary - Loyalty Campaign details",
        "description": "Campaign summary data for loyalty campaigns.",
        "allOf": [
          {
            "$ref": "#/components/schemas/CampaignsSummaryCampaignBase"
          },
          {
            "$ref": "#/components/schemas/CampaignsSummaryVouchersPublications"
          },
          {
            "$ref": "#/components/schemas/CampaignsSummaryLoyalty"
          }
        ]
      },
      "CampaignsSummaryReferralCampaign": {
        "type": "object",
        "title": "Campaigns Summary - Referral Campaign details",
        "description": "Campaign summary data for referral campaigns.",
        "allOf": [
          {
            "$ref": "#/components/schemas/CampaignsSummaryCampaignBase"
          },
          {
            "$ref": "#/components/schemas/CampaignsSummaryVouchersPublications"
          },
          {
            "type": "object",
            "properties": {
              "referred_customers": {
                "type": "integer",
                "description": "Total number of all referred customers."
              }
            },
            "required": [
              "referred_customers"
            ]
          }
        ]
      },
      "CampaignsCreateBaseValidationRules": {
        "type": "object",
        "title": "Campaign Create Schema Base With Validation Rules",
        "description": "Base body schema for creating a campaign using **POST** `v1/campaigns`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/CampaignsCreateBase"
          },
          {
            "type": "object",
            "properties": {
              "validation_rules": {
                "type": "array",
                "description": "Array containing the ID of the validation rule associated with the promotion tier.",
                "items": {
                  "type": "string"
                },
                "maxItems": 1
              }
            }
          }
        ]
      },
      "DiscountCouponsCampaignVoucher": {
        "title": "Object representing voucher property for Discount Coupons Campaign",
        "properties": {
          "type": {
            "type": "string",
            "default": "DISCOUNT_VOUCHER",
            "description": "Type of voucher.",
            "enum": [
              "DISCOUNT_VOUCHER"
            ]
          },
          "discount": {
            "$ref": "#/components/schemas/Discount"
          },
          "code_config": {
            "$ref": "#/components/schemas/CodeConfig"
          },
          "redemption": {
            "type": "object",
            "description": "Defines the redemption limits on vouchers.",
            "properties": {
              "quantity": {
                "type": "integer",
                "nullable": true,
                "description": "How many times a voucher can be redeemed. A `null` value means unlimited."
              }
            }
          }
        },
        "required": [
          "type",
          "discount"
        ]
      },
      "ReferralProgram": {
        "title": "Referral Program",
        "description": "Defines the referee reward and the way a referral is triggered. Context: `REFERRAL_PROGRAM`.",
        "type": "object",
        "properties": {
          "conversion_event_type": {
            "type": "string",
            "enum": [
              "redemption",
              "custom_event"
            ],
            "description": "Define how a referral is triggered."
          },
          "custom_event": {
            "type": "object",
            "description": "Contains details about the custom event.",
            "properties": {
              "id": {
                "type": "string",
                "example": "ms_Ll9enAm2BCN0M1s4VxWobLFM",
                "description": "Unique custom event ID."
              },
              "name": {
                "type": "string",
                "description": "Custom event name."
              }
            }
          },
          "referee_reward": {
            "type": "object",
            "description": "Defines the referee reward.",
            "properties": {
              "related_object_parent": {
                "type": "object",
                "description": "Details of the resource from which the reward originates.",
                "properties": {
                  "id": {
                    "type": "string",
                    "example": "camp_kdxp3vf1clQ9CFs1jpqv3tZe",
                    "description": "Unique ID of the reward source."
                  },
                  "name": {
                    "type": "string",
                    "description": "Name of the reward source."
                  },
                  "object": {
                    "type": "string",
                    "default": "CAMPAIGN",
                    "enum": [
                      "CAMPAIGN"
                    ],
                    "description": "Type of resource represented by the source of the reward."
                  }
                }
              },
              "type": {
                "type": "string",
                "enum": [
                  "LOYALTY_CARD",
                  "GIFT_VOUCHER"
                ],
                "description": "Type of reward."
              },
              "amount": {
                "type": "integer",
                "description": "Define the number of `points` to add to a loyalty card or `credits` to the balance on a gift card. In case of the gift card, the value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000."
              }
            }
          }
        }
      },
      "ReferralCampaignVoucher": {
        "title": "Object representing voucher property for Referral Program",
        "properties": {
          "type": {
            "type": "string",
            "default": "DISCOUNT_VOUCHER",
            "description": "Type of voucher.",
            "enum": [
              "DISCOUNT_VOUCHER"
            ]
          },
          "discount": {
            "$ref": "#/components/schemas/Discount"
          },
          "code_config": {
            "$ref": "#/components/schemas/CodeConfig"
          },
          "redemption": {
            "type": "object",
            "description": "Defines the redemption limits on vouchers.",
            "properties": {
              "quantity": {
                "type": "integer",
                "nullable": true,
                "description": "How many times a voucher can be redeemed. A `null` value means unlimited."
              }
            }
          },
          "is_referral_code": {
            "type": "boolean",
            "description": "Flag indicating whether this voucher is a referral code; `true` for campaign type `REFERRAL_PROGRAM`."
          }
        },
        "required": [
          "type",
          "discount",
          "is_referral_code"
        ]
      },
      "GiftCampaignVoucher": {
        "type": "object",
        "description": "Schema model for a discount voucher.",
        "title": "Discount Voucher",
        "properties": {
          "type": {
            "type": "string",
            "description": "Type of voucher.",
            "default": "GIFT_VOUCHER",
            "enum": [
              "GIFT_VOUCHER"
            ]
          },
          "gift": {
            "$ref": "#/components/schemas/Gift"
          },
          "redemption": {
            "type": "object",
            "description": "Defines the redemption limits on vouchers.",
            "properties": {
              "quantity": {
                "type": "integer",
                "nullable": true,
                "description": "How many times a voucher can be redeemed. A `null` value means unlimited."
              }
            }
          },
          "code_config": {
            "$ref": "#/components/schemas/CodeConfig"
          }
        },
        "required": [
          "type",
          "gift"
        ]
      },
      "CampaignsCreateBase": {
        "type": "object",
        "title": "Campaign Create Schema Base",
        "description": "Base body schema for creating a campaign",
        "properties": {
          "name": {
            "type": "string",
            "description": "Campaign name."
          },
          "description": {
            "type": "string",
            "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details."
          },
          "type": {
            "type": "string",
            "description": "Defines whether the campaign can be updated with new vouchers after campaign creation or if the campaign consists of generic (standalone) vouchers.\n\n- `AUTO_UPDATE`: the campaign is dynamic, i.e. vouchers will generate based on set criteria\n-  `STATIC`: vouchers need to be manually published\n- `STANDALONE`: the campaign is a generic (standalone) one with a single voucher for public use (only for discount and gift card campaigns)",
            "enum": [
              "AUTO_UPDATE",
              "STATIC",
              "STANDALONE"
            ]
          },
          "join_once": {
            "type": "boolean",
            "description": "If this value is set to `true`, customers will be able to join the campaign only once. For loyalty campaigns, it's forced to `true`, even if `join_once: false` is passed in the request."
          },
          "auto_join": {
            "type": "boolean",
            "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled."
          },
          "use_voucher_metadata_schema": {
            "type": "boolean",
            "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema."
          },
          "vouchers_count": {
            "type": "integer",
            "description": "Total number of unique vouchers in campaign (size of campaign)."
          },
          "start_date": {
            "type": "string",
            "format": "date-time",
            "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ",
            "example": "2022-09-20T00:00:00.000Z"
          },
          "expiration_date": {
            "type": "string",
            "format": "date-time",
            "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format.  Campaign is *inactive after* this date.",
            "example": "2022-09-30T00:00:00.000Z"
          },
          "validity_timeframe": {
            "$ref": "#/components/schemas/ValidityTimeframe"
          },
          "validity_day_of_week": {
            "$ref": "#/components/schemas/ValidityDayOfWeek"
          },
          "validity_hours": {
            "$ref": "#/components/schemas/ValidityHours"
          },
          "activity_duration_after_publishing": {
            "type": "string",
            "description": "Defines the amount of time the vouchers will be active after publishing. The value is shown in the ISO 8601 format. For example, a voucher with the value of P24D will be valid for a duration of 24 days."
          },
          "category_id": {
            "type": "string",
            "description": "Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`.",
            "example": "cat_0b688929a2476386a7"
          },
          "category": {
            "type": "string",
            "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`."
          },
          "metadata": {
            "type": "object",
            "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format."
          },
          "access_settings": {
            "$ref": "#/components/schemas/AccessSettings"
          }
        }
      },
      "CampaignLoyaltyVoucher": {
        "type": "object",
        "description": "Schema model for a discount voucher.",
        "title": "Campaign Loyalty Voucher",
        "properties": {
          "type": {
            "type": "string",
            "default": "LOYALTY_CARD",
            "description": "Type of voucher.",
            "enum": [
              "LOYALTY_CARD"
            ]
          },
          "loyalty_card": {
            "$ref": "#/components/schemas/CampaignLoyaltyCard"
          },
          "redemption": {
            "type": "object",
            "description": "Defines the redemption limits on vouchers.",
            "properties": {
              "quantity": {
                "type": "integer",
                "nullable": true,
                "description": "How many times a voucher can be redeemed. A `null` value means unlimited."
              }
            }
          },
          "code_config": {
            "$ref": "#/components/schemas/CodeConfig"
          }
        },
        "required": [
          "type",
          "loyalty_card"
        ]
      },
      "PromotionTierCreateParams": {
        "type": "object",
        "description": "This is an object representing a promotion tier create params. Promotion tiers are always assigned to a campaign and cannot be used standalone.",
        "title": "Promotion Tier Create Params",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the promotion tier."
          },
          "banner": {
            "type": "string",
            "description": "Text to be displayed to your customers on your website."
          },
          "action": {
            "type": "object",
            "description": "Contains details about the discount applied by the promotion tier.",
            "properties": {
              "discount": {
                "$ref": "#/components/schemas/Discount"
              }
            }
          },
          "metadata": {
            "type": "object",
            "description": "The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format."
          },
          "validation_rules": {
            "type": "array",
            "description": "Array containing the ID of the validation rule associated with the promotion tier.",
            "items": {
              "type": "string"
            }
          },
          "active": {
            "type": "boolean",
            "description": "A flag to toggle the promotion tier on or off. You can disable a promotion tier even though it's within the active period defined by the `start_date` and `expiration_date`.  \n\n- `true` indicates an *active* promotion tier\n- `false` indicates an *inactive* promotion tier"
          },
          "hierarchy": {
            "type": "integer",
            "description": "The promotions hierarchy defines the order in which the discounts from different tiers will be applied to a customer's order. If a customer qualifies for discounts from more than one tier, discounts will be applied in the order defined in the hierarchy."
          },
          "start_date": {
            "type": "string",
            "description": "Activation timestamp defines when the promotion tier starts to be active in ISO 8601 format. Promotion tier is *inactive before* this date. ",
            "format": "date-time",
            "example": "2022-09-23T00:00:00.000Z"
          },
          "expiration_date": {
            "type": "string",
            "description": "Activation timestamp defines when the promotion tier expires in ISO 8601 format. Promotion tier is *inactive after* this date. ",
            "format": "date-time",
            "example": "2022-09-26T00:00:00.000Z"
          },
          "validity_timeframe": {
            "$ref": "#/components/schemas/ValidityTimeframe"
          },
          "validity_day_of_week": {
            "$ref": "#/components/schemas/ValidityDayOfWeek"
          },
          "validity_hours": {
            "$ref": "#/components/schemas/ValidityHours"
          },
          "category": {
            "type": "string",
            "description": "Assign category to the promotion tier."
          },
          "category_id": {
            "type": "string",
            "description": "Instead of using the category name, you can alternatively assign a new category to a promotion tier using a unique category ID, i.e. `cat_0c9da30e7116ba6bba`.",
            "example": "cat_0c9da30e7116ba6bba"
          }
        },
        "required": [
          "name"
        ]
      },
      "PromotionTiersList": {
        "type": "object",
        "description": "Promotion Tiers",
        "title": "Promotion Tiers",
        "properties": {
          "object": {
            "type": "string",
            "default": "list",
            "description": "The type of the object represented by JSON. This object stores information about promotion tiers in a dictionary."
          },
          "data_ref": {
            "type": "string",
            "default": "tiers",
            "description": "Identifies the name of the attribute that contains the array of promotion tier objects."
          },
          "tiers": {
            "type": "array",
            "description": "Contains array of promotion tier objects.",
            "items": {
              "$ref": "#/components/schemas/PromotionTier"
            }
          },
          "total": {
            "type": "integer",
            "description": "Total number of promotion tiers."
          },
          "has_more": {
            "type": "boolean",
            "description": "As query results are always limited (by the limit parameter), the `has_more` flag indicates if there are more records for given filter parameters. This lets you know if you can run another request to get more records returned in the results."
          }
        }
      },
      "ValidationRulesAssignmentsList": {
        "title": "Validation Rules Assignments List",
        "description": "List of Validation Rules Assignments",
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "default": "list",
            "enum": [
              "list"
            ],
            "description": "The type of the object represented by JSON. This object stores information about validation rules assignments."
          },
          "data_ref": {
            "type": "string",
            "default": "data",
            "enum": [
              "data"
            ],
            "description": "Identifies the name of the attribute that contains the array of validation rules assignments."
          },
          "data": {
            "type": "array",
            "description": "Contains array of validation rules assignments.",
            "items": {
              "$ref": "#/components/schemas/BusValRuleAssignment"
            }
          },
          "total": {
            "type": "integer",
            "minimum": 0,
            "description": "Total number of validation rules assignments."
          }
        },
        "required": [
          "object",
          "data_ref",
          "data",
          "total"
        ]
      },
      "CampaignVoucher": {
        "type": "object",
        "description": "Schema model for a campaign voucher.",
        "title": "Campaign Voucher",
        "properties": {
          "type": {
            "type": "string",
            "description": "Type of voucher."
          },
          "discount": {
            "description": "Defines the voucher discount type and details.",
            "allOf": [
              {
                "$ref": "#/components/schemas/Discount"
              }
            ]
          },
          "gift": {
            "description": "Defines the voucher gift details.",
            "allOf": [
              {
                "$ref": "#/components/schemas/Gift"
              }
            ]
          },
          "loyalty_card": {
            "description": "Defines the voucher loyalty card details.",
            "allOf": [
              {
                "$ref": "#/components/schemas/CampaignLoyaltyCard"
              }
            ]
          },
          "redemption": {
            "type": "object",
            "description": "Defines the redemption limits on vouchers.",
            "properties": {
              "quantity": {
                "type": "integer",
                "nullable": true,
                "description": "How many times a voucher can be redeemed. A `null` value means unlimited."
              }
            },
            "required": [
              "quantity"
            ]
          },
          "code_config": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CodeConfig"
              }
            ],
            "required": [
              "length",
              "charset",
              "pattern"
            ]
          },
          "is_referral_code": {
            "type": "boolean",
            "description": "Flag indicating whether this voucher is a referral code; `true` for campaign type `REFERRAL_PROGRAM`."
          },
          "start_date": {
            "type": "string",
            "format": "date-time",
            "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ",
            "example": "2022-09-20T00:00:00.000Z"
          },
          "expiration_date": {
            "type": "string",
            "format": "date-time",
            "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format.  Campaign is *inactive after* this date.",
            "example": "2022-09-30T00:00:00.000Z"
          },
          "validity_timeframe": {
            "$ref": "#/components/schemas/ValidityTimeframe"
          },
          "validity_day_of_week": {
            "$ref": "#/components/schemas/ValidityDayOfWeek"
          },
          "validity_hours": {
            "$ref": "#/components/schemas/ValidityHours"
          }
        },
        "required": [
          "type",
          "redemption",
          "code_config",
          "is_referral_code"
        ]
      },
      "ValidityTimeframe": {
        "title": "Validity Timeframe",
        "type": "object",
        "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.",
        "properties": {
          "duration": {
            "type": "string",
            "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.",
            "example": "PT1H"
          },
          "interval": {
            "type": "string",
            "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.",
            "example": "P2D"
          }
        }
      },
      "ValidityDayOfWeek": {
        "title": "Validity Day Of Week",
        "type": "array",
        "description": "Integer array corresponding to the particular days of the week in which the voucher is valid.\n\n- `0` Sunday\n- `1` Monday\n- `2` Tuesday\n- `3` Wednesday\n- `4` Thursday\n- `5` Friday\n- `6` Saturday",
        "items": {
          "type": "integer",
          "enum": [
            0,
            1,
            2,
            3,
            4,
            5,
            6
          ]
        }
      },
      "ValidityHours": {
        "title": "Validity Hours",
        "type": "object",
        "description": "Determines the hours of validity, e.g. to create a happy hours scenario.",
        "properties": {
          "daily": {
            "type": "array",
            "description": "Defines the recurring period(s) when the resource is active. The periods should not overlap.",
            "items": {
              "type": "object",
              "description": "Defines the recurring period(s) when the resource will be active.",
              "properties": {
                "start_time": {
                  "type": "string",
                  "format": "time",
                  "description": "Defines the starting hour of validity in the HH:mm format. The resource is *inactive before* this time.",
                  "example": "12:00"
                },
                "days_of_week": {
                  "type": "array",
                  "description": "Integer array corresponding to the particular days of the week in which the resource is valid.\n\n- `0` Sunday\n- `1` Monday\n- `2` Tuesday\n- `3`  Wednesday\n- `4` Thursday\n- `5` Friday\n- `6` Saturday",
                  "items": {
                    "type": "integer",
                    "enum": [
                      0,
                      1,
                      2,
                      3,
                      4,
                      5,
                      6
                    ]
                  }
                },
                "expiration_time": {
                  "type": "string",
                  "format": "time",
                  "description": "Defines the ending hour of validity in the HH:mm format. The resource is *inactive after* this time.",
                  "example": "14:00"
                }
              }
            }
          }
        }
      },
      "Category": {
        "title": "Category",
        "description": "This is an object representing a category.",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique category ID assigned by Voucherify."
          },
          "name": {
            "type": "string",
            "description": "Category name."
          },
          "hierarchy": {
            "type": "integer",
            "description": "Category hierarchy. Categories with lower hierarchy are processed before categories with higher hierarchy value.",
            "minimum": 0
          },
          "object": {
            "type": "string",
            "default": "category",
            "enum": [
              "category"
            ],
            "description": "The type of the object represented by the JSON. This object stores information about the category."
          },
          "created_at": {
            "type": "string",
            "description": "Timestamp representing the date and time when the category was created. The value is shown in the ISO 8601 format.",
            "example": "2022-07-14T10:45:13.156Z",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "example": "2022-08-16T10:52:08.094Z",
            "description": "Timestamp representing the date and time when the category was updated. The value is shown in the ISO 8601 format.",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "hierarchy",
          "created_at",
          "object"
        ]
      },
      "LoyaltyTiersExpirationAll": {
        "title": "Loyalty Tiers Expiration",
        "type": "object",
        "description": "Defines the Loyalty Tiers Expiration.",
        "properties": {
          "qualification_type": {
            "type": "string",
            "enum": [
              "BALANCE",
              "POINTS_IN_PERIOD"
            ],
            "description": "Tier qualification.   \n\n`BALANCE`: Points balance is based on the customer's current points balance. Customers qualify for the tier if their points balance is in the points range of the tier. \n `POINTS_IN_PERIOD`: A customer qualifies for the tier only if the sum of the accumulated points in a **defined time interval** reaches the tier threshold."
          },
          "qualification_period": {
            "type": "string",
            "description": "Customers can qualify for the tier if they collected enough points in a given time period. So, in addition to the customer having to reach a points range, they also need to have collected the points within a set time period.    \n\n| **Period** | **Definition** |\n|:---|:---|\n| **Calendar Month** | Points collected in one calendar month<br />January, February, March, etc. |\n| **Calendar Quarter** | Points collected in the quarter<br />- January - March<br />- April - June<br />- July - September<br />- October - December |\n| **Calendar Half-year** | Points collected in the half-year<br />- January - June<br />- July - December |\n| **Calendar Year** | Points collected in one calendar year<br />January - December |",
            "enum": [
              "MONTH",
              "QUARTER",
              "HALF_YEAR",
              "YEAR"
            ]
          },
          "start_date": {
            "type": "object",
            "description": "Defines the conditions for the start date of the tier.",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "IMMEDIATE",
                  "NEXT_PERIOD"
                ],
                "description": "What triggers the tier to be valid for a customer.    \n`IMMEDIATE`: After reaching the minimum required points. \n`NEXT_PERIOD`: When the next qualification period starts."
              }
            },
            "required": [
              "type"
            ]
          },
          "expiration_date": {
            "type": "object",
            "description": "Defines the conditions for the expiration date of a tier.",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "END_OF_PERIOD",
                  "END_OF_NEXT_PERIOD",
                  "BALANCE_DROP",
                  "CUSTOM"
                ],
                "description": "What triggers the tier to expire for a customer.    \n`END_OF_PERIOD`: Expire tier at the end of the period.    \n`END_OF_NEXT_PERIOD`:  Expire tier at the end of the next period. \n `BALANCE_DROP`: Tier expires when the points balance drops below the required range of the tier. \n `CUSTOM`: Tier expires after a certain time period passes following the instance the points balance drops below the required range of the tier."
              },
              "extend": {
                "type": "string",
                "description": "Extend the expiration by adding extra months or days in ISO 8601 format. The tier will remain active even though it reaches its expiration time period. For example, a tier with a duration of `P3M` will be valid for an additional duration of 3 months and a tier with a duration of `P1D` will be valid for an additional duration of 1 day."
              },
              "rounding": {
                "description": "Defines the rounding mechanism for tier expiration.",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "MONTH",
                      "QUARTER",
                      "HALF_YEAR",
                      "YEAR",
                      "CUSTOM"
                    ],
                    "description": "This mechanism describes a custom rounding for the expiration date."
                  },
                  "strategy": {
                    "type": "string",
                    "enum": [
                      "START",
                      "END"
                    ],
                    "description": "This mechanism describes a rounding strategy for the expiration date."
                  },
                  "unit": {
                    "type": "string",
                    "description": "Defines the type of unit of time in which the rounding period is counted.",
                    "default": "MONTH",
                    "enum": [
                      "MONTH"
                    ]
                  },
                  "value": {
                    "type": "integer",
                    "description": "Value for the unit of time that the rounding applies to. Units for this parameter are defined by the `rounding.unit` parameter.    \n- `0`: January\n- `1`: February\n- `2`: March\n- `3`: April\n- `4`: May\n- `5`: June\n- `6`: July\n- `7`: August\n- `8`: September\n- `9`: October\n- `10`: November\n- `11`: December"
                  }
                }
              }
            },
            "required": [
              "type",
              "extend"
            ]
          }
        },
        "required": [
          "qualification_type",
          "start_date",
          "expiration_date"
        ]
      },
      "AccessSettingsCampaignAssignmentsList": {
        "title": "Access Settings Campaign Assignments List",
        "type": "object",
        "description": "Lists all assignments of the campaign to areas and stores. For [GET List Campaigns](/api-reference/campaigns/list-campaigns), this is returned if the `expand=access_settings_assignments` query parameter is passed in the request. This object is not returned for the [GET Campaign summary endpoint](/api-reference/campaigns/get-campaign-summary).\n\n**NOTE**: This object is returned only if the Areas and Stores enterprise feature is enabled. Contact [Voucherify Sales](https://www.voucherify.io/contact-sales) to learn more.",
        "properties": {
          "object": {
            "type": "string",
            "default": "list",
            "description": "The type of the object represented by JSON. Default is `list`. This object stores information about campaign assignments to areas and stores",
            "enum": [
              "list"
            ]
          },
          "data_ref": {
            "type": "string",
            "default": "data",
            "description": "Identifies the name of the attribute that contains the array of campaign assignments.",
            "enum": [
              "data"
            ]
          },
          "data": {
            "type": "array",
            "description": "Contains an array of campaign assignments.",
            "items": {
              "$ref": "#/components/schemas/AreaStoreCampaignAssignment"
            }
          },
          "total": {
            "type": "integer",
            "description": "Total number of areas and stores to which the campaign is assigned.",
            "minimum": 0
          }
        },
        "required": [
          "object",
          "data_ref",
          "data",
          "total"
        ]
      },
      "CampaignsUpdateCouponCampaignBase": {
        "type": "object",
        "title": "Update Coupon Campaign Schema Base",
        "description": "Base body schema for updating a campaign which contains coupon codes using **PUT** `v1/campaigns`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/CampaignsUpdateBase"
          },
          {
            "type": "object",
            "properties": {
              "activity_duration_after_publishing": {
                "type": "string",
                "description": "Defines the amount of time the vouchers will be active after publishing. The value is shown in the ISO 8601 format. For example, a voucher with the value of P24D will be valid for a duration of 24 days."
              },
              "join_once": {
                "type": "boolean",
                "description": "If this value is set to `true`, customers will be able to join the campaign only once. It is always `false` for generic (standalone) vouchers campaigns and it cannot be changed in them. It is always `true` for loyalty campaigns and it cannot be changed in them."
              },
              "auto_join": {
                "type": "boolean",
                "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled."
              },
              "type": {
                "type": "string",
                "description": "Defines whether the campaign can be updated with new vouchers after campaign creation.\n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method).\n-  `STATIC`: vouchers need to be manually published.\n\nIf the `type` of the campaign is `STANDALONE`, the type cannot be changed. Also, the `type` cannot be changed to `STANDALONE`.",
                "enum": [
                  "AUTO_UPDATE",
                  "STATIC"
                ]
              }
            }
          }
        ]
      },
      "Discount": {
        "title": "Discount",
        "type": "object",
        "description": "Contains information about discount.",
        "oneOf": [
          {
            "$ref": "#/components/schemas/DiscountAmount"
          },
          {
            "$ref": "#/components/schemas/DiscountUnit"
          },
          {
            "$ref": "#/components/schemas/DiscountUnitMultiple"
          },
          {
            "$ref": "#/components/schemas/DiscountPercent"
          },
          {
            "$ref": "#/components/schemas/DiscountFixed"
          }
        ]
      },
      "Gift": {
        "title": "Gift",
        "type": "object",
        "description": "Contains current gift card balance information.",
        "properties": {
          "amount": {
            "type": "number",
            "description": "Total gift card income over the lifetime of the card. The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`."
          },
          "subtracted_amount": {
            "type": "integer",
            "description": "Total amount of subtracted credits over the gift card lifetime."
          },
          "balance": {
            "type": "number",
            "description": "Available funds. The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`. `balance` = `amount` - `subtracted_amount` - `redemption.redeemed_amount`."
          },
          "effect": {
            "type": "string",
            "description": "Defines how the credits are applied to the customer's order.",
            "enum": [
              "APPLY_TO_ORDER",
              "APPLY_TO_ITEMS"
            ]
          }
        },
        "required": [
          "amount",
          "balance"
        ]
      },
      "CampaignsUpdateBase": {
        "type": "object",
        "title": "Campaign Update Schema Base",
        "description": "Base body schema for creating a campaign using **PUT** `v1/campaigns`.",
        "properties": {
          "start_date": {
            "type": "string",
            "format": "date-time",
            "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ",
            "example": "2022-09-20T00:00:00.000Z"
          },
          "expiration_date": {
            "type": "string",
            "format": "date-time",
            "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format.  Campaign is *inactive after* this date.",
            "example": "2022-09-30T00:00:00.000Z"
          },
          "validity_timeframe": {
            "$ref": "#/components/schemas/ValidityTimeframe"
          },
          "validity_day_of_week": {
            "$ref": "#/components/schemas/ValidityDayOfWeek"
          },
          "validity_hours": {
            "$ref": "#/components/schemas/ValidityHours"
          },
          "description": {
            "type": "string",
            "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details."
          },
          "category": {
            "type": "string",
            "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`."
          },
          "metadata": {
            "type": "object",
            "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format."
          },
          "unset_metadata_fields": {
            "type": "array",
            "nullable": true,
            "description": "Determine which metadata should be removed from campaign.",
            "items": {
              "type": "string"
            }
          },
          "category_id": {
            "type": "string",
            "description": "Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`.",
            "example": "cat_0b688929a2476386a7"
          },
          "access_settings": {
            "$ref": "#/components/schemas/AccessSettings"
          }
        }
      },
      "VoucherBase": {
        "title": "Voucher Base",
        "description": "This is an object representing a voucher.",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "v_mkZN9v7vjYUadXnHrMza8W5c34fE5KiV",
            "description": "Assigned by the Voucherify API, identifies the voucher."
          },
          "code": {
            "type": "string",
            "example": "WVPblOYX",
            "description": "A code that identifies a voucher. Pattern can use all letters of the English alphabet, Arabic numerals, and special characters."
          },
          "campaign": {
            "type": "string",
            "example": "Gift Card Campaign",
            "description": "A unique campaign name, identifies the voucher's parent campaign."
          },
          "campaign_id": {
            "type": "string",
            "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV",
            "description": "Assigned by the Voucherify API, identifies the voucher's parent campaign."
          },
          "category": {
            "type": "string",
            "description": "Tag defining the category that this voucher belongs to. Useful when listing vouchers using the List Vouchers endpoint."
          },
          "category_id": {
            "type": "string",
            "description": "Unique category ID assigned by Voucherify.",
            "example": "cat_0bb343dee3cdb5ec0c"
          },
          "type": {
            "type": "string",
            "enum": [
              "GIFT_VOUCHER",
              "DISCOUNT_VOUCHER",
              "LOYALTY_CARD"
            ],
            "description": "Defines the type of the voucher. "
          },
          "discount": {
            "$ref": "#/components/schemas/Discount"
          },
          "gift": {
            "type": "object",
            "description": "Object representing gift parameters. Child attributes are present only if `type` is `GIFT_VOUCHER`. Defaults to `null`.",
            "properties": {
              "amount": {
                "type": "integer",
                "example": 10000,
                "description": "Total gift card income over the lifetime of the card. The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`."
              },
              "subtracted_amount": {
                "type": "integer",
                "description": "Total amount of subtracted credits over the gift card lifetime. The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`."
              },
              "balance": {
                "type": "integer",
                "example": 500,
                "description": "Available funds. The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`."
              },
              "effect": {
                "type": "string",
                "enum": [
                  "APPLY_TO_ORDER",
                  "APPLY_TO_ITEMS"
                ],
                "description": "Defines how the credits are applied to the customer's order."
              }
            }
          },
          "loyalty_card": {
            "type": "object",
            "description": "Object representing loyalty card parameters. Child attributes are present only if `type` is `LOYALTY_CARD`. Defaults to `null`.",
            "properties": {
              "points": {
                "type": "integer",
                "example": 7000,
                "description": "Total number of points added to the loyalty card over its lifespan."
              },
              "balance": {
                "type": "integer",
                "example": 6970,
                "description": "Points available for reward redemption. This is calculated as follows: `balance` = `points` - `expired_points` - `subtracted_points` - `redemption.redeemed_points`."
              },
              "next_expiration_date": {
                "type": "string",
                "format": "date",
                "example": "2023-05-30",
                "description": "The next closest date when the next set of points are due to expire."
              },
              "next_expiration_points": {
                "type": "integer",
                "description": "The amount of points that are set to expire next."
              },
              "pending_points": {
                "type": "integer",
                "description": "Shows the number of pending points that will be added to the loyalty card when they are activated automatically or manually."
              },
              "expired_points": {
                "type": "integer",
                "description": "Shows the total number of expired points over the lifetime of the loyalty card."
              },
              "subtracted_points": {
                "type": "integer",
                "description": "Shows the total number of subtracted points over the lifetime of the loyalty card."
              }
            }
          },
          "start_date": {
            "type": "string",
            "example": "2021-12-01T00:00:00.000Z",
            "format": "date-time",
            "description": "Activation timestamp defines when the code starts to be active in ISO 8601 format. Voucher is *inactive before* this date. "
          },
          "expiration_date": {
            "type": "string",
            "example": "2021-12-31T00:00:00.000Z",
            "format": "date-time",
            "description": "Expiration timestamp defines when the code expires in ISO 8601 format.  Voucher is *inactive after* this date."
          },
          "validity_timeframe": {
            "$ref": "#/components/schemas/ValidityTimeframe"
          },
          "validity_day_of_week": {
            "$ref": "#/components/schemas/ValidityDayOfWeek"
          },
          "validity_hours": {
            "$ref": "#/components/schemas/ValidityHours"
          },
          "active": {
            "type": "boolean",
            "nullable": true,
            "description": "A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`.  \n\n- `true` indicates an *active* voucher\n- `false` indicates an *inactive* voucher"
          },
          "additional_info": {
            "type": "string",
            "description": "An optional field to keep any extra textual information about the code such as a code description and details."
          },
          "metadata": {
            "type": "object",
            "description": "The metadata object stores all custom attributes assigned to the code. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format."
          },
          "assets": {
            "$ref": "#/components/schemas/VoucherAssets"
          },
          "is_referral_code": {
            "type": "boolean",
            "nullable": true,
            "description": "Flag indicating whether this voucher is a referral code; `true` for campaign type `REFERRAL_PROGRAM`."
          },
          "created_at": {
            "type": "string",
            "example": "2021-12-22T10:13:06.487Z",
            "description": "Timestamp representing the date and time when the voucher was created. The value is shown in the ISO 8601 format.",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "example": "2021-12-22T10:14:45.316Z",
            "format": "date-time",
            "description": "Timestamp representing the date and time when the voucher was last updated in ISO 8601 format."
          },
          "holder_id": {
            "type": "string",
            "example": "cust_eWgXlBBiY6THFRJwX45Iakv4",
            "description": "Unique customer identifier of the redeemable holder. It equals to the customer ID assigned by Voucherify."
          },
          "referrer_id": {
            "type": "string",
            "description": "Unique identifier of the referring person.",
            "example": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv"
          },
          "object": {
            "type": "string",
            "description": "The type of the object represented by JSON. Default is `voucher`.",
            "default": "voucher"
          },
          "publish": {
            "type": "object",
            "description": "Stores a summary of publication events: an event counter and endpoint to return details of each event. Publication is an assignment of a code to a customer, e.g. through a distribution.",
            "properties": {
              "object": {
                "type": "string",
                "default": "list",
                "description": "The type of the object represented is by default `list`. To get this list, you need to make a call to the endpoint returned in the `url` attribute."
              },
              "count": {
                "type": "integer",
                "example": 0,
                "description": "Publication events counter."
              },
              "url": {
                "type": "string",
                "example": "/v1/vouchers/WVPblOYX/publications?page=1&limit=10",
                "description": "The endpoint where this list of publications can be accessed using a **GET** method. `/v1/vouchers/{voucher_code}/publications`"
              }
            }
          },
          "redemption": {
            "type": "object",
            "description": "Stores a summary of redemptions that have been applied to the voucher.",
            "properties": {
              "quantity": {
                "type": "integer",
                "description": "How many times a voucher can be redeemed. A `null` value means unlimited."
              },
              "redeemed_quantity": {
                "type": "integer",
                "example": 1,
                "description": "How many times a voucher has already been redeemed."
              },
              "redeemed_points": {
                "type": "integer",
                "example": 100000,
                "description": "Total loyalty points redeemed."
              },
              "object": {
                "type": "string",
                "default": "list",
                "description": "The type of the object represented is by default `list`. To get this list, you need to make a call to the endpoint returned in the url attribute."
              },
              "url": {
                "type": "string",
                "example": "/v1/vouchers/WVPblOYX/redemptions?page=1&limit=10",
                "description": "The endpoint where this list of redemptions can be accessed using a **GET** method. `/v1/vouchers/{voucher_code}/redemptions`"
              }
            }
          }
        }
      },
      "VoucherImportLoyaltyCard": {
        "title": "Voucher Import Loyalty Card",
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/VoucherImportBase"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "default": "LOYALTY_CARD",
                "enum": [
                  "LOYALTY_CARD"
                ],
                "description": "Defines the type of the voucher. "
              },
              "loyalty_card": {
                "$ref": "#/components/schemas/SimpleLoyaltyCard"
              }
            },
            "required": [
              "loyalty_card"
            ]
          }
        ]
      },
      "VoucherImportGift": {
        "title": "Voucher Import Gift",
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/VoucherImportBase"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "default": "GIFT_VOUCHER",
                "enum": [
                  "GIFT_VOUCHER"
                ],
                "description": "Defines the type of the voucher. "
              },
              "gift": {
                "$ref": "#/components/schemas/Gift"
              }
            },
            "required": [
              "gift"
            ]
          }
        ]
      },
      "VoucherImportDiscount": {
        "title": "Voucher Import Discount",
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/VoucherImportBase"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "default": "DISCOUNT_VOUCHER",
                "enum": [
                  "DISCOUNT_VOUCHER"
                ],
                "description": "Defines the type of the voucher. "
              },
              "discount": {
                "$ref": "#/components/schemas/Discount"
              }
            },
            "required": [
              "discount"
            ]
          }
        ]
      },
      "Order": {
        "title": "Order",
        "type": "object",
        "description": "Order information.",
        "allOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request."
              }
            }
          },
          {
            "$ref": "#/components/schemas/OrderBase"
          }
        ]
      },
      "Customer": {
        "title": "Customer",
        "allOf": [
          {
            "type": "object",
            "title": "Customer Id And Source Id",
            "properties": {
              "id": {
                "type": "string",
                "description": "The ID of an existing customer."
              },
              "source_id": {
                "type": "string",
                "description": "A unique identifier of the customer who validates a voucher. It can be a customer ID or email from a CRM system, database, or a third-party service. If you also pass a customer ID (unique ID assigned by Voucherify), the source ID will be ignored."
              }
            }
          },
          {
            "$ref": "#/components/schemas/CustomerBase"
          }
        ]
      },
      "Referrer": {
        "title": "Referrer",
        "allOf": [
          {
            "$ref": "#/components/schemas/Customer"
          }
        ]
      },
      "2_obj_campaign_object_voucher_object_DISCOUNT": {
        "type": "object",
        "description": "Schema model for a discount voucher.",
        "title": "Discount Voucher",
        "properties": {
          "type": {
            "type": "string",
            "default": "DISCOUNT_VOUCHER",
            "description": "Type of voucher."
          },
          "discount": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/1_obj_voucher_object_discount_amount"
              },
              {
                "$ref": "#/components/schemas/1_obj_voucher_object_discount_percentage"
              },
              {
                "$ref": "#/components/schemas/1_obj_voucher_object_discount_fixed"
              },
              {
                "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_one"
              },
              {
                "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_multiple"
              },
              {
                "$ref": "#/components/schemas/1_obj_voucher_object_discount_shipping"
              }
            ],
            "description": "Defines the voucher discount type and details."
          },
          "redemption": {
            "type": "object",
            "description": "Defines the redemption limits on vouchers.",
            "properties": {
              "quantity": {
                "type": "integer",
                "description": "How many times a voucher can be redeemed. A `null` value means unlimited."
              }
            }
          },
          "code_config": {
            "type": "object",
            "description": "Defines code's pattern (prefix, suffix, length, charset, etc). ",
            "properties": {
              "length": {
                "type": "string",
                "description": "Number of characters in a generated code (excluding prefix and postfix)."
              },
              "charset": {
                "type": "string",
                "description": "Characters that can appear in the code.  \n\nExamples:\n\n- Alphanumeric: `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic: `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic Lowercase: `abcdefghijklmnopqrstuvwxyz` \n- Alphabetic Uppercase: `ABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Numbers: `0123456789`  \n- Custom: a custom character set"
              },
              "prefix": {
                "type": "string",
                "description": "A text appended before the code."
              },
              "postfix": {
                "type": "string",
                "description": "A text appended after the code."
              },
              "pattern": {
                "type": "string",
                "description": "A pattern for codes where hashes (#) will be replaced with random characters. Overrides `length`."
              }
            }
          },
          "is_referral_code": {
            "type": "boolean",
            "description": "Flag indicating whether this voucher is a referral code; `true` for campaign type `REFERRAL_PROGRAM`."
          }
        }
      },
      "2_obj_campaign_object_voucher_object_GIFT_CARD": {
        "type": "object",
        "description": "Schema model for a gift card.",
        "title": "Gift Card",
        "properties": {
          "type": {
            "type": "string",
            "default": "GIFT_VOUCHER",
            "description": "Type of voucher."
          },
          "gift": {
            "description": "Defines the gift card details.",
            "type": "object",
            "properties": {
              "amount": {
                "type": "integer",
                "description": "Initial gift card income to be applied to the gift card at voucher generation. The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`."
              },
              "effect": {
                "type": "string",
                "description": "Defines how the credits are applied to the customer's order.",
                "enum": [
                  "APPLY_TO_ORDER",
                  "APPLY_TO_ITEMS"
                ]
              }
            }
          },
          "redemption": {
            "type": "object",
            "description": "Defines the redemption limits on vouchers.",
            "properties": {
              "quantity": {
                "type": "integer",
                "description": "How many times a voucher can be redeemed. A `null` value means unlimited."
              }
            }
          },
          "code_config": {
            "type": "object",
            "description": "Defines code's pattern (prefix, suffix, length, charset, etc). ",
            "properties": {
              "length": {
                "type": "string",
                "description": "Number of characters in a generated code (excluding prefix and postfix)."
              },
              "charset": {
                "type": "string",
                "description": "Characters that can appear in the code.  \n\nExamples:\n\n- Alphanumeric: `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic: `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic Lowercase: `abcdefghijklmnopqrstuvwxyz` \n- Alphabetic Uppercase: `ABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Numbers: `0123456789`  \n- Custom: a custom character set"
              },
              "prefix": {
                "type": "string",
                "description": "A text appended before the code."
              },
              "postfix": {
                "type": "string",
                "description": "A text appended after the code."
              },
              "pattern": {
                "type": "string",
                "description": "A pattern for codes where hashes (#) will be replaced with random characters. Overrides `length`."
              }
            }
          },
          "is_referral_code": {
            "type": "boolean",
            "description": "Flag indicating whether this voucher is a referral code; `true` for campaign type `REFERRAL_PROGRAM`."
          }
        }
      },
      "2_obj_campaign_object_voucher_object_LOYALTY_CARD": {
        "type": "object",
        "description": "Schema model for a loyalty card.",
        "title": "Loyalty Card",
        "properties": {
          "type": {
            "type": "string",
            "default": "LOYALTY_CARD",
            "description": "Type of voucher."
          },
          "loyalty_card": {
            "description": "Defines the loyalty card details.",
            "type": "object",
            "properties": {
              "points": {
                "type": "integer",
                "description": "Initial loyalty card income in points to be applied to the loyalty card at voucher generation."
              },
              "expiration_rules": {
                "type": "object",
                "description": "Defines point expiration rules.",
                "properties": {
                  "period_type": {
                    "type": "string",
                    "default": "MONTH",
                    "enum": [
                      "MONTH"
                    ],
                    "description": "The expiration period."
                  },
                  "period_value": {
                    "type": "integer",
                    "description": "How many periods should pass before the expiration occurs."
                  },
                  "rounding_type": {
                    "type": "string",
                    "enum": [
                      "END_OF_MONTH",
                      "END_OF_QUARTER",
                      "END_OF_HALF_YEAR",
                      "END_OF_YEAR",
                      "PARTICULAR_MONTH"
                    ],
                    "description": "Round up expiration till the end of the given period type."
                  }
                }
              }
            }
          },
          "redemption": {
            "type": "object",
            "description": "Defines the redemption limits on vouchers.",
            "properties": {
              "quantity": {
                "type": "integer",
                "description": "How many times a voucher can be redeemed. A `null` value means unlimited."
              }
            }
          },
          "code_config": {
            "type": "object",
            "description": "Defines code's pattern (prefix, suffix, length, charset, etc). ",
            "properties": {
              "length": {
                "type": "string",
                "description": "Number of characters in a generated code (excluding prefix and postfix)."
              },
              "charset": {
                "type": "string",
                "description": "Characters that can appear in the code.  \n\nExamples:\n\n- Alphanumeric: `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic: `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic Lowercase: `abcdefghijklmnopqrstuvwxyz` \n- Alphabetic Uppercase: `ABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Numbers: `0123456789`  \n- Custom: a custom character set"
              },
              "prefix": {
                "type": "string",
                "description": "A text appended before the code."
              },
              "postfix": {
                "type": "string",
                "description": "A text appended after the code."
              },
              "pattern": {
                "type": "string",
                "description": "A pattern for codes where hashes (#) will be replaced with random characters. Overrides `length`."
              }
            }
          },
          "is_referral_code": {
            "type": "boolean",
            "description": "Flag indicating whether this voucher is a referral code; `true` for campaign type `REFERRAL_PROGRAM`."
          }
        }
      },
      "VoucherTransactionBase": {
        "title": "Voucher Transaction Base",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique transaction ID."
          },
          "source_id": {
            "type": "string",
            "nullable": true,
            "description": "The merchant's transaction ID if it is different from the Voucherify transaction ID. It is really useful in case of an integration between multiple systems. It can be a transaction ID from a CRM system, database or 3rd-party service. In case of a redemption, this value is null."
          },
          "voucher_id": {
            "type": "string",
            "description": "Unique voucher ID."
          },
          "campaign_id": {
            "type": "string",
            "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes."
          },
          "source": {
            "type": "string",
            "nullable": true,
            "description": "The channel through which the transaction took place, whether through the API or the Dashboard. In case of a redemption, this value is null."
          },
          "reason": {
            "type": "string",
            "nullable": true,
            "description": "Reason why the transaction occurred. In case of a redemption, this value is null."
          },
          "related_transaction_id": {
            "type": "string",
            "nullable": true,
            "description": "The related transaction ID on the receiving card."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp representing the date and time when the transaction was created. The value is shown in the ISO 8601 format."
          }
        },
        "required": [
          "id",
          "source_id",
          "voucher_id",
          "campaign_id",
          "source",
          "reason",
          "type",
          "details",
          "related_transaction_id",
          "created_at"
        ]
      },
      "VoucherBalance": {
        "type": "object",
        "title": "Voucher Balance",
        "description": "Contains information on how the balance was affected by the transaction.",
        "properties": {
          "type": {
            "type": "string",
            "description": "The type of voucher whose balance is being adjusted due to the transaction.",
            "enum": [
              "loyalty_card",
              "gift_voucher"
            ]
          },
          "total": {
            "type": "integer",
            "description": "The number of all points or credits accumulated on the card as affected by add or subtract operations."
          },
          "object": {
            "type": "string",
            "description": "The type of the object represented by the JSON.",
            "enum": [
              "balance"
            ]
          },
          "amount": {
            "type": "integer",
            "description": "Credits added or subtracted on a gift card."
          },
          "points": {
            "type": "integer",
            "description": "Points added or subtracted in the transaction of a loyalty card."
          },
          "balance": {
            "type": "integer",
            "description": "The available points or credits on the card after the transaction as affected by redemption or rollback."
          },
          "operation_type": {
            "type": "string",
            "description": "The type of the operation being performed. The operation type is `AUTOMATIC` if it is an automatic redemption.",
            "enum": [
              "MANUAL",
              "AUTOMATIC"
            ]
          },
          "related_object": {
            "type": "object",
            "required": [
              "id",
              "type"
            ],
            "description": "Defines the resource that is being modified with the values that are returned in the balance object.",
            "properties": {
              "id": {
                "type": "string",
                "description": "Identifies the voucher that is being modified. The ID is assigned by the Voucherify API."
              },
              "type": {
                "type": "string",
                "description": "The object being modified, i.e. voucher.",
                "enum": [
                  "voucher"
                ]
              }
            }
          }
        },
        "required": [
          "total",
          "object",
          "balance",
          "related_object"
        ]
      },
      "LoyaltyPendingPoints": {
        "type": "object",
        "title": "Loyalty Pending Point Entry",
        "description": "Contains details about the pending point entry.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier of the pending point entry, assigned by Voucherify.",
            "example": "lopp_0ffd593d5ad207ba6b"
          },
          "voucher_id": {
            "type": "string",
            "description": "Unique identifier of the loyalty card, assigned by Voucherify.",
            "example": "v_abCdEfghI1JKLMNPqRS2Tu3vWXyza4bc"
          },
          "campaign_id": {
            "type": "string",
            "description": "Unique campaign identifier, assigned by Voucherify.",
            "example": "camp_weer1c3p5ZgktqfW56RfoNaG"
          },
          "customer_id": {
            "type": "string",
            "description": "Unique customer identifier, assigned by Voucherify.",
            "example": "cust_IdgAFZxYwwHctOk9ppZMu319"
          },
          "order_id": {
            "type": "string",
            "description": "Unique order identifier, assigned by Voucherify.",
            "example": "ord_0ffc0fa65f15d2df17"
          },
          "points": {
            "type": "integer",
            "description": "Number of points in the pending state."
          },
          "activates_at": {
            "type": "string",
            "description": "Date when the pending points are activated and added to the customer's loyalty card.",
            "format": "date"
          },
          "details": {
            "$ref": "#/components/schemas/LoyaltyPendingPointsDetails"
          },
          "created_at": {
            "type": "string",
            "description": "Timestamp representing the date and time when the pending point entry was created. The value is shown in the ISO 8601 format.",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "description": "Timestamp representing the date and time when the pending point entry was modified. The value is shown in the ISO 8601 format.",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "voucher_id",
          "campaign_id",
          "customer_id",
          "order_id",
          "points",
          "activates_at",
          "details",
          "created_at"
        ]
      },
      "SimpleVoucher": {
        "type": "object",
        "title": "Simple Voucher",
        "description": "Simplified voucher data.",
        "properties": {
          "id": {
            "type": "string",
            "description": "A unique identifier that represents the voucher assigned by Voucherify."
          },
          "code": {
            "type": "string",
            "description": "Voucher code."
          },
          "gift": {
            "description": "Gift object response.",
            "allOf": [
              {
                "$ref": "#/components/schemas/Gift"
              }
            ]
          },
          "discount": {
            "$ref": "#/components/schemas/Discount"
          },
          "loyalty_card": {
            "description": "Defines the loyalty card details.",
            "type": "object",
            "allOf": [
              {
                "$ref": "#/components/schemas/SimpleLoyaltyCard"
              }
            ]
          },
          "type": {
            "type": "string",
            "description": "Type of the voucher.",
            "enum": [
              "DISCOUNT_VOUCHER",
              "LOYALTY_CARD",
              "GIFT_VOUCHER"
            ]
          },
          "campaign": {
            "type": "string",
            "description": "Campaign name."
          },
          "campaign_id": {
            "type": "string",
            "description": "Campaign unique ID."
          },
          "is_referral_code": {
            "type": "boolean",
            "description": "Flag indicating whether this voucher is a referral code; `true` for campaign type `REFERRAL_PROGRAM`."
          },
          "holder_id": {
            "type": "string",
            "example": "cust_eWgXlBBiY6THFRJwX45Iakv4",
            "description": "Unique customer identifier of the redeemable holder. It equals to the customer ID assigned by Voucherify."
          },
          "referrer_id": {
            "type": "string",
            "description": "Unique identifier of the referrer assigned by Voucherify.",
            "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix"
          },
          "category_id": {
            "type": "string",
            "nullable": true,
            "description": "Unique identifier of the category that this voucher belongs to.",
            "example": "cat_0b6152ce12414820dc"
          },
          "categories": {
            "type": "array",
            "description": "Contains details about the category.",
            "items": {
              "$ref": "#/components/schemas/Category"
            }
          },
          "active": {
            "type": "boolean",
            "description": "Shows whether the voucher is on or off. `true` indicates an *active* voucher and `false` indicates an *inactive* voucher."
          },
          "created_at": {
            "type": "string",
            "example": "2021-12-22T10:13:06.487Z",
            "description": "Timestamp representing the date and time when the order was created in the ISO 8601 format.",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "example": "2024-01-01T11:11:11.111Z",
            "description": "Timestamp representing the date and time when the order was created. The value is shown in the ISO 8601 format.",
            "format": "date-time"
          },
          "redemption": {
            "type": "object",
            "description": "Defines the redemption limits on vouchers.",
            "properties": {
              "quantity": {
                "type": "integer",
                "nullable": true,
                "description": "How many times a voucher can be redeemed. A `null` value means unlimited."
              },
              "redeemed_quantity": {
                "type": "integer",
                "example": 1,
                "description": "How many times a voucher has already been redeemed."
              },
              "redeemed_points": {
                "type": "integer",
                "description": "Total loyalty points redeemed."
              }
            },
            "required": [
              "quantity",
              "redeemed_quantity"
            ]
          },
          "start_date": {
            "type": "string",
            "example": "2021-12-01T00:00:00.000Z",
            "format": "date-time",
            "description": "Activation timestamp defines when the code starts to be active in ISO 8601 format. Voucher is *inactive before* this date."
          },
          "expiration_date": {
            "type": "string",
            "example": "2021-12-31T00:00:00.000Z",
            "format": "date-time",
            "description": "Expiration timestamp defines when the code expires in ISO 8601 format.  Voucher is *inactive after* this date."
          },
          "metadata": {
            "type": "object",
            "description": "A set of custom key/value pairs that you can attach to a voucher. The metadata object stores all custom attributes assigned to the voucher."
          },
          "object": {
            "type": "string",
            "description": "The type of the object represented by JSON.",
            "default": "voucher",
            "enum": [
              "voucher"
            ]
          }
        },
        "required": [
          "type",
          "code",
          "created_at",
          "object"
        ]
      },
      "GiftVoucherTransactionsType": {
        "title": "Gift Card Transactions Type",
        "type": "string",
        "description": "Transaction types concerning gift card credits.",
        "enum": [
          "CREDITS_REDEMPTION",
          "CREDITS_REFUND",
          "CREDITS_ADDITION",
          "CREDITS_REMOVAL"
        ]
      },
      "LoyaltyCardTransactionsType": {
        "title": "Loyalty Card Transactions Type",
        "type": "string",
        "description": "Transaction types concerning loyalty points.",
        "enum": [
          "PENDING_POINTS_ACTIVATION",
          "POINTS_ACCRUAL",
          "POINTS_REDEMPTION",
          "POINTS_REFUND",
          "POINTS_ADDITION",
          "POINTS_REMOVAL",
          "POINTS_EXPIRATION",
          "POINTS_TRANSFER_IN",
          "POINTS_TRANSFER_OUT"
        ]
      },
      "TransactionsExportFilterConditionsWithCampaign": {
        "description": "Filter condition.",
        "title": "Filter by Campaign ID",
        "type": "object",
        "required": [
          "campaign_id"
        ],
        "properties": {
          "campaign_id": {
            "type": "object",
            "required": [
              "conditions"
            ],
            "description": "Data filters used to narrow down the data records to be returned in the result.",
            "properties": {
              "conditions": {
                "type": "object",
                "required": [
                  "$in"
                ],
                "description": "Data filters used to narrow down the data records to be returned in the result.",
                "properties": {
                  "$in": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 1,
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 1
                    }
                  }
                }
              }
            }
          }
        }
      },
      "CampaignsSummaryCampaignBase": {
        "type": "object",
        "description": "Contains the basic information about any type of campaign.",
        "properties": {
          "object": {
            "type": "string",
            "description": "The type of the object, which is `campaign_summary`.",
            "default": "campaign_summary",
            "enum": [
              "campaign_summary"
            ]
          },
          "campaign": {
            "$ref": "#/components/schemas/CampaignBase"
          },
          "redemptions": {
            "type": "integer",
            "description": "Total number of redemptions, which includes successful and failed redemptions."
          },
          "redemptions_succeeded": {
            "type": "integer",
            "description": "Total number of successful redemptions."
          },
          "redemptions_failed": {
            "type": "integer",
            "description": "Total number of failed redemptions."
          },
          "rollbacks": {
            "type": "integer",
            "description": "Total number of rollbacks, which includes successful and failed rollbacks."
          },
          "rollbacks_succeeded": {
            "type": "integer",
            "description": "Total number of successful rollbacks."
          },
          "rollbacks_failed": {
            "type": "integer",
            "description": "Total number of failed rollbacks."
          },
          "validations": {
            "type": "integer",
            "description": "Total number of validations, which includes successful and failed validations."
          },
          "validations_succeeded": {
            "type": "integer",
            "description": "Total number of successful validations."
          },
          "validations_failed": {
            "type": "integer",
            "description": "Total number of failed validations."
          },
          "orders_amount": {
            "type": "integer",
            "description": "Total amount of orders related to the campaign. This amount is not reduced by `orders_rolledback_amount`. The value is multiplied by `100` to precisely represent 2 decimal places. For example, `$10` is represented as `1000`."
          },
          "orders_rolledback_amount": {
            "type": "integer",
            "description": "Total amount of orders that were rolled back and are related to the campaign. The value is multiplied by `100` to precisely represent 2 decimal places. For example, `$10` is represented as `1000`."
          }
        },
        "required": [
          "object",
          "campaign",
          "redemptions",
          "redemptions_succeeded",
          "redemptions_failed",
          "rollbacks",
          "rollbacks_succeeded",
          "rollbacks_failed",
          "validations",
          "validations_succeeded",
          "validations_failed",
          "orders_amount",
          "orders_rolledback_amount"
        ]
      },
      "CampaignsSummaryVouchersPublications": {
        "type": "object",
        "properties": {
          "vouchers_created": {
            "type": "integer",
            "description": "Total number of vouchers created within the campaign. Includes vouchers generated when the campaign was created, vouchers added manually, or vouchers generated automatically when a new customer joined the campaign."
          },
          "vouchers_deleted": {
            "type": "integer",
            "description": "Total number of vouchers deleted within the campaign. Includes vouchers moved to the bin and vouchers deleted permanently. Vouchers moved to the bin and then deleted permanently are counted once."
          },
          "publications": {
            "type": "integer",
            "description": "Total number of publications, which includes successful and failed publications."
          },
          "publications_succeeded": {
            "type": "integer",
            "description": "Total number of successful publications."
          },
          "publications_failed": {
            "type": "integer",
            "description": "Total number of failed publications."
          }
        },
        "required": [
          "vouchers_created",
          "vouchers_deleted",
          "publications",
          "publications_succeeded",
          "publications_failed"
        ]
      },
      "CampaignsSummaryDiscounts": {
        "type": "object",
        "properties": {
          "discounted_amount": {
            "type": "integer",
            "description": "Total amount of discounts related to the campaign. This amount is not reduced by the `rolledback_discounted_amount`. The value is multiplied by `100` to precisely represent 2 decimal places. For example, `$10` is represented as `1000`."
          },
          "rolledback_discounted_amount": {
            "type": "integer",
            "description": "Total amount of discounts orders that were rolled back and are related to the campaign. The value is multiplied by `100` to precisely represent 2 decimal places. For example, `$10` is represented as `1000`."
          }
        },
        "required": [
          "discounted_amount",
          "rolledback_discounted_amount"
        ]
      },
      "CampaignsSummaryGift": {
        "type": "object",
        "description": "",
        "properties": {
          "created_vouchers_amount": {
            "type": "integer",
            "description": "The total credit amount for all created gift cards. The value is multiplied by `100` to precisely represent 2 decimal places. For example, `$10` is represented as `1000`."
          },
          "amount_added": {
            "type": "integer",
            "description": "The total credit amount that was added. The value is multiplied by `100` to precisely represent 2 decimal places. For example, `$10` is represented as `1000`."
          },
          "amount_deleted": {
            "type": "integer",
            "description": "The total credit amount that was deleted by deleting gift cards. The value is multiplied by `100` to precisely represent 2 decimal places. For example, `$10` is represented as `1000`."
          },
          "amount_redeemed": {
            "type": "integer",
            "description": "The total credit amount that was redeemed. This amount is not reduced by the `amount_rolledback`. The value is multiplied by `100` to precisely represent 2 decimal places. For example, `$10` is represented as `1000`."
          },
          "amount_rolledback": {
            "type": "integer",
            "description": "The total credit amount that was rolled back. The value is multiplied by `100` to precisely represent 2 decimal places. For example, `$10` is represented as `1000`."
          },
          "amount_subtracted": {
            "type": "integer",
            "description": "The total credit amount that was subtracted. The value is multiplied by `100` to precisely represent 2 decimal places. For example, `$10` is represented as `1000`."
          }
        },
        "required": [
          "created_vouchers_amount",
          "amount_added",
          "amount_deleted",
          "amount_redeemed",
          "amount_rolledback",
          "amount_subtracted"
        ]
      },
      "CampaignsSummaryLoyalty": {
        "type": "object",
        "properties": {
          "created_vouchers_points": {
            "type": "integer",
            "description": "Total number of points added to newly created loyalty cards. This also counts points added for the loyalty cards which are created by importing a CSV file to a campaign."
          },
          "points_deleted": {
            "type": "integer",
            "description": "Total number of points that were deleted."
          },
          "points_subtracted": {
            "type": "integer",
            "description": "Total number of points that were subtracted."
          },
          "points_added": {
            "type": "integer",
            "description": "Total number of points that were added. This includes points added manually or automatically by redeeming a reward that adds loyalty points to cards in this campaign."
          },
          "points_rewarded": {
            "type": "integer",
            "description": "Total number of points that were rewarded to loyalty cards through earning rules. This includes pending points that were activated."
          },
          "points_redeemed": {
            "type": "integer",
            "description": "Total number of points that were redeemed for rewards."
          },
          "points_rolledback": {
            "type": "integer",
            "description": "Total number of points that were rolled back for reward redemptions."
          },
          "points_expired": {
            "type": "integer",
            "description": "Total number of points that have expired."
          },
          "points_transferred_out": {
            "type": "integer",
            "description": "Total number of points transferred out of loyalty cards covered by the campaign."
          },
          "points_transferred_in": {
            "type": "integer",
            "description": "Total number of points transferred into loyalty cards covered by the campaign."
          },
          "pending_points_added": {
            "type": "integer",
            "description": "Total number of pending points that were added either as part of earning rules or added manually to an existing pending point bucket. Pending points that were activated manually or automatically or that were canceled do not affect this number."
          },
          "pending_points_subtracted": {
            "type": "integer",
            "description": "Total number of pending points that were subtracted from existing pending point buckets."
          },
          "pending_points_activated": {
            "type": "integer",
            "description": "Total number of pending points that were activated manually or automatically."
          },
          "pending_points_canceled": {
            "type": "integer",
            "description": "Total number of pending points that were canceled."
          }
        },
        "required": [
          "created_vouchers_points",
          "points_deleted",
          "points_subtracted",
          "points_added",
          "points_rewarded",
          "points_redeemed",
          "points_rolledback",
          "points_expired",
          "points_transferred_out",
          "points_transferred_in",
          "orders_amount",
          "orders_rolledback_amount",
          "pending_points_added",
          "pending_points_subtracted",
          "pending_points_activated",
          "pending_points_canceled"
        ]
      },
      "AccessSettings": {
        "type": "object",
        "title": "Access Settings",
        "description": "Assigns or unassigns an area or store to the campaign.\n\n**NOTE**: this object can be sent if the Areas and Stores enterprise feature is enabled. Contact [Voucherify Sales](https://www.voucherify.io/contact-sales) to learn more.",
        "properties": {
          "assign": {
            "type": "object",
            "description": "Assigns the campaign to an area or a store. Provide the area and/or store IDs in the respective arrays. If a campaign changes assignments between areas or stores, unassign it from the area. For example, if a campaign is assigned to Area-01, but it must be now assigned to Store-01 within this area, you have to unassign the campaign from Area-01 and assign to Store-01 only.\n\nIf you want to assign the campaign to stores only, you do not have to send the area ID.",
            "properties": {
              "areas_ids": {
                "type": "array",
                "description": "List all area IDs to which the campaign will be assigned.",
                "items": {
                  "type": "string"
                }
              },
              "area_stores_ids": {
                "type": "array",
                "description": "List all store IDs to which the campaign will be assigned.",
                "items": {
                  "type": "string"
                }
              },
              "area_all_stores_ids": {
                "type": "array",
                "description": "List all area IDs where the campaign is assigned to all stores in the area. This assignment is not equal to the assignment to all `area_stores_ids` listed separately.",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "unassign": {
            "type": "object",
            "description": "Unassigns the campaign from an area or a store. Provide the area and/or store IDs in the respective arrays. If a campaign changes assignments between areas or stores, unassign it first. For example, if a campaign is assigned to Area-01, but it must be now assigned to Store-01 within this area, you have to unassign the campaign from Area-01 and assigned to Store-01 only.\n\nIf you want to assign the campaign to stores only, you do not have to send the area ID.",
            "properties": {
              "areas_ids": {
                "type": "array",
                "description": "List all area IDs from which the campaign will be unassigned.",
                "items": {
                  "type": "string"
                }
              },
              "area_stores_ids": {
                "type": "array",
                "description": "List all store IDs from which the campaign will be unassigned.",
                "items": {
                  "type": "string"
                }
              },
              "area_all_stores_ids": {
                "type": "array",
                "description": "List all area IDs where the campaign will be unassigned from all stores in the area. This unassignment is not equal to the unassignment from all `area_stores_ids` listed separately.",
                "items": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "CampaignLoyaltyCard": {
        "type": "object",
        "description": "Schema model for a campaign loyalty card.",
        "title": "Campaign Loyalty Card",
        "properties": {
          "points": {
            "type": "integer",
            "description": "The initial number of points to assign to the loyalty card. This is the current loyalty card score i.e. the number of loyalty points on the card."
          },
          "expiration_rules": {
            "type": "object",
            "description": "Defines the loyalty point expiration rule. This expiration rule applies when there are no `expiration_rules` defined for an earning rule.",
            "properties": {
              "period_type": {
                "type": "string",
                "description": "Type of period. Can be set for `MONTH` or `FIXED_DAY_OF_YEAR`. `MONTH` requires the `period_value` field. `FIXED_DAY_OF_YEAR` requires the `fixed_month` and `fixed_day` fields.",
                "enum": [
                  "FIXED_DAY_OF_YEAR",
                  "MONTH"
                ]
              },
              "period_value": {
                "type": "integer",
                "description": "Value of the period. Required for the `period_type: MONTH`."
              },
              "rounding_type": {
                "type": "string",
                "description": "Type of rounding of the expiration period. Optional for the `period_type: MONTH`.",
                "enum": [
                  "END_OF_MONTH",
                  "END_OF_QUARTER",
                  "END_OF_HALF_YEAR",
                  "END_OF_YEAR",
                  "PARTICULAR_MONTH"
                ]
              },
              "rounding_value": {
                "type": "integer",
                "description": "Value of rounding of the expiration period. Required for the `rounding_type`."
              },
              "fixed_month": {
                "type": "integer",
                "description": "Determines the month when the points expire; `1` is January, `2` is February, and so on. Required for the `period_type: FIXED_DAY_OF_YEAR`.",
                "minimum": 1,
                "maximum": 12
              },
              "fixed_day": {
                "type": "integer",
                "description": "Determines the day of the month when the points expire. Required for the `period_type: FIXED_DAY_OF_YEAR`.",
                "minimum": 1,
                "maximum": 31
              }
            },
            "required": [
              "period_type"
            ]
          }
        },
        "required": [
          "points"
        ]
      },
      "PromotionTier": {
        "type": "object",
        "description": "This is an object representing a promotion tier. Promotion tiers are always assigned to a campaign and cannot be used standalone.",
        "title": "Promotion Tier",
        "properties": {
          "id": {
            "type": "string",
            "example": "promo_63fYCt81Aw0h7lzyRkrGZh9p",
            "description": "Unique promotion tier ID."
          },
          "created_at": {
            "type": "string",
            "example": "2021-12-15T11:34:01.333Z",
            "format": "date-time",
            "description": "Timestamp representing the date and time when the promotion tier was created. The value is shown in the ISO 8601 format."
          },
          "updated_at": {
            "type": "string",
            "example": "2022-02-09T09:20:05.603Z",
            "format": "date-time",
            "description": "Timestamp representing the date and time when the promotion tier was updated. The value is shown in the ISO 8601 format."
          },
          "name": {
            "type": "string",
            "description": "Name of the promotion tier."
          },
          "banner": {
            "type": "string",
            "description": "Text to be displayed to your customers on your website."
          },
          "action": {
            "type": "object",
            "description": "Contains details about the discount applied by the promotion tier.",
            "properties": {
              "discount": {
                "$ref": "#/components/schemas/Discount"
              }
            }
          },
          "metadata": {
            "type": "object",
            "description": "The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format."
          },
          "hierarchy": {
            "type": "integer",
            "description": "The promotions hierarchy defines the order in which the discounts from different tiers will be applied to a customer's order. If a customer qualifies for discounts from more than one tier, discounts will be applied in the order defined in the hierarchy."
          },
          "promotion_id": {
            "type": "string",
            "description": "Promotion unique ID."
          },
          "campaign": {
            "type": "object",
            "description": "Contains details about promotion tier's parent campaign.",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique campaign ID."
              },
              "start_date": {
                "type": "string",
                "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ",
                "format": "date-time",
                "example": "2022-09-22T00:00:00.000Z"
              },
              "expiration_date": {
                "type": "string",
                "format": "date-time",
                "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format.  Campaign is *inactive after* this date.",
                "example": "2022-09-30T00:00:00.000Z"
              },
              "validity_timeframe": {
                "$ref": "#/components/schemas/ValidityTimeframe"
              },
              "validity_day_of_week": {
                "$ref": "#/components/schemas/ValidityDayOfWeek"
              },
              "validity_hours": {
                "$ref": "#/components/schemas/ValidityHours"
              },
              "active": {
                "type": "boolean",
                "description": "A flag indicating whether the campaign is active or not active. A campaign can be disabled even though it's within the active period defined by the `start_date` and `expiration_date` using the [Disable Campaign](/api-reference/disable-campaign) endpoint.  \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign"
              },
              "category_id": {
                "type": "string",
                "example": "cat_0b688929a2476386a6",
                "description": "Unique category ID that this campaign belongs to."
              },
              "object": {
                "type": "string",
                "description": "The type of the object represented by the campaign object. This object stores information about the campaign.",
                "default": "campaign"
              }
            }
          },
          "campaign_id": {
            "type": "string",
            "description": "Promotion tier's parent campaign's unique ID."
          },
          "active": {
            "type": "boolean",
            "description": "A flag to toggle the promotion tier on or off. You can disable a promotion tier even though it's within the active period defined by the `start_date` and `expiration_date`.  \n\n- `true` indicates an *active* promotion tier\n- `false` indicates an *inactive* promotion tier"
          },
          "start_date": {
            "type": "string",
            "description": "Activation timestamp defines when the promotion tier starts to be active in ISO 8601 format. Promotion tier is *inactive before* this date. ",
            "format": "date-time",
            "example": "2022-09-23T00:00:00.000Z"
          },
          "expiration_date": {
            "type": "string",
            "description": "Activation timestamp defines when the promotion tier expires in ISO 8601 format. Promotion tier is *inactive after* this date. ",
            "format": "date-time",
            "example": "2022-09-26T00:00:00.000Z"
          },
          "validity_timeframe": {
            "$ref": "#/components/schemas/ValidityTimeframe"
          },
          "validity_day_of_week": {
            "$ref": "#/components/schemas/ValidityDayOfWeek"
          },
          "validity_hours": {
            "$ref": "#/components/schemas/ValidityHours"
          },
          "summary": {
            "type": "object",
            "description": "Contains statistics about promotion tier redemptions and orders.",
            "properties": {
              "redemptions": {
                "type": "object",
                "description": "Contains statistics about promotion tier redemptions.",
                "properties": {
                  "total_redeemed": {
                    "type": "integer",
                    "description": "Number of times the promotion tier was redeemed."
                  }
                }
              },
              "orders": {
                "type": "object",
                "description": "Contains statistics about orders related to the promotion tier.",
                "properties": {
                  "total_amount": {
                    "type": "integer",
                    "description": "Sum of order totals."
                  },
                  "total_discount_amount": {
                    "type": "integer",
                    "description": "Sum of total discount applied using the promotion tier."
                  }
                }
              }
            }
          },
          "object": {
            "type": "string",
            "default": "promotion_tier",
            "description": "The type of the object represented by JSON. This object stores information about the promotion tier."
          },
          "validation_rule_assignments": {
            "$ref": "#/components/schemas/ValidationRuleAssignmentsList"
          },
          "category_id": {
            "type": "string",
            "description": "Promotion tier category ID.",
            "example": "cat_0c9da30e7116ba6bba"
          },
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Category"
            }
          }
        }
      },
      "BusValRuleAssignment": {
        "title": "Business Validation Rule Assignment",
        "description": "Assignments of business validation rule",
        "example": {
          "id": "asgm_LnY1g7UNFA9KyDrD",
          "rule_id": "val_3gPNA6SnH4ae",
          "related_object_id": "camp_CZOnEGiZfwIKWmSjhIoIT7Ol",
          "related_object_type": "campaign",
          "object": "validation_rules_assignment",
          "validation_status": "PARTIALLY_VALID",
          "validation_omitted_rules": [
            "1"
          ]
        },
        "properties": {
          "id": {
            "type": "string",
            "description": "The unique identifier for a assignment"
          },
          "rule_id": {
            "type": "string",
            "description": "The unique identifier for a rule"
          },
          "related_object_id": {
            "type": "string",
            "description": "The unique identifier for a related object"
          },
          "related_object_type": {
            "type": "string",
            "description": "The type of related object"
          },
          "created_at": {
            "type": "string",
            "description": "Timestamp representing the date and time when the object was created. The value is shown in the ISO 8601 format.",
            "example": "2022-03-09T11:19:04.819Z",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "description": "Timestamp representing the date and time when the object was last updated in ISO 8601 format.",
            "example": "2022-03-09T11:19:04.819Z",
            "format": "date-time"
          },
          "object": {
            "type": "string",
            "description": "The type of the object represented by JSON.",
            "default": "validation_rules_assignment",
            "enum": [
              "validation_rules_assignment"
            ]
          },
          "validation_status": {
            "type": "string",
            "description": "The validation status of the assignment",
            "enum": [
              "VALID",
              "PARTIALLY_VALID",
              "INVALID"
            ]
          },
          "validation_omitted_rules": {
            "type": "array",
            "description": "The list of omitted rules",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "id",
          "rule_id",
          "related_object_id",
          "related_object_type",
          "object"
        ]
      },
      "AreaStoreCampaignAssignment": {
        "title": "Areas and Stores Campain Assignment",
        "type": "object",
        "description": "An object representing an assignment of a campaign to an area or store.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier of the campaign assignment.",
            "example": "arsca_0ef5ee192117ae2416"
          },
          "area_id": {
            "type": "string",
            "description": "Unique identifier of the area to which the campaign is assigned.",
            "example": "ar_0ea6cd7b781b8f857f"
          },
          "all_stores": {
            "type": "boolean",
            "description": "Determines if the campaign is assigned to all of the stores in the area, i.e. if an area ID is passed in the `access_settings.assign.area_all_stores_ids` in the request."
          },
          "area_store_id": {
            "type": "string",
            "description": "Unique identifier of the store to which the campaign is assigned.",
            "example": "ars_0ec347e2016bed85f4"
          },
          "created_at": {
            "type": "string",
            "description": "Date and time when the assignment was made. The value is shown in the ISO 8601 format.",
            "format": "date-time",
            "example": "2024-06-25T19:04:16.260Z"
          },
          "object": {
            "type": "string",
            "description": "The type of the object represented by JSON. This object stores information about the campaign assignment to areas or stores.",
            "default": "area_store_campaign_assignment",
            "enum": [
              "area_store_campaign_assignment"
            ]
          }
        },
        "required": [
          "id",
          "area_id",
          "created_at",
          "object"
        ]
      },
      "DiscountAmount": {
        "type": "object",
        "title": "Amount",
        "properties": {
          "type": {
            "type": "string",
            "default": "AMOUNT",
            "enum": [
              "AMOUNT"
            ],
            "description": "Defines the type of the voucher."
          },
          "amount_off": {
            "type": "number",
            "description": "Amount taken off the subtotal of a price. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000."
          },
          "amount_off_formula": {
            "type": "string",
            "description": "Formula used to dynamically calculate the discount."
          },
          "aggregated_amount_limit": {
            "type": "integer",
            "description": "Maximum discount amount per order."
          },
          "effect": {
            "description": "Defines how the discount is applied to the customer's order.",
            "allOf": [
              {
                "$ref": "#/components/schemas/DiscountAmountVouchersEffectTypes"
              }
            ]
          },
          "is_dynamic": {
            "type": "boolean",
            "description": "Flag indicating whether the discount was calculated using a formula."
          }
        },
        "required": [
          "type",
          "amount_off"
        ]
      },
      "DiscountUnit": {
        "type": "object",
        "title": "Unit",
        "properties": {
          "type": {
            "type": "string",
            "default": "UNIT",
            "enum": [
              "UNIT"
            ],
            "description": "Discount type."
          },
          "unit_off": {
            "type": "integer",
            "description": "Number of units to be granted a full value discount."
          },
          "unit_off_formula": {
            "type": "string",
            "description": "Formula used to dynamically calculate the number of units."
          },
          "effect": {
            "description": "Defines how the unit is added to the customer's order.",
            "allOf": [
              {
                "$ref": "#/components/schemas/DiscountUnitVouchersEffectTypes"
              }
            ]
          },
          "unit_type": {
            "type": "string",
            "description": "The product deemed as free, chosen from product inventory (e.g. time, items)."
          },
          "product": {
            "description": "Contains information about the product.",
            "allOf": [
              {
                "$ref": "#/components/schemas/SimpleProductDiscountUnit"
              }
            ]
          },
          "sku": {
            "$ref": "#/components/schemas/SimpleSkuDiscountUnit"
          },
          "is_dynamic": {
            "type": "boolean",
            "description": "Flag indicating whether the discount was calculated using a formula."
          }
        },
        "required": [
          "type",
          "unit_type"
        ]
      },
      "DiscountUnitMultiple": {
        "type": "object",
        "title": "Unit Multiple",
        "properties": {
          "type": {
            "type": "string",
            "default": "UNIT",
            "enum": [
              "UNIT"
            ],
            "description": "Discount type."
          },
          "effect": {
            "type": "string",
            "default": "ADD_MANY_ITEMS",
            "enum": [
              "ADD_MANY_ITEMS"
            ],
            "description": "Defines how the discount is applied to the customer's order."
          },
          "units": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DiscountUnitMultipleOneUnit"
            }
          }
        },
        "required": [
          "type",
          "units"
        ]
      },
      "DiscountPercent": {
        "type": "object",
        "title": "Percent",
        "properties": {
          "type": {
            "type": "string",
            "default": "PERCENT",
            "enum": [
              "PERCENT"
            ],
            "description": "Defines the type of the voucher."
          },
          "percent_off": {
            "type": "number",
            "description": "The percent discount that the customer will receive."
          },
          "percent_off_formula": {
            "type": "string",
            "description": "Formula used to dynamically calculate the discount."
          },
          "amount_limit": {
            "type": "number",
            "description": "Upper limit allowed to be applied as a discount. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount is written as 600."
          },
          "aggregated_amount_limit": {
            "type": "integer",
            "description": "Maximum discount amount per order."
          },
          "effect": {
            "description": "Defines how the discount is applied to the customer's order.",
            "allOf": [
              {
                "$ref": "#/components/schemas/DiscountPercentVouchersEffectTypes"
              }
            ]
          },
          "is_dynamic": {
            "type": "boolean",
            "description": "Flag indicating whether the discount was calculated using a formula."
          }
        },
        "required": [
          "type",
          "percent_off"
        ]
      },
      "DiscountFixed": {
        "title": "Fixed",
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "default": "FIXED",
            "enum": [
              "FIXED"
            ],
            "description": "Defines the type of the voucher."
          },
          "fixed_amount": {
            "type": "number",
            "description": "Sets a fixed value for an order total or the item price. The value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000. If the fixed amount is calculated by the formula, i.e. the `fixed_amount_formula` parameter is present in the fixed amount definition, this value becomes the **fallback value**. As a result, if the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed value."
          },
          "fixed_amount_formula": {
            "type": "string",
            "description": "Formula used to dynamically calculate the discount."
          },
          "effect": {
            "description": "Defines how the discount is applied to the customer's order.",
            "allOf": [
              {
                "$ref": "#/components/schemas/DiscountFixedVouchersEffectTypes"
              }
            ]
          },
          "is_dynamic": {
            "type": "boolean",
            "description": "Flag indicating whether the discount was calculated using a formula."
          }
        },
        "required": [
          "type",
          "fixed_amount"
        ]
      },
      "VoucherAssets": {
        "title": "Voucher Assets",
        "type": "object",
        "description": "Stores links to images of QR and barcode that correspond to an encrypted voucher code.",
        "properties": {
          "qr": {
            "type": "object",
            "description": "Stores Quick Response (QR) representation of encrypted code.",
            "properties": {
              "id": {
                "type": "string",
                "example": "U2FsdGVkX19ucFhvVmBVpVYG5KoswTsjSIaqoKg5L9ie4BK+t4pp7U7oFzjGJzj9q/bmuMOj9mEFiVKDMIkSaruKedMvHbKoPX5Sg+BaZk5QwXMf8k/OzSlOEVybpwSq+AiqPoNtjeuqtIgkDyvT6Q==",
                "description": "Encrypted voucher code ID."
              },
              "url": {
                "type": "string",
                "example": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19ucFhvVmBVpVYG5KoswTsjSIaqoKg5L9ie4BK%2Bt4pp7U7oFzjGJzj9q%2FbmuMOj9mEFiVKDMIkSaruKedMvHbKoPX5Sg%2BBaZk5QwXMf8k%2FOzSlOEVybpwSq%2BAiqPoNtjeuqtIgkDyvT6Q%3D%3D",
                "description": "URL to QR code  \n\n*Optional:* Attach query parameters to base URL to customize the image of the encrypted voucher code.  \n\n- `size`: integer value from `1` to `100`  \n- `format`: string, either `png` (default) or `svg`"
              }
            }
          },
          "barcode": {
            "type": "object",
            "description": "Stores barcode representation of encrypted code.",
            "properties": {
              "id": {
                "type": "string",
                "example": "U2FsdGVkX19eJhGfWwUrH9+tulBkON+AnMktic+N6CVWzZ9+fHVxuVx22WakrzxiWXy0skuvvEHSeZIw9HlgyIJ+kJ1iPdUKpyENuNYJKzoZlO0mmTf6WQM6/pFs61apEn9SJx32ttCF6d3oxKISQQ==",
                "description": "Encrypted voucher code ID."
              },
              "url": {
                "type": "string",
                "example": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19eJhGfWwUrH9%2BtulBkON%2BAnMktic%2BN6CVWzZ9%2BfHVxuVx22WakrzxiWXy0skuvvEHSeZIw9HlgyIJ%2BkJ1iPdUKpyENuNYJKzoZlO0mmTf6WQM6%2FpFs61apEn9SJx32ttCF6d3oxKISQQ%3D%3D",
                "description": "URL to barcode  \n\n*Optional:* Attach query parameters to base URL to customize the image of the encrypted voucher code.  \n\n- `size`: integer value from `1` to `100`  \n- `format`: string, either `png` (default) or `svg`"
              }
            }
          }
        }
      },
      "VoucherImportBase": {
        "title": "Voucher Import Base",
        "type": "object",
        "description": "Object model for gift card object being imported.",
        "properties": {
          "code": {
            "type": "string",
            "description": "Value representing the imported code."
          },
          "redemption": {
            "type": "object",
            "description": "Stores the quantity of redemptions that can be applied to the voucher.",
            "properties": {
              "quantity": {
                "type": "integer",
                "description": "How many times a voucher can be redeemed. A `null` value means unlimited.",
                "example": 10
              }
            }
          },
          "active": {
            "type": "boolean",
            "description": "A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`.  \n\n- `true` indicates an *active* voucher\n- `false` indicates an *inactive* voucher"
          },
          "metadata": {
            "type": "object",
            "description": "The metadata object stores all custom attributes assigned to the code. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format."
          },
          "category": {
            "type": "string",
            "description": "Tag defining the category that this voucher belongs to. Useful when listing vouchers using the [List Vouchers](/api-reference/vouchers/list-vouchers) endpoint."
          },
          "start_date": {
            "type": "string",
            "description": "Activation timestamp presented in the ISO 8601 format. Voucher is *inactive before* this date. Start date defines when the code starts to be active.\nAllowed date formats are:\n- YYYY-MM-DD\n- YYYY-MM-DDTHH\n- YYYY-MM-DDTHH:mm\n- YYYY-MM-DDTHH:mm:ss\n- YYYY-MM-DDTHH:mm:ssZ\n- YYYY-MM-DDTHH:mm:ss.SSSZ",
            "format": "date-time",
            "example": "2020-12-28T12:49:16.272Z"
          },
          "expiration_date": {
            "type": "string",
            "description": "Expiration date defines when the code expires. Expiration timestamp is presented in the ISO 8601 format.  Voucher is *inactive after* this date.\nAllowed date formats are:\n- YYYY-MM-DD\n- YYYY-MM-DDTHH\n- YYYY-MM-DDTHH:mm\n- YYYY-MM-DDTHH:mm:ss\n- YYYY-MM-DDTHH:mm:ssZ\n- YYYY-MM-DDTHH:mm:ss.SSSZ",
            "format": "date-time",
            "example": "2053-12-28T12:49:16.272Z"
          },
          "validity_timeframe": {
            "$ref": "#/components/schemas/ValidityTimeframe"
          },
          "validity_day_of_week": {
            "$ref": "#/components/schemas/ValidityDayOfWeek"
          },
          "additional_info": {
            "type": "string",
            "description": "An optional field to keep any extra textual information about the code such as a code description and details."
          }
        },
        "required": [
          "code"
        ]
      },
      "SimpleLoyaltyCard": {
        "title": "Simple Loyalty Card",
        "type": "object",
        "description": "Simplified loyalty card data.",
        "required": [
          "points"
        ],
        "properties": {
          "points": {
            "type": "integer",
            "description": "Total number of points added to the loyalty card over its lifespan."
          },
          "balance": {
            "type": "integer",
            "description": "Points available for reward redemption. This is calculated as follows: `balance` = `points` - `expired_points` - `subtracted_points` - `redemption.redeemed_points`."
          },
          "next_expiration_date": {
            "type": "string",
            "description": "The next closest date when the next set of points are due to expire."
          },
          "next_expiration_points": {
            "type": "integer",
            "description": "The amount of points that are set to expire next."
          },
          "pending_points": {
            "type": "integer",
            "description": "Shows the number of pending points that will be added to the loyalty card when they are activated automatically or manually."
          },
          "expired_points": {
            "type": "integer",
            "description": "Shows the total number of expired points over the lifetime of the loyalty card."
          },
          "subtracted_points": {
            "type": "integer",
            "description": "Shows the total number of subtracted points over the lifetime of the loyalty card."
          }
        }
      },
      "OrderBase": {
        "title": "Order Base",
        "type": "object",
        "description": "Order information.",
        "properties": {
          "source_id": {
            "type": "string",
            "nullable": true,
            "description": "Unique source ID of an existing order that will be linked to the redemption of this request.\n\nFor validation and redemption, if `source_id` is used with an existing order, the original order data will be used, like `items`, `amount`, and so on, not the one sent in the new request."
          },
          "status": {
            "type": "string",
            "description": "The order status.",
            "enum": [
              "CREATED",
              "PAID",
              "CANCELED",
              "FULFILLED"
            ]
          },
          "amount": {
            "type": "integer",
            "description": "A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts."
          },
          "initial_amount": {
            "type": "integer",
            "description": "A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts."
          },
          "discount_amount": {
            "type": "integer",
            "description": "Sum of all order-level discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00)."
          },
          "items": {
            "type": "array",
            "description": "Array of items applied to the order. It can include up to 500 items.",
            "items": {
              "$ref": "#/components/schemas/OrderItem"
            }
          },
          "metadata": {
            "type": "object",
            "description": "A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format. It can be used to define business validation rules or discount formulas."
          }
        }
      },
      "CustomerBase": {
        "title": "Customer Base",
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Customer's first and last name."
          },
          "description": {
            "type": "string",
            "description": "An arbitrary string that you can attach to a customer object."
          },
          "email": {
            "type": "string",
            "description": "Customer's email address."
          },
          "phone": {
            "type": "string",
            "description": "Customer's phone number. This parameter is mandatory when you try to send out codes to customers via an SMS channel."
          },
          "birthday": {
            "type": "string",
            "description": "`Deprecated`. ~~Customer's birthdate; format YYYY-MM-DD~~.",
            "format": "date"
          },
          "birthdate": {
            "type": "string",
            "description": "Customer's birthdate; format YYYY-MM-DD.",
            "format": "date"
          },
          "address": {
            "type": "object",
            "nullable": true,
            "description": "Customer's address.",
            "properties": {
              "city": {
                "type": "string",
                "description": "City"
              },
              "state": {
                "type": "string",
                "description": "State"
              },
              "line_1": {
                "type": "string",
                "description": "First line of address."
              },
              "line_2": {
                "type": "string",
                "description": "Second line of address."
              },
              "country": {
                "type": "string",
                "description": "Country."
              },
              "postal_code": {
                "type": "string",
                "description": "Postal code."
              }
            }
          },
          "metadata": {
            "type": "object",
            "description": "A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments."
          }
        }
      },
      "1_obj_voucher_object_discount_amount": {
        "title": "Amount",
        "type": "object",
        "description": "Amount discount type.",
        "properties": {
          "type": {
            "type": "string",
            "default": "AMOUNT",
            "description": "Applies an amount discount."
          },
          "amount_off": {
            "type": "integer",
            "example": 100,
            "description": "Amount taken off the subtotal of a price. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000. In case of the amount being calculated by the formula, i.e. the `amount_off_formula` parameter is present in the amount definition, this value becomes the **fallback value**. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the amount off."
          },
          "amount_off_formula": {
            "type": "string",
            "description": "Formula used to dynamically calculate the discount."
          },
          "aggregated_amount_limit": {
            "type": "integer",
            "description": "Maximum discount amount per order. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount on the entire order is written as 600. This value is definable for the following discount effects:\n- `APPLY_TO_ITEMS` (each item subtotal is discounted equally)\n- `APPLY_TO_ITEMS_BY_QUANTITY` (each unit of matched products has the same discount value)"
          },
          "effect": {
            "type": "string",
            "enum": [
              "APPLY_TO_ORDER",
              "APPLY_TO_ITEMS",
              "APPLY_TO_ITEMS_PROPORTIONALLY",
              "APPLY_TO_ITEMS_PROPORTIONALLY_BY_QUANTITY",
              "APPLY_TO_ITEMS_BY_QUANTITY"
            ],
            "description": "Defines how the discount is applied to the customer's order. The discount effects are defined as follows:\n- `APPLY_TO_ORDER` (discount applies to the total order amount)\n- `APPLY_TO_ITEMS` (each item subtotal is discounted equally)\n- `APPLY_TO_ITEMS_PROPORTIONALLY` (split discount proportionally to amount)\n- `APPLY_TO_ITEMS_PROPORTIONALLY_BY_QUANTITY` (split discount proportionally to quantity)\n- `APPLY_TO_ITEMS_BY_QUANTITY` (each unit of matched products has the same discount value)"
          }
        }
      },
      "1_obj_voucher_object_discount_percentage": {
        "title": "Percentage",
        "type": "object",
        "description": "Percentage discount type.",
        "properties": {
          "type": {
            "type": "string",
            "default": "PERCENT",
            "description": "Applies a percentage discount."
          },
          "amount_limit": {
            "type": "string",
            "description": "Upper limit allowed to be applied as a discount per order line item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount is written as 600."
          },
          "aggregated_amount_limit": {
            "type": "integer",
            "description": "Maximum discount amount per order. This value is definable for the `APPLY_TO_ITEMS` discount effect. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount on the entire order is written as 600."
          },
          "percent_off": {
            "type": "integer",
            "description": "Percent taken off the subtotal amount. In case of the percent being calculated by the formula, i.e. the `percent_off_formula` parameter is present in the percent definition, this value becomes the **fallback value**. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the percent off.",
            "minimum": 0,
            "maximum": 100
          },
          "percent_off_formula": {
            "type": "string",
            "description": "Formula used to dynamically calculate the discount."
          },
          "effect": {
            "type": "string",
            "enum": [
              "APPLY_TO_ORDER",
              "APPLY_TO_ITEMS"
            ],
            "description": "Defines how the discount is applied to the customer's order."
          }
        }
      },
      "1_obj_voucher_object_discount_fixed": {
        "title": "Fixed",
        "description": "Fixed discount type.",
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "default": "FIXED",
            "description": "Sets a fixed total on cart or item(s) and then calculates the discount to apply."
          },
          "fixed_amount": {
            "type": "integer",
            "description": "Sets a fixed value for an order total or the item price. The value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000. If the fixed amount is calculated by the formula, i.e. the `fixed_amount_formula` parameter is present in the fixed amount definition, this value becomes the **fallback value**. As a result, if the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed value.",
            "example": 1000
          },
          "fixed_amount_formula": {
            "type": "string",
            "description": "Formula used to dynamically calculate the discounted price of an item or a new order total."
          },
          "effect": {
            "type": "string",
            "enum": [
              "APPLY_TO_ORDER",
              "APPLY_TO_ITEMS"
            ],
            "description": "\n| **Effect** | **Definition** |\n|:---|:---|\n| **APPLY_TO_ORDER** | Sets the order total amount to the value of the fixed amount. The discount value is calculated dynamically during the redemption as it's a difference between the total amount of the customer's order and the fixed amount. For example, if the fixed amount is set to equal $10 and the order amount equals $25, then the calculated discount will be $15. |\n| **APPLY_TO_ITEMS** | Sets a new price on items. The total discount amount is dynamically calculated during the redemption and it's a difference between the initial item price and the fixed amount. During the redemption, prices for items will change only if the new price is lower than the original price. If the new product price you set is different from the product price in a collection, then the new product price will be passed during the redemption. If a prodct is in more than one collection, the price is always changed to the lowest price. The new price for products with several SKUs will force the price change for SKUs if their original price is higher than the new price. |"
          }
        }
      },
      "1_obj_voucher_object_discount_unit_one": {
        "title": "Unit, single item",
        "type": "object",
        "description": "Single item type.",
        "properties": {
          "type": {
            "type": "string",
            "default": "UNIT",
            "description": "Applies a full value discount to item(s)."
          },
          "unit_off": {
            "type": "number",
            "description": "Number of units to be granted a full value discount. In case of the unit being calculated by the formula, i.e. the `unit_off_formula` parameter is present in the unit definition, this value becomes the **fallback value**. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the unit value.",
            "example": 1,
            "format": "float"
          },
          "unit_off_formula": {
            "type": "string",
            "description": "Formula used to dynamically calculate the number of units."
          },
          "unit_type": {
            "type": "string",
            "description": "The product deemed as free, chosen from the product  inventory (e.g. time, items).",
            "example": "prod_f1r5Tpr0DuC7"
          },
          "effect": {
            "type": "string",
            "enum": [
              "ADD_NEW_ITEMS",
              "ADD_MISSING_ITEMS"
            ],
            "default": "ADD_MISSING_ITEMS",
            "description": "Defines how the unit is added to the customer's order."
          }
        }
      },
      "1_obj_voucher_object_discount_unit_multiple": {
        "title": "Unit, multiple items",
        "type": "object",
        "description": "Multiple item types.",
        "properties": {
          "type": {
            "type": "string",
            "description": "Applies a full value discount to item(s).",
            "default": "UNIT"
          },
          "effect": {
            "type": "string",
            "default": "ADD_MANY_ITEMS",
            "description": "Defines the effect for adding multiple item types."
          },
          "units": {
            "type": "array",
            "description": "Array of objects defining items to be offered for free. Each item type can have a different discount effect assigned.",
            "items": {
              "type": "object",
              "description": "Object defining a unit discount.",
              "properties": {
                "unit_off": {
                  "type": "integer",
                  "description": "Number of units to be granted a full value discount. In case of the unit being calculated by the formula, i.e. the `unit_off_formula` parameter is present in the unit definition, this value becomes the **fallback value**. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the unit value.",
                  "example": 1
                },
                "unit_off_formula": {
                  "type": "string",
                  "description": "Formula used to dynamically calculate the number of units."
                },
                "unit_type": {
                  "type": "string",
                  "description": "The product deemed as free, chosen from the product  inventory (e.g. time, items).",
                  "example": "prod_f1r5Tpr0DuC7"
                },
                "effect": {
                  "type": "string",
                  "enum": [
                    "ADD_NEW_ITEMS",
                    "ADD_MISSING_ITEMS"
                  ],
                  "description": "Defines how the unit is added to the customer's order."
                }
              }
            }
          }
        }
      },
      "1_obj_voucher_object_discount_shipping": {
        "title": "Shipping",
        "description": "Shipping discount type.",
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "default": "UNIT",
            "description": "Applies a full value discount to item(s)."
          },
          "unit_off": {
            "type": "number",
            "format": "float",
            "description": "Subtracts 1 shipping item from the subtotal.",
            "default": 1
          },
          "unit_type": {
            "type": "string",
            "description": "The shipping product deemed as free.",
            "default": "prod_5h1pp1ng"
          },
          "effect": {
            "type": "string",
            "description": "Defines how the unit is added to the customer's order.",
            "default": "ADD_MISSING_ITEMS"
          }
        }
      },
      "LoyaltyPendingPointsDetails": {
        "title": "Pending Point Details",
        "type": "object",
        "description": "Details about how the pending points were earned.",
        "properties": {
          "loyalty_tier": {
            "type": "object",
            "description": "The loyalty tier that is mapped for the earning rule and used in the pending point transaction.",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique identifier of the loyalty tier, assigned by Voucherify."
              },
              "name": {
                "type": "string",
                "description": "User-defined name of the loyalty tier."
              }
            },
            "required": [
              "id",
              "name"
            ]
          },
          "holder_loyalty_tier": {
            "type": "object",
            "description": "Loyalty tier of the loyalty card holder at the moment when the transaction occurred. The loyalty tier is the tier in which the holder was at the moment pending points were created.",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique identifier of the loyalty tier, assigned by Voucherify."
              },
              "name": {
                "type": "string",
                "description": "User-defined name of the loyalty tier."
              }
            },
            "required": [
              "id",
              "name"
            ]
          },
          "event": {
            "type": "object",
            "description": "Details about the event that created pending points.",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique event identifier, assigned by Voucherify."
              },
              "type": {
                "type": "string",
                "description": "Type of the event that triggered the creation of pending points.",
                "enum": [
                  "customer.order.paid"
                ]
              },
              "group_id": {
                "type": "string",
                "description": "Unique identifier of the request that triggered the event, assigned by Voucherify."
              },
              "entity_id": {
                "type": "string",
                "description": "Unique identifier of the entity that triggered the event, assigned by Voucherify. For pending points, it is the `customer_id` of the customer who paid for the order."
              },
              "created_at": {
                "type": "string",
                "description": "Timestamp representing the date and time when the event occurred. The value is shown in the ISO 8601 format.",
                "format": "date-time"
              },
              "category": {
                "type": "string",
                "description": "Type of the event.",
                "enum": [
                  "ACTION",
                  "EFFECT"
                ]
              },
              "event_source": {
                "$ref": "#/components/schemas/EventSource"
              }
            }
          },
          "earning_rule": {
            "type": "object",
            "description": "Contains information about the earning rule.",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique identifier of an earning rule, assigned by Voucherify."
              },
              "source": {
                "type": "object",
                "required": [
                  "banner"
                ],
                "description": "Contains the custom earning rule name.",
                "properties": {
                  "banner": {
                    "type": "string",
                    "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard."
                  }
                }
              }
            },
            "required": [
              "id",
              "source"
            ]
          },
          "order": {
            "type": "object",
            "description": "Details about the order that caused adding pending points.",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique order identifier, assigned by Voucherify."
              },
              "source_id": {
                "nullable": true,
                "type": "string",
                "description": "User-defined order identifier."
              }
            },
            "required": [
              "id",
              "source_id"
            ]
          }
        },
        "required": [
          "event",
          "earning_rule",
          "order"
        ]
      },
      "ValidationRuleAssignmentsList": {
        "type": "object",
        "description": "Validation Rule Assignments List",
        "title": "Validation Rule Assignments List",
        "properties": {
          "object": {
            "type": "string",
            "description": "The type of the object represented by JSON. This object stores information about validation rule assignments.",
            "default": "list"
          },
          "data_ref": {
            "type": "string",
            "description": "Identifies the name of the JSON property that contains the array of validation rule assignments.",
            "default": "data"
          },
          "data": {
            "type": "array",
            "description": "A dictionary that contains an array of validation rule assignments.",
            "items": {
              "$ref": "#/components/schemas/ValidationRuleAssignment"
            }
          },
          "total": {
            "type": "integer",
            "description": "Total number of validation rule assignments."
          }
        },
        "required": [
          "object",
          "data_ref",
          "data",
          "total"
        ]
      },
      "DiscountAmountVouchersEffectTypes": {
        "title": "Discount Amount Vouchers Effect Types",
        "enum": [
          "APPLY_TO_ORDER",
          "APPLY_TO_ITEMS",
          "APPLY_TO_ITEMS_PROPORTIONALLY",
          "APPLY_TO_ITEMS_PROPORTIONALLY_BY_QUANTITY",
          "APPLY_TO_ITEMS_BY_QUANTITY"
        ],
        "type": "string"
      },
      "DiscountUnitVouchersEffectTypes": {
        "title": "Discount Unit Vouchers Effect Types",
        "enum": [
          "ADD_MISSING_ITEMS",
          "ADD_NEW_ITEMS",
          "ADD_MANY_ITEMS",
          "ADD_SAME_ITEMS"
        ],
        "type": "string"
      },
      "SimpleProductDiscountUnit": {
        "type": "object",
        "title": "Simple Product Discount Unit",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique product ID, assigned by Voucherify."
          },
          "source_id": {
            "type": "string",
            "description": "Product's source ID."
          },
          "name": {
            "type": "string",
            "description": "Product name."
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "SimpleSkuDiscountUnit": {
        "type": "object",
        "title": "Simple Sku Discount Unit",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique SKU ID, assigned by Voucherify."
          },
          "source_id": {
            "type": "string",
            "description": "Product variant's source ID."
          },
          "name": {
            "type": "string",
            "description": "Sku name"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "DiscountUnitMultipleOneUnit": {
        "type": "object",
        "title": "One Unit",
        "properties": {
          "unit_off": {
            "type": "number",
            "description": "Number of units to be granted a full value discount."
          },
          "unit_off_formula": {
            "type": "string",
            "description": "Formula used to dynamically calculate the number of units."
          },
          "effect": {
            "type": "string",
            "enum": [
              "ADD_NEW_ITEMS",
              "ADD_MISSING_ITEMS"
            ],
            "description": "Defines how the unit is added to the customer's order.\n\n"
          },
          "unit_type": {
            "type": "string",
            "description": "The product deemed as free, chosen from product inventory (e.g. time, items)."
          },
          "product": {
            "description": "Contains information about the product.",
            "allOf": [
              {
                "$ref": "#/components/schemas/SimpleProductDiscountUnit"
              }
            ]
          },
          "sku": {
            "description": "Contains information about the sku.",
            "allOf": [
              {
                "$ref": "#/components/schemas/SimpleSkuDiscountUnit"
              }
            ]
          }
        },
        "required": [
          "effect",
          "unit_type"
        ]
      },
      "DiscountPercentVouchersEffectTypes": {
        "title": "Discount Percent Vouchers Effect Types",
        "enum": [
          "APPLY_TO_ORDER",
          "APPLY_TO_ITEMS"
        ],
        "type": "string"
      },
      "DiscountFixedVouchersEffectTypes": {
        "title": "Discount Fixed Vouchers Effect Types",
        "enum": [
          "APPLY_TO_ORDER",
          "APPLY_TO_ITEMS"
        ],
        "type": "string"
      },
      "OrderItem": {
        "type": "object",
        "title": "Order Item",
        "properties": {
          "sku_id": {
            "type": "string",
            "description": "Unique identifier of the SKU. It is assigned by Voucherify."
          },
          "product_id": {
            "type": "string",
            "description": "Unique identifier of the product. It is assigned by Voucherify."
          },
          "related_object": {
            "type": "string",
            "enum": [
              "product",
              "sku"
            ],
            "description": "Used along with the source_id property, can be set to either sku or product."
          },
          "source_id": {
            "type": "string",
            "description": "The merchant's product/SKU ID (if it is different from the Voucherify product/SKU ID). It is useful in the integration between multiple systems. It can be an ID from an eCommerce site, a database, or a third-party service."
          },
          "quantity": {
            "type": "integer",
            "description": "The quantity of the particular item in the cart."
          },
          "discount_quantity": {
            "type": "integer",
            "description": "Number of dicounted items."
          },
          "initial_quantity": {
            "type": "integer",
            "description": "A positive integer in the smallest unit quantity representing the total amount of the order; this is the sum of the order items' quantity."
          },
          "amount": {
            "type": "integer",
            "description": "The total amount of the order item (price * quantity)."
          },
          "discount_amount": {
            "type": "integer",
            "description": "Sum of all order-item-level discounts applied to the order."
          },
          "initial_amount": {
            "type": "integer",
            "description": "A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts."
          },
          "price": {
            "type": "integer",
            "description": "Unit price of an item. The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`."
          },
          "product": {
            "type": "object",
            "description": "An object containing details of the related product.",
            "properties": {
              "id": {
                "type": "string",
                "description": "A unique identifier that represents the product and is assigned by Voucherify."
              },
              "source_id": {
                "type": "string",
                "description": "The merchant's product ID (if it is different than Voucherify's product ID). It is really useful in case of integration between multiple systems. It can be an ID from an eCommerce site, a database or a 3rd party service."
              },
              "override": {
                "type": "boolean",
                "description": "The override set to `true` is used to store the product information in the system. If the product does not exist, it will be created with a source_id; if it does exist, the provided values for the name, price, and metadata will replace those already stored in the system. Override works only for endpoints that create an order in the database."
              },
              "name": {
                "type": "string",
                "description": "Product name."
              },
              "metadata": {
                "type": "object",
                "description": "A set of custom key/value pairs that you can attach to a product. It can be useful for storing additional information about the product in a structured format. It can be used to create product collections."
              },
              "price": {
                "type": "number",
                "description": "Product price. A positive integer in the smallest currency unit (e.g. 100 cents for $1.00)."
              }
            }
          },
          "sku": {
            "type": "object",
            "description": "An object containing details of the related SKU.",
            "properties": {
              "id": {
                "type": "string",
                "description": "A unique identifier that represents the SKU and is assigned by Voucherify."
              },
              "source_id": {
                "type": "string",
                "description": "The merchant's SKU ID (if it is different than Voucherify's SKU ID). It is really useful in case of integration between multiple systems. It can be an ID from an eCommerce site, a database or a 3rd party service."
              },
              "override": {
                "type": "boolean",
                "description": "The override set to `true` is used to store the product information in the system. If the product does not exist, it will be created with a source_id; if it does exist, the provided values for the name, price, and metadata will replace those already stored in the system."
              },
              "sku": {
                "type": "string",
                "description": "The SKU name."
              },
              "price": {
                "type": "number",
                "description": "SKU price. A positive integer in the smallest currency unit (e.g. 100 cents for $1.00)."
              },
              "metadata": {
                "type": "object",
                "description": "A set of custom key/value pairs that you can attach to an order item. It can be useful for storing additional information about the order item in a structured format. It can be used to create product collections."
              }
            }
          },
          "metadata": {
            "type": "object",
            "description": "A set of custom key/value pairs that you can attach to an order item. It can be useful for storing additional information about the order item in a structured format. It can be used to define business validation rules."
          }
        },
        "required": [
          "object"
        ]
      },
      "EventSource": {
        "type": "object",
        "title": "Event Source",
        "description": "Contains the source of the object that initiated the event.",
        "required": [
          "channel"
        ],
        "properties": {
          "channel": {
            "type": "string",
            "description": "Determines the channel that initiated the event.",
            "enum": [
              "USER_PORTAL",
              "API",
              "CLIENT_API",
              "INTERNAL"
            ],
            "example": "API"
          },
          "user": {
            "type": "object",
            "description": "Determines the Voucherify user who triggered the event.",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique identifier of the user.",
                "example": "user_xyzfghSTprSTUVWXYlk6tuvXYst7FGH7"
              }
            },
            "required": [
              "id"
            ]
          },
          "api_key": {
            "type": "object",
            "description": "Determines the API key used to initiate the event.",
            "required": [
              "name",
              "app_id"
            ],
            "properties": {
              "name": {
                "type": "string",
                "description": "Channel name in the application keys."
              },
              "app_id": {
                "type": "string",
                "description": "Contains the application ID from the Voucherify API key pair.",
                "example": "1XXXX5XX-0XXX-XXXb-X7XX-XX2XXaXXX6XX"
              }
            }
          }
        }
      },
      "ValidationRuleAssignment": {
        "title": "Validation Rule Assignment",
        "type": "object",
        "description": "This is an object representing a validation rule assignment.",
        "properties": {
          "id": {
            "type": "string",
            "example": "asgm_74F7QZoYbUoljwQO",
            "description": "Validation rule assignment ID."
          },
          "rule_id": {
            "type": "string",
            "example": "val_4j7DCRm2IS59",
            "description": "Validation rule ID."
          },
          "related_object_id": {
            "type": "string",
            "example": "v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT",
            "description": "The resource ID to which the validation rule was assigned."
          },
          "related_object_type": {
            "type": "string",
            "description": "The type of resource to which the validation rule was assigned.",
            "enum": [
              "voucher",
              "campaign",
              "earning_rule",
              "reward_assignment",
              "promotion_tier",
              "distribution"
            ]
          },
          "created_at": {
            "type": "string",
            "example": "2022-02-17T08:18:15.085Z",
            "description": "Timestamp representing the date and time when the validation rule assignment was created. The value is shown in the ISO 8601 format.",
            "format": "date-time"
          },
          "object": {
            "type": "string",
            "default": "validation_rules_assignment",
            "description": "The type of the object represented by the ID.",
            "enum": [
              "validation_rules_assignment"
            ]
          }
        },
        "required": [
          "id",
          "rule_id",
          "related_object_id",
          "related_object_type",
          "created_at",
          "object"
        ]
      }
    },
    "parameters": {
      "limit": {
        "name": "limit",
        "in": "query",
        "required": false,
        "schema": {
          "$ref": "#/components/schemas/ParameterLimit"
        },
        "description": "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."
      },
      "page": {
        "name": "page",
        "in": "query",
        "required": false,
        "schema": {
          "$ref": "#/components/schemas/ParameterPage"
        },
        "description": "Which page of results to return. The lowest value is `1`."
      },
      "campaign_type": {
        "name": "campaign_type",
        "in": "query",
        "required": false,
        "schema": {
          "$ref": "#/components/schemas/ParameterCampaignType"
        },
        "description": "This attribute allows filtering by campaign type."
      }
    },
    "examples": {
      "res_async_actions": {
        "value": {
          "async_action_id": "aa_0ab2df092385be5ca5"
        }
      }
    },
    "securitySchemes": {
      "X-App-Id": {
        "type": "apiKey",
        "name": "X-App-Id",
        "in": "header"
      },
      "X-App-Token": {
        "type": "apiKey",
        "name": "X-App-Token",
        "in": "header"
      },
      "X-Voucherify-OAuth": {
        "type": "oauth2",
        "flows": {
          "implicit": {
            "authorizationUrl": "https://api.voucherify.io/v1/oauth/token",
            "scopes": {
              "api": "Gives access to whole server-side API.",
              "vouchers": "Gives access to all endpoints and methods starting with `v1/vouchers`.",
              "client_api": "Gives access to whole client-side API.",
              "client_vouchers": "Gives access to all endpoints and methods starting with `/client/v1/vouchers`.",
              "promotions": "Gives access to all endpoints and methods starting with `/v1/promotions`.",
              "client_promotions": "Gives access to all endpoints and methods starting with `/client/v1/promotions`",
              "campaigns": "Gives access to all endpoints and methods starting with `v1/campaigns`.",
              "client_publish": "Gives access to all endpoints and methods starting with `/client/v1/publish`.",
              "exports": "Gives access to all endpoints and methods starting with `/v1/exports`.",
              "publications": "Gives access to all endpoints and methods starting with `/v1/publications`.",
              "client_validate": "Gives access to all endpoints and methods starting with `/client/v1/validate`.",
              "validations": "Gives access to all endpoints and methods starting with `/v1/validations`.",
              "client_validations": "Gives access to all endpoints and methods starting with `/client/v1/validations`.",
              "qualifications": "Gives access to all endpoints and methods starting with `/v1/qualifications`.",
              "client_qualifications": "Gives access to all endpoints and methods starting with `/client/v1/qualifications`.",
              "client_redeem": "Gives access to all endpoints and methods starting with `/client/v1/redeem",
              "redemptions": "Gives access to all endpoints and methods starting with `/v1/redemptions`.",
              "client_redemptions": "Gives access to all endpoints and methods starting with `/client/v1/redemptions`",
              "customers": "Gives access to all endpoints and methods starting with `/v1/customers`.",
              "client_customers": "Gives access to all endpoints and methods starting with `/client/v1/customers`.",
              "orders": "Gives access to all endpoints and methods starting with `/v1/orders`.",
              "products": "Gives access to all endpoints and methods starting with `/v1/products`.",
              "skus": "Gives access to all endpoints and methods starting with `/v1/SKUs`.",
              "validation-rules": "Gives access to all endpoints and methods starting with `/v1/validation-rules`.",
              "validation-rules-assignments": "Gives access to all endpoints and methods starting with `/v1/validation-rules-assignments",
              "segments": "Gives access to all endpoints and methods starting with `/v1/segments`.",
              "events": "Gives access to all endpoints and methods starting with `/v1/events`.",
              "client_events": "Gives access to all endpoints and methods starting with `client/v1/events`.",
              "rewards": "Gives access to all endpoints and methods starting with `/v1/rewards`.",
              "assets": "Gives access to all endpoints and methods starting with `/v1/assets`.",
              "task-results": "Gives access to all endpoints and methods starting with `/v1/task-results`.",
              "loyalties": "Gives access to all endpoints and methods starting with `/v1/loyalties`.",
              "client_consents": "Gives access to all endpoints and methods starting with `client/v1/consents`.",
              "consents": "Gives access to all endpoints and methods starting with `/v1/consents`.",
              "async-actions": "Gives access to all endpoints and methods starting with `/v1/async-actions`.",
              "product-collections": "Gives access to all endpoints and methods starting with `/v1/product-collections`.",
              "categories": "Gives access to all endpoints and methods starting with `/v1/categories`.",
              "metadata-schemas": "Gives access to all endpoints and methods starting with `/v1/metadata-schemas`.",
              "locations": "Gives access to all endpoints and methods starting with `/v1/locations`.",
              "referrals": "Gives access to all endpoints and methods starting with `/v1/referrals`.",
              "trash-bin": "Gives access to all endpoints and methods starting with `/v1/trash-bin`.",
              "templates": "Gives access to all endpoints and methods starting with `/v1/templates`."
            }
          }
        }
      }
    }
  }
}