Create Expense with Receipt
In order to create an expense with a receipt, you will first need to upload your image via the uploader endpoint. Once you receive a response, you can apply that jwt
token to your expense under the nested attachment
object. Look at the example on the right.
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
include%5B%5D | string |
Request Body
{"expense"=>{"transactionid"=>nil, "status"=>nil, "has_receipt"=>false, "always_remember"=>false, "is_cogs"=>false, "account_name"=>nil, "include_receipt"=>false, "amount"=>{"amount"=>"79.73", "code"=>"USD"}, "notes"=>"Purchased Gasoline for deliveries", "vendor"=>"Shell Gas Station", "date"=>"2019-04-24", "staffid"=>1, "author_name"=>nil, "taxName1"=>"other tax", "taxName2"=>nil, "taxAmount1"=>{"amount"=>"9.17", "code"=>"USD"}, "taxPercent1"=>13, "taxPercent2"=>nil, "markup_percent"=>nil, "invoiceid"=>nil, "attachment"=>{"jwt"=>"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY2NvdW50Ijo0MjM2NDEwLCJvcmlnaW5hbF9maWxlbmFtZSI6IlNjcmVlbiBTaG90IDIwMTktMDQtMjQgYXQgOS4zOS4xOSBBTS5wbmciLCJidWNrZXQiOiJ1cGxvYWRzIiwiZmlsZW5hbWUiOiJ1cGxvYWQtMGU2ZDMwOWQ1ZTI5MzA3NmNhMGIyNDdkODFlOGJlNWE4NDZlZWE0YSIsImxlbmd0aCI6MTkxNDcyLCJrZXkiOiInZG9jcy0nLTQyMzY0MTAvdXBsb2FkLTBlNmQzMDlkNWUyOTMwNzZjYTBiMjQ3ZDgxZThiZTVhODQ2ZWVhNGEifQ.SOoW3_nTUrxjYO76g1UXHPIrO_aLbTpXCHEa-ZcnejA", "media_type"=>"image/png", "expenseid"=>nil}, "categoryid"=>"2003174", "clientid"=>nil}}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string |
RESPONSES
status: OK
{"response":{"result":{"expense":{"account_name":"","accountid":null,"accounting_systemid":"wkMd2g","amount":{"amount":"79.73","code":"USD"},"attachment":{"attachmentid":8670,"id":8670,"jwt":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY2NvdW50Ijo0MjM2NDEwLCJvcmlnaW5hbF9maWxlbmFtZSI6IlNjcmVlbiBTaG90IDIwMTktMDQtMjQgYXQgOS4zOS4xOSBBTS5wbmciLCJidWNrZXQiOiJ1cGxvYWRzIiwiZmlsZW5hbWUiOiJ1cGxvYWQtMGU2ZDMwOWQ1ZTI5MzA3NmNhMGIyNDdkODFlOGJlNWE4NDZlZWE0YSIsImxlbmd0aCI6MTkxNDcyLCJrZXkiOiInZG9jcy0nLTQyMzY0MTAvdXBsb2FkLTBlNmQzMDlkNWUyOTMwNzZjYTBiMjQ3ZDgxZThiZTVhODQ2ZWVhNGEifQ.SOoW3_nTUrxjYO76g1UXHPIrO_aLbTpXCHEa-ZcnejA","media_type":"image/png"},"background_jobid":null,"bank_name":"","categoryid":2003174,"clientid":0,"compounded_tax":false,"date":"2019-04-24","expenseid":1825574,"ext_invoiceid":0,"ext_systemid":0,"from_bulk_import":false,"has_receipt":true,"id":1825574,"include_receipt":false,"invoiceid":null,"is_cogs":false,"isduplicate":true,"markup_percent":"0","notes":"Purchased Gasoline for deliveries","profileid":null,"projectid":0,"staffid":1,"status":0,"taxAmount1":{"amount":"9.17","code":"USD"},"taxAmount2":null,"taxName1":"other tax","taxName2":null,"taxPercent1":"13","taxPercent2":null,"transactionid":null,"updated":"2019-04-24 11:33:35","vendor":"Shell Gas Station","vis_state":0}}}}