| Environment | API base URL | Web console |
|---|---|---|
| Development | https://dev.inktoss.com/v1 | Dev Account |
| Production | https://www.inktoss.com/v1 | Production Account |
Authentication
Send your Inktoss API key in the Authorization: Bearer <API_KEY> header on every order request. The key gives access to your account’s orders and can spend its cash credits. Use Content-Type: application/json for JSON requests. When uploading with a multipart form, let your HTTP library or form editor set the Content-Type and boundary.
Create an API key
Sign in to the web console and open Account → API keys. Enter a name for your integration and select Create API key. Copy the key when it appears. The console shows only its last four characters after you dismiss it. You can check your available balance in the same section. Open the web console
To remove an integration’s access, select Revoke beside its key in the console.
Submit a complete order
Set submit to true and include the shipping address, shipping option ID, and one or more documents. The server reads the page counts, calculates the print and shipping price from the current app configuration, and debits the account in USD cents. A successful submission creates a paid order for fulfillment.
Set API_KEY to your account’s API key. Use GET /orders/options to find valid paper and shipping option IDs. Replace the sample shipping address before placing a real order.
Bash
Save this as order.json beside sample.pdf. The document ID sample also names the file part in the request.
{
"submit": true,
"shippingAddress": {
"name": "Morgan Lee",
"line1": "100 Example St",
"city": "Louisville",
"state": "KY",
"postalCode": "40202",
"country": "US"
},
"shippingOptionId": "standard",
"documents": [
{
"id": "sample",
"paperId": "letter"
}
]
}
BASE=https://www.inktoss.com/v1
AUTH="Authorization: Bearer $API_KEY"
ORDER_KEY=$(uuidgen)
curl -sS "$BASE/orders" -H "$AUTH" \
-H "Idempotency-Key: $ORDER_KEY" \
-F 'order=<order.json' -F 'sample=@sample.pdf'
Python
Install Requests with python -m pip install requests.
import json
import os
import uuid
import requests
BASE = "https://www.inktoss.com/v1"
AUTH = {"Authorization": "Bearer " + os.environ["API_KEY"]}
order = {
"submit": True,
"shippingAddress": {
"name": "Morgan Lee",
"line1": "100 Example St",
"city": "Louisville",
"state": "KY",
"postalCode": "40202",
"country": "US",
},
"shippingOptionId": "standard",
"documents": [{"id": "sample", "paperId": "letter"}],
}
order_key = str(uuid.uuid4())
with open("sample.pdf", "rb") as pdf:
response = requests.post(
BASE + "/orders",
headers={**AUTH, "Idempotency-Key": order_key},
data={"order": json.dumps(order)},
files={"sample": pdf},
timeout=60,
)
print(response.status_code, response.json())
HTTP
This example uses JetBrains HTTP Client file syntax. Set API_KEY and a unique ORDER_KEY, and put sample.pdf beside the .http file. In a client with a form editor, add a text part named order with the JSON below and a file part named sample with the PDF. JetBrains HTTP Client syntax
POST https://www.inktoss.com/v1/orders
Authorization: Bearer {{API_KEY}}
Content-Type: multipart/form-data; boundary=inktoss-example
Idempotency-Key: {{ORDER_KEY}}
--inktoss-example
Content-Disposition: form-data; name="order"
{
"submit": true,
"shippingAddress": {
"name": "Morgan Lee",
"line1": "100 Example St",
"city": "Louisville",
"state": "KY",
"postalCode": "40202",
"country": "US"
},
"shippingOptionId": "standard",
"documents": [{"id": "sample", "paperId": "letter"}]
}
--inktoss-example
Content-Disposition: form-data; name="sample"; filename="sample.pdf"
Content-Type: application/pdf
< ./sample.pdf
--inktoss-example--
Save the Idempotency-Key with the request and reuse it with the same details after a timeout. The initial successful POST returns 201. A replay returns 200 with the order’s current API representation and spends no additional credits. Reusing a successful key with different details returns 409 idempotency_conflict. Idempotency keys are scoped to the authenticated account and accept 1–128 letters, digits, underscores, or hyphens.
Create and edit a pending order
Omit submit or set it to false to create a pending order. An empty object is enough to start. You can also include shipping details and documents at creation. Pending orders spend no credits and enter fulfillment only after successful submission.
Bash
Use the same BASE and AUTH variables from the complete order example.
Create the draft and copy its orderId from the response.
JSON='Content-Type: application/json'
DRAFT_KEY=$(uuidgen)
curl -fsS "$BASE/orders" -H "$AUTH" -H "$JSON" \
-H "Idempotency-Key: $DRAFT_KEY" --data '{}'
Set ORDER_ID to the returned ID, then add the shipping details.
ORDER_ID="paste-your-order-id-here"
curl -fsS -X PATCH "$BASE/orders/$ORDER_ID" -H "$AUTH" -H "$JSON" --data-binary @- <<EOF
{
"shippingAddress": {
"name": "Morgan Lee",
"line1": "100 Example St",
"city": "Louisville",
"state": "KY",
"postalCode": "40202",
"country": "US"
},
"shippingOptionId": "standard"
}
EOF
Upload the image directly with its print settings. A PDF uses the same file field.
curl -fsS -X PUT "$BASE/orders/$ORDER_ID/documents/sample" -H "$AUTH" \
-F 'document={"paperId":"letter","printMode":"color"}' \
-F 'file=@sample.png'
Review and submit the order.
curl -fsS "$BASE/orders/$ORDER_ID" -H "$AUTH"
curl -sS -X POST "$BASE/orders/$ORDER_ID/submit" -H "$AUTH"
Python
This example uses Requests. Review the printed draft before running the final submission line.
import json
import os
import uuid
import requests
BASE = "https://www.inktoss.com/v1"
session = requests.Session()
session.headers["Authorization"] = "Bearer " + os.environ["API_KEY"]
def send(method, path, **kwargs):
response = session.request(method, BASE + path, timeout=60, **kwargs)
response.raise_for_status()
return response.json()
draft_key = str(uuid.uuid4())
draft = send("POST", "/orders", json={}, headers={"Idempotency-Key": draft_key})
path = "/orders/" + draft["orderId"]
send("PATCH", path, json={
"shippingAddress": {
"name": "Morgan Lee",
"line1": "100 Example St",
"city": "Louisville",
"state": "KY",
"postalCode": "40202",
"country": "US",
},
"shippingOptionId": "standard",
})
with open("sample.png", "rb") as image:
send(
"PUT", path + "/documents/sample",
data={"document": json.dumps({"paperId": "letter", "printMode": "color"})},
files={"file": image},
)
print(send("GET", path))
# Run after reviewing the draft:
# print(send("POST", path + "/submit"))
HTTP
Run the requests in order. Set API_KEY to your key and DRAFT_KEY to a unique value. After creating the draft, set ORDER_ID to the returned orderId. Put sample.png beside the .http file. In a form editor, send the print settings as a text part named document and attach the image as a file part named file.
POST https://www.inktoss.com/v1/orders
Authorization: Bearer {{API_KEY}}
Content-Type: application/json
Idempotency-Key: {{DRAFT_KEY}}
{}
###
PATCH https://www.inktoss.com/v1/orders/{{ORDER_ID}}
Authorization: Bearer {{API_KEY}}
Content-Type: application/json
{
"shippingAddress": {
"name": "Morgan Lee",
"line1": "100 Example St",
"city": "Louisville",
"state": "KY",
"postalCode": "40202",
"country": "US"
},
"shippingOptionId": "standard"
}
###
PUT https://www.inktoss.com/v1/orders/{{ORDER_ID}}/documents/sample
Authorization: Bearer {{API_KEY}}
Content-Type: multipart/form-data; boundary=inktoss-example
--inktoss-example
Content-Disposition: form-data; name="document"
{"paperId":"letter","printMode":"color"}
--inktoss-example
Content-Disposition: form-data; name="file"; filename="sample.png"
Content-Type: image/png
< ./sample.png
--inktoss-example--
###
GET https://www.inktoss.com/v1/orders/{{ORDER_ID}}
Authorization: Bearer {{API_KEY}}
###
POST https://www.inktoss.com/v1/orders/{{ORDER_ID}}/submit
Authorization: Bearer {{API_KEY}}
| Method and path | Behavior |
|---|---|
POST /orders | Creates an order. Requires Idempotency-Key. |
GET /orders/options | Lists paper and shipping option IDs and names. |
POST /orders/quote | Validates a complete order and returns its current price. |
GET /orders/{orderId} | Returns the draft or the confirmation receipt and current fulfillment details. |
POST /orders/{orderId}/quote | Validates and prices a draft. Takes no body. |
PATCH /orders/{orderId} | Updates shippingAddress and/or shippingOptionId on a pending order. When supplied, the address replaces the entire previous address. |
PUT /orders/{orderId}/documents/{documentId} | Adds or replaces a PDF or image and its settings on a pending order. |
DELETE /orders/{orderId}/documents/{documentId} | Removes the document from a pending order. Removing an absent document succeeds. |
POST /orders/{orderId}/submit | Submits a pending order. Optionally takes a JSON body with maxTotalCents. Repeating this call returns the original confirmation receipt. |
Initial creation returns 201. Other successful requests return 200. A pending order response contains orderId, status: "pending", documents, createdAt, updatedAt, and any shipping fields already set. A successful submission changes the API status to confirmed and adds submittedAt, cashCreditsChargedCents, and cashCreditsRemainingCents. The remaining balance is the balance immediately after that order’s debit. Poll GET /orders/{orderId} for the current fulfillment.status and, when available, trackingNumber, trackingUrl, shippedAt, and deliveredAt in the fulfillment object. The top-level status records whether the order was submitted.
Quotes and spending caps
For POST /orders/quote, use the same multipart fields as a complete order. Omit submit and maxTotalCents from the order JSON. Both quote endpoints return currency, subtotalCents, shippingCents, and totalCents without reserving funds, staging new uploads, or placing an order. Prices can change before submission.
Set maxTotalCents on a complete order with submit: true or in the JSON body when submitting a draft. If the current price exceeds the cap, submission returns 409 price_exceeds_maximum with totalCents and maxTotalCents. No credits are spent. For a complete order, keep the cap the same when retrying an accepted request.
Request fields
- Shipping address. Required at submission. Supply
name,line1,city,state(two letters), andpostalCode(five-digit ZIP or ZIP+4).line2is optional.countrydefaults toUS, the supported country. Text fields accept up to 128 characters unless a shorter format is specified. - Shipping option. Supply
shippingOptionIdfrom the current app configuration. At submission the server checks its weight and subtotal limits. - Documents. Each document requires a
paperIdfrom the app configuration. For multipart creation and quotes, put the JSON in a text part namedorder. Give each entry indocumentsa uniqueidand attach its file in a part with that same name. For multipart PUT, the path supplies the document ID. Send print settings as JSON in a text part nameddocumentand attach one file in a part namedfile. IDs accept 1–64 letters, digits, underscores, or hyphens. The file part must have a filename. Setnamein the document settings to override it. - PDFs. Use a
.pdffilename and a readable, unencrypted PDF with 1–5,000 pages. - Images. Upload PNG, JPEG, WebP, GIF, or TIFF with a matching filename extension. Each image must contain one frame or page and be at most 25 megapixels. The API preserves the original file. Each image counts as one printed page per copy.
- Upload limits. Each document can be up to 8 MiB, each order can contain up to 20 documents, and each request body can be up to 12 MiB including multipart overhead. The multipart JSON field must be smaller than 256 KiB. Use the pending flow to upload orders that exceed the single-request limit.
- JSON uploads. Clients can also send
application/jsonwithnameand exactly one ofpdfBase64orimageBase64per document. Use standard base64 without line breaks or a data URL prefix. Base64 counts toward the 12 MiB request limit. - Print settings.
copiesdefaults to 1 (1–1,000).printModeisbw(default) orcolor.doubleSidedModeisnone(default),long_edge, orshort_edge.orientationisportrait(default) orlandscape.selectedPagesis a list of up to 1,000 unique one-based page numbers. An omitted or empty list prints all pages. Document responses include the server-calculatedpageCountandpageSelection(allorcustom) along with the print settings and document metadata.
Credits and errors
The order API spends cash credits in USD cents. An account without credits starts at zero. Contact Inktoss for help funding your account. The order’s receipt records the debit. Contact Inktoss
A submission that costs more than the available balance returns 402. It makes no debit and creates no fulfillment order. A pending order remains editable and can be submitted after a top-up. A failed one-step submission can be retried with the same key.
{
"error": {
"code": "insufficient_cash_credits",
"message": "The account has insufficient cash credits",
"requiredCents": 240,
"availableCents": 100
}
}
| HTTP status | API code |
|---|---|
| 400 | invalid_request |
| 401 | unauthorized |
| 402 | insufficient_cash_credits |
| 404 | not_found |
| 405 | method_not_allowed |
| 409 | idempotency_conflict, order_already_submitted, or price_exceeds_maximum |
| 413 | payload_too_large |
| 415 | unsupported_media_type |
| 429 | rate_limited |
| 500 | internal_error |
An order and its balance debit commit together. Concurrent submissions share the same balance, and retries of an accepted order reuse its receipt. Uploaded documents can be staged before a submission commits. Removing a draft document removes its reference from the order. Inactive drafts are eligible for removal after 30 days. Unreferenced uploads are eligible for removal after seven days.
REST and MCP share per-account limits in rolling one-minute windows. The limits are 30 draft creation requests, 60 upload requests, 30 submission requests, and 60 quote requests. Requests with inline uploads count toward the upload limit and the relevant draft or submission limit. REST returns 429 with a Retry-After header in seconds. Both REST and MCP include retryAfterSeconds in the error object.
MCP server
Connect to https://www.inktoss.com/mcp using Streamable HTTP. Send your Order API key in the Authorization: Bearer <API_KEY> header on every MCP request. The MCP server uses the same account balance, drafts, and receipts as the Order API.
Create an Inktoss API key under Account → API keys. Make it available as the INKTOSS_API_KEY environment variable in the terminal where you launch your client. Keep the key value out of shared configuration and chat messages.
Claude Code
Add an .mcp.json file at your project root, or merge the inktoss entry into the file’s existing mcpServers object.
{
"mcpServers": {
"inktoss": {
"type": "http",
"url": "https://www.inktoss.com/mcp",
"headers": {
"Authorization": "Bearer ${INKTOSS_API_KEY}"
}
}
}
}
Start Claude Code from that project, approve the server if prompted, and use /mcp to check its connection. Claude Code MCP setup
Codex CLI
Register the server from your terminal.
codex mcp add inktoss --url https://www.inktoss.com/mcp \
--bearer-token-env-var INKTOSS_API_KEY
Start a new Codex session with INKTOSS_API_KEY set and use /mcp to check its connection. OpenAI Docs for Codex MCP
In either client, try “Use Inktoss to check my cash credit balance.” This calls a read-only tool and spends no credits.
| Tool | What it does |
|---|---|
get_cash_credit_balance | Returns the available balance in USD cents. |
get_order_options | Lists paper and shipping option IDs. |
create_pending_order | Creates a draft using an idempotencyKey. |
quote_complete_order | Validates and prices a complete order without submitting it. |
quote_pending_order | Validates and prices a draft. |
get_order | Reads the draft or confirmation receipt for an orderId. |
update_pending_order | Sets the shipping address or option on a draft. |
put_order_document | Adds or replaces a PDF or image and its print settings using a documentId. |
remove_order_document | Removes a document from a draft. |
submit_pending_order | Submits a draft for printing and mailing, debiting the account. |
submit_complete_order | Accepts a complete order in one call and debits the account. Requires an idempotencyKey. |
Use get_order_options to find IDs for the chosen paper and shipping option. For put_order_document, pass the file and its settings as document, using the JSON upload fields above. For submit_complete_order, provide the shipping details and an array of documents with an id on each. Follow the same document limits as the Order API. The 12 MiB request limit includes the MCP message.
Both submit tools accept an optional maxTotalCents and place an order for fulfillment when successful. Reuse the same idempotencyKey and order details to retry submit_complete_order. Retry submit_pending_order with the same orderId. Tool failures return isError: true and an error object in structuredContent. For insufficient funds, the error includes code: "insufficient_cash_credits", requiredCents, and availableCents.