Check a prepared file for a return case
All field references · Returns
POST /v1/returns/evidence
Takes over an upload_id of your own from POST /uploads. In addition to files:write, perspective=owner requires returns:decide and perspective=operator requires returns:process. Afterwards the file is not yet attached to the case: run attach_evidence or attach_inspection_evidence with the expected version and an idempotency key. A retry keeps evidence_id and upload_id. The upload is consumed once preparation succeeds: the same upload_id with a different evidence_id, a different case or a different perspective ends with 422 file_not_found (message: upload already used) — request a new slot with POST /uploads for every further file or case; an unchanged retry returns the original receipt. 503 command_outcome_unknown can also mean that the organization's storage quota is used up (the message says so): a retry then succeeds only once space has been freed.
Required scopes: "files:write".
#Request body
Request body required.
Content type: application/json
| Field | Type | Presence | null | Meaning, limits and examples |
|---|---|---|---|---|
| $ (whole value) | object | Whole value | Not allowed | Additional properties are not allowed. |
| evidence_id | string | Required when parent is present | Not allowed | Identifier of a prepared evidence file; use the same identifier returned by evidence preparation. format: "uuid". |
| return_id | string | Required when parent is present | Not allowed | Return case identifier. For announcement choose a new UUID; subsequent actions use the identifier returned for that case. format: "uuid". |
| upload_id | string | Required when parent is present | Not allowed | Identifier of your completed upload from POST /v1/uploads. format: "uuid". |
| perspective | string | Required when parent is present | Not allowed | Capacity in which the caller acts: owner of the goods or warehouse operator; each requires its matching permission. enum: ["owner","operator"]. |
#Response 200
200: Success
Content type: application/json
| Field | Type | Presence | null | Meaning, limits and examples |
|---|---|---|---|---|
| $ (whole value) | object | Whole value | Not allowed | Additional properties are not allowed. |
| data | object | Required when parent is present | Not allowed | Authorized response payload or documented event data. Additional properties are not allowed. |
| data.id | string | Required when parent is present | Not allowed | Identifier of this entry. Keep it unchanged when referring to the same entry in subsequent requests. format: "uuid". |
| data.return_id | string | Required when parent is present | Not allowed | Return case identifier. For announcement choose a new UUID; subsequent actions use the identifier returned for that case. format: "uuid". |
| data.file_name | string | Required when parent is present | Not allowed | Original display filename of this attachment. |
| data.mime_type | string | Required when parent is present | Not allowed | Validated media type of the file content. |
| data.size_bytes | integer | Required when parent is present | Not allowed | File size in bytes. exclusiveMinimum: 0. maximum: 26214400. |
| data.attached | boolean | Required when parent is present | Not allowed | Whether this prepared evidence has already been attached to its return case. |
#Response 401, 403, 404, 409, 422, 429, 500, 503
401: The key is missing, unknown, revoked or expired. 403: The key lacks a required scope, or the operation requires a live key. 404: Not found. Also applies to IDs that belong to another organization — we deliberately do not distinguish between "does not exist" and "does not belong to you". 409: The same ID already exists with different content. It is never overwritten. 422: Content validation failed. The response lists all affected locations at once. 429: A rate limit was reached and the request did not run. Wait for Retry-After, then repeat it unchanged. X-RateLimit-Scope names the limit: key (120 requests per minute), organization (300 per minute across all keys), write (1,000 at once, refilling at 60 per minute) or list (300 unfiltered list pages at once, refilling at 10 per minute). 500: Unexpected error on our side. 503: Temporarily unavailable. Repeat the same request with the same business identity.
Content type: application/json
| Field | Type | Presence | null | Meaning, limits and examples |
|---|---|---|---|---|
| $ (whole value) | object | Whole value | Not allowed | — |
| error | object | Required when parent is present | Not allowed | Machine-readable error code; use it to select the documented recovery path. |
| error.code | string | Required when parent is present | Not allowed | Machine-readable, permanently stable error code. Program against it, not against message. |
| error.message | string | Required when parent is present | Not allowed | Explanation for humans. May change at any time. |
| error.field | string | Optional | Not allowed | Affected location in the request, if it can be determined. |
| error.doc_url | string | Required when parent is present | Not allowed | Documentation link explaining this API error. format: "uri". |
Machine-readable version of this page: https://www.meykt.com/developers/fields-stage-return-evidence.md