1501 API Post

Introduction

The purpose of this service is to save new Orders to Vision database,

Request

Request URL POST : https://<pathtoapi>/service/Order

POST Body structure : SO XML Structure

<?xml version="1.0" encoding="UTF-8"?> <ORDERS> <SO> <HD> <FKCustomer>CUS1</FKCustomer> <FKUnderBondType>T</FKUnderBondType> <DocumentRef>API_1</DocumentRef> <DPAccountRef>API_1</DPAccountRef> <OrderDate>31/10/2017</OrderDate> <DeliveryName>Test Wines</DeliveryName> <DeliveryAddress1>Add 1</DeliveryAddress1> <DeliveryAddress2>Address 2</DeliveryAddress2> <DeliveryTownOrCounty>ASD</DeliveryTownOrCounty> <DeliveryPostcode>QWER TYU</DeliveryPostcode> <DeliveryCountry>GB</DeliveryCountry> <ContactName>Contact Name</ContactName> <ContactTelephoneNo>00000 111111</ContactTelephoneNo> </HD> <HO> <FKSalesOrderType>1</FKSalesOrderType> <SiteCode>CO</SiteCode> <EarliestTime></EarliestTime> <CustomerPORef>123</CustomerPORef> <IsBookingRequired>Y</IsBookingRequired> <RemovalAuthorisationConfirmed>Y</RemovalAuthorisationConfirmed> <DeliveryCategory /> <ParcelCarrierExtraInsuranceRequired>N</ParcelCarrierExtraInsuranceRequired> <ProcessedBy>Devi Prabha</ProcessedBy> <SendDeliveryConfirmationEmail>N</SendDeliveryConfirmationEmail> <SendDeliveryIssueEmail>N</SendDeliveryIssueEmail> <SendBookingDelayedEmail>N</SendBookingDelayedEmail> <GDPR_Type>1</GDPR_Type> <GDPR_Erase>N</GDPR_Erase> </HO> <HU> <CustomsDefermentNumber>CDN1</CustomsDefermentNumber> <PayCustomsDuty>N</PayCustomsDuty> <ConsigneeName>Bob</ConsigneeName> <ConsigneeAddress1>Add1</ConsigneeAddress1> <ConsigneeAddress2>ad2</ConsigneeAddress2> <ConsigneeAddress4>CN AD</ConsigneeAddress4> <ConsigneePostcode>XSES 0LB</ConsigneePostcode> <ConsigneeCountry>GB</ConsigneeCountry> <TransportName>TRN</TransportName> </HU> <LD> <FKProduct>08061</FKProduct> <RotationNo>17/0000896</RotationNo> <RotationLineNo></RotationLineNo> <PalletsOrdered>0</PalletsOrdered> <UnitsOrdered>1</UnitsOrdered> <SinglesOrdered>2</SinglesOrdered> <SalesPrice>25.00</SalesPrice> <PODLineNumber>1</PODLineNumber> </LD> <LO> </LO> </SO> </ORDERS>

Response

Response body will have new tag <RES> attached with input XML which will have information about the response.

<RES> <Code></Code> <Message></Message> </RES>

Code will be 200 or 400, 200 is for success, if the code is 400 node <Message> will have reason for failure

HTTP Response Codes

Code

Message

Code

Message

200

OK, All request processed

406

Input XML validation failed, response body will have reason for failure

429

API access restricted (Exceeded the rate limit / access not allowed)

207

Multi-Status, <RES> tag have more information

400

Request processing all record failed, <RES> tag have more information

Response samples

Code : 200

The response body depends on the configuration applied to your warehouse / API user account, for data posted directly into the main system a record by record response is given as below, alternatively ‘Data saved for processing’ will be returned.

Unless told otherwise you should expect the basic response which is a text reply.

<ORDERS> <SO> <HD> <DocumentRef>API_1</DocumentRef> <DPAccountRef>BALF</DPAccountRef> </HD> <RES> <Code>200</Code> <Message>Order processed</Message> </RES> </SO> </ORDERS>

 

Code : 207

 

Code : 400

 

Code : 406 Response Body

 

Copyright Ontech Solutions 2017-2024. All rights reserved, no part may be replicated or distributed without the express permission of the owner.