Quantcast
Channel: Opinion: Shopify Community - Shopify APIs & SDKs
Viewing all 25503 articles
Browse latest View live

Update Metafield using MetaField API inside mystore by Muhammad Saud

$
0
0

I created a metafield "count" inside products. Now I want to increment the value of "count" when some item is sold. I'm new to shopify. So, your help will be highly appriciated.

Thanks


James Pudney commented on Creating test orders in Shopify without a Zip code

$
0
0

Thanks for the reply Carted, unfortunately removing the attribute or using null as a value results in the response.

Chris Saunders commented on Access shop.permanent.domain in javscript inserted with a script_tag

$
0
0

Script tags don't go through the liquid pipeline because it's just your server serving up the assets. If you need the permanent domain you could turn your JS file into a rendered template and feed in a locally cached shop object with all the data you need

# controller.rb
# /scripts/:shop_id
respond_to :js
def show
  @shop = Shop.find(params[:shop_id])
end

# scripts/show.js.erb
var shop = "<%= @shop.permanent_domain %>"
var newPage = "http://myserver.com?shop=&quot; + shop

function openNewPage() { window.open(newPage); }

 

Chris Saunders commented on Missing or invalid parameter when POSTing an order to store

$
0
0

Have you tried not including variant_title? That information will be pulled from Shopify

Chris Saunders commented on Discounts/Coupons API Support

$
0
0

There's no plans for anything at the moment. Yes it's been requested a bunch and there's ways to get access to it but the API is pretty gross and undocumented.

Keep your eyes on the API announcements forum, that's where we will make the announcement if/when it becomes available.

Chris Saunders commented on Setting custom variant titles

$
0
0

The options are maintained by the Product, so making a change to the option will make a change to that for all your product variants.

options: [
{
id: 123,
name: "Size",
position: 1,
product_id: 321
},
{
id: 908,
name: "Color",
position: 2,
product_id: 809
},
{
id: ,
name: "Style",
position: 3,
product_id: 92368952
}
],

 

Chris Saunders commented on Update Metafield using MetaField API inside mystore

$
0
0

You'll need to write an application that integrates with order creation webhooks. When that product is sold you update the value.

jamie koning commented on Missing or invalid parameter when POSTing an order to store

$
0
0

I just tried

{"order": {"line_items": [
            {"quantity": 2,"variant_id": 314451299
            }
        ]
    }
}

And I get the error

{"errors":{"order":["Line items is invalid"],"line_items":["can't have missing variant details, missing variant_id"]}}

 


Sort by best selling products by Jason Jaynes

$
0
0

We are trying to get a sold count from the product endpoint so we can sort products in our system by best selling like users can already do through custom collections. This attribute currently does not appear to exist on the product endpoint. 

Is there another way to get this data? If not, can you add it?

Thanks,
Jason

Marius Andreiana commented on Adding snippets with API

$
0
0

Is there a way to include a Snippet (not Asset) with an app?

Looks like Snippets are reusable across themes, whereas Assets are theme-specific.

Chris Saunders commented on Sort by best selling products

$
0
0

We don't track this kind of information. You can use webhooks to keep track of product sales and then re-order your top selling collection based on that collected information.

Shopify doesn't track this kind of information.

Orders/Create Webhook Verification. No Hmac header. by Jonathan Schwartz

$
0
0

I'm just doing a simple "orders/create" webhook. I'm doing the verification of the webhook by looking at the headers based on this doc: http://docs.shopify.com/api/tutorials/using-webhooks#verify-webhook

Headers I see:

{"Accept":"*\/*","Accept-Encoding":"gzip;q=1.0,deflate;q=0.6,identity;q=0.3","Connection":"close","Host":"example.com","User-Agent":"Ruby","X-Newrelic-Id":"VQQUVFdSDwMF","X-Newrelic-Transaction":"PxRRU1RTAAFSUlZQAQZSA10DFB8EBw8RVT8=","X-Shopify-Order-Id":"123456678","X-Shopify-Shop-Domain":"example.myshopify.com","X-Shopify-Test":"false","X-Shopify-Topic":"orders\/create"}

As you can see, the X-Shopify-Hmac-SHA256 header is not being passed. Any ideas?
 

Jason Jaynes commented on Sort by best selling products

$
0
0

Thanks for the reply Chris. I am confused because you already provide this sort option, so I would assume you would provide the data you use to perform this sort through the API. It may not be sold count, but I assume there is some attribute you use to perform this sort. Can you tell me what product attribute you use to sort products by "best selling" in custom collections?

If you are unwilling to surface this data, can you surface a call that allows one to get a list of products for a custom collection sorted by "best selling"?

Thanks,
Jason

HunkyBill commented on Orders/Create Webhook Verification. No Hmac header.

$
0
0

Did you create the webhook yourself using the API or are you testing from within the admin in the settings -> notifications?

If you created it using the API, you'll get the right header information, otherwise you won't, since it is just to test the endpoints out and not a real, secure webhook.

Jonathan Schwartz commented on Orders/Create Webhook Verification. No Hmac header.

$
0
0

Not sure I agree with that from a functional standpoint but at least I have an answer. Learn something new every day. Thanks much.


HunkyBill commented on Orders/Create Webhook Verification. No Hmac header.

$
0
0

It makes total sense. Your App has a private:public keypair you use to validate the HMAC and your connection to the shop. The Shopify Admin notifications section has no clue about the existence of your private:public keys, so how can it possibly generate an HMAC for you? 

Like you say, lesson learned every day... when you generate a webhook with your App, Shopify will know your keys and hence can generate the HMAC.

 

Jonathan Schwartz commented on Orders/Create Webhook Verification. No Hmac header.

$
0
0

Oh I totally agree with that. I'm just saying that it would be nice to have a method for verifying all webhooks. This way I can have a non technical user manage which webhooks are enabled while still having them be more secure. 

Freshness of data sent via Webhook? by Steven Kinley

$
0
0

According to http://docs.shopify.com/api/tutorials/using-webhooks Webhooks will retry when failed for 2 days.

If a product is updated on Monday which triggers the "updated product" alert and it fails for 24 hours, finally being accepted on Tuesday; will the product info included in the alert contain the state of the product from Monday (possibly stale), or will it contain the latest product version known to Shopify?

Thanks

Chris Saunders commented on Freshness of data sent via Webhook?

$
0
0

The content is always pulled from the database when sending a webhook, so you don't have to worry about the data being stale.

Chris Saunders commented on Orders/Create Webhook Verification. No Hmac header.

$
0
0

Not everyone needs a full app to create webhooks and even to just verify that your own signature code is working, it would be great to not have to create a full application, register the webhook and validate it. We've experienced the same problem you have had internally and are looking into a way to provide message verification.

It's easy to say you *shouldn't* be using these webhooks, but people might need a one off, or it just sticks around because you get it working and it's good enough. I don't know exactly when we'll have this out, but keep your eyes on the API Announcements forum where we'll announce this change when it comes out.

For now you can just use a private app to create your webhooks, which contains the shared_secret which you can use to validate the content we are sending to you.

Viewing all 25503 articles
Browse latest View live