Print and Mail Company API API

Print and mail letters worldwide (printed and posted in Germany, France, Belgium or Luxembourg). Upload a PDF or compose a letter, create a draft with the exact price, then send it (paid from prepaid credit). Before the account's first letter we need its sender details, the sender's REAL full name (

GitHub OpenAPI

Operations 14

GET /quote Price for a letter (public, no API key needed) #
GET /destinations Countries, zones and 1-page price (public) #
GET /balance Prepaid credit #
GET /account The account the API key belongs to: email, name and currency (e.g. to show which account an app is connected to) #
POST /documents Upload a PDF (multipart 'file', or JSON with pdf_url / pdf_base64) and run the print check #
GET /documents/{id} #
POST /documents/{id}/fix Fix pages that break the margin rule: shrink (default) or crop #
POST /documents/{id}/revert Undo a fix: print the original upload again (as on upload: a mixed document's US Letter pages placed on A4) #
POST /compose Render text into an A4 letter (DIN 5008) and create a draft #
GET /letters #
POST /letters Create a draft letter (nothing is charged). The envelope shows the account's sender details as the sender. #
GET /letters/{id} #
POST /letters/{id}/send Pay from credit and send. acceptTerms must be true (the user accepted the Terms and the immediate start). #
POST /letters/{id}/cancel #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/printandmailcompany-com:print-and-mail-company-api-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

printandmailcompany-com-api-openapi.json Raw ↑
{"openapi":"3.1.0","info":{"title":"Print and Mail Company API","version":"1.0.0","description":"Print and mail letters worldwide (printed and posted in Germany, France, Belgium or Luxembourg). Upload a PDF or compose a letter, create a draft with the exact price, then send it (paid from prepaid credit). Before the account's first letter we need its sender details, the sender's REAL full name (first and last name; not an alias, nickname or pseudonym) and postal address, in any country: pass them as sender to /compose, /letters or /letters/{id}/send (or add them in the account), else drafts and payments answer 422 SENDER_DETAILS_REQUIRED. A sender given once the account has them changes nothing: the saved details are used (senderDetails \"on_file\" when it is the same, \"kept\" when it differs). Authentication: create an API key in your account (Settings → API & AI assistants) and send it as `Authorization: Bearer pmc_…`. AI assistants should prefer the MCP server at https://printandmailcompany.com/mcp.","contact":{"name":"LeFaLux vGmbH","email":"support@printandmailcompany.com","url":"https://printandmailcompany.com"},"termsOfService":"https://printandmailcompany.com/en/legal/terms"},"servers":[{"url":"https://printandmailcompany.com/api/v1"}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"pmc_…"}},"schemas":{"Address":{"type":"object","required":["name","line1","city","country"],"properties":{"name":{"type":"string","maxLength":60},"company":{"type":"string","maxLength":60},"line1":{"type":"string","maxLength":60,"description":"Street and number or PO box"},"line2":{"type":"string","maxLength":60},"postalCode":{"type":"string","maxLength":16},"city":{"type":"string","maxLength":50},"region":{"type":"string","maxLength":50,"description":"State/province where used (e.g. US state code)"},"country":{"type":"string","minLength":2,"maxLength":2,"description":"ISO 3166-1 alpha-2"}}},"Letter":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string","description":"Shown to the customer and on receipts, e.g. PM-7K3QX9"},"status":{"type":"string","enum":["draft","paid","in_production","printed","posted","cancelled","returned"]},"documentId":{"type":"string"},"recipient":{"$ref":"#/components/schemas/Address"},"recipientLines":{"type":"array","items":{"type":"string"},"description":"The address as printed on the envelope"},"options":{"type":"object","properties":{"pages":{"type":"integer"},"duplex":{"type":"boolean"},"color":{"type":"string","enum":["bw","color"]},"envelope":{"type":"string","enum":["DL","C5","C4"]},"registered":{"type":"boolean"},"paper":{"type":["string","null"],"enum":["a4","us_letter",null],"description":"Paper the letter is printed on, fixed at payment; null while the paper choice is pending; absent on letters from before 8 October 2026 (A4)"},"paperChoice":{"type":"string","enum":["a4","us_letter"],"description":"The paper the customer chose for a US Letter document to a destination outside the US, Canada and US territories"}}},"paperSize":{"type":["string","null"],"enum":["a4","us_letter",null],"description":"Paper the letter is printed on (a draft's as decided from its document now, a paid letter's as fixed at payment); null while the customer still has to choose (paperChoiceRequired)"},"paperChoiceRequired":{"type":"boolean","description":"A US Letter document to a destination outside the US, Canada and US territories, and no choice yet: ask \"shrink to A4 (recommended) or keep US Letter?\" and send paperSize with /letters/{id}/send. Sending without it answers 409 PAPER_CHOICE_REQUIRED."},"destinationPaperSize":{"type":"string","enum":["a4","us_letter"],"description":"Standard paper of the destination: us_letter for US, CA, PR, VI, GU, AS, MP, else a4"},"currency":{"type":"string","enum":["EUR","USD","GBP","CHF"]},"total":{"type":"integer","description":"Total in minor units of currency"},"totalFormatted":{"type":"string"},"quote":{"type":"object","description":"Price breakdown in EUR cents (lines, netEurCents, vatEurCents, grossEurCents, vatRate, reverseCharge), postal size class and zone"},"priceLabel":{"type":"string","description":"\"incl. <rate> VAT\" with the current VAT rate, or \"excl. VAT — reverse charge\""},"trackingNumber":{"type":["string","null"],"description":"Registered letters, once posted"},"createdVia":{"type":"string","enum":["web","mcp","api"]},"createdAt":{"type":"string","format":"date-time"},"paidAt":{"type":["string","null"],"format":"date-time"},"postedAt":{"type":["string","null"],"format":"date-time"},"cancelledAt":{"type":["string","null"],"format":"date-time"},"url":{"type":"string","format":"uri","description":"The letter's page in the customer's account, in the account's language: the print-ready PDF (page previews, open, download) until the retention period ends, the status and the price. Give it to the account holder to check the letter before sending; it needs their sign-in."}}},"Document":{"type":"object","properties":{"id":{"type":"string"},"fileName":{"type":"string"},"pageCount":{"type":"integer"},"sizeBytes":{"type":"integer","description":"Size of the uploaded file"},"compliant":{"type":"boolean","description":"Every page of the print file has the size of its paper (A4, or US Letter for a US Letter document) and keeps the free margin: the document can be sent"},"hasColor":{"type":"boolean"},"fixed":{"type":"boolean","description":"A margin fix (shrink or crop) is applied"},"fixMode":{"type":["string","null"],"enum":["shrink","crop",null]},"fixedAt":{"type":["string","null"],"format":"date-time"},"source":{"type":"string","enum":["upload","url","compose"]},"printedOn":{"type":"string","enum":["A4","US Letter"],"description":"The paper size uploaded is the paper printed on: \"US Letter\" when every page is US Letter (8.5 × 11 in), else \"A4\" (A4 documents, and documents mixing A4 and US Letter pages). A letter with a US Letter document to a destination outside the US, Canada and US territories is printed on the paper the customer chose (Letter paperSize)."},"usLetterPages":{"type":"integer","description":"Uploaded US Letter pages: every page of a US Letter document (printed on US Letter paper, checked with the same margin), or the US Letter pages of a mixed document, which the print file centres on A4 sheets at 100 % or scales down just enough when their content would otherwise come within the margin (analysis.pages[].usLetter.scale, 1 = 100 %). The original upload is kept."},"usLetterNote":{"type":["string","null"],"description":"How the US Letter pages are printed, e.g. \"The document is printed on US Letter paper, as uploaded. …\" or \"The US Letter page is printed on A4 paper, centred at 100%.\"; null without any"},"analysis":{"type":"object","description":"Print check of the print file: marginMm, compliant (decides whether it can be printed), allA4 (literally every page A4: false for a printable US Letter document), paper (\"a4\" or \"us_letter\"), usLetterPages, a4Version (a US Letter document's version on A4: compliant, scales per page), and per page (pages[]) widthMm, heightMm, isA4, isUsLetter, orientation, contentBox, violations (side, depthMm), usLetter ({ scale } on US Letter pages placed on A4)"},"createdAt":{"type":"string","format":"date-time"},"deleteAfter":{"type":"string","format":"date-time"}}},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}}}}}}},"security":[{"apiKey":[]}],"paths":{"/quote":{"get":{"operationId":"getQuote","summary":"Price for a letter (public, no API key needed)","description":"Consumer price incl. VAT. With an API key, the price follows the account's VAT treatment: a business customer in another EU country with a VAT number confirmed by VIES gets the net price (reverseCharge true, vatRate 0, priceLabel \"excl. VAT — reverse charge\"). A revoked or invalid key is ignored here: the answer is then the consumer price, never an error.","security":[{},{"apiKey":[]}],"parameters":[{"name":"pages","in":"query","required":true,"schema":{"type":"integer","minimum":1,"maximum":250}},{"name":"country","in":"query","required":true,"schema":{"type":"string"},"description":"ISO country code, e.g. DE"},{"name":"postal_code","in":"query","schema":{"type":"string"}},{"name":"duplex","in":"query","schema":{"type":"boolean"}},{"name":"color","in":"query","schema":{"type":"string","enum":["bw","color"]}},{"name":"envelope","in":"query","schema":{"type":"string","enum":["DL","C5","C4"]}},{"name":"registered","in":"query","schema":{"type":"boolean"}},{"name":"currency","in":"query","schema":{"type":"string","enum":["EUR","USD","GBP","CHF"]}}],"responses":{"200":{"description":"Price breakdown incl. VAT (net under the reverse charge, see reverseCharge and priceLabel)"},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/destinations":{"get":{"operationId":"listDestinations","summary":"Countries, zones and 1-page price (public)","security":[],"responses":{"200":{"description":"List of destinations"}}}},"/balance":{"get":{"operationId":"getBalance","summary":"Prepaid credit","responses":{"200":{"description":"Balance in minor units"}}}},"/account":{"get":{"operationId":"getAccount","summary":"The account the API key belongs to: email, name and currency (e.g. to show which account an app is connected to)","responses":{"200":{"description":"The account","content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"},"currency":{"type":"string","enum":["EUR","USD","GBP","CHF"]}}}}}}}}},"/documents":{"post":{"operationId":"uploadDocument","summary":"Upload a PDF (multipart 'file', or JSON with pdf_url / pdf_base64) and run the print check","description":"A4 or US Letter PDF up to 4 MB and 250 pages, not password-protected. Printed on the paper size uploaded (printedOn): A4 on A4, US Letter on US Letter; a PDF mixing A4 and US Letter pages on A4, its Letter pages centred (usLetterPages, usLetterNote). pdf_base64 makes the request a third larger: for files over 3 MB, upload multipart or pass pdf_url.","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}}}},"application/json":{"schema":{"type":"object","properties":{"pdf_url":{"type":"string","format":"uri"},"pdf_base64":{"type":"string"},"file_name":{"type":"string"}}}}}},"responses":{"201":{"description":"Document with print check (compliant, analysis per page)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}}}}},"/documents/{id}":{"get":{"operationId":"getDocument","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Document","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}}}}},"/documents/{id}/fix":{"post":{"operationId":"fixDocument","summary":"Fix pages that break the margin rule: shrink (default) or crop","description":"Always works from the original upload, so calling it again (e.g. with the other mode) replaces the earlier fix. Compliant pages, and US Letter pages of a mixed document whose placement on A4 keeps the margin, are never changed. shrink scales the affected pages down slightly; nothing is lost. crop keeps pages at 100 % and cuts off everything inside the margin band, which is then not printed; pages of other sizes are first fitted onto A4. A US Letter document keeps its US Letter pages. Mode via JSON body or ?mode=.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"mode","in":"query","schema":{"type":"string","enum":["shrink","crop"]}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"type":"string","enum":["shrink","crop"],"default":"shrink"}}}}}},"responses":{"200":{"description":"Updated document (fixMode, fixedAt, compliant, analysis per page)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"400":{"description":"Invalid mode or body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"LOCKED: the document belongs to a letter that is already paid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/documents/{id}/revert":{"post":{"operationId":"revertDocument","summary":"Undo a fix: print the original upload again (as on upload: a mixed document's US Letter pages placed on A4)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Document with the original's print check","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"409":{"description":"LOCKED: the document belongs to a letter that is already paid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/compose":{"post":{"operationId":"composeLetter","summary":"Render text into an A4 letter (DIN 5008) and create a draft","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["recipient","subject","body"],"properties":{"sender":{"$ref":"#/components/schemas/Address","description":"Optional. Without it, the letter carries the account's own sender block, as on the letter form: the company name and business address if the account has business details, else its sender details, signed with the account holder's name (senderDetails \"on_file\"; an account without sender details gets 422 SENDER_DETAILS_REQUIRED and nothing is created). With it: printed in the letter's sender block. While the account has no sender details, this must be the sender's REAL full name (first and last name; not an alias, nickname or pseudonym) and postal address, in any country: it is then checked and saved as them. Once the account has them, the block is printed as given and the saved details stay as they are (senderDetails \"on_file\" when it matches them, \"kept\" when it differs). The envelope prints the account's sender details, not this block: The sender's name and postal address are printed at the top left of the envelope after \"Sent on behalf of:\" (the company name and business address instead, if the account has business details); undeliverable letters are returned to that address."},"recipient":{"$ref":"#/components/schemas/Address"},"subject":{"type":"string"},"body":{"type":"string","description":"Paragraphs separated by blank lines, '- ' bullets, **bold**"},"language":{"type":"string","default":"en"},"place":{"type":"string"},"date":{"type":"string","format":"date"},"closing":{"type":"string"},"signature":{"type":"string"},"references":{"type":"array","items":{"type":"string"}},"duplex":{"type":"boolean","default":false},"color":{"type":"string","enum":["bw","color"],"default":"bw"},"envelope":{"type":"string","enum":["DL","C5","C4"],"description":"Omit for the smallest envelope that fits"},"registered":{"type":"boolean","default":false}}}}}},"responses":{"201":{"description":"Document and draft letter with price","content":{"application/json":{"schema":{"type":"object","properties":{"document":{"$ref":"#/components/schemas/Document"},"letter":{"$ref":"#/components/schemas/Letter"},"senderDetails":{"type":"string","enum":["saved","on_file","kept"],"description":"\"saved\": the sender given was saved as the account's sender details now; \"on_file\": the account had them already, and no sender was given or the sender given is the same; \"kept\": the account had them already and the sender given differs: the saved details are used and stay as they are, the sender given is not saved (the account holder changes them in Settings → Your details); senderDetailsNote says so"},"senderDetailsNote":{"type":"string","description":"Only with senderDetails \"kept\": a plain note, not an error, that the saved sender details were used (/compose: that the sender block is printed in the letter and the saved details stay as they are), and that the account holder can change them in Settings → Your details"}}}}}},"422":{"description":"The request can't be carried out as it is; error.code says why, error.details may name the fields. Nothing was created or charged. SENDER_DETAILS_REQUIRED: the account has no sender details yet (no details: ask the account holder for their real full name and postal address and pass them as sender, or they add them in Settings → Your details), or the sender given doesn't pass the checks (details.fields: name → required, tooLong, characters, fullName or placeholder; address fields → required, invalid or tooLong). A real name the check refuses: the account holder writes to support, who can set it. INVALID_ADDRESS: the recipient's address is incomplete or invalid (details.fields: field → required, invalid or tooLong). UNKNOWN_COUNTRY, BLOCKED_COUNTRY: no letters to the recipient's country; TOO_MANY_PAGES, TOO_HEAVY, ENVELOPE_TOO_SMALL: the letter doesn't fit the envelopes and formats we post. NOT_PDF, ENCRYPTED, TOO_LARGE, TOO_MANY_PAGES, EMPTY, CORRUPT, TOO_COMPLEX: the PDF can't be printed as it is.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/letters":{"get":{"operationId":"listLetters","parameters":[{"name":"status","in":"query","schema":{"type":"string","enum":["draft","paid","in_production","printed","posted","cancelled","returned"]}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0},"description":"Letters to skip: pass nextOffset of the previous page to read the next one"}],"responses":{"200":{"description":"Letters, newest first: by creation; with status=posted by posting time, and with status=returned by the time of the last change, so a letter created long ago but posted or returned now comes first","content":{"application/json":{"schema":{"type":"object","properties":{"letters":{"type":"array","items":{"$ref":"#/components/schemas/Letter"}},"nextOffset":{"type":["integer","null"],"description":"The offset of the next page, or null on the last page"}}}}}}}},"post":{"operationId":"createLetter","summary":"Create a draft letter (nothing is charged). The envelope shows the account's sender details as the sender.","description":"The account's first letter needs its sender details, the sender's REAL full name (first and last name; not an alias, nickname or pseudonym) and postal address, in any country. Pass them as sender while the account has none; once it has them, the saved details are used and a sender given is not saved (senderDetails \"on_file\" when it is the same, \"kept\" when it differs; the account holder changes them in Settings → Your details).","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["documentId","recipient"],"properties":{"documentId":{"type":"string"},"recipient":{"$ref":"#/components/schemas/Address"},"sender":{"$ref":"#/components/schemas/Address","description":"Optional: the sender details, the sender's REAL full name (first and last name; not an alias, nickname or pseudonym) and postal address, in any country. Needed only while the account has none; checked and saved to the account (company is not used). The sender's name and postal address are printed at the top left of the envelope after \"Sent on behalf of:\" (the company name and business address instead, if the account has business details); undeliverable letters are returned to that address."},"duplex":{"type":"boolean","default":false},"color":{"type":"string","enum":["bw","color"],"default":"bw"},"envelope":{"type":"string","enum":["DL","C5","C4"],"description":"Omit for the smallest envelope that fits"},"registered":{"type":"boolean","default":false},"paperSize":{"type":"string","enum":["a4","us_letter"],"description":"Only for a US Letter document (printedOn \"US Letter\") to a destination outside US, CA, PR, VI, GU, AS, MP (paperChoiceRequired): \"a4\" = shrink to A4 (recommended), \"us_letter\" = keep US Letter. Ask the user; same price. Ignored (not stored) for other letters: A4 and mixed documents are printed on A4, US Letter documents to those countries on US Letter."}}}}}},"responses":{"201":{"description":"Draft letter with total (Letter, plus senderDetails); url is its page, where the account holder sees the print-ready PDF before sending","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Letter"},{"type":"object","properties":{"senderDetails":{"type":"string","enum":["saved","on_file","kept"],"description":"\"saved\": the sender given was saved as the account's sender details now; \"on_file\": the account had them already, and no sender was given or the sender given is the same; \"kept\": the account had them already and the sender given differs: the saved details are used and stay as they are, the sender given is not saved (the account holder changes them in Settings → Your details); senderDetailsNote says so"},"senderDetailsNote":{"type":"string","description":"Only with senderDetails \"kept\": a plain note, not an error, that the saved sender details were used (/compose: that the sender block is printed in the letter and the saved details stay as they are), and that the account holder can change them in Settings → Your details"}}}]}}}},"422":{"description":"The request can't be carried out as it is; error.code says why, error.details may name the fields. Nothing was created or charged. SENDER_DETAILS_REQUIRED: the account has no sender details yet (no details: ask the account holder for their real full name and postal address and pass them as sender, or they add them in Settings → Your details), or the sender given doesn't pass the checks (details.fields: name → required, tooLong, characters, fullName or placeholder; address fields → required, invalid or tooLong). A real name the check refuses: the account holder writes to support, who can set it. INVALID_ADDRESS: the recipient's address is incomplete or invalid (details.fields: field → required, invalid or tooLong). UNKNOWN_COUNTRY, BLOCKED_COUNTRY: no letters to the recipient's country; TOO_MANY_PAGES, TOO_HEAVY, ENVELOPE_TOO_SMALL: the letter doesn't fit the envelopes and formats we post.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/letters/{id}":{"get":{"operationId":"getLetter","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Letter. total includes VAT unless quote.reverseCharge is true (EU business customer with a confirmed VAT number); priceLabel says which","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Letter"}}}}}}},"/letters/{id}/send":{"post":{"operationId":"sendLetter","summary":"Pay from credit and send. acceptTerms must be true (the user accepted the Terms and the immediate start).","description":"A letter with paperChoiceRequired (a US Letter document to a destination outside the US, Canada and US territories) needs paperSize: ask the user \"shrink to A4 (recommended) or keep US Letter?\" (same price). paperSize is saved on the draft before paying. An account without sender details passes them as sender, the sender's REAL full name (first and last name; not an alias, nickname or pseudonym) and postal address, in any country: they are checked and saved before paying (once the account has them, the saved details are used).","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["acceptTerms"],"properties":{"acceptTerms":{"const":true},"paperSize":{"type":"string","enum":["a4","us_letter"],"description":"Only for a US Letter document (printedOn \"US Letter\") to a destination outside US, CA, PR, VI, GU, AS, MP (paperChoiceRequired): \"a4\" = shrink to A4 (recommended), \"us_letter\" = keep US Letter. Ask the user; same price. Ignored (not stored) for other letters: A4 and mixed documents are printed on A4, US Letter documents to those countries on US Letter."},"sender":{"$ref":"#/components/schemas/Address","description":"Optional: the sender details, the sender's REAL full name (first and last name; not an alias, nickname or pseudonym) and postal address, in any country. Needed only while the account has none (else 422 SENDER_DETAILS_REQUIRED): checked and saved to the account before paying (company is not used). The sender's name and postal address are printed at the top left of the envelope after \"Sent on behalf of:\" (the company name and business address instead, if the account has business details); undeliverable letters are returned to that address."}}}}}},"responses":{"200":{"description":"Paid letter (Letter; with sender given, plus senderDetails)","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Letter"},{"type":"object","properties":{"senderDetails":{"type":"string","enum":["saved","on_file","kept"],"description":"\"saved\": the sender given was saved as the account's sender details now; \"on_file\": the account had them already, and no sender was given or the sender given is the same; \"kept\": the account had them already and the sender given differs: the saved details are used and stay as they are, the sender given is not saved (the account holder changes them in Settings → Your details); senderDetailsNote says so"},"senderDetailsNote":{"type":"string","description":"Only with senderDetails \"kept\": a plain note, not an error, that the saved sender details were used (/compose: that the sender block is printed in the letter and the saved details stay as they are), and that the account holder can change them in Settings → Your details"}}}]}}}},"402":{"description":"Not enough credit (details.shortfall)"},"403":{"description":"EMAIL_NOT_VERIFIED: the account's email address is not confirmed yet. PAYMENTS_ON_HOLD: payments are on hold while a card payment is reviewed (contact support).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"PAPER_CHOICE_REQUIRED: the document is US Letter size and the destination is outside the US, Canada and US territories; ask the user and send paperSize again (details: country, destinationPaperSize, paperSizeOptions [\"a4\", \"us_letter\"], recommended \"a4\"). INVALID_STATE: the letter is not a draft. Nothing was charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request can't be carried out as it is; error.code says why, error.details may name the fields. Nothing was created or charged. SENDER_DETAILS_REQUIRED: the account has no sender details yet (no details: ask the account holder for their real full name and postal address and pass them as sender, or they add them in Settings → Your details), or the sender given doesn't pass the checks (details.fields: name → required, tooLong, characters, fullName or placeholder; address fields → required, invalid or tooLong). A real name the check refuses: the account holder writes to support, who can set it. DOCUMENT_NOT_COMPLIANT: the document fails the print check (POST /documents/{id}/fix, or a corrected file). UNKNOWN_COUNTRY, BLOCKED_COUNTRY: no letters to the recipient's country; TOO_MANY_PAGES, TOO_HEAVY, ENVELOPE_TOO_SMALL: the letter doesn't fit the envelopes and formats we post.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/letters/{id}/cancel":{"post":{"operationId":"cancelLetter","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Cancelled letter; amount returned to credit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Letter"}}}}}}}}}