POST Discounts/Post/{SiteID}?PackageId={PackageId}

Post to create Discount

Request Information

URI Parameters

Name Type Description Additional information
SiteID integer

PackageId integer

Optional: leave null and the method Package/GetLatestPackageForSite will be used to determine packageid

None.

Body Parameters

PostDiscountModel
Name Type Description Additional information
CMReasonID integer

Reason for Discount. See Get Reason Types.

Name string

Discount name. This will show on the Transaction and Reports.

Amount decimal number

Discount Amount.

PromptText string

IsDiscountByPercentage boolean

True: Amount is Percentage. False: Amount is whole number.

IsManagerOverride boolean

Used to set if Manager permissions are required.

IsApplyToOptions boolean

Used to set if Discount should apply to Options or only full Items.

IsMustHaveItemsSelected boolean

Used to set if items must be selected before discount is applied. If not; All items on the Transaction are discounted.

IsPromptForReason boolean

Used to set if Reason prompt should show on every trigger of the discount.

IncludedProducts string

Used to specify which Products discount can be applied to. CSV List.

MaxCovers integer

Used to set if Discount should apply if Transaction exceeds cover count.

TriggerBarcode string

Used to set barcode value to trigger the Discount through a barcode scan.

StartDate date

Start Date from which Discount can be applied.

EndDate date

End Date at which Discount can no longer be applied.

PriceGroupIDs string

Price Group IDs for which Discount can apply to. If none set, applies to all Price Groups.

ApplyIfBestDiscount boolean

Used to set priority if more than one Discount is being applied.

MaxValue decimal number

Used to set Maximum Discount value which applying Discount will not exceed.

StockCode string

Stock Code used for Reporting and Stock.

ShortName string

Short name used on bills and receipts.

Quantity integer

Used to set how many of the discount should be applied.

DiscountSchedule Collection of PostDiscountSchedule

List of schedules (day of the week) when Promotion should trigger.

Request Formats

application/json, text/json

Sample:
{
  "CMReasonID": 1,
  "Name": "sample string 2",
  "Amount": 3.0,
  "PromptText": "sample string 4",
  "IsDiscountByPercentage": true,
  "IsManagerOverride": true,
  "IsApplyToOptions": true,
  "IsMustHaveItemsSelected": true,
  "IsPromptForReason": true,
  "IncludedProducts": "sample string 10",
  "MaxCovers": 11,
  "TriggerBarcode": "sample string 12",
  "StartDate": "2025-03-31T22:32:32.9735535+01:00",
  "EndDate": "2025-03-31T22:32:32.9735535+01:00",
  "PriceGroupIDs": "sample string 15",
  "ApplyIfBestDiscount": true,
  "MaxValue": 17.0,
  "StockCode": "sample string 18",
  "ShortName": "sample string 19",
  "Quantity": 20,
  "DiscountSchedule": [
    {
      "Weekday": 1,
      "StartTime": "00:00:00.1234567",
      "EndTime": "00:00:00.1234567"
    },
    {
      "Weekday": 1,
      "StartTime": "00:00:00.1234567",
      "EndTime": "00:00:00.1234567"
    }
  ]
}

application/xml, text/xml

Sample:
<PostDiscountModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Tevalis.API.App.Models">
  <_x003C_Amount_x003E_k__BackingField>3</_x003C_Amount_x003E_k__BackingField>
  <_x003C_ApplyIfBestDiscount_x003E_k__BackingField>true</_x003C_ApplyIfBestDiscount_x003E_k__BackingField>
  <_x003C_CMReasonID_x003E_k__BackingField>1</_x003C_CMReasonID_x003E_k__BackingField>
  <_x003C_DiscountSchedule_x003E_k__BackingField>
    <PostDiscountSchedule>
      <EndTime>PT0.1234567S</EndTime>
      <StartTime>PT0.1234567S</StartTime>
      <Weekday>1</Weekday>
    </PostDiscountSchedule>
    <PostDiscountSchedule>
      <EndTime>PT0.1234567S</EndTime>
      <StartTime>PT0.1234567S</StartTime>
      <Weekday>1</Weekday>
    </PostDiscountSchedule>
  </_x003C_DiscountSchedule_x003E_k__BackingField>
  <_x003C_EndDate_x003E_k__BackingField>2025-03-31T22:32:32.9735535+01:00</_x003C_EndDate_x003E_k__BackingField>
  <_x003C_IncludedProducts_x003E_k__BackingField>sample string 10</_x003C_IncludedProducts_x003E_k__BackingField>
  <_x003C_IsApplyToOptions_x003E_k__BackingField>true</_x003C_IsApplyToOptions_x003E_k__BackingField>
  <_x003C_IsDiscountByPercentage_x003E_k__BackingField>true</_x003C_IsDiscountByPercentage_x003E_k__BackingField>
  <_x003C_IsManagerOverride_x003E_k__BackingField>true</_x003C_IsManagerOverride_x003E_k__BackingField>
  <_x003C_IsMustHaveItemsSelected_x003E_k__BackingField>true</_x003C_IsMustHaveItemsSelected_x003E_k__BackingField>
  <_x003C_IsPromptForReason_x003E_k__BackingField>true</_x003C_IsPromptForReason_x003E_k__BackingField>
  <_x003C_MaxCovers_x003E_k__BackingField>11</_x003C_MaxCovers_x003E_k__BackingField>
  <_x003C_MaxValue_x003E_k__BackingField>17</_x003C_MaxValue_x003E_k__BackingField>
  <_x003C_Name_x003E_k__BackingField>sample string 2</_x003C_Name_x003E_k__BackingField>
  <_x003C_PriceGroupIDs_x003E_k__BackingField>sample string 15</_x003C_PriceGroupIDs_x003E_k__BackingField>
  <_x003C_PromptText_x003E_k__BackingField>sample string 4</_x003C_PromptText_x003E_k__BackingField>
  <_x003C_Quantity_x003E_k__BackingField>20</_x003C_Quantity_x003E_k__BackingField>
  <_x003C_ShortName_x003E_k__BackingField>sample string 19</_x003C_ShortName_x003E_k__BackingField>
  <_x003C_StartDate_x003E_k__BackingField>2025-03-31T22:32:32.9735535+01:00</_x003C_StartDate_x003E_k__BackingField>
  <_x003C_StockCode_x003E_k__BackingField>sample string 18</_x003C_StockCode_x003E_k__BackingField>
  <_x003C_TriggerBarcode_x003E_k__BackingField>sample string 12</_x003C_TriggerBarcode_x003E_k__BackingField>
</PostDiscountModel>

application/x-www-form-urlencoded

Sample:

Sample not available.

Response Information

Resource Description

tblCMDiscount
Name Type Description Additional information
CMDiscountID integer

None.

CMPackageID integer

None.

CMReasonID integer

None.

Name string

None.

Amount decimal number

None.

PromptText string

None.

IsDiscountByPercentage boolean

None.

IsManagerOverride boolean

None.

IsApplyToOptions boolean

None.

IsMustHaveItemsSelected boolean

None.

IsPromptForReason boolean

None.

IncludedProducts string

None.

AvailableThroughTevalisAPI boolean

None.

MaxCovers integer

None.

TriggerBarcode string

None.

StartDate date

None.

EndDate date

None.

PriceGroupIDs string

None.

ApplyIfBestDiscount boolean

None.

CostPricePlusPercentage boolean

None.

MaxValue decimal number

None.

UseOriginalGrossForServiceCharge boolean

None.

StockCode string

None.

ShortName string

None.

Quantity integer

None.

tblCMDiscountSchedules Collection of tblCMDiscountSchedule

None.

tblCMDiscountExcludedFromPackageSites Collection of tblCMDiscountExcludedFromPackageSite

None.

Response Formats

application/json, text/json

Sample:
{
  "CMDiscountID": 1,
  "CMPackageID": 2,
  "CMReasonID": 1,
  "Name": "sample string 4",
  "Amount": 5.0,
  "PromptText": "sample string 6",
  "IsDiscountByPercentage": true,
  "IsManagerOverride": true,
  "IsApplyToOptions": true,
  "IsMustHaveItemsSelected": true,
  "IsPromptForReason": true,
  "IncludedProducts": "sample string 12",
  "AvailableThroughTevalisAPI": true,
  "MaxCovers": 14,
  "TriggerBarcode": "sample string 15",
  "StartDate": "2025-03-31T22:32:32.9994396+01:00",
  "EndDate": "2025-03-31T22:32:32.9994396+01:00",
  "PriceGroupIDs": "sample string 18",
  "ApplyIfBestDiscount": true,
  "CostPricePlusPercentage": true,
  "MaxValue": 21.0,
  "UseOriginalGrossForServiceCharge": true,
  "StockCode": "sample string 23",
  "ShortName": "sample string 24",
  "Quantity": 25,
  "tblCMDiscountSchedules": [
    {
      "CMDiscountScheduleID": 1,
      "CMDiscountID": 1,
      "Weekday": 3,
      "StartTime": "00:00:00.1234567",
      "EndTime": "00:00:00.1234567"
    }
  ],
  "tblCMDiscountExcludedFromPackageSites": [
    {
      "CMDiscountExcludedFromPackageSiteID": 1,
      "CMDiscountID": 1,
      "CMSiteID": 1,
      "CMPackageID": 1
    }
  ]
}

application/xml, text/xml

Sample:
<tblCMDiscount xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Tevalis.CM.DAL">
  <CMDiscountID>1</CMDiscountID>
  <CMPackageID>2</CMPackageID>
  <CMReasonID>1</CMReasonID>
  <Name>sample string 4</Name>
  <Amount>5</Amount>
  <PromptText>sample string 6</PromptText>
  <IsDiscountByPercentage>true</IsDiscountByPercentage>
  <IsManagerOverride>true</IsManagerOverride>
  <IsApplyToOptions>true</IsApplyToOptions>
  <IsMustHaveItemsSelected>true</IsMustHaveItemsSelected>
  <IsPromptForReason>true</IsPromptForReason>
  <IncludedProducts>sample string 12</IncludedProducts>
  <AvailableThroughTevalisAPI>true</AvailableThroughTevalisAPI>
  <MaxCovers>14</MaxCovers>
  <TriggerBarcode>sample string 15</TriggerBarcode>
  <StartDate>2025-03-31T22:32:32.9994396+01:00</StartDate>
  <EndDate>2025-03-31T22:32:32.9994396+01:00</EndDate>
  <PriceGroupIDs>sample string 18</PriceGroupIDs>
  <ApplyIfBestDiscount>true</ApplyIfBestDiscount>
  <CostPricePlusPercentage>true</CostPricePlusPercentage>
  <MaxValue>21</MaxValue>
  <UseOriginalGrossForServiceCharge>true</UseOriginalGrossForServiceCharge>
  <StockCode>sample string 23</StockCode>
  <ShortName>sample string 24</ShortName>
  <Quantity>25</Quantity>
  <tblCMDiscountSchedules>
    <tblCMDiscountSchedule>
      <CMDiscountScheduleID>1</CMDiscountScheduleID>
      <CMDiscountID>1</CMDiscountID>
      <Weekday>3</Weekday>
      <StartTime>PT0.1234567S</StartTime>
      <EndTime>PT0.1234567S</EndTime>
    </tblCMDiscountSchedule>
  </tblCMDiscountSchedules>
  <tblCMDiscountExcludedFromPackageSites>
    <tblCMDiscountExcludedFromPackageSite>
      <CMDiscountExcludedFromPackageSiteID>1</CMDiscountExcludedFromPackageSiteID>
      <CMDiscountID>1</CMDiscountID>
      <CMSiteID>1</CMSiteID>
      <CMPackageID>1</CMPackageID>
    </tblCMDiscountExcludedFromPackageSite>
  </tblCMDiscountExcludedFromPackageSites>
</tblCMDiscount>