putting an api into my shopify

Shopify Partner
4 0 0

I will be dropshipping personalised clothing and the company have given me an api script and an api key to import into my shop.


How and where do i do this?

Shopify Expert
10037 119 1872

Here is the likely starting point:

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
Shopify Partner
4 0 0

Thats great Jason, I have read it and it wants me to create the app itself through the development tools.


However the app is already built and i have my api key already provided for me, i just need to import into my shop. This app is for my use only and is not for use within the shopify app store for other people to use.

The in structions in the api document ends when you have you app and key :/ so im a little confused.


Shopify Partner
74 0 9

Can you be more specific which API you are talking about and what you want to do with it?

Is it an API key from the dropshipping vendor to import product data into your shop? 

Shopify Partner
4 0 0

its for my customers order to go straight with all required information to my dropshipper. I will be supplying people with personalised sweatshoits etc


I have been provided with the key and coding either in json or xml. I have been told by shopify that it needs to be json but thats all the information i can get.

API Post Order Test Script


//Set your data here
$post_data = '
 <api_key>' . API_KEY . '</api_key>
  <order_notes><![CDATA[Any extra information here]]></order_notes>
  <name>Name Here</name>
  <company_name>Quayside Clothing Ltd</company_name>
  <address_line_1>Unit 9 Wheel Forge Way</address_line_1>
  <address_line_2>Trafford Park</address_line_2>
  <postcode>M17 1EH</postcode>
  <country>United Kingdom</country>

//Post data to the API
$ch = curl_init(API_URL);
curl_setopt($ch, CURLOPT_HTTPHEADER,
 array('Content-Type: application/xml',
       'Accept: application/xml'
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$ch_result = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);

//Get response
$obj = simplexml_load_string($ch_result);

//Check HTTP status
if ($http_code == 200) {
 //All OK
 echo 'All seems OK: ' . $obj->status->msg  . "<br />\n";

 //Lets echo some values
 echo 'Clothes2order order ID: ' . $obj->order_details->order_id . "<br />\n";
 echo 'This order has cost you: &pound;' . $obj->order_details->net_order_value . "<br />\n";
 echo 'Estimated dispatch date: ' . $obj->order_details->est_dispatch_date . "<br />\n";

 if (sizeof($obj->warnings->warning) > 0) {
  foreach ((array)$obj->warnings->warning as $warning) {
   echo 'Warning: ' . $warning . "<br />\n";

 if (sizeof($obj->test_msgs->msg) > 0) {
  foreach ((array)$obj->test_msgs->msg as $test_msg) {
   echo 'Test message: ' . $test_msg . "<br />\n";
} elseif ($http_code == 400) {
 //There was an error
 echo 'Error occured: ' . $obj->status->msg  . "<br />\n";


Shopify Partner
74 0 9

Hi Allison,

Sorry for the late reply, I forgot about this thread.

Looks like you need a private app that subscribes to the order webhook and submits certain order data to the API from Clothes2Order.

How many orders per month are you doing roughly? If only a few, I'd say submit orders manually for now (if Clothes2Order allows this). If enough to invest a little in automating this task, I'd be happy to do a quick call with you this week and see if we can work something out.

But again, I'd only recommend automating this if you have high enough order volume.

Shopify Partner
4 0 0

Thanks PJ.

i have had to make a complaint to clothes2order with regards to this as I was told by a member of staff, that all their documentation is conclusive and obvioulsy if I dont understand it then i should basically either forget about it or hire someone to sort it for me.

Lovely customer service! I have the managing director of the company now investigating it.


I have told him that I want me website to go live within a day and I will be manually ordering anything my customers order from me.

Why would you recommend automating only on high call volumes? At this moment in time, I have no idea what I would be generating.

Shopify Partner
74 0 9

I recommend only automating with high enough sales volume cause having someone make a private app, even a rather simple one as you need, will cost some money. You need to compare that cost with the money you save.

Say it will cost you $500 to have this integration done by a Shopify expert. If placing an order manually costs you 3 minutes and you can hire staff at $20 all-in hourly cost to do so, then (even if you place the order yourself) you can say the private app would save you $1 each time an order comes in.

So with 100 orders a month a $500 investment returns 20% per month. Great. With 10 orders per month, only 2% per month, which may sound high compared to the stock market but as you will have to write off the entire $500 if your startup business fails, it's not the best investment. In the software world we would call this pre-mature optimization.

Also note that even if you suddenly have a huge spike in orders, a developer can download all the non-fulfilled orders via the Shopify API and then submit them to the Clothes2Order API. So don't think you need this private app before the orders come in. So really no need to worry, do things manually and when overwhelmed due to too many sales for manual entry contact me or any other developer on this forum to help you out. When this happens, the profits on those sales will pay for the private app development easily and your return on time / money saved will make it an obvious investment.

Good luck with your business!

7 0 0

Hi Pj, 

i am after something like this and i am pretty stuck in getting the products of our suppliers loaded to our website.

Can you assist in any way?