Search documentation of stripe_elixir

# StripeElixir.Services.FileService (stripe_elixir v0.1.0)

Copy Markdown View Source

File

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

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

Create a file

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

List all files

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

Retrieve a file

## Functions

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

    @spec create(StripeElixir.Client.t(), map(), keyword()) ::
      {:ok, term()} | {:error, StripeElixir.Error.t()}

Create 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`.

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

    @spec list(StripeElixir.Client.t(), map(), keyword()) ::
      {:ok, term()} | {:error, StripeElixir.Error.t()}

List all files

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.

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

    @spec retrieve(StripeElixir.Client.t(), String.t(), map(), keyword()) ::
      {:ok, term()} | {:error, StripeElixir.Error.t()}

Retrieve a file

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.