Access a community of over 900,000 Shopify Merchants and Partners and engage in meaningful conversations with your peers.
I just Got know that i can access my Store database Through "API", i want to know more about this API .
How it will works ?
Is it free ? ( if not....! then what is the price structure and limitaion ).
i have not found any answer for this . even i have consulted Support. they have clearly refused to give information regarding this .
thanks in advance
Manikanta
The documentation on the API is public, and available here:
https://help.shopify.com/api
There's no cost to use the API, though you'll need Shopify account (obviously) and some features may be restrictured (like Plus API endpoints). It's all noted in the docs.
Ya. thank you .
Can i import my data to shopify database using API . ? instead of importing in CSV format.
Sure can!
If you're talking about adding products you'll want to focus on the products endpoint. There's an example of how to create a product here:
Thnaks again Jason ..
i have called my API for 3 time so product has inserted 3 time too with same SKU number .
http://screencast.com/t/rpdu6O9af
any idea how to avoid this ?
You need to provide more details for the results, for example the script you used.
API is just another interface to interact with your webstore. You can basicly do the same thing as you can do on the admin portal after auth granted. Have a look a the api documentation as Jason provided above, you will find all the endpoint for it.
If you have other web stores and planning to migrate or sync your data on the shopify web stroe, use some scripts or build a connector app via api can be a good option instead of spreadsheet. It depends on what you are trying to do.
I hope the "SKU" is the primary key in shopify , and i think it will not allow you Duplicate SKU numbers .
here is my code
<?php
$vendor = "kanta";
$products_array = array(
"product"=>array(
'title'=>'',
"title"=> "Burton Custom Freestlye 151",
"body_html"=> "<strong>Good snowboard!</strong>",
"vendor"=> $vendor,
"product_type"=> "Snowboard",
"published"=> true ,
"variants"=>array(
array(
"id"=> null,
"product_id"=> 327475578523353102,
"title"=> "",
"price"=> "19.99",
"sku"=> "Ac-mani-Gowda1",
"image"=> "http://cdn.shopify.com/s/files/1/0040/7092/products/red-rain-coat.jpeg?v=1402604893",
"position"=> 0,
"grams"=> 200,
)
)
)
);
echo json_encode($products_array);
echo "<br />";
$url = "https://XXX:YYY :x.com/admin/products.json";
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_VERBOSE, 0);
curl_setopt($curl, CURLOPT_HEADER, 1);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($products_array));
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec ($curl);
curl_close ($curl);
echo "<pre>";
print_r($response);
?>
After calling this API the data is storing multiple time with same SKU number .
thank you
mani
SKU is not a unique field so can be a duplicate, or even blank.
User | RANK |
---|---|
8 | |
7 | |
4 | |
3 | |
3 |
Connect your PayPal account to allow your customers to checkout using the PayPal gateway a...
ByYour online store speed can enhance your store’s discoverability, boost conversion rates a...
ByShopping is at our fingertips with mobile devices. Is your theme optimized to be user-frie...
By