Class File

All Implemented Interfaces:
HasId, StripeActiveObject, StripeObjectInterface

public class File extends ApiResource implements HasId
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

  • Constructor Details

    • File

      public File()
  • Method Details

    • create

      public static File create(Map<String,Object> params) throws StripeException
      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.

      Throws:
      StripeException
    • create

      public static File create(Map<String,Object> params, RequestOptions options) throws StripeException
      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.

      Throws:
      StripeException
    • create

      public static File create(FileCreateParams params) throws StripeException
      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.

      Throws:
      StripeException
    • create

      public static File create(FileCreateParams params, RequestOptions options) throws StripeException
      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.

      Throws:
      StripeException
    • list

      public static FileCollection list(Map<String,Object> params) throws StripeException
      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.
      Throws:
      StripeException
    • list

      public static FileCollection list(Map<String,Object> params, RequestOptions options) throws StripeException
      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.
      Throws:
      StripeException
    • list

      public static FileCollection list(FileListParams params) throws StripeException
      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.
      Throws:
      StripeException
    • list

      public static FileCollection list(FileListParams params, RequestOptions options) throws StripeException
      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.
      Throws:
      StripeException
    • retrieve

      public static File retrieve(String file) throws StripeException
      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.
      Throws:
      StripeException
    • retrieve

      public static File retrieve(String file, RequestOptions options) throws StripeException
      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.
      Throws:
      StripeException
    • retrieve

      public static File retrieve(String file, Map<String,Object> params, RequestOptions options) throws StripeException
      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.
      Throws:
      StripeException
    • retrieve

      public static File retrieve(String file, FileRetrieveParams params, RequestOptions options) throws StripeException
      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.
      Throws:
      StripeException
    • setResponseGetter

      public void setResponseGetter(StripeResponseGetter responseGetter)
      Description copied from interface: StripeActiveObject
      Method is used by the containing object or StripeResponseGetter implementations to set the StripeResponseGetter instance used to make further requests.
      Specified by:
      setResponseGetter in interface StripeActiveObject
      Overrides:
      setResponseGetter in class ApiResource
      Parameters:
      responseGetter - the StripeResponseGetter instance to use for making further requests.
    • getCreated

      public Long getCreated()
      Time at which the object was created. Measured in seconds since the Unix epoch.
    • getExpiresAt

      public Long getExpiresAt()
      The file expires and isn't available at this time in epoch seconds.
    • getFilename

      public String getFilename()
      The suitable name for saving the file to a filesystem.
    • getLinks

      public FileLinkCollection getLinks()
      A list of file links that point at this file.
    • getObject

      public String getObject()
      String representing the object's type. Objects of the same type share the same value.

      Equal to file.

    • getPurpose

      public String getPurpose()
      The purpose of the uploaded file.

      One of account_requirement, additional_verification, business_icon, business_logo, customer_signature, dispute_evidence, document_provider_identity_document, finance_report_run, identity_document, identity_document_downloadable, issuing_regulatory_reporting, pci_document, selfie, sigma_scheduled_query, tax_document_user_upload, or terminal_reader_splashscreen.

    • getSize

      public Long getSize()
      The size of the file object in bytes.
    • getTitle

      public String getTitle()
      A suitable title for the document.
    • getType

      public String getType()
      The returned file type (for example, csv, pdf, jpg, or png).
    • getUrl

      public String getUrl()
      Use your live secret API key to download the file from this URL.
    • setCreated

      public void setCreated(Long created)
      Time at which the object was created. Measured in seconds since the Unix epoch.
    • setExpiresAt

      public void setExpiresAt(Long expiresAt)
      The file expires and isn't available at this time in epoch seconds.
    • setFilename

      public void setFilename(String filename)
      The suitable name for saving the file to a filesystem.
    • setId

      public void setId(String id)
      Unique identifier for the object.
    • setLinks

      public void setLinks(FileLinkCollection links)
      A list of file links that point at this file.
    • setObject

      public void setObject(String object)
      String representing the object's type. Objects of the same type share the same value.

      Equal to file.

    • setPurpose

      public void setPurpose(String purpose)
      The purpose of the uploaded file.

      One of account_requirement, additional_verification, business_icon, business_logo, customer_signature, dispute_evidence, document_provider_identity_document, finance_report_run, identity_document, identity_document_downloadable, issuing_regulatory_reporting, pci_document, selfie, sigma_scheduled_query, tax_document_user_upload, or terminal_reader_splashscreen.

    • setSize

      public void setSize(Long size)
      The size of the file object in bytes.
    • setTitle

      public void setTitle(String title)
      A suitable title for the document.
    • setType

      public void setType(String type)
      The returned file type (for example, csv, pdf, jpg, or png).
    • setUrl

      public void setUrl(String url)
      Use your live secret API key to download the file from this URL.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getId

      public String getId()
      Unique identifier for the object.
      Specified by:
      getId in interface HasId