3rd party fulfillment integration
  • We are currently building out an ecommerce site which we will be integrating with a 3rd party fulfillment system that our client uses. We need to integrate order fulfillment and inventory amounts for each sku.

    Anyone ever do this before with Vae?

    Right now I am starting the process using the API and custom scripts.

  • 5 Answers sorted by
  • Here is an example script that has been used by others for integrating something like this. We can set this up on a cronjob for you -- just tell us when and how often you'd like to have it run.

    <?php

    $orders = verb_store_orders(array('fulfilled' => 0));
    foreach ($orders as $order) {
    if (!strstr($order['status'], "Waiting")) {


    // Spit out the order info here
    // This is the part you will want to change to match the format you need.
    var_dump($order);


    // Uncomment out this line once you're done testing. This will mark the orders as sent, so they won't be sent again.
    //verb_store_update_order($order['id'], array('fulfilled' => 1, 'status' => "Processing"));
    }
    }

    ?>

  • Here's an example of how you can update inventory in Vae from some external source:

    <?php

    // get data from fulfillment in an associative array format:
    // array(vaeId => inventory, vaeId => inventory, etc.);
    // example:
    // $inventory = array(123 => 7, 124 => 8, 125 => 2);

    foreach ($inventory as $id => $inventory) {
    vae_update($id, array('inventory' => $inventory));
    }

    ?>

  • And here's an example of how you can update tracking numbers from some kind of feed:

    <?php

    // get data from fulfillment in the following format:
    // array(array(orderId, ShipmentCompany, TrackingNumber), array(orderId, ShipmentCompany, TrackingNumber), etc.);
    // example:
    // $tracking = array(array(123, "UPS", "1X1283719283"));

    foreach ($tracking as $cols) {
    $order_id = trim($cols[0]);
    $shipment_company = trim($cols[1]);
    $shipment_tracking_number = trim($cols[2]);
    if (strlen($order_id) && is_numeric($order_id)) {
    echo " - updating order number " . $order_id . " to be Shipped by " . $shipment_company . " with tracking " . $shipment_tracking_number . "\n";
    vae_store_update_order($order_id, array('status' => "Shipped", 'shipment_company' => $shipment_company, 'shipment_tracking_number' => $shipment_tracking_number));
    }
    }


    ?>

  • Thanks Kevin, much appreciated.

    Do you have a list of the available order status flags?

  • This api doc:
    http://docs.vaeplatform.com/php_vae_store_update_order_status

    notes these options: Cancelled, Backordered, Waiting for Payment, Ordered, Processing, Shipped.

    however in the management panel there are these options as well:
    Waiting for Approval, Partially Shipped

    Any reason these are available on the API side of things as well?

    -sb

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

In this Discussion