API Reference

Orders

Orders

findOrders

Query for orders

Parameters

ParameterTypeDescription
LoginLoginObjectStandard login object with username, password, and application key
BeginTimeiCalTimeStringFind orders from. Check getCurrentDateTime
EndTimeiCalTimeStringFind orders to
ModifiedBeginTimeiCalTimeStringFind orders modified from. Check getOffsetDateTime
ModifiedEndTimeiCalTimeStringFind orders modified to
RequiredSearchObjectsObject[]Objects that must be present on the orders
CustomerObjectsObject[]Customer objects to search on
OwnerObjectsObject[]Owner objects to search on
SearchObjectsObject[]Order row objects to search on
StatusStatus[]Order statuses to search for
SortOrderStringThe sorting order for the orders matching the query
IncludeObjectNamesBooleanFlag to indicate whether to include object names or not on the return
StartRowIntIndex of the starting row (for pagination)
NumberOfRowsIntMaximum number of rows to return (capped at 1000 per query, use StartRow to paginate over the orders)

Returns

ReturnTypeDescription
RowsString[]Array of orders matching the query
TotalNumOfRowsIntTotal number of order rows matching the query

Example

Request

<tns:begintime></tns:begintime>
<tns:endtime></tns:endtime>
<tns:modifiedbegintime></tns:modifiedbegintime>
<tns:modifiedendtime></tns:modifiedendtime>
<tns:requiredsearchobjects>
</tns:requiredsearchobjects>
<tns:customerobjects>
</tns:customerobjects>
<tns:ownerobjects>
</tns:ownerobjects>
<tns:searchobjects>
</tns:searchobjects>
<tns:status>
</tns:status>
<tns:allorders>true</tns:allorders>
<tns:sortorder></tns:sortorder>
<tns:includeobjectnames>true</tns:includeobjectnames>
<tns:useutc>false</tns:useutc>
<tns:startrow>0</tns:startrow>
<tns:numberofrows>1000</tns:numberofrows>

getOrders

Get orders by order ids

Parameters

ParameterTypeDescription
LoginLoginObjectStandard login object with username, password, and application key
OrderIdsString[]Array of ids for the orders to get
CreateObjectsWithNamesBooleanFlag to indicate whether to create objects with names or only ids
UseUTCBooleanIndicate whether the order timestamps should be in UTC or in local time

Returns

ReturnTypeDescription
OrdersString[]Array of the requested orders

Example

Request

<tns:orderids>
  <order>_te_3</order>
</tns:orderids>
<tns:createobjectswithnames>true</tns:createobjectswithnames>

validateOrders

Validate new orders without importing them

Parameters

ParameterTypeDescription
LoginLoginObjectStandard login object with username, password, and application key
OrdersOrder[]Array of orders to validate

Returns

ReturnTypeDescription
StatusStatus[]Array of validation status per order. A status of 0 indicates the order was successfully validated

Example

Request

<tns:orders>
    <order>
        <extid>40c89e67-826f-45dc-8486-50b6c6ab74f4</extid>
        <organizations>
            <organization>admin</organization>
        </organizations>
        <title>Example order</title>
        <description>Extra order description</description>
        <status>ACTIVE</status>
        <begin>20190410T000000</begin>
        <end>20200410T000000</end>
        <requiredobject>
            <extid>bd7ff3ff-d2ab-47b3-892e-7176c030184e</extid>
            <type>project</type>
            <fields/>
        </requiredobject>
        <rows>
            <extid>_te_3#1</extid>
            <ordertitle>SU TE3</ordertitle>
            <orderbegin>20140410T000000</orderbegin>
            <orderend>20150410T000000</orderend>
            <description/>
            <status>PARTIAL</status>
            <active>true</active>
            <possible>true</possible>
            <ordercount>2</ordercount>
            <orderlength>0</orderlength>
            <deliveredcount>0</deliveredcount>
            <deliveredlength>0</deliveredlength>
            <objects>
                <object>
                    <extid>237e2269-d446-49d2-8348-57626e7c1d1f</extid>
                    <type>staff</type>
                    <fields/>
                </object>
                <object>
                    <extid>b0364e47-6151-4c61-9362-af04b3040aaf</extid>
                    <type>place</type>
                    <fields/>
                </object>
                <object>
                    <extid>709fa369-4a63-44f4-9a38-72d69d96fa32</extid>
                    <type>project</type>
                    <fields/>
                </object>
                <object>
                    <extid>709fa369-4a63-44f4-9a38-72d69d96fa32</extid>
                    <type>company</type>
                    <fields/>
                </object>
                <object>
                    <extid>f2b97211-340c-45f4-8801-722f3d55d319</extid>
                    <type>activity</type>
                    <fields/>
                </object>
                <object>
                    <extid>f9b706f4-c8e0-40f4-b631-a8e997d724c4</extid>
                    <type>workorder</type>
                    <fields/>
                </object>
            </objects>
            <extraobjects/>
        </rows>
    </order>
</tns:orders>

importOrders

Import orders

Parameters

ParameterTypeDescription
LoginLoginObjectStandard login object with username, password, and application key
OrdersOrder[]Array of orders to import

Returns

ReturnTypeDescription
StatusStatus[]Array of import status per order. A status of 0 indicates the order was successfully imported

Example

Request

<tns:orders>
    <order>
        <extid>40c89e67-826f-45dc-8486-50b6c6ab74f4</extid>
        <organizations>
            <organization>admin</organization>
        </organizations>
        <title>Example order</title>
        <description>Extra order description</description>
        <status>ACTIVE</status>
        <begin>20190410T000000</begin>
        <end>20200410T000000</end>
        <requiredobject>
            <extid>bd7ff3ff-d2ab-47b3-892e-7176c030184e</extid>
            <type>project</type>
            <fields/>
        </requiredobject>
        <rows>
            <extid>_te_3#1</extid>
            <ordertitle>SU TE3</ordertitle>
            <orderbegin>20140410T000000</orderbegin>
            <orderend>20150410T000000</orderend>
            <description/>
            <status>PARTIAL</status>
            <active>true</active>
            <possible>true</possible>
            <ordercount>2</ordercount>
            <orderlength>0</orderlength>
            <deliveredcount>0</deliveredcount>
            <deliveredlength>0</deliveredlength>
            <objects>
                <object>
                    <extid>237e2269-d446-49d2-8348-57626e7c1d1f</extid>
                    <type>staff</type>
                    <fields/>
                </object>
                <object>
                    <extid>b0364e47-6151-4c61-9362-af04b3040aaf</extid>
                    <type>place</type>
                    <fields/>
                </object>
                <object>
                    <extid>709fa369-4a63-44f4-9a38-72d69d96fa32</extid>
                    <type>project</type>
                    <fields/>
                </object>
                <object>
                    <extid>709fa369-4a63-44f4-9a38-72d69d96fa32</extid>
                    <type>company</type>
                    <fields/>
                </object>
                <object>
                    <extid>f2b97211-340c-45f4-8801-722f3d55d319</extid>
                    <type>activity</type>
                    <fields/>
                </object>
                <object>
                    <extid>f9b706f4-c8e0-40f4-b631-a8e997d724c4</extid>
                    <type>workorder</type>
                    <fields/>
                </object>
            </objects>
            <extraobjects/>
        </rows>
    </order>
</tns:orders>

exportOrders

Export orders

Parameters

ParameterTypeDescription
LoginLoginObjectStandard login object with username, password, and application key
OrderIdsString[]Array of ids for the orders to export

Returns

ReturnTypeDescription
OrdersString[]Array of orders requested

Example

Request

<tns:orderids>
  <order>_te_3</order>
</tns:orderids>

deleteOrders

Delete orders

Parameters

ParameterTypeDescription
LoginLoginObjectStandard login object with username, password, and application key
OrderIdsString[]Array of ids for the orders to delete

Returns

ReturnTypeDescription
ResultsStatus[]Array of statuses for the deletion request. A status of 0 indicates the order was successfully deleted

Example

Request

<tns:orderids>
  <order>_te_3</order>
</tns:orderids>