Skip to content
PressFlow Help Centre

PressFlow Trade API Reference

Use the Trade API to connect your own software to a PressFlow printer who invites you. If both shops use PressFlow, PressFlow Link connects them with a one-time code. The API gives partners access to their own catalogue, trade prices, quotes, orders, artwork, proofs and dispatch updates.

Using the Trade API

The Trade API is a JSON REST API at https://<printer's shop>/wp-json/pressflow-trade/v1. The printer gives you its address, a key and the link to its OpenAPI file (/openapi.json), which describes every call and can generate a client.

The downloadable reference contains the full OpenAPI 3.1 description, including every field, worked examples, errors and webhook payloads. Each printer’s enabled Trade API also serves its own copy of the description.

Authentication

Send your key on every call as Authorization: Bearer pft_test_…. If your host strips the Authorization header, send X-PressFlow-Key: pft_test_… instead. Test keys work over HTTP or HTTPS; live keys only over HTTPS, and only once the printer has allowed live ordering. Every response says which mode it ran in (X-PressFlow-Mode) and is never cached.

Typical order

  1. GET /account — check payment readiness and read the delivery options.
  2. GET /products, then GET /products/{id} — the fields, choice keys, availability rules, allowed copy counts, sizes, turnaround options and artwork specification.
  3. POST /quotes — price the jobs for the delivery address.
  4. POST /uploads (optional) — upload artwork files, if you can’t give links.
  5. POST /orders with an Idempotency-Key header — place the order from the quote.
  6. Follow the order through webhook events, or GET /orders/{id}.
  7. GET and POST /orders/{id}/proof — if you asked for a proof.

Endpoints

MethodPathWhat it does
GET/accountAccount, mode, currency, payment readiness, delivery options, webhook, limits
GET/productsProducts you may sell, with your discount
GET/products/{id}One product’s full specification
POST/products/{id}/checkCheck a set of options: which choices are unavailable and why, and the trade price once the job is complete
GET/products/{id}/pricingThe product’s price tables at your trade prices, when the printer shares them
POST/quotesPrice 1 to 20 jobs for one delivery
GET/quotes/{id}A quote, with status open, expired or ordered
POST/ordersPlace an order from a quote
GET/ordersYour orders, newest change first; filter by state or updated_since, page with cursor and limit (up to 100)
GET/orders/{id}One order: state, jobs, artwork, proof, payment, dispatch
POST/orders/{id}/artworkAdd or replace artwork
POST/uploadsUpload one file as the request body
GET/orders/{id}/proofCurrent proofs, with download links valid for one hour
POST/orders/{id}/proofApprove a proof or ask for changes
POST/orders/{id}/cancelCancel before production starts
GET, PUT, DELETE/webhookYour webhook for this key’s mode
POST/webhooks/testSend a signed test event now
POST/test/orders/{id}/advanceTest keys only: move a test order on
GET/openapi.jsonThe API description (no key needed)

Quotes

Send options as field key to choice key, exactly as GET /products/{id} lists them. Large-format products also take width and height in the product’s unit.

{
  "items": [
    {"product": 101, "copies": 250, "options": {"stock": "silk", "sides": "two", "turnaround": "standard"}}
  ],
  "delivery": {"option": "next_working_day", "address": {"country": "GB", "postcode": "M1 1AA"}}
}

The quote returns each job’s trade price, VAT, dispatch and delivery dates, the delivery charge, totals, your payment readiness and expires_at. Prices are net of VAT and in the shop’s currency. A quote expires after the printer’s validity period or at the job’s order cut-off, whichever comes first.

Orders

{
  "quote": "3f2a9c1e-5b7d-4e8a-9c21-7d4e5f6a8b90",
  "reference": "PO-1001",
  "proof": "none",
  "payment": "credit",
  "delivery": {"name": "Alex Morgan", "company": "Demo Print Ltd", "address_1": "10 High Street", "city": "Manchester", "postcode": "M1 1AA", "country": "GB", "phone": "0161 000 0000"},
  "items": [{"artwork": [{"url": "https://files.example.com/front.pdf", "label": "Front"}, {"upload": "<upload id>", "label": "Back"}]}],
  "notes": "Leave with reception"
}
  • reference (up to 60 characters) is required. items follow the quote’s jobs in order; artwork can be left out and sent later.
  • proof: none prints as supplied after the printer’s file check; required waits for your approval.
  • payment defaults to your account’s method. Credit accounts can also choose prepay.
  • The delivery country and postcode must match the quote. The quote is checked again: if prices or VAT changed, the order is refused with the new totals.
  • Send an Idempotency-Key header (up to 80 characters). Repeating a request with the same key returns the first order with Idempotent-Replayed: true; the same key with a different request is refused.

A prepay order returns payment.pay_url, a secure payment link. Production waits until it’s paid.

Order states

StateMeaning
receivedPlaced; waiting for account checks
awaiting_paymentPrepay order not yet paid
awaiting_artworkA job has no artwork
artwork_checkArtwork is downloading or being checked
changes_requestedNew artwork or proof changes are needed; reason says why
proof_readyA proof is waiting for your approval
in_productionBeing printed
dispatchedSent; each job carries carrier and tracking
completedFinished
cancelledCancelled
failedCould not proceed; reason says why

Each job in items also has its own state, artwork status (missing, downloading, received, accepted, rejected) and proof status.

Artwork and uploads

Give each job up to 10 files, each a public HTTPS url or an upload ID, with a label when there are several. To upload, POST /uploads with the file as the request body and its name in X-Filename (optionally X-Label). Use the returned ID within 24 hours; each upload can be attached once. Very large files are better sent as links.

To replace artwork, POST /orders/{id}/artwork with {"items": [{"index": 0, "artwork": […]}]}. This works until the job goes into production.

Proofs

GET /orders/{id}/proof lists each job’s proof status, version, the printer’s message and download links valid for one hour. To decide, send:

{"index": 0, "version": "<version>", "decision": "approved"}

or "decision": "changes_requested" with a note describing the changes.

Webhooks and events

Set your webhook with PUT /webhook and {"url": "https://…"}. The signing secret is returned once, when first set or when you send "rotate_secret": true. Test and live keys have separate webhooks.

Every event is a POST with the order’s full current view in order, so you can process events in any order and a missed one does no harm. Events are: order.created, order.payment_required, order.paid, artwork.received, artwork.accepted, artwork.rejected, proof.ready, proof.approved, proof.changes_requested, order.in_production, order.dispatched, order.completed, order.cancelled, order.failed, order.updated and webhook.test. Job events include the job’s item index.

Check each event before you trust it. The headers are X-PressFlow-Event (a unique ID, for de-duplicating), X-PressFlow-Event-Type, X-PressFlow-Timestamp and X-PressFlow-Signature. The signature is v1= followed by the HMAC-SHA256, in hex, of timestamp + "." + raw body, keyed with your secret.

Reply with any 2xx status. Failed deliveries (no answer, 408, 429 or 5xx) are tried up to 8 times in all, waiting longer each time (from a minute to about an hour), and honouring Retry-After.

Test mode

With a test key, orders use the printer’s real products and prices but are never printed or charged. Move a test order to its next state with POST /test/orders/{id}/advance, or send {"to": "changes_requested"}, "failed" or "cancelled" to try those paths. Every step sends the same events as a live order. Test orders are removed after 7 days.

Errors and limits

Errors always look like this, with the HTTP status:

{"error": {"code": "invalid_options", "message": "Item 1: Choose or enter Stock.", "item": 0, "fields": {"stock": ["Choose or enter Stock."]}}}
CodeStatusMeaning
key_required, key_invalid401No key, or it isn’t recognised or was revoked
live_not_enabled, https_required, account_inactive403Live ordering is off, the call wasn’t HTTPS, or trade access is off
rate_limited429Too many requests; wait for Retry-After seconds
invalid_options, product_unavailable, delivery_unavailable, address_mismatch422Fix the request as the message says
quote_changed, quote_used, idempotency_conflict409Request a new quote, or use a new key
quote_expired410Request a new quote
credit_limit_exceeded, credit_unavailable402Pay this order instead, or contact the printer
LimitValue
Requests per key120 a minute, unless the printer changes it
Jobs per quote or order20
Files per job10
Upload ID valid for24 hours
Proof links valid for1 hour
Active keys per account10