2Service Services API

<back to all web services

PostNewOrder

The following routes are available for this service:
POST/dealers/orderPlaces a new order with the specified items.
namespace _2Service.Webservices.ServiceModel

open System
open System.IO
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations

    [<AllowNullLiteral>]
    type NewOrderResult() = 
        ///<summary>
        ///Number for the order that has been placed.
        ///</summary>
        [<ApiMember(Description="Number for the order that has been placed.", ParameterType="model")>]
        member val OrderNumber:String = null with get,set

    [<AllowNullLiteral>]
    type OperationResult() = 
        ///<summary>
        ///Specifies if the operation was successful.
        ///</summary>
        [<ApiMember(Description="Specifies if the operation was successful.", ParameterType="model")>]
        member val IsSuccessful:Boolean = new Boolean() with get,set

        ///<summary>
        ///States error message in case of unsuccessful operation.
        ///</summary>
        [<ApiMember(Description="States error message in case of unsuccessful operation.", ParameterType="model")>]
        member val ErrorMessage:String = null with get,set

    [<AllowNullLiteral>]
    type PartInfoResultImage() = 
        ///<summary>
        ///Image number
        ///</summary>
        [<ApiMember(Description="Image number")>]
        member val ImageNumber:Int32 = new Int32() with get,set

        ///<summary>
        ///Image URL
        ///</summary>
        [<ApiMember(Description="Image URL")>]
        member val ImageUrl:String = null with get,set

    [<AllowNullLiteral>]
    type PartStockQuantity() = 
        ///<summary>
        ///Location ID
        ///</summary>
        [<ApiMember(Description="Location ID")>]
        member val LocationId:Int32 = new Int32() with get,set

        ///<summary>
        ///Location code
        ///</summary>
        [<ApiMember(Description="Location code")>]
        member val LocationCode:String = null with get,set

        ///<summary>
        ///Stock quantity in location
        ///</summary>
        [<ApiMember(Description="Stock quantity in location")>]
        member val StockQuantity:Int32 = new Int32() with get,set

    [<AllowNullLiteral>]
    type PartInfoResult() = 
        ///<summary>
        ///Unique ID for the part.
        ///</summary>
        [<ApiMember(Description="Unique ID for the part.")>]
        member val Id:Int32 = new Int32() with get,set

        ///<summary>
        ///Part number.
        ///</summary>
        [<ApiMember(Description="Part number.")>]
        member val PartNumber:String = null with get,set

        ///<summary>
        ///Description of the part.
        ///</summary>
        [<ApiMember(Description="Description of the part.")>]
        member val Description:String = null with get,set

        ///<summary>
        ///Part manufacturer.
        ///</summary>
        [<ApiMember(Description="Part manufacturer.")>]
        member val Manufacturer:String = null with get,set

        ///<summary>
        ///Determines if the part can be ordered.
        ///</summary>
        [<ApiMember(Description="Determines if the part can be ordered.")>]
        member val CanBeOrdered:Boolean = new Boolean() with get,set

        ///<summary>
        ///Textual representation of the status of the part.
        ///</summary>
        [<ApiMember(Description="Textual representation of the status of the part.")>]
        member val StatusText:String = null with get,set

        ///<summary>
        ///Available stock to order.
        ///</summary>
        [<ApiMember(Description="Available stock to order.")>]
        member val AvailableStockQuantity:Int32 = new Int32() with get,set

        ///<summary>
        ///Average days needed for delivery.
        ///</summary>
        [<ApiMember(Description="Average days needed for delivery.")>]
        member val AverageDeliveryInDays:Nullable<Int32> = new Nullable<Int32>() with get,set

        ///<summary>
        ///Price of a single unit, excluding VAT.
        ///</summary>
        [<ApiMember(Description="Price of a single unit, excluding VAT.")>]
        member val UnitPrice:Nullable<Decimal> = new Nullable<Decimal>() with get,set

        ///<summary>
        ///EAN number.
        ///</summary>
        [<ApiMember(Description="EAN number.")>]
        member val EanNumber:String = null with get,set

        ///<summary>
        ///Images
        ///</summary>
        [<ApiMember(Description="Images")>]
        member val Images:ResizeArray<PartInfoResultImage> = null with get,set

        ///<summary>
        ///Secondary article numbers
        ///</summary>
        [<ApiMember(Description="Secondary article numbers")>]
        member val SecondaryArticleNumbers:ResizeArray<String> = null with get,set

        ///<summary>
        ///Replacement article numbers
        ///</summary>
        [<ApiMember(Description="Replacement article numbers")>]
        member val ReplacementArticleNumbers:ResizeArray<String> = null with get,set

        ///<summary>
        ///Stock quantities
        ///</summary>
        [<ApiMember(Description="Stock quantities")>]
        member val StockQuantities:ResizeArray<PartStockQuantity> = null with get,set

    [<AllowNullLiteral>]
    type PartResults() = 
        ///<summary>
        ///Total number of parts available.
        ///</summary>
        [<ApiMember(Description="Total number of parts available.")>]
        member val TotalNumberOfParts:Int32 = new Int32() with get,set

        ///<summary>
        ///Indication if there are more parts to retrieve.
        ///</summary>
        [<ApiMember(Description="Indication if there are more parts to retrieve.")>]
        member val HasMoreRecords:Boolean = new Boolean() with get,set

        ///<summary>
        ///Part records.
        ///</summary>
        [<ApiMember(Description="Part records.")>]
        member val Parts:ResizeArray<PartInfoResult> = null with get,set

    [<AllowNullLiteral>]
    type OperationResult<T>() = 
        inherit OperationResult()
        ///<summary>
        ///Result value
        ///</summary>
        [<ApiMember(Description="Result value", ParameterType="model")>]
        member val Result:PartResults = null with get,set

    [<AllowNullLiteral>]
    type NewOrderResponse() = 
        inherit OperationResult<NewOrderResult>()

    [<AllowNullLiteral>]
    type AuthenticatedRequest() = 
        ///<summary>
        ///Session token received from successful authentication.
        ///</summary>
        [<ApiMember(Description="Session token received from successful authentication.", IsRequired=true, ParameterType="query")>]
        member val SessionToken:String = null with get,set

    [<AllowNullLiteral>]
    type NewOrderItem() = 
        ///<summary>
        ///Unique ID for the part.
        ///</summary>
        [<ApiMember(Description="Unique ID for the part.", IsRequired=true, ParameterType="body")>]
        member val PartId:Int32 = new Int32() with get,set

        ///<summary>
        ///Quantity to order.
        ///</summary>
        [<ApiMember(Description="Quantity to order.", IsRequired=true, ParameterType="body")>]
        member val Quantity:Int32 = new Int32() with get,set

        ///<summary>
        ///Custom reference.
        ///</summary>
        [<ApiMember(Description="Custom reference.", ParameterType="body")>]
        member val Reference:String = null with get,set

    [<AllowNullLiteral>]
    type NewOrderItemList() = 
        inherit ResizeArray<NewOrderItem>()

    [<AllowNullLiteral>]
    type NewOrderAddress() = 
        ///<summary>
        ///Company name.
        ///</summary>
        [<ApiMember(Description="Company name.", ParameterType="body")>]
        member val CompanyName:String = null with get,set

        ///<summary>
        ///First name.
        ///</summary>
        [<ApiMember(Description="First name.", ParameterType="body")>]
        member val FirstName:String = null with get,set

        ///<summary>
        ///Last name.
        ///</summary>
        [<ApiMember(Description="Last name.", ParameterType="body")>]
        member val LastName:String = null with get,set

        ///<summary>
        ///Street name.
        ///</summary>
        [<ApiMember(Description="Street name.", IsRequired=true, ParameterType="body")>]
        member val StreetName:String = null with get,set

        ///<summary>
        ///House number.
        ///</summary>
        [<ApiMember(Description="House number.", IsRequired=true, ParameterType="body")>]
        member val HouseNumber:String = null with get,set

        ///<summary>
        ///House number addition.
        ///</summary>
        [<ApiMember(Description="House number addition.", ParameterType="body")>]
        member val HouseNumberAddition:String = null with get,set

        ///<summary>
        ///Postal code.
        ///</summary>
        [<ApiMember(Description="Postal code.", IsRequired=true, ParameterType="body")>]
        member val PostalCode:String = null with get,set

        ///<summary>
        ///City.
        ///</summary>
        [<ApiMember(Description="City.", IsRequired=true, ParameterType="body")>]
        member val City:String = null with get,set

        ///<summary>
        ///Country code.
        ///</summary>
        [<ApiMember(Description="Country code.", IsRequired=true, ParameterType="body")>]
        member val CountryCode:String = null with get,set

        ///<summary>
        ///Telephone number.
        ///</summary>
        [<ApiMember(Description="Telephone number.", ParameterType="body")>]
        member val TelephoneNumber:String = null with get,set

    [<AllowNullLiteral>]
    type PostNewOrder() = 
        inherit AuthenticatedRequest()
        ///<summary>
        ///Items to order.
        ///</summary>
        [<ApiMember(Description="Items to order.", IsRequired=true, ParameterType="body")>]
        member val Items:NewOrderItemList = null with get,set

        ///<summary>
        ///Dropshipment indication.
        ///</summary>
        [<ApiMember(Description="Dropshipment indication.", ParameterType="body")>]
        member val UseDropshipment:Nullable<Boolean> = new Nullable<Boolean>() with get,set

        ///<summary>
        ///Delivery address.
        ///</summary>
        [<ApiMember(Description="Delivery address.", ParameterType="body")>]
        member val DeliveryAddress:NewOrderAddress = null with get,set

F# PostNewOrder DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

POST /dealers/order HTTP/1.1 
Host: services.acct.2service.nl 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"Items":[{"PartId":0,"Quantity":0,"Reference":"String"}],"UseDropshipment":false,"DeliveryAddress":{"CompanyName":"String","FirstName":"String","LastName":"String","StreetName":"String","HouseNumber":"String","HouseNumberAddition":"String","PostalCode":"String","City":"String","CountryCode":"String","TelephoneNumber":"String"},"SessionToken":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

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