Read Shopify shop shipping origin - shopify

Anyone know how to read a Shopify shop's shipping origin? The address you can read via the Shop API appears to be just for billing.
I've tried using the 'Location' API but that seems to reference the same data as the Shop API.

I hope it may be useful for someone.
There is a field called primary_location_id in Shop resource

I don't know if that's what you are looking for but shop.address.summary liquid variable might help.

Related

Get Products metafields with rest api in shopify react-app

I am trying to access shopify product metafields same like products getting with rest-api and also i am using shopify-api npm package to get metafields but we are receing empty metafields array
enter image description here
enter image description here
Please help me to resolve that..
There are a couple of potential reasons. One, perhaps that product actually has no metafields. Or two, perhaps your API has no permission to read the metafields assigned to the product.
A sure fire way for you to establish if your code is working or not, is to use your API key to write a metafield. Verify it exists. Then use your code to read the metafield you created. With that, you know your code is working.

Shopify extract orders + marketing action

I need to extract all of our orders from a Shopify shop in order to analyze them. When I check the shops backend, I can see if and where the order is coming from (ppc, organic).
Downloading the excel files, this information is missing.
Looking at the API documentation, I can find an object called marketingEvent, which has (i) a marketing_channel and (ii) a paid flag:
https://help.shopify.com/en/api/reference/marketingevent#properties
but I'm not sure if this is what I am looking for and how a marketingEvent object is related to an order.
Do you have any ideas?
Thanks,
E.
From your description it seems like you are discussing about Conversion Summary. However, it is not possible to export this data with Orders Export as per this forum post. HOwever, if you have a look at API reference for Orders, there are few properties that may help you.
client_details
landing_site
referring_site
client_details will allow you to see the details like broswer and locale.
landing_site will allow you to see the the additional UTM etc parameters that may provide you the additional information.
referring_site will define if it was a direct visit or some site that referred visitor to your store.
For more information on Conversion tracking have a look at Shopify documentation.
If you examine the GraphQL documentation, you'll find all the answers in there.
https://help.shopify.com/en/api/graphql-admin-api/reference/object/marketingevent

Shopify API Customer sort incorrectly unlike other resources(Product, Order, etc)

I am building a shopify app by using the Shopify API, and run into trouble.
When I make a GET request with '/admin/customers.json'
Shopify API response with results sort incorrectly unlike other resources(Product, Order, etc)
I make some screenshots to get thething clear.
Both Order and Product reponse with the correct collection result("updated_at desc") but Customer didn't.
Is it bug or did I miss anything?
I think you need to encode your parameters. Shopify docs don't show encoded params for clarity but you need:
'?fields='+encodeURIComponent('id,updated_at')+
'&updated_at_min='+encodeURIComponent('2015-11-25 20:01:00')+
'&order='+ encodeURIComponent('updated_at DESC');
You could use the search endpoint on customer.
/admin/customers/search.json
/admin/customers/search.json?order=updated_at DESC&fields=id
See the doc on the same API page as customer, just a bit further down the page
https://docs.shopify.com/api/customer
Use the 'sorty_by' attribute when doing your search: https://shopify.github.io/js-buy-sdk/api/classes/ShopClient.html#method-fetchQueryCollections

BigCommerce JavaScript API

In BigCommerce, can I access the current customer's record using JavaScript?
I want to change something on the product page based on the customer group that the current customer is in.
there is no JS SDK yet for Bigcommerce. However, because the APIs are restful, you should be able to execute a simple GET request to get a customer's record. The only challenge is that you need to get the customer ID/info when they login to the store and then get their record.
There is an example on Bigcommerce forums on using Javascript to hide pricing for customers who are not logged in.
http://forum.bigcommerce.com/f4/global-variable-for-current-user-s-group-1815/index2.html
This combined with GET request on the customer endpoint (http://developer.bigcommerce.com/api/customers) should get you moving in that direction.
Does this help? Are you looking for a code sample?
Use Javascript or jQuery to do the IF statement.
Then use Ajax to request the data that you want to display to the user.
So to answer your question, directly with Javascript you can't, but combine it with some PHP and then you use the API to do what you would like.
Hope this helps :)

Modify fulfillment.tracking_url variable?

As part of a Shopify app I'm building, I'd like to modify the fulfillment.tracking_url email variable.
Specifically, when a customer is emailed their tracking number, I want to change the tracking URL from the default carrier so that ALL tracking links are this format:
http://example-store.myshopify.com/tools/track?n=1Z18E08VYW76416035
Is that possible?
This currently isn't possible, but it's something Shopify is thinking of making available. We will let you know once it's out via an upcoming Shopify Developer newsletter and over #shopifyapi.