api.sale_events¶
- /api/sale_events/
- /api/sale_events/(d+)/
- /api/sale_events/(d+)/sale_offers/
- /api/sale_events/(d+)/sale_offers/(d+)/
- /api/sale_events/(d+)/sale_offers/(d+)/add_customer_categories/
- /api/sale_events/(d+)/sale_offers/(d+)/add_products/
- /api/sale_events/(d+)/sale_offers/(d+)/customer_categories/
- /api/sale_events/(d+)/sale_offers/(d+)/products/
- /api/sale_events/(d+)/sale_offers/(d+)/remove_customer_categories/
- /api/sale_events/(d+)/sale_offers/(d+)/remove_products/
- /api/sale_events/search/
/api/sale_events/¶
GET /api/sale_events/¶
Description:
List all Sale Events
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | False | False | False |
Request:
<!-- No XML Request -->
Response:
<sale_events>
<sale_event uri="/sale_events/X/" id="X" etag="[int]">
<!-- See GET /sale_events/X/ response for details. -->
</sale_event>
[...]
</sale_events>
POST /api/sale_events/¶
Description:
Create a Sale Event
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | False | True | False |
Request:
<sale_event>
<start_date>[datetime]</start_date> <!-- Mandatory -->
<end_date>[datetime]</end_date> <!-- Mandatory -->
<name>[string]</name>
<description>[string]</description>
<on>[boolean]</on>
</sale_event>
Response:
<sale_event uri="/sale_events/X/" id="X">
<!-- See GET /sale_events/X/ response for details. -->
</sale_event>
/api/sale_events/(d+)/¶
GET /api/sale_events/(d+)/¶
Description:
Get details of a Sale Event
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | False | True | False |
Request:
<!-- No XML Request -->
Response:
<sale_event uri="/sale_events/X/" id="X">
<start_date>[datetime]</start_date>
<end_date>[datetime]</end_date>
<name>[string]</name>
<description>[string]</description>
<on>[boolean]</on>
<sale_offers>
<sale_offer uri="/sale_events/X/sale_offers/Y/" id="Y">
<!-- See GET /sale_events/X/sale_offers/Y/ response for details -->
</sale_offer>
[...]
</sale_offers>
</sale_event>
PUT /api/sale_events/(d+)/¶
Description:
Update a Sale Event
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | False | True | True |
Request:
<sale_event>
<start_date>[datetime]</start_date>
<end_date>[datetime]</end_date>
<name>[string]</name>
<description>[string]</description>
<on>[boolean]</on>
</sale_event>
Response:
<sale_event uri="/sale_events/X/" id="X">
<!-- See GET /sale_events/X/ response for details. -->
</sale_event>
DELETE /api/sale_events/(d+)/¶
Description:
Delete a Sale Event
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | False | False | True |
Request:
<!-- No XML Request -->
Response:
<sale_event uri="/sale_events/X/" id="X" deleted="true"/>
/api/sale_events/(d+)/sale_offers/¶
GET /api/sale_events/(d+)/sale_offers/¶
Description:
List all Sale Offers tied to a Sale Event
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | False | True | False |
Request:
<!-- No XML Request -->
Response:
<sale_offers>
<sale_offer uri="/sale_events/X/sale_offers/Y/" id="Y">
<!-- See GET /sale_events/X/sale_offers/Y/ response for details. -->
</sale_offer>
[...]
</sale_offers>
POST /api/sale_events/(d+)/sale_offers/¶
Description:
Create a Sale Offer for a Sale Event. etag version of the Sale Event is required.
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | False | True | True |
Request:
<sale_offer>
<name>[string]</name>
<discount>
<percent>[decimal]</percent> <!-- Mutually exclusive with value -->
<value>[decimal]</value> <!-- Mutually exclusive with percent -->
</discount>
</sale_offer>
Response:
<sale_offer uri="/sale_events/X/sale_offers/Y/" id="Y">
<!-- See GET /sale_events/X/sale_offers/Y/ response for details. -->
</sale_offer>
/api/sale_events/(d+)/sale_offers/(d+)/¶
GET /api/sale_events/(d+)/sale_offers/(d+)/¶
Description:
Describe a Sale Offer.
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | False | True | False |
Request:
<!-- No XML Request -->
Response:
<sale_offer uri="/sale_events/X/sale_offers/Y/" id="Y">
<name>[string]</name>
<discount>
<percent>[decimal]</percent> <!-- Mutually exclusive with value -->
<value>[decimal]</value> <!-- Mutually exclusive with percent -->
</discount>
<products total_count="[int]"> <!-- Only render total_count attributes if bigger than 10 -->
<product uri="/products/A/" id="A" full_render="true">
<!-- See GET /products/X/ response for details. -->
</product>
[...] <!-- Up to first 10 products in the offer. --->
</products>
<customer_categories>
<customer_category uri="/setup/customer_categories/B/" id="B">
<!-- see GET /customer_categories/X/ response for details. -->
</customer_category>
[...]
</customer_categories>
</sale_offer>
PUT /api/sale_events/(d+)/sale_offers/(d+)/¶
Description:
Update a Sale Offer. etag version of the Sale Event is required.
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | False | True | True |
Request:
<sale_offer>
<name>[string]</name>
<discount>
<percent>[decimal]</percent> <!-- Mutually exclusive with value -->
<value>[decimal]</value> <!-- Mutually exclusive with percent -->
</discount>
</sale_offer>
Response:
<sale_offer uri="/sale_events/X/sale_offers/Y/" id="Y">
<!-- See GET /sale_events/X/sale_offers/Y/ response for details. -->
</sale_offer>
DELETE /api/sale_events/(d+)/sale_offers/(d+)/¶
Description:
Remove a sale offer. etag version of the Sale Event is required.
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | False | True | True |
Request:
<!-- No XML Request -->
Response:
<sale_offer uri="/sale_events/X/sale_offers/Y/" id="Y" deleted="true"/>
/api/sale_events/(d+)/sale_offers/(d+)/add_customer_categories/¶
POST /api/sale_events/(d+)/sale_offers/(d+)/add_customer_categories/¶
Description:
Add many customer categories to a sale offer. etag version of the Sale Event is required.
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | False | True | True |
Request:
<customer_categories>
<customer_category id="[int]"/>
[...]
</customer_categories>
Response:
<customer_categories> <!-- Only customer categories that have been added. -->
<customer_category uri="/setup/customer_categories/X/" id="X" full_render="true">
<!-- see GET /setup/customer_categories/X/ response for details. -->
</customer_category>
[...]
</customer_categories>
/api/sale_events/(d+)/sale_offers/(d+)/add_products/¶
POST /api/sale_events/(d+)/sale_offers/(d+)/add_products/¶
Description:
Add products to a sale offer. etag version of the Sale Event is required.
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | False | True | True |
Request:
<products>
<product id="[int]"/>
[...]
</products>
Response:
<products> <!-- Only products that have been added. -->
<product uri="/products/X/" id="X" full_render="true">
<!-- see GET /products/X/ response for details. -->
</product>
[...]
</products>
/api/sale_events/(d+)/sale_offers/(d+)/customer_categories/¶
GET /api/sale_events/(d+)/sale_offers/(d+)/customer_categories/¶
Description:
List all categories tied to a sale offer.
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | False | True | False |
Request:
<!-- No XML Request -->
Response:
<customer_categories>
<customer_category uri="/setup/customer_categories/X/ id="X">
<!-- see GET /setup/customer_categories/X/ response for details. -->
</customer_category>
[...]
</customer_categories>
/api/sale_events/(d+)/sale_offers/(d+)/products/¶
GET /api/sale_events/(d+)/sale_offers/(d+)/products/¶
Description:
List all the products tied to a sale offer.
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | False | True | False |
Request:
<!-- No XML Request -->
Response:
<products>
<product uri="/products/X/" id="X" full_render="true">
<!-- see GET /products/X/ response for details. -->
</product>
[...]
</products>
/api/sale_events/(d+)/sale_offers/(d+)/remove_customer_categories/¶
POST /api/sale_events/(d+)/sale_offers/(d+)/remove_customer_categories/¶
Description:
Remove a customer category from a sale offer. etag version of the Sale Event is required.
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | False | True | True |
Request:
<customer_categories>
<customer_category id="[int]"/>
[...]
</customer_categories>
Response:
<!-- No XML Response -->
/api/sale_events/(d+)/sale_offers/(d+)/remove_products/¶
POST /api/sale_events/(d+)/sale_offers/(d+)/remove_products/¶
Description:
Remove many products from the sale offer at once. etag version of the Sale Event is required.
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | False | True | True |
Request:
<products>
<product id="[int]"/>
[...]
</products>
Response:
<!-- No XML Response -->
/api/sale_events/search/¶
Data¶
Columns
name | type | required | default | sort_default | can_summarize |
---|---|---|---|---|---|
lsserver.search.column.name | STRING | False | True | False | False |
lsserver.search.column.description | STRING | False | True | False | False |
lsserver.search.column.on | BOOLEAN | False | True | True | False |
lsserver.search.column.start_date | DATETIME | False | True | False | False |
lsserver.search.column.end_date | DATETIME | False | True | False | False |
lsserver.search.column.created | DATETIME | False | False | False | False |
lsserver.search.column.modified | DATETIME | False | False | False | False |
Filters
name | type | required | enum_values |
---|---|---|---|
lsserver.search.filters.name | STRING | False | None |
lsserver.search.filters.description | STRING | False | None |
lsserver.search.filters.on | BOOLEAN | False | None |
lsserver.search.filters.start_date | DATE | False | None |
lsserver.search.filters.end_date | DATE | False | None |
lsserver.search.filters.created_date | DATE | False | None |
lsserver.search.filters.modified_date | DATE | False | None |
lsserver.search.filters.product_code | STRING | False | None |
lsserver.search.filters.product_description | STRING | False | None |
lsserver.search.filters.customer_category | STRING | False | None |
GET /api/sale_events/search/¶
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | False | False | False |
Request:
<!-- No XML Request. -->
Response:
<search_criteria>
<columns>
<column id="[str]">
<name>
<localizable_message/> <!-- mutually exclusive with <raw> -->
<raw>[str]</raw><!-- mutually exclusive with <localizable_message> -->
</name> <!-- The localizable name of this column -->
<type>[enum: STRING | INTEGER | DECIMAL | MONEY | DATE | DATETIME | BOOLEAN]</type>
<required>[bool]</required><!-- Indicates that this item must be part of the query -->
<default>[bool]</default><!-- Indicates which columns should be selected by default -->
<sort_default>[bool]</sort_default><!-- Indicates that this column should be selected as the sort column by default -->
<sort_default_order_by>[enum: ASC | DESC]</sort_default_order_by><!-- Indicates what the default order by should be for this column -->
<can_summarize>[bool]</can_summarize><!-- Indicates that this column can be used to generate a summarized total -->
</column>
[...]
</columns>
<filters>
<filter id="[str]">
<name>
<localizable_message/> <!-- mutually exclusive with <raw> -->
<raw>[str]</raw><!-- mutually exclusive with <localizable_message> -->
</name> <!-- The localizable name of this filter -->
<type>[enum: ENUM | STRING | INTEGER | DECIMAL | MONEY | DATE | DATETIME | BOOLEAN ]</type><!-- Defines the type of data this filter represents -->
<enum_values><!-- Present if and only if type is ENUM -->
<enum_value>
<name>
<localizable_message/> <!-- Mutually exclusive with <raw> -->
<raw>[str]</raw> <!-- Mutually exclusive with <localizable_message> -->
</name> <!-- The name to be displayed -->
<value>[str]</value> <!-- The value to be passed to the server in <filters> of a POST -->
</enum_value>
[...]
</enum_values>
</filter>
[...]
</filters>
</search_criteria>
POST /api/sale_events/search/¶
Description:
Executes a search based on the content of the post. Responses are streamed to
the client.
Note: Read only clients may POST searches.
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | False | False | False |
Request:
<search>
<include_total>[bool]</include_total> <!-- True by default -->
<page> <!-- optional if getting the whole dataset -->
<offset>[int]</offset> <!-- optional -->
<count>[int]</count> <!-- optional -->
</page>
<summarized_column><!-- Optional. When specified, a summarized total is added to the data -->
<column id="[str]"/>
</summarized_column>
<search_query>
<columns><!-- optional. If no columns are specified, the default columns are selected.-->
<column id="[str]"/>
[...]
</columns>
<sort_by_column><!-- optional. If not specified, the default columns is used for sorting. -->
<column id="[str]"/>
<order_by>[enum: ASC | DESC]</order_by><!-- Optional. If not specified the default order by is used.-->
</sort_by_column>
<filters><!-- optional or content optional-->
<!--
Predicate search based on the filter list from the GET
Predicate searches take the form of:
lsserver.search.column.fictional_column > 10 AND (lsserver.search.column.fictional_column2 == 0 OR lsserver.search.column.fictional_column3 != 0)
-->
</filters>
</search_query>
</search>
Response:
<data>
<info>
<total_count>[int]</total_count>
<summarized_column>
<column>
<name>
<localizable_message/> <!-- mutually exclusive with <raw> -->
<raw>[str]</raw><!-- mutually exclusive with <localizable_message> -->
</name>
<type>[enum: INTEGER | DECIMAL | MONEY ]</type>
</column>
</summarized_column>
<summarized_total>[int|decimal]</summarized_total>
</info>
<columns>
<column>
<name>
<localizable_message/> <!-- mutually exclusive with <raw> -->
<raw>[str]</raw><!-- mutually exclusive with <localizable_message> -->
</name>
<type>[enum: STRING | INTEGER | DECIMAL | MONEY | DATE | DATETIME | BOOLEAN]</type>
</column>
[...]
</columns>
<rows>
<row>
<links> <!-- Links to relevant documents -->
<link>
<product uri="" id="" />
</link>
[...]
</links>
<cell>
<type>[enum: STRING | INTEGER | DECIMAL | MONEY | DATE | DATETIME | BOOLEAN]</type>
<value>[str | int | decimal | date | datetime | bool]</value>
</cell>
[...] <!-- The count will always match the column count -->
</row>
</rows>
</data>