File Service
Represents files uploaded to Airwallex for secure storage and retrieval via download links. Each file can be referenced in other API endpoints using its unique file identifier.
POST /api/v1/files/download_linksPOST /api/v1/files/upload
Get file download links
POST /api/v1/files/download_links
Populate the download request with a list of file unique identifiers and the API responds with associated download links. Links will be valid for 1 day. Files do not exceed 20MB. Can also be used by Scale platforms to download files for connected accounts using the x-on-behalf-of header.
List of file unique identifiers to retrieve download links for.
File unique identifiers that could not be found.
File download links.
Content type.
File download URL expiration date.
File unique identifier.
File name, if provided during upload.
File size in bytes.
File download URL.
| Error status | Description |
|---|---|
| 400 | Possible errors: |
| 401 | Possible errors: |
| 429 | Too many requests |
| 500 | Service unavailable |
$curl --request POST \> --url 'https://api-demo.airwallex.com/api/v1/files/download_links' \> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \> --header 'Content-Type: application/json' \> --data '{> "file_ids": []>}'
1{2 "absent_files": [3 "YmVkODdkNGMtNWFiZC00MzM0LdGVzdC5wZGZfMTYxNTI2MDIxOQ=="4 ],5 "files": [6 {7 "content_type": "application/octet-stream",8 "download_link_valid_until": "2022-01-18T21:38:52Z",9 "file_id": "YmVkODdkNGMtNWFiZC00MzM0LdGVzdC5wZGZfMTYxNTI2MDIxOQ==",10 "filename": "registration_certificate.pdf",11 "size": 120591,12 "url": "https://airwallex-upload-shenzhen-dev.oss-accelerate.aliyuncs.com/YmVkOI2MDIxOQ%3D%3D?Expires=1637271532&OSSAccessKeyId=&Signature=GNGvvv0%3D"13 }14 ]15}
Upload a file
POST /api/v1/files/upload
Upload a file to Airwallex using this endpoint of the files.airwallex.com subdomain. The max size of upload file is up to 20MB. When you upload a file, the API responds with a file_id. This file unique identifier can then be referenced as required as part of the attachments object in our other endpoints.
The notes of the uploaded file, max length is 50 characters
The file to upload, max length of filename is 50 characters
created time of file
Unique identifier of file, to be referenced in other endpoints
Name of file
notes of file
type of object. Can be file or list
Size in bytes
| Error status | Description |
|---|---|
| 400 | Possible errors: |
| 401 | Possible errors: |
| 429 | Too many requests |
| 500 | Service unavailable |
$curl --request POST \> --url 'https://files-demo.airwallex.com/api/v1/files/upload' \> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \> --header 'Content-Type: multipart/form-data' \> --data '{> "file": "@your_file.pdf">}'
1{2 "created": 0,3 "file_id": "<string>",4 "filename": "<string>",5 "notes": "<string>",6 "object_type": "<string>",7 "size": 08}