Xpenser API: Receipts
Upload
URL: http://xpenser.com/api/receipt/
Method: POST - The receipt is uploaded via an HTTP file upload - a multi-part POST.
Parameters:
expense: id of expense to attach receipt tofile: receipt file to be uploaded, as an HTTP file upload
Response
statusindicated whether upload was successful, using HTTP return codes. 200 indicates success.expenseid: id of expense receipt was attached toimage: name of image as stored by Xpenser
Sample Usage:
Upload the file /tmp/sample-receipt.png and attach it to expense 829500:
curl -F file=@/tmp/sample-receipt.png -F expense=829500 -u username:password "http://xpenser.com/api/receipt/"
Response:
{"status": 200, "expenseid": 829500, "receiptid": 3496, "image": "4/70043344-1075-40c1-97ee-b58e780bfe3f.jpg"}