API reference
Test mode. Use your secret key on your server; live processing is currently disabled.
https://api.knoxapi.comSend form-encoded requests with Authorization: Bearer sk_test_....
Complete OpenAPI specification · Integration guide
Operations and schemas are based on the pinned Stripe OpenAPI specification (MIT). Nested object definitions and enums are available in the complete specification.
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.
Request parameters
| Parameter | Location | Type | Description |
|---|---|---|---|
created | query | one of multiple schemas | Only return files that were created during the given date interval. |
ending_before | query | string | A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. |
expand | query | array of string | Specifies which fields in the response should be expanded. |
limit | query | integer | A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. |
purpose | query | string | Filter queries by the file purpose. If you don't provide a purpose, the queries return unfiltered files. |
starting_after | query | string | A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. |
object. See the OpenAPI specification for the complete schema.
Responses
HTTP 200: Successful response.
| Field | Type | Description |
|---|---|---|
data required | array of file | |
has_more required | boolean | True if this list has another page of items after this one that can be fetched. |
object required | string | String representing the object's type. Objects of the same type share the same value. Always has the value `list`. |
url required | string | The URL where this list can be accessed. |
HTTP default: Error response.
| Field | Type | Description |
|---|---|---|
error required | api_errors |
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.
Request parameters
No parameters.
Responses
HTTP 200: Successful response.
| Field | Type | Description |
|---|---|---|
created required | integer | Time at which the object was created. Measured in seconds since the Unix epoch. |
expires_at | integer | 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 required | string | Unique identifier for the object. |
links | object | A list of [file links](https://api.stripe.com#file_links) that point at this file. |
object required | string | String representing the object's type. Objects of the same type share the same value. |
purpose required | string | The [purpose](https://docs.stripe.com/file-upload#uploading-a-file) of the uploaded file. |
size required | integer | 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`, or `png`). |
url | string | Use your live secret API key to download the file from this URL. |
HTTP default: Error response.
| Field | Type | Description |
|---|---|---|
error required | api_errors |
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.
Request parameters
| Parameter | Location | Type | Description |
|---|---|---|---|
expand | query | array of string | Specifies which fields in the response should be expanded. |
file | path | string |
object. See the OpenAPI specification for the complete schema.
Responses
HTTP 200: Successful response.
| Field | Type | Description |
|---|---|---|
created required | integer | Time at which the object was created. Measured in seconds since the Unix epoch. |
expires_at | integer | 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 required | string | Unique identifier for the object. |
links | object | A list of [file links](https://api.stripe.com#file_links) that point at this file. |
object required | string | String representing the object's type. Objects of the same type share the same value. |
purpose required | string | The [purpose](https://docs.stripe.com/file-upload#uploading-a-file) of the uploaded file. |
size required | integer | 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`, or `png`). |
url | string | Use your live secret API key to download the file from this URL. |
HTTP default: Error response.
| Field | Type | Description |
|---|---|---|
error required | api_errors |