Returns an attachment image, either an unprocessed or a processed one
Update an existing image by changing its rotation angle
Param name | Description |
---|---|
attachment
required |
Validations:
|
attachment[transaction_id]
required |
Receipt ID Validations:
|
attachment[rotate_angle]
optional |
How many degrees to rotate an image to; may be either positive or negative number, e.g. 30, -90 Validations:
|
Upload new attachment either to an existing receipt or initiate creating a new receipt.
An example of creating a new draft transaction and adding an attachment via curl:
curl -X POST -F "file=@/home/buru/Pictures/crycat.png" -F "draft=1" https://app.bezala.com/api/attachments?token=helloworld
Response:
{"id":1091,"file":"/uploads/tmp/1622055993-1726493-0003-4122/crycat.png","transaction_id":2804}
Param name | Description |
---|---|
file
required |
Either a single FILE object or a hash with one or more files for upload, e.g. {“0”: FILE1, “1”: FILE2} Validations:
|
transaction_id
optional |
Receipt id in case attachment is being added to existing receipt. Warning: optional only if “draft” param is set to 1 Validations:
|
draft
optional |
If equal to 1, attachment can be saved without a transaction_id Validations:
|
Param name | Description |
---|---|
id
required |
Attachment ID Validations:
|
Update images display order
{ "attachment": ["395", "397", "396"] }
Param name | Description |
---|---|
attachment
optional |
Array of attachment ids in the desired order Validations:
|