> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bahnexpress.fi/llms.txt
> Use this file to discover all available pages before exploring further.

# Files and inspections

> Upload customer documents and build a transport evidence archive.

An order can collect customer uploads, handover photos, transport documents, condition summaries, and a full inspection report. These records answer different questions, so keep their labels distinct in your product.

## Upload a customer document

You cannot attach a file by URL. Upload it first, then add its ID to an order:

1. Call `POST /v2/files` with the file name, category, media type, and byte size.
2. Submit every returned form field to the returned upload URL.
3. Add the file as the final multipart field with the name `file`.
4. Add the returned `file_id` to the order `file_ids` field.

Do not rename or remove fields from the upload form. The temporary upload request accepts PDF, JPEG, and PNG files up to 12 MiB.

Use `power_of_attorney` or `customer_document` as the category. The optional description is visible with the attached file and should tell a user what the document contains.

Use `customer_document` for a pickup release document. Give the file a clear name, such as `pickup-release-document.pdf`, and add its ID to the order. You can leave `pickup.release_code` empty when the document contains the release authorization.

A successful upload does not attach the file by itself. The file appears on the order only after its ID is included in order creation or an order update.

## Build the order file list

Call `GET /v2/orders/{order_id}/files` to read all available order files. Use the fields together rather than relying on the file name:

| Field          | Use in your product                                        |
| -------------- | ---------------------------------------------------------- |
| `id`           | Stable file identity.                                      |
| `kind`         | Render the file as an `image` or `document`.               |
| `category`     | Label the content, such as vehicle, odometer, VIN, or CMR. |
| `stage`        | Group the file under pickup or delivery. It can be `null`. |
| `evidence_for` | Mark evidence for damage, inspection, both, or neither.    |
| `item_id`      | Associate the file with the primary or trade-in vehicle.   |

The file `id` is stable. The `content_url` is not. Use the URL before `content_url_expires_at`, then read the file list again when you need a fresh URL.

## Show vehicle condition

Each order item has a `pickup_condition` and `delivery_condition`. These summaries contain the recorded condition, odometer value, notes, and related `evidence_file_ids` when available.

Use those file IDs to find the photos in the order file list. A photo alone does not tell you whether Bahn recorded damage or accepted a condition result.

## Show a full inspection

A full inspection is a structured report for the primary vehicle. It is separate from the condition summary and the general file list.

Call `GET /v2/orders/{order_id}/inspection-report` and handle its status:

| Status         | Product behavior                                                            |
| -------------- | --------------------------------------------------------------------------- |
| `not_required` | Do not show an inspection section for this order.                           |
| `pending`      | Show that the inspection is not yet available.                              |
| `available`    | Show the inspection time, overall findings, category results, and evidence. |

Each category has an `ok` or `issue` status, optional findings, and its own evidence files. Use those fields to build the report. Do not label a normal handover photo as an inspection result.

## Delete a customer upload

The `can_delete` field tells you whether the current credential can delete a file. When it is `true`, call `DELETE /v2/orders/{order_id}/files/{file_id}`.

Deletion is available only while the order allows changes and only for files uploaded by the same customer account. Use `can_delete` as the UI rule instead of deriving access from the file category.
