Draft orders no longer showing item properties

richard88
New Member
2 0 0

Hi,

We've been using the Ruby Shopify API to create draft orders with line items attached with properties since the Shopify admin interface doesn't support adding line item properties. For a couple of months this has been working fine and draft orders created in this way would display line item properties on the Shopify admin draft order interface. However recently the properties have stopped being shown despite no changes to our code. Strangely the properties still show up for draft orders created on our development store which we use for testing, it's just on our live site that the properties have stopped showing up.

Any help would be greatly appreciated.

Thank you

0 Likes
Jason
Shopify Expert
10260 142 1940
  1. Can you confirm that you're using the same API version between both shops?
  2. Got the code that you're sending in a way that can be shared?
  3. Have a very (very) recent request id from a header?

All the questions!

I jump on these forums to help and share some insights. Not looking to be hired, and not looking for work.

Don't hand out staff invites or give admin password to forum members unless absolutely needed. In most cases the help you need can be handled without that.


★ http://freakdesign.com.au ★
0 Likes
richard88
New Member
2 0 0

No problem!

The private apps we are running to interact with the Admin API are using 2020-07 (both dev and live).

Here are the relevant code excerpts from our Rails server:

# application.rb (excerpt)
ShopifyAPI::Base.api_version = '2020-07'
ShopifyAPI::Base.site = "https://#{api_key}:#{password}@#{config.shop_name}.myshopify.com/admin"


# some_controller.rb (excerpt)
line_item = ShopifyAPI::LineItem.new
line_item.variant_id = variant[:id]
line_item.properties = [
    {
        name: 'Custom Code',
        value: item[:code]
    }
]
line_item.quantity = item[:qty]
line_items.push(line_item)

order = ShopifyAPI::DraftOrder.new
order.line_items = line_items
order.save

 

Here is a screenshot from the dev store admin of an order created using the above (with some anonymization):

dev.png

 

And here is a screenshot from the live store admin:

live.png

 

One thing we have observed is that on our live store, the admin interface is slightly different in styling and that might have something to do with it. Also, not sure what is meant by request id but if you can elaborate I may be able to provide that too. Thanks!

0 Likes