New? Watch our welcome video [here], which goes over the basics of logging in and participating in the forums. Then, check out the [Rules] and our [video] about the features of the forum.

Shipstation API

Hello,
I'm trying to use the shipstation API to update orders automatically. By reading the documentation (at http://api.shipstation.com/) I was able to create new orders and retrieve information about orders, but I can't seem to edit an existing order. Is there any way I can do this?
For example, suppose I want to edit the name of the buyer in the order with number #1000. I could possibly filter orders to find the OrderID, and use the OrderID to edit the order, but I can't find a way to do that. More specifically, where should I send a post request to edit an existing order?
Tagged:

Comments

  • JasonJason Moderator
    A Keeper of the Keys
    Hi @deborahhh, yes, this is possible via an odata MERGE operation. Here's an XML example for you:

    MERGE http://data.shipstation.com/1.2/Orders(18248463) HTTP/1.1

    <?xml version="1.0" encoding="utf-8"?>
    <entry xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
    <id>http://data.shipstation.com/1.2/Orders(18248463)</id>
    <category term="SS.WebData.Order" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
    <title />
    <updated>2013-07-29T20:49:17Z</updated>
    <author>
    <name />
    </author>
    <content type="application/xml">
    <m:properties>
    <d:Active m:type="Edm.Boolean">true</d:Active>
    <d:AdditionalHandling m:type="Edm.Boolean">false</d:AdditionalHandling>
    <d:AddressVerified m:type="Edm.Byte">1</d:AddressVerified>
    <d:AmountPaid m:type="Edm.Decimal">0.00</d:AmountPaid>
    <d:AssignedUser m:type="Edm.Guid" m:null="true" />
    <d:BuyerEmail>test@test.com</d:BuyerEmail>
    <d:Confirmation m:type="Edm.Byte">1</d:Confirmation>
    <d:ConfirmationCost m:type="Edm.Decimal">0.00</d:ConfirmationCost>
    <d:CreateDate m:type="Edm.DateTime">2013-02-19T13:10:07.133</d:CreateDate>
    <d:CustomerID m:type="Edm.Int32" m:null="true" />
    <d:CustomField1 m:null="true" />
    <d:CustomField2 m:null="true" />
    <d:CustomField3 m:null="true" />
    <d:CustomsContents m:null="true" />
    <d:EmailTemplateID m:type="Edm.Int32" m:null="true" />
    <d:ExportStatus m:type="Edm.Int32" m:null="true" />
    <d:ExternalPaymentID m:null="true" />
    <d:ExternalUrl m:null="true" />
    <d:Gift m:type="Edm.Boolean">false</d:Gift>
    <d:GiftMessage m:null="true" />
    <d:Height m:type="Edm.Decimal" m:null="true" />
    <d:HoldUntil m:type="Edm.DateTime" m:null="true" />
    <d:ImportBatch m:type="Edm.Guid">4db2ba67-4774-493a-b23f-8c3b4f2e4d93</d:ImportBatch>
    <d:ImportKey>20130219Import-423</d:ImportKey>
    <d:InsuranceCost m:type="Edm.Decimal">0.00</d:InsuranceCost>
    <d:InsuranceProvider m:type="Edm.Byte">0</d:InsuranceProvider>
    <d:InsuredValue m:type="Edm.Decimal">0.00</d:InsuredValue>
    <d:InternalNotes m:null="true" />
    <d:Length m:type="Edm.Decimal" m:null="true" />
    <d:MarketplaceID m:type="Edm.Int32">0</d:MarketplaceID>
    <d:ModifyDate m:type="Edm.DateTime">2013-05-16T14:24:47.387</d:ModifyDate>
    <d:NonDelivery m:null="true" />
    <d:NonMachinable m:type="Edm.Boolean">false</d:NonMachinable>
    <d:NotesFromBuyer m:null="true" />
    <d:NotesToBuyer m:null="true" />
    <d:OrderDate m:type="Edm.DateTime">2014-02-18T00:00:00</d:OrderDate>
    <d:OrderID m:type="Edm.Int32">18248463</d:OrderID>
    <d:OrderNumber>20130219Import-423</d:OrderNumber>
    <d:OrderStatusID m:type="Edm.Int32">2</d:OrderStatusID>
    <d:OrderTotal m:type="Edm.Decimal">0.00</d:OrderTotal>
    <d:OtherCost m:type="Edm.Decimal">0.00</d:OtherCost>
    <d:PackageTypeID m:type="Edm.Int32">3</d:PackageTypeID>
    <d:PackingSlipID m:type="Edm.Int32" m:null="true" />
    <d:PayDate m:type="Edm.DateTime">2014-02-18T04:00:00</d:PayDate>
    <d:ProviderID m:type="Edm.Int32">5</d:ProviderID>
    <d:RateError m:null="true" />
    <d:RequestedServiceID m:type="Edm.Int32" m:null="true" />
    <d:RequestedShippingService>PRIORITY MAIL</d:RequestedShippingService>
    <d:ResidentialIndicator>R</d:ResidentialIndicator>
    <d:SaturdayDelivery m:type="Edm.Boolean">false</d:SaturdayDelivery>
    <d:SellerID m:type="Edm.Int32">100002</d:SellerID>
    <d:ServiceID m:type="Edm.Int32">21</d:ServiceID>
    <d:ShipCity>BEVERLY HILLS</d:ShipCity>
    <d:ShipCompany m:null="true" />
    <d:ShipCountryCode>US</d:ShipCountryCode>
    <d:ShipDate m:type="Edm.DateTime" m:null="true" />
    <d:ShipName>Josh & Nadia Test</d:ShipName>
    <d:ShipPhone m:null="true" />
    <d:ShippingAmount m:type="Edm.Decimal">0.00</d:ShippingAmount>
    <d:ShipPostalCode>90210-2001</d:ShipPostalCode>
    <d:ShipState>CA</d:ShipState>
    <d:ShipStreet1>111 Main Street</d:ShipStreet1>
    <d:ShipStreet2 m:null="true" />
    <d:ShipStreet3 m:null="true" />
    <d:ShowPostage m:type="Edm.Boolean">false</d:ShowPostage>
    <d:Source m:null="true" />
    <d:StoreID m:type="Edm.Int32">86</d:StoreID>
    <d:TaxAmount m:type="Edm.Decimal">0.00</d:TaxAmount>
    <d:Username m:null="true" />
    <d:WarehouseID m:type="Edm.Int32">37</d:WarehouseID>
    <d:WeightOz m:type="Edm.Int32">16</d:WeightOz>
    <d:Width m:type="Edm.Decimal" m:null="true" />
    </m:properties>
    </content>
    </entry>
  • deborahhhdeborahhh Member
    An Apprentice
    Great, thanks @Jason ! I'll explore this then! I have a few more questions.
    1) I've been trying to add items to a existing order, using a POST and the OrderItems resource. But my order comes from my Shopify store, so I add the item, but when I update my Shopify store, the item is gone. Is there a way I can keep the item after updating? Maybe using MERGE/PUT operations?

    2) Is there anyway to set the multiple packages dimensions of an order via the API? It doesn't seem to be possible to set them up using shipping presets, so for now we're doing it manually for every order.
  • JasonJason Moderator
    A Keeper of the Keys
    1) We consider the original sales channel to be the system of record for orders, so I would only recommend making this type of change to manual orders (orders in your ShipStation Store). I am not sure if the Shopify API supports modifying orders, but you might want to check into that.

    2) Multiple packages are not yet supported via the API. This is something we are planning on addressing, but I don't have an ETA.
  • deborahhhdeborahhh Member
    An Apprentice
    Thanks @Jason!
    Regarding the first question, what we're doing right now manually is creating a new order (in shipstation store) with the item to be added, and combining this order with the shopify order. Doing manually this way, the item stays even after we update the store. Is there something equivalent to the 'combine' action on Shipstation that I can do using the API?
  • JasonJason Moderator
    A Keeper of the Keys
    That's a good question :) Unfortunately, that process uses fields that are not currently exposed via the API.
  • deborahhhdeborahhh Member
    An Apprentice
    I see.. ok, thanks for the answers!
  • richasrichas Member
    An Apprentice
    hey, how you call that xml code.
    I tried to post this xml data via Python. But getting bad request error.
  • richasrichas Member
    An Apprentice
    hello,
    how can i get the total no. of orders?

    thanks
  • JasonJason Moderator
    A Keeper of the Keys
    hey @richas, this will give you the total number of orders awaiting shipment:

    https://data.shipstation.com/1.3/Orders()/$count?$filter=OrderStatusID eq 2
  • richasrichas Member
    An Apprentice
    Great thanks Jason :)
  • arul@4E6DEarul@4E6DE Member
    An Apprentice
    I want to get the shipstation shipped orders by date. i used
    https://ssapi.shipstation.com/orders?orderstatus=shipped&shipDate="2016-05-23"'
    But it only filters order status, i need to get shipped orders by "shipDate". Anybody can give solution for this..

    Thanks in advance.
  • ugpadminugpadmin Member
    An Apprentice
    Please vote on this idea in the shipstation feedback forum here:

    http://feedback.shipstation.com/forums/330429-product-feedback-fresh-ideas/suggestions/4771748-api-multiple-packages

    This is to prioritize development of assigning multiple packages through the API.
Sign In or Register to comment.