Purchase Documents API

Upload, list, complete and remove documents attached to purchase orders.

Purchase document endpoints attach files to /api/v1/purchases/{purchaseId} records.

Endpoints

MethodPathDescription
GET/api/v1/purchases/{purchaseId}/documentsList documents attached to a purchase
POST/api/v1/purchases/{purchaseId}/documentsUpload a purchase document with multipart form data
POST/api/v1/purchases/{purchaseId}/documents/presignCreate a direct-storage upload
POST/api/v1/purchases/{purchaseId}/documents/{documentId}/completeComplete a direct-storage upload
DELETE/api/v1/purchases/{purchaseId}/documents/{documentId}Remove a document from a purchase

Multipart upload

Shell
curl -X POST {{BASE_URL}}/api/v1/purchases/{purchaseId}/documents \
-H "Authorization: Bearer $CONFORMA_PAT" \
-F "category=INVOICE" \
-F "file=@invoice.pdf"

The multipart body requires category and file. 201 Created returns DocumentDto.

Presigned upload

Request body (PresignPurchaseDocumentRequestDto)

FieldTypeRequiredDescription
categorystringyesDocument category
fileNamestringyesOriginal filename
contentTypestringyesMIME type
sizeBytesintegeryesFile size, max 26214400

Call POST /api/v1/purchases/{purchaseId}/documents/presign, upload bytes to presignedUrl, then call POST /api/v1/purchases/{purchaseId}/documents/{documentId}/complete with checksumSha256.

Responses

List returns DocumentListResponseDto. Upload and complete return DocumentDto. Delete returns 204 No Content.