File Links
To share the contents of a File
object with non-Stripe users, you can create a FileLink
. FileLink
s contain a URL that you can use to retrieve the contents of the file without authentication.
The File Link object
Attributes
- idstring
Unique identifier for the object.
- expires_
atnullable timestamp Time that the link expires.
- filestringExpandable
The file object this link points to.
- metadataobject
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.
- urlnullable string
The publicly accessible URL to download the file.
More attributes
- objectstring
- createdtimestamp
- expiredboolean
- livemodeboolean
{
"id": "link_1Mr23jLkdIwHu7ix65betcoo",
"object": "file_link",
"created": 1680108075,
"expired": false,
"expires_at": null,
"file": "file_1Mr23iLkdIwHu7ixQkCV3CBR",
"livemode": false,
"metadata": {},
"url": "https://files.stripe.com/links/MDB8YWNjdF8xTTJKVGtMa2RJd0h1N2l4fGZsX3Rlc3RfaXVoY2hrUnJPMzlBR3dPb01XMmFkSTVq00yUPLFf3h"
}
Create a file link
Creates a new file link object.
Parameters
- filestringRequired
The ID of the file. The file’s
purpose
must be one of the following:business_icon
,business_logo
,customer_signature
,dispute_evidence
,finance_report_run
,identity_document_downloadable
,pci_document
,selfie
,sigma_scheduled_query
,tax_document_user_upload
, orterminal_reader_splashscreen
. - expires_
attimestamp The link isn’t usable after this future timestamp.
- metadataobject
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
.
Returns
Returns the file link object if successful and raises an error otherwise.
{
"id": "link_1Mr23jLkdIwHu7ix65betcoo",
"object": "file_link",
"created": 1680108075,
"expired": false,
"expires_at": null,
"file": "file_1Mr23iLkdIwHu7ixQkCV3CBR",
"livemode": false,
"metadata": {},
"url": "https://files.stripe.com/links/MDB8YWNjdF8xTTJKVGtMa2RJd0h1N2l4fGZsX3Rlc3RfaXVoY2hrUnJPMzlBR3dPb01XMmFkSTVq00yUPLFf3h"
}
Update a file link
Updates an existing file link object. Expired links can no longer be updated.
Parameters
- expires_
atstring | timestamp A future timestamp after which the link will no longer be usable, or
now
to expire the link immediately. - metadataobject
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
.
Returns
Returns the file link object if successful, and raises an error otherwise.
{
"id": "link_1Mr23jLkdIwHu7ix65betcoo",
"object": "file_link",
"created": 1680108075,
"expired": false,
"expires_at": null,
"file": "file_1Mr23iLkdIwHu7ixQkCV3CBR",
"livemode": false,
"metadata": {
"order_id": "6735"
},
"url": "https://files.stripe.com/links/MDB8YWNjdF8xTTJKVGtMa2RJd0h1N2l4fGZsX3Rlc3RfaXVoY2hrUnJPMzlBR3dPb01XMmFkSTVq00yUPLFf3h"
}
Retrieve a file link
Retrieves the file link with the given ID.
Parameters
No parameters.
Returns
If the identifier you provide is valid, a file link object returns. If not, Stripe raises an error.
{
"id": "link_1Mr23jLkdIwHu7ix65betcoo",
"object": "file_link",
"created": 1680108075,
"expired": false,
"expires_at": null,
"file": "file_1Mr23iLkdIwHu7ixQkCV3CBR",
"livemode": false,
"metadata": {},
"url": "https://files.stripe.com/links/MDB8YWNjdF8xTTJKVGtMa2RJd0h1N2l4fGZsX3Rlc3RfaXVoY2hrUnJPMzlBR3dPb01XMmFkSTVq00yUPLFf3h"
}