POSTing split transactions

Do you have an example of creating a new transaction that is split? I've tried several things through the API, but nothing seems to work. Is this supported? If not, do you have a timeline for it? If it is supported, can we have an example json that works? Thanks!

46replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • Split transactions are now supported!  You can specify a "subtransactions" array when creating or updating a transaction like this:

    curl -H "Authorization: Bearer $API_ACCESS_TOKEN" https://api.youneedabudget.com/v1/budgets/last-used/transactions -H "Content-Type: application/json" -X POST --data-binary @- << EOF
    {
       "transaction":{
          "account_id":"00d17281-a898-4bac-a3e4-0cbcb947c6e7",
          "date":"2020-02-18",
          "amount":-200000,
          "memo":"This is a split",
          "subtransactions":[
             {
                "amount":-100000,
                "payee_name":"Split payee",
                "category_id":"99e33804-e58f-4121-9930-ba013c8bb4c3",
                "memo":"Split 1"
             },
             {
                "amount":-100000,
                "payee_id":"f7d7779a-0084-4023-91fd-7de2a80f9105",
                "category_id":"3b9dcabc-ca09-4c7f-a26e-cb823209194d",
                "memo":"Split 2"
             }
          ]
       }
    }
    EOF

    See the API Endpoint Documentation for more details.

    The client libraries have not been updated to support splits yet, but will be in the near future.

    Like 4
      • Alfred
      • firnnauriel
      • 1 mth ago
      • 1
      • Reported - view

      Brady Fantastic news! I'll test it sometime this week. Thanks for the work.

      Like 1
    • Brady Cool. But I‘m not able to create a transaction with a transfer as a subtransaction. I tried with payee_name and payee_id. But the subtransaction has no payee in the end.

      Can you give a hint, or is there a bug?

      Like
    • Pink Yearling Per the docs, transfer payees are not allowed for splits.

      Like
  • Nice! Thanks Brady!

    Like 1
  • So excited for this! Thank you! 

    Like 1
  • Integrated split transactions into my grocery store receipt processor and it's working great. Thanks again!

    Like 2
  • Hi Brady, nice to see this feature!
    But there is a problem - why subtransactions cannot be specified for an imported transaction?
    I'm heavily relying on this field to backtrack created transactions.

    Like
  • Gold Wrench - There is a technical design reason we don't support that, currently.  One thing you could do is create a regular non-imported transaction (no import_id) as a split and then create a secondary imported transaction that will match (same account_id, amount, and date) to that first transaction.  The net result would be a single, split transaction with a matched, non-visible imported transaction counterpart.  This is effectively how things work when not using the API.

    Like
    • Brady thank you, will try it out!

      Like
Like16 Follow
  • 16 Likes
  • 3 wk agoLast active
  • 46Replies
  • 1490Views
  • 32 Following