Build your own app with this very simple REST API to place print orders.
About 99% of our customers, including Issuu and Rijksmuseum, use embedded Javascript instead. Read how.
Using the API, you can build your own user interface, including payment screens. So, you will be collecting consumer payments yourself. Normally, we do this.
Because we still need to be able to pay our facilities for the production of your products, the API can only be used with enough prepaid credit to pay for any orders placed through the API.
The API can be used to print by source URL, pretty much like our print button, but is also capable of merging variable data with pre-fabricated templates. This is useful to create personalized products that are based on the same design.
Last but not least, the API can be used in conjunction with the print button. It allows customers to order products based on source files that are not there yet. So, you can create source files asynchronously and tell us when they are ready.

The service fee for the Simple Print API is charged only after a 30 day trial period, so you can launch your app without charge. You will notice that our test environment (a sandbox that is almost a clone of production - do not forget to register again) does not charge a monthly fee, so you can build and test without it.
For all paid plans, the following applies.
In order to pay for orders through the Simple Print API, you need prepaid credit. You can buy this through your dashboard. The prepaid credit is yours. In your own app, you can collect the consumer payments and charge whatever you like. For every order that you place through the API, we subtract the wholesale price from your prepaid credit before commencing with the order.
We do this, so we can allow anyone to use the API without doing a thorough credibility check and such. It makes everything simpler.
Display the list of available offerings for a certain merchant and application.
| Parameter | Required | Explanation |
|---|---|---|
| applicationApiKey | yes | Unique string identifier of the application |
| merchantApiKey | yes | Unique string identifier of the merchant |
| currencies | no | Express offering prices in various currencies. ALL returns all available currencies. |
curl -v "http://www.peecho.com/rest/offering/list?applicationApiKey={yourApplicationApiKey}&merchantApiKey={yourMerchantApiKey}" A list of offering details of the following structure:
<?xml version="1.0"?> <root> <pricingExpireDate>2011-09-13T16:00:00.000+02:00</pricingExpireDate> <offerings> <offering> <id>1</id> <price>1.00</price> <countryShippingPrice>0.00</countryShippingPrice> <regionShippingPrice>0.00</regionShippingPrice> <worldShippingPrice>0.00</worldShippingPrice> <pricePerPage>1.00</pricePerPage> <name>boek a5</name> <downloadLocation>http://cloud.peecho.com/1/</downloadLocation> <currency>EUR</currency> <priceByCurrency> <value amount="1.00" currency="EUR"/> <value amount="1.37" currency="USD"/> </priceByCurrency> <pricePerPageByCurrency> <value amount="0.00" currency="EUR"/> <value amount="0.00" currency="USD"/> </pricePerPageByCurrency> <countryShippingPriceByCurrency> <value amount="0.00" currency="EUR"/> <value amount="0.00" currency="USD"/> </countryShippingPriceByCurrency> <regionShippingPriceByCurrency> <value amount="0.00" currency="EUR"/> <value amount="0.00" currency="USD"/> </regionShippingPriceByCurrency> <worldShippingPriceByCurrency> <value amount="0.00" currency="EUR"/> <value amount="0.00" currency="USD"/> </worldShippingPriceByCurrency> <vatPercentage>19</vatPercentage> <defaultNumberOfPages>12</defaultNumberOfPages> <minNumberOfPages>0</minNumberOfPages> <maxNumberOfPages>100</maxNumberOfPages> <dimensionWidth>0</dimensionWidth> <dimensionHeight>0</dimensionHeight> <minimumQuantity>1</minimumQuantity> <addShipping>true</addShipping> <recommended>false</recommended> <dimensionUnit>mm</dimensionUnit> <elements> <id>1</id> <name>content</name> <url/> </elements> <elements> <id>2</id> <name>cover</name> <url>cover</url> </elements> <catalogueItemCode>boek a5</catalogueItemCode> <merchantApiKey>your-merchant-api-key</merchantApiKey> <applicationApiKey>your-application-api-key</applicationApiKey> <fixedSize>false</fixedSize> </offering> </offerings> </root>
Display a filtered list of available offerings for a certain application.
| Parameter | Required | Explanation |
|---|---|---|
| applicationApiKey | yes | Unique string identifier of the application |
| numberOfPages | yes | Filters the available offerings based on minimum and maximum number of pages needed to print the document. |
| fileType | yes | Should be PDF, JPG, JPEG, GIF, or PNG. When specifying PDF the width and height are in mm, otherwise it is in pixels. |
| width | no | Filters the available offerings based on size and aspect ratio. You should set both width and height when using this. |
| height | no | Filters the available offerings based on size and aspect ratio. You should set both width and height when using this. |
| recipientCountry | no | Filters the available offerings based on the recipient country. Not all products can be send to all countries. Use this to know for sure we can send to order to the recipient country. |
| currencies | no | Express offering prices in various currencies. ALL returns all available currencies. |
curl -v "http://www.peecho.com/rest/offering/list/filtered?applicationApiKey={yourApplicationApiKey}&numberOfPages=40&fileType=PDF" The response is exactly the same to the response for /rest/offering/list
<?xml version="1.0"?> <root> <pricingExpireDate>2011-09-13T16:00:00.000+02:00</pricingExpireDate> <offerings> <offering> <id>1</id> <price>1.00</price> <countryShippingPrice>0.00</countryShippingPrice> <regionShippingPrice>0.00</regionShippingPrice> <worldShippingPrice>0.00</worldShippingPrice> <pricePerPage>1.00</pricePerPage> <name>boek a5</name> <downloadLocation>http://cloud.peecho.com/1/</downloadLocation> <currency>EUR</currency> <priceByCurrency> <value amount="1.00" currency="EUR"/> <value amount="1.37" currency="USD"/> </priceByCurrency> <pricePerPageByCurrency> <value amount="0.00" currency="EUR"/> <value amount="0.00" currency="USD"/> </pricePerPageByCurrency> <countryShippingPriceByCurrency> <value amount="0.00" currency="EUR"/> <value amount="0.00" currency="USD"/> </countryShippingPriceByCurrency> <regionShippingPriceByCurrency> <value amount="0.00" currency="EUR"/> <value amount="0.00" currency="USD"/> </regionShippingPriceByCurrency> <worldShippingPriceByCurrency> <value amount="0.00" currency="EUR"/> <value amount="0.00" currency="USD"/> </worldShippingPriceByCurrency> <vatPercentage>19</vatPercentage> <defaultNumberOfPages>12</defaultNumberOfPages> <minNumberOfPages>0</minNumberOfPages> <maxNumberOfPages>100</maxNumberOfPages> <dimensionWidth>0</dimensionWidth> <dimensionHeight>0</dimensionHeight> <minimumQuantity>1</minimumQuantity> <addShipping>true</addShipping> <recommended>false</recommended> <dimensionUnit>mm</dimensionUnit> <elements> <id>1</id> <name>content</name> <url/> </elements> <elements> <id>2</id> <name>cover</name> <url>cover</url> </elements> <catalogueItemCode>boek a5</catalogueItemCode> <merchantApiKey>your-merchant-api-key</merchantApiKey> <applicationApiKey>your-application-api-key</applicationApiKey> <fixedSize>false</fixedSize> </offering> </offerings> </root>
Create a new order.
| Parameter | Required | Explanation |
|---|---|---|
| merchantApiKey | yes | Unique string identifier of the merchant |
| offeringId | yes | Unique integer identifier of your offering |
| emailAddress | no | Customer email address for order reference |
| merchantReference | no | Use your own internal id as a reference to couple this order to your internal systems |
| paymentReference | no | Reference for the payment provider, this should be a globally unique identifier. Use UUID |
| title | no | The on-screen title of the document visible in the admin panels |
| locale | no | The locale of the end customer. E-mails send from our systems will be in this language. Defaults to en_EN |
| currency | no | The currency used to pay with. Defaults to EUR |
curl -v -d "merchantApiKey={yourApiKey}&offeringId={yourOfferingId}" "http://www.peecho.com/rest/order" An XML representation of the new order including the policy and signature to be used when sending files to the order bucket.
<?xml version="1.0"?> <order> <externalOrderId>4194</externalOrderId> <signedPutUrl>http://peecho-test-order.s3.amazonaws.com</signedPutUrl> <signedPutPath>1/4194/</signedPutPath> <base64EncodedPolicy>encoded-policy </base64EncodedPolicy> <signature>3XRuQ96XNs10porjx30=</signature> <apiVersion>0</apiVersion> <id>4194</id> <orderState>OPEN</orderState> <quantity>1</quantity> </order>
Create a new order based on a source document (either PDF or image).
| Parameter | Required | Explanation |
|---|---|---|
| merchantApiKey | yes | Unique string identifier of the merchant |
| offeringId | yes | Unique integer identifier of your offering |
| numberOfPages | yes | The total number of pages in the source document including cover pages. |
| sourceUrl | yes | The full URL to the source document |
| sourceWidth | yes | The width in mm of the source PDF document |
| sourceHeight | yes | The height in mm of the source PDF document |
| filetype | no | The filetype of the source document, can be either PDF or IMAGE. Defaults to PDF |
| merchantReference | no | Use your own internal id as a reference to couple this order to your internal systems |
| paymentReference | no | Reference for the payment provider, this should be a globally unique identifier. Use UUID |
| title | no | The on-screen title of the document visible in the admin panels |
| locale | no | The locale of the end customer. E-mails send from our systems will be in this language. Defaults to en_EN |
| currency | no | The currency used to pay with. Defaults to EUR |
curl -v -d "merchantApiKey={yourMerchantApiKey}&offeringId=70&numberOfPages=40&sourceUrl=https://dl.dropboxusercontent.com/u/5278037/mediamarkt.pdf&sourceWidth=245&sourceHeight=220" "http://www.peecho.com/rest/order/create_from_source_url" An XML representation of the new order including the policy and signature to be used when sending files to the order bucket.
<?xml version="1.0"?> <order> <externalOrderId>4194</externalOrderId> <signedPutUrl>http://peecho-test-order.s3.amazonaws.com</signedPutUrl> <signedPutPath>1/4194/</signedPutPath> <base64EncodedPolicy>encoded-policy </base64EncodedPolicy> <signature>3XRuQ96XNs10porjx30=</signature> <apiVersion>0</apiVersion> <id>4194</id> <orderState>OPEN</orderState> <quantity>1</quantity> </order>
Supply additional details about an order, such as the customer shipping address and quantity.
| Parameter | Required | Explanation |
|---|---|---|
| externalOrderId | yes | Unique external string identifying the order |
| shippingAddressXml | yes | XML representation of the shipping address |
| emailAddress | yes | Customer email address. Used for order status updates and customer support |
| customerName | no | Name of the customer |
| quantity | no | Number of copies requested. Defaults to 1 |
The shipping address must have the following structure:
<?xml version="1.0"?> <address> <firstName>recipientFirstName</firstName> <lastName>recipientLastName</lastName> <addressLine1>shippingAddressLine1</addressLine1> <addressLine2>shippingAddressLine2</addressLine2> <zipCode>shippingZipCode</zipCode> <city>shippingCity</city> <country>Netherlands</country> <countryCode>NL</countryCode> </address>
curl -v -d "externalOrderId={externalOrderId}&emailAddress=marcel@peecho.com&shippingAddressXml=<?xml version='1.0'?><address><firstName>recipientFirstName</firstName><lastName>recipientLastName</lastName><addressLine1>shippingAddressLine1</addressLine1><addressLine2>shippingAddressLine2</addressLine2><zipCode>shippingZipCode</zipCode><city>shippingCity</city><country>Netherlands</country><countryCode>NL</countryCode></address>" "http://www.peecho.com/rest/order/details" If all went well this service only response with the string 'OK'.
Mark an order as PAID. This is useful for Peecho customers who handle the customer payment themselves.
| Parameter | Required | Explanation |
|---|---|---|
| externalOrderId | yes | Unique external string identifying the order |
| merchantApiKey | yes | Unique string identifier of the merchant |
| secret | yes | Base64 encoded HMAC SHA1 Hash of merchantApiKey + externalOrderId using your merchantSecretKey as HMAC-key |
curl -v -d "externalOrderId={yourExternalOrderId}&merchantApiKey={yourMerchantApiKey}&secret={generatedSecretHash}" "http://www.peecho.com/rest/order/set_paid" String secretKey = "merchantSecretKey";
String merchantApiKey = "merchantApiKey";
String externalOrderId = "1234";
String data = merchantApiKey + externalOrderId;
Mac m = Mac.getInstance("HmacSHA1");
m.init(new SecretKeySpec(secretKey.getBytes("UTF-8"), "HmacSHA1"));
byte[] hash = m.doFinal(data.getBytes("UTF-8"));
String secret = new String(Base64.encodeBase64(hash));
/*
You get as result: LmzDnZGhdSI3D3aWXrQNcY0GDqI=
(using org.apache.commons.codec.binary for base64 and javax.crypto for Mac).
*/ This service either returns 'ERROR' or 'OK'.
Set the source URL of an order - only applicable for asynchronous source generation.
| Parameter | Required | Explanation |
|---|---|---|
| orderId | yes | The Peecho order id |
| sourceUrl | yes | The full public URL of the source document |
| merchantApiKey | yes | Your merchant public API key |
| secret | yes | Base64 encoded HMAC SHA1 Hash of externalOrderId + merchantReference + sourceUrl using your merchantSecretKey as HMAC-key. The merchantReference is a specified as a button-variable called 'data-reference' or specified in the order creation API call |
curl -v -d "orderId={yourExternalOrderId}&sourceUrl=https://dl.dropboxusercontent.com/u/5278037/mediamarkt.pdf&merchantApiKey={yourMerchantApiKey}&secret={generatedSecretHash}" "http://www.peecho.com/rest/order/set_source_url" String secretKey = "merchantSecretKey";
String externalOrderId = "1234";
String merchantReference = "merchantReference";
String sourceUrl = "http://somesourceurl.com/a.pdf"
String data = externalOrderId + merchantReference + sourceUrl;
Mac m = Mac.getInstance("HmacSHA1");
m.init(new SecretKeySpec(secretKey.getBytes("UTF-8"), "HmacSHA1"));
byte[] hash = m.doFinal(data.getBytes("UTF-8"));
String secret = new String(Base64.encodeBase64(hash));
/*
You get as result: MjavkJnEj5SrkHYWtO65KDWEw3M=
(using org.apache.commons.codec.binary for base64 and javax.crypto for Mac).
*/
This service either returns 'OK' or an error status.
Display the current order state.
| Parameter | Required | Explanation |
|---|---|---|
| paymentReference | yes | Globally unique identifier specified in the order creation API call |
| merchantApiKey | yes | Unique string Identifier of the merchant |
curl -v "http://www.peecho.com/rest/order/status?paymentReference={yourPaymentReference}&merchantApiKey={yourMerchantApiKey}" <?xml version="1.0"?>
<orderState>
<externalOrderId>4194</externalOrderId>
<paymentReference>payment reference</paymentReference>
<merchantReference>some reference</merchantReference>
<orderState>MODERATION</orderState>
<price>0.00</price>
<priceRetail>1.00</priceRetail>
<priceWholesale>1.00</priceWholesale>
<shippingRetail>0.00</shippingRetail>
<shippingWholesale>0.00</shippingWholesale>
<vat>0.00</vat>
<created>2011-09-27T14:25:54.000+02:00</created>
<quantity>1</quantity>
<title>title</title>
<shipping>
<firstName>John</firstName>
<lastName>Doe</lastName>
<street>42 first street</street>
<zipCode>11111</zipCode>
<city>New York</city>
<state>NY</state>
<countryCode>US</countryCode>
<country>United States</country>
</shipping>
<history>
<historyEntry>
<entryDate>2013-04-24T12:53:13.000+02:00</entryDate>
<why>set_paid rest api call</why>
<state>PAID</state>
</historyEntry>
<historyEntry>
<entryDate>2013-04-24T13:06:46.000+02:00</entryDate>
<state>MODERATION</state>
</historyEntry>
</history>
</orderState>