2Service Services API

<back to all web services

GetPartInfo

The following routes are available for this service:
GET/dealers/partRetrieves part info based on part number.
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using _2Service.Webservices.ServiceModel.Dealers;
using _2Service.Webservices.ServiceModel;

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 virtual bool IsSuccessful { get; set; }

        ///<summary>
        ///States error message in case of unsuccessful operation.
        ///</summary>
        [ApiMember(Description="States error message in case of unsuccessful operation.", ParameterType="model")]
        public virtual string? ErrorMessage { get; set; }
    }

    public partial class OperationResult<T>
        : OperationResult
    {
        ///<summary>
        ///Result value
        ///</summary>
        [ApiMember(Description="Result value", ParameterType="model")]
        public virtual PartResults? Result { get; set; }
    }

}

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 virtual string SessionToken { get; set; }
    }

    public partial class GetPartInfo
        : AuthenticatedRequest
    {
        ///<summary>
        ///Part number to retrieve info for.
        ///</summary>
        [ApiMember(Description="Part number to retrieve info for.", IsRequired=true)]
        public virtual string PartNumber { get; set; }
    }

    public partial class PartInfoResponse
        : OperationResult<PartInfoResult>
    {
    }

    public partial class PartInfoResult
    {
        ///<summary>
        ///Unique ID for the part.
        ///</summary>
        [ApiMember(Description="Unique ID for the part.")]
        public virtual int Id { get; set; }

        ///<summary>
        ///Part number.
        ///</summary>
        [ApiMember(Description="Part number.")]
        public virtual string? PartNumber { get; set; }

        ///<summary>
        ///Description of the part.
        ///</summary>
        [ApiMember(Description="Description of the part.")]
        public virtual string? Description { get; set; }

        ///<summary>
        ///Part manufacturer.
        ///</summary>
        [ApiMember(Description="Part manufacturer.")]
        public virtual string? Manufacturer { get; set; }

        ///<summary>
        ///Determines if the part can be ordered.
        ///</summary>
        [ApiMember(Description="Determines if the part can be ordered.")]
        public virtual bool CanBeOrdered { get; set; }

        ///<summary>
        ///Textual representation of the status of the part.
        ///</summary>
        [ApiMember(Description="Textual representation of the status of the part.")]
        public virtual string? StatusText { get; set; }

        ///<summary>
        ///Available stock to order.
        ///</summary>
        [ApiMember(Description="Available stock to order.")]
        public virtual int AvailableStockQuantity { get; set; }

        ///<summary>
        ///Average days needed for delivery.
        ///</summary>
        [ApiMember(Description="Average days needed for delivery.")]
        public virtual int? AverageDeliveryInDays { get; set; }

        ///<summary>
        ///Price of a single unit, excluding VAT.
        ///</summary>
        [ApiMember(Description="Price of a single unit, excluding VAT.")]
        public virtual decimal? UnitPrice { get; set; }

        ///<summary>
        ///EAN number.
        ///</summary>
        [ApiMember(Description="EAN number.")]
        public virtual string? EanNumber { get; set; }

        ///<summary>
        ///Images
        ///</summary>
        [ApiMember(Description="Images")]
        public virtual List<PartInfoResultImage>? Images { get; set; }

        ///<summary>
        ///Secondary article numbers
        ///</summary>
        [ApiMember(Description="Secondary article numbers")]
        public virtual List<string>? SecondaryArticleNumbers { get; set; }

        ///<summary>
        ///Replacement article numbers
        ///</summary>
        [ApiMember(Description="Replacement article numbers")]
        public virtual List<string>? ReplacementArticleNumbers { get; set; }

        ///<summary>
        ///Stock quantities
        ///</summary>
        [ApiMember(Description="Stock quantities")]
        public virtual List<PartStockQuantity>? StockQuantities { get; set; }
    }

    public partial class PartInfoResultImage
    {
        ///<summary>
        ///Image number
        ///</summary>
        [ApiMember(Description="Image number")]
        public virtual int ImageNumber { get; set; }

        ///<summary>
        ///Image URL
        ///</summary>
        [ApiMember(Description="Image URL")]
        public virtual string? ImageUrl { get; set; }
    }

    public partial class PartResults
    {
        ///<summary>
        ///Total number of parts available.
        ///</summary>
        [ApiMember(Description="Total number of parts available.")]
        public virtual int TotalNumberOfParts { get; set; }

        ///<summary>
        ///Indication if there are more parts to retrieve.
        ///</summary>
        [ApiMember(Description="Indication if there are more parts to retrieve.")]
        public virtual bool HasMoreRecords { get; set; }

        ///<summary>
        ///Part records.
        ///</summary>
        [ApiMember(Description="Part records.")]
        public virtual List<PartInfoResult>? Parts { get; set; }
    }

    public partial class PartStockQuantity
    {
        ///<summary>
        ///Location ID
        ///</summary>
        [ApiMember(Description="Location ID")]
        public virtual int LocationId { get; set; }

        ///<summary>
        ///Location code
        ///</summary>
        [ApiMember(Description="Location code")]
        public virtual string? LocationCode { get; set; }

        ///<summary>
        ///Stock quantity in location
        ///</summary>
        [ApiMember(Description="Stock quantity in location")]
        public virtual int StockQuantity { get; set; }
    }

}

C# GetPartInfo DTOs

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

HTTP + OTHER

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

GET /dealers/part HTTP/1.1 
Host: services.acct.2service.nl 
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"IsSuccessful":false,"ErrorMessage":"String"}