---
title: "Upload a file for an invoice"
method: POST
path: "/v1/invoices/{invoiceKey}/files"
tags: ["Invoices"]
---

# Upload a file for an invoice

`POST /v1/invoices/{invoiceKey}/files`

Uploads an externally generated invoice PDF file for an invoice that is in Draft or Posted status.
To use this operation, you must enable the Modify Invoice permission. See [Billing Permissions](https://knowledgecenter.zuora.com/Billing/Tenant_Management/A_Administrator_Settings/User_Roles/d_Billing_Roles) for more information.
This operation has the following restrictions:
- Only the PDF file format is supported.
- The maximum size of the PDF file to upload is 4 MB.
- A maximum of 50 PDF files can be uploaded for one invoice.
- Ensure that each uploaded PDF file has a unique name. Duplicate filenames are not allowed when attaching files to an invoice.

## Path parameters

- `invoiceKey` string, required

## Headers

- `Idempotency-Key` string
- `Accept-Encoding` string
- `Content-Encoding` string
- `Zuora-Entity-Ids` string
- `Zuora-Org-Ids` string
- `Zuora-Track-Id` string
- `Zuora-Version` string

## Response `200`

OK

- POSTUploadFileResponse
  - `fileId` string — The unique ID of the uploaded PDF file.
  - `success` boolean — Indicates whether the call succeeded.

## Other responses

- `500` — Internal Server Error
- `4XX` — Request Errors

---

[API](https://skmtc.dev/zuora/apis/api-reference.md) · [All operations](https://skmtc.dev/zuora/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/zuora/api-reference/revisions/7f43d4a77e8a/schema)
