View Source Stripe.File (stripity_stripe v3.2.0)
This object represents files hosted on Stripe's servers. You can upload files with the create file request (for example, when uploading dispute evidence). Stripe also creates files independently (for example, the results of a Sigma scheduled query).
Related guide: File upload guide
Summary
Functions
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.
Returns a list of the files that your account has access to. Stripe sorts and returns the files by their creation dates, placing the most recently created files at the top.
Retrieves the details of an existing file object. After you supply a unique file ID, Stripe returns the corresponding file object. Learn how to access file contents.
Types
@type t() :: %Stripe.File{ created: integer(), expires_at: integer() | nil, filename: binary() | nil, id: binary(), links: term() | nil, object: binary(), purpose: binary(), size: integer(), title: binary() | nil, type: binary() | nil, url: binary() | nil }
The file
type.
created
Time at which the object was created. Measured in seconds since the Unix epoch.expires_at
The file expires and isn't available at this time in epoch seconds.filename
The suitable name for saving the file to a filesystem.id
Unique identifier for the object.links
A list of file links that point at this file.object
String representing the object's type. Objects of the same type share the same value.purpose
The purpose of the uploaded file.size
The size of the file object in bytes.title
A suitable title for the document.type
The returned file type (for example,csv
,pdf
,jpg
, orpng
).url
Use your live secret API key to download the file from this URL.
Functions
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
.
Details
- Method:
post
- Path:
/v1/files
@spec list( params :: %{ optional(:created) => created() | integer(), optional(:ending_before) => binary(), optional(:expand) => [binary()], optional(:limit) => integer(), optional(:purpose) => :account_requirement | :additional_verification | :business_icon | :business_logo | :customer_signature | :dispute_evidence | :document_provider_identity_document | :finance_report_run | :identity_document | :identity_document_downloadable | :pci_document | :selfie | :sigma_scheduled_query | :tax_document_user_upload | :terminal_reader_splashscreen, optional(:starting_after) => binary() }, opts :: Keyword.t() ) :: {:ok, Stripe.List.t(t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Returns a list of the files that your account has access to. Stripe sorts and returns the files by their creation dates, placing the most recently created files at the top.
Details
- Method:
get
- Path:
/v1/files
@spec retrieve( file :: binary(), params :: %{optional(:expand) => [binary()]}, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Retrieves the details of an existing file object. After you supply a unique file ID, Stripe returns the corresponding file object. Learn how to access file contents.
Details
- Method:
get
- Path:
/v1/files/{file}