Event Notifications

RSS
Modified on 2013/08/28 15:43 by trushwin Paths: Integration Categorized as Uncategorized

Event Notifications, Order Status, and Errors

Event Notifications

ezprints offers you the option to subscribe to one or more event notifications, regardless of whether you are using the ezp Builder, the ezp Commerce module, or just posting order XML. The notifications are XML posts we send to a URL you specify. The notifications provide a status update on your orders. Each notification type may go to a separate URL you specify, or they can all go to the same URL. You are not required to receive the notifications and you can choose to only receive a subset of the notifications, if desired.

You would need to code your site to accept the XML post for event notifications and store/parse the data into your own order system, as well as send a message received response to the notifications. Remember that you can choose to track orders via the Partner Portal initially, and later subscribe to event notifications.

Available event notifications:

Event Notification NameDescription
FailureIndicates that the order XML has failed to pass validation against business rules and was not accepted (successfully unmarshalled) into the EZP order processing workflow.
AcceptedIndicates that the order XML has been validated against business rules and accepted (successfully unmarshalled) into the EZP order processing workflow.
AssetsCollectedIndicates that all assets (image files) have been collected for this order.
InProductionIndicates that the order has entered the production plant and will be printed soon.
CanceledIndicates that the entire order or part of an order has been cancelled. Partial order cancellation events are only supported in specific moderated order scenarios. Moderated order support is a future feature, subject to specification change.
ShipmentInformation about an individual shipment for the specified order. Lists SKUs (orderline-level info). Shipment lists product codes (SKUs) and shipment/tracking information. There would be a second notification sent for the same order that shipped separately.
CompleteShipmentIndicates that order fulfillment is complete and contains shipment information about all orders in the session.
CompleteIndicates that order fulfillment is complete. I.e., an individual order in the session has shipped. We distinguish this from "Shipping Complete" because you may just want a notification that the order is complete, but not all the shipping information about the order.
ModerationStartedIndicates that a moderated order has started the moderation process. THIS EVENT IS A FUTURE FEATURE IN DEVELOPMENT. THE FINAL SPECIFICATION IS SUBJECT TO CHANGE.
ModerationPendingIndicates that a moderated order's image has been marked as pending for review purposes. THIS EVENT IS A FUTURE FEATURE IN DEVELOPMENT. THE FINAL SPECIFICATION IS SUBJECT TO CHANGE.
ModerationCompleteIndicates that a moderated order has completed the moderation process. Contains orderline-level status information regarding if associated images have been 'Passed' or 'Rejected' in the moderation process. 'Rejected' orderlines indicate a reason code. THIS EVENT IS A FUTURE FEATURE IN DEVELOPMENT. THE FINAL SPECIFICATION IS SUBJECT TO CHANGE.

The event notification post requires either the word "Success" or "OK" to be written somewhere in your response to the post. The response should either contain the word "success" somewhere in the body of the response or the response must begin with "OK".

Example response:

<?xml version="1.0" encoding="UTF-8"?>
<OrderEventNotificationReceived Result="Success"/>

Without the success response, our event notification system will continue to post the notifications to your URL 10 times (sent every 30 minutes), so the event notification messages may be posted to you multiple times if we don't receive the success/OK response. In other words, regardless of a successful response and due to the nature of Internet communications, you'll want to be able to receive a duplicate event notification without it causing problems in your system.

Although the Accepted, AssetsCollected, and InProduction notifications will be sent regardless of whether or not a response is received, the shipping notifications require successful responses in order for subsequent notifications to be sent. For example, if a Shipment notification is sent and a successful response is not posted to ezprints, we will not send the CompleteShipment and Complete notifications.

In addition to the Event Notifications in the table above, ezprints also offers a Failed notification for orders with XML that contains one or more errors. If you subscribe to any of the notifications in the table above, you will also receive Failed notifications for bad order XML. Note that, by default, neither the event notifications in the table above nor the Failed notifications are URL encoded. Your integration manager can change make all notifications URL encoded, if desired.

Event Notification Code Samples

Failure to Unmarshal

Indicates that the order XML has failed to pass validation against business rules and was not accepted (successfully unmarshalled) into the EZP order processing workflow.

<orderfailed AffiliateID="499">
   <ordernumber>718362</ordernumber>
   <referencenumber>00123-200708031121-62724</referencenumber>
   <message>4002 Error: Type mismatch</message>
</orderfailed>

<orderfailed AffiliateID="499"> <ordernumber /> <referencenumber>00244-200708031403-63077</referencenumber> <message>6047 Invalid State Code in Customer Node. </message> </orderfailed>

Accepted

Indicates that the order XML has been validated against business rules and accepted (successfully unmarshalled) into the EZP order processing workflow.

<OrderEventNotification Id="1176390">
   <Order Id="12345" EZPReferenceNumber="00123-200708031121-62724">
      <Accepted DateTime="2008-06-13T13:01:51.0000000" />
   </Order>
</OrderEventNotification>

AssetsCollected

Indicates that all assets (image files) have been collected for an order.

<OrderEventNotification Id="1176463">
   <Order Id="12345" EZPReferenceNumber="00123-200708031121-62724">
      <AssetsCollected DateTime="2008-06-13T13:32:28.0000000" />
   </Order>
</OrderEventNotification>

InProduction

Indicates that the order has entered the production plant and will be printed soon.

<OrderEventNotification Id="1176466">
   <Order Id="12345" EZPReferenceNumber="00123-200708031121-62724">
      <InProduction DateTime="2008-06-13T13:26:19.0000000" />
   </Order>
</OrderEventNotification>

Canceled

Indicates that the entire order or part of an order has been cancelled.

Example 1 - Entire order cancelled:

<OrderEventNotification Id="1169450">
   <Order Id="12345" EZPReferenceNumber="00123-200708031121-62724">
      <Canceled DateTime="2008-06-12T00:45:00.0000000" />
   </Order>
</OrderEventNotification>

Example 2 - Partial order cancellations indicate exact orderlines cancelled:

<OrderEventNotification Id="E201302071629237820819099">
	<Order EZPReferenceNumber="0-00-0910-201302071628-0127-0187" Id="000-0000-000000000-000-0-0">
		<Canceled DateTime="2013-02-07T16:29:23.9182256Z">
			<Item Id="1" Sku="60010" PartnerSku="023-1444-abc" Quantity="1" />
			<Item Id="2" Sku="60010" PartnerSku="023-1444-abc" Quantity="1" />
		</Canceled>
	</Order>
</OrderEventNotification>

NOTE - PARTIAL ORDER CANCELLATION EVENTS ARE ONLY SUPPORTED IN SPECIFIC MODERATED ORDER SCENARIOS. MODERATED ORDER SUPPORT IS A FUTURE FEATURE, SUBJECT TO SPECIFICATION CHANGE.

Shipment

Information about an individual shipment for the specified order. Recall that there may be multiple shipments for each order because we split shipments based on products ordered. This notification lists SKUs (orderline-level info). Shipment lists product codes (SKUs) and shipment/tracking information. The example below is for 2 of the same product with 2 different images.

<OrderEventNotification Id="1192206">
   <Order Id="002005990205-8000048_12884641" EZPReferenceNumber="00392-200806191259-57994">
      <Shipment DateTime="2008-06-20T08:45:03.0000000" Carrier="FEDEX" 
            Service="Second Business Day: FedEX 2 Day" 
            DeliveryMethod="FedEx HOME DELIVERY" TrackingNumber="200326870226813">
         <Item Id="313358640" Sku="10102" PartnerSku="10102" Quantity="1" />
         <Item Id="313358639" Sku="10102" PartnerSku="10102" Quantity="1" />
      </Shipment>
   </Order>
</OrderEventNotification>

This notification is the second notification sent for the same order above, that shipped separately:

<OrderEventNotification Id="1192839">
   <Order Id="002005990205-8000048_12884641" EZPReferenceNumber="00392-200806191259-57994">
      <Shipment DateTime="2008-06-20T13:29:20.0000000" Carrier="USPS" Service="Priority Mail" 
            DeliveryMethod="USPS Priority Mail" TrackingNumber="9101132138798011187865">
         <Item Id="313358638" Sku="10106" PartnerSku="10106" Quantity="1" />
      </Shipment>
   </Order>
</OrderEventNotification>

CompleteShipment

Indicates that order fulfillment is complete and contains shipment information about all orders in the session.

<OrderEventNotification Id="1275335">
   <Order Id="12345" EZPReferenceNumber="00123-200708031121-62724">
      <CompleteShipment DateTime="2008-07-27T12:36:04.0000000" Carrier="USPS" Service="First Class" 
            DeliveryMethod="USPS First Class" TrackingNumber="">
         <Item Id="313358638" Sku="10020" PartnerSku="10020" Quantity="1" />
      </CompleteShipment>
   </Order>
   <Order Id="12345" EZPReferenceNumber="00123-200708031121-62724">
      <CompleteShipment DateTime="2008-07-27T14:56:04.0000000" Carrier="USPS" Service="Economy" 
            DeliveryMethod="USPS Economy" TrackingNumber="">
         <Item Id="313358623" Sku="10022" PartnerSku="10022" Quantity="2" />
      </CompleteShipment>
   </Order>
   <Order Id="12345" EZPReferenceNumber="00123-200708031121-62724">
      <CompleteShipment DateTime="2008-07-27T18:17:04.0000000" Carrier="USPS" Service="First Class" 
            DeliveryMethod="USPS First Class" TrackingNumber="">
         <Item Id="313358678" Sku="40026" PartnerSku="40026" Quantity="1" />
      </CompleteShipment>
   </Order>
</OrderEventNotification>

Complete

Indicates that order fulfillment is complete. I.e., all individual orders in the session have shipped. We distinguish this from CompleteShipment because you may just want a notification that the order is complete (this notification), but not all the shipping information about the order (CompleteShipment notification).

<OrderEventNotification Id="1176501">
        <Order Id="12345" EZPReferenceNumber="00123-200708031121-62724">
                <Complete DateTime="2008-06-13T13:24:15.0000000" />
        </Order>
</OrderEventNotification>

ModerationStarted

Indicates that a moderated order has started the moderation process.

<OrderEventNotification Id="E201302071629237820819095">
	<Order EZPReferenceNumber="0-00-0910-201302071628-0127-0187" Id="000-0000-000000000-000-0-0">
		<ModerationStarted DateTime="2013-02-07T16:29:23.9182256Z" />
	</Order>
</OrderEventNotification>

ModerationPending

Indicates that a moderated order's image has been marked as pending for review purposes.

<OrderEventNotification Id="E201302071629237820819096">
	<Order EZPReferenceNumber="0-00-0910-201302071628-0127-0187" Id="000-0000-000000000-000-0-0">
		<ModerationPending DateTime="2013-02-07T16:29:23.9182256Z">
			<Asset Id="2" Uri="http://www.ezprints.com/images/0/123.jpg" />
		</ModerationPending>
	</Order>
</OrderEventNotification>

ModerationComplete

Indicates that a moderated order has completed the moderation process. Contains orderline-level status information regarding if associated images have been 'Passed' or 'Rejected' in the moderation process. 'Rejected' orderlines indicate a reason code. Valid reason codes are determined during the moderation setup process.

<OrderEventNotification Id="E201302071629237820819098">
	<Order EZPReferenceNumber="0-00-0910-201302071628-0127-0187" Id="000-0000-000000000-000-0-0">
	  <ModerationComplete DateTime="2013-02-07T16:29:23.9182256Z">
		 <Asset Id="1" Status="Passed" Uri="http://www.ezprints.com/images/0/123.jpg" />
		 <Asset Id="2" Status="Rejected" Uri="http://www.ezprints.com/images/0/456.jpg" ReasonCode="Copyright" />
	  </ModerationComplete>
	</Order>
</OrderEventNotification>

Order Error Codes

The following errors may be returned by the ezprints order processing system if there is a problem validating or unmarshalling your order XML. The code and description will be sent in the Failed to Unmarshal event notification post:

Event Notification NameDescription
6010 invalid xml - no greeting address1
6011 invalid xml - no greeting city
6012 invalid state code
6013 invalid xml - no greeting zip
6014 invalid country code
6015 Customer processing error with database or datatype
6016 invalid xml - no month for calendar
6017 invalid xml - no year for calendar
6018 Customer processing error with database or datatype
6019 invalid xml -no imageid
6020 invalid image id in orderline
6021 Customer processing error with database or datatype
6022 invalid xml - no productid
6023 invalid xml - bad product id
6024 invalid xml - no imageid
6025 invalid image id in orderline
6026 Processing error with database or datatype
6027 invalid xml - no Address1
6028 invalid xml - no city
6029 invalid state code
6030 invalid xml- no zip
6031 invalid country code
6032 invalid country code
6033 processing error with database or datatype
6034 invalid xml - no shipping method
6035 invalid xml - no shipping method
6036 Processing error with database or datatype
6037 invalid xml - no shipping address
6038 XML not valid - no orderline elements
6039 processing error with database or datatype
6040 Vendor processing error with database or datatype
6041 no vendor logo path
6042 invalid image id in vendor data
6043 no vendor name
6044 invalid state code
6045 invalid country code
6046 Vendor processing error with database or datatype
6047 invalid state code
6048 invalid country code
6049 Customer processing error with database or datatype
6050 XML not valid - no order elements
6051 session processing error with database or datatype
6052 session processing error with database or datatype
6053 invalid or missing image id
6056 invalid or missing image uri
6057 invalid or missing image id
6058 Image processing error with database or datatype
6059 Processing error
6060 Processing error
6061 XML not valid - no orders or no affiliateid
6070 XML not valid - no orders or no affiliateid
6071 XML not valid - no orders or no affiliateid
6062 XML not valid - no images
6063 XML not valid - no order elements
6064 XML parse error
6065 Processing error