Scope: Integrate with Shipstation so that we can stream orders and retrieve tracking numbers back.
We need to create two webservice endpoints:
https://www.yourstore.com/shipstationxml.php?action=export&start_date=01%2f23%2f2012+17%3a28&end_date=01%2f23%2f2012+17%3a33&page=1
https://www.yourstore.com/shipstationxml.php?action=shipNotify&start_date=01%2f23%2f2012+17%3a28&end_date=01%2f23%2f2012+17%3a33&page=1
action=export when Shipstation does a GET call to us to retrieve data for all orders between start and end dates.
action=shipNotify when Shipstation makes a POST call to the same endpoint to to send us tracking information
ShipStation uses Basic HTTP Authentication when calling your Web Endpoint. Use a Basic Authentication Header to pass the credentials.
NOTE: Please see reference link below for field formats and mandatory fields
Sample GET Response body ( to export Orders) #
<?xml version="1.0" encoding="utf-8"?>
<Orders pages="1">
<Order>
<OrderID><![CDATA[123456]]></OrderID>
<OrderNumber><![CDATA[ABC123]]></OrderNumber>
<OrderDate>10/18/2019 21:56 PM</OrderDate>
<OrderStatus><![CDATA[paid]]></OrderStatus>
<LastModified>12/8/2011 12:56 PM</LastModified>
<ShippingMethod><![CDATA[USPSPriorityMail]]></ShippingMethod>
<PaymentMethod><![CDATA[Credit Card]]></PaymentMethod>
<CurrencyCode>EUR</CurrencyCode>
<OrderTotal>123.45</OrderTotal>
<TaxAmount>0.00</TaxAmount>
<ShippingAmount>4.50</ShippingAmount>
<CustomerNotes><![CDATA[Please make sure it gets here by Dec. 22nd!]]></CustomerNotes>
<InternalNotes><![CDATA[Ship by December 18th via Priority Mail.]]></InternalNotes>
<Gift>false</Gift>
<GiftMessage></GiftMessage>
<CustomField1></CustomField1>
<CustomField2></CustomField2>
<CustomField3></CustomField3>
<Customer>
<CustomerCode><![CDATA[[email protected]]]></CustomerCode>
<BillTo>
<Name><![CDATA[The President]]></Name>
<Company><![CDATA[US Govt]]></Company>
<Phone><![CDATA[512-555-5555]]></Phone>
<Email><![CDATA[[email protected]]]></Email>
</BillTo>
<ShipTo>
<Name><![CDATA[The President]]></Name>
<Company><![CDATA[US Govt]]></Company>
<Address1><![CDATA[1600 Pennsylvania Ave]]></Address1>
<Address2></Address2>
<City><![CDATA[Washington]]></City>
<State><![CDATA[DC]]></State>
<PostalCode><![CDATA[20500]]></PostalCode>
<Country><![CDATA[US]]></Country>
<Phone><![CDATA[512-555-5555]]></Phone>
</ShipTo>
</Customer>
<Items>
<Item>
<SKU><![CDATA[FD88821]]></SKU>
<Name><![CDATA[My Product Name]]></Name>
<ImageUrl><![CDATA[http://www.mystore.com/products/12345.jpg]]></ImageUrl>
<Weight>8</Weight>
<WeightUnits>Ounces</WeightUnits>
<Quantity>2</Quantity>
<UnitPrice>13.99</UnitPrice>
<Location><![CDATA[A1-B2]]></Location>
<Options>
<Option>
<Name><![CDATA[Size]]></Name>
<Value><![CDATA[Large]]></Value>
<Weight>10</Weight>
</Option>
<Option>
<Name><![CDATA[Color]]></Name>
<Value><![CDATA[Green]]></Value>
<Weight>5</Weight>
</Option>
</Options>
</Item>
<Item>
<SKU></SKU>
<Name><![CDATA[$10 OFF]]></Name>
<Quantity>1</Quantity>
<UnitPrice>-10.00</UnitPrice>
<Adjustment>true</Adjustment>
</Item>
</Items>
</Order>
</Orders>
Sample POST response body ( to get tracking info back) #
<?xml version="1.0" encoding="utf-8"?>
<ShipNotice>
<OrderNumber>ABC123</OrderNumber>
<OrderID>123456</OrderID>
<CustomerCode>[email protected]</CustomerCode>
<CustomerNotes></CustomerNotes>
<InternalNotes></InternalNotes>
<NotesToCustomer></NotesToCustomer>
<NotifyCustomer></NotifyCustomer>
<LabelCreateDate>10/19/2019 12:56</LabelCreateDate>
<ShipDate>10/19/2019</ShipDate>
<Carrier>USPS</Carrier>
<Service>Priority Mail</Service>
<TrackingNumber>1Z909084330298430820</TrackingNumber>
<ShippingCost>4.95</ShippingCost>
<CustomField1></CustomField1>
<CustomField2></CustomField2>
<CustomField3></CustomField3>
<Recipient>
<Name>The President</Name>
<Company>US Govt</Company>
<Address1>1600 Pennsylvania Ave</Address1>
<Address2></Address2>
<City>Washington</City>
<State>DC</State>
<PostalCode>20500</PostalCode>
<Country>US</Country>
</Recipient>
<Items>
<Item>
<SKU>FD88821</SKU>
<Name>My Product Name</Name>
<Quantity>2</Quantity>
<LineItemID>25590</LineItemID>
</Item>
</Items>
</ShipNotice>