---
title: "Create Coupon"
method: POST
path: "/Sites/{siteId}/Coupons"
tags: ["Coupons"]
---

# Create Coupon

`POST /Sites/{siteId}/Coupons`

## Path parameters

- `siteId` integer, required

## Request body

- QPilotCoreModelsCoupon
  - `id` integer
  - `siteId` integer
  - `code` string, required
  - `name` string, nullable
  - `country` string, nullable
  - `postcode` string, nullable
  - `state` string, nullable
  - `city` string, nullable
  - `minUnits` integer, nullable
  - `maxUnits` integer, nullable
  - `minWeight` number, double, nullable
  - `maxWeight` number, double, nullable
  - `weightUnitType` 'Pound' | 'Ounce' | 'Kilogram' | 'Gram'
  - `cycles` integer
  - `maxCyclesPerSite` integer, nullable
  - `minSubtotal` number, float, nullable
  - `maxSubtotal` number, float, nullable
  - `maxCyclesPerCustomer` integer, nullable
  - `assignments` integer
  - `maxAssignmentsPerCustomer` integer, nullable
  - `maxAssignmentsPerSite` integer, nullable
  - `minScheduledOrderCycles` integer, nullable
  - `maxScheduledOrderCycles` integer, nullable
  - `maxCyclesPerScheduledOrder` integer, nullable
  - `maxDiscountPerCustomer` number, double, nullable
  - `lifetimeValue` number, double
  - `amount` number, double
  - `discountType` 'None' | 'ReduceSubtotalByPercentage' | 'ReduceSubtotalByAmount' | 'ReduceShippingByPercentage' | 'ReduceShippingByAmount' | 'SetShippingToAmount' | 'ReduceProductPriceByPercentage' | 'ReduceProductPriceByAmount'
  - `maxPercentageDiscount` number, double, nullable
  - `expirationDate` string, date-time, nullable
  - `applyExpirationDateToExisting` boolean
  - `isStackable` boolean
  - `productId` integer, nullable
  - `product` QPilotCoreModelsProduct
    - `id` integer
    - `siteId` integer
    - `parentProductId` integer, nullable
    - `externalId` string, nullable
    - `type` string, nullable
    - `sku` string, nullable
    - `gtin` string, nullable
    - `mpn` string, nullable
    - `title` string, required
    - `description` string, nullable
    - `price` number, float, required
    - `salePrice` number, float, nullable
    - `length` string, nullable
    - `width` string, nullable
    - `weightUnitType` 'Pound' | 'Ounce' | 'Kilogram' | 'Gram'
    - `lengthUnitType` 'Inch' | 'Foot' | 'Yard' | 'Milimeter' | 'Centimeter' | 'Meter'
    - `height` string, nullable
    - `weight` string, nullable
    - `shippingClass` string, nullable
    - `taxClass` string, nullable
    - `imageUrl` string, nullable
    - `imageThumbUrl` string, nullable
    - `addToScheduledOrder` boolean
    - `processScheduledOrder` boolean
    - `availability` 'Undefined' | 'InStock' | 'OutOfStock' | 'Preorder'
    - `stock` integer, nullable
    - `createdUtc` string, date-time
    - `updatedUtc` string, date-time
    - `lifetimeValue` number, double
    - `active` boolean
    - `valid` boolean
    - `validationErrorCode` 1 | 2 | 3 | 4
    - `backordersAllowed` boolean, nullable
    - `metadata` object, nullable
  - `productGroupId` integer, nullable
  - `productGroup` QPilotCoreModelsProductGroup
    - `productGroupId` integer
    - `name` string, required
    - `createdUtc` string, date-time
    - `updatedUtc` string, date-time, nullable
    - `siteId` integer
    - `site` QPilotCoreModelsSitesSite
      - `id` integer
      - `userId` integer
      - `url` string, required
      - `baseUrlWebHook` string, nullable
      - `logoUrl` string, nullable
      - `scheduledOrdersClientPageUrl` string, nullable
      - `name` string, required
      - `email` string, required
      - `zipCode` string, nullable
      - `createdUtc` string, date-time
      - `updatedUtc` string, date-time
      - `isProduction` boolean
      - `orderProcessingStartTime` string, date-span, nullable
      - `orderProcessingEndTime` string, date-span, nullable
      - `orderProcessingOffset` integer, nullable
      - `utcOffset` integer, nullable
      - `lockDurationDays` integer, nullable
      - `isShowingNotes` boolean
      - `isShowCoupons` boolean
      - `isStackedButtons` boolean
      - `isDisplayScheduledOrderId` boolean
      - `allowRetryScheduledOrder` boolean
      - `showProductTitleOnImages` boolean
      - `enableProductCarouselAutoSlide` boolean
      - `noScheduleOrdersBody` string, nullable
      - `noScheduleOrdersLink` string, nullable
      - `isProcessingPaused` boolean
      - `lastProcessingPausedUtc` string, date-time, nullable
      - `failedConnectAttempts` integer
      - `defaultWeightUnitType` 'Pound' | 'Ounce' | 'Kilogram' | 'Gram'
      - `defaultLengthUnitType` 'Inch' | 'Foot' | 'Yard' | 'Milimeter' | 'Centimeter' | 'Meter'
      - `themingSettings` QPilotCoreModelsEmailsSiteThemingSettings
        - `emailSettings` QPilotCoreModelsEmailsEmailTemplatesStyleSettings
          - `logoBackgroundColor` string, nullable
          - `bannerBackgroundColor` string, nullable
          - `bannerFontColor` string, nullable
          - `scheduledOrderTableColor` string, nullable
          - `scheduledOrderFontColor` string, nullable
          - `contentTableColor` string, nullable
          - `bodyContainerBackgroundColor` string, nullable
          - `contentBackgroundColor` string, nullable
          - `contentFontColor` string, nullable
          - `customStyles` string, nullable
        - `resourcesStylesSettings` object, nullable
        - `notificationsComponentGeneralInformationAreaEnabled` boolean
      - `themingSettingsJson` string, nullable
      - `customerPortalSettings` QPilotCoreModelsSitesSiteCustomerPortalSettings
        - `styles` QPilotCoreModelsSitesCustomerPortalStyleSettings
          - `largeDisplayBreakpoint` string, nullable
          - `primaryColor` string, nullable
          - `onPrimaryColor` string, nullable
          - `surfaceColor` string, nullable
          - `onSurfaceColor` string, nullable
          - `errorColor` string, nullable
          - `onErrorColor` string, nullable
          - `customStyles` string, nullable
          - `onDiscountBarColor` string, nullable
          - `discountBarColor` string, nullable
          - `buttonBorderThicknessPx` integer
          - `buttonBorderRadiusPx` integer
          - `buttonBorderColor` string, nullable
          - `selectedButtonBackgroundColor` string, nullable
          - `selectedButtonTextColor` string, nullable
          - `unselectedButtonTextColor` string, nullable
          - `maxImageWidthPx` integer
          - `maxImageHeightPx` integer
        - `detailedSummaryComponentConfig` QPilotCoreModelsSitesDetailedSummaryComponentConfig
          - `customCss` string, nullable
          - `components` QPilotCoreModelsSitesComponentItem[], nullable
            - `order` integer
            - `label` string, nullable
            - `identifier` string, nullable
            - `enabled` boolean
          - `unifiedOrder` QPilotCoreModelsSitesUnifiedComponentOrderItem[], nullable
            - `identifier` string, nullable
            - `label` string, nullable
            - `order` integer
            - `enabled` boolean
            - `isCustom` boolean
          - `customComponents` QPilotCoreModelsSitesCustomComponentContent[], nullable
            - `id` string, nullable
            - `name` string, nullable
            - `htmlContent` string, nullable
            - `cssContent` string, nullable
            - `enabled` boolean
            - `order` integer
            - `createdAt` string, date-time, nullable
            - `updatedAt` string, date-time, nullable
        - `allowCustomerSnooze` boolean
        - `snoozeOptions` QPilotCoreModelsSitesSnoozeOption[], nullable
          - `duration` integer
          - `durationType` string, nullable
          - `isDefault` boolean
          - `enabled` boolean
          - `order` integer
      - `customerPortalSettingsJson` string, nullable
      - `repeatProcessingAllowedWindow` integer, nullable
      - `repeatProcessingAllowedWindowUnitType` 'Minutes' | 'Hours' | 'Days'
      - `metadata` object, nullable
      - `metadataJson` string, nullable
      - `phoneNumber` string, nullable
      - `revenueSummaryEmailAddresses` string, nullable
      - `enableRevenueSummaryEmail` boolean
      - `productEventLogsExpirationHours` integer
      - `emailDeliveryEventExpirationHours` integer
      - `paymentMethodsPageUrl` string, nullable
      - `processingVersion` integer
      - `baseUrl` string, nullable
      - `createOrderEndpoint` string, nullable
      - `orderProcessedEndpoint` string, nullable
      - `failOrderEndpoint` string, nullable
      - `updateProductAvailabilityEndpoint` string, nullable
      - `healthCheckPostEndpoint` string, nullable
      - `healthCheckPutEndpoint` string, nullable
      - `secretKeyId` integer, nullable
      - `secretKey` QPilotCoreModelsSecretKey
        - `id` integer
        - `userId` integer
        - `user` QPilotCoreModelsUsersUser
          - `id` integer
          - `email` string, required
          - `password` string, byte, required
          - `role` 'None' | 'Merchant' | 'Administrator'
          - `subscriptionId` string, nullable
          - `subscriptionStatus` 'None' | 'Trial' | 'Active' | 'Inactive'
          - `subscriptionPaymentMethodDescription` string, nullable
          - `subscriptionNextBillingDate` string, date-time, nullable
          - `subscriptionUpdatedUtc` string, date-time, nullable
          - `createdUtc` string, date-time
          - `updatedUtc` string, date-time
          - `activeTier` 0 | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256
          - `chargifyProductHandle` string, nullable
          - `phoneNumber` string, nullable
          - `firstLogin` integer
          - `accountOwnerEmail` string, nullable
          - `emailVerificationStatus` 'Unknown' | 'Verified' | 'Unverified' | 'PendingVerification'
        - `key` string, byte, nullable
        - `integrationId` integer
        - `integration` QPilotCoreModelsIntegration
          - `id` integer
          - `name` string, required
          - `subtitle` string, nullable
          - `subtitle2` string, nullable
          - `header` string, nullable
          - `description` string, required
          - `category` 0 | 1 | 2 | 3 | 4 | 5
          - `code` string, required
          - `url` string, required
          - `pluginUrl` string, nullable
          - `supportUrl` string, nullable
          - `accountKeysUrl` string, nullable
          - `logoPath` string, required
          - `transparentLogoPath` string, nullable
          - `slideImage1Path` string, nullable
          - `slideImage2Path` string, nullable
          - `slideImage3Path` string, nullable
          - `color` string, nullable
          - `skipChargify` boolean
          - `siteIntegrations` QPilotCoreModelsSitesSiteIntegration[], nullable
            - `siteId` integer
            - `integrationId` integer
            - `outboundApiKey1` string, nullable
            - `outboundApiKey2` string, nullable
            - `inboundApiKeyString` string, nullable
            - `inboundApiKey` string, byte, nullable
            - `createdUtc` string, date-time
            - `updatedUtc` string, date-time
            - `testMode` boolean
            - `enabled` boolean
        - `integrationType` string, required
        - `description` string, required
        - `createdUtc` string, date-time
        - `updatedUtc` string, date-time
      - `policies` QPilotCoreModelsSubscriptionTiersPolicy[], nullable
        - `id` integer
        - `slug` string, nullable
        - `tierId` integer
        - `tier` QPilotCoreModelsSubscriptionTiersTier
          - `id` integer
          - `name` string, nullable
          - `handle` string, nullable
          - `createdUtc` string, date-time
          - `updatedUtc` string, date-time
          - `policies` QPilotCoreModelsSubscriptionTiersPolicy[], nullable
          - `usageOnCreating` boolean
          - `usageOnProcessing` boolean
        - `siteId` integer, nullable
        - `site` QPilotCoreModelsSitesSite — recursive
        - `defaultPolicyId` integer, nullable
        - `defaultPolicy` QPilotCoreModelsSubscriptionTiersPolicy — recursive
        - `pageId` integer, nullable
        - `type` 0 | 1 | 2
        - `name` string, nullable
        - `description` string, nullable
        - `value` string, nullable
        - `active` boolean
        - `createdUtc` string, date-time
        - `updatedUtc` string, date-time
      - `fallbackToQpilotShippingWhenNextimeFails` boolean
      - `logExpirations` QPilotCoreModelsLogExpiration[], nullable
        - `id` integer
        - `sites` QPilotCoreModelsSitesSite — recursive
        - `codLogToClean` string, nullable
        - `expirationDates` integer
      - `active` boolean
      - `currencyIso` string, nullable
      - `sortProductsAlphabetically` boolean
      - `hideOutOfStockProducts` boolean
      - `manageAllowedFrequencies` boolean
      - `allowedFrequencies` QPilotCoreModelsFrequencyTypeValues[], nullable
        - `frequencyType` 'Days' | 'Weeks' | 'Months' | 'DayOfTheWeek' | 'DayOfTheMonth'
        - `displayName` string, nullable
        - `value` integer
  - `productDiscountNotAppliesWhenItHasSalePrice` boolean
  - `subtotalDiscountAppliesToRegularPrice` boolean
  - `createdUtc` string, date-time
  - `updatedUtc` string, date-time
  - `customerCouponUsages` QPilotCoreModelsCustomerCouponUsage[], nullable
    - `couponId` integer
    - `customerId` integer
    - `lifetimeDiscount` number, float
    - `updatedUtc` string, date-time
    - `cycles` integer
    - `assignments` integer
    - `valid` boolean
    - `couponInvalidationCode` 'Expired' | 'SiteLimitExceeded' | 'ScheduledOrderLimitExceeded' | 'CustomerLimitExceeded' | 'GeographyNotMet' | 'TotalsNotMet' | 'UnitsNotMet' | 'MinWeightNotMet' | 'MaxWeightNotMet' | 'ScheduledOrderCyclesNotMet' | 'CustomerInclusionList' | 'CustomerExclusionList' | 'NonStackable' | 'ManuallyRemoved' | 'MaxAssignmentsReached' | 'MapRemoved' | 'ProductNotPresent' | 'SubtotalDiscountTypeMixed' | 'ItemHasSalePrice'
  - `includeCustomerEmails` string, nullable
  - `excludeCustomerEmails` string, nullable
  - `active` boolean
  - `valid` boolean
  - `couponInvalidationCode` 'Expired' | 'SiteLimitExceeded' | 'ScheduledOrderLimitExceeded' | 'CustomerLimitExceeded' | 'GeographyNotMet' | 'TotalsNotMet' | 'UnitsNotMet' | 'MinWeightNotMet' | 'MaxWeightNotMet' | 'ScheduledOrderCyclesNotMet' | 'CustomerInclusionList' | 'CustomerExclusionList' | 'NonStackable' | 'ManuallyRemoved' | 'MaxAssignmentsReached' | 'MapRemoved' | 'ProductNotPresent' | 'SubtotalDiscountTypeMixed' | 'ItemHasSalePrice'

## Response `200`

Success

- QPilotCoreModelsDtoLegacyLegacyCouponDto
  - `id` integer
  - `siteId` integer
  - `code` string, nullable
  - `name` string, nullable
  - `country` string, nullable
  - `postcode` string, nullable
  - `state` string, nullable
  - `city` string, nullable
  - `minUnits` integer, nullable
  - `maxUnits` integer, nullable
  - `minWeight` number, double, nullable
  - `maxWeight` number, double, nullable
  - `weightUnitType` 'Pound' | 'Ounce' | 'Kilogram' | 'Gram'
  - `cycles` integer
  - `maxCyclesPerSite` integer, nullable
  - `minSubtotal` number, float, nullable
  - `maxSubtotal` number, float, nullable
  - `maxCyclesPerCustomer` integer, nullable
  - `assignments` integer, nullable
  - `maxAssignmentsPerCustomer` integer, nullable
  - `maxAssignmentsPerSite` integer, nullable
  - `minScheduledOrderCycles` integer, nullable
  - `maxScheduledOrderCycles` integer, nullable
  - `maxCyclesPerScheduledOrder` integer, nullable
  - `maxDiscountPerCustomer` number, double, nullable
  - `lifetimeValue` number, double
  - `amount` number, double
  - `discountType` 'None' | 'ReduceSubtotalByPercentage' | 'ReduceSubtotalByAmount' | 'ReduceShippingByPercentage' | 'ReduceShippingByAmount' | 'SetShippingToAmount' | 'ReduceProductPriceByPercentage' | 'ReduceProductPriceByAmount'
  - `maxPercentageDiscount` number, double, nullable
  - `expirationDate` string, date-time, nullable
  - `applyExpirationDateToExisting` boolean
  - `isStackable` boolean
  - `productId` integer, nullable
  - `product` QPilotCoreModelsDtoLegacyLegacyProductDto
    - `id` integer
    - `siteId` integer
    - `parentProductId` integer, nullable
    - `externalId` string, required
    - `type` string, required
    - `sku` string, nullable
    - `title` string, required
    - `description` string, nullable
    - `price` number, float
    - `salePrice` number, float, nullable
    - `length` string, nullable
    - `width` string, nullable
    - `height` string, nullable
    - `weight` string, nullable
    - `weightUnitType` 'Pound' | 'Ounce' | 'Kilogram' | 'Gram'
    - `lengthUnitType` 'Inch' | 'Foot' | 'Yard' | 'Milimeter' | 'Centimeter' | 'Meter'
    - `shippingClass` string, nullable
    - `taxClass` string, nullable
    - `imageUrl` string, nullable
    - `imageThumbUrl` string, nullable
    - `availability` 'None' | 'AddToScheduledOrder' | 'ProcessScheduledOrder'
    - `stockLevel` 'Undefined' | 'InStock' | 'OutOfStock' | 'Preorder'
    - `stock` integer, nullable
    - `createdUtc` string, date-time
    - `updatedUtc` string, date-time
    - `lifetimeValue` number, double
    - `active` boolean, nullable
    - `valid` boolean, nullable
    - `productGroupIds` integer[], nullable
    - `validationErrorCode` 1 | 2 | 3 | 4
    - `backordersAllowed` boolean, nullable
    - `metadata` object, nullable
    - `syncOnUpdate` boolean
    - `quantityLabel` string, nullable
  - `productDiscountNotAppliesWhenItHasSalePrice` boolean
  - `subtotalDiscountAppliesToRegularPrice` boolean
  - `createdUtc` string, date-time
  - `updatedUtc` string, date-time
  - `includeCustomerEmails` string, nullable
  - `excludeCustomerEmails` string, nullable
  - `active` boolean
  - `valid` boolean
  - `couponInvalidationCode` 'Expired' | 'SiteLimitExceeded' | 'ScheduledOrderLimitExceeded' | 'CustomerLimitExceeded' | 'GeographyNotMet' | 'TotalsNotMet' | 'UnitsNotMet' | 'MinWeightNotMet' | 'MaxWeightNotMet' | 'ScheduledOrderCyclesNotMet' | 'CustomerInclusionList' | 'CustomerExclusionList' | 'NonStackable' | 'ManuallyRemoved' | 'MaxAssignmentsReached' | 'MapRemoved' | 'ProductNotPresent' | 'SubtotalDiscountTypeMixed' | 'ItemHasSalePrice'
  - `productGroupId` integer, nullable
  - `productGroup` QPilotCoreModelsDtoEntitiesProductGroupDto
    - `productGroupId` integer, nullable
    - `name` string, required
    - `createdUtc` string, date-time, nullable
    - `updatedUtc` string, date-time, nullable
    - `siteId` integer
    - `products` QPilotCoreModelsDtoEntitiesProductGroupProductsDto[], nullable
      - `id` string, required
      - `title` string, nullable
  - `productsExternalIds` string[], nullable

---

[API](https://skmtc.net/qpilot/apis/qpilot-api.md) · [All operations](https://skmtc.net/qpilot/apis/qpilot-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/qpilot/qpilot-api/revisions/b2f13a808fdd/schema)
