PrintNowPrintNowDocs

Webhooks

Get notified when orders and customers change, instead of polling. Subscribe a URL to an event and PrintNow POSTs the changed order or customer to it each time the event happens. This is also how the Zapier integration works.

Events

EventFires whenPayload
order_createdAn order is placed on a storefront.Order
order_updatedAn order changes in the storefront, the admin or the API: for example its status, shipping or items.Order
order_deletedAn order is deleted in the admin.Order (its last state)
customer_createdA customer account is created: storefront registration, the admin, the API, or a guest converted to an account.Customer
customer_updatedA customer's profile changes in the storefront, the admin or the API.Customer
customer_deletedA customer is deleted through the API.Customer (its last state)

Deliveries

Each delivery is an HTTP POST to your target_url with Content-Type: application/json. The body is a JSON array holding one object: the order or customer in exactly the shape the Get Order and Get Customer endpoints return, so the same parsing works for both. The callbacks on the subscribe endpoint document each event's payload.

  • Answer with any 2xx status to acknowledge the delivery.
  • Answer 410 Gone to unsubscribe: PrintNow removes the subscription. (Zapier uses this when a Zap is turned off.)
  • Your endpoint must be reachable from PrintNow. Firewalls are the most common reason deliveries don't arrive.

PrintNow's outgoing addresses

If your endpoint sits behind a firewall or VPN, allow these addresses. The list can change as PrintNow's infrastructure grows; contact PrintNow Support if you need it confirmed.

20.112.217.23020.112.218.6120.112.218.12320.112.219.45
20.112.217.24020.112.218.7820.112.218.12620.112.219.47
20.112.217.24920.112.218.8020.112.218.14820.112.219.51
20.112.217.25320.112.218.9320.112.218.15020.112.219.52
20.112.218.1720.112.218.11320.112.218.15220.112.219.54
20.112.218.3020.112.218.11720.112.218.20420.112.219.73
20.112.218.3820.112.218.11820.112.219.3620.118.56.5
20.112.218.5720.112.218.12020.112.219.4052.189.72.76

Subscriptions belong to an API key

Subscriptions are created, listed and removed per API key: each key sees and manages only its own. A target URL can be subscribed once per key, so use a different URL for each event you subscribe to.

Deactivating or deleting an API key (in the admin's Settings > API Keys) stops its subscriptions' deliveries. Reactivating the key resumes them.

Lifecycle

  1. Subscribe: POST /api/v2/hooks with target_url and event. The response holds the subscription's id.
  2. Receive deliveries and answer 2xx.
  3. Unsubscribe: DELETE /api/v2/hooks/{id}, or answer a delivery with 410 Gone.

List webhook subscriptions

GET
/api/v2/hooks
AuthorizationBasic <token>

Your API token as the username and your API key as the password.

In: header

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://api.printnow.com/api/v2/hooks"
[
  {
    "id": 1,
    "target_url": "https://www.domain.com/new-customer",
    "event": "customer_created"
  },
  {
    "id": 2,
    "target_url": "https://www.domain.com/new-order",
    "event": "order_created"
  }
]

The key or token is missing, does not match, or the token is inactive or deleted.

{
  "Message": "Invalid key or token."
}

The message names the section, e.g. Orders, Customers, Products, Storefronts, Reports or Webhooks.

{
  "Message": "Your license does not include the Orders API."
}

Each license may make 100 calls per 10 seconds across all its API keys. Wait for the Retry-After header (seconds) before calling again.

{
  "Message": "Rate limit exceeded: 100 calls per 10 seconds."
}

Subscribe a URL to an event

POST
/api/v2/hooks
AuthorizationBasic <token>

Your API token as the username and your API key as the password.

In: header

Request Body

application/json

The target URL and the event.

target_url?|

Required. The URL PrintNow POSTs the events to. It must be reachable from PrintNow; IP addresses in private, loopback or link-local ranges are refused.

event?|

Required. The event to subscribe to: order_created, order_updated, order_deleted, customer_created, customer_updated or customer_deleted.

[key: string]?never

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.printnow.com/api/v2/hooks" \  -H "Content-Type: application/json" \  -d '{    "target_url": "https://www.domain.com/callback1.aspx",    "event": "order_created"  }'
{
  "id": 6,
  "target_url": "https://www.domain.com/callback.aspx",
  "event": "order_created"
}
{
  "Message": "Event name is invalid."
}

The key or token is missing, does not match, or the token is inactive or deleted.

{
  "Message": "Invalid key or token."
}

The message names the section, e.g. Orders, Customers, Products, Storefronts, Reports or Webhooks.

{
  "Message": "Your license does not include the Orders API."
}
{
  "Message": "Target url already exists."
}

Each license may make 100 calls per 10 seconds across all its API keys. Wait for the Retry-After header (seconds) before calling again.

{
  "Message": "Rate limit exceeded: 100 calls per 10 seconds."
}

Unsubscribe

DELETE
/api/v2/hooks/{id}
AuthorizationBasic <token>

Your API token as the username and your API key as the password.

In: header

Path Parameters

id*integer

Subscription id, from the subscribe response or the list.

Formatint64

Response Body

application/json

application/json

application/json

application/json

curl -X DELETE "https://api.printnow.com/api/v2/hooks/0"
Empty

The key or token is missing, does not match, or the token is inactive or deleted.

{
  "Message": "Invalid key or token."
}

The message names the section, e.g. Orders, Customers, Products, Storefronts, Reports or Webhooks.

{
  "Message": "Your license does not include the Orders API."
}
{
  "Message": "Hook not found."
}

Each license may make 100 calls per 10 seconds across all its API keys. Wait for the Retry-After header (seconds) before calling again.

{
  "Message": "Rate limit exceeded: 100 calls per 10 seconds."
}

On this page