| POST | /dealers/order | Places a new order with the specified items. |
|---|
import java.math.*
import java.util.*
import java.io.InputStream
import net.servicestack.client.*
open class PostNewOrder : AuthenticatedRequest()
{
/**
* Items to order.
*/
@ApiMember(Description="Items to order.", IsRequired=true, ParameterType="body")
open var Items:NewOrderItemList? = null
/**
* Dropshipment indication.
*/
@ApiMember(Description="Dropshipment indication.", ParameterType="body")
open var UseDropshipment:Boolean? = null
/**
* Delivery address.
*/
@ApiMember(Description="Delivery address.", ParameterType="body")
open var DeliveryAddress:NewOrderAddress? = null
}
open class AuthenticatedRequest
{
/**
* Session token received from successful authentication.
*/
@ApiMember(Description="Session token received from successful authentication.", IsRequired=true, ParameterType="query")
open var SessionToken:String? = null
}
open class NewOrderItemList : ArrayList<NewOrderItem>()
{
}
open class NewOrderItem
{
/**
* Unique ID for the part.
*/
@ApiMember(Description="Unique ID for the part.", IsRequired=true, ParameterType="body")
open var PartId:Int? = null
/**
* Quantity to order.
*/
@ApiMember(Description="Quantity to order.", IsRequired=true, ParameterType="body")
open var Quantity:Int? = null
/**
* Custom reference.
*/
@ApiMember(Description="Custom reference.", ParameterType="body")
open var Reference:String? = null
}
open class NewOrderAddress : IAddress
{
/**
* Company name.
*/
@ApiMember(Description="Company name.", ParameterType="body")
override var CompanyName:String? = null
/**
* First name.
*/
@ApiMember(Description="First name.", ParameterType="body")
override var FirstName:String? = null
/**
* Last name.
*/
@ApiMember(Description="Last name.", ParameterType="body")
override var LastName:String? = null
/**
* Street name.
*/
@ApiMember(Description="Street name.", IsRequired=true, ParameterType="body")
override var StreetName:String? = null
/**
* House number.
*/
@ApiMember(Description="House number.", IsRequired=true, ParameterType="body")
override var HouseNumber:String? = null
/**
* House number addition.
*/
@ApiMember(Description="House number addition.", ParameterType="body")
override var HouseNumberAddition:String? = null
/**
* Postal code.
*/
@ApiMember(Description="Postal code.", IsRequired=true, ParameterType="body")
override var PostalCode:String? = null
/**
* City.
*/
@ApiMember(Description="City.", IsRequired=true, ParameterType="body")
override var City:String? = null
/**
* Country code.
*/
@ApiMember(Description="Country code.", IsRequired=true, ParameterType="body")
override var CountryCode:String? = null
/**
* Telephone number.
*/
@ApiMember(Description="Telephone number.", ParameterType="body")
override var TelephoneNumber:String? = null
}
open class NewOrderResponse : OperationResult_1<NewOrderResult>()
{
}
open class OperationResult_1<T> : OperationResult()
{
/**
* Result value
*/
@ApiMember(Description="Result value", ParameterType="model")
open var Result:PartResults? = null
}
open class OperationResult
{
/**
* Specifies if the operation was successful.
*/
@ApiMember(Description="Specifies if the operation was successful.", ParameterType="model")
open var IsSuccessful:Boolean? = null
/**
* States error message in case of unsuccessful operation.
*/
@ApiMember(Description="States error message in case of unsuccessful operation.", ParameterType="model")
open var ErrorMessage:String? = null
}
open class PartResults
{
/**
* Total number of parts available.
*/
@ApiMember(Description="Total number of parts available.")
open var TotalNumberOfParts:Int? = null
/**
* Indication if there are more parts to retrieve.
*/
@ApiMember(Description="Indication if there are more parts to retrieve.")
open var HasMoreRecords:Boolean? = null
/**
* Part records.
*/
@ApiMember(Description="Part records.")
open var Parts:ArrayList<PartInfoResult>? = null
}
open class PartInfoResult
{
/**
* Unique ID for the part.
*/
@ApiMember(Description="Unique ID for the part.")
open var Id:Int? = null
/**
* Part number.
*/
@ApiMember(Description="Part number.")
open var PartNumber:String? = null
/**
* Description of the part.
*/
@ApiMember(Description="Description of the part.")
open var Description:String? = null
/**
* Part manufacturer.
*/
@ApiMember(Description="Part manufacturer.")
open var Manufacturer:String? = null
/**
* Determines if the part can be ordered.
*/
@ApiMember(Description="Determines if the part can be ordered.")
open var CanBeOrdered:Boolean? = null
/**
* Textual representation of the status of the part.
*/
@ApiMember(Description="Textual representation of the status of the part.")
open var StatusText:String? = null
/**
* Available stock to order.
*/
@ApiMember(Description="Available stock to order.")
open var AvailableStockQuantity:Int? = null
/**
* Average days needed for delivery.
*/
@ApiMember(Description="Average days needed for delivery.")
open var AverageDeliveryInDays:Int? = null
/**
* Price of a single unit, excluding VAT.
*/
@ApiMember(Description="Price of a single unit, excluding VAT.")
open var UnitPrice:BigDecimal? = null
/**
* EAN number.
*/
@ApiMember(Description="EAN number.")
open var EanNumber:String? = null
/**
* Images
*/
@ApiMember(Description="Images")
open var Images:ArrayList<PartInfoResultImage>? = null
/**
* Secondary article numbers
*/
@ApiMember(Description="Secondary article numbers")
open var SecondaryArticleNumbers:ArrayList<String>? = null
/**
* Replacement article numbers
*/
@ApiMember(Description="Replacement article numbers")
open var ReplacementArticleNumbers:ArrayList<String>? = null
/**
* Stock quantities
*/
@ApiMember(Description="Stock quantities")
open var StockQuantities:ArrayList<PartStockQuantity>? = null
}
open class PartInfoResultImage
{
/**
* Image number
*/
@ApiMember(Description="Image number")
open var ImageNumber:Int? = null
/**
* Image URL
*/
@ApiMember(Description="Image URL")
open var ImageUrl:String? = null
}
open class PartStockQuantity
{
/**
* Location ID
*/
@ApiMember(Description="Location ID")
open var LocationId:Int? = null
/**
* Location code
*/
@ApiMember(Description="Location code")
open var LocationCode:String? = null
/**
* Stock quantity in location
*/
@ApiMember(Description="Stock quantity in location")
open var StockQuantity:Int? = null
}
open class NewOrderResult
{
/**
* Number for the order that has been placed.
*/
@ApiMember(Description="Number for the order that has been placed.", ParameterType="model")
open var OrderNumber:String? = null
}
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
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"}