The section will describe the file API overview, request model, and response model.
Overview
The files API endpoint in Tap is used to upload files to the Tap server. This is typically used in the onboarding process for merchants, where the file IDs are required for creating a business account, uploading required documents such as ID, commercial registration license, and logo, and for other API requests.
File Request Example
To upload a file, a request of type multipart/form-data is required. The request must include the file to be uploaded, as well as the parameters for creating a file. These parameters are listed in the File Body Request Table.
After the file is uploaded, the response will include a file ID that can be used to reference the file in other API requests. It is important to note that there are limits to the file size and type that can be uploaded, and files that exceed these limits will not be accepted by the Tap server.
File Body Request Table (multipart/form-data)
Field Name | Field Type | Description | Data Format |
---|---|---|---|
| file | required | |
| string | required For more details check File Purpose | Text |
| string | required | Text |
| boolean | required | true/false |
| timestamp | required | millisecond |
| object | optional |
File Purpose Table
PURPOSE | SUPPORTED FILE FORMATS | DESCRIPTION | MAX SIZE |
---|---|---|---|
business_logo | A business logo. | GIF, JPEG, PNG | 512KB |
customer_signature | A customer signature. | JPG, PNG | 4MB |
dispute_evidence | Evidence to submit with a dispute response. | JPEG, PDF, PNG | 8MB |
identity_document | A document to verify the identity of an account owner during account provisioning. | JPEG, PNG | < 10MB |
pci_document | A self-assessment PCI questionnaire. | 16MB | |
tax_document_user_upload | A user-uploaded tax document.A user-uploaded tax document. | CSV, DOCX, JPG, PDF, PNG, XLS, XLSX, | 16MB |
File Format Table (Possible values)
FILE FORMAT | MIME TYPE |
---|---|
CSV | text/csv |
DOCX | application/vnd.openxmlformats-officedocument.wordprocessingml.documentapplication/vnd.openxmlformats-officedocument.wordprocessingml.document |
GIF | image/gif |
PNG | image/png |
JPEG | image/jpeg |
application/pdf | |
XLS | application/vnd.ms-excel |
XLSX | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet |
File Response Example
After uploading a file, the JSON response will be returned with the file id that is required in some APIs. In the following table, you will find the response details.
Key | Value | Description |
---|---|---|
| string | optional |
| string | optional |
| boolean | optional |
| string | optional |
| string | optional |
| integer | optional |
| string | optional |
| string | optional |
| integer | optional |
| string | optional |
| string | optional |
| string | optional |
| array[object] | optional |
{
"id": "file_641212279714869248",
"object": "file",
"live_mode": false,
"api_version": "1.0",
"feature_version": "1.0",
"created": 1572947320,
"filename": "8801760e0a28ae2105e4ada503e30b8c.jpg",
"purpose": "identity_document",
"size": 346827,
"title": "test",
"type": "jpg",
"url": "/files/file_641212279714869248",
"links": [
{
"id": "link_641212281036075008",
"object": "file_link",
"live_mode": true,
"api_version": "1.0",
"feature_version": "1.0",
"created": 1572947320,
"expired": false,
"expires_at": 1234567,
"metadata": {
"key1": "value1",
"key2": "value2"
},
"url": "/links/fl_test_641212281036075009"
}
]
}