API Best Practices
We sometimes get requests from print on demand companies who don't yet have APIs. We have extensive experience in connecting to APIs from hundreds of companies so we have a real sense for what works best and what doesn't. Regarding print on demand, here are a list of best practices we have put together for potential API builds:
- REST-based API with simple API key authentication in headers
- Error messages should be returned in a simple JSON format without multiple nested levels. HTTP status codes should be observed.
- One submission for entire order instead of multiple submissions for different parts of order
- Let us send our order number and an optional PO number
- Duplicate order number submissions should not be allowed
- Let us send a packing slip URL to be printed and included with the order
- Please provide us with a pre-selected list of shipping options or codes and we'll pass one with the order. We'll do the customer mapping on our side.
- Let us optionally send a third party shipping account number
- Each line item should have quantity, print url, your print SKU (a code for your product blank), as well as optional size and color as well as other configurations as needed.
- Let us send you a status notification url with each order. You'll send us a JSON post to that address with order updates and/or shipment notification. With the shipment notification we'd like to receive both the tracking number and the name of the carrier so we can build tracking links. You can also send us shipment method, weight, cost, and date shipped. If the webhook post fails, please try again at varying intervals.
- Provide an endpoint where we can request an order cancelation
- Provide an endpoint where we can request order status and tracking details manually
You can also review our print on demand integration specifications here.