namaggarwal / splitwise

Python SDK for Splitwise
MIT License
184 stars 46 forks source link

Support for uploading receipt to an expense #51

Closed rahulaaj closed 4 years ago

rahulaaj commented 4 years ago

Naman, Can we get support for adding receipt to an expense. It can work as follows: receipt = "receipt.jpeg" files = {"receipt": open(receipt, 'rb')} requestObj = Request(method=method, url=url, data=data, auth=auth, files=files)

namaggarwal commented 4 years ago

Hi Rahul,

Unfortunately, Splitwise has no APIs to upload a receipt. What you can do now is add it receipt url in description using expense.setDescription method. I am also adding a setDetail method which can also be used. Someone is also working on adding support for adding comments. So you will be able to add receipt url as comment as well. You will have all this by Sunday.

rahulaaj commented 4 years ago

Hi Naman, Based on https://github.com/splitwise/api-docs/issues/21 "receipt" is a parameter available for create expense. I was able to use that successfully using Request as mentioned in issue description.

namaggarwal commented 4 years ago

Ah thats great. Its not mentioned in the API docs. I will implement it then

rahulaaj commented 4 years ago

Thanks for providing the feature quickly 💯