Add file to a transaction
const url = 'http://localhost:8000/api/v1/transactions/1/files';const form = new FormData();form.append('files[]', 'file');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:8000/api/v1/transactions/1/files \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: multipart/form-data' \ --form 'files[]=@file'Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”ID of the transaction
Request Body required
Section titled “Request Body required ”object
Files to attach (jpg, jpeg, png, pdf; max 1MB each)
Responses
Section titled “ Responses ”Files uploaded successfully
object
ID of the transaction
Type of the transaction (income or expense)
Amount of the transaction
Description of the transaction
Date and time of the transaction
List of categories of the transaction
Set the transaction as a recurring transaction
ID of the user who created the transaction
Transaction amount converted to the currency of the budget
ID of the associated transfer, if any
Client-generated ID of the associated wallet
Client-generated ID of the associated party
Files attached to the transaction
object
ID of the file
Path or content of the file
URL to access the file
Type of file (image, icon, emoji, pdf)
Related model name
ID of the related model
object
ID of the transaction
ID of the transaction
Set how often the transaction should repeat
Set how often the transaction should repeat
When the transaction stops repeating
When next the transaction should happen
Example
{ "type": "income", "files": [ { "type": "image" } ]}Transaction not found
Validation error