Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8645057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:27:05+00:00 2026-06-12T12:27:05+00:00

I am writing an app which will sit between a vendors proprietary inventory management

  • 0

I am writing an app which will sit between a vendors proprietary inventory management system and their Shopify shop. The app will periodically update Shopify from new data generated by the inventory management system. It will also provide end-points for Shopify webhooks.

I am currently doing something like this (pseudo-ruby with much stuff omitted):

  def update_product_with_proxy(product_proxy)
    product_proxy.variant_proxies.dirty.each do |variant_proxy|
      update_variant_with_proxy(variant_proxy)
    end

    if product_proxy.dirty_proxy
      shopify_product = ShopifyAPI::Product.find(product_proxy.shopify_id)
      shopify_product.update_attributes({some attributes here})
    end
  end

Elsewhere:

  def update_variant_with_proxy(variant_proxy)
    shopify_variant = ShopifyAPI::Variant.find(variant_proxy.shopify_id)
    shopify_variant.update_attributes({some attributes here})
  end

This seems terribly inefficient as I have to fetch each updated ShopifyAPI::Product and ShopifyAPI::Variant before I can update them (I have their id’s cached locally). It takes about 25 minutes for an update cycle updating 24 products each with 16 variants. Rails spends less than 2 seconds updating my product/variant proxies. The other 99% of the time is spent talking to Shopify. I must be doing something wrong.

Given that I know the id of the remote object is there a way to updated it directly without having to fetch it first?

cheers,
-tomek

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T12:27:06+00:00Added an answer on June 12, 2026 at 12:27 pm

    First things first: You can update variants through their parent product. Once you’ve grabbed the product it’ll have the variant info with it so you can edit them, save, and the changes will be persisted in a single API call. That’ll save you some time.

    Second: You can create an object locally using the gem, give it an id, and then call save to initiate the PUT request without first fetching the object from Shopify. Something like this should do the trick:

    product = ShopifyAPI::Product.new(:id => 1, :title => "My new title")
    product.save
    

    Putting those two things together should give you what you want: The ability to update a product’s variants in a single API call.

    Note: For future reference, the shopify_api gem is built on Active Resource, so anything you can do with that library you can do with the gem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing an app which will be used mainly on phones, but which some
I'm writing an app for gnome which will support plugins. Each plugin will contain
I am writing an app which will remove some Registry keys recursively using API
I am writing a app in .NET which will generate random text based on
I am writing a component for a web app which will display some html,
I am writing an Android app, part of which will be a survey involving
I'm writing an app which will rely heavily on the use of a database.
I'm looking at writing an app which will use text present on a user's
I'm writing an Android app which will be making use of the cloud-2-device messaging
I am writing a web app which will allow the user to specify a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.