api.orders¶
- /api/orders/
- /api/orders/(d+)/
- /api/orders/(d+)/cancel/
- /api/orders/(d+)/finish/
- /api/orders/(d+)/lineitems/
- /api/orders/(d+)/lineitems/(d+)/
- /api/orders/(d+)/lineitems/(d+)/reservation/
- /api/orders/(d+)/payments/
- /api/orders/(d+)/payments/(d+)/
- /api/orders/search/
/api/orders/¶
GET /api/orders/¶
Description:
Retrieve the order listing
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | False | False | False |
Request:
<!-- No XML Request. -->
Response:
<orders>
<order uri="/orders/X/" id="X" full_render="false">
<datetime_created>[datetime]</datetime_created> <!-- Datetime order created -->
<order_id>[str]</order_id> <!-- order string id example O-123 -->
<order_customer>
<customer uri="/customers/X/" id="X"/> <!-- Empty if the customer is a walk in -->
<mainname>[str]</mainname> <!-- main name of customer -->
<mainphone>[str]</mainphone> <!-- main phone of customer-->
<contact_info>[str]</contact_info> <!-- contact info from customer -->
</order_customer>
<totals>
<total>[decimal]</total> <!-- total of order -->
</totals>
</order>
[...]
</orders>
POST /api/orders/¶
Description:
Create a new order
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | False | False | False |
Request:
<order>
<order_customer> <!-- stock orders do not have customer information -->
<customer id="[integer]"/><!-- customer assigned to order, No customer tag means that this is a walk-in -->
<mainname>[string]</mainname> <!-- main name of customer, optional and nullable, must be set if customer is walk-in -->
<phone_email>[string]</phone_email> <!-- phone and email of customer, optional and nullable -->
<phone>[string]</phone> <!- phone of customer,optional and nullable -->
<mainphone>[string]</mainphone> <!-- main phone of customer, optional and nullable -->
<zip>[string]</zip> <!-- zip code of customer, optional and nullable -->
<contact>[string]</contact> <!-- contact of customer, optional and nullable -->
<discount>[decimal]</discount> <!-- customer category discount applied to order,optional and nullable -->
<po>[string]</po> <!-- po of customer,optional and nullable -->
<pricing_level>[integer]</pricing_level> <!-- customer category pricing level index applied to order, optional and nullable -->
<terms_tax>[string]</terms_tax> <!-- terms applied name, optional and nullable -->
</order_customer>
<flags>
<drop_shipment>[boolean]</drop_shipment> <!-- True if order is a drop shipment, optional-->
</flags>
<print_options>
<localizable_language id="[int]"/> <!-- print language of receipt, optional -->
<discounts>[boolean]</discounts> <!-- print discount in order line description, optional -->
<images>[enum: None | Small | Medium | 1st Product Large | 1st Product Medium | 1st Product Large]</images> <!-- print image size, optional -->
</print_options>
<primary_user>
<user id="[integer]"/> <!-- primary user, optional -->
</primary_user>
<secondary_user>
<user id="[integer]"/> <!-- secondary user, optional -->
</secondary_user>
<currency id="[integer]"/> <!-- currency of order, optional -->
<terms id="[integer]"> <!-- terms, optional -->
<printed_notes>[string]</printed_notes> <!-- printed notes (shows on receipt), optional -->
<internal_notes>[string]</internal_notes><!-- internal notes (not shown on receipt), optional -->
<shipping_method id="[int]"/><!-- shipping method, optional -->
<tax_code id="[integer]"/> <!-- tax code, optional -->
<pricing_level index="[integer]" <!-- index attribute optional--> > <!-- customer category pricing level applied, optional -->
<c_discount_percentage>[decimal]</c_discount_percentage> <!-- customer category discount applied, optional -->
<web_order_number>[str]</web_order_number> <!-- order number from web order, optional -->
<order_type>[Enum: Customer | Stock]</order_type> <!-- order type, optional, defaults to Customer-->
</order>
Response:
<order uri="/orders/X/" id="X" full_render="true">
<!-- See GET /orders/X/ response for details. -->
</order>
/api/orders/(d+)/¶
GET /api/orders/(d+)/¶
Description:
Retrieve a specific order
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
True | False | False | False |
Request:
<!-- No XML Request. -->
Response:
<order uri="/orders/X/" id="X" full_render="true">
<document_id>[int]</document_id> <!-- document id -->
<date_created>[date]</date_created> <!--date created -->
<datetime_created>[datetime]</datetime_created> <!-- datetime created -->
<date_modified>[date]</date_modified> <!-- date modified -->
<datetime_modified>[datetime]</datetime_modified> <!-- datetime modified -->
<flags>
<drop_shipment>[bool]</drop_shipment> <!-- True if order is a drop shipment -->
</flags>
<order_id>[str]</order_id> <!-- order string id example O-123 -->
<order_customer>
<customer uri="/customers/X/" id="X" /><!-- Empty if the customer is a walk in -->
<mainname>[str]</mainname> <!-- main name of customer -->
<mainphone>[str]</mainphone> <!-- main phone of customer-->
<phone_email>[str]</phone_email> <!-- phone and email of customer -->
<contact>[str]</contact> <!-- contact of customer -->
<contact_info>[str]</contact_info> <!-- contact info of customer -->
<merged_to> <!-- The current customer that this customer is merged to. -->
<customer uri="/customers/Y/" id="Y"/> <!-- Empty if not merged -->
</merged_to>
<discount>[decimal]</discount> <!-- customer category discount applied to order -->
<pricing_level>[int]</pricing_level> <!-- customer category pricing level index applied to order -->
<terms_tax>[string]<terms_tax> <!-- terms applied name -->
<zip>[string]</zip> <!-- customer zip code -->
<po>[string]</po> <!-- customer po -->
</order_customer>
<margin>[decimal]</margin> <!-- margin -->
<print_options>
<localizable_language uri="/setup/localizable_languages/X/" id="X" full_rendered="true">
<!-- See GET /setup/localizable_languages/X/ response for details. -->
</localizable_language> <!-- print language of receipt -->
<images>[enum: None | Small | Medium | 1st Product Large | 1st Product Medium | 1st Product Large]</images> <!-- print image size -->
<discounts>[bool]</discounts> <!-- print discount in order line description -->
</print_options>
<primary_user>
<user uri="[str]" id="[int]"/><!-- primary user, empty if no primary user -->
</primary_user>
<secondary_user>
<user uri="[str]" id="[int]"/><!-- secondary user, empty if no secondary user -->
</secondary_user>
<printed_notes>[str]</printed_notes> <!-- printed notes (shows on receipt) -->
<internal_notes>[str]<internal_notes> <!-- internal notes (not shown on receipt) -->
<shipping_method uri="/setup/shipping_methods/X/" id="X"> <!-- shipping method -->
<!-- See GET /setup/shipping_methods/X/ response for details. -->
</shipping_method
<currency uri="[str] id="[int]" full_render="true"><!-- currency, empty if no currency assigned. Else fully rendered. -->
<!-- See GET /setup/currencies/x/ for details -->
</currency>
<terms uri="/setup/terms/[int]/" id="[int]"/><!-- terms, empty if no terms assigned -->
<due>[date]</due> <!-- due date -->
<import_id>[str]</import_id> <!-- import id -->
<status>[enum: None | Requested | Processed | Partially Received | Received | Cancelled | Invoiced]</status> <!-- order status -->
<totals>
<cost>[decimal]</cost>
<subtotal>[decimal]</subtotal> <!-- subtotal -->
<profit>[decimal]</profit>
<tax>[decimal]</tax> <!-- tax -->
<credit>[decimal]</credit> <!-- credit -->
<total>[decimal]</total> <!-- total -->
<paid>[decimal]</paid>
<remaining_balance>[decimal]</remaining_balance>
</totals>
<tax_code uri="[str]" id="[int]" /><!-- tax code, empty if no tax code assigned -->
<taxes inclusive="[bool]">
<tax_exempt>
<tax total="[decimal]" id="[int]">[bool]</tax><!-- tax total for each tax, always 5 tax elements with ids 1-5 -->
[...]
</tax_exempt>
</taxes>
<pricing_level index="[int]"><!-- Empty if no pricing level has been set -->
<name>[str]</name> <!-- pricing level name -->
</pricing_level>
<c_discount_percentage>[decimal]</c_discount_percentage> <!-- customer category discount applied -->
<payments>
<payment uri="[str]" id="[int]" /> <!-- order payment -->
[...]
</payments>
<billing>
<address>
<address1>[str]</address1> <!-- billing line 1 -->
<address2>[str]</address> <!-- billing line 2 -->
<city>[str]</city> <!-- billing city -->
<state>[str]</state> <!-- billing state -->
<country>[str]</country> <!-- billing country -->
<zip>[str]</zip> <!-- billing zip -->
</address>
</billing>
<shipping>
<address>
<address1>[str]</address1> <!-- shipping line 1 -->
<address2>[str]</address2> <!-- shipping line 2-->
<city>[str]</city> <!-- shipping city-->
<state>[str]</state> <!-- shipping state -->
<country>[str]</country> <!-- shipping country -->
<zip>[str]</zip> <!-- shipping zip -->
</address>
</shipping>
<lineitems>
<lineitem uri="[str]" id="[int]" full_render="false">
<quantity>[decimal]</quantity>
<sell_price>[decimal]</sell_price> <!-- the sell price (including or excluding taxes, depending on the tax-inclusion mode) -->
<sells>
<sell>[decimal]</sell> <!-- sell price of item, excluding taxes -->
<base>[decimal]</base> <!-- base sell price of item, excluding taxes -->
<total>[decimal]</total> <!-- total sell price of specified quantity of item, excluding taxes -->
<sell_quantity_discount>[decimal]</sell_quantity_discount> <!-- sell price of item accounting for quantity discounts (excluding taxes) -->
<sell_tax_inclusive_quantity_discount>[decimal]</sell_tax_inclusive_quantity_discount> <!-- sell quantity discount including taxes -->
<sell_tax_inclusive>[decimal]</sell_tax_inclusive> <!-- sell price of item, including taxes -->
<sell_tax_inclusive_total>[decimal]</sell_tax_inclusive_total> <!-- total sell price of specified quantity of item, including taxes -->
<sell_tax_inclusive_discounted>[decimal]</sell_tax_inclusive_discounted> <!-- sell price of item including both taxes and discounts -->
</sells>
<price_calculations>[enum: AUTO | MANUAL | NONE | AUTO_NONE]</price_calculations>
<lineitem_product>
<product uri="[str]" id="[int]" /> <!-- product -->
<code>[str]</code> <!-- product code -->
<description>[str]</description> <!-- product description -->
</lineitem_product>
</lineitem>
[...]
</lineitems>
<web_order_number>[str]</web_order_number> <!-- order number from web order -->
<order_type>[Enum: Customer | Stock]</order_type> <!-- order type, optional -->
</order>
PUT /api/orders/(d+)/¶
Description:
Update an order
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
True | True | False | False |
Request:
<order>
<order_customer> <!-- stock orders do not have customer information -->
<customer id="[integer]"/><!-- customer assigned to order, optional-->
<mainname>[string]</mainname> <!-- main name of customer, optional -->
<phone_email>[string]</phone_email> <!-- phone and email of customer, optional and nullable -->
<phone>[string]</phone> <!- phone of customer,optional and nullable -->
<mainphone>[string]</mainphone> <!-- main phone of customer, optional and nullable -->
<zip>[string]</zip> <!-- zip code of customer, optional and nullable -->
<contact>[string]</contact> <!-- contact of customer, optional and nullable -->
<discount>[decimal]</discount> <!-- customer category discount applied to order,optional and nullable -->
<po>[string]</po> <!-- po of customer,optional and nullable -->
<pricing_level>[integer]</pricing_level> <!-- customer category pricing level index applied to order, optional and nullable -->
<terms_tax>[string]</terms_tax> <!-- terms applied name, optional and nullable -->
</order_customer>
<flags>
<drop_shipment>[boolean]</drop_shipment> <!-- True if order is a drop shipment, optional-->
</flags>
<print_options>
<localizable_language id="[int]"/> <!-- print language of receipt, optional -->
<discounts>[boolean]</discounts> <!-- print discount in order line description, optional -->
<images>[enum: None | Small | Medium | 1st Product Large | 1st Product Medium | 1st Product Large]</images> <!-- print image size, optional -->
</print_options>
<primary_user>
<user id="[integer]"/> <!-- primary user, optional -->
</primary_user>
<secondary_user>
<user id="[integer]"/> <!-- secondary user, optional -->
</secondary_user>
<currency id="[integer]"/> <!-- currency of order, optional -->
<terms id="[integer]"> <!-- terms, optional -->
<printed_notes>[string]</printed_notes> <!-- printed notes (shows on receipt), optional -->
<internal_notes>[string]</internal_notes><!-- internal notes (not shown on receipt), optional -->
<shipping_method id="[int]"/><!-- shipping method, optional -->
<tax_code id="[integer]"/> <!-- tax code, optional -->
<pricing_level index="[integer]" <!-- index attribute optional--> > <!-- customer category pricing level applied, optional -->
<c_discount_percentage>[decimal]</c_discount_percentage> <!-- customer category discount applied, optional -->
<web_order_number>[str]</web_order_number> <!-- order number from web order, optional -->
</order>
Response:
<order uri="/orders/X/" id="X" full_render="true">
<!-- See GET /orders/X/ response for details. -->
</order>
/api/orders/(d+)/cancel/¶
POST /api/orders/(d+)/cancel/¶
Description:
Cancels the order by cancelling all order lines (even invoiced order lines) and releases all reserved inventory. Reserved inventory for order lines can be released back into specific warehouses by using the <order_line_cancellation> tag.
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | True | False | False |
Request:
<order_cancellation>
<!-- Lineitems that are not listed will be cancelled and released to inventory automatically. -->
<order_line_cancellation> <!-- Optional -->
<lineitem id="[int]"/>
<reservation>
<quantity>[decimal]</quantity> <!-- quantity, mutually exclusive with serial_numbers. -->
<serial_numbers> <!-- Required for serialized products. Mutually exclusive with quantity. -->
<serial_number>[str]</serial_number> <!-- product serial number -->
[...]
</serial_numbers>
<to>
<warehouse id="[int]"/> <!-- to warehouse -->
</to>
</reservation>
</order_line_cancellation>
[...]
</order_cancellation>
Response:
<response>
<order uri="/orders/X/" id="X" full_render="true">
<!-- See GET /orders/X/ response for details. -->
</order>
</response>
/api/orders/(d+)/finish/¶
POST /api/orders/(d+)/finish/¶
Description:
Marks all line items as finished. Sets the pricing calculations to NONE.
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | False | False | False |
Request:
<!-- No XML Response. -->
Response:
<order uri="/orders/X/" id="X">
<!-- See GET /orders/X/ response for details -->
</order>
/api/orders/(d+)/lineitems/¶
GET /api/orders/(d+)/lineitems/¶
Description:
Retrieve the lineitems of an order.
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | False | False | False |
Request:
<!-- No XML Request. -->
Response:
<lineitems>
<lineitem uri="/orders/X/lineitems/Y/" id="Y"/>
[...]
</lineitems>
POST /api/orders/(d+)/lineitems/¶
Description:
Create a lineitem for an order.
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | True | False | False |
Request:
<lineitem>
<quantity>[decimal]</quantity> <!-- quantity -->
<quantity_discount>[bool]</quantity_discount><!-- Optional. Works with sells/..quantity_discount fields -->
<price_calculations>[enum: AUTO | MANUAL | NONE | AUTO_NONE]</price_calculations><!-- optional -->
<lineitem_product>
<product id="z" /> <!-- product -->
<description>[str]</description> <!-- product description,optional -->
</lineitem_product>
<sell_price>decimal</sell_price> <!-- Optional. Mutually exclusive with sells. Should only be sent when the lineitem is manually edited by the user. -->
<sells><!-- Optional. Mutually exclusive with sell_price. Should be sent when the line has predetermined base and tax inclusive prices already.
For example, a lineitem with externally applied taxes or a line item with a None pricing calculation.-->
<base>[decimal]</base> <!-- Optional -->
<sell_tax_inclusive>[decimal]</sell_tax_inclusive> <!-- Optional -->
<sell_quantity_discount>[decimal]</sell_quantity_discount> <!-- Optional -->
<sell_tax_inclusive_quantity_discount>[decimal]</sell_tax_inclusive_quantity_discount> <!-- Optional -->
</sells>
<pricing_level index="[int]"/> <!-- pricing level, optional -->
<discount> <!-- Optional -->
<percent>[decimal]</percent> <!-- Mutually exclusive with value, tax_exclusive_value, tax_inclusive_value -->
<value>[decimal]</value> <!-- Mutually exclusive with percent, tax_exclusive_value, tax_inclusive_value. Treated as tax_exclusive or tax_inclusive based on the doc's setting -->
<tax_exclusive_value>[decimal]</tax_exclusive_value> <!-- Mutually exclusive with percent, value -->
<tax_inclusive_value>[decimal]</tax_inclusive_value> <!-- Mutually exclusive with percent, value -->
</discount>
<taxes>
<tax id="1"><!-- Always 5 tax elements with ids 1-5 -->
<exempt>[bool]</exempt> <!-- true if tax is exempt, optional -->
</tax>
[...]
</taxes>
</lineitem>
Response:
<response>
<lineitem uri="/orders/X/lineitems/Y/" id="Y">
<!-- See GET /orders/X/lineitems/Y/ response for details -->
</lineitem>
<order uri="/orders/X/" id="X">
<!-- See GET /orders/X/ response for details. -->
</order>
</response>
/api/orders/(d+)/lineitems/(d+)/¶
GET /api/orders/(d+)/lineitems/(d+)/¶
Description:
Retrieve a specific order lineitem
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | False | False | False |
Request:
<!-- No XML Request. -->
Response:
<lineitem uri="[str]" id="[int]">
<cost edited="[bool]" total="[decimal]">[decimal]</cost> <!-- cost -->
<discount> <!-- Optional -->
<percent>[decimal]</percent> <!-- This will naturally be Null if there're values in the other 3 fields. -->
<value>[decimal]</value> <!-- Will be tax_exclusive or tax_inclusive based on the doc's setting -->
<tax_exclusive_value>[decimal]</tax_exclusive_value>
<tax_inclusive_value>[decimal]</tax_inclusive_value>
</discount>
<pricing_level index="[int]">
<name>[str]</name> <!-- pricing level name -->
</pricing_level>
<profit_margin minimum="[decimal]">[decimal]</profit_margin> <!-- profit margin-->
<quantity>[decimal]</quantity> <!-- quantity -->
<quantity_discount>[bool]</quantity_discount> <!-- true if quantity discount pricing applied -->
<sell_price>[decimal]</sell_price> <!-- the sell price (including or excluding taxes, depending on the tax-inclusion mode) -->
<sells>
<sell>[decimal]</sell> <!-- sell price of item, excluding taxes -->
<base>[decimal]</base> <!-- base sell price of item, excluding taxes -->
<total>[decimal]</total> <!-- total sell price of specified quantity of item, excluding taxes -->
<sell_quantity_discount>[decimal]</sell_quantity_discount> <!-- sell price of item accounting for quantity discounts (excluding taxes) -->
<sell_tax_inclusive_quantity_discount>[decimal]</sell_tax_inclusive_quantity_discount> <!-- sell quantity discount including taxes -->
<sell_tax_inclusive>[decimal]</sell_tax_inclusive> <!-- sell price of item, including taxes -->
<sell_tax_inclusive_total>[decimal]</sell_tax_inclusive_total> <!-- total sell price of specified quantity of item, including taxes -->
<sell_tax_inclusive_discounted>[decimal]</sell_tax_inclusive_discounted> <!-- sell price of item including both taxes and discounts -->
</sells>
<editable>[bool]</editable> <!-- true if editable description -->
<manual>[boolean]</manual> <!-- DEPRECATED, use price_calculations. User manually made a change to prevent sale offer pricing-->
<price_calculations>[enum: AUTO | MANUAL | NONE | AUTO_NONE]</price_calculations>
<!-- Defaults to AUTO. AUTO indicates pricing is calculated using the latest values from the product card and any associated discounts or sales.
MANUAL indicates that a user entered price has been set and no price calculations are to be performed.
NONE indicates that no price calculations are to be performed.
AUTO_NONE indicates that pricing should be calculated, but the resulting price calculation state is NONE (i.e. no more recalculations on future edits). -->
<lineitem_product>
<product uri="[str]" id="[int]" full_render="true">
<!-- See GET /products/X/ for details -->
</product>
<code>[str]</code> <!-- product code -->
<family>[str]</family> <!-- product family name -->
<description>[str]</description> <!-- product description -->
<class_name>[str]</class_name> <!-- class name -->
<current>[bool]</current> <!-- true if product is current -->
<editable>[bool]</editable> <!-- true if product has editable description -->
<editable_sell>[bool]</editable_sell> <!-- true if product has editable sell -->
<gift_card>[bool]</gift_card> <!-- true if product is gift card -->
<inventoried>[bool]</inventoried> <!-- true if product is inventoried -->
<no_profit>[bool]</no_profit> <!-- true if product is non profit -->
<serialized>[bool]</serialized> <!-- true if product is serialized-->
<manufacturer_part_number>[str]</manufacturer_part_number>
<manufacturer_pricing_option_code>[str]</manufacturer_pricing_option_code>
</lineitem_product>
<tax_exemption uri="/setup/tax_exemptions/X/" id="X"/>
<taxes>
<tax id="1"><!-- Always 5 tax elements with ids 1-5 -->
<exempt>[bool]</exempt> <!-- true if tax is exempt -->
<total>[decimal]</total> <!-- tax total amount -->
</tax>
[...]
</taxes>
<status>[enum: Requested | Processed | Partially Received | Received | Cancelled | Invoiced]</status> <!-- status of order line -->
<quantity_received>[decimal]</quantity_received> <!-- quantity reserved for order line -->
</lineitem>
PUT /api/orders/(d+)/lineitems/(d+)/¶
Description:
Update an order lineitem
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | True | False | False |
Request:
<lineitem>
<quantity>[decimal]</quantity> <!-- quantity, optional-->
<quantity_discount>[bool]</quantity_discount><!-- Optional. Works with sells/..quantity_discount fields -->
<price_calculations>[enum: AUTO | MANUAL | NONE | AUTO_NONE]</price_calculations><!-- optional -->
<lineitem_product>
<description>Optional description</description> <!-- product description, optional-->
</lineitem_product>
<sell_price>decimal</sell_price> <!-- sell price, optional-->
<sells>
<base>[decimal]</base> <!-- Optional -->
<sell_tax_inclusive>[decimal]</sell_tax_inclusive> <!-- Optional -->
<sell_quantity_discount>[decimal]</sell_quantity_discount> <!-- Optional -->
<sell_tax_inclusive_quantity_discount>[decimal]</sell_tax_inclusive_quantity_discount> <!-- Optional -->
</sells>
<pricing_level index="[int]"/> <!-- pricing level, optional -->
<discount> <!-- Optional -->
<percent>[decimal]</percent> <!-- discount percent, mutually exclusive with value, optional -->
<value>[decimal]</value> <!-- dollar discount, mutually exclusive with percent, optional -->
</discount>
<taxes>
<tax id="1"><!-- Always 5 tax elements with ids 1-5 -->
<exempt>[bool]</exempt> <!-- true if tax is exempt, optional -->
</tax>
[...]
</taxes>
<status>[Enum: Requested | Cancelled | Invoiced]</status> <!-- status of the order line, optional -->
</lineitem>
Response:
<response>
<lineitem uri="/orders/X/lineitems/Y/" id="Y">
<!-- See GET /orders/X/lineitems/Y/ response for details -->
</lineitem>
<order uri="/orders/X/" id="X">
<!-- See GET /orders/X/ response for details. -->
</order>
</response>
DELETE /api/orders/(d+)/lineitems/(d+)/¶
Description:
Delete an order lineitem
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | True | False | False |
Request:
<!-- No XML Request -->
Response:
<response>
<lineitem uri="/orders/X/lineitems/Y/" id="Y" deleted="true"/>
<order uri="/orders/X/" id="X">
<!-- See GET /orders/X/ response for details. -->
</order>
</response>
- Expected Errors:
/api/orders/(d+)/lineitems/(d+)/reservation/¶
POST /api/orders/(d+)/lineitems/(d+)/reservation/¶
Description:
Reserve inventory for a order lineitem from a specific warehouse. Reserved inventory can also be released back to the warehouse specified.
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | True | False | False |
Request:
<reservation>
<quantity>[decimal]</quantity> <!-- Positive qty. Mutually exclusive with serial_numbers. -->
<serial_numbers> <!-- Required to reserve serialized products from warehouse. Mutually exclusive with quantity. -->
<serial_number>[str]</serial_number> <!-- product serial number -->
[...]
</serial_numbers>
<from> <!-- Where to reserve inventory from. Mutually exclusive with to. -->
<warehouse id="[int]"/> <!-- from warehouse -->
</from>
<to> <!-- Where to release inventory to. Mutually exclusive with from. -->
<warehouse id="[int]"/> <!-- to warehouse -->
</to>
</reservation>
Response:
<response>
<lineitem uri="/orders/X/lineitems/Y/" id="Y">
<!-- See GET /orders/X/lineitems/Y/ response for details -->
</lineitem>
<order uri="/orders/X/" id="X">
<!-- See GET /orders/X/ response for details. -->
</order>
</response>
/api/orders/(d+)/payments/¶
GET /api/orders/(d+)/payments/¶
Description:
Retrieve the list of payments made on an order
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | False | False | False |
Request:
<!-- No XML Request -->
Response:
<payments>
<payment uri="/orders/X/payments/Y/" id="Y"/>
[...]
</payments>
POST /api/orders/(d+)/payments/¶
Description:
Creates a new Order Payment
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | True | False | False |
Request:
<payment>
<type>[enum: Web Payment]</type><!-- The type of payment -->
<action>[enum: sale | offline_sale | return | void]</action><!-- The action being taken -->
<station>[string]</station><!-- The station performing the action -->
<amount>[decimal]</amount><!-- The payment amount -->
<payment_method>[string]</payment_method><!-- Name of the payment method. Must align with a value from the payment_method resource -->
</payment>
Response:
<response>
<order uri="/orders/X/" id="Y">
<!-- Totals only -->
</order>
<payment uri="/orders/X/payments/Y/" id="Y"/>
<!-- See GET /orders/X/payments/Y/ response for details. -->
</payment>
</response>
- Expected Errors:
- resource.not_found
- model.payments.credit_cards.payment_too_small
- model.payments.credit_cards.payment_gateway_token_requires_customer
- model.payments.credit_cards.customer_payment_gateway_token_mismatch
- server.not_implemented_error
- model.payments.store_credit.invalid_type_error
- model.payments.store_credit.source_loading_error
- model.payments.store_credit.bad_base_payment_error
- model.payments.store_credit.negative_amount_error
- model.payments.store_credit.unsaved_invoice_error
- model.payments.store_credit.not_enough_credit_error
- model.payments.gift_cards.no_serial_number_error
- model.payments.gift_cards.serial_number_does_not_exist_error
- model.payments.gift_cards.insufficient_funds_error
- model.payments.gift_cards.product_required_error
- model.payments.gift_cards.product_not_found_error
/api/orders/(d+)/payments/(d+)/¶
GET /api/orders/(d+)/payments/(d+)/¶
Description:
Represents the details of an Order Payment
can_lock | requires_lock | has_etag | requires_etag |
---|---|---|---|
False | False | False | False |
Request:
<!-- No XML Request -->
Response:
<payment uri="/orders/X/payments/Y/" id="Y">
<type>[enum: Cash | Gift Card | Debit Card | Credit Card | Credit Card Manual | Debit Card Manual | Store Card | Cheque | Loan | Lease | Web Payment | Manual | Credit | Rounding ]</type><!-- The type of payment -->
<payment_method>[string]</payment_method><!-- The payment method used. String matching one of the payment methods. This should be replace with an ID/URI to the appropriate payment method -->
<datetime_created>[datetime]</datetime_created><!-- The datetime this payment was created -->
<datetime_modified>[datetime]</datetime_modified><!-- The datetime this payment was modified -->
<exported>[datetime]</exported><!-- The date the payment was expored. Null otherwise -->
<posted>[datetime]<posted><!-- The date the payment was posted. Null otherwise-->
<flags>
<exported>[bool]</exported><!-- True if the payment has been exported -->
<posted>[bool]</posted><!-- True if the payment has been posted -->
<voided>[bool]</voided><!-- True if the payment has been voided -->
</flags>
<number>[string]</number><!-- The number associated to this transaction. Generally this is the ref id from the processor -->
<source id="[string]"/><!-- ID from the parent. -->
<amount>[decimal]</amount><!-- The payment amount -->
<tendered>[decimal]</tendered><!-- The amount tendered in a cash payment -->
<authcode>[string]</authcode><!-- The authorization code received from the payment gateway -->
<avs_result /><!-- Always Null on a GET response. -->
<till uri="" id="" /><!-- See /tills/X/ for details. Note the URI only -->
<signature_photo uri="/orders/[integer]/payments/[integer]/signature_photo/" /><!-- Not null if a signature photo is available -->
</payment>
/api/orders/search/¶
Data¶
Columns
name | type | required | default | sort_default | can_summarize |
---|---|---|---|---|---|
lsserver.search.column.id | STRING | False | True | True | False |
lsserver.search.column.date | DATE | False | True | False | False |
lsserver.search.column.customer | STRING | False | True | False | False |
lsserver.search.column.phone | STRING | False | True | False | False |
lsserver.search.column.po | STRING | False | True | False | False |
lsserver.search.column.user | STRING | False | True | False | False |
lsserver.search.column.status | STRING | False | True | False | False |
lsserver.search.column.total | MONEY | False | True | False | True |
lsserver.search.column.modified | DATETIME | False | False | False | False |
lsserver.search.column.created | DATETIME | False | False | False | False |
lsserver.search.column.drop_shipment | BOOLEAN | False | False | False | False |
lsserver.search.column.shipping_method | STRING | False | False | False | False |
lsserver.search.column.terms | STRING | False | False | False | False |
lsserver.search.column.currency | STRING | False | False | False | False |
lsserver.search.column.deposit_amount | MONEY | False | False | False | False |
lsserver.search.column.deposit_status | ENUM | False | False | False | False |
lsserver.search.column.base_custom_field_0 | STRING/DATE/BOOLEAN | False | False | False | False |
Filters
name | type | required | enum_values |
---|---|---|---|
lsserver.search.filters.created_date | DATE | False | None |
lsserver.search.filters.user | STRING | False | None |
lsserver.search.filters.status | STRING | False | None |
lsserver.search.filters.deposit_amount | MONEY | False | None |
lsserver.search.filters.deposit_status | ENUM | False | NONE, PARTIAL, FULL |
lsserver.search.filters.drop_shipment | BOOLEAN | False | None |
lsserver.search.filters.order_id | STRING | False | None |
lsserver.search.filters.customer_id | STRING | False | None |
lsserver.search.filters.customer_name | STRING | False | None |
lsserver.search.filters.customer_phone | STRING | False | None |
lsserver.search.filters.customer_po | STRING | False | None |
lsserver.search.filters.product_code | STRING | False | None |
lsserver.search.filters.product_description | STRING | False | None |
lsserver.search.filters.product_id | STRING | False | None |
lsserver.search.filters.upc | STRING | False | None |
lsserver.search.filters.product_class | STRING | False | None |
lsserver.search.filters.product_family | STRING | False | None |
lsserver.search.filters.product_size | STRING | False | None |
lsserver.search.filters.product_color | STRING | False | None |
lsserver.search.filters.printed_notes | STRING | False | None |
lsserver.search.filters.internal_notes | STRING | False | None |
lsserver.search.filters.modified_date | DATE | False | None |
lsserver.search.filters.base_custom_field_0 | STRING/DATE/BOOLEAN | False | None |
GET /api/orders/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/orders/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>