| POST | /dealers/order | Places a new order with the specified items. |
|---|
// @ts-nocheck
export class AuthenticatedRequest
{
/** @description Session token received from successful authentication. */
// @ApiMember(Description="Session token received from successful authentication.", IsRequired=true, ParameterType="query")
public SessionToken: string;
public constructor(init?: Partial<AuthenticatedRequest>) { (Object as any).assign(this, init); }
}
export class NewOrderResult
{
/** @description Number for the order that has been placed. */
// @ApiMember(Description="Number for the order that has been placed.", ParameterType="model")
public OrderNumber?: string;
public constructor(init?: Partial<NewOrderResult>) { (Object as any).assign(this, init); }
}
export class OperationResult
{
/** @description Specifies if the operation was successful. */
// @ApiMember(Description="Specifies if the operation was successful.", ParameterType="model")
public IsSuccessful: boolean;
/** @description States error message in case of unsuccessful operation. */
// @ApiMember(Description="States error message in case of unsuccessful operation.", ParameterType="model")
public ErrorMessage?: string;
public constructor(init?: Partial<OperationResult>) { (Object as any).assign(this, init); }
}
export class PartInfoResultImage
{
/** @description Image number */
// @ApiMember(Description="Image number")
public ImageNumber: number;
/** @description Image URL */
// @ApiMember(Description="Image URL")
public ImageUrl?: string;
public constructor(init?: Partial<PartInfoResultImage>) { (Object as any).assign(this, init); }
}
export class PartStockQuantity
{
/** @description Location ID */
// @ApiMember(Description="Location ID")
public LocationId: number;
/** @description Location code */
// @ApiMember(Description="Location code")
public LocationCode?: string;
/** @description Stock quantity in location */
// @ApiMember(Description="Stock quantity in location")
public StockQuantity: number;
public constructor(init?: Partial<PartStockQuantity>) { (Object as any).assign(this, init); }
}
export class PartInfoResult
{
/** @description Unique ID for the part. */
// @ApiMember(Description="Unique ID for the part.")
public Id: number;
/** @description Part number. */
// @ApiMember(Description="Part number.")
public PartNumber?: string;
/** @description Description of the part. */
// @ApiMember(Description="Description of the part.")
public Description?: string;
/** @description Part manufacturer. */
// @ApiMember(Description="Part manufacturer.")
public Manufacturer?: string;
/** @description Determines if the part can be ordered. */
// @ApiMember(Description="Determines if the part can be ordered.")
public CanBeOrdered: boolean;
/** @description Textual representation of the status of the part. */
// @ApiMember(Description="Textual representation of the status of the part.")
public StatusText?: string;
/** @description Available stock to order. */
// @ApiMember(Description="Available stock to order.")
public AvailableStockQuantity: number;
/** @description Average days needed for delivery. */
// @ApiMember(Description="Average days needed for delivery.")
public AverageDeliveryInDays?: number;
/** @description Price of a single unit, excluding VAT. */
// @ApiMember(Description="Price of a single unit, excluding VAT.")
public UnitPrice?: number;
/** @description EAN number. */
// @ApiMember(Description="EAN number.")
public EanNumber?: string;
/** @description Images */
// @ApiMember(Description="Images")
public Images?: PartInfoResultImage[];
/** @description Secondary article numbers */
// @ApiMember(Description="Secondary article numbers")
public SecondaryArticleNumbers?: string[];
/** @description Replacement article numbers */
// @ApiMember(Description="Replacement article numbers")
public ReplacementArticleNumbers?: string[];
/** @description Stock quantities */
// @ApiMember(Description="Stock quantities")
public StockQuantities?: PartStockQuantity[];
public constructor(init?: Partial<PartInfoResult>) { (Object as any).assign(this, init); }
}
export class PartResults
{
/** @description Total number of parts available. */
// @ApiMember(Description="Total number of parts available.")
public TotalNumberOfParts: number;
/** @description Indication if there are more parts to retrieve. */
// @ApiMember(Description="Indication if there are more parts to retrieve.")
public HasMoreRecords: boolean;
/** @description Part records. */
// @ApiMember(Description="Part records.")
public Parts?: PartInfoResult[];
public constructor(init?: Partial<PartResults>) { (Object as any).assign(this, init); }
}
export class OperationResult_1<T> extends OperationResult
{
/** @description Result value */
// @ApiMember(Description="Result value", ParameterType="model")
public Result?: PartResults;
public constructor(init?: Partial<OperationResult_1<T>>) { super(init); (Object as any).assign(this, init); }
}
export class NewOrderResponse extends OperationResult_1<NewOrderResult>
{
public constructor(init?: Partial<NewOrderResponse>) { super(init); (Object as any).assign(this, init); }
}
export class NewOrderItem
{
/** @description Unique ID for the part. */
// @ApiMember(Description="Unique ID for the part.", IsRequired=true, ParameterType="body")
public PartId: number;
/** @description Quantity to order. */
// @ApiMember(Description="Quantity to order.", IsRequired=true, ParameterType="body")
public Quantity: number;
/** @description Custom reference. */
// @ApiMember(Description="Custom reference.", ParameterType="body")
public Reference?: string;
public constructor(init?: Partial<NewOrderItem>) { (Object as any).assign(this, init); }
}
export class NewOrderItemList extends Array<NewOrderItem>
{
public constructor(init?: Partial<NewOrderItemList>) { super(); (Object as any).assign(this, init); }
}
export class NewOrderAddress implements IAddress
{
/** @description Company name. */
// @ApiMember(Description="Company name.", ParameterType="body")
public CompanyName?: string;
/** @description First name. */
// @ApiMember(Description="First name.", ParameterType="body")
public FirstName?: string;
/** @description Last name. */
// @ApiMember(Description="Last name.", ParameterType="body")
public LastName?: string;
/** @description Street name. */
// @ApiMember(Description="Street name.", IsRequired=true, ParameterType="body")
public StreetName: string;
/** @description House number. */
// @ApiMember(Description="House number.", IsRequired=true, ParameterType="body")
public HouseNumber: string;
/** @description House number addition. */
// @ApiMember(Description="House number addition.", ParameterType="body")
public HouseNumberAddition?: string;
/** @description Postal code. */
// @ApiMember(Description="Postal code.", IsRequired=true, ParameterType="body")
public PostalCode: string;
/** @description City. */
// @ApiMember(Description="City.", IsRequired=true, ParameterType="body")
public City: string;
/** @description Country code. */
// @ApiMember(Description="Country code.", IsRequired=true, ParameterType="body")
public CountryCode: string;
/** @description Telephone number. */
// @ApiMember(Description="Telephone number.", ParameterType="body")
public TelephoneNumber?: string;
public constructor(init?: Partial<NewOrderAddress>) { (Object as any).assign(this, init); }
}
export class PostNewOrder extends AuthenticatedRequest
{
/** @description Items to order. */
// @ApiMember(Description="Items to order.", IsRequired=true, ParameterType="body")
public Items: NewOrderItemList;
/** @description Dropshipment indication. */
// @ApiMember(Description="Dropshipment indication.", ParameterType="body")
public UseDropshipment?: boolean;
/** @description Delivery address. */
// @ApiMember(Description="Delivery address.", ParameterType="body")
public DeliveryAddress?: NewOrderAddress;
public constructor(init?: Partial<PostNewOrder>) { super(init); (Object as any).assign(this, init); }
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
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/xml
Content-Type: application/xml
Content-Length: length
<PostNewOrder xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/_2Service.Webservices.ServiceModel.Dealers">
<SessionToken>String</SessionToken>
<DeliveryAddress>
<City>String</City>
<CompanyName>String</CompanyName>
<CountryCode>String</CountryCode>
<FirstName>String</FirstName>
<HouseNumber>String</HouseNumber>
<HouseNumberAddition>String</HouseNumberAddition>
<LastName>String</LastName>
<PostalCode>String</PostalCode>
<StreetName>String</StreetName>
<TelephoneNumber>String</TelephoneNumber>
</DeliveryAddress>
<Items>
<NewOrderItem>
<PartId>0</PartId>
<Quantity>0</Quantity>
<Reference>String</Reference>
</NewOrderItem>
</Items>
<UseDropshipment>false</UseDropshipment>
</PostNewOrder>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<NewOrderResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/_2Service.Webservices.ServiceModel.Dealers">
<ErrorMessage xmlns="http://schemas.datacontract.org/2004/07/_2Service.Webservices.ServiceModel">String</ErrorMessage>
<IsSuccessful xmlns="http://schemas.datacontract.org/2004/07/_2Service.Webservices.ServiceModel">false</IsSuccessful>
<Result xmlns:d2p1="http://schemas.datacontract.org/2004/07/_2Service.Webservices.ServiceModel.Dealers" xmlns="http://schemas.datacontract.org/2004/07/_2Service.Webservices.ServiceModel">
<d2p1:OrderNumber>String</d2p1:OrderNumber>
</Result>
</NewOrderResponse>