what does creation_method parameter of create_expense endpoint do?
goleary opened this issue · 5 comments
I understand how to create expenses where I do all of the math on my end (i.e. submit an "array" of involved users with what each spent and what they owe).
I've noticed in the documentation there is an optional parameter:
creation_method: iou, quickadd, payment, or split
Is there any way to use this so that I don't have to do the splitting math on my end. For instance, submit
- array of involved id
- cost
- description
- split method: "split"
and have the splitwise backend figure out who owes what?
If not, what is the point of this optional parameter?
Unfortunately, that parameter is mislabeled, and is actually not useful. We're sorry about that!
Have you looked at the parse_expense
endpoint? Although you do have to provide a natural language sentence, it'll do the math for you.
Hope this, along with my answer to #25, helps!
I have not tried the parse_sentence
endpoint, but I'll take a look.
Thanks for the quick replies, you've set me on the right track.
(also leaving this one open for the same reason listed in #25)
@jas14
I did a little poking around with the parse_sentence
endpoint.
A couple of questions:
- what's the difference between
friendship_id
&friend_id
? http://dev.legacy.splitwise.com/dokuwiki/doku.php?id=create_expense vs http://dev.legacy.splitwise.com/dokuwiki/doku.php?id=parse_sentence - is there any way to use the parse endpoint with a list of friends? it seems like it can only be used with a single friend or a single group.
- I tried several input sentences that included the word 'owe' & 'iou' but the result was always an expense that was split equally. I'm curious if the response for this endpoint will ever be an expense that is not split equally, and if so, what verbage should be used to trigger this?
friend_id
indicates the user ID of the friend;friendship_id
is the ID of the friendship object that encodes the friendship (has the ID of each user).- Unfortunately, that's correct - it can only be used for a single group or user.
- "IOU" is not in our model, but "owe", "owes", and "owed" will work. Here are some examples of sentences that will parse:
- "A owes B five dollars"
- "A paid C five cents"
- "B lent A 5 bucks"
Sweet thanks for all of your help Joe!
I'll think about how I can leverage this in my app.
Looks like you've got some great content for the documentation ;)