Discount Definition
GET /discount-definition/current
GET /discount-definition/document/<_id>
POST /discount-definition/entity/<entity_id>
POST /discount-definition/updateEntitiesWithDependencies
PATCH /discount-definition/document/<_id>
Endpoints
GET /discount-definition/current
Request Parameters
In | Field Name | Type | Required | Description |
|---|---|---|---|---|
header |
| string | Yes | The identifier of the company to manage data for |
header |
| [ csv of string ] | No | The unique identifiers (UIDs) of the site to manage data for |
query |
| string | No | A filter expression in OData v4 format |
query |
| int32 | No | The maximum documents to return |
query |
| int32 | No | The documents to skip before returning |
query |
| string | No | An order by expression in OData v4 format |
query |
| string | Yes | The date and time to query against |
query |
| [ string ] | No | An array of entity identifiers |
query |
| boolean | No | Adds audit fields to each document when returning a result ( |
query |
| boolean | No | Includes the documents that are inactive for the current sites |
Response Codes
Response | Description |
|---|---|
200 OK | Success |
400 Bad Request | Bad request, for more information look at body error |
403 Forbidden | Invalid token |
404 Not Found | Not found |
422 Unprocessable Entity | Unprocessable error |
Default | Unexpected error |
GET /discount-definition/list
Request Parameters
In | Field Name | Type | Required | Description |
|---|---|---|---|---|
header |
| string | Yes | The identifier of the company to manage data for |
header |
| [ csv of string ] | No | The unique identifiers (UIDs) of the site to manage data for |
query |
| string | No | A filter expression in OData v4 format |
query |
| int32 | No | The maximum documents to return |
query |
| int32 | No | The documents to skip before returning |
query |
| string | No | An order by expression in OData v4 format |
query |
| string | Yes | The date and time to query against |
query |
| [ string ] | No | An array of entity identifiers |
query |
| boolean | No | Adds audit fields to each document when returning a result ( |
query |
| boolean | No | Includes the documents that are inactive for the current sites |
Response Codes
Response | Description |
|---|---|
200 OK | Success |
400 Bad Request | Bad request, for more information look at body error |
403 Forbidden | Invalid token |
404 Not Found | Not found |
422 Unprocessable Entity | Unprocessable error |
Default | Unexpected error |
GET /discount-definition/document/<_id>
Request Parameters
In | Field Name | Type | Required | Description |
|---|---|---|---|---|
header |
| string | Yes | The identifier of the company to manage data for |
path |
| string | Yes | The identifier of the document |
query |
| [ csv of string ] | No | Specifies |
Response Codes
Response | Description |
|---|---|
200 OK | Success |
400 Bad Request | Bad request, for more information look at body error |
403 Forbidden | Invalid token |
404 Not Found | Not found |
422 Unprocessable Entity | Unprocessable error |
Default | Unexpected error |
POST /discount-definition
Adds a new discount definition.
Request Parameters
In | Field Name | Type | Required | Description |
|---|---|---|---|---|
header |
| string | Yes | The identifier of the company to manage data for |
query |
| boolean | No | Hydrates-related nested objects when returning a result (For example, populate a Menu with menu categories and menu groups) |
query |
| [ string ] | No | Specifies |
body |
| Yes | The JSON of the category being patched |
Response Codes
Response | Description |
|---|---|
200 OK | Success |
400 Bad Request | Bad request, for more information look at body error |
403 Forbidden | Invalid token |
404 Not Found | Not found |
422 Unprocessable Entity | Unprocessable error |
Default | Unexpected error |
POST /discount-definition/entity/<entity_id>
Creates/Updates discount definitions.
Request Parameters
In | Field Name | Type | Required | Description |
|---|---|---|---|---|
header |
| string | Yes | The identifier of the company to manage data for |
path |
| string | Yes | The identifier of the entity |
body |
| Yes | The JSON formatted request |
Response Codes
Response | Description |
|---|---|
200 OK | Success |
400 Bad Request | Bad request, for more information look at body error |
403 Forbidden | Invalid token |
404 Not Found | Not found |
422 Unprocessable Entity | Unprocessable error |
Default | Unexpected error |
DELETE
Summary
Deletes an entity and all versions of it.
Request Parameters
In | Field Name | Type | Required | Description |
|---|---|---|---|---|
header |
| string | Yes | The identifier of the company to manage data for |
path |
| string | Yes | The identifier of the entity |
Response Codes
Response | Description |
|---|---|
200 OK | Success |
400 Bad Request | Bad request, for more information look at body error |
403 Forbidden | Invalid token |
404 Not Found | Not found |
422 Unprocessable Entity | Unprocessable error |
Default | Unexpected error |
POST /discount-definition/updateEntitiesWithDependencies
Creates/Updates discount definitions with the mappings.
Request Parameters
In | Field Name | Type | Required | Description |
|---|---|---|---|---|
header |
| string | Yes | The identifier of the company to manage data for |
header |
| [ string ] | No | The identifiers of the site to manage data for |
body |
| Yes | Supports the mappings field (array/boolean) for each document. With mappings: True mappings are created for the current date and sites from the |
Response Codes
Response | Description |
|---|---|
200 OK | Success |
400 Bad Request | Bad request, for more information look at body error |
403 Forbidden | Invalid token |
404 Not Found | Not found |
422 Unprocessable Entity | Unprocessable error |
Default | Unexpected error |
PATCH /discount-definition/document/<_id>
Partially updates a discount definition.
Request Parameters
In | Field Name | Type | Required | Description |
|---|---|---|---|---|
header |
| string | Yes | The identifier of the company to manage data for |
path |
| string | Yes | The identifier of the document |
query |
| boolean | No | Hydrates-related nested objects when returning a result (For example, populate a Menu with menu categories and menu groups) |
query |
| [ string ] | No | Specifies |
body |
| Yes | The JSON of the category being patched |
Response Codes
Response | Description |
|---|---|
200 OK | Success |
400 Bad Request | Bad request, for more information look at body error |
403 Forbidden | Invalid token |
404 Not Found | Not found |
422 Unprocessable Entity | Unprocessable error |
Default | Unexpected error |
Data Models
discount_definition
Field Name | Type | Required | Description |
|---|---|---|---|
| string | Yes | The name of the discount |
| boolean | No | The discount is active or not |
| string | Yes | The type of the discount (discount, comp, promo, coupon, loyalty) |
| string | Yes | The user-friendly and memorable discount code |
| boolean | No | This flag is used by the Mobile API and other integrating systems to indicate that this specific discount needs to be processed through the loyalty engine |
| object | Yes | |
| boolean | No | When enabled, the discount amount is distributed evenly across all items available to be discounted. When disabled, the discount amount is applied to each item available to be discounted. |
| string | Yes | The type of the discount (manual or automatic). The possible values are "manual" or "automatic." |
| boolean | No | The flag that indicates whether to apply to liability items or not |
| [ string ] | No | Allows the user to add the discount to an order using the added price look ups (PLUs) |
| [ string ] | No | Where the discount is available to apply. For example, at the order entry screen only, at the tender screen only or available both at the order entry screen and the tender screen. The possible values are "order_entry" or "tender." |
| [ string ] | No | Exclusive to other discounts. The possible values are "after" or "before."
|
| number (currency) | No | The maximum discount amount limit for the discount |
| string | No | Defines if the discount will apply to the amount of the original item or the remaining amount after all higher priority discounts have been applied. The possible values are"gross_item_amount" or "net_item_amount." |
| number (currency) | No | Configures the minimum order subtotal required for the discount to be applied |
| string | No | "Lowest" = The discount lowest-priced item if more than one item qualifies for the discount. 'Highest' = discount highest priced item if more than one item qualifies for the discount. "Next_highest" = The discount the second-highest or one of the multiple highest-priced items from the order if more than one item qualifies for the discount. The possible values are"lowest," "highest," or "next_highest." |
| [ object ] | Yes | The customer information prompts for specific discount types such as a student's or firefighter's badge number |
| object | No | Defines the availability of the discount |
| integer | No | The priority of the discount rule |
| boolean | No | Excludes child item prices in the discount calculation if the parent item qualifies for the discounts |
| boolean | No | This discount should be applied after all applicable taxes have been applied to the subtotal. |
| boolean | No | Excludes modifier prices in the discount calculation if the parent item qualifies for the discount |
| object | No | The discount evaluation criteria |
| object | No | Applies criteria for the discount when the discount evaluation criteria is met |
| object | No | The discount print options |
| object | No | This property contains access control definitions |
| [ string,object ] | No | An array of allowed Order Source entity identifiers |
| [ string ] | No | An array of allowed Order Source identifiers |
| [ string,object ] | No | |
| No | ||
| No | ||
| No | ||
| No | ||
| No | ||
| No | ||
| No | ||
| No | ||
| No | ||
| No |
discount_definition_create
Field Name | Type | Required | Description |
|---|---|---|---|
| string | Yes | The name of the discount |
| boolean | No | The flag that indicates if the discount is active or not |
| string | Yes | The type of the discount (discount, comp, promo, coupon, loyalty) |
| string | Yes | The user-friendly and memorable discount code |
| boolean | No | This flag is used by the Mobile API and other integrating systems to let them know that this specific discount needs to be processed through the loyalty engine |
| object | Yes | |
| boolean | No | When enabled, the discount amount is distributed evenly across all items available to be discounted. When disabled, the discount amount is applied to each item available to be discounted. |
| string | Yes | The type of the discount (manual or automatic). The possible values are "manual" or "automatic." |
| boolean | No | The flag that indicates whether to apply to liability items or not |
| [ string ] | No | Allows the user to add the discount to an order using the added price look ups (PLUs) |
| [ string ] | No | Where the discount is available to apply. For example, at the order entry screen only, at the tender screen only, or available both at the order entry screen and tender screen. The possible values are "order_entry" or "tender." |
| [ string ] | No | Exclusive to other discounts. The possible values are "after" or "before."
|
| number (currency) | No | The maximum discount amount limit for the discount |
| string | No | Defines if the discount applies to the amount of the original item or the remaining amount after all higher priority discounts have been applied. The possible values are"gross_item_amount" or "net_item_amount." |
| number (currency) | No | Configures the minimum order subtotal required for the discount to be applied |
| string | No | The possible values are "lowest," "highest," or "next_highest." "Lowest" = The discount lowest-priced item if more than one item qualifies for the discount. "Highest" = The discount highest priced item if more than one item qualifies for the discount. "Next_highest" = The discount the second-highest or one of the multiple highest-priced items from the order if more than one item qualifies for the discount. |
| [ object ] | Yes | The customer information prompts for specific discount types such as a student's or firefighter's badge number |
| object | No | Defines the availability of the discount |
| integer | No | The priority of the discount rule |
| boolean | No | Excludes child item prices in the discount calculation if the parent item qualifies for the discounts |
| boolean | No | This discount should be applied after all applicable taxes have been applied to the subtotal |
| boolean | No | Excludes modifier prices in the discount calculation if the parent item qualifies for the discount |
| object | No | The discount evaluation criteria |
| object | No | Applies criteria for the discount when the discount evaluation criteria is met |
| object | No | The discount print options |
| object | No | This property contains access control definitions |
| [ string, object ] | No | An array of allowed Order Source entity identifiers |
| [ string ] | No | An array of allowed Order Source identifiers |
| [ string, object ] | No | |
| No | ||
| No |
discount_definition_edit
Field Name | Type | Description |
|---|---|---|
| string | The name of the discount |
| boolean | The flag that indicates whether the discount is active or not |
| string | The type of the discount (discount, comp, promo, coupon, loyalty) |
| string | The user-friendly and memorable discount code |
| boolean | This flag is used by the Mobile API and other integrating systems to let them know that this specific discount needs to be processed through the loyalty engine |
| object | |
| boolean | When enabled the discount amount is distributed evenly across all items available to be discounted. When disabled the discount amount id applied to each item available to be discounted. |
| string | The type of the discount (manual or automatic). The possible values are "manual" or "automatic." |
| boolean | The flag that indicates whether to apply to liability items or not |
| [ string ] | Allows the user to add the discount to an order using the added price look ups (PLUs) |
| [ string ] | Where the discount is available to apply. For example, at the order entry screen only, at the tender screen only, or available both at the order entry screen and tender screen. Possible values: <"order_entry", "tender"> |
| [ string ] | Exclusive to other discounts. The possible values are "after" or "before."
|
| number (currency) | The maximum discount amount limit for the discount |
| string | Defines if the discount applies to the amount of the original item or the remaining amount after all higher priority discounts have been applied. The possible values are "gross_item_amount" or "net_item_amount." |
| number (currency) | Configures the minimum order subtotal required for the discount to be applied |
| string | The possible values are "lowest," "highest," or "next_highest." "Lowest" = The discount lowest-priced item if more than one item qualifies for the discount. "Highest" = The discount highest priced item if more than one item qualifies for the discount. "Next_highest" = The discount the second-highest or one of the multiple highest-priced items from the order if more than one item qualifies for the discount. |
| [ object ] | The customer information prompts for specific discount types such as a student's or a firefighter's badge number |
| object | Defines the availability of the discount |
| integer | Priority of the discount rule |
| boolean | Excludes child item prices in the discount calculation if the parent item qualifies for the discounts |
| boolean | This discount should be applied after all applicable taxes have been applied to the subtotal |
| boolean | Excludes modifier prices in the discount calculation if the parent item qualifies for the discount |
| object | The discount evaluation criteria |
| object | Applies criteria for the discount when the discount evaluation criteria is met |
| object | The discount print options |
| object | This property contains access control definitions |
| [ string,object ] | An array of allowed Order Source entity identifiers |
| [ string ] | An array of allowed Order Source identifiers |
| [ string,object ] | |
|
discount_definition_list
FieldName | Type | Description |
|---|---|---|
| integer | No |
| No |
name
Field Name | Type | Description |
|---|---|---|
| string |
_id
The auto-assigned system document identifier.
Field Name | Type | Description |
|---|---|---|
| string | The auto-assigned system document identifier |
company_id
The identifier of the company that owns the document.
Field Name | Type | Description |
|---|---|---|
| string | The identifier of the company that owns the document |
entity_id
The auto-assigned unique identifier (UID) of the entity, set on creation. All future versions of the entity share the same entity_id.
Field Name | Type | Description |
|---|---|---|
| string | The auto-assigned unique ID of this entity, set on creation. All future versions of this entity will share the same |
is_master
Field Name | Type | Description |
|---|---|---|
| boolean |
is_active
Marking property is the essence of active documents. Sets in true by default.
Field Name | Type | Description |
|---|---|---|
| boolean | Marking property is the essence of active documents. Sets in true by default. |
external_id
Field Name | Type | Description |
|---|---|---|
| string |
created_by
The identifier of the OPRA user or site that created the document.
Field Name | Type | Description |
|---|---|---|
| string | The identifier of the OPRA user or site that created the document |
updated_by
The identifier of the OPRA user or site that last updated the document.
Field Name | Type | Description |
|---|---|---|
| string | The identifier of the OPRA user or site that last updated the document |
created_at
The date and time the document was created.
Field Name | Type | Description |
|---|---|---|
| string | The date and time (date-time) the document was created |
updated_at
The last date and time the document was updated.
Field Name | Type | Description |
|---|---|---|
| string | The last date and time (date-time) the document was updated |