POST
/v1/filesCreate a file
To upload a file to Stripe, you need to send a request of type multipart/form-data. Include the file you want to upload in the request, and the parameters for creating a file.
All of Stripe’s officially supported Client libraries support sending multipart/form-data.
- RetriesRetries up to 2×, 500ms backoff, 30s timeout.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
expandarray<string>optional
Specifies which fields in the response should be expanded.
filestringrequired
A file to upload. Make sure that the specifications follow RFC 2388, which defines file transfers for the `multipart/form-data` protocol.
file_link_dataobjectoptional
Optional parameters that automatically create a [file link](https://api.stripe.com#file_links) for the newly created file.
purposestringrequired
The [purpose](https://docs.stripe.com/file-upload#uploading-a-file) of the uploaded file.
200Successful response.
createdintegerrequired
Time at which the object was created. Measured in seconds since the Unix epoch.
expires_atintegeroptional
The file expires and isn't available at this time in epoch seconds.
filenamestringoptional
The suitable name for saving the file to a filesystem.
idstringrequired
Unique identifier for the object.
linksobjectoptional
A list of [file links](https://api.stripe.com#file_links) that point at this file.
objectstringrequired
String representing the object's type. Objects of the same type share the same value.
purposestringrequired
The [purpose](https://docs.stripe.com/file-upload#uploading-a-file) of the uploaded file.
sizeintegerrequired
The size of the file object in bytes.
titlestringoptional
A suitable title for the document.
typestringoptional
The returned file type (for example, `csv`, `pdf`, `jpg`, or `png`).
urlstringoptional
Use your live secret API key to download the file from this URL.
defaultError response.
errorobjectrequired
Error handling
Any other status is an error: Error response.