---
title: "Creates a file"
method: POST
path: "/files"
tags: ["Files"]
---

# Creates a file

`POST /files`

To upload a file to Digital River, you’ll need to send a request of type <code>multipart/form-data</code>. The request should contain the file you would like to upload, as well as the parameters for creating a file. For appliation/JSON request type, a base64 encoded string may be sent in the payload.

## Response `201`

201 Created

- FileObject
  - `id` string — The unique identifier of the file.
  - `createdTime` string, date-time — The time when the file was created.
  - `fileName` string — A filename for the file, suitable for saving to a filesystem.
  - `links` FileLink[] — An array of file links.
    - `id` string — Unique identifier for the file link.
    - `createdTime` string, date-time — Time when the file link was created.
    - `expired` boolean — Whether this link has already expired.
    - `expiresTime` string, date-time — Time at which the link expires.
    - `fileId` string — The file object this link points to.
    - `liveMode` boolean — Has the value true if the object exists in live mode or the value false if the object exists in test mode.
    - `metadata` Metadata — Key-value pairs used to store additional data. Value can be string, boolean or integer types.
    - `url` string — The publicly accessible URL to download the file.
  - `purpose` 'tax_document_customer_upload' | 'customer_invoice' | 'customer_credit_memo' — The purpose of the file.
  - `title` string — A user friendly title for the document.
  - `size` number — The size in bytes of the file object.
  - `type` string — The type of the file returned (e.g. pdf, jpg, or png).
  - `url` string — The URL from which the file can be downloaded. To download the file, use your live secret API key.
  - `liveMode` boolean — Has the value true if the object exists in live mode or the value false if the object exists in test mode.

## Other responses

- `400` — 400 Bad Request
- `401` — 401 Unauthorized
- `403` — 403 Forbidden
- `405` — 405 Method Not Allowed
- `406` — 406 Not Acceptable
- `408` — 408 Request Timeout
- `409` — 409 Conflict
- `429` — 429 Too Many Requests
- `500` — 500 Internal Server Error
- `502` — 502 Bad Gateway Error
- `503` — 503 Service Unavailable Error
- `504` — 504 Gateway Timeout Error

---

[API](https://skmtc.net/digitalriver/apis/digital-river-api-reference.md) · [All operations](https://skmtc.net/digitalriver/apis/digital-river-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/digitalriver/digital-river-api-reference/revisions/f21981db32be/schema)
