Files

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 NameField TypeDescriptionData Format
filefilerequired
The file to be uploaded. This should follow the specifications of RFC 2388 (which defines file transfers for the multipart/form-data protocol).
file
purposestringrequired
The purpose of the file. Possible values are business_icon, business_logo, customer_signature, dispute_evidence, finance_report_run, identity_document, pci_document, sigma_scheduled_query, or tax_document_user_upload, memorandum_association, bank_statement , bank_certificate, article_of_association, commercial_registration

For more details check File Purpose
Text
titlestringrequired
Title of the document
Text
file_link_createbooleanrequired
Whether to create a public link for the newly created file
true/false
expires_attimestamprequired
A future timestamp after which the link will no longer be usable.
( use millisecond formate)
millisecond
file_link_meta_dataobjectoptional
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.

File Purpose Table

PURPOSESUPPORTED FILE FORMATSDESCRIPTIONMAX SIZE
business_logoA business logo.GIF, JPEG, PNG512KB
customer_signatureA customer signature.JPG, PNG4MB
dispute_evidenceEvidence to submit with a dispute response.JPEG, PDF, PNG8MB
identity_documentA document to verify the identity of an account owner during account provisioning.JPEG, PNG< 10MB
pci_documentA self-assessment PCI questionnaire.PDF16MB
tax_document_user_uploadA user-uploaded tax document.A user-uploaded tax document.CSV, DOCX, JPG, PDF, PNG, XLS, XLSX,16MB

File Format Table (Possible values)

FILE FORMATMIME TYPE
CSVtext/csv
DOCXapplication/vnd.openxmlformats-officedocument.wordprocessingml.documentapplication/vnd.openxmlformats-officedocument.wordprocessingml.document
GIFimage/gif
PNGimage/png
JPEGimage/jpeg
PDFapplication/pdf
XLSapplication/vnd.ms-excel
XLSXapplication/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.

KeyValueDescription
idstringoptional
File id, Its unique ID provide by Tap
objectstringoptional
Name of the object-"file"
live_modebooleanoptional
Environment mode
api_versionstringoptional
Tap API version
feature_versionstringoptional
Tap API feature version
createdintegeroptional
File created date and time, Measured in seconds since the Unix epoc
filenamestringoptional
Name of the file
purposestring optional
Purpose or Identification of the file (Please check the table File Formate to know Possible values & MAX SIZE)
sizeintegeroptional
The size in bytes of the file
titlestringoptional
A user friendly title for the file
typestringoptional
The type of the file returned (e.g., csv, pdf, jpg, or png).
urlstringoptional
URL of the file
linksarray[object]optional
List of file links
{
  "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"
    }
  ]
}