---
title: "POST /api/v1.0/{appId}/campaigns/loyalty"
method: POST
path: "/api/v1.0/{appId}/campaigns/loyalty"
tags: ["Campaigns"]
---

# POST /api/v1.0/{appId}/campaigns/loyalty

`POST /api/v1.0/{appId}/campaigns/loyalty`

## Request

- Base URL: `https://api.flipdish.co`
- URL: `https://api.flipdish.co/api/v1.0/{appId}/campaigns/loyalty`
- Auth: OAuth 2 (implicit, authorization URL `https://api.flipdish.co/identity/connect/authorize`, scopes: `api`)

## Path parameters

- `appId` string, required

## Request body

- LoyaltyCampaignBase: Loyalty campaign base
  - `OrdersBeforeReceivingVoucher` integer: Number of orders customer needs to make, before receiving voucher
  - `PercentDiscountAmount` integer, nullable: Discount amount in percents
  - `MaxDiscount` number, double, nullable: Maximum discount for percentage discounts
  - `RoundingStrategy` integer, nullable: Controls how the loyalty voucher's amount is rounded
  - `ShouldIncludeOrdersWithLoyaltyVoucher` boolean, nullable: Controls whether we should include orders with loyalty vouchers in the campaign calculation
  - `VoucherValidPeriodDays` integer: Number of days for which the voucher will be valid.
  - `IncludeDeliveryFee` boolean: Discount will include delivery fee
  - `AutoApplyResultingVouchers` boolean: Automatically apply resulting vouchers
  - `IncludeExistingOrders` boolean: Campaign will apply to existing orders
  - `IsEnabled` boolean: Is campaign enabled
  - `StoreIds` integer[]: Ids of stores this campaign applies to
  - `AppId` string: The app that this campaign belongs to.
  - `ForceDiscount` boolean: Controls whether the voucher generated from this campaign will override discount exclusions

## Response `200`

OK

- RestApiResultLoyaltyCampaign: Rest api result
  - `Data` LoyaltyCampaign, required: Loyalty campaign
    - `CampaignId` integer: Id of campaign
    - `Statistics` CampaignStatistics: Campaign statistics
      - `VouchersIssued` integer: Deprecated. Number of issued vouchers. This field is always zero.
      - `VouchersRedeemed` integer: Deprecated. Number of redeemed vouchers. This field is always zero. This field is always zero.
      - `Conversion` number, double: Deprecated. Conversion of campaign (VouchersIssued / VouchersRedeemed). This field is always zero.
      - `SalesGenerated` number, double: Deprecated. Sales generated by campaign (TotalAmount - FeeChargedToCustomer ie. the discounted sale value). This field is always zero.
      - `ReturnOfInvestment` number, double: Deprecated. Return of investment of campaign (TotalAmount / DiscountAmount). This field is always zero.
    - `Stores` StoreCampaignStartTime[]: Stores this campaign applies to with campaign start time in Utc
      - `StoreId` integer: Store Id
      - `TsStart` string, date-time: Campaign start time in Utc
    - `PublicId` string, uuid: Permanent reference to the item.
    - `OrdersBeforeReceivingVoucher` integer: Number of orders customer needs to make, before receiving voucher
    - `PercentDiscountAmount` integer, nullable: Discount amount in percents
    - `MaxDiscount` number, double, nullable: Maximum discount for percentage discounts
    - `RoundingStrategy` integer, nullable: Controls how the loyalty voucher's amount is rounded
    - `ShouldIncludeOrdersWithLoyaltyVoucher` boolean, nullable: Controls whether we should include orders with loyalty vouchers in the campaign calculation
    - `VoucherValidPeriodDays` integer: Number of days for which the voucher will be valid.
    - `IncludeDeliveryFee` boolean: Discount will include delivery fee
    - `AutoApplyResultingVouchers` boolean: Automatically apply resulting vouchers
    - `IncludeExistingOrders` boolean: Campaign will apply to existing orders
    - `IsEnabled` boolean: Is campaign enabled
    - `StoreIds` integer[]: Ids of stores this campaign applies to
    - `AppId` string: The app that this campaign belongs to.
    - `ForceDiscount` boolean: Controls whether the voucher generated from this campaign will override discount exclusions

## Other responses

- `400`: BadRequest
- `401`: Unauthorized
- `403`: Successful authentication, but authorization has been denied for this request.
- `404`: NotFound

---

[API](https://skmtc.dev/flipdish/apis/flipdish-open-api-v1-0.md) · [All operations](https://skmtc.dev/flipdish/apis/flipdish-open-api-v1-0/llms.txt) · [OpenAPI document](https://skmtc.dev/flipdish/apis/flipdish-open-api-v1-0/revisions/4d8c2b9e1c13?raw)
