GetPurchases


 

Overview

Quick Links

This method retrieves Purchases from the system based on a set of criteria.

Resource Information

Request Format XML
Response Format XML

Request Header

Name Type Description
String String Authentication Token

Request Body

Name Type Description
customerCode String The customerCode of the purchase to filter on
includeUnmapped Boolean Whether or not to include unmapped purchases
productLabel String The productLabel of the puchase to filter on
dateFrom String Select only purchases with a purchaseDate later than dateFrom. This should be in the format YYYY-MM-DD'T'HH:mm:SS
dateTo String Select only purchases with a purchaseDate earlier than dateTo. This should be in the format YYYY-MM-DD'T'HH:mm:SS

Response

Name Type Description
Result List of Purchases The actual result. A list of purchases meeting the specified criteria.
ResultCode String String indicating the result. Either "Success" or "Error".
ResultMessage String Empty when call successful, error message otherwise.

In the case of an internal unhandled fault, a Fault object is returned instead. Providing information on what occurred exactly.

Examples

Request

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
    <Header xmlns:s="System"><s:String>9f4f80d9-c1a6-49a7-b6ab-547ddaa2c6ba</s:String></Header>
    <Body>
        <GetPurchases xmlns="http://tempuri.org/">
            <customerCode>102011</customerCode>
            <dateFrom>2014-10-20T00:00:00</dateFrom>
            <dateTo>2014-10-21T00:00:00</dateTo>
        </GetPurchases>
    </Body>
</Envelope>

Response

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Body>
        <GetPurchasesResponse xmlns="http://tempuri.org/">
            <GetPurchasesResult xmlns:a="http://schemas.datacontract.org/2004/07/Kolonel.Public.Service.API.Contracts.V1_0" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
                <a:Result>
                    <a:Purchase>
                        <a:BillInAdvance>false</a:BillInAdvance>
                        <a:BundleInfo i:nil="true"/>
                        <a:CustomerCode>12345</a:CustomerCode>
                        <a:DateValues/>
                        <a:EndDate>2014-10-21T12:03:35.295+00:00</a:EndDate>
                        <a:Id>54465c876f605b0df04b6618</a:Id>
                        <a:ImportedDate>2014-10-21T16:05:23.202+01:00</a:ImportedDate>
                        <a:NumericValues/>
                        <a:OverrideCost i:nil="true"/>
                        <a:OverrideTotalPurchasePrice i:nil="true"/>
                        <a:OverrideUnitPrice i:nil="true"/>
                        <a:ProductLabel>ProductX</a:ProductLabel>
                        <a:PurchaseDate>2014-10-20T12:04:27.447+00:00</a:PurchaseDate>
                        <a:PurchaseReference>54833568-bb36-4bb5-80a0-99bc30230b1d</a:PurchaseReference>
                        <a:Quantity>23</a:Quantity>
                        <a:RecurrenceLimit i:nil="true"/>
                        <a:RecurrencePeriodSize>1</a:RecurrencePeriodSize>
                        <a:RecurrencePeriodUOM>Month</a:RecurrencePeriodUOM>
                        <a:SourceUpdateDate i:nil="true"/>
                        <a:StringValues>
                            <a:NameValuePair>
                                <a:Name>Color</a:Name>
                                <a:Value>Green</a:Value>
                            </a:NameValuePair>
                            <a:NameValuePair>
                                <a:Name>BatchNumber</a:Name>
                                <a:Value>143798</a:Value>
                            </a:NameValuePair>
                        </a:StringValues>
                    </a:Purchase>
                    <a:Purchase>
                        <a:BillInAdvance>false</a:BillInAdvance>
                        <a:BundleInfo i:nil="true"/>
                        <a:CustomerCode>12345</a:CustomerCode>
                        <a:DateValues/>
                        <a:EndDate>2014-10-21T12:03:35.295+00:00</a:EndDate>
                        <a:Id>54465c876f605b0df04b6617</a:Id>
                        <a:ImportedDate>2014-10-21T16:05:23.202+01:00</a:ImportedDate>
                        <a:NumericValues/>
                        <a:OverrideCost i:nil="true"/>
                        <a:OverrideTotalPurchasePrice i:nil="true"/>
                        <a:OverrideUnitPrice i:nil="true"/>
                        <a:ProductLabel>ProductY</a:ProductLabel>
                        <a:PurchaseDate>2014-10-20T12:04:27.447+00:00</a:PurchaseDate>
                        <a:PurchaseReference>109606aa-8606-49bb-8e22-753d04be8e90</a:PurchaseReference>
                        <a:Quantity>1</a:Quantity>
                        <a:RecurrenceLimit i:nil="true"/>
                        <a:RecurrencePeriodSize>0</a:RecurrencePeriodSize>
                        <a:RecurrencePeriodUOM>None</a:RecurrencePeriodUOM>
                        <a:SourceUpdateDate i:nil="true"/>
                        <a:StringValues>
                            <a:NameValuePair>
                                <a:Name>BatchNumber</a:Name>
                                <a:Value>vm-143798</a:Value>
                            </a:NameValuePair>
                        </a:StringValues>
                    </a:Purchase>
                </a:Result>
                <a:ResultCode>Success</a:ResultCode>
                <a:ResultMessage/>
            </GetPurchasesResult>
        </GetPurchasesResponse>
    </s:Body>
</s:Envelope>