The specifications on this page are for submitting an order to Corefact, or for requesting a reprint of an existing order.
https://www.printhq2.com/rest_interface.php
https://www.printhq2.com/rest_interface.php
'http' is supported in addition to 'https' but not recommended for security reasons.
Four POST parameters are required on every call:
login |
Required | Assigned to you by Corefact. |
password |
Required | Assigned to you by Corefact. |
method |
Required | newPrintRequest = New orders reprintPrintRequest = Reprint of an existing order |
orderxml |
Required | See below. |
If successful, the response will look like this:
<?xml version=”1.0" encoding="UTF-8"?>
<newPrintRequest>
<status>1</status>
<client_order>12345678</client_order>
</newPrintRequest>
If there is any error, the response will look like this:
<?xml version=”1.0" encoding="UTF-8"?> <newPrintRequest> <status>0</status> <error_code>123</error_code> <error_description>Description of the error</error_description> <client_order>12345678</client_order> </newPrintRequest>
In all cases, you will need to resubmit, even if the error was on our end.
Follow this blueprint if you are sending an item with artwork (not photobook or envelope). If you only have one file, please include two <file>'s in the xml (front and separator)
<item> <client_orderitem_number>Item_123</client_orderitem_number> <client_product_code>PRODUCT_SKU1</client_product_code> <product_description>Print Desc for Item_123</product_description> <quantity>1</quantity> <files> <file> <type>front</type> <name>123_print.pdf</name> <full_url>my_url.com</full_url> </file> <file> <type>separator</type> <name>123_print.pdf</name> <full_url>my_url.com</full_url> </file> <file> <type>back</type> <name>123_print.pdf</name> <full_url>my_url.com</full_url> </file> </files> </item>
<item> <client_orderitem_number>Item_123</client_orderitem_number> <client_product_code>PRODUCT_SKU1</client_product_code> <product_description>Print Desc for Item_123</product_description> <quantity>1</quantity> <page_count>20</page_count> <photobook>true</photobook> <files> <file> <type>front</type> <name>123_print.pdf</name> <full_url>my_url.com</full_url> </file> <file> <type>separator</type> <name>123_print.pdf</name> <full_url>my_url.com</full_url> </file> </files> </item>
<item> <client_orderitem_number>311412699_1</client_orderitem_number> <client_product_code>ENV_SQUARE_80_WHT_BLACK_TP</client_product_code> <product_description>311412699_1 Printed White 5.5 Inch Square Envelopes</product_description> <quantity>40</quantity> <files> <file> <type>envelope</type> <name>311412699_6146649_square.pdf</name> <full_url>my_url.com</full_url> </file> </files> </item>
<item> <client_orderitem_number>1A2B3C4D</client_orderitem_number> <client_product_code>Inv_Env_5.75in x 4.375in_blank_80_natural</client_product_code> <quantity>40</quantity> <product_description>Natural 80# Envelope</product_description> </item>
<?xml version="1.0" encoding="UTF-8"?> |
Required | |
<order> |
Required | |
<client>abccompany</client> |
Required | This code is assigned to you by Corefact. |
<client_order_number>12345</client_order_number> |
Required | Your order number. |
<recipient> |
The recipient node is optional. It refers to the person who placed the order, and is only needed if we need to contact someone other than the person at the ship_address. | |
<first_name>Amanda</first_name> |
||
<last_name>Hanlin</last_name> |
||
<email>myname@mycompany.com</email> |
||
<phone>800-555-1212</phone> |
||
</recipient> |
||
<ship_address> |
Required | The ship_address node is required. |
<attention>Amanda Hanlin</attention> |
Required | |
<company>Residence</company> |
Required | |
<street1>275 Vestor Street</street1> |
Required | |
<street2>Apartment 233</street2> |
||
<street3></street3> |
||
<city>Ferndale</city> |
Required | |
<state>MI</state> |
Required | |
<zip>48220</zip> |
Required | |
<country>UNITED STATES</country> |
Required | |
</ship_address> |
Required | |
<bill_to> |
The bill_to node is optional. It's only required if you need Corefact to have billing information different from normal. | |
<first_name>Amanda</first_name> |
||
<last_name>Hanlin</last_name> |
||
<company>Residence</company> |
||
<street1>275 Vestor Street</street1> |
||
<street2>Apartment 233</street2> |
||
<street3></street3> |
||
<city>Ferndale</city> |
||
<state>MI</state> |
||
<zip>48220</zip> |
||
<country>UNITED STATES</country> |
||
</bill_to> |
||
<ship_method_desc>Ground (no HI or AK)</ship_method_desc> |
Required | Exact full text of method as defined by shipper. e.g.
Standard |
<ship_account>12345</ship_account> |
An optional shipping account number to use for this order. | |
<expected_delivery_date>2/13/2008</expected_delivery_date> |
mm/dd/yyyy | |
<label_message>Happy Birthday, Frank!</label_message> |
Message to appear on the shipping label/packing list. | |
<status_update> |
Optional. If you have a special URL you want status updates and/or shipping notifications to go to. The only type is standard and the following arguments will be appended as PATH args to your url and sent as an HTTP GET request:
http://yoururl.com/yourpage.php?ShippingTracking |
|
<url>http://domain.com/function.php</url> |
||
<type>Standard</type> |
||
</status_update> |
||
<items> |
Required | There must be at least one item in your order. |
<item> |
Required | There is no limit to how many you can have. |
<client_orderitem_number>38809816-1</client_orderitem_number> |
The item as you want it to appear on the customer's packing list. | |
<client_product_code>STD_ENV_WHITE_SQUARE6_TP</client_product_code> |
Required | The product part number (SKU) as it appears in Corefact's database. |
<product_description>White 6 Inch Square Envelopes</product_description> |
Description for internal reference. | |
<quantity>51</quantity> |
Required | |
<photobook>true</photobook> |
Set to true on items that use photobook multi quantity support. If you have not been asked to add this leave it out! | |
<document_id>XXX123</document_id> |
Optional. Only needed if a Document ID is required for printing. | |
<notes>Do something special to it</notes> |
Optional. | |
<files> |
Optional. Only needed if there are files we need to retrieve from you. | |
<file> |
||
<type>front</type> |
Required | Acceptable values are front, back, separator, envelope. They can be in any order. Only one of each per <item> is allowed. |
<name>file-38809816-1.pdf</name> |
Required | This should be a unique name for every order. A common convention is to append the client_orderitem_number to the name. |
<full_url>https://www.xxxxx.com/your_system.php?xxx=yyy</full_url> |
Required | The full URL where our system can retrieve your print file. |
<sha1_hash>1234567890abcdef</sha1_hash> |
sha1_hash of file contents for validation. | |
<bytes>97700</bytes> |
File size for validation. | |
</file> |
||
<file> |
||
<type>separator</type> |
||
<name>filename.pdf</name> |
||
<full_url>https://www.xxxxx.com/your_system.php?xxx=yyy</full_url> |
||
<sha1_hash>1234567890abcdef</sha1_hash> |
||
<bytes>97700</bytes> |
||
</file> |
||
</files> |
||
</item> |
||
<item> |
||
<client_product_code>STD_ENV_WHITE_SQUARE6_TP</client_product_code> |
||
<product_description>White 6 Inch Square Envelopes</product_description> |
||
<quantity>51</quantity> |
||
<document_id>XXX123</document_id> |
||
<notes></notes> |
||
<page_count>25</page_count> |
Optional. | |
<files> |
||
<file> |
||
<type>front</type> |
||
<name>filename.pdf</name> |
||
<full_url>https://www.xxxxx.com/your_system.php?xxx=yyy</full_url> |
||
<sha1_hash>1234567890abcdef</sha1_hash> |
||
<bytes>97700</bytes> |
||
</file> |
||
</files> |
||
</item> |
||
</items> |
||
</order> |