0

I have an XML file I can auto generate and upload daily. And I wish to take that XML and automatically update/close the orders in Volusion and add the tracking number...

I have the API credentials, encrypted PW, etc. and I have this XML, but I am missing the middle piece that will actually do the import. and hopefully on a defined interval (like daily)

(I am trying to avoid having to keep uploading a .csv manually through the web admin every day)

my XML looks like:

enter image description here

does anyone have an example of importing something with PHP/CURL? (I have PHP access on another server)

M21
  • 343
  • 3
  • 14
  • I guess that depends on Volusion's system. You may wish to ask them first as most programmers likely don't use their services. If there service is a full fledged web hosting service you will be able to use server-side code (PHP, ASP, C++, ect) to parse the XML. And then you can create a cron job to run that code automatically (daily) – Krik Mar 29 '16 at 16:51
  • Thanks for the reply, cant do cron or anything like that, we have no server access... it's a hosted platform and it's windows unfortunately. – M21 Mar 29 '16 at 17:04
  • It will then depend on the tools Volusion has available... And after a minute of thought there maybe a second work around, thought quite unorthodox, and complicated. You mentioned a web admin page. You could get a separate basic web hosting service (their cheap enough) and use something like PHP cURL or SOAP to login and upload the csv. I have used this method once several years ago and it can be a real pain to work through but most times it is doable. – Krik Mar 29 '16 at 17:31
  • I have linux servers available separate of the Volusion store... I could do that no problem, but the part I don't have/know is WHAT to use on those servers to accomplish this task. Volusion has no tools available like that... just the API call itself. – M21 Mar 29 '16 at 18:16
  • You need to make an HTTP request to the Volusion API to work with. There are numerous ways to do this. Can be achieved through any modern scripting language (php, python, etc) –  Mar 31 '16 at 17:12

2 Answers2

2

From http://helpcenter.volusion.com/developers/get-building/order-management-trackingnumbers-developer

Sample XML Request Data

<?xml version="1.0" encoding="utf-8" ?>
<xmldata>
  <TrackingNumbers>
    <gateway>UPS</gateway>
    <MarkOrderShipped>true</MarkOrderShipped>
    <OrderID>XXXX</OrderID>
    <SendShippedEmail>false</SendShippedEmail>
    <Shipment_Cost>0</Shipment_Cost>
    <ShippingMethodID>141</ShippingMethodID>
    <TrackingNumber>XXXXXXXXXXXXX</TrackingNumber>
  </TrackingNumbers>
</xmldata>

POST

POST http://yourdomain.com/net/WebService.aspx?Login=you@yourdomain.com&EncryptedPassword=YOURPASS&Import=Insert-Update
Haukman
  • 3,726
  • 2
  • 21
  • 33
1

We have a cheap $5/mo server at Godaddy as the "middle man" for these kinds of operations.

It works great, although not necessary if you have access to Linux servers as you said.

We are calling the API for a dozen different functions, on a regular basis, using cron jobs in Linux and executing cURL through PHP and MySQL. You could accomplish this using any scripting language you like!

We also have a few different software products running on Microsoft servers in the office that communicate with Volusion as well.

You are able to create server-side ASP pages, but the functionality is limited.

Here is a basic example in PHP:

$url = 'http://www.yoursite.com/net/WebService.aspx?Login=USERNAME&EncryptedPassword=PASSWORD&Import=Update';

$xml = 'YOUR COMPLETE XML';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml); 
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type:application/x-www-form-urlencoded; charset=utf-8", "Content-Action:Volusion_API"));

$head = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
Phil S
  • 179
  • 2
  • ok, that's what I was thinking, some type of middleware, so is there an example of anything getting posted to Volusion API this way? – M21 Mar 31 '16 at 13:40