NAV Navbar
Logo
http json

Overview

The PrintNow API is a REST based web service designed to facilitate communication between PrintNow and an external system. The API supports the ability to allow external system to hook specific events for near real-time updates for order and customer data.

The PrintNow API endpoint is https://api.printnow.com.

Authentication

The Authorize HTTP header should appear like:

Authorization: Basic abc123

All requests to the PrintNow API require the use of your api token and key to authenticate. Your API token and key can be generated/retrieved with in Admin Tools under Storefront > PrintNow API. Request authentication uses HTTP basic authentication in combination with HTTPS.

Orders

GET api/v1/order/{orderId}

Example request:

POST /api/v1/order/46
Authorization: Basic QVBJX1RPS0VOOkFQSV9LRVk=
Content-Type: application/json

Example response:

200 OK

{  
    "storefront":"Demo Store",
    "id":46,
    "is_archived":false,
    "is_deleted":true,
    "status":"Starting Status",
    "customer":{  
        "storefront":"Demo Store",
        "id":24,
        "first_name":"Demo",
        "last_name":"User",
        "email":"demouser@domain.com",
        "username":"demouser",
        "receive_marketing_emails":false,
        "last_logged_in_on":"2017-04-14T18:33:41.8Z",
        "created_on":"2012-02-03T15:29:12.157Z",
        "last_updated_on":"2017-04-10T04:00:00Z",
        "company":"PrintNow Technologies, Inc."
    },
    "shipping_address":{  
        "id":1,
        "name":"Default",
        "company":"",
        "first_name":"Demo",
        "last_name":"User",
        "line_1":"123 Main St.",
        "line_2":"Apt. B1",
        "line_3":null,
        "line_4":null,
        "city":"Springfield",
        "state":"MA",
        "postal_code":"01103",
        "phone":"555-555-5555",
        "email":"demouser@domain.com",
        "country_code":"US",
        "is_residential":true
    },
    "billing_address":{  
        "id":1,
        "name":"Default",
        "company":"",
        "first_name":"Demo",
        "last_name":"User",
        "line_1":"123 Main St.",
        "line_2":"Apt. B1",
        "line_3":null,
        "line_4":null,
        "city":"Springfield",
        "state":"MA",
        "postal_code":"01103",
        "phone":"555-555-5555",
        "email":"demouser@domain.com",
        "country_code":"US",
        "is_residential":true
    },
    "payment_creditcard":false,
    "payment_check":false,
    "payment_cod":false,
    "payment_po":true,
    "payment_invoice":false,
    "po_number":"333",
    "invoice_number":null,
    "tax_total":0,
    "shipping_total":16.55,
    "sub_total":18,
    "promotion_total":0,
    "promotion_code":null,
    "created_on":"2012-04-18T18:27:08.153Z",
    "shipped_on":null,
    "shipping_provider":"UPS",
    "shipping_service":"UPS Ground",
    "items":[  
        {  
            "id":47,
            "sub_total":18,
            "created_on":"2012-04-18T18:26:33.907Z",
            "status":"Starting Status",
            "quantity":10,
            "due_on":null,
            "weight":12,
            "base_price":8,
            "options_price":10,
            "markup_price":0,
            "image_fee":0,
            "download_fee":0,
            "integration_id":null,
            "product_id":12,
            "item_number":null,
            "model_number":null,
            "name":"Corporate Card",
            "vendor":null,
            "options":[  
                {  
                    "name":"Color",
                    "value":"Full Color",
                    "option_integration_id":null,
                    "value_integration_id":null
                },
                {  
                    "name":"Size",
                    "value":"3.5\" × 2\"",
                    "option_integration_id":null,
                    "value_integration_id":null
                },
                {  
                    "name":"Turnaround",
                    "value":"Economy",
                    "option_integration_id":null,
                    "value_integration_id":null
                },
                {  
                    "name":"Authenticity",
                    "value":"Real",
                    "option_integration_id":null,
                    "value_integration_id":null
                }
            ],
            "notes":null
        }
    ]
}
{  
    "storefront":"Demo Store",
    "id":46,
    "is_archived":false,
    "is_deleted":true,
    "status":"Starting Status",
    "customer":{  
        "storefront":"Demo Store",
        "id":24,
        "first_name":"Demo",
        "last_name":"User",
        "email":"demouser@domain.com",
        "username":"demouser",
        "receive_marketing_emails":false,
        "last_logged_in_on":"2017-04-14T18:33:41.8Z",
        "created_on":"2012-02-03T15:29:12.157Z",
        "last_updated_on":"2017-04-10T04:00:00Z",
        "company":"PrintNow Technologies, Inc."
    },
    "shipping_address":{  
        "id":1,
        "name":"Default",
        "company":"",
        "first_name":"Demo",
        "last_name":"User",
        "line_1":"123 Main St.",
        "line_2":"Apt. B1",
        "line_3":null,
        "line_4":null,
        "city":"Springfield",
        "state":"MA",
        "postal_code":"01103",
        "phone":"555-555-5555",
        "email":"demouser@domain.com",
        "country_code":"US",
        "is_residential":true
    },
    "billing_address":{  
        "id":1,
        "name":"Default",
        "company":"",
        "first_name":"Demo",
        "last_name":"User",
        "line_1":"123 Main St.",
        "line_2":"Apt. B1",
        "line_3":null,
        "line_4":null,
        "city":"Springfield",
        "state":"MA",
        "postal_code":"01103",
        "phone":"555-555-5555",
        "email":"demouser@domain.com",
        "country_code":"US",
        "is_residential":true
    },
    "payment_creditcard":false,
    "payment_check":false,
    "payment_cod":false,
    "payment_po":true,
    "payment_invoice":false,
    "po_number":"333",
    "invoice_number":null,
    "tax_total":0,
    "shipping_total":16.55,
    "sub_total":18,
    "promotion_total":0,
    "promotion_code":null,
    "created_on":"2012-04-18T18:27:08.153Z",
    "shipped_on":null,
    "shipping_provider":"UPS",
    "shipping_service":"UPS Ground",
    "items":[  
        {  
            "id":47,
            "sub_total":18,
            "created_on":"2012-04-18T18:26:33.907Z",
            "status":"Starting Status",
            "quantity":10,
            "due_on":null,
            "weight":12,
            "base_price":8,
            "options_price":10,
            "markup_price":0,
            "image_fee":0,
            "download_fee":0,
            "integration_id":null,
            "product_id":12,
            "item_number":null,
            "model_number":null,
            "name":"Corporate Card",
            "vendor":null,
            "options":[  
                {  
                    "name":"Color",
                    "value":"Full Color",
                    "option_integration_id":null,
                    "value_integration_id":null
                },
                {  
                    "name":"Size",
                    "value":"3.5\" × 2\"",
                    "option_integration_id":null,
                    "value_integration_id":null
                },
                {  
                    "name":"Turnaround",
                    "value":"Economy",
                    "option_integration_id":null,
                    "value_integration_id":null
                },
                {  
                    "name":"Authenticity",
                    "value":"Real",
                    "option_integration_id":null,
                    "value_integration_id":null
                }
            ],
            "notes":null
        }
    ]
}

Retrieve an order

Parameters

Parameter Description
orderId Id of order

GET api/v1/order/{orderId}/download

Example request:

GET /api/v1/order/46/download
Authorization: Basic QVBJX1RPS0VOOkFQSV9LRVk=
Content-Type: application/json

Example response:

200 OK
Content-Length: 1890711
Content-Type: application/zip
Content-Disposition: attachment; filename=order-46.zip

[binary content body]

Download an order. Entire order will be returned as a zip file.

Parameters

Parameter Description
orderId Id of order

GET api/v1/order/{orderId}/download/{itemId}

Example request:

GET /api/v1/order/46/download/90
Authorization: Basic QVBJX1RPS0VOOkFQSV9LRVk=
Content-Type: application/json

Example response:

200 OK
Content-Length: 586
Content-Type: application/zip
Content-Disposition: attachment; filename=item-90.zip

[binary content body]

Download an individual order item. Item will be returned as a zip file.

Parameters

Parameter Description
orderId Id of order
itemId Id of item

Customers

GET api/v1/customer/{customerId}

Example request:

GET /api/v1/customer/24
Authorization: Basic QVBJX1RPS0VOOkFQSV9LRVk=
Content-Type: application/json

Example response:

200 OK

{  
    "storefront":"Demo Store",
    "id":24,
    "first_name":"Demo",
    "last_name":"User",
    "email":"demouser@domain.com",
    "username":"demouser",
    "receive_marketing_emails":false,
    "last_logged_in_on":"2017-04-14T18:33:41.8Z",
    "created_on":"2012-02-03T15:29:12.157Z",
    "last_updated_on":"2017-04-10T04:00:00Z",
    "company":"PrintNow Technologies, Inc."
}
{  
    "storefront":"Demo Store",
    "id":24,
    "first_name":"Demo",
    "last_name":"User",
    "email":"demouser@domain.com",
    "username":"demouser",
    "receive_marketing_emails":false,
    "last_logged_in_on":"2017-04-14T18:33:41.8Z",
    "created_on":"2012-02-03T15:29:12.157Z",
    "last_updated_on":"2017-04-10T04:00:00Z",
    "company":"PrintNow Technologies, Inc."
}

Retrieve customer info

Parameters

Parameter Description
customerId Id of customer

Products

GET api/v1/product/{productId}/renderings

Example request:

GET /api/v1/product/36/renderings
Authorization: Basic QVBJX1RPS0VOOkFQSV9LRVk=
Content-Type: application/json

Example response:

200 OK

[
    {
        "id": 25,
        "name": "Primary view"
    },
    {
        "id": 26,
        "name": "Secondary view"
    },
    {
        "id": 27,
        "name": "Extra view"
    }
]
[
    {
        "id": 25,
        "name": "Primary view"
    },
    {
        "id": 26,
        "name": "Secondary view"
    },
    {
        "id": 27,
        "name": "Extra view"
    }
]

Retrieve a list of photo merge renderings for a product.

Parameters

Parameter Description
productId Id of product/project

GET api/v1/product/{productId}/renderings/{renderingId}

Example request:

GET /api/v1/product/36/renderings/25
Authorization: Basic QVBJX1RPS0VOOkFQSV9LRVk=
Content-Type: application/json

Example response:

200 OK
Content-Length: 711
Content-Type: image/png
Content-Disposition: attachment; filename=Primary-view.png

[binary content body]

Download a specific product rendering.

Parameters

Parameter Description
productId Id of product/project
renderingId Id of rendering

Punch In/Out

POST api/v1/pipo/user/convert

Example request:

POST /api/v1/pipo/user/convert
Authorization: Basic QVBJX1RPS0VOOkFQSV9LRVk=
Content-Type: application/json
X-PN-TOKEN: a3ac7ca140

{
  "username": "demo",
  "password": "pass1234",
  "email": "demo@domain.com",
  "first_name": "demo",
  "last_name": "user",
  "storefront_id": 1
}
{
  "username": "demo",
  "password": "pass1234",
  "email": "demo@domain.com",
  "first_name": "demo",
  "last_name": "user",
  "storefront_id": 1
}

Example response:

200 OK

Convert a temporary user account into a normal account.

Parameters

Parameter Description
username username of target user
password password of target user
email email address of target user
first_name first name of target user
last_name last name of target user
storefront_id target storefront id

POST api/v1/pipo/user/create

Example request:

POST /api/v1/pipo/user/create
Authorization: Basic QVBJX1RPS0VOOkFQSV9LRVk=
Content-Type: application/json

{
  "username": "demo",
  "password": "pass1234",
  "email": "demo@domain.com",
  "first_name": "demo",
  "last_name": "user",
  "storefront_id": 1
}
{
  "username": "demo",
  "password": "pass1234",
  "email": "demo@domain.com",
  "first_name": "demo",
  "last_name": "user",
  "storefront_id": 1
}

Example response:

200 OK

Create a new user account.

Parameters

Parameter Description
username username of target user
password password of target user
email email address of target user
first_name first name of target user
last_name last name of target user
storefront_id target storefront id

POST api/v1/pipo/user/createtemp

Example request:

POST /api/v1/pipo/user/createtemp
Authorization: Basic QVBJX1RPS0VOOkFQSV9LRVk=
Content-Type: application/json

{
  "storefront_id": 1
}
{
  "storefront_id": 1
}

Example response:

200 OK

Create a new temporary user account.

Parameters

Parameter Description
storefront_id target storefront id

GET api/v1/pipo/user/info

Example request:

GET /api/v1/pipo/user/info
Authorization: Basic QVBJX1RPS0VOOkFQSV9LRVk=
Content-Type: application/json
X-PN-TOKEN: a3ac7ca140

Example response:

200 OK
{
  "id": 1234,
  "username": "demouser",
  "first_name": "John",
  "last_name": "Doe",
  "is_temp": false
}
{
  "id": 1234,
  "username": "demouser",
  "first_name": "John",
  "last_name": "Doe",
  "is_temp": false
}

Retrieve user account information.

POST api/v1/pipo/user/info

Example request:

POST /api/v1/pipo/user/createtemp
Authorization: Basic QVBJX1RPS0VOOkFQSV9LRVk=
Content-Type: application/json
X-PN-TOKEN: a3ac7ca140

{
  "current_password":"pass1234",
  "new_password": "4321pass",
  "first_name": "John",
  "last_name": "Doe"
}
{
  "current_password":"pass1234",
  "new_password": "4321pass",
  "first_name": "John",
  "last_name": "Doe"
}

Example response:

200 OK

Update user account information.

Parameters

Parameter Description
current_password (optional) current password of target user
new_password (optional) new password for target user
first_name (optional) new first name for target user
last_name (optional) new last name for target user

GET api/v1/pipo/user/istemp

Example request:

GET /api/v1/pipo/user/istemp
Authorization: Basic QVBJX1RPS0VOOkFQSV9LRVk=
Content-Type: application/json
X-PN-TOKEN: a3ac7ca140

Example response:

200 OK

false
false

Determine if a user account is temporary. Response will be a boolean value.

GET api/v1/pipo/user/loggedin

Example request:

GET /api/v1/pipo/user/loggedin
Authorization: Basic QVBJX1RPS0VOOkFQSV9LRVk=
Content-Type: application/json
X-PN-TOKEN: a3ac7ca140

Example response:

200 OK

true
true

Determine if a user is still logged in. Response will be a boolean value.

POST api/v1/pipo/user/login

Example request:

POST /api/v1/pipo/user/login
Authorization: Basic QVBJX1RPS0VOOkFQSV9LRVk=
Content-Type: application/json

{
  "username": "demo",
  "password": "pass1234",
  "storefront_id": 1
}
{
  "username": "demo",
  "password": "pass1234",
  "storefront_id": 1
}

Example response:

200 OK

"a3ac7ca1408a45f7bef79ef74e925aeca20d8894bc0840dcb8b762c7d970bbc2"
"a3ac7ca1408a45f7bef79ef74e925aeca20d8894bc0840dcb8b762c7d970bbc2"

Login a user. Response will be a user token string value.

Parameters

Parameter Description
username username of target user
password password of target user
storefront_id target storefront id

GET api/v1/pipo/user/logout

Example request:

GET /api/v1/pipo/user/logout
Authorization: Basic QVBJX1RPS0VOOkFQSV9LRVk=
Content-Type: application/json
X-PN-TOKEN: a3ac7ca140

Example response:

200 OK

Log a user out.

POST api/v1/pipo/user/transfer

Example request:

POST /api/v1/pipo/user/transfer
Authorization: Basic QVBJX1RPS0VOOkFQSV9LRVk=
Content-Type: application/json
X-PN-TOKEN: a3ac7ca140

{
  "username": "demo",
  "password": "pass1234"
}
{
  "username": "demo",
  "password": "pass1234"
}

Example response:

200 OK

Transfer a temporary user account into an existing normal account.

Parameters

Parameter Description
username username of target user
password password of target user

GET api/v1/pipo/project/{id}

Example request:

GET /api/v1/pipo/project/1234
Authorization: Basic QVBJX1RPS0VOOkFQSV9LRVk=
Content-Type: application/json
X-PN-TOKEN: a3ac7ca140

Example response:

200 OK

{
  "id": 1234,
  "name": "project name",
  "external_id": "h1254-z"
}
{
  "id": 1234,
  "name": "project name",
  "external_id": "h1254-z"
}

Retreive a specific user project by id.

Parameters

Parameter Description
id user project id

DELETE api/v1/pipo/project/{id}

Example request:

DELETE /api/v1/pipo/project/1234
Authorization: Basic QVBJX1RPS0VOOkFQSV9LRVk=
Content-Type: application/json
X-PN-TOKEN: a3ac7ca140

Example response:

200 OK

Delete a specific user project by id.

Parameters

Parameter Description
id user project id

GET api/v1/pipo/project/all

Example request:

GET /api/v1/pipo/project/all
Authorization: Basic QVBJX1RPS0VOOkFQSV9LRVk=
Content-Type: application/json
X-PN-TOKEN: a3ac7ca140

Example response:

200 OK

[
  {
    "id": 1234,
    "name": "project name",
    "external_id": "h1254-z"
  },
  {
    "id": 45,
    "name": "business card",
    "external_id": ""
  }
]
[
  {
    "id": 1234,
    "name": "project name",
    "external_id": "h1254-z"
  },
  {
    "id": 45,
    "name": "business card",
    "external_id": ""
  }
]

Retrieve a list of user projects.

GET api/v1/pipo/order/{id}/process

Example request:

GET /api/v1/pipo/order/1234/process
Authorization: Basic QVBJX1RPS0VOOkFQSV9LRVk=
Content-Type: application/json
X-PN-TOKEN: a3ac7ca140

Example response:

200 OK

Process and merge an order.

Parameters

Parameter Description
id PrintNow order id to process/merge

POST api/v1/pipo/order/create

Example request:

POST /api/v1/pipo/order/create
Authorization: Basic QVBJX1RPS0VOOkFQSV9LRVk=
Content-Type: application/json
X-PN-TOKEN: a3ac7ca140

{
  "product_id": [ 28, 37, 123 ],
  "external_id": "my external order id"
}
{
  "product_id": [ 28, 37, 123 ],
  "external_id": "my external order id"
}

Example response:

200 OK

1681
1681

Create an order. Reponse will contain a PrintNow order id integer value.

Parameters

Parameter Description
product_id array of customized PrintNow product ids
external_id a unique order identifier from a 3rd party system

Shopping Cart Return Url

The shopping cart return url can be specified in one of two different ways:

1) You can specify your return url via the cru query string parameter in the editor url. Ex: https://editor.domain.com/online-editor?epi=my-product&tpsc=1&cru=https%3A%2F%2Fwww.domain.com%2Fpick-options.aspx

2) You can specify your return url by adding javascript to the cms system on the editor page. The variable you’ll want to assign is window.cartReturnUrl. Ex: <script type="text/javascript">window.cartReturnUrl = 'https://www.domain.com/pick-options.aspx';</script>

In either case the newly created PrintNow product id will be passed along as a query string parameter called productid.


Online Editor Page

The online editor page has a number of parameters which may be passed via querystring. Below is a comprehensive list of those parameters:

Parameter Description
productid (optional) This is the product id as defined in the PrintNow system. It is only required if not using the epi parameter.
epi (optional) This parameter allows you to load a product based off of an ID in an external system. The value is specified in the Integration Id field when editing a product in Admin Tools. It is only required if not using productid.
tpsc (required) Third party shopping cart flag, it needs a value but the value is unimportant.
token (required) Punch In/Out token assigned via the API.
cru (optional) As discussed in the previous section you may choose to provide your return url with this parameter.
s (optional) This parameter allows you to specify a custom size for the template you are opening. It only applies to products which have custom sizing ability. The format for this value is w.ww,h.hh.

In addition to the above parameters you can also affect image items on a given template by supplying an image item tag name as a parameter. The value of the parameter dictates what type of interaction you will have.

Type Description
Hide/Show Using a boolean true/false value will show/hide the corresponding image layer in your template and the end-user will be unable to modify this. Ex: background-image=false will hide the background layer.
Swap Image Using an integer value you can pass in an image to be swapped in to the corresponding layer when your template loads. Ex: head_shot=1234 will swap the image with id 1234 in to the head_show image placeholder.
Colors For vector (svg) images you can specify a color mapping to modify colors when your template loads. Colors can be specified by either rgb hex code of the color assigned to your palette or by the color name you’ve assigned to the color in your palette. Ex: clipart=ffffff,Custom%20Red;000000,343536 will swap out white for a color named “Custom Red” and pure black to a lighter black. The format for the color map is color1_from,color1_to;color2_from,color2_to;color3_from,color3_to, a semi-colon separated dictionary of comma separated pairs.

These additional “item tag” parameters will be monitored by the editor and subsequently passed back in the cart return url with their updated values.


Product Thumbnail Urls

You can retrieve product or user project thumbnails by sending the correct parameters to the thumbnail url. Ex: https://editor.domain.com/productthumb.ashx?p=1234&w=200&h=200. The product thumbnail url also includes a number of options:

Parameter Description
p (required) Product id as defined in the PrintNow system.
w (optional) Width of thumbnail (integer).
h (optional) Height of thumbnail (integer).
b (optional) Hide/show border flag (boolean, default: true).
bw (optional) Border width (integer, default: 1).
bc (optional) Border color as hex string without leading “#” (string, default: 777777).
bm (optional) Border mode; 0 - border product, 1 - border entire thumbnail (integer, default: 0).
fm (optional) Fit mode; 0 - fit product to box, 1 - mask product to box, 2 - stretch to fit (integer, default: 0).
fwnb (optional) Force width no border. This will make the thumbnail proportional to the product dimensions and fit in width param supplied (boolean, default: true)


PDF Proof Download Urls

You can download low resolution pdf proofs by passing a token and product id to the download url. Ex: https://editor.domain.com/download.ashx?token=a1b2c3d4&pid=1234.

Parameter Description
token (required) Punch In/Out token assigned via the API.
pid (required) Product id as defined in the PrintNow system, or a user project id.

Hooks

POST api/v1/hooks

Example request:

POST /api/v1/hooks
Authorization: Basic QVBJX1RPS0VOOkFQSV9LRVk=
Content-Type: application/json

{
    "target_url": "https://www.domain.com/callback.aspx",
    "event": "order_created"
}
{
    "target_url": "https://www.domain.com/callback.aspx",
    "event": "order_created"
}

Example response:

200 OK

{
    "id": 1234
}
{
    "id": 1234
}

Create a webhook which is triggered by events in the PrintNow system.

Parameters

Parameter Description
target_url Target url for calling back when an event is triggered.
event Event name to trigger on.

DELETE api/v1/hooks/{id}

Example request:

DELETE /api/v1/hooks/1234
Authorization: Basic QVBJX1RPS0VOOkFQSV9LRVk=
Content-Type: application/json

Example response:

204 No Content

Remove a previously created webhook.

Parameters

Parameter Description
id Unique id of the target hook.

Event Hooks

Below is a list of supported event names: