api.suppliers¶
/api/suppliers/¶
GET /api/suppliers/¶
Description:
Return a detailed list of existing suppliers.
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | False | False | False |
Request:
<!-- No XML Request. -->
Response:
<suppliers>
<supplier uri="/suppliers/X/" id="X">
<name>[str]</name>
<contact>
<first>[str]</first>
<last>[str]</last>
</contact>
<email>[str]</email>
<phone_numbers>
<phone_number id="[int]">
<main>[bool]</main>
<type>[enum: work|home|mobile|main|home fax|work fax|toll-free|other]</type>
<list_order>[int]</list_order>
<number>[str]</number>
</phone_number>
[...] <!-- 4 phone numbers with ids 1-4 -->
</phone_numbers>
<billing>
<address>
<address1>[str]</address1>
<address2>[str]</address2>
<city>[str]</city>
<state>[str]</state>
<country>[str]</country>
<zip>[str]</zip>
</address>
</billing>
<photo uri="/suppliers/X/supplier_photo/"/>
</supplier>
[...]
</suppliers>
POST /api/suppliers/¶
Description:
Creates a new supplier
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | False | False | False |
Request:
<supplier>
<name>[str]</name><!-- Required -->
<contact>
<first>[str]</first><!-- Optional -->
<last>[str]</last><!-- Optional -->
</contact>
<email>[str]</email><!-- Optional -->
<homepage>[str]</homepage><!-- Optional -->
<phone_numbers><!-- Optional -->
<phone_number id="[int]">
<main>[bool]</main><!-- Optional -->
<type>[enum: work|home|mobile|main|home fax|work fax|toll-free|other]</type><!-- Optional -->
<number>[str]</number><!-- Optional -->
</phone_number>
[0-4 values possible]
</phone_numbers>
<billing><!-- Optional -->
<address>
<address1>[str]</address1><!-- Optional -->
<address2>[str]</address2><!-- Optional -->
<city>[str]</city><!-- Optional -->
<state>[str]</state><!-- Optional -->
<country>[str]</country><!-- Optional -->
<zip>[str]</zip><!-- Optional -->
</address>
</billing>
<shipping><!-- Optional -->
<address>
<address1>[str]</address1><!-- Optional -->
<address2>[str]</address2><!-- Optional -->
<city>[str]</city><!-- Optional -->
<state>[str]</state><!-- Optional -->
<country>[str]</country><!-- Optional -->
<zip>[str]</zip><!-- Optional -->
</address>
</shipping>
<new_import>[bool]</new_import><!-- Optional -->
<store>[bool]</store><!-- Optional -->
<import_id>[str]</import_id><!-- Optional -->
<currency id="[int]" /><!-- Optional -->
<tax_exemption id="[int]" /><!-- Optional -->
<terms id="[int]" /><!-- Optional -->
<account_status id="[int]" /><!-- Optional -->
</supplier>
Response:
<supplier uri="/suppliers/X/" id="X">
<!-- See GET /suppliers/X/ response for details. -->
</supplier>
/api/suppliers/(d+)/¶
GET /api/suppliers/(d+)/¶
Description:
Return detailed information of a specific supplier.
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
True | False | False | False |
Request:
<!-- No XML Request. -->
Response:
<supplier uri="/suppliers/X/" id="X">
<name>[str]</name>
<created>[datetime]</created>
<modified>[datetime]</modified>
<contact>
<first>[str]</first>
<last>[str]</last>
</contact>
<email>[str]</email>
<homepage>[str]</homepage>
<phone_numbers>
<phone_number id="[int]"> <!-- The id is new. Values 1-4 --><!-- The phone_number will be empty if null -->
<main>[bool]</main>
<type>[enum: work|home|mobile|main|home fax|work fax|toll-free|other]</type>
<list_order>[int]</list_order><!-- The list order will always match the id -->
<number>[str]</number>
</phone_number>
[Exactly 4 numbers present.]
</phone_numbers>
<billing>
<address>
<address1>[str]</address1>
<address2>[str]</address2>
<city>[str]</city>
<state>[str]</state>
<country>[str]</country>
<zip>[str]</zip>
</address>
</billing>
<shipping>
<address>
<address1>[str]</address1>
<address2>[str]</address2>
<city>[str]</city>
<state>[str]</state>
<country>[str]</country>
<zip>[str]</zip>
</address>
</shipping>
<new_import>[bool]</new_import><!-- Removed the flags wrapper -->
<store>[bool]</store>
<supplier_id>[str]</supplier_id>
<import_id>[str]</import_id>
<notes>
<note uri="/suppliers/X/notes/Y/" id="Y"/>
[...]
</notes>
<currency uri="/setup/currencies/x/" id="x" full_render="true">
<name>[str]</name>
<rate>[decimal]</rate>
<symbol>[str]</symbol>
</currency>
<tax_exemption uri="/setup/tax_exemptions/1/" id="1">
<!-- See GET /setup/tax_exemptions/X/ response for details. -->
</tax_exemption>
<terms uri="/setup/terms/[int]/" id="[int]" full_render="true">
<name>[str]</name>
<list_order>[int]</list_order>
<account>[bool]</account>
<terms_days>[int]</terms_days>
<active>[bool]</active>
</terms>
<account_status uri="/setup/account_statuses/[int]/" id="[int]">
<!-- See GET /setup/account_statuses/X/ for details -->
</account_status>
<photo uri="/suppliers/X/supplier_photo/"/>
</supplier>
PUT /api/suppliers/(d+)/¶
Description:
Updates the values of a supplier.
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
True | True | False | False |
Request:
<supplier>
<name>[str]</name><!-- Optional -->
<contact>
<first>[str]</first><!-- Optional -->
<last>[str]</last><!-- Optional -->
</contact>
<email>[str]</email><!-- Optional -->
<homepage>[str]</homepage><!-- Optional -->
<phone_numbers><!-- Optional -->
<phone_number id="[int]">
<main>[bool]</main><!-- Optional -->
<type>[enum: work|home|mobile|main|home fax|work fax|toll-free|other]</type><!-- Optional -->
<number>[str]</number><!-- Optional -->
</phone_number>
[0-4 values possible]
</phone_numbers>
<billing><!-- Optional -->
<address>
<address1>[str]</address1><!-- Optional -->
<address2>[str]</address2><!-- Optional -->
<city>[str]</city><!-- Optional -->
<state>[str]</state><!-- Optional -->
<country>[str]</country><!-- Optional -->
<zip>[str]</zip><!-- Optional -->
</address>
</billing>
<shipping><!-- Optional -->
<address>
<address1>[str]</address1><!-- Optional -->
<address2>[str]</address2><!-- Optional -->
<city>[str]</city><!-- Optional -->
<state>[str]</state><!-- Optional -->
<country>[str]</country><!-- Optional -->
<zip>[str]</zip><!-- Optional -->
</address>
</shipping>
<new_import>[bool]</new_import><!-- Optional -->
<store>[bool]</store><!-- Optional -->
<import_id>[str]</import_id><!-- Optional -->
<currency id="[int]" /><!-- Optional -->
<tax_exemption id="[int]" /><!-- Optional -->
<terms id="[int]" /><!-- Optional -->
<account_status id="[int]" /><!-- Optional -->
</supplier>
Response:
<supplier uri="/suppliers/X/" id="X">
<!-- See GET /suppliers/X/ response for details. -->
</supplier>
/api/suppliers/search/¶
Data¶
Columns
name | type | required | default | sort_default | can_summarize |
---|---|---|---|---|---|
lsserver.search.column.id | STRING | False | False | False | False |
lsserver.search.column.name | STRING | False | True | True | False |
lsserver.search.column.email | STRING | False | True | False | False |
lsserver.search.column.phone | STRING | False | True | False | False |
lsserver.search.column.city | STRING | False | False | False | False |
lsserver.search.column.state_province | STRING | False | False | False | False |
lsserver.search.column.country | STRING | False | False | False | False |
lsserver.search.column.currency | STRING | False | False | False | False |
lsserver.search.column.terms | STRING | False | False | False | False |
lsserver.search.column.account_status | STRING | False | False | False | False |
lsserver.search.column.supplier_custom_field_0 | STRING/DATE/BOOLEAN | False | False | False | False |
Filters
name | type | required | enum_values |
---|---|---|---|
lsserver.search.filters.name | STRING | False | None |
lsserver.search.filters.email | STRING | False | None |
lsserver.search.filters.city | STRING | False | None |
lsserver.search.filters.state_province | STRING | False | None |
lsserver.search.filters.country | STRING | False | None |
lsserver.search.filters.currency | STRING | False | None |
lsserver.search.filters.terms | STRING | False | None |
lsserver.search.filters.account_status | STRING | False | None |
lsserver.search.filters.home_page | STRING | False | None |
lsserver.search.filters.address | STRING | False | None |
lsserver.search.filters.zip_postal_code | STRING | False | None |
lsserver.search.filters.supplier_id | STRING | False | None |
lsserver.search.filters.notes | STRING | False | None |
lsserver.search.filters.tax_status | STRING | False | None |
lsserver.search.filters.new_import | BOOLEAN | False | None |
lsserver.search.filters.phone | STRING | False | None |
lsserver.search.filters.supplier | STRING | False | None |
lsserver.search.filters.supplier_custom_field_0 | STRING/DATE/BOOLEAN | False | None |
GET /api/suppliers/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/suppliers/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>