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

Russell Quinn commented on Do API-created web hooks appear in the admin UI?


dfp commented on Custom inventory management with Nielsen book data

$
0
0

We do a bunch of book sites, and have a variety of solutions for handling book meta data. I realize that this is an old thread, but in the interest of efficiency, it would be worth a few minutes to discuss this with us. ... hi at mugo.ca

Carted commented on Add to cart by customer id

Chris Saunders commented on Uninstall webhook gets called twice

$
0
0

Did the shop have multiple webhooks installed? You'll get one app/uninstalled webhook for each webhook you have registered.

Nate commented on App development: how to install my app into my dev shop and test it

$
0
0

Hi Brandon,

In step #4, the full list of parameters is:

  • code
  • shop
  • timestamp
  • signature

When someone installs your app and uses it later by clicking on the link from the 'Apps' panel in the admin, they will be sent to your apps Callback URL, with the following parameters:

  • shop
  • timestamp
  • signature

The API token that you received during the installation of the app can be used for that shop until it removes your app. You'll just have to look up the token associated with the shop.

Sorry about the wait on the answer for this. Let me know if you have any questions.

Nate

Carted commented on App development: how to install my app into my dev shop and test it

$
0
0

Man Oauth is fun the first time around. Needs a nice pretty diagram on the flow, you guys should get one of your infographic designers to make an auth flow for a typical app. Would look amazing and help out a lot of developers not familiar with Oauth 2. Would probably trend pretty well through developer communities if it was generic.

Nate commented on App development: how to install my app into my dev shop and test it

$
0
0

Agreed, better documentation for the OAuth flow is something we're working on (it can be tricky to get right). Stay tuned.

Carted commented on App development: how to install my app into my dev shop and test it

$
0
0

Should post it on your technology blog if you do something good, that poor forum gets no attention these days. It's a hard topic to nail in one doc or diagram so I look forward to seeing it


Shopify API + add.js + 404 by David Nejedly

$
0
0

Hi, I've been bashing my head against the screen all morning trying to figure out why I'm getting a 404 error by using a post as described here (http://docs.shopify.com/support/your-website/themes/can-i-use-ajax-api) to add items to the cart...

What the final goal is, is to add multiple items to the car with 1 button click.

I've scoured the forum and found similar requests, none with a definite solution? I've asked live shopify chat who couldn't help so I'm hoping that someone can point me in the right direction.

We have a customised shopify theme based on the standard 'Minimal theme'.

When running this code:

Shopify.itemsToAdd = [];
 Shopify.addItemstoTheCart = function() {
  if (Shopify.itemsToAdd.length) {
    var item = Shopify.itemsToAdd.pop();
    $.ajax({
      url: '/cart/add.js',
      dataType: 'json',
      type: 'post',
      data: item,
      success: Shopify.addItemstoTheCart,
      error: Shopify.addItemstoTheCart
    });
  } else {
    //window.location.href = '/cart';
    alert('redirecting to cart');
  }

I get a 404 as shown in the firebug inspector

Remote Address:204.93.213.54:80
Request URL:http://the-nutritionists-3.myshopify.com/cart/add.js
Request Method:POST
Status Code:404 Not Found
Request Headersview source
Accept:application/json, text/javascript, */*; q=0.01
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Content-Length:23
Content-Type:application/x-www-form-urlencoded; charset=UTF-8
Cookie:cacheable_token=753a1ad0-bf11-4d48-ba52-9409852fe550; ki_u=dd2bf8c7-b211-74ce-95b4-c5c5bc62c646; ki_r=https%3A//delivery.shopifyapps.com/login/authenticate%3Fshop%3Dthe-nutritionists-3.myshopify.com; ki_s=120557%3A0.0.0.0.1; __atuvc=2%7C20%2C0%7C21%2C2%7C22%2C0%7C23%2C1%7C24; cart=9e7f42b87543a0e84b9165f491a3b483; ki_t=1403230130419%3B1404256168436%3B1404256681477%3B3%3B28; _session_id=56327072167c1d0ba915fb8782146129; admin_next_beta_domains=true; _ab=1; _ga=GA1.2.81915067.1397696914; __utma=1.81915067.1397696914.1404707052.1404771793.28; __utmc=1; __utmz=1.1402617312.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); storefront_digest=f6a73da942049ff8e0f85b80b17b5d5852f94972; ki_t=1403230130419%3B1404771851587%3B1404771851587%3B4%3B29; ki_r=; request_method=GET; _shopify_y=c69f41ad-0ab4-4e89-828f-fba0f6a2420c; _shopify_visit=t; _shopify_uniq=x; _shopify_s=72236e5e-dbc9-4e09-82ba-7d95fa546898
Host:the-nutritionists-3.myshopify.com
Origin:http://the-nutritionists-3.myshopify.com
Referer:http://the-nutritionists-3.myshopify.com/collections/bundle-1/products/bonvit-psyllium-husks
User-Agent:Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36
X-Requested-With:XMLHttpRequest

What is strange is that accessing change.js (http://the-nutritionists-3.myshopify.com/cart/change.js) is OK but http://the-nutritionists-3.myshopify.com/cart/add.js gives a 404....

 

Any information on what is going on here would be great... At this stage I'm thinking that the minimal theme is the cause and somehow missing the /cart/add.js file...?

UPDATE: the response found is this

{"status":404,"message":"Cart Error","description":" Cannot find variant (request_id: d03a5117-b88f-4453-86a8-30e5985b3ada)"} 

so it seems like a variant issue as described here http://ecommerce.shopify.com/c/ecommerce-design/t/shopify-additem-404-error-54782

I will keep investigating but if anyone has experienced this please let me know how you overcame the problem.

ANY help is greatly appreciated.

Regards,

David

 

 

 

 

David Nejedly commented on Shopify API + add.js + 404

$
0
0

LOL, Wouldn't you know it. The Variant issue was the culprit... It's my opinion that the 404 is confusing but I guess the repsonse tell you what to do.

 

Multiple items adding to the cart, now I just need them to pickup their variant price on the cart... Next hurdle.

Changing the Shipping Address in Admin doesn't trigger order_update Event by Nico Beyer

$
0
0

When I edit the shipping_address in the admin, the order_update webhook doesn't fire and the "updated_at" field of the order remains unchanged.

Also, this seems to have implications for API-Calls for this order. When I call orders.json to get a list of orders, I only get the old address transmitted.

Only when I change the Order Note, the update event is triggered. Only then the webhook is fired and the API calls return the correct address.

Since I have to recreate shipping labels everytime the address changes, my App needs to be notified of an address change.

Idiot question: params from 'previous call' in Ruby API? by Matthew Ostman

$
0
0

I'm probobly missing something obvious, but I'm getting started with the shopify api ( https://github.com/Shopify/shopify_api ), and this particular section of the documentation is making my head hurt a bit:

There is a method to make the request and get the token for you. Pass all the params received from the previous call and the method will verify the params, extract the temp code and then request your token:

token = session.request_token(params)

However, following the instructions as given up to this point, I'm not really seeing any call I would have made previously that would have returned any parameters for me to pass back in this call, at least not as explained in the documentation. Can anyone help me figure out what I'm missing?

Chris Saunders commented on Integrating Shopify with Our Inventory Application

Chris Saunders commented on Idiot question: params from 'previous call' in Ruby API?

$
0
0

Are you looking to get the OAuth working? If you are using a Ruby app you can use Omniauth-Shopify which will make it easier to work with.

Basically what is going on is you'll setup an oauth request, and when the user approves your app you'll get a temporary code as one of the parameters in the redirect. You can use that parameter to fetch the actual API access token.

If you use omniauth-shopify-oauth2 gem, all of this will be taken care of for you, then you just grab the values you need from the omniauth hash.

Chris Saunders commented on GET /cart.js : add product_id

$
0
0

The update is now in production.

Shopify.getCart(function(data){ console.log(data); })
Object {token: "ff3bd19be48b1ec4cf80c15635300a55", note: null, attributes: Object, total_price: 2500, total_weight: 0…}
attributes: Object
item_count: 1
items: Array[1]
0: Object
gift_card: false
grams: 0
handle: "owl-o-lantern"
id: 359111983
image: "http://cdn.shopify.com/s/files/1/0064/2402/products/scrollview.gif?v=1403529721"
line_price: 2500
price: 2500
**product_id: 156730669**
properties: null
quantity: 1
requires_shipping: true
sku: "owl-o-lantern"
title: "Owl-o-Lantern"
url: "/products/owl-o-lantern?variant=359111983"
variant_id: 359111983
vendor: "Dodocase"
__proto__: Object
length: 1
__proto__: Array[0]
note: null
requires_shipping: true
token: "ff3bd19be48b1ec4cf80c15635300a55"
total_price: 2500
total_weight: 0
__proto__: Object

 


Marius Andreiana commented on GET /cart.js : add product_id

$
0
0

I see it. You rock!

Any chance to get it included in

{{cart | json}}

 too?

This already works:

{% for item in cart.items %}
  {{item.product.id}}
{% endfor %}

 

Chris Saunders commented on GET /cart.js : add product_id

$
0
0

{{ cart | json }} causes the cart items to be turned into the JSON that I showed in the example AJAX API snippet. So you'll have access to 'product_id' on each item.

 

Marius Andreiana commented on GET /cart.js : add product_id

$
0
0

Right, it's also there now. Thanks!

Shopify's AJAX API: Add Item To Cart Not Working by Bennett Lee

$
0
0

I have a question regarding Shopify's AJAX API: http://docs.shopify.com/support/your-website/themes/can-i-use-ajax-api

I want to add an item to cart from a remote site asynchronously, so I want to make sure I did this correctly.

1) Include the Shopify AJAX API library (javascript file) over at http://cdn.shopify.com/s/shopify/api.jquery.js

2) Call

Shopify.addItem(variant_id, quantity, function(line_item){
   console.log(line_item);
});

Assuming the variant id and quantity variables are correct, that should be it right?

IIn my console, I'm getting "SyntaxError: syntax error api.jquery.js (line 1, col1)" which is the Shopify AJAX Api library. Can't figure this out.

Chris Saunders commented on Shopify's AJAX API: Add Item To Cart Not Working

$
0
0

What does your Network pane of your developer panel (cmd+option+i on Mac) say when making the request? The Shopify AJAX API doesn't support cross-domain requests, which is probably why this is failing. You should see an error in the network request

Viewing all 25503 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>