Shopify_api Ruby Gem not creating fulfillment











up vote
0
down vote

favorite












I have a csv that we upload to an app and I want that csv with Order Number and Tracking Number to then go in and mark the order as fulfilled and put in a tracking number on each order. When coding this, my Intellisense is not picking up the ShopifyAPI::Fulfillment so I am not 100% sure if that is how I should do it. I don't get an error in the code but I also don't get the order fulfilled... am I doing something wrong?



order = ShopifyAPI::Order.find(:all, params: { name: o_id, status: "any" }) 
if order[0].id != "" and !order[0].id.to_s.empty?
items = Array.new order[0].line_items.each do |item|
items.push({"id": item.id})
end
fulfill = ShopifyAPI::Fulfillment.new(order_id: order[0].id, line_items: items)
fulfill.tracking_numbers = [track.to_s]
puts fulfill
fulfill.save
order[0].save
end









share|improve this question
























  • Quick side note, if you're using Ruby on Rails, or at least ActiveSupport, then you can change order[0].id != "" and !order[0].id.to_s.empty? to order[0].id.present?
    – Nate
    Nov 8 at 1:07















up vote
0
down vote

favorite












I have a csv that we upload to an app and I want that csv with Order Number and Tracking Number to then go in and mark the order as fulfilled and put in a tracking number on each order. When coding this, my Intellisense is not picking up the ShopifyAPI::Fulfillment so I am not 100% sure if that is how I should do it. I don't get an error in the code but I also don't get the order fulfilled... am I doing something wrong?



order = ShopifyAPI::Order.find(:all, params: { name: o_id, status: "any" }) 
if order[0].id != "" and !order[0].id.to_s.empty?
items = Array.new order[0].line_items.each do |item|
items.push({"id": item.id})
end
fulfill = ShopifyAPI::Fulfillment.new(order_id: order[0].id, line_items: items)
fulfill.tracking_numbers = [track.to_s]
puts fulfill
fulfill.save
order[0].save
end









share|improve this question
























  • Quick side note, if you're using Ruby on Rails, or at least ActiveSupport, then you can change order[0].id != "" and !order[0].id.to_s.empty? to order[0].id.present?
    – Nate
    Nov 8 at 1:07













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have a csv that we upload to an app and I want that csv with Order Number and Tracking Number to then go in and mark the order as fulfilled and put in a tracking number on each order. When coding this, my Intellisense is not picking up the ShopifyAPI::Fulfillment so I am not 100% sure if that is how I should do it. I don't get an error in the code but I also don't get the order fulfilled... am I doing something wrong?



order = ShopifyAPI::Order.find(:all, params: { name: o_id, status: "any" }) 
if order[0].id != "" and !order[0].id.to_s.empty?
items = Array.new order[0].line_items.each do |item|
items.push({"id": item.id})
end
fulfill = ShopifyAPI::Fulfillment.new(order_id: order[0].id, line_items: items)
fulfill.tracking_numbers = [track.to_s]
puts fulfill
fulfill.save
order[0].save
end









share|improve this question















I have a csv that we upload to an app and I want that csv with Order Number and Tracking Number to then go in and mark the order as fulfilled and put in a tracking number on each order. When coding this, my Intellisense is not picking up the ShopifyAPI::Fulfillment so I am not 100% sure if that is how I should do it. I don't get an error in the code but I also don't get the order fulfilled... am I doing something wrong?



order = ShopifyAPI::Order.find(:all, params: { name: o_id, status: "any" }) 
if order[0].id != "" and !order[0].id.to_s.empty?
items = Array.new order[0].line_items.each do |item|
items.push({"id": item.id})
end
fulfill = ShopifyAPI::Fulfillment.new(order_id: order[0].id, line_items: items)
fulfill.tracking_numbers = [track.to_s]
puts fulfill
fulfill.save
order[0].save
end






ruby shopify fulfillment






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 7 at 21:08









phoet

17k33967




17k33967










asked Nov 7 at 18:21









Ian Brown

186




186












  • Quick side note, if you're using Ruby on Rails, or at least ActiveSupport, then you can change order[0].id != "" and !order[0].id.to_s.empty? to order[0].id.present?
    – Nate
    Nov 8 at 1:07


















  • Quick side note, if you're using Ruby on Rails, or at least ActiveSupport, then you can change order[0].id != "" and !order[0].id.to_s.empty? to order[0].id.present?
    – Nate
    Nov 8 at 1:07
















Quick side note, if you're using Ruby on Rails, or at least ActiveSupport, then you can change order[0].id != "" and !order[0].id.to_s.empty? to order[0].id.present?
– Nate
Nov 8 at 1:07




Quick side note, if you're using Ruby on Rails, or at least ActiveSupport, then you can change order[0].id != "" and !order[0].id.to_s.empty? to order[0].id.present?
– Nate
Nov 8 at 1:07












1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










Fulfillments are now requiring you to specify a location where the item is being fulfilled from. Check out the documentation concerning Locations and Inventory Items.



Once you have a location ID, you can create a fulfillment for an item from an order.






share|improve this answer





















  • That was it...just missing that elusive location ID...
    – Ian Brown
    Nov 7 at 22:52











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53195509%2fshopify-api-ruby-gem-not-creating-fulfillment%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote



accepted










Fulfillments are now requiring you to specify a location where the item is being fulfilled from. Check out the documentation concerning Locations and Inventory Items.



Once you have a location ID, you can create a fulfillment for an item from an order.






share|improve this answer





















  • That was it...just missing that elusive location ID...
    – Ian Brown
    Nov 7 at 22:52















up vote
1
down vote



accepted










Fulfillments are now requiring you to specify a location where the item is being fulfilled from. Check out the documentation concerning Locations and Inventory Items.



Once you have a location ID, you can create a fulfillment for an item from an order.






share|improve this answer





















  • That was it...just missing that elusive location ID...
    – Ian Brown
    Nov 7 at 22:52













up vote
1
down vote



accepted







up vote
1
down vote



accepted






Fulfillments are now requiring you to specify a location where the item is being fulfilled from. Check out the documentation concerning Locations and Inventory Items.



Once you have a location ID, you can create a fulfillment for an item from an order.






share|improve this answer












Fulfillments are now requiring you to specify a location where the item is being fulfilled from. Check out the documentation concerning Locations and Inventory Items.



Once you have a location ID, you can create a fulfillment for an item from an order.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 7 at 21:50









David Lazar

5,22631426




5,22631426












  • That was it...just missing that elusive location ID...
    – Ian Brown
    Nov 7 at 22:52


















  • That was it...just missing that elusive location ID...
    – Ian Brown
    Nov 7 at 22:52
















That was it...just missing that elusive location ID...
– Ian Brown
Nov 7 at 22:52




That was it...just missing that elusive location ID...
– Ian Brown
Nov 7 at 22:52


















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53195509%2fshopify-api-ruby-gem-not-creating-fulfillment%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

Hercules Kyvelos

Tangent Lines Diagram Along Smooth Curve

Yusuf al-Mu'taman ibn Hud