api.products

/api/products/

GET /api/products/

Description:

List products partially rendered
can_lock requires_lock has_etag requires_etag
False False False False

Request:

<!-- No XML Request. -->

Response:

<products>
    <product uri="/products/X/" id="X" full_render="false">
        <code>[str]</code>
        <flags>
            <inventoried>[bool]</inventoried>
            <editable_sell>[bool]</editable_sell>
            <master_model>[bool]</master_model>
        </flags>
        <sell_price>[decimal]</sell_price>
        <description>[str]</description>
        <inventory>
            <available>[decimal]</available>
            <reserved>[decimal]</reserved>
            <coming_for_stock>[decimal]</coming_for_stock>
            <coming_for_customer>[decimal]</coming_for_customer>
            <warehouses>[decimal]</warehouses>
            <in_transit>[decimal]</in_transit>
            <total>[decimal]</total>
        </inventory>
        <product_photos>
            <product_photo uri="/products/X/product_photos/Y/" id="Y"/>
            [...]
        </product_photos>
    </product>
    [...]
</products>

POST /api/products/

Description:

Create a new product
can_lock requires_lock has_etag requires_etag
False False False False

Request:

<product>
    <code>[str: max(1023)]</code><!-- Optional -->
    <sell_price>[decimal]</sell_price><!-- Optional. Sets the sell and sell_tax_inclusive according to the current tax inclusive/exclusive settings. For tax exclusive, the sell_price becomes the sell (i.e. sell=19.99) and sell_tax_inclusive becomes None. For tax inclusive (assuming 7% tax), the sell price becomes the sell_tax_inclusive and the sell is calculated using the default tax code (i.e. sell=18.68 and sell_tax_inclusive=19.99). Set child product to master product's sell_price if not present. -->
    <class id="[int]"/><!-- Optional -->
    <currency id="[int]"/><!-- Optional -->
    <supplier id="[int]"/><!-- Optional. Note: This value is normally set by updating the supplier_costs. -->
    <supplier_code>[str]</supplier_code> <!-- Optional. The supplier product code. Note: This value is normally set by updating the supplier_costs. -->
    <flags>
        <current>[bool]</current><!-- Optional -->
        <editable>[bool]</editable><!-- Optional -->
        <inventoried>[bool]</inventoried><!-- Optional -->
        <editable_sell>[bool]</editable_sell><!-- Optional -->
        <gift_card>[bool]</gift_card><!-- Optional -->
        <no_profit>[bool]</no_profit><!-- Optional -->
        <serialized>[bool]</serialized><!-- Optional -->
        <web>[bool]</web><!-- Optional -->
    </flags>
    <description>[str: max(4096)]</description><!-- Optional -->
    <short_description>[str: max(4096)]</short_description><!-- Optional -->
    <family>[str]</family><!-- Optional -->
    <sells>
        <sell>[decimal]</sell><!-- Optional -->
        <sell_tax_inclusive>[decimal]</sell_tax_inclusive><!-- Optional -->
        <sell_web>[decimal]</sell_web> <!-- Optional -->
    </sells>
    <tax_exemption id="[int]"/>
    <master_product>
        <product id="[int]"/> <!-- Optional -->
    </master_product>
    <code_suffix>[enum: COLOR_SIZE | SIZE_COLOR]</code_suffix> <!-- COLOR_SIZE="-color-size", SIZE_COLOR="-size-color". Default to COLOR_SIZE if not present. Use this to determine the child product's code if code is not present. -->
    <description_suffix>[enum: COLOR_SIZE | SIZE_COLOR | BCOLOR_SIZEB | BSIZE_COLORB]</description_suffix> <!-- COLOR_SIZE=", color, size", SIZE_COLOR=", size, color", BCOLOR_SIZEB=", (color, size)", BSIZE_COLORB=", (size, color)". Default to COLOR_SIZE if not present. Use this to determine the child product's description if description is not present. -->
    <product_color id="[int]"/> <!-- Mandatory if master_product id is present. -->
    <product_size id="[int]"/> <!-- Mandatory if master_product id is present. -->
    <manufacturer_part_number>[str]</manufacturer_part_number> <!-- Optional -->
    <manufacturer_pricing_option_code>[str]</manufacturer_pricing_option_code> <!-- Optional -->
</product>

Response:

<product uri="/products/X/" id="X">
    <!-- See GET /products/X/ response for details. -->
</product>

/api/products/(d+)/

GET /api/products/(d+)/

Description:

Detailed product info
can_lock requires_lock has_etag requires_etag
True False False False

Request:

<!-- No XML Request. -->

Response:

<product uri="/products/A/" id="A">
    <class uri="/setup/classes/B/" id="B"/>
    <currency uri="/setup/currencies/C/" id="C"/>
    <code>[str]</code>
    <costs> <!-- Default costs being used by the product. -->
        <cost>[decimal]</cost>  <!-- The actual cost of the product in the current currecy. -->
        <average>[decimal]</average> <!-- Cost average for this product -->
        <raw>[decimal]</raw> <!-- This is the default raw cost for the product. Reflects the default raw cost from the supplier costs. -->
    </costs>
    <supplier_costs> <!-- The supplier costs attached to this product. -->
        <cost uri="/products/A/costs/N/" id="N">
            <!-- See GET /products/X/costs/Y/ for details. -->
        </cost>
        [...]
    </supplier_costs>
    <flags>
        <current>[bool]</current>
        <editable>[bool]</editable>
        <gift_card>[bool]</gift_card>
        <inventoried>[bool]</inventoried>
        <new_cost>[bool]</new_cost>
        <new_import>[bool]</new_import>
        <new_update>[bool]</new_update>
        <no_live_rules>[bool]</no_live_rules>
        <no_profit>[bool]</no_profit>
        <serialized>[bool]</serialized>
        <web>[bool]</web>
        <editable_sell>[bool]</editable_sell>
        <master_model>[bool]</master_model>
    </flags>
    <sell_price>[decimal]</sell_price>
    <created>[datetime]</created>
    <modified>[datetime]</modified>
    <description>[str]</description>
    <long_web_description>[str]</long_web_description>
    <family>[str]</family>
    <gl_product>
        <asset>[str]</asset>
        <cogs_expense>[str]</cogs_expense>
        <income>[str]</income>
    </gl_product>
    <product_id>[str]</product_id>
    <inventory>
        <available>[decimal]</available>
        <reserved>[decimal]</reserved>
        <coming_for_stock>[decimal]</coming_for_stock>
        <coming_for_customer>[decimal]</coming_for_customer>
        <warehouses>[decimal]</warehouses>
        <in_transit>[decimal]</in_transit>
        <total>[decimal]</total>
    </inventory>
    <margin>[decimal]</margin>
    <minimum_margin>[decimal]</minimum_margin>
    <product_info>
        <color>[str]</color>
        <height>[decimal]</height>
        <length>[decimal]</length>
        <size>[str]</size>
        <weight>[decimal]</weight>
        <width>[decimal]</width>
    </product_info>
    <reorder>
        <amount>[decimal]</amount>
        <calc>[decimal]</calc>
        <point>[decimal]</point>
        <type>[int]</type>
    </reorder>
    <sells>
        <sell>[decimal]</sell>
        <sell_tax_inclusive>[decimal]</sell_tax_inclusive>
        <sell_web>[decimal]</sell_web>
    </sells>
    <supplier uri="/suppliers/G/" id="G"/> <!-- The current supplier attached to this product. Note: This value is normally pulled from the default supplier cost. However, it can be overridden. -->
    <supplier_code>[str]</supplier_code> <!-- The current supplier product code. Note: This value is normally pulled from the default supplier code. However, this can be overridden. -->
    <upc>[str]</upc>
    <web>
        <inventory>[str]</inventory>
    </web>
    <keywords>
        <keyword>[str]<keyword>
        [...] <!-- 3 keywords total -->
    </keywords>
    <multi_store_label>[str]</multi_store_label>
    <multi_store_master_label>[str]</multi_store_master_label>
    <categories>
        <pos>
            <category uri="/setup/pos_categories/H/" id="H">
                <!-- See GET /setup/pos_categories/X/ for details -->
            </category>
        </pos>
        <web>
            <category uri="/setup/web_categories/I/" id="I">
                <!-- See GET /setup/web_categories/X/ for details -->
            </category>
        </web>
    </categories>
    <related_products>
        <related_product>
            <product uri="/products/J/" id="J"/>
            <quantity>[decimal]</quantity>
            <auto-add>[bool]</auto-add>
        </related_product>
        [...]
    </related_products>
    <serial_numbers>
        <serial_number uri="/products/A/serial_numbers/K/" id="K">
            <!-- See GET /products/X/serial_numbers/Y/ for details -->
        </serial_number>
        [...]
    </serial_numbers>
    <product_photos>
        <product_photo uri="/products/A/images/L/" id="L"/>
        [...]
    </product_photos>
    <tax_exemption uri="/setup/tax_exemptions/M/" id="M">
        <!-- See GET /setup/tax_exemptions/X/ for details. -->
    </tax_exemption>
    <master_product>
        <product uri="/products/N/" id="N">
    </master_product>
    <manufacturer_part_number>[str]</manufacturer_part_number>
    <manufacturer_pricing_option_code>[str]</manufacturer_pricing_option_code>
</product>

PUT /api/products/(d+)/

Description:

Update an existing product
can_lock requires_lock has_etag requires_etag
True True False False

Request:

<product>
    <!-- See POST /products/ request for details. -->
</product>

Response:

<product uri="/products/X/" id="X">
    <!-- See GET /products/X/ response for details. -->
</product>

/api/products/(d+)/add_product_photo/

POST /api/products/(d+)/add_product_photo/

Description:

Add a photo for the current product
can_lock requires_lock has_etag requires_etag
False True False False
Header Name Description
Content-Location [str]

Request:

[raw image binary data]

Response:

<product_photo uri="/products/X/product_photos/Y/" id="Y">
    <!-- See GET /products/X/product_photos/Y/ response for details. -->
</product_photo>
Expected Errors:

/api/products/(d+)/costs/

GET /api/products/(d+)/costs/

Description:

Return the list of supplier costs for a specific product.
can_lock requires_lock has_etag requires_etag
False False False False

Request:

<!-- No xml request -->

Response:

<costs>
    <cost uri="/products/X/costs/Y/" id="Y">
        <!-- See GET /products/X/costs/Y/ for details. -->
    </cost>
    [...]
</costs>

POST /api/products/(d+)/costs/

Description:

Create a new cost for a specific product.
can_lock requires_lock has_etag requires_etag
False True False False

Request:

<cost>
    <raw>[decimal]</raw> <!-- Default 0 -->
    <supplier id="[int]"/> <!-- Mandatory -->
    <supplier_product_code>[str]</supplier_product_code> <!-- Mandatory -->
    <default>[bool]</default> <!-- Default False -->
</cost>

Response:

<cost uri="/products/X/costs/Y/" id="Y">
    <!-- See GET /products/X/costs/Y/ for details. -->
</cost>

/api/products/(d+)/costs/(d+)/

GET /api/products/(d+)/costs/(d+)/

Description:

Return a specific supplier cost for a specific product.
can_lock requires_lock has_etag requires_etag
False False False False

Request:

<!-- No xml request -->

Response:

<cost uri="/products/A/costs/B/" id="B">
    <raw>[decimal]</raw>
    <currency uri="/setup/currencies/C/" id="C">
        <!-- See GET /setup/currencies/X/ for details -->
    </currency>
    <cost>[decimal]</cost>
    <supplier id="[int]"/>
    <supplier_product_code>[str]</supplier_product_code>
    <default>[bool]</default>
</cost>

PUT /api/products/(d+)/costs/(d+)/

Description:

Update a specific supplier cost for a specific product.
can_lock requires_lock has_etag requires_etag
False True False False

Request:

<cost>
    <raw>[decimal]</raw> <!-- Optional -->
    <supplier id="[int]"/> <!-- Optional -->
    <supplier_product_code>[str]</supplier_product_code> <!-- Optional -->
    <default>[bool]</default> <!-- Optional -->
</cost>

Response:

<cost uri="/products/X/costs/Y/" id="Y">
    <!-- See GET /products/X/costs/Y/ for details. -->
</cost>

DELETE /api/products/(d+)/costs/(d+)/

Description:

Delete a specific supplier cost for a specific product.
can_lock requires_lock has_etag requires_etag
False True False False

Request:

<!-- No xml request -->

Response:

<cost uri="/products/A/costs/B/" id="B" deleted="true"/>

/api/products/(d+)/product_photos/

GET /api/products/(d+)/product_photos/

Description:

Return the list of photo details of the product.
can_lock requires_lock has_etag requires_etag
False False False False

Request:

<!-- No XML Request. -->

Response:

<product_photos>
    <product_photo uri="/products/X/product_photos/Y/" id="Y">
        <!-- See GET /products/X/product_photos/Y/ response for details. -->
    </product_photo>
    [...]
</product_photos>

/api/products/(d+)/product_photos/(d+)/

GET /api/products/(d+)/product_photos/(d+)/

Description:

Return the details of a product photo
can_lock requires_lock has_etag requires_etag
False False False False

Request:

<!-- No XML Request. -->

Response:

<product_photo uri="/products/X/product_photos/Y/" id="Y">
    <sort_order>[int]</sort_order>
    <scales>
        <scale>
            <filename>[str]</filename>
            <size>[str]</size>
            <format>[str]</format>
        </scale>
        [...] <!-- 3 totals for 3 different size formats: 512, 256, original. -->
    </scales>
</product_photo>

PUT /api/products/(d+)/product_photos/(d+)/

Description:

Update a product photo detail
can_lock requires_lock has_etag requires_etag
False True False False

Request:

<product_photo>
    <sort_order>[int]</sort_order>
</product_photo>

Response:

<product_photo uri="/products/X/product_photos/Y/" id="Y">
    <!-- See GET /products/X/product_photos/Y/ response for details. -->
</product_photo>

DELETE /api/products/(d+)/product_photos/(d+)/

Description:

Delete a product photo
can_lock requires_lock has_etag requires_etag
False True False False

Request:

<!-- No XML Request -->

Response:

<!-- No XML Response -->

/api/products/(d+)/product_photos/(d+)/image/

GET /api/products/(d+)/product_photos/(d+)/image/

Description:

Return the product photo in binary data
can_lock requires_lock has_etag requires_etag
False False False False
Header Name Description
Accept image/*;size=[str]

Request:

<!-- No XML Request. -->

Response:

<!-- Image data at the requested size. If no such size, then the original is returned -->
Expected Errors:

/api/products/(d+)/serial_numbers/

represents a list of serial numbers attached to a specific product.

GET /api/products/(d+)/serial_numbers/

Description:

Return the list of serial numbers for this product
can_lock requires_lock has_etag requires_etag
False False False False

Request:

<!-- No XML Request. -->

Response:

<serial_numbers>
    <serial_number uri="/products/X/serial_numbers/Y/" id="Y">
        <!-- See GET /products/X/serial_numbers/Y/ response for details. -->
    </serial_number>
    [...]
</serial_numbers>

/api/products/(d+)/serial_numbers/(d+)/

GET /api/products/(d+)/serial_numbers/(d+)/

Description:

Detailed info of a product serial number
can_lock requires_lock has_etag requires_etag
False False False False

Request:

<!-- No XML Request. -->

Response:

<serial_number uri="/products/X/serial_numbers/Y/" id="Y">
    <status>[int]</status>
    <note>[str]</note>
    <cost>[decimal]</cost>
    <serial>[str]</serial>
    <warehouse uri="/warehouses/Z/" id="Z"/>
</serial_number>