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:

Response

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"}

Query / List

URL: http://xpenser.com/api/v1.0/receipts

Method: GET

Parameters:

None.

Response

Sample Usage:

List all unattached receipts:

curl -u username:password "http://xpenser.com/api/v1.0/receipts"

Response:

[
    {
        "image": "736/f1608e46-698f-429f-a987-213ec18d1be2.jpg", 
        "id": 474, 
        "pieces": null
    }, 
    {
        "image": "736/29d9e202-987f-4391-a829-f6ef04addefb.jpg", 
        "id": 475, 
        "pieces": null
    }, 
    {
        "image": "736/c957d8f1-d4c9-47d2-ab5c-bb379507f509.jpg", 
        "id": 476, 
        "pieces": null
    }
]