TanqoryDocs

tanqoryExtPurchaseOrderFilesAdd

  • Mutation
  • Inventory and fulfillment

Attaches files to a purchase order (the supplier's invoice: a scan or a PDF), in any status. Each is a staged upload of this store (stagedUploadsCreate, resource FILE or IMAGE: PUT the bytes, then pass the target's key parameter as stagedUploadPath). Before anything is kept: at most 10 files on the purchase order (TOO_MANY_FILES), the upload must exist (FILE_NOT_FOUND), at most 20 MB (FILE_TOO_LARGE), the malware scan (MALWARE_DETECTED, MALWARE_SCAN_UNAVAILABLE), a PDF, JPEG, PNG, WebP or HEIC by its bytes (FILE_TYPE_UNSUPPORTED), metadata removed (a photo's location and camera; a PDF's author, annotations and attachments; FILE_UNREADABLE when that cannot be done, e.g. an encrypted PDF). The files are private: never in Files and never on the media CDN; url is a signed link.

Arguments

ArgumentTypeRequiredDefault
files[TanqoryExtPurchaseOrderFileInput!]!Required
idID!Required

Returns

TanqoryExtPurchaseOrderPayload

FieldTypeDescription
purchaseOrderInventoryPurchaseOrder
userErrors[TanqoryExtPurchaseOrderUserError!]!

Example request

A starting point: required arguments as variables and a few fields of the result. Replace the placeholders.

Set STORE_ID and TANQORY_ACCESS_TOKEN in your environment first (Make your first API call).

curl
curl -X POST "https://api.tanqory.com/admin/2026-10/stores/$STORE_ID/graphql" \
  -H "Authorization: Bearer $TANQORY_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  --data '{"query":"mutation TanqoryExtPurchaseOrderFilesAdd($files: [TanqoryExtPurchaseOrderFileInput!]!, $id: ID!) {\n  tanqoryExtPurchaseOrderFilesAdd(files: $files, id: $id) {\n    purchaseOrder { id }\n    userErrors {\n      code\n      field\n      message\n    }\n  }\n}","variables":{"files":[],"id":"gid://tanqory/Type/id"}}'

Built from commit c0b3fb3fdef7 · API version 2026-10