import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;
import org.json.JSONObject;
public class MDX_RealTime {
private String BaseUrl, ClientId, ApiKey;
public MDX_RealTime(String BaseUrl, String ClientId, String ApiKey) {
this.BaseUrl = BaseUrl;
this.ClientId = ClientId;
this.ApiKey = ApiKey;
}
public static void main(String[] args) throws Exception {
String base_url = "https://int-live.moneydesktop.com";
String client_id = ":client_id";
String api_key = ":api_key";
MDX_RealTime mdx = new MDX_RealTime(base_url, client_id, api_key);
/// Setup Account Update json object
String user_id = "U-39XBF7";
String member_id = "M-39XBF7";
String account_id = "A-XA5Y4L";
JSONObject transaction = new JSONObject();
JSONObject fields = new JSONObject();
fields.put("status", "POSTED");
fields.put("posted_on", "2017-01-21");
transaction.put("transaction", fields);
mdx.UpdateTransaction(user_id, member_id, account_id, transaction_id, transaction);
}
public void UpdateTransaction(String user_id, String member_id, String account_id, String transaction_id, JSONObject transaction) {
try {
String uri = BaseUrl + "/" + ClientId + "/users/" + user_id + "/members/" + member_id + "/accounts/" + account_id + "/transactions/" + transaction_id + ".json";
URL url = new URL(uri);
HttpsURLConnection con = (HttpsURLConnection) url.openConnection();
con.setRequestMethod("PUT");
con.setRequestProperty("Accept", "application/vnd.moneydesktop.mdx.v5+json");
con.setRequestProperty("Content-Type", "application/vnd.moneydesktop.mdx.v5+json");
con.setRequestProperty("MD-API-KEY", ApiKey);
con.setDoOutput(true);
OutputStream out = con.getOutputStream();
out.write(transaction.toString().getBytes("UTF-8"));
out.close();
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
con.disconnect();
System.out.println(response.toString());
} catch (Exception e) {
System.out.println(e);
}
}
}
{
"transaction": {
"account_guid": "ACT-a341b026-635c-8318-002c-9f3a58b0eff8",
"account_id": "A-XZ5Y4L",
"amount": 8.2,
"category": "GAS",
"category_guid": "CAT-7829f71c-2e8c-afa5-2f55-fa3634b89874",
"category_name": "Gas",
"check_image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==",
"check_number": "9543",
"currency_code": null,
"description": "Costco (Gas)",
"guid": "TRN-cd2987fe-9afb-e912-a5e3-2eaabb866e43",
"id": "T-3QP5X0",
"is_international": false,
"latitude": "40.429675",
"localized_description": null,
"localized_memo": null,
"longitude": "-111.891982",
"member_guid": "MBR-3e4f6897-06ae-e08a-29b2-27d62e574978",
"member_id": "M-39XBF7",
"memo": "POS Purchase",
"merchant_category_code": null,
"merchant_guid": "MCH-bcd4eed1-f341-b7bb-4cbd-e2a854205306",
"merchant_location_guid": null,
"metadata": null,
"posted_at": 1382961600,
"posted_on": "2013-10-28",
"running_balance": 345.45,
"status": "POSTED",
"transacted_at": 1382961600,
"transacted_on": "2013-10-28",
"type": "DEBIT",
"user_guid": "USR-fe9bb059-67c4-0e6b-e8cd-3fa00b2b5735",
"user_id": "U-39XBF7"
}
}
Transactions
Update Transaction
Use this endpoint to update a transaction. This endpoint accepts the optional MX-SKIP-WEBHOOK header.
POST
/
users
/
{user_id}
/
members
/
{member_id}
/
accounts
/
{account_id}
/
transactions
/
{transaction_id}
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;
import org.json.JSONObject;
public class MDX_RealTime {
private String BaseUrl, ClientId, ApiKey;
public MDX_RealTime(String BaseUrl, String ClientId, String ApiKey) {
this.BaseUrl = BaseUrl;
this.ClientId = ClientId;
this.ApiKey = ApiKey;
}
public static void main(String[] args) throws Exception {
String base_url = "https://int-live.moneydesktop.com";
String client_id = ":client_id";
String api_key = ":api_key";
MDX_RealTime mdx = new MDX_RealTime(base_url, client_id, api_key);
/// Setup Account Update json object
String user_id = "U-39XBF7";
String member_id = "M-39XBF7";
String account_id = "A-XA5Y4L";
JSONObject transaction = new JSONObject();
JSONObject fields = new JSONObject();
fields.put("status", "POSTED");
fields.put("posted_on", "2017-01-21");
transaction.put("transaction", fields);
mdx.UpdateTransaction(user_id, member_id, account_id, transaction_id, transaction);
}
public void UpdateTransaction(String user_id, String member_id, String account_id, String transaction_id, JSONObject transaction) {
try {
String uri = BaseUrl + "/" + ClientId + "/users/" + user_id + "/members/" + member_id + "/accounts/" + account_id + "/transactions/" + transaction_id + ".json";
URL url = new URL(uri);
HttpsURLConnection con = (HttpsURLConnection) url.openConnection();
con.setRequestMethod("PUT");
con.setRequestProperty("Accept", "application/vnd.moneydesktop.mdx.v5+json");
con.setRequestProperty("Content-Type", "application/vnd.moneydesktop.mdx.v5+json");
con.setRequestProperty("MD-API-KEY", ApiKey);
con.setDoOutput(true);
OutputStream out = con.getOutputStream();
out.write(transaction.toString().getBytes("UTF-8"));
out.close();
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
con.disconnect();
System.out.println(response.toString());
} catch (Exception e) {
System.out.println(e);
}
}
}
{
"transaction": {
"account_guid": "ACT-a341b026-635c-8318-002c-9f3a58b0eff8",
"account_id": "A-XZ5Y4L",
"amount": 8.2,
"category": "GAS",
"category_guid": "CAT-7829f71c-2e8c-afa5-2f55-fa3634b89874",
"category_name": "Gas",
"check_image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==",
"check_number": "9543",
"currency_code": null,
"description": "Costco (Gas)",
"guid": "TRN-cd2987fe-9afb-e912-a5e3-2eaabb866e43",
"id": "T-3QP5X0",
"is_international": false,
"latitude": "40.429675",
"localized_description": null,
"localized_memo": null,
"longitude": "-111.891982",
"member_guid": "MBR-3e4f6897-06ae-e08a-29b2-27d62e574978",
"member_id": "M-39XBF7",
"memo": "POS Purchase",
"merchant_category_code": null,
"merchant_guid": "MCH-bcd4eed1-f341-b7bb-4cbd-e2a854205306",
"merchant_location_guid": null,
"metadata": null,
"posted_at": 1382961600,
"posted_on": "2013-10-28",
"running_balance": 345.45,
"status": "POSTED",
"transacted_at": 1382961600,
"transacted_on": "2013-10-28",
"type": "DEBIT",
"user_guid": "USR-fe9bb059-67c4-0e6b-e8cd-3fa00b2b5735",
"user_id": "U-39XBF7"
}
}
Path Parameters
string
required
string
required
string
required
string
required
Body Parameters
decimal
string
string
string
string
string
string
string
string
string
string
string
string
string
string
string
string
string
required
string
string
string
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;
import org.json.JSONObject;
public class MDX_RealTime {
private String BaseUrl, ClientId, ApiKey;
public MDX_RealTime(String BaseUrl, String ClientId, String ApiKey) {
this.BaseUrl = BaseUrl;
this.ClientId = ClientId;
this.ApiKey = ApiKey;
}
public static void main(String[] args) throws Exception {
String base_url = "https://int-live.moneydesktop.com";
String client_id = ":client_id";
String api_key = ":api_key";
MDX_RealTime mdx = new MDX_RealTime(base_url, client_id, api_key);
/// Setup Account Update json object
String user_id = "U-39XBF7";
String member_id = "M-39XBF7";
String account_id = "A-XA5Y4L";
JSONObject transaction = new JSONObject();
JSONObject fields = new JSONObject();
fields.put("status", "POSTED");
fields.put("posted_on", "2017-01-21");
transaction.put("transaction", fields);
mdx.UpdateTransaction(user_id, member_id, account_id, transaction_id, transaction);
}
public void UpdateTransaction(String user_id, String member_id, String account_id, String transaction_id, JSONObject transaction) {
try {
String uri = BaseUrl + "/" + ClientId + "/users/" + user_id + "/members/" + member_id + "/accounts/" + account_id + "/transactions/" + transaction_id + ".json";
URL url = new URL(uri);
HttpsURLConnection con = (HttpsURLConnection) url.openConnection();
con.setRequestMethod("PUT");
con.setRequestProperty("Accept", "application/vnd.moneydesktop.mdx.v5+json");
con.setRequestProperty("Content-Type", "application/vnd.moneydesktop.mdx.v5+json");
con.setRequestProperty("MD-API-KEY", ApiKey);
con.setDoOutput(true);
OutputStream out = con.getOutputStream();
out.write(transaction.toString().getBytes("UTF-8"));
out.close();
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
con.disconnect();
System.out.println(response.toString());
} catch (Exception e) {
System.out.println(e);
}
}
}
{
"transaction": {
"account_guid": "ACT-a341b026-635c-8318-002c-9f3a58b0eff8",
"account_id": "A-XZ5Y4L",
"amount": 8.2,
"category": "GAS",
"category_guid": "CAT-7829f71c-2e8c-afa5-2f55-fa3634b89874",
"category_name": "Gas",
"check_image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==",
"check_number": "9543",
"currency_code": null,
"description": "Costco (Gas)",
"guid": "TRN-cd2987fe-9afb-e912-a5e3-2eaabb866e43",
"id": "T-3QP5X0",
"is_international": false,
"latitude": "40.429675",
"localized_description": null,
"localized_memo": null,
"longitude": "-111.891982",
"member_guid": "MBR-3e4f6897-06ae-e08a-29b2-27d62e574978",
"member_id": "M-39XBF7",
"memo": "POS Purchase",
"merchant_category_code": null,
"merchant_guid": "MCH-bcd4eed1-f341-b7bb-4cbd-e2a854205306",
"merchant_location_guid": null,
"metadata": null,
"posted_at": 1382961600,
"posted_on": "2013-10-28",
"running_balance": 345.45,
"status": "POSTED",
"transacted_at": 1382961600,
"transacted_on": "2013-10-28",
"type": "DEBIT",
"user_guid": "USR-fe9bb059-67c4-0e6b-e8cd-3fa00b2b5735",
"user_id": "U-39XBF7"
}
}
⌘I

