published on Friday, Aug 14, 2026 by Pulumi
published on Friday, Aug 14, 2026 by Pulumi
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
Create File Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new File(name: string, args: FileArgs, opts?: CustomResourceOptions);@overload
def File(resource_name: str,
args: FileArgs,
opts: Optional[ResourceOptions] = None)
@overload
def File(resource_name: str,
opts: Optional[ResourceOptions] = None,
file: Optional[str] = None,
purpose: Optional[str] = None,
file_link_data: Optional[FileFileLinkDataArgs] = None)func NewFile(ctx *Context, name string, args FileArgs, opts ...ResourceOption) (*File, error)public File(string name, FileArgs args, CustomResourceOptions? opts = null)type: stripe:File
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "stripe_file" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args FileArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args FileArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args FileArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args FileArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args FileArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var fileResource = new Stripe.File("fileResource", new()
{
File = "string",
Purpose = "string",
FileLinkData = new Stripe.Inputs.FileFileLinkDataArgs
{
Create = false,
ExpiresAt = 0.0,
Metadata =
{
{ "string", "string" },
},
},
});
example, err := stripe.NewFile(ctx, "fileResource", &stripe.FileArgs{
File: pulumi.String("string"),
Purpose: pulumi.String("string"),
FileLinkData: &stripe.FileFileLinkDataArgs{
Create: pulumi.Bool(false),
ExpiresAt: pulumi.Float64(0),
Metadata: pulumi.StringMap{
"string": pulumi.String("string"),
},
},
})
resource "stripe_file" "fileResource" {
lifecycle {
create_before_destroy = true
}
file = "string"
purpose = "string"
file_link_data = {
create = false
expires_at = 0
metadata = {
"string" = "string"
}
}
}
var fileResource = new File("fileResource", FileArgs.builder()
.file("string")
.purpose("string")
.fileLinkData(FileFileLinkDataArgs.builder()
.create(false)
.expiresAt(0.0)
.metadata(Map.of("string", "string"))
.build())
.build());
file_resource = stripe.File("fileResource",
file="string",
purpose="string",
file_link_data={
"create": False,
"expires_at": float(0),
"metadata": {
"string": "string",
},
})
const fileResource = new stripe.File("fileResource", {
file: "string",
purpose: "string",
fileLinkData: {
create: false,
expiresAt: 0,
metadata: {
string: "string",
},
},
});
type: stripe:File
properties:
file: string
fileLinkData:
create: false
expiresAt: 0
metadata:
string: string
purpose: string
File Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The File resource accepts the following input properties:
- File string
- A file to upload. Make sure that the specifications follow RFC 2388, which defines file transfers for the
multipart/form-dataprotocol. - Purpose string
- The purpose of the uploaded file.
- File
Link FileData File Link Data - Optional parameters that automatically create a file link for the newly created file.
- File string
- A file to upload. Make sure that the specifications follow RFC 2388, which defines file transfers for the
multipart/form-dataprotocol. - Purpose string
- The purpose of the uploaded file.
- File
Link FileData File Link Data Args - Optional parameters that automatically create a file link for the newly created file.
- file String
- A file to upload. Make sure that the specifications follow RFC 2388, which defines file transfers for the
multipart/form-dataprotocol. - purpose String
- The purpose of the uploaded file.
- file
Link FileData File Link Data - Optional parameters that automatically create a file link for the newly created file.
- file string
- A file to upload. Make sure that the specifications follow RFC 2388, which defines file transfers for the
multipart/form-dataprotocol. - purpose string
- The purpose of the uploaded file.
- file
Link FileData File Link Data - Optional parameters that automatically create a file link for the newly created file.
- file str
- A file to upload. Make sure that the specifications follow RFC 2388, which defines file transfers for the
multipart/form-dataprotocol. - purpose str
- The purpose of the uploaded file.
- file_
link_ Filedata File Link Data Args - Optional parameters that automatically create a file link for the newly created file.
- file String
- A file to upload. Make sure that the specifications follow RFC 2388, which defines file transfers for the
multipart/form-dataprotocol. - purpose String
- The purpose of the uploaded file.
- file
Link Property MapData - Optional parameters that automatically create a file link for the newly created file.
Outputs
All input properties are implicitly available as output properties. Additionally, the File resource produces the following output properties:
- Created double
- Time at which the object was created. Measured in seconds since the Unix epoch.
- Expires
At double - The file expires and isn't available at this time in epoch seconds.
- Filename string
- The suitable name for saving the file to a filesystem.
- Id string
- The provider-assigned unique ID for this managed resource.
- Object string
- String representing the object's type. Objects of the same type share the same value.
- Size double
- The size of the file object in bytes.
- Title string
- A suitable title for the document.
- Type string
- The returned file type (for example,
csv,pdf,jpg, orpng). - Url string
- Use your live secret API key to download the file from this URL.
- Created float64
- Time at which the object was created. Measured in seconds since the Unix epoch.
- Expires
At float64 - The file expires and isn't available at this time in epoch seconds.
- Filename string
- The suitable name for saving the file to a filesystem.
- Id string
- The provider-assigned unique ID for this managed resource.
- Object string
- String representing the object's type. Objects of the same type share the same value.
- Size float64
- The size of the file object in bytes.
- Title string
- A suitable title for the document.
- Type string
- The returned file type (for example,
csv,pdf,jpg, orpng). - Url string
- Use your live secret API key to download the file from this URL.
- created number
- Time at which the object was created. Measured in seconds since the Unix epoch.
- expires_
at number - The file expires and isn't available at this time in epoch seconds.
- filename string
- The suitable name for saving the file to a filesystem.
- id string
- The provider-assigned unique ID for this managed resource.
- object string
- String representing the object's type. Objects of the same type share the same value.
- size number
- The size of the file object in bytes.
- title string
- A suitable title for the document.
- type string
- The returned file type (for example,
csv,pdf,jpg, orpng). - url string
- Use your live secret API key to download the file from this URL.
- created Double
- Time at which the object was created. Measured in seconds since the Unix epoch.
- expires
At Double - The file expires and isn't available at this time in epoch seconds.
- filename String
- The suitable name for saving the file to a filesystem.
- id String
- The provider-assigned unique ID for this managed resource.
- object String
- String representing the object's type. Objects of the same type share the same value.
- size Double
- The size of the file object in bytes.
- title String
- A suitable title for the document.
- type String
- The returned file type (for example,
csv,pdf,jpg, orpng). - url String
- Use your live secret API key to download the file from this URL.
- created number
- Time at which the object was created. Measured in seconds since the Unix epoch.
- expires
At number - The file expires and isn't available at this time in epoch seconds.
- filename string
- The suitable name for saving the file to a filesystem.
- id string
- The provider-assigned unique ID for this managed resource.
- object string
- String representing the object's type. Objects of the same type share the same value.
- size number
- The size of the file object in bytes.
- title string
- A suitable title for the document.
- type string
- The returned file type (for example,
csv,pdf,jpg, orpng). - url string
- Use your live secret API key to download the file from this URL.
- created float
- Time at which the object was created. Measured in seconds since the Unix epoch.
- expires_
at float - The file expires and isn't available at this time in epoch seconds.
- filename str
- The suitable name for saving the file to a filesystem.
- id str
- The provider-assigned unique ID for this managed resource.
- object str
- String representing the object's type. Objects of the same type share the same value.
- size float
- The size of the file object in bytes.
- title str
- A suitable title for the document.
- type str
- The returned file type (for example,
csv,pdf,jpg, orpng). - url str
- Use your live secret API key to download the file from this URL.
- created Number
- Time at which the object was created. Measured in seconds since the Unix epoch.
- expires
At Number - The file expires and isn't available at this time in epoch seconds.
- filename String
- The suitable name for saving the file to a filesystem.
- id String
- The provider-assigned unique ID for this managed resource.
- object String
- String representing the object's type. Objects of the same type share the same value.
- size Number
- The size of the file object in bytes.
- title String
- A suitable title for the document.
- type String
- The returned file type (for example,
csv,pdf,jpg, orpng). - url String
- Use your live secret API key to download the file from this URL.
Look up Existing File Resource
Get an existing File resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: FileState, opts?: CustomResourceOptions): File@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
created: Optional[float] = None,
expires_at: Optional[float] = None,
file: Optional[str] = None,
file_link_data: Optional[FileFileLinkDataArgs] = None,
filename: Optional[str] = None,
object: Optional[str] = None,
purpose: Optional[str] = None,
size: Optional[float] = None,
title: Optional[str] = None,
type: Optional[str] = None,
url: Optional[str] = None) -> Filefunc GetFile(ctx *Context, name string, id IDInput, state *FileState, opts ...ResourceOption) (*File, error)public static File Get(string name, Input<string> id, FileState? state, CustomResourceOptions? opts = null)public static File get(String name, Output<String> id, FileState state, CustomResourceOptions options)resources: _: type: stripe:File get: id: ${id}import {
to = stripe_file.example
id = "${id}"
}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Created double
- Time at which the object was created. Measured in seconds since the Unix epoch.
- Expires
At double - The file expires and isn't available at this time in epoch seconds.
- File string
- A file to upload. Make sure that the specifications follow RFC 2388, which defines file transfers for the
multipart/form-dataprotocol. - File
Link FileData File Link Data - Optional parameters that automatically create a file link for the newly created file.
- Filename string
- The suitable name for saving the file to a filesystem.
- Object string
- String representing the object's type. Objects of the same type share the same value.
- Purpose string
- The purpose of the uploaded file.
- Size double
- The size of the file object in bytes.
- Title string
- A suitable title for the document.
- Type string
- The returned file type (for example,
csv,pdf,jpg, orpng). - Url string
- Use your live secret API key to download the file from this URL.
- Created float64
- Time at which the object was created. Measured in seconds since the Unix epoch.
- Expires
At float64 - The file expires and isn't available at this time in epoch seconds.
- File string
- A file to upload. Make sure that the specifications follow RFC 2388, which defines file transfers for the
multipart/form-dataprotocol. - File
Link FileData File Link Data Args - Optional parameters that automatically create a file link for the newly created file.
- Filename string
- The suitable name for saving the file to a filesystem.
- Object string
- String representing the object's type. Objects of the same type share the same value.
- Purpose string
- The purpose of the uploaded file.
- Size float64
- The size of the file object in bytes.
- Title string
- A suitable title for the document.
- Type string
- The returned file type (for example,
csv,pdf,jpg, orpng). - Url string
- Use your live secret API key to download the file from this URL.
- created number
- Time at which the object was created. Measured in seconds since the Unix epoch.
- expires_
at number - The file expires and isn't available at this time in epoch seconds.
- file string
- A file to upload. Make sure that the specifications follow RFC 2388, which defines file transfers for the
multipart/form-dataprotocol. - file_
link_ objectdata - Optional parameters that automatically create a file link for the newly created file.
- filename string
- The suitable name for saving the file to a filesystem.
- object string
- String representing the object's type. Objects of the same type share the same value.
- purpose string
- The purpose of the uploaded file.
- size number
- The size of the file object in bytes.
- title string
- A suitable title for the document.
- type string
- The returned file type (for example,
csv,pdf,jpg, orpng). - url string
- Use your live secret API key to download the file from this URL.
- created Double
- Time at which the object was created. Measured in seconds since the Unix epoch.
- expires
At Double - The file expires and isn't available at this time in epoch seconds.
- file String
- A file to upload. Make sure that the specifications follow RFC 2388, which defines file transfers for the
multipart/form-dataprotocol. - file
Link FileData File Link Data - Optional parameters that automatically create a file link for the newly created file.
- filename String
- The suitable name for saving the file to a filesystem.
- object String
- String representing the object's type. Objects of the same type share the same value.
- purpose String
- The purpose of the uploaded file.
- size Double
- The size of the file object in bytes.
- title String
- A suitable title for the document.
- type String
- The returned file type (for example,
csv,pdf,jpg, orpng). - url String
- Use your live secret API key to download the file from this URL.
- created number
- Time at which the object was created. Measured in seconds since the Unix epoch.
- expires
At number - The file expires and isn't available at this time in epoch seconds.
- file string
- A file to upload. Make sure that the specifications follow RFC 2388, which defines file transfers for the
multipart/form-dataprotocol. - file
Link FileData File Link Data - Optional parameters that automatically create a file link for the newly created file.
- filename string
- The suitable name for saving the file to a filesystem.
- object string
- String representing the object's type. Objects of the same type share the same value.
- purpose string
- The purpose of the uploaded file.
- size number
- The size of the file object in bytes.
- title string
- A suitable title for the document.
- type string
- The returned file type (for example,
csv,pdf,jpg, orpng). - url string
- Use your live secret API key to download the file from this URL.
- created float
- Time at which the object was created. Measured in seconds since the Unix epoch.
- expires_
at float - The file expires and isn't available at this time in epoch seconds.
- file str
- A file to upload. Make sure that the specifications follow RFC 2388, which defines file transfers for the
multipart/form-dataprotocol. - file_
link_ Filedata File Link Data Args - Optional parameters that automatically create a file link for the newly created file.
- filename str
- The suitable name for saving the file to a filesystem.
- object str
- String representing the object's type. Objects of the same type share the same value.
- purpose str
- The purpose of the uploaded file.
- size float
- The size of the file object in bytes.
- title str
- A suitable title for the document.
- type str
- The returned file type (for example,
csv,pdf,jpg, orpng). - url str
- Use your live secret API key to download the file from this URL.
- created Number
- Time at which the object was created. Measured in seconds since the Unix epoch.
- expires
At Number - The file expires and isn't available at this time in epoch seconds.
- file String
- A file to upload. Make sure that the specifications follow RFC 2388, which defines file transfers for the
multipart/form-dataprotocol. - file
Link Property MapData - Optional parameters that automatically create a file link for the newly created file.
- filename String
- The suitable name for saving the file to a filesystem.
- object String
- String representing the object's type. Objects of the same type share the same value.
- purpose String
- The purpose of the uploaded file.
- size Number
- The size of the file object in bytes.
- title String
- A suitable title for the document.
- type String
- The returned file type (for example,
csv,pdf,jpg, orpng). - url String
- Use your live secret API key to download the file from this URL.
Supporting Types
FileFileLinkData, FileFileLinkDataArgs
- Create bool
- Set this to
trueto create a file link for the newly created file. Creating a link is only possible when the file'spurposeis one of the following:business_icon,business_logo,customer_signature,dispute_evidence,issuing_regulatory_reporting,pci_document,tax_document_user_upload,terminal_android_apk, orterminal_reader_splashscreen. - Expires
At double - The link isn't available after this future timestamp.
- Metadata Dictionary<string, string>
- Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to
metadata.
- Create bool
- Set this to
trueto create a file link for the newly created file. Creating a link is only possible when the file'spurposeis one of the following:business_icon,business_logo,customer_signature,dispute_evidence,issuing_regulatory_reporting,pci_document,tax_document_user_upload,terminal_android_apk, orterminal_reader_splashscreen. - Expires
At float64 - The link isn't available after this future timestamp.
- Metadata map[string]string
- Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to
metadata.
- create bool
- Set this to
trueto create a file link for the newly created file. Creating a link is only possible when the file'spurposeis one of the following:business_icon,business_logo,customer_signature,dispute_evidence,issuing_regulatory_reporting,pci_document,tax_document_user_upload,terminal_android_apk, orterminal_reader_splashscreen. - expires_
at number - The link isn't available after this future timestamp.
- metadata map(string)
- Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to
metadata.
- create Boolean
- Set this to
trueto create a file link for the newly created file. Creating a link is only possible when the file'spurposeis one of the following:business_icon,business_logo,customer_signature,dispute_evidence,issuing_regulatory_reporting,pci_document,tax_document_user_upload,terminal_android_apk, orterminal_reader_splashscreen. - expires
At Double - The link isn't available after this future timestamp.
- metadata Map<String,String>
- Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to
metadata.
- create boolean
- Set this to
trueto create a file link for the newly created file. Creating a link is only possible when the file'spurposeis one of the following:business_icon,business_logo,customer_signature,dispute_evidence,issuing_regulatory_reporting,pci_document,tax_document_user_upload,terminal_android_apk, orterminal_reader_splashscreen. - expires
At number - The link isn't available after this future timestamp.
- metadata {[key: string]: string}
- Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to
metadata.
- create bool
- Set this to
trueto create a file link for the newly created file. Creating a link is only possible when the file'spurposeis one of the following:business_icon,business_logo,customer_signature,dispute_evidence,issuing_regulatory_reporting,pci_document,tax_document_user_upload,terminal_android_apk, orterminal_reader_splashscreen. - expires_
at float - The link isn't available after this future timestamp.
- metadata Mapping[str, str]
- Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to
metadata.
- create Boolean
- Set this to
trueto create a file link for the newly created file. Creating a link is only possible when the file'spurposeis one of the following:business_icon,business_logo,customer_signature,dispute_evidence,issuing_regulatory_reporting,pci_document,tax_document_user_upload,terminal_android_apk, orterminal_reader_splashscreen. - expires
At Number - The link isn't available after this future timestamp.
- metadata Map<String>
- Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to
metadata.
Package Details
- Repository
- stripe stripe/terraform-provider-stripe
- License
- Notes
- This Pulumi package is based on the
stripeTerraform Provider.
published on Friday, Aug 14, 2026 by Pulumi