Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a correct order test for Ingram micro integration?

I'm trying to create an order test for ingram micro and I have not achieved results.

This is the xml request to send:

<OrderRequest>
   <Version>2.0</Version>
   <TransactionHeader>
      <SenderID>123456789</SenderID>
      <ReceiverID>987654321</ReceiverID>
      <CountryCode>MD</CountryCode>
      <LoginID>ingram_login</LoginID>
      <Password>ingram_password</Password>
      <TransactionID>54321</TransactionID>
   </TransactionHeader>
   <OrderHeaderInformation>
      <BillToSuffix />
      <AddressingInformation>
         <CustomerPO>TEST PO ONLY - DO NOT SHIP</CustomerPO>
         <ShipToAttention>Mrs Jones</ShipToAttention>
         <EndUserPO>EndUserPO_1</EndUserPO>
         <ShipTo>
            <Address>
               <ShipToAddress1>Red House Company</ShipToAddress1>
               <ShipToAddress2>1730 105TH ST</ShipToAddress2>
               <ShipToAddress3/>
               <ShipToCity>NEW RICHMOND</ShipToCity>
               <ShipToProvince>WI</ShipToProvince>
               <ShipToPostalCode>54017</ShipToPostalCode>
            </Address>
         </ShipTo>
      </AddressingInformation>
      <ProcessingOptions>
         <CarrierCode>F2</CarrierCode>
         <AutoRelease>H</AutoRelease>
         <ThirdPartyFreightAccount/>
         <KillOrderAfterLineError>N</KillOrderAfterLineError>
         <ShipmentOptions>
            <BackOrderFlag>Y</BackOrderFlag>
            <SplitShipmentFlag>N</SplitShipmentFlag>
            <SplitLine>N</SplitLine>
              <ShipFromBranches>10</ShipFromBranches>
            <DeliveryDate>20090901</DeliveryDate>
         </ShipmentOptions>
      </ProcessingOptions>
      <DynamicMessage>
         <MessageLines>Deliver to Mrs Jones</MessageLines>
      </DynamicMessage>
   </OrderHeaderInformation>
   <OrderLineInformation>
      <ProductLine>
         <SKU>TSXML3</SKU>
         <Quantity>1</Quantity>
         <CustomerLineNumber/>
         <ReservedInventory>
            <ReserveCode>C</ReserveCode>
             <ReserveSequence>01</ReserveSequence>
         </ReservedInventory>
         <CustomerPartNumber/>
         <UPC/>
         <ManufacturerPartNumber/>
         <ShipFromBranchAtLine>10</ShipFromBranchAtLine>
      </ProductLine>
      <CommentLine>
         <CommentText>TEST PO ONLY - DO NOT SHIP</CommentText>
      </CommentLine>
   </OrderLineInformation>
   <ShowDetail>1</ShowDetail>
</OrderRequest>

ingram micro response:

<OrderResponse>
    <Version>2.0</Version>
    <TransactionHeader>
        <SenderID>987654321</SenderID>
        <ReceiverID>123456789</ReceiverID>
        <ErrorStatus ErrorNumber="20196">
ERROR: One Productline can not have multiple parts in it when ShowDetail='2'
</ErrorStatus>
        <DocumentID>{5535EC2F-DB51-4D35-B492-6425A0B9F62D}</DocumentID>
        <TransactionID>54321</TransactionID>
        <TimeStamp>2016-01-27T11:45:19</TimeStamp>
    </TransactionHeader>
</OrderResponse>

I have been trying and researching about the response ErrorStatus and the Productline and I have not figured out a solution. thanks in advance

Sorry, there is no ingram-micro tag

like image 715
miglio Avatar asked Oct 18 '22 16:10

miglio


1 Answers

Just looking at the IM-XML documentation I could find, you have several apparent issues with the <ProductLine> element section of your example:

<ManufacturerPartNumber> Manufacturer Part Number - Do not specify if <SKU> or <UPC> are included

<UPC> EAN/UPC Number - Do not specify if <ManufacturerPartNumber> or <SKU> are included

<SKU> Ingram Micro product code Number - Do not specify if <ManufacturerPartNumber> or <UPC> are included

Apparently you should only specify one of the above element's values, your example specifies values for SKU and UPC

<ReservedInventory> Contains reserved Inventory information. - Unless required, do not specify.

It's not clear to me from my quick skim of the documentation when this would be required, but you specify a value for this element and I don't see any clear indication anywhere else in the example that would suggest why it would be required in your example case. So let's call this one a "maybe" issue.

<ShipFromBranchAtLine>

I couldn't find any reference to this element in the documentation, so it's probably invalid. The closest match to this element I could find was <ShipFromBranches>, which wouldn't belong in the <ProductLine> element.

<CustomerPartNumber>

Again, no reference to this that I could find in the documentation.

<RequestedPrice> Special Bid Price Parent : <SpecialBid>

You have <RequestedPrice> as a direct child of ProductLine, when it should be inside of a <SpecialBid> element.

So with all of the above taken into account, I commented out the parts that seemed wrong (or potentially wrong, for our maybe) like so:

    <ProductLine>
        <SKU>NV9159</SKU>
        <Quantity>1</Quantity>
        <CustomerLineNumber/>
        <!-- ResvervedInventory : Unless required, do not specify
        <ReservedInventory>
            <ReserveCode>C</ReserveCode>
            <ReserveSequence>01</ReserveSequence>
        </ReservedInventory>
        -->
        <!-- CustomerPartNumber element not defined in spec.
        <CustomerPartNumber/>
        -->
        <!-- UPC : Do not specify if SKU included
        <UPC>SP-RACKTRAY</UPC>
         -->
        <!-- ManufacturerPartNumber : Do not specify if SKU included
        <ManufacturerPartNumber/>
         -->
        <!-- ShipFromBranchAtLine element not defined in spec.
        <ShipFromBranchAtLine>10</ShipFromBranchAtLine>
        -->
        <!-- RequestedPrice : parent = SpecialBid
        <RequestedPrice>163.36</RequestedPrice>
        -->
    </ProductLine>

If we just pulled those parts out (assuming none of them should be in there) and set them to empty elements, it might look something like:

    <ProductLine>
        <SKU>NV9159</SKU>
        <Quantity>1</Quantity>
        <CustomerLineNumber/>
    </ProductLine>

Finally, in direct reference to the error you are getting back:

One Productline can not have multiple parts in it when ShowDetail='2'

I would assume that this is due directly to you setting a value for both <SKU> and <UPC>, which might confuse the system into thinking that you are trying to include "multiple parts" (eg two different part codes that might be for two different actual parts) when specifying (illegally) the value for those two elements.

But even if that weren't the case, it seems like the easiest thing to try to do, given the actual wording of that error, might be to try simply changing the ShowDetail element value from:

<ShowDetail>2</ShowDetail>

to

<ShowDetail>1</ShowDetail>

I would encourage fixing the other issues with the ProductLine element instead, but with the response error to go by alone, did you try changing ShowDetail to see if that made a difference?

like image 129
Anthony Avatar answered Oct 29 '22 03:10

Anthony