About the Printful API

The Printful API is a RESTful API, that uses a HTTP protocol for communication. HTTP GET, POST, PUT and DELETE methods are used to access the API.

How to start

To begin using Printful API, follow these steps:
• Go to Settings → Stores
• Select the store you would like to connect by clicking Edit
• Click the “Add API Access” button
• Enter your website URL & get your unique API Key

API key

The API key is a secret key unique to each store that is used to access the API. You can enable the API and generate an API key for your store in the store settings page.

Keep the API key in secret, and never expose it in any public website's client-side code.

Authentication

Some API requests (like the Product catalog and Country codes) are available without an API key, but for majority of requests you will need to authenticate your store.

Printful uses HTTP basic authentication for the API requests.

To perform authorization, you need to add the Authorization header with a Base64 encoded API key when performing a request. So if the API key is vv0gtldg-1d7v-qclq:e2vv-lmhg676ak0z1, then you need to add this header to the API request:

Authorization: Basic dnYwZ3RsZGctMWQ3di1xY2xxOmUydnYtbG1oZzY3NmFrMHox

Request endpoint

All API requests have to be sent to this URL:

https://api.printful.com/

Connecting by HTTP is available as well, but for security reasons, use of HTTPS is highly recommended.

Request parameters

Some mandatory parameters (like object identifiers) must be included in the request URL path:

GET /orders/123

Additional parameters can be passed as GET variables:

GET /orders?offset=10&limit=5

For POST and PUT requests, a more complex data structure can be passed as JSON encoded data in the request body:

POST /orders

{"recipient":{...},"items":[...]}

Response body

The response body is always a JSON object that contains a response status code (identical to the HTTP status code) and the result of the action. If the status code is 200, then the action was successful.

{
   "code": 200, //Response status code
   "result":{
      //API method return data
	  //...
   }
}

Sometimes the response includes paging information to allow to browse larger result sets by adding offset and limit GET parameters to the request URL.

{
   "code": 200, //Response status code
   "result":[
	   {
	      //Item 11
	   },
	   {
	      //Item 12
	   }
   ]
   "paging": {
      "total": 12,  //Total items available
      "offset": 10, //Items skipped from the beginning
      "limit": 20   //Number of items per page
   }
}

Error response

If the API call is not successful, then the response code is not in the 2xx range and the result attribute contains an error description.

{
   "code": 404, //Response status code
   "result":"Item not found" //Error text
}

In general, response codes in the 4xx range indicate an error that resulted from the provided information (e.g. a required parameter was missing, etc.), and codes in the 5xx range indicate an error with Printful's servers.

Timestamps

All timestamps from the API are returned as integers in UNIX timestamp format.

Ready to try Printful ?

Get Me Started

Printing is what we do best.

Trusted to print 1 395 065 shirts since 2013