Shopify - get price, stock on hand hand in realtime from external database - api

My company would like to sell products through the Shopify Platform, but be they want to be able to get their prices and stock levels from an external data base. We have developers that know how to create an API, but we do not quite understand how to set up a private app to do this.
For instance, we want to make an ajax call to this endpoint www.{ourDomain}/shopify/getPrice.html?Part=UserRequestedPart and the endpoint would return some JSON or XML data which I would expect to parse and display in Shopify.

Create a private app with write_products and write_inventory scopes.
Access your endpoint to get current prices/inventory from your external database.
Update Shopify product prices/inventory using Shopify API.
Use Product Variant to update prices.
Use Inventory Level endpoint to update the quantity.
More details can be found here: Shopify Admin API

Related

Shopify - How to update inventory on the fly

So i have a customer that wants to keep his inventory in sync with the supplier (who has a stock API) in magento I wrote a plugin that on page load updated the inventory and then re-rendered the page showing the updated value.
I've seen that shopify has an API, but I couldn't see if what I wanted to do was do-able.
Has anyone got any thoughts?
I could hit the API every 15mins and updated all the products, but this seems like an overkill
You cannot update Shopify inventory in real-time without using an App. Install your custom App in your client store. That App can then securely call the supplier API and get values for inventory. Using your API permissions in the Shopify you can then update Shopify
As David said you need an app. It can be a custom app, that is an app that you don't think to put on the market place and that is only available on a particular store.
In particular, I don't think you need an embedded app, you just need to have the access token and make your REST calls.
You will need to create one webhook on Shopify and one webhook on Magento, to syncrhonize the two stocks.
I don't have any knowledege of Magento but on Shopify the webhook that I think you should use is inventory_levels/update that is triggered whenever the stock changes, and that also depends on the location of your products. The same you should do on Magento.
This is a python script that is doing the update when receiving the webhook
def sync_inventory():
inventory_request = app.current_request.json_body
inventory_id = inventory_request["inventory_item_id"]
location_id = inventory_request["location_id"]
if location_id not in WAREHOUSE_IDS or inventory_id not in INVENTORY_IDS:
# Discarded inventory event
return {}
return sync_inventory_data(inventory_id) # do your magento call here

Link Shippo Transaction to Shopify Order

I am attempting to work on some integration with Shopify and Shippo, part of the process is sending an email to our warehouse including the order line items with the Shipping Label attached as a PDF.
When we create the label in Shippo, the fulfillment information is updated in Shopify correctly, but I was wondering if there was any way to link the two back up reliably from an API perspective since the Shippo API appears to not include any invoice information. I see a link to an internal order object, but the API docs don't seem to stipulate any further information and the Shopify Fulfillment record does not appear to include any Shippo object id.
The only thing I see if the Shippo Order Metadata field which includes the order number, so I suppose I could parse this and make the request to Shopify's API but I would prefer a more concrete link if one is available.
We (I'm working on Shippo's product team) currently don't officially support Shopify Fulfillments with Shippo API label purchases.
That said, we have an Orders API endpoint in beta. The Orders endpoint allows you to retrieve all Orders of a Shippo account, including those imported automatically from Shopify. Each order, like all other Shippo resources, has an object_id field.
When you create a label through the Shippo API's Transaction endpoint, you can link the Order to the Transaction by sending the additional flag order, setting it to the object_id of the corresponding Order (e.g.: { ... "order": "<order-object-id>" ... }). This will trigger the corresponding Fulfillment of the order on its shopping cart platform, in your case Shopify.
Feel free to reach out to product#goshippo.com if you have more questions about this endpoint. Please keep in mind that it is still in closed beta and the endpoint might change in the future.

Need to modify Shopify products API BY Shopify team then return back to me

It is necessary to modify Shopify products API as per my client requirement.
For example the below products API is available in Shopify API reference document.
GET /admin/products.json
I am able to get list of products from above API. But i want to filter products based on price by sending price as input parameter and get related products as a response.
For that post API is needed. Do shopify team provide Products API for filtering products by sending input parameter as that is not available in API reference?
Kindly give me the information. Thanks in advance
No, there is no way to filter on a price range using /admin/products.json. You can page through all of the products, 250 at a time, and find the products that meet your criteria that way.

Does ebay API allows to create a listing draft?

I would like to create a listing ebay draft as it is possible to do manually using this flow:
Go to the new listing sell creation page
Choose category id
Put some random data (title, description, etc.)
Close tab
You will see now unfinished draft, when you go to the new listing sell creation page.
Can I do the same thing using eBay api?
The reason of it is that I don't want to implement all functionality of addItem, currently.
eBay API will not allow to create draft listing.
when you call API for creating new listing, API needs all required fields value.
eBay Listing API provide one attribute PrivateListing.it will hide your product for selling.
If PrivateListing is true, designates the listing as private.customer can't see private listing.
eBay Listing API provide one more attribute ScheduleTime.
When you export product in eBay via API you can give ScheduleTime as well, eBay will active product for selling based on ScheduleTime.
You can make product inactive/draft using this alternative way.
http://developer.ebay.com/devzone/xml/docs/Reference/eBay/AddItem.html#AddItem
You can refer above link for eBay API.
As of now, I can confirm eBay does provide the API to create listing draft, though it's in beta at the moment.
POST - /item_draft/
Official doc is here
To my knowledge this cannot be done, since there are some pretty strict constraints around using the addItem API call, and eBay will throw an error if you don't complete the all the required fields. The required fields of addItem are numerous enough that if you could populate these fields, then you are already 90% of the way to completing your listing anyways.
If you are using Selling Manager Pro, you can create product templates which may be a way to accomplish what you are looking for.

How to get value from customer's notes field?

I am working on shopify and my requirement is to add some extra information of user and I did that following this link :-
http://docs.shopify.com/manual/configuration/store-customization/communicating-with-customers/accounts-and-newsletters/capture-additional-information-in-the-account-registration-form
But now I want to know how to get values from customer[note][label] field in my liquid code.
Like I am able to get customer's name using {{customer.name}} which is store in customer[name] field but unable to get values from customer[note][label] field.
customer.note is not exposed via the the customer Liquid object. It is currently only available via the Shopify API. This is because customer notes are not meant for displaying in your store, they are for shop owners to manage customers in the admin area. An alternative is to use metafields instead.
Relevant discussions on the Shopify forums:
Accessing Customer Note in Account.liquid template
how to access to the customer.note with Liquid