# Files

Use the file entity to store files and related metadata.
Files can be sorted by size, MIME-type, user-defined tags, and description.
The following methods are available to upload files:
multipart/form-data encoded form, RAW POST —
by sending the file contents as the POST body, and fetching from URL —
by providing the file URL using the 'url' parameter.
Use the attachments entity to link a file to one or multiple objects, such as:
customer, dispute, transaction, order, plan, product, invoice, or timeline comment.
Attachments enable you to quickly find and use files related to specific entities.

 - [GET /attachments](https://www.rebilly.com/docs/dev-docs/api/files/getattachmentcollection.md): Retrieves a list of attachments. You may sort attachments by: `id`, `name`, `relatedId`, `relatedType`, `fileId`, `createdTime`, and `updatedTime`.
 - [POST /attachments](https://www.rebilly.com/docs/dev-docs/api/files/postattachment.md): Attaches a file to one or multiple objects, such as: customer, dispute, transaction, order, plan, product, invoice, or timeline comment. Attachments enable you to quickly find and use files related to
 - [GET /attachments/{id}](https://www.rebilly.com/docs/dev-docs/api/files/getattachment.md): Retrieves an attachment with a specified ID.
 - [PUT /attachments/{id}](https://www.rebilly.com/docs/dev-docs/api/files/putattachment.md): Updates an attachment with a specified ID.
 - [DELETE /attachments/{id}](https://www.rebilly.com/docs/dev-docs/api/files/deleteattachment.md): Deletes an attachment with a specified ID.
 - [GET /files](https://www.rebilly.com/docs/dev-docs/api/files/getfilecollection.md): Retrieves a list of files.
 - [POST /files](https://www.rebilly.com/docs/dev-docs/api/files/postfile.md): Creates a file. Additionally, a file can be sent by: - Multipart/form-data POST request: In this request, the file is uploaded and all property names are the same as the JSON names. - File body reques
 - [GET /files/{id}](https://www.rebilly.com/docs/dev-docs/api/files/getfile.md): Retrieves a file with a specified ID.
 - [PUT /files/{id}](https://www.rebilly.com/docs/dev-docs/api/files/putfile.md): Updates a file with a specified ID. > **Note:** Files can only be uploaded by POST request. For more information, see the Create a file operation.
 - [DELETE /files/{id}](https://www.rebilly.com/docs/dev-docs/api/files/deletefile.md): Deletes a file with a specified ID.
 - [GET /files/{id}/download](https://www.rebilly.com/docs/dev-docs/api/files/getfiledownload.md): Downloads a file with a specified ID.
