about summary refs log tree commit diff
path: root/monzo_ynab/ynab
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2020-02-10T23·22+0000
committerWilliam Carroll <wpcarro@gmail.com>2020-02-10T23·24+0000
commite223adfec540f3de19342b16eeb6336f14ff11e5 (patch)
treed24abff8125bc547bbb40e86851cb91b18913858 /monzo_ynab/ynab
parent2e719d117418e1e8718b242c0098b5e658fe714f (diff)
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.
Diffstat (limited to 'monzo_ynab/ynab')
-rw-r--r--monzo_ynab/ynab/client.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/monzo_ynab/ynab/client.go b/monzo_ynab/ynab/client.go
new file mode 100644
index 000000000000..0492b9071adc
--- /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"
+			}
+		]
+	}
+}