PDA

View Full Version : New order instead of Update order when using post in



jpdusty
03-26-2017, 02:39 PM
When using the "post in" custom store, any change made to the submission results in a new order rather than an updated order.

Section 2.2 of the Integration Points document seems to indicate that to change an order, post the order again with the new information.

We post to this url (url is masked):
https://api.my.shiprush.com/IntegrationService.svc/######################/######################/order/add

We use the exact same XML both times, but just change the
<PaymentStatus>1</PaymentStatus>
to
<PaymentStatus>2</PaymentStatus>

Instead of the order being updated, a new order is created.
Same thing happens if we change the address and leave everything else the same.

Here's the XML:

<?xml version="1.0"?>
<Request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ShipTransaction>
<Order>
<OrderDate>3/13/2017 8:22:20 PM</OrderDate>
<OrderNumber>123456102</OrderNumber>
<PaymentStatus>2</PaymentStatus>
</Order>
<Shipment>
<PostbackUrl>http://requestb.in/wvyc2lwv</PostbackUrl>
<PostbackContentType>Unknown</PostbackContentType>
<UPSServiceType>MVP</UPSServiceType>
<Carrier>19</Carrier>
<IsInternational>1</IsInternational>
<ShipmentChgType>PRE</ShipmentChgType>
<Package>
<PackageActualWeight>6.8</PackageActualWeight>
<PackagingType>02</PackagingType>
<PackageReference1>Order 123456102</PackageReference1>
</Package>
<International>
<ContentType>OTHER</ContentType>
<Commodity>
<LineCurrencyCode>USD</LineCurrencyCode>
<LineUnitAmtPrice>17.95</LineUnitAmtPrice>
<LineQty>1</LineQty>
<LineQtyUOM>EA</LineQtyUOM>
<LineMerchDesc1>Box of paper</LineMerchDesc1>
<LineMerchDesc2>122.1122.1122</LineMerchDesc2>
<LineMerchDesc3>US</LineMerchDesc3>
<CommodityWeight>5.9</CommodityWeight>
</Commodity>
</International>
<DeliveryAddress>
<Address>
<FirstName>Bob</FirstName>
<LastName>Jones</LastName>
<Address1>123 Main Street</Address1>
<City>Berlin</City>
<State>.</State>
<Country>DE</Country>
<PostalCode>10119</PostalCode>
<Phone>(206) 512-1111</Phone>
</Address>
</DeliveryAddress>
</Shipment>
</ShipTransaction>
</Request>

Another thing we tried was using the <OrderID>########-####-####-####-############</OrderID> from the AddOrderResponse. But that still created a new order.

How can we update the order rather than create a new one?

Thanks,

SYSOPS
03-27-2017, 06:34 AM
I've asked development to review this issue further. Case 57521

Thank you,
SYSOPS

SYSOPA
03-27-2017, 01:38 PM
For incoming orders we use <ExternalID> to track order "uniqueness". If your order numbers are unique you can pass it as <ExternalID>

Example
<?xml version="1.0"?>
<Request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ShipTransaction>
<Order>
<OrderDate>3/13/2017 8:22:20 PM</OrderDate>
<OrderNumber>123456102</OrderNumber>
<ExternalID>123456102</ExternalID>
<PaymentStatus>2</PaymentStatus>
</Order>
<Shipment>
<PostbackUrl>http://requestb.in/wvyc2lwv</PostbackUrl>
<PostbackContentType>Unknown</PostbackContentType>
<UPSServiceType>MVP</UPSServiceType>
<Carrier>19</Carrier>
<IsInternational>1</IsInternational>
<ShipmentChgType>PRE</ShipmentChgType>
<Package>
<PackageActualWeight>6.8</PackageActualWeight>
<PackagingType>02</PackagingType>
<PackageReference1>Order 123456102</PackageReference1>
</Package>
<International>
<ContentType>OTHER</ContentType>
<Commodity>
<LineCurrencyCode>USD</LineCurrencyCode>
<LineUnitAmtPrice>17.95</LineUnitAmtPrice>
<LineQty>1</LineQty>
<LineQtyUOM>EA</LineQtyUOM>
<LineMerchDesc1>Box of paper</LineMerchDesc1>
<LineMerchDesc2>122.1122.1122</LineMerchDesc2>
<LineMerchDesc3>US</LineMerchDesc3>
<CommodityWeight>5.9</CommodityWeight>
</Commodity>
</International>
<DeliveryAddress>
<Address>
<FirstName>Bob</FirstName>
<LastName>Jones</LastName>
<Address1>123 Main Street</Address1>
<City>Berlin</City>
<State>.</State>
<Country>DE</Country>
<PostalCode>10119</PostalCode>
<Phone>(206) 512-1111</Phone>
</Address>
</DeliveryAddress>
</Shipment>
</ShipTransaction>
</Request>

SYSOPP
03-28-2017, 06:04 AM
For incoming orders we use <ExternalID> to track order "uniqueness". If your order numbers are unique you can pass it as <ExternalID>

The inverse is also true. To update an order, pass in the same <ExternalID>

Note that updates should be few. If orders are getting updated a lot, or sent to SR over and over, please streamline your system to send a given order fewer times to MySR. A given order should be touched by your system 1-3 times, and most orders only posted into MySR once and not updated externally.

jpdusty
03-28-2017, 08:56 AM
Great. Thank you.

Yes, we don't plan on posting the orders more than once, or foresee needing to, but wanted to know that we could if we had to.

Thanks