api.gift_cards¶
- /api/gift_cards/
- /api/gift_cards/(d+)/
- /api/gift_cards/(d+)/history/
- /api/gift_cards/(d+)/history/(d+)/
- /api/gift_cards/search/
/api/gift_cards/¶
GET /api/gift_cards/¶
Description:
Retrieve a summary list of all gift cards.
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | False | False | False |
Filters:
Name | Description |
---|---|
serialNumber | The gift card serial number |
id | The gift card id |
Request:
<!-- No XML Request. -->
Response:
<gift_cards>
<gift_card uri="/gift_cards/X/" id="X" full_render="false"/>
[...]
</gift_cards>
POST /api/gift_cards/¶
Description:
Create a new Gift Card
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | False | False | False |
Request:
<gift_card>
<!-- You may specify an invoice ID or a source ID (not required and specifying both is not allowed) -->
<invoice id="[unsigned integer]" />
<source_id>[string]</source_id>
<product id="[unsigned integer]" />
<serial_number>[string]</serial_number> <!-- If the server does not generate gift card serials this tag must be present, else it must not be present -->
<flags> <!-- optional -->
<active>[boolean]</active>
</flags>
<user id="[unsigned integer]" /> <!-- optional -->
<note>[string]</note> <!-- optional -->
<totals> <!-- Optional -->
<used>[decimal - max 2 decimal places]</used> <!-- Must be present if total is present -->
<credit>[decimal - max 2 decimal places]</credit> <!-- Must be present if used and total are present -->
<total>[decimal - max 2 decimal places]</total> <!-- Must be present if used is present -->
<!-- You can specify credit alone, or used AND credit AND total -->
</totals>
</gift_card>
Response:
<gift_card uri="/gift_cards/X/" id="X" full_render="true">
<!-- See GET /gift_cards/X/ response for details. -->
</gift_card>
/api/gift_cards/(d+)/¶
GET /api/gift_cards/(d+)/¶
Description:
Retrieve the details for a single gift card.
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | False | False | False |
Request:
<!-- No XML Request. -->
Response:
<gift_card uri="/gift_cards/A/" id="A" full_render="true">
<flags>
<active>false</active>
</flags>
<created>[datetime]</created>
<modified>[datetime]</modified>
<gift_card_id>[str]</gift_card_id>
<user uri="/users/B/" id="B"/>
<product uri="/products/C/" id="C"/>
<invoice uri="/invoices/D/" id="D"/>
<serial_number>[str]</serial_number>
<totals>
<total>[decimal]</total>
<used>[decimal]</used>
<credit>[decimal]</credit>
</totals>
<history_entries>
<history uri="/gift_cards/A/history/E/" id="E" full_render="true">
<!-- See GET /gift_cards/X/history/Y/ response for details. -->
</history>
[...]
</history_entries>
</gift_card>
/api/gift_cards/(d+)/history/¶
GET /api/gift_cards/(d+)/history/¶
Description:
Return a list of history entries for a specific gift card
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | False | False | False |
Request:
<!-- No XML Request. -->
Response:
<history_entries>
<history uri="/gift_cards/X/history/Y/" id="Y" full_render="true">
<!-- See GET /gift_cards/X/history/Y/ response for details. -->
</history>
[...]
</history_entries>
/api/gift_cards/(d+)/history/(d+)/¶
GET /api/gift_cards/(d+)/history/(d+)/¶
Description:
Return a specific history entry for a specific gift card
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | False | False | False |
Request:
<!-- No XML Request. -->
Response:
<history uri="/gift_cards/A/history/B/" id="B" full_render="true">
<created>[datetime]</created>
<user uri="/users/C/" id="C"/>
<note>[str]</note>
<source_id>[str]</source_id>
<totals>
<before>[decimal]</before>
<after>[decimal]</after>
<amount>[decimal]</amount>
</totals>
<activity>[str]</activity>
</history>
/api/gift_cards/search/¶
Data¶
Columns
name | type | required | default | sort_default | can_summarize |
---|---|---|---|---|---|
lsserver.search.column.gift_card_id | STRING | False | False | False | False |
lsserver.search.column.serial_number | STRING | False | False | False | False |
lsserver.search.column.total_credit | MONEY | False | False | False | False |
lsserver.search.column.total_used | MONEY | False | False | False | False |
lsserver.search.column.total | MONEY | False | False | False | False |
lsserver.search.column.active | BOOLEAN | False | False | 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.gift_card_id | STRING | False | None |
lsserver.search.filters.serial_number | STRING | False | None |
lsserver.search.filters.total_credit | MONEY | False | None |
lsserver.search.filters.total_used | MONEY | False | None |
lsserver.search.filters.total | MONEY | False | None |
lsserver.search.filters.active | BOOLEAN | False | None |
lsserver.search.filters.created | DATETIME | False | None |
lsserver.search.filters.modified | DATETIME | False | None |
GET /api/gift_cards/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/gift_cards/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>