Skip to content

Instantly share code, notes, and snippets.

@resistorsoftware
Created December 16, 2011 20:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save resistorsoftware/1487854 to your computer and use it in GitHub Desktop.
Save resistorsoftware/1487854 to your computer and use it in GitHub Desktop.
Update Fulfillment with Order ID
f = ShopifyAPI::Fulfillment.find(:first, :params => {:order_id => order_id})
if f.nil?
fulfillment = ShopifyAPI::Fulfillment.new({:order_id => order_id, :notify_customer => true, :tracking_number => "123456"})
fulfillment.save
else
f.tracking_number = '123456'
f.notify_customer = true
f.save
end
@stewartknapman
Copy link

Thank you, this gist was exactly what I was looking for.
I am however having an issue tweaking this to fulfill a single line item. When I pass a line items parameter hash like is suggested in the shopify api (http://api.shopify.com/fulfillment.html#create) (e.g. :line_items => { "id" => v } ) the api returns a 500 error. Are you familiar with the correct syntax?

Thanks,
Stewart Knapman.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment