---
title: "Upload documents to a payable"
method: POST
path: "/v1/erp/payouts/payables/{payable_id}/user_documents"
tags: ["Payable"]
---

# Upload documents to a payable

`POST /v1/erp/payouts/payables/{payable_id}/user_documents`

## Request

- Base URL: `https://api.cardda.com`
- URL: `https://api.cardda.com/v1/erp/payouts/payables/{payable_id}/user_documents`
- Auth: none required

Attaches one or more files as user documents on the payable. Send the files under the
`files` key (single file or array) as `multipart/form-data`. Invalid attachments are
rejected and purged, returning `422`.

This endpoint skips user authentication so a provider (via the portal) can upload
supporting documents; it is scoped by the payable id in the path, not by the company.

## Path parameters

- `payable_id` string, required

## Request body `multipart/form-data`

- object
  - `files` string[], required: One or more files to attach. A single file is also accepted.

## Response `201`

The last attached document.

- UserDocument: An ActiveStorage attachment representing a user-uploaded document on a payable, with its embedded blob metadata.
  - `id` string, uuid
  - `name` string: The attachment name (always `user_documents`).
  - `record_type` string
  - `record_id` string, uuid
  - `blob_id` string, uuid
  - `created_at` string, date-time
  - `blob` object
    - `id` string, uuid
    - `filename` string
    - `content_type` string
    - `byte_size` integer
    - `checksum` string
    - `created_at` string, date-time

## Other responses

- `404`: Payable not found
- `412`: Precondition Failed — the required `files` parameter is missing. Body: `{"message": "param is missing or the value is empty or invalid: files"}`.
- `422`: Unprocessable Entity — one or more attachments failed validation.

---

[API](https://skmtc.dev/cardda/apis/erp-api.md) - [All operations](https://skmtc.dev/cardda/apis/erp-api/llms.txt) - [OpenAPI document](https://skmtc.dev/cardda/apis/erp-api/revisions/0730ed26bc3c?raw)
