Submit receiving decisions with evidence
This API reference is for integrators submitting receiving decisions from external clients to Workspace. The procurement.receivingSubmissions resource associates a decision about goods with its evidence. It uses normal authentication, an active Workspace and current permissions. Its base path is /api/v1/procurement/receiving-submissions.
Connections and authorization
Read authenticated entrypoints and their actions before calling paths. Discovery reflects current permissions; an action may require several permissions together. Session writes require normal CSRF protection.
Capabilities, stores and connections
GET/api/v1/procurement/receiving-submissions/capabilities
| Method | Path relative to the base path | Success | Permission |
|---|---|---|---|
GET | /capabilities | 200 | receiving_cases:read |
GET | /signing-keys | 200 | receiving_cases:read |
GET | /stores | 200 | receiving_cases:read |
POST | /connections | 201 | receiving_cases:create and store write access |
Capabilities contain format, maxFileBytes, maxFiles, sourceModes, captureLeaseAvailable and captureLeaseSeconds. /stores returns stores with current write access, up to 100 results per page. Continue with after=<nextCursor> when nextCursor is present.
Create a connection with storeId and optional externalReference. The response contains connectionId, externalReference, tenantId and storeId. Repeating an external reference within the same Workspace selects the same connection; a different store conflicts. The reference grants no authority. Multiple authorized clients may share a connection.
The following paths are relative to /connections/{connectionId}. Read actions require store read access; write actions require store write access. Explicit legacy adoption requires store owner access. Store write access does not grant read access to individual files.
Connection actions
| Method | Path | Success | Required permissions |
|---|---|---|---|
GET | /reference-data | 200 | receiving_cases:read |
GET | /expected | 200 | receiving_cases:read |
POST | /capture-leases | 200 | receiving_cases:create |
POST | /commands/adopt-legacy | 200 | tenant:owner |
POST | /submissions | 201 | receiving_cases:create |
GET | /submissions/{submissionId} | 200 | receiving_cases:read |
PUT | /submissions/{submissionId}/files/{fileId} | 200 | receiving_cases:create |
POST | /submissions/{submissionId}/commands/confirm-documents | 200 | receiving_cases:create |
POST | /submissions/{submissionId}/commands/receive | 201 | receiving_cases:book, receiving_cases:create and receiving_cases:update |
POST | /submissions/{submissionId}/commands/abandon | 200 | receiving_cases:delete and receiving_cases:create |
POST | /submissions/{submissionId}/revisions | 201 | receiving_cases:update and receiving_cases:create |
Prepare and confirm files
Prepare a submission with operationId and files. Each file supplies fileId, filename, kind, mediaType, size and a SHA-256 hash as 64 lowercase hexadecimal characters in sha256. Roles are document, report, original, annotation and manifest. PDF and manifest files are optional. An optional manifestDigest must be sha256:<hash> and match exactly one JSON file of kind manifest.
A submission contains 1–500 files, each larger than zero and at most 50 MiB. Workspace Storage configuration and quotas also apply. File metadata, sizes and hashes are immutable after successful preparation. Supply exactly one Idempotency-Key equal to operationId for preparation, receiving and revision.
Upload complete binary contents with Content-Type: application/octet-stream. Prepared mediaType describes the actual file type. After an interrupted upload, resend the complete identical file. Bound size and hash prevent a different file from replacing it. Uploaded files are not overwritten. JSON files may exceed the short file-type detection window; size and hash checks still apply.
uploaded=true means the file has been transferred. Only documentsConfirmed=true confirms publication of the complete evidence set and protects it against changes and deletion. Confirmation does not book stock. Use abandon before confirmation; confirmed evidence cannot be deleted through that command.
Status returns details and storageObjectId only with current object read access. Before a Storage object exists, the creator can see prepared details while the submission has not been abandoned. Once the object exists, its current read ACL also applies to the creator. Confirmed case evidence is available at GET /api/v1/procurement/receiving-cases/{id}/evidence, requiring receiving_cases:read and each object's read access.
A revision identifies its predecessor in the path. That predecessor must have confirmed documents and a receiving case. The revision adds evidence to the same case; its receiving command is rejected. It cannot create another stock booking.
Buyer and movement facts
Decision reference data
GET/api/v1/procurement/receiving-submissions/connections/{connectionId}/reference-data
reference-data returns warehouses with id, code and name, plus buyerLegalEntities containing only id and name. Buyer references are non-deleted internal organizations in the active Workspace. Select the actual responsible buyer; do not infer it from the target warehouse or an arbitrary default.
expected returns open purchase orders and their items. Optional q searches the order number. Its response does not supply movement origin or goods status. The server checks expected remaining quantities again under lock when executing receiving.
The receiving command contains operationId and receiving. Set receiving.sourceMode to purchase_order or paper_delivery.
| Field | Meaning and requirement |
|---|---|
purchaseOrderId | Required for purchase_order; items reference the corresponding purchaseOrderItemId. |
supplierId, targetWarehouseId, items[].variantId | References for a paper delivery. Existing warehouse and item business validation still applies. |
buyerLegalEntityId | Required for paper deliveries. For a purchase order, the server may use the stored buyer. An explicitly supplied buyer must match it. Foreign or deleted buyers are rejected. |
originCountry | Actual movement origin required for a positive booking decision; the current policy must be able to resolve it. |
originRegion | Required where policy needs a region to resolve the territory unambiguously. |
goodsStatus | Physical goods require a known status for a positive booking decision: union or non_union. |
customsProcedure | Optional movement fact, not a general substitute for approval. Further requirements depend on the procedure and policy. |
decisionSummary | Required summary of the decision. |
Warehouse and facility describe the destination. They establish neither actual movement origin nor goods status. The server evaluates facts against a valid approved trade-compliance policy. Missing facts, a missing facility profile or an unavailable approved policy pack do not permit booking. Intake, inspection and quarantine can precede approval. A synthetic test policy is not legal approval for operational use.
Movement field limits are two characters for originCountry, 16 for originRegion, 24 for goodsStatus and 80 for customsProcedure. Send quantities and prices as decimal strings. Item fields include quantityArrived, quantityAccepted, quantityRejected, quantityQuarantined, unitCost, taxRate, targetBinId, batchNumber, expiryDate, trackingNumbers, serialAssignments, productionOrderId, inspectionResult, differenceReason and rejectionReason. Optional header fields are deliveryNoteNumber, expectedDeliveryAt, arrivedAt and notes. Timestamps use RFC3339 with a time zone; authentication determines the executing identity.
Paper delivery example structure; replace placeholders with verified references and actual movement facts:
{"operationId":"<operation-id>","receiving":{"sourceMode":"paper_delivery","supplierId":"<supplier-uuid>","targetWarehouseId":"<warehouse-uuid>","buyerLegalEntityId":"<buyer-uuid>","originCountry":"<country>","goodsStatus":"<union-or-non_union>","decisionSummary":"<decision>","items":[{"variantId":"<variant-uuid>","quantityArrived":"1","quantityAccepted":"1","quantityRejected":"0","quantityQuarantined":"0"}]}}Interpret results and errors
Confirm documents before executing receiving. A fully successful command returns 201 with operationId, status, receivingCaseId and optional goodsReceiptId. booked and partially_booked identify a booking; rejected and quarantine are other successful business outcomes. 201 alone therefore does not prove stock was booked.
Only a fully successful receiving command stores a replay result. After a lost response, read status or resend the identical command. Changing the file list after successful preparation conflicts; changing the command after successful receiving also conflicts. Current rights apply on every retry. Treat 409 as a conflict without modifying a used operation to bypass validation.
| Status | Meaning |
|---|---|
400 ERR_INVALID_RECEIVING_SUBMISSION | Invalid body, header, file type, size or hash. |
400 ERR_VALIDATION | Business validation failed; inspect meta.validationErrors. A missing buyer identifies buyerLegalEntityId; movement or policy problems identify tradeCompliance, such as tradeCompliance.movementContextIncomplete or tradeCompliance.policyUnavailable. |
403 | Current permission or store access is missing. |
409 ERR_EVIDENCE_INCOMPLETE | Evidence has not been fully confirmed before receiving. |
409 ERR_RECEIVING_SUBMISSION_CONFLICT | The operation, revision or stored state conflicts with the request. |
413 | Upload or request exceeds its allowed size. |
422 | Another business processing step cannot be executed. |
503 ERR_RECEIVING_CAPTURE_UNAVAILABLE | Offline capture signing is unavailable. |
500 | Processing failed; do not infer success from an error response. |
Offline capture
Connection POST /capture-leases issues a signed capture lease valid for seven days from issuance. Supply deviceId, Ed25519 publicKeyHex and a hexadecimal signature signatureHex proving possession. Sign this compact UTF-8 JSON with exactly this field order:
{"format":"nucleus.receiving.capture-request.v1","connectionId":"<UUID>","deviceId":"<device-id>","publicKeyHex":"<hex>"}Verify the JWT signature using GET /signing-keys: alg=EdDSA, kid, issuer nucleus, audience nucleus.receiving.capture.v1, format nucleus.receiving.capture-lease.v1, expiry and binding to tenantId, connectionId, deviceId and your public key. captureLeaseAvailable indicates whether a signer is configured. The lease supports local capture; later upload still requires normal authentication and current rights. Offline clients cannot learn about intervening revocation until reconnecting.
Adopt an existing connector
The procurement.receivingIntegrations API-key interface keeps its existing paths, permissions, DTOs, canonical hashes and 201 for initial execution and identical replay. Its reference response does not gain the new buyer list.
Adoption is optional. Connection POST /commands/adopt-legacy requires tenant owner and store owner authority, plus legacyIdentityId, queueReconciled=true and reconciliationReference describing the prior queue reconciliation. The server checks assignment and waits for active legacy receiving transactions. After adoption, further legacy execution requests return 409 ERR_RECEIVING_EXECUTOR_CHANGED. Historical successes can be recognized through the explicit mapping and original hash contract. Do not add buyer or movement fields to such replays; they would alter the old payload. Existing decisions are not automatically enriched.
Schema transition and operation
The combined schema owner, final target baseline and predecessor upgrade qualification are still pending. The target follows the qualified combined starting point by exactly one baseline. Activation must bind the forward_only contract and required minimum runtime.
Replace all writer instances and Storage workers together with the qualified target runtime. Older writers or workers must not continue in parallel. Binary rollback to the previous runtime is prohibited after transition. This reference replaces neither combined qualification nor the established release and schema cutover process.