Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Introduction

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

Request

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

POST Body structure : PA XML Structure

 Request body sample
<?xml version='1.0' standalone='yes'?>
<PREADVICES>
    <PA>
        <HD>
            <CustomerCode>CUS1</CustomerCode>
            <CustomerPONumber>API_TEST1</CustomerPONumber>
            <CustomerPODate>28/06/2018</CustomerPODate>
        </HD>
        <HO>
            <SiteCode>CO</SiteCode>
            <DeliveryType>PUR</DeliveryType>
            <ExpectedDeliveryDate>28/06/2020</ExpectedDeliveryDate>
            <Container>N</Container>
            <ContainerNumber/>
            <SlipSheetsInUse>N</SlipSheetsInUse>
            <OnPallets>N</OnPallets>
            <SupplierName>A tester</SupplierName>
            <SupplierContactName>A. tester</SupplierContactName>
            <SupplierAddressLine1>address 1</SupplierAddressLine1>
            <SupplierAddressLine2>address 2</SupplierAddressLine2>
            <SupplierAddressLine3>Add3</SupplierAddressLine3>
            <SupplierTown>Town1</SupplierTown>
            <SupplierPostcode>CM15 000</SupplierPostcode>
            <SupplierCountry>GB</SupplierCountry>
            <SupplierTelephone>1234 567 8910</SupplierTelephone>
            <SupplierFax>1234 567 8910</SupplierFax>
            <SupplierEmail>test@tt.net</SupplierEmail>
            <SupplierCode>SUP1</SupplierCode>
            <ShipperName>df</ShipperName>
            <ShipperContactName/>
            <ShipperContactTelephone/>
            <ShipperCode/>
            <ShipperContactFax/>
            <ShipperContactEmail/>
            <ExpectedNoOfLines>1</ExpectedNoOfLines>
            <ExpectedNoOfCases>0</ExpectedNoOfCases>
            <ArrangeCollection>N</ArrangeCollection>
        </HO>
        <LO>
            <ProductCode>PRO1</ProductCode>
            <DescriptionOfGoods>red f</DescriptionOfGoods>
            <CountryWhenceConsigned>GB</CountryWhenceConsigned>
            <SinglesPerUnit>12</SinglesPerUnit>
            <ExpectedUnits>0</ExpectedUnits>
            <ExpectedSingles>1</ExpectedSingles>
            <ProductCostPerUnit>10.00</ProductCostPerUnit>
            <ProductCostCurrency>GBP</ProductCostCurrency>
            <SiteCode>TH</SiteCode>
            <PALineNo>12345</PALineNo>
            <Vintage>1981</Vintage>
            <DutyPaid>N</DutyPaid>
            <Brand>ABC Ferrer</Brand>
            <SingleSize>0.7500</SingleSize>
            <CustLineLitres>9.000</CustLineLitres>
        </LO>
    </PA>
</PREADVICES>

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

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

<PREADVICES>
    <PA>
        <HD>
            <CustomerPONumber>API_TEST1</CustomerPONumber>
            <CustomerCode>JOE</CustomerCode>
        </HD>
        <RES>
            <Code>200</Code>
            <Message>Preadvice processed</Message>
        </RES>
    </PA>
</PREADVICES>

Code : 207

<PREADVICES>
    <PA>
        <HD>
            <CustomerPONumber>API_TEST1</CustomerPONumber>
            <CustomerCode>JOE</CustomerCode>
        </HD>
        <RES>
            <Code>200</Code>
            <Message>Preadvice processed</Message>
        </RES>
    </PA>
    <PA>
         <HD>
            <CustomerPONumber>API_TEST2</CustomerPONumber>
            <CustomerCode>JOE</CustomerCode>
        </HD>
        <RES>
            <Code>400</Code>
            <Message>Validation failure occurred on line: 1 Product Code is mandatory</Message>
        </RES>
    </PA>
</PREADVICES>

Code : 400

<PREADVICES>
    <PA>
         <HD>
            <CustomerPONumber>API_TEST1</CustomerPONumber>
            <CustomerCode>JOE</CustomerCode>
        </HD>
       <RES>
            <Code>400</Code>
            <Message>Validation failure occurred on line: 1 Product Code is mandatory</Message>
        </RES>
    </PA>
    <PA>
        <HD>
            <CustomerPONumber>API_TEST2</CustomerPONumber>
            <CustomerCode>JOE</CustomerCode>
        </HD>
        <RES>
            <Code>400</Code>
            <Message>Validation failure occurred on line: 1 Product Code is mandatory</Message>
        </RES>
    </PA>
</PREADVICES>

Code : 406 Response Body

Failed validation because field 'SiteCode' exceeded the maximum number of characters allowed.

  • No labels