Upload a transaction attachment
Upload a file attachment to a transaction. The file is uploaded via multipart/form-data. Supported file types include PDF, images (PNG, JPG, GIF), and common document formats.
Authentication
AuthorizationBearer
Bearer token authentication for Mercury API.
Use your API token in the Authorization header:
Authorization: Bearer TOKEN
Example:
Authorization: Bearer secret-token:mercury_production_wma_24SCp4G81X3yHL4Wq8FgzuaP9ye3VKf2mgTDctXyRg5HY_yrucrem
Your Mercury API token should include the ‘secret-token:’ prefix. Tokens can be generated from your Mercury dashboard settings.
Path parameters
transactionId
ID of the transaction to attach the file to
Request
File to upload. Use form field name 'file'. Optionally include 'attachmentType' field with value 'receipt', 'bill', or 'other'.
attachmentType
Type of attachment: ‘receipt’, ‘bill’, or ‘other’. Defaults to ‘other’.
Allowed values:
file
The file to upload
Response
Successfully uploaded attachment. Returns attachmentId and downloadUrl.
Errors
400
Bad Request Error
404
Not Found Error
413
Content Too Large Error
415
Unsupported Media Type Error

