Request endpoint All API requests have to be sent to this URL: https://api.printful.com/
If you are using a proxy, make sure that all requests have host header set to api.printful.com.
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, \"result\": \"Not Found\", \"error\": {\"reason\": \"NotFound\",\"message\": \"Not Found\"} }
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. ### Rate Limits Printful API has a general rate limit of 120 API calls per minute. Additionally, endpoints that perform resource intensive operations (such as mockup generator) have a lower allowed request limit. # Authentication
This Python package is automatically generated by the Swagger Codegen project:
- API version: 1.0
- Package version: 1.0.0
- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen For more information, please visit https://www.printful.com/docs/support
Python 2.7 and 3.4+
If the python package is hosted on Github, you can install directly from Github
pip install git+https://github.com/connorguy/Printfulpy.git
(you may need to run pip
with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
)
Then import the package:
import printfulpy
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install
to install the package for all users)
Then import the package:
import printfulpy
Please follow the installation procedure and then run the following:
from __future__ import print_function
import time
import printfulpy
from printfulpy.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = printfulpy.ApprovalSheetsAPIApi(printfulpy.ApiClient(configuration))
body = NULL # object | POST request body
confirm_hash = 'confirm_hash_example' # str | The confirm hash for the approval sheet you would like to approve.
x_pf_store_id = 'x_pf_store_id_example' # str | Use this to specify which store you want to use (required only for account level token) (optional)
try:
# Approve a design
api_response = api_instance.approve_design(body, confirm_hash, x_pf_store_id=x_pf_store_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling ApprovalSheetsAPIApi->approve_design: %s\n" % e)
# create an instance of the API class
api_instance = printfulpy.ApprovalSheetsAPIApi(printfulpy.ApiClient(configuration))
x_pf_store_id = 'x_pf_store_id_example' # str | Use this to specify which store you want to use (required only for account level token) (optional)
try:
# Retrieve a list of approval sheets
api_response = api_instance.get_approval_sheets(x_pf_store_id=x_pf_store_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling ApprovalSheetsAPIApi->get_approval_sheets: %s\n" % e)
All URIs are relative to https://api.printful.com
Class | Method | HTTP request | Description |
---|---|---|---|
ApprovalSheetsAPIApi | approve_design | POST /approval-sheets | Approve a design |
ApprovalSheetsAPIApi | get_approval_sheets | GET /approval-sheets | Retrieve a list of approval sheets |
CatalogAPIApi | get_categories | GET /categories | Get Categories |
CatalogAPIApi | get_category_by_id | GET /categories/{id} | Get Category |
CatalogAPIApi | get_product_by_id | GET /products/{id} | Get Product |
CatalogAPIApi | get_product_size_guide_by_id | GET /products/{id}/sizes | Get Product Size Guide |
CatalogAPIApi | get_products | GET /products | Get Products |
CatalogAPIApi | get_variant_by_id | GET /products/variant/{id} | Get Variant |
CountryStateCodeAPIApi | get_countries | GET /countries | Retrieve country list |
EcommercePlatformSyncAPIApi | delete_store_sync_product | DELETE /sync/products/{id} | Delete a Sync Product |
EcommercePlatformSyncAPIApi | delete_store_sync_variant | DELETE /sync/variant/{id} | Delete a Sync Variant |
EcommercePlatformSyncAPIApi | get_store_sync_product_by_id | GET /sync/products/{id} | Get a Sync Product |
EcommercePlatformSyncAPIApi | get_store_sync_products | GET /sync/products | Get list of Sync Products |
EcommercePlatformSyncAPIApi | get_store_sync_variant_by_id | GET /sync/variant/{id} | Get a Sync Variant |
EcommercePlatformSyncAPIApi | update_store_sync_variant | PUT /sync/variant/{id} | Modify a Sync Variant |
FileLibraryAPIApi | add_file | POST /files | Add a new file |
FileLibraryAPIApi | get_file | GET /files/{id} | Get file |
FileLibraryAPIApi | thread_colors | POST /files/thread-colors | Return available thread colors from provided image URL |
MockupGeneratorAPIApi | create_generator_task | POST /mockup-generator/create-task/{id} | Create a mockup generation task |
MockupGeneratorAPIApi | get_printfiles | GET /mockup-generator/printfiles/{id} | Retrieve product variant printfiles |
MockupGeneratorAPIApi | get_task | GET /mockup-generator/task | Mockup generation task result |
MockupGeneratorAPIApi | get_templates | GET /mockup-generator/templates/{id} | Layout templates |
OAuthAPIApi | get_scopes | GET /oauth/scopes | Get scopes for token |
OrdersAPIApi | cancel_order_by_id | DELETE /orders/{id} | Cancel an order |
OrdersAPIApi | confirm_order_by_id | POST /orders/{id}/confirm | Confirm draft for fulfillment |
OrdersAPIApi | create_order | POST /orders | Create a new order |
OrdersAPIApi | estimate_order_costs | POST /orders/estimate-costs | Estimate order costs |
OrdersAPIApi | get_order_by_id | GET /orders/{id} | Get order data |
OrdersAPIApi | get_orders | GET /orders | Get list of orders |
OrdersAPIApi | update_order_by_id | PUT /orders/{id} | Update order data |
ProductTemplatesAPIApi | delete_product_template | DELETE /product-templates/{id} | Delete product template |
ProductTemplatesAPIApi | get_product_template_by_id | GET /product-templates/{id} | Get product template |
ProductTemplatesAPIApi | get_product_templates | GET /product-templates | Get product template list |
ProductsAPIApi | create_sync_product | POST /store/products | Create a new Sync Product |
ProductsAPIApi | create_sync_variant | POST /store/products/{id}/variants | Create a new Sync Variant |
ProductsAPIApi | delete_sync_product | DELETE /store/products/{id} | Delete a Sync Product |
ProductsAPIApi | delete_sync_variant | DELETE /store/variants/{id} | Delete a Sync Variant |
ProductsAPIApi | get_sync_product_by_id | GET /store/products/{id} | Get a Sync Product |
ProductsAPIApi | get_sync_products | GET /store/products | Get Sync Products |
ProductsAPIApi | get_sync_variant_by_id | GET /store/variants/{id} | Get a Sync Variant |
ProductsAPIApi | update_sync_product | PUT /store/products/{id} | Modify a Sync Product |
ProductsAPIApi | update_sync_variant | PUT /store/variants/{id} | Modify a Sync Variant |
ReportsAPIApi | get_statistics | GET /reports/statistics | Get statistics |
ShippingRateAPIApi | calculate_shipping_rates | POST /shipping/rates | Calculate shipping rates |
StoreInformationAPIApi | change_packing_slip | POST /store/packing-slip | Change packing slip |
StoreInformationAPIApi | get_store | GET /stores/{id} | Get basic information about a store |
StoreInformationAPIApi | get_stores | GET /stores | Get basic information about stores |
TaxRateAPIApi | calculate_tax_rates | POST /tax/rates | Calculate tax rate |
TaxRateAPIApi | get_tax_countries | GET /tax/countries | Get a list of countries for tax calculation |
WarehouseProductsAPIApi | get_warehouse_product | GET /warehouse/products/{id} | Get warehouse product data |
WarehouseProductsAPIApi | get_warehouse_products | GET /warehouse/products | Get a list of your warehouse products |
WebhookAPIApi | create_webhook | POST /webhooks | Set up webhook configuration |
WebhookAPIApi | disable_webhook | DELETE /webhooks | Disable webhook support |
WebhookAPIApi | get_webhooks | GET /webhooks | Get webhook configuration |
- Address
- AddressInfo
- AllOfItemFilesItems
- AllOfOrderCosts
- AllOfSyncVariantProduct
- AllOfinlineResponse20021ResultItems
- AnyOfPackingSlip
- ApprovalSheet
- ApprovalSheetWebhookFile
- AvailabilityStatus
- AvailableTechnique
- AverageFulfillmentTime
- Category
- Costs
- CostsByAmount
- CostsByAmountInner
- CostsByProduct
- CostsByProductInner
- Country
- File
- FileOption
- FileType
- GenerationTask
- GenerationTaskExtraMockup
- GenerationTaskFile
- GenerationTaskFilePosition
- GenerationTaskMockup
- GenerationTaskTemplateFile
- Gift
- Id
- Id1
- Id2
- Id3
- Id4
- IncompleteItem
- InlineResponse200
- InlineResponse2001
- InlineResponse20010
- InlineResponse20011
- InlineResponse20012
- InlineResponse20013
- InlineResponse20013Result
- InlineResponse20014
- InlineResponse20015
- InlineResponse20016
- InlineResponse20016Result
- InlineResponse20017
- InlineResponse20018
- InlineResponse20019
- InlineResponse2002
- InlineResponse20020
- InlineResponse20021
- InlineResponse20022
- InlineResponse20023
- InlineResponse20023Result
- InlineResponse20024
- InlineResponse20025
- InlineResponse20026
- InlineResponse20027
- InlineResponse20028
- InlineResponse20029
- InlineResponse2003
- InlineResponse20030
- InlineResponse20031
- InlineResponse20032
- InlineResponse20032Result
- InlineResponse20033
- InlineResponse20034
- InlineResponse20034Result
- InlineResponse20034ResultScopes
- InlineResponse20035
- InlineResponse2004
- InlineResponse2005
- InlineResponse2006
- InlineResponse2007
- InlineResponse2008
- InlineResponse2009
- InlineResponse400
- InlineResponse400Error
- InlineResponse401
- InlineResponse401Error
- InlineResponse403
- InlineResponse403Error
- InlineResponse404
- InlineResponse404Error
- Item
- ItemInfo
- ItemOption
- Measurement
- MeasurementValue
- Option
- OptionType
- Order
- OrderEstimateCosts
- OrderEstimateRetailCosts
- OrderShipmentItem
- PackingSlip
- Paging
- PricingBreakdown
- Printfile
- PrintfileInfo
- PrintfileInfoAvailablePlacements
- PrintfulCosts
- Product
- ProductInfo
- ProductSizeGuide
- ProductTemplate
- ProductVariant
- Profit
- Response200
- Response200Paginated
- RetailCosts
- SalesAndCosts
- SalesAndCostsInner
- SalesAndCostsSummary
- SalesAndCostsSummaryInner
- Shipment
- ShippingInfo
- SizeTable
- State
- Statistics
- Store
- StoreStatistics
- SyncProduct
- SyncProductDeleted
- SyncProductEvent
- SyncProductInfo
- SyncVariant
- SyncVariantInfo
- TaxAddressInfo
- TaxInfo
- Template
- TemplateById
- TemplateByIdColors
- TemplateByIdOptionData
- TemplateByIdPlacements
- TemplatePlacementConflict
- TemplateVariantMapping
- TemplateVariantMappingItem
- Templates
- TotalPaidOrders
- Variant
- VariantInfo
- VariantPrintfile
- VariantPrintfilePlacements
- WarehouseProduct
- WarehouseProductVariant
- Webhook
- WebhookInfo
- Type: HTTP basic authentication
- Type: OAuth
- Flow: accessCode
- Authorization URL: https://www.printful.com/oauth/token
- Scopes:
- orders: Read and Write access to Orders
- orders/read: Read access to Orders
- stores_list: Read and Write access to Stores
- stores_list/read: Read access to Stores
- sync_products: Read and Write access to SyncProducts
- sync_products/read: Read access to SyncProducts
- file_library: Read and Write access to File library
- file_library/read: Read access to File library
- webhooks: Read and Write access to Webhooks
- webhooks/read: Read access to Webhooks