Some useful tips to work with the API.
This article describes the two environments of the Print.com API, production (live) and staging (test): which account to use for each, the daily reset of staging, how orders, order status and invoicing work in each, why prices can differ between them, and what the price fields productPrice and salesPrice contain. Two environments exist so that you can build and test an integration on staging without creating real orders, and place real orders on production once the integration is ready.
Key facts
- Production (https://api.print.com), also called the live environment, is the base URL for all requests. Every order placed there is a real order. When the order is taken into production, an invoice is generated and you are charged.
- Staging (https://api.stg.print.com), also called the test environment, is completely separated from production and runs on its own database. Every order placed there is a test order: it is not taken into production and not invoiced. Prices and other data for the same product configuration can differ from production.
- Staging is reset every 24 hours. API keys and product presets on staging then expire. Create them again to continue testing.
- Production accepts the same credentials as the Print.com webapp (https://app.print.com). A separate user for the API connection is recommended. Staging requires its own account: request it by email at [email protected].
- On staging, the order status does not follow production progress. The only status change is the approval of artwork for an order placed with
approveDesign: false. Follow production progress through the order status on production only. productPriceis the gross selling price, excluding the customer discount. salesPrice is the net selling price, including the customer discount. Both exclude VAT and shipping costs.- An order placed with
approveDesign: falsestays on hold until its artwork is approved in the Print.com webapp: https://app.print.com for production, https://app.stg.print.com for staging. On production, approval releases the order for production. On staging, approval only changes the order status.
Production and staging compared
| Property | Production | Staging |
|---|---|---|
| Also called | Live enviroment | Test enviroment |
| Base URL | https://api.print.com | https://api.stg.print.com |
| Webapp | https://app.print.com | https://app.stg.print.com |
| Account | Same credentials as the Print.com webapp; a separate API user is recommended for large volumes. | Separate staging account, requested by email at [email protected] |
| Reset | No | Every 24 hours; API keys and product presets expire |
| Order type | Real order | Test order |
| Taken into production | Yes | No |
| Order status updated | Yes, follows production progress | Only on artwork approval of an order placed with approveDesign: false |
Order placed with approveDesign: false | On hold until artwork is approved in https://app.print.com; approval releases it for production | On hold until artwork is approved in https://app.stg.print.com; approval only changes the order status |
| Invoiced | Yes, when the order is taken into production | No |
| Database | Production database, shared with the Print.com webapp | Separate staging database, completely separated from production |
| Prices, shipping options and production dates | Current, correct, and include your customer loyalty discount | For testing only; can differ from production and don't include any loyalty discounts |
| Intended use | Live integration: prices, quotes and real orders | Building and testing an integration |
In practice: build and test on staging, then switch the base URL to production when the integration is ready. Only production gives you the correct price, the relevant shipping options and production dates for a product.
The same comparison in machine-readable form:
{
"environments": [
{
"name": "production",
"alias": "live",
"base_url": "https://api.print.com",
"webapp_url": "https://app.print.com",
"account": "same_as_webapp",
"dedicated_api_user_recommended": true,
"reset_interval_hours": null,
"order_type": "real",
"taken_into_production": true,
"order_status_updated": "follows_production_progress",
"approve_design_false": "on_hold_until_artwork_approved_in_webapp_then_released_for_production",
"invoiced": "when_taken_into_production",
"prices_authoritative": true
},
{
"name": "staging",
"alias": "test",
"base_url": "https://api.stg.print.com",
"webapp_url": "https://app.stg.print.com",
"account": "separate_staging_account",
"account_request_email": "[email protected]",
"reset_interval_hours": 24,
"expires_on_reset": ["api_keys", "product_presets"],
"order_type": "test",
"taken_into_production": false,
"order_status_updated": "only_on_artwork_approval_with_approve_design_false",
"approve_design_false": "on_hold_until_artwork_approved_in_webapp_then_status_change_only",
"invoiced": false,
"prices_authoritative": false
}
]
}Accounts and credentials for production and staging
Production (https://api.print.com) and staging (https://api.stg.print.com) use different accounts, because the two environments are completely separated.
Production. You can log in to the API with the same credentials as the Print.com webapp (https://app.print.com). We recommend creating a separate user for the API connection, for two reasons:
- You can reset the password of your own webapp user without breaking the API connection.
- You can see which orders were created through the API.
You add new users in My account in the Print.com webapp. New to Print.com, or need a separate account? Email your request to [email protected].
Staging. Staging requires its own account. Production credentials do not work on staging. Email [email protected] to request a staging account. With the staging account you also log in to the staging webapp (https://app.stg.print.com).
Staging resets every 24 hours
Staging (https://api.stg.print.com) is reset every 24 hours. After each reset, the following expire:
- API keys created on staging
- product presets created on staging
To continue testing after a reset, create the API keys and product presets on staging again.
What your integration should do:
- Do not store staging API keys or product presets as permanent configuration. They expire every 24 hours.
- Automate the creation of API keys and product presets on staging, so you can recreate them after every reset in one step.
- When staging requests that worked before start failing, first check whether the 24-hour reset has expired your API key or product presets.
Prices: productPrice, salesPrice and differences between enviroments
productPrice, salesPrice and differences between enviromentsThe Print.com API returns two price fields. Both exclude VAT and shipping costs.
| Field | Meaning | Customer discount | VAT | Shipping costs |
|---|---|---|---|---|
productPrice | Gross selling price | Excluded | Excluded | Excluded |
salesPrice | Net selling price | Included | Excluded | Excluded |
The difference between productPrice and salesPrice is the customer discount. salesPrice is the price after the customer discount is applied, before VAT and shipping costs.
{
"price_fields": [
{ "field": "productPrice", "type": "gross", "includes_customer_discount": false, "includes_vat": false, "includes_shipping": false },
{ "field": "salesPrice", "type": "net", "includes_customer_discount": true, "includes_vat": false, "includes_shipping": false }
]
}Production (https://api.print.com) and staging (https://api.stg.print.com) each run on their own database. As a result, productPrice and salesPrice for the same product configuration can differ between production and staging. Use prices from production for quotes, selling prices and price comparisons. Use prices from staging only to test that your integration handles price responses correctly.
What happens to orders and invoices on production and staging
On production (https://api.print.com), every order placed through the API is treated as a real order. Production is the same platform as the Print.com webapp (https://app.print.com). When an order is taken into production, an invoice is generated and you are charged for the order. You can follow the progress of the order through its order status.
On staging (https://api.stg.print.com), every order placed through the API is treated as a test order. A staging order is not taken into production and is not invoiced. Its order status does not follow production progress.
Orders placed with approveDesign: false. The order stays on hold until its uploaded artwork is approved in the Print.com webapp.
- On production, approve the artwork in https://app.print.com. Approval means the order may be produced. It is invoiced once it is taken into production.
- On staging, approve the artwork in https://app.stg.print.com. Staging has no production, so approval only changes the order status. This is the only order status change on staging.
What your integration should do:
- Use staging (https://api.stg.print.com) while you build and test, with a separate staging account requested by email at [email protected]. You can place test orders there without production or invoices. Recreate your API keys and product presets after the staging reset, which happens every 24 hours.
- Do not test production progress on staging. On staging, the only order status change is the approval of artwork for an order placed with
approveDesign: false. - Switch to production (https://api.print.com) only when you are ready to place real orders. Every production order is produced and invoiced once it is taken into production.
- To test on production without automatic production, place the order with
approveDesign: false. The order stays on hold until you approve the artwork in the Print.com webapp (https://app.print.com). Approval releases the order for production.
Rules for testing and going live
Integrations, including code written or generated by AI assistants, should follow these rules.
- Make the environment configurable. Store the base URL and credentials in configuration, not in code: https://api.stg.print.com with the staging account, https://api.print.com with the production account. Switching environments should not require a code change.
- Use a separate account per environment. Staging (https://api.stg.print.com) is completely separated from production and requires its own account, requested by email at [email protected]. Production credentials do not work on staging.
- Create a dedicated API user on production. Add a separate user for the API connection in My account in the Print.com webapp (https://app.print.com). Resetting a personal password then does not break the API connection, and you can see which orders were created through the API.
- Test on staging first. Orders placed on staging (https://api.stg.print.com) are test orders. They are not taken into production and not invoiced.
- Recreate API keys and product presets after the staging reset. Staging is reset every 24 hours, and API keys and product presets on staging then expire. Automate their creation so you can recreate them in one step.
- Treat every production order as real. Orders placed on production (https://api.print.com) are produced and invoiced once they are taken into production. Never run automated tests that place orders against production.
- Do not rely on staging prices. Production and staging each run on their own database. productPrice and salesPrice for the same configuration can differ, so take prices for quotes and selling prices from production only.
- Do not expect production progress on staging. On staging, the only order status change is the approval of artwork for an order placed with approveDesign: false. Test production progress tracking on production only.
- Use
approveDesign: falsefor a controlled production test. The order stays on hold until you approve the artwork in the Print.com webapp (https://app.print.com). Approval releases the order for production.
Example of environment selection, recovery from the 24-hour staging reset and a controlled production test (illustrative pseudocode, not an official SDK):
ENVIRONMENTS = {
# Test orders: not produced, not invoiced.
# Requires a separate staging account (request it at [email protected]).
# Reset every 24 hours: API keys and product presets expire.
"staging": {
"base_url": "https://api.stg.print.com",
"webapp_url": "https://app.stg.print.com",
"credentials": read_secret("PRINTCOM_STAGING_CREDENTIALS"),
},
# Real orders: produced and invoiced when taken into production.
# Use a dedicated API user, not a personal webapp user.
"production": {
"base_url": "https://api.print.com",
"webapp_url": "https://app.print.com",
"credentials": read_secret("PRINTCOM_PRODUCTION_CREDENTIALS"),
},
}
ENV_NAME = read_config("PRINTCOM_ENVIRONMENT") # "staging" while building and testing
ENV = ENVIRONMENTS[ENV_NAME]
def prepare_staging():
# Staging is reset every 24 hours. Recreate what the reset expires.
if ENV_NAME == "staging" and staging_was_reset(ENV):
create_api_key(ENV)
create_product_presets(ENV)
def get_quote(configuration):
# Prices differ between staging and production (separate databases).
# Only production prices are valid for quotes and selling prices.
price = request_price(ENV, configuration)
return {
"gross": price["productPrice"], # excl. customer discount, VAT and shipping
"net": price["salesPrice"], # incl. customer discount, excl. VAT and shipping
}
def place_test_order_on_production(order):
# A production order is a real order. With approveDesign: false it stays on hold
# until the artwork is approved in https://app.print.com. Approval releases it
# for production; it is invoiced once it is taken into production.
order["approveDesign"] = False
return place_order(ENVIRONMENTS["production"], order)Frequently asked questions
Is an order placed throught the API on production a real order?
Yes. Every order placed on production (https://api.print.com) is treated as a real order. When it is taken into production, an invoice is generated and you are charged.
Are orders placed on staging produced or invoiced?
No. Orders placed on staging (https://api.stg.print.com) are test orders. They are not taken into production and you are not invoiced for them.
Why does the order status of my staging order not follow production?
Staging orders are test orders and are not taken into production. The only order status change on staging is the approval of artwork for an order placed with approveDesign: false, in the staging webapp (https://app.stg.print.com). Follow production progress through the order status on production (https://api.print.com) only.
What is the difference between productPrice and salesPrice?
productPrice and salesPrice?productPrice is the gross selling price, excluding the customer discount. salesPrice is the net selling price, including the customer discount. Both exclude VAT and shipping costs.
Do productPrice and salesPrice include VAT and shipping costs?
productPrice and salesPrice include VAT and shipping costs?No. Both productPrice and salesPrice exclude VAT and shipping costs.
What happens to an order placed with approveDesign: false?
approveDesign: false?The order stays on hold until its artwork is approved in the Print.com webapp. On production (https://app.print.com), approval releases the order for production. On staging (https://app.stg.print.com), approval only changes the order status, because staging has no production.
Can I use my Print.com webapp credentials for the API?
Yes, on production (https://api.print.com) the API accepts the same credentials as the Print.com webapp (https://app.print.com). We recommend a separate API user, added in My account, so that a password reset does not break the API connection and you can see which orders came through the API.
How do I get an account for staging?
Staging (https://api.stg.print.com) is completely separated from production and requires its own account. Email [email protected] to request a staging account.
I am new to Print.com. How do I get access to the API?
Request an account on https://www.print.com. With that account you can use production (https://api.print.com). After receiving your production acount you can request a separate account for staging (https://api.stg.print.com) to test first.
Is there a webapp for staging?
Yes. The staging webapp is at https://app.stg.print.com. You log in with your staging account, and you approve the artwork of staging orders placed with approveDesign: false there. The staging webapp includes all basic functionalities of the production webapp.
Why did my API key or product presets stop working on staging?
Staging (https://api.stg.print.com) is reset every 24 hours. API keys and product presets on staging then expire. Create them again to continue testing.