API V1 is no longer in active development. If you are starting a new integration, it is recommended you use API V2

Fulfillment

The Fulfillment API is an extension of the Order API. The Fulfillment extension lets you view Ready or Packing Fulfillments or lets you update its shipping information or cancel a fulfillment.

Views

Views allow you to display fulfillment data including the fulfillment weight, shipping addresses and methods. Available outputs are in XML and JSON.

Example:

<?php  
header("Content-type: text/xml;");  
$credentials = array('identifier' =>  'LC350000000', 
             'key'=> 'dynKSr4I7y2K3RrPRsFYFJr03IXUbv',
             'view' => 'fulfillment'); 
$curl = curl_init();  
curl_setopt($curl,CURLOPT_POSTFIELDS, http_build_query($credentials));  
curl_setopt($curl,CURLOPT_POST, 1);  
curl_setopt($curl, CURLOPT_URL, 'http://leadcommercestore.web/api/v1/Orders.xml');
curl_exec($curl);  
curl_close($curl);  
?>

It is important to pass the flag view to the API with the word fulfillment. This will let the Order API, you are using the fulfillment extension. This is not required for the Order API. By not passing this or passing the value "Order", it will load the Orders View.

With the Fulfillment API, you can filter your result set to get a particular result set you are looking for. You can use any of the filters in any particular combination. If you are passing a particular fulfillment ID or Order ID, all other filters will be ignored.

Filters

Key Data Type Required Example Notes
view String Yes "fulfillment" Must be set to fulfillment for fulfillment view to work.
shipping_provider Integer No 5 The ID of the Shipping Provider
shipping_provider_class Integer No 51 The ID of the Shipping Provider Class
fulfillment_status Integer No 1 This number represents the status value. The values goes as follows:
  • 1 Ready
  • 2 Packing
order_status Integer No This number represents the status value. The values goes as follows:

  • 2 Pending
  • 4 Partially Backordered
  • 7 Processing
  • 8 Partially Shipped
  • 11 Pending Return
  • 12 Partially Return
customer_type Integer No 1 The ID of the Customer Type
sale_channel Integer No 6 The ID of the Sale Channel the Order belongs to
warehouse Integer No 2 The ID of the warehouse the fulfillment is being fulfilled from
customer_id Integer No 651 The ID of a particular customer
order_id Integer No 1006 The ID of a particular order
alternate_order_id String No 100020280 The Alternate Order ID
placed_start Integer No 1406239561 UNIX timestamp of when the Order was placed. This is great for a range.
placed_end Integer No 140624551 UNIX timestamp of when the Order was placed. This is great for a range.

Example Output:

<?xml version="1.0" encoding="UTF-8"?>
<message client="172.4.33.114" time="1408561445">
   <response>
      <code>200</code>
      <data>
         <item>
            <fulfillment>13</fulfillment>
            <line_items>1</line_items>
            <total_items>1</total_items>
            <warehouse>1</warehouse>
            <status>Ready</status>
            <shipping_provider>5</shipping_provider>
            <order_id>17</order_id>
            <shipping_provider_name>Shipping</shipping_provider_name>
            <shipping_provider_class>51</shipping_provider_class>
            <shipping_provider_class_name>Ground</shipping_provider_class_name>
            <service_code />
            <ship_from>
               <name>Mark Jones</name>
               <company_name>Development</company_name>
               <address_1>555 Old Oak Rd</address_1>
               <address_2 />
               <city>San Diego</city>
               <region>United States</region>
               <subregion>California</subregion>
               <postal_code>92130</postal_code>
               <phone>2069238660</phone>
               <fax />
            </ship_from>
            <ship_to>
               <name>Leo DeCappuccino</name>
               <company_name />
               <address_1>5000 Parkway Avenue</address_1>
               <address_2 />
               <city>Los Angeles</city>
               <region>United States</region>
               <subregion>California</subregion>
               <postal_code>90009</postal_code>
               <phone>310-555-6789</phone>
            </ship_to>
            <weight>
               <value>1.75</value>
               <units>lbs</units>
               <region />
               <subregion />
            </weight>
         </item>
         <item>
            <fulfillment>8</fulfillment>
            <line_items>1</line_items>
            <total_items>1</total_items>
            <warehouse>1</warehouse>
            <status>Ready</status>
            <shipping_provider>5</shipping_provider>
            <order_id>13</order_id>
            <shipping_provider_name>Shipping</shipping_provider_name>
            <shipping_provider_class>51</shipping_provider_class>
            <shipping_provider_class_name>Ground</shipping_provider_class_name>
            <service_code />
            <ship_from>
               <name>Mark Jones</name>
               <company_name>Development</company_name>
               <address_1>555 Old Oak Rd</address_1>
               <address_2 />
               <city>San Diego</city>
               <region>United States</region>
               <subregion>California</subregion>
               <postal_code>92130</postal_code>
               <phone>2069238660</phone>
               <fax />
            </ship_from>
            <ship_to>
               <name>Frank Grimes</name>
               <company_name />
               <address_1>109 Ocean Dr</address_1>
               <address_2>Apt 87</address_2>
               <city>San Diego</city>
               <region>United States</region>
               <subregion>California</subregion>
               <phone>69515551212</phone>
            </ship_to>
            <weight>
               <value>1.75</value>
               <units>lbs</units>
               <region />
               <subregion />
            </weight>
         </item>
      </data>
   </response>
</message>

Fulfillment

Fulfillment allows for the API to either cancel or ship fulfillments. Available outputs are in XML and JSON.

Data Points

Key Data Type Required Example Notes

fulfillment

int

Yes

40

The ID of the fulfillment

action

string

Yes

ship

The action you want to perform. This can either be "ship" or "cancel".

notes

string

No

These are some notes


shipping_cost

decimal

Yes

8.45 The amount it cost to ship fulfillment
tracking string No 565981684TF74 Tracking Code for the shipment

Example:

header("Content-type: text/xml;");  
$update = array('fulfillment'     => 40,
            'action'        => "ship",
           'notes'           => "Some Notes",
            'tracking'        => '565981684TF74',
            'shipping_cost'      => 8.97
    );
$credentials = array('identifier' => 'LC350000000',
             'key'        => 'dynKSr4I7y2K3RrPRsFYFJr03IXUbv', 
             'updates'    => array($update)); 
$curl = curl_init();  
curl_setopt($curl,CURLOPT_POSTFIELDS, http_build_query($credentials));  
curl_setopt($curl,CURLOPT_POST, 1);  
curl_setopt($curl, CURLOPT_URL, 'http://leadcommercestore.web/api/v1/Orders/fulfillment.xml');
curl_exec($curl);  
curl_close($curl);

Start your free, no-risk trial today.