View Source Stripe.File (stripity_stripe v3.1.1)

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 independetly (for example, the results of a Sigma scheduled query).

Related guide: File upload guide

Link to this section Summary

Types

t()

The file type.

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.

Link to this section Types

@type created() :: %{
  optional(:gt) => integer(),
  optional(:gte) => integer(),
  optional(:lt) => integer(),
  optional(:lte) => integer()
}
@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, or png).
  • url Use your live secret API key to download the file from this URL.

Link to this section Functions

Link to this function

create(params \\ %{}, opts \\ [])

View Source

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
Link to this function

list(params \\ %{}, opts \\ [])

View Source
@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
Link to this function

retrieve(file, params \\ %{}, opts \\ [])

View Source
@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}