Printcart API
Printcart API is a REST API that can be used to interact with data from your Printcart account. The Printcart API uses predictable resource-oriented URLs, standard HTTP verbs and response codes, and accepts and returns JSON-encoded request and response bodies.
Authentication
To keep your data on Printcart safe and secure, all integrations must authenticate when making API requests. This guide introduces the different methods of authenticating and authorizing integration with Printcart API.
There are 2 types of authentication in Printcart API:
- Basic HTTP Authentication
- UnAuth Token
Basic HTTP Authentication
This authentication type represents your Printcart dashboard admin privileges and can request to all Printcart API endpoints, so it is meant to use on server side only.
To keep them secure, do not share your username and password in publicly accessible areas such as GitHub, client-side code, and so forth.
To authenticate with HTTP, you may provide a username and password with the following URL format:
https://username:password@api.printcart.com/v1/your_desired_path
UnAuth Token
Some Printcart API endpoints don't need your username and password to authenticate. Those endpoints only interact with your public data so the code can be shared publicly.
To request to those endpoints, you only need to send UnAuth Token
in the X-PrintCart-Unauth-Token
header:
X-PrintCart-Unauth-Token: <UnAuth Token>
In order to get your UnAuth Token, please copy the UnAuth Token
at this link.
Check our API Reference for all endpoints that can be authenticated with UnAuth Token.
Status codes
A code in the range of 2xx indicates success, a code in the range of 4xx indicates there was a problem with the arguments provided (e.g., a required field was missing) or authentication problems, and a code in the range of 5xx indicates an error occurred with Printcart's servers.
Pagination
When you make a request to an endpoint that supports paginated results, you can set the number of results to return per page using the limit
parameter. If you don't specify a limit
, then the endpoint will return 20 results at maximum.
The following example request asks the product endpoint for all products, with a limit of 10 products per page of results:
Request
GET https://api.printcart.com/v1/products?limit=10
Response
{
"data": [
{
"id": "c6acb889-88d5-3410-9431-d64a3719c7ac",
...
},
{
"id": "962af342-a2c9-4665-bb5d-cb208258d958",
...
},
...
],
"links": {
"first": null,
"last": null,
"prev": null,
"next": null
},
"meta": {
"path": "https://api.printcart.com/products/4419934f-8e1b-4cf0-b432-01ef9258a812",
"per_page": 10
},
"message": "Retrieved successfully"
}
Printcart allows a maximum of 100 items per request
Query parameters
Almost all endpoints accept optional parameters which can be passed as an HTTP query string parameter, e.g. GET https://api.printcart.com/project?status=completed&sortBy=created_date
. All parameters are documented along with each endpoint.
API limit rate
To ensure our platform remains stable and fair for everyone, all Printcart API endpoints are rate-limited. You can make 120 requests per minute in all of Printcart API endpoints.
If you reach the rate limit, you will need to wait for at least 30 seconds to request more data. Please make sure your application is aware of this limit and makes requests according to it.
API Reference
Please follow this link to detailed API Reference.
Learn more
Now you had basic understanding about Printcart API, we recommnend you to read the following sections next: