From e223adfec540f3de19342b16eeb6336f14ff11e5 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Mon, 10 Feb 2020 23:22:36 +0000 Subject: Begin work on YNAB client After reading these docs https://api.youneedabudget.com/v1#/Transactions/createTransaction I successfully made a request to post a transaction to my YNAB account. Hastily created a client.go that doesn't contain much at the moment. --- monzo_ynab/ynab/client.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 monzo_ynab/ynab/client.go (limited to 'monzo_ynab/ynab/client.go') diff --git a/monzo_ynab/ynab/client.go b/monzo_ynab/ynab/client.go new file mode 100644 index 0000000000..0492b9071a --- /dev/null +++ b/monzo_ynab/ynab/client.go @@ -0,0 +1,24 @@ +package client + +import ( + "serde" +) + +// See requests.txt for more details. +func PostTransactions(accountID string, txs []serde.Transaction{}) error { + return map[string]string{ + "transactions": [ + { + "account_id": accountID, + "date": "2019-12-30", + "amount": 10000, + "payee_name": "Richard Stallman", + "memo": "Not so free software after all...", + "cleared": "cleared", + "approved": true, + "flag_color": "red", + "import_id": "xyz-123" + } + ] + } +} -- cgit 1.4.1