Cancel Order Status Function

The function to cancel an order is CancelOrder.

Heads up! You can only cancel an order in the PENDING status.
An error will be returned if you try to cancel an order after it has printed.


creds (type: array)
Credentials must be passed in the order data to authenticate (see authentication for more details)
  • Credentials.partnerCode (type: string)
    Your unique partner key as assigned by ZenPrint
  • Credentials.apiKey (type: string)
    Your unique API key as assigned by ZenPrint
partnerOrderId (type: int)
Your order number


Order data will be returned with:
LineItem.currentState (type: array)
The current status of the line item. Can include:
  • PENDING - The order is received and waiting to be printed
  • PRINTED - The order has been printed
  • BINNING - This item has been completed as is awaiting other line items before shipping
  • PACK SLIP CREATED - The order is complete and awaiting packaging to be shipped
  • PACKAGED - The order has been packaged and is awaiting final shipping
  • SHIPPED - The order has been shipped
  • HOLD - The order is on hold due to an issue
  • CANCELLED - The order has been cancelled
OrderData.errors.message (type: string)
Any errors in the submission will be returned here

Sample Code (PHP)

<?php * Cancel an Order *
//showing all errors
ini_set('display_errors', '1');

$client = new soapclient('', array('cache_wsdl' => WSDL_CACHE_NONE));
$credentials = array("partnerCode"=>"REPLACE_WITH_PARTNER_CODE", "apiKey" =>"REPLACE_WITH_API_KEY");
$orderID = 12345; // replace with the order number you'd like to cancel

$orderStatus = $client->CancelOrder(array(
        "creds" => $credentials,
        "partnerOrderId" => $orderID

if (is_array($orderStatus->orderLineItems->LineItem)){
	echo "Current Order Status: ".$orderStatus->orderLineItems->LineItem[0]->currentState;
} else {
echo "Current Order Status: ".$orderStatus->orderLineItems->LineItem->currentState;