2Service Services API

<back to all web services

GetSearchParts

The following routes are available for this service:
GET/dealers/parts/searchSearches for articles by keyword(s).
Imports System
Imports System.IO
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports _2Service.Webservices.ServiceModel.Dealers
Imports _2Service.Webservices.ServiceModel

Namespace Global

    Namespace _2Service.Webservices.ServiceModel

        Public Partial Class OperationResult
            '''<Summary>
            '''Specifies if the operation was successful.
            '''</Summary>
            <ApiMember(Description:="Specifies if the operation was successful.", ParameterType:="model")>
            Public Overridable Property IsSuccessful As Boolean

            '''<Summary>
            '''States error message in case of unsuccessful operation.
            '''</Summary>
            <ApiMember(Description:="States error message in case of unsuccessful operation.", ParameterType:="model")>
            Public Overridable Property ErrorMessage As String
        End Class

        Public Partial Class OperationResult(Of T)
            Inherits OperationResult
            '''<Summary>
            '''Result value
            '''</Summary>
            <ApiMember(Description:="Result value", ParameterType:="model")>
            Public Overridable Property Result As PartResults
        End Class
    End Namespace

    Namespace _2Service.Webservices.ServiceModel.Dealers

        Public Partial Class AuthenticatedRequest
            '''<Summary>
            '''Session token received from successful authentication.
            '''</Summary>
            <ApiMember(Description:="Session token received from successful authentication.", IsRequired:=true, ParameterType:="query")>
            Public Overridable Property SessionToken As String
        End Class

        Public Partial Class GetSearchParts
            Inherits AuthenticatedRequest
            '''<Summary>
            '''Keyword(s)
            '''</Summary>
            <ApiMember(Description:="Keyword(s)", IsRequired:=true)>
            Public Overridable Property SearchText As String

            '''<Summary>
            '''Article type (1=part, 2=accessory, 3=tool, 4=device)
            '''</Summary>
            <ApiMember(Description:="Article type (1=part, 2=accessory, 3=tool, 4=device)", IsRequired:=true)>
            Public Overridable Property ArticleType As Integer

            '''<Summary>
            '''Number of parts to return (max 100).
            '''</Summary>
            <ApiMember(Description:="Number of parts to return (max 100).", IsRequired:=true)>
            Public Overridable Property PageSize As Integer

            '''<Summary>
            '''Page number.
            '''</Summary>
            <ApiMember(Description:="Page number.", IsRequired:=true)>
            Public Overridable Property Page As Integer
        End Class

        Public Partial Class PartInfoResult
            '''<Summary>
            '''Unique ID for the part.
            '''</Summary>
            <ApiMember(Description:="Unique ID for the part.")>
            Public Overridable Property Id As Integer

            '''<Summary>
            '''Part number.
            '''</Summary>
            <ApiMember(Description:="Part number.")>
            Public Overridable Property PartNumber As String

            '''<Summary>
            '''Description of the part.
            '''</Summary>
            <ApiMember(Description:="Description of the part.")>
            Public Overridable Property Description As String

            '''<Summary>
            '''Part manufacturer.
            '''</Summary>
            <ApiMember(Description:="Part manufacturer.")>
            Public Overridable Property Manufacturer As String

            '''<Summary>
            '''Determines if the part can be ordered.
            '''</Summary>
            <ApiMember(Description:="Determines if the part can be ordered.")>
            Public Overridable Property CanBeOrdered As Boolean

            '''<Summary>
            '''Textual representation of the status of the part.
            '''</Summary>
            <ApiMember(Description:="Textual representation of the status of the part.")>
            Public Overridable Property StatusText As String

            '''<Summary>
            '''Available stock to order.
            '''</Summary>
            <ApiMember(Description:="Available stock to order.")>
            Public Overridable Property AvailableStockQuantity As Integer

            '''<Summary>
            '''Average days needed for delivery.
            '''</Summary>
            <ApiMember(Description:="Average days needed for delivery.")>
            Public Overridable Property AverageDeliveryInDays As Integer?

            '''<Summary>
            '''Price of a single unit, excluding VAT.
            '''</Summary>
            <ApiMember(Description:="Price of a single unit, excluding VAT.")>
            Public Overridable Property UnitPrice As Decimal?

            '''<Summary>
            '''EAN number.
            '''</Summary>
            <ApiMember(Description:="EAN number.")>
            Public Overridable Property EanNumber As String

            '''<Summary>
            '''Images
            '''</Summary>
            <ApiMember(Description:="Images")>
            Public Overridable Property Images As List(Of PartInfoResultImage)

            '''<Summary>
            '''Secondary article numbers
            '''</Summary>
            <ApiMember(Description:="Secondary article numbers")>
            Public Overridable Property SecondaryArticleNumbers As List(Of String)

            '''<Summary>
            '''Replacement article numbers
            '''</Summary>
            <ApiMember(Description:="Replacement article numbers")>
            Public Overridable Property ReplacementArticleNumbers As List(Of String)

            '''<Summary>
            '''Stock quantities
            '''</Summary>
            <ApiMember(Description:="Stock quantities")>
            Public Overridable Property StockQuantities As List(Of PartStockQuantity)
        End Class

        Public Partial Class PartInfoResultImage
            '''<Summary>
            '''Image number
            '''</Summary>
            <ApiMember(Description:="Image number")>
            Public Overridable Property ImageNumber As Integer

            '''<Summary>
            '''Image URL
            '''</Summary>
            <ApiMember(Description:="Image URL")>
            Public Overridable Property ImageUrl As String
        End Class

        Public Partial Class PartResults
            '''<Summary>
            '''Total number of parts available.
            '''</Summary>
            <ApiMember(Description:="Total number of parts available.")>
            Public Overridable Property TotalNumberOfParts As Integer

            '''<Summary>
            '''Indication if there are more parts to retrieve.
            '''</Summary>
            <ApiMember(Description:="Indication if there are more parts to retrieve.")>
            Public Overridable Property HasMoreRecords As Boolean

            '''<Summary>
            '''Part records.
            '''</Summary>
            <ApiMember(Description:="Part records.")>
            Public Overridable Property Parts As List(Of PartInfoResult)
        End Class

        Public Partial Class PartStockQuantity
            '''<Summary>
            '''Location ID
            '''</Summary>
            <ApiMember(Description:="Location ID")>
            Public Overridable Property LocationId As Integer

            '''<Summary>
            '''Location code
            '''</Summary>
            <ApiMember(Description:="Location code")>
            Public Overridable Property LocationCode As String

            '''<Summary>
            '''Stock quantity in location
            '''</Summary>
            <ApiMember(Description:="Stock quantity in location")>
            Public Overridable Property StockQuantity As Integer
        End Class
    End Namespace
End Namespace

VB.NET GetSearchParts DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /dealers/parts/search HTTP/1.1 
Host: services.acct.2service.nl 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<OperationResultOfPartResultsIFqyKMl_P xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/_2Service.Webservices.ServiceModel">
  <ErrorMessage>String</ErrorMessage>
  <IsSuccessful>false</IsSuccessful>
  <Result xmlns:d2p1="http://schemas.datacontract.org/2004/07/_2Service.Webservices.ServiceModel.Dealers">
    <d2p1:HasMoreRecords>false</d2p1:HasMoreRecords>
    <d2p1:Parts>
      <d2p1:PartInfoResult i:nil="true" />
    </d2p1:Parts>
    <d2p1:TotalNumberOfParts>0</d2p1:TotalNumberOfParts>
  </Result>
</OperationResultOfPartResultsIFqyKMl_P>