curl --request POST \
--url https://int-data.moneydesktop.com/spending_plans/{spending_plan_guid}/iterations/current/iteration_items \
--header 'Content-Type: application/vnd.mx.nexus.v1+json' \
--header 'MD-SESSION-TOKEN: <api-key>' \
--data '
{
"planned_amount": 110,
"category_guid": "CAT-40faf068-abb4-405c-8f6a-e883ed541fff",
"item_type": 1,
"scheduled_payment_guid": "SCP-c731988a-712f-4f83-9b3b-0aa5b3d5208b",
"top_level_category_guid": "CAT-9588eaad-90a4-bb5c-66c8-1812503d0db8"
}
'import requests
url = "https://int-data.moneydesktop.com/spending_plans/{spending_plan_guid}/iterations/current/iteration_items"
payload = {
"planned_amount": 110,
"category_guid": "CAT-40faf068-abb4-405c-8f6a-e883ed541fff",
"item_type": 1,
"scheduled_payment_guid": "SCP-c731988a-712f-4f83-9b3b-0aa5b3d5208b",
"top_level_category_guid": "CAT-9588eaad-90a4-bb5c-66c8-1812503d0db8"
}
headers = {
"MD-SESSION-TOKEN": "<api-key>",
"Content-Type": "application/vnd.mx.nexus.v1+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'MD-SESSION-TOKEN': '<api-key>',
'Content-Type': 'application/vnd.mx.nexus.v1+json'
},
body: JSON.stringify({
planned_amount: 110,
category_guid: 'CAT-40faf068-abb4-405c-8f6a-e883ed541fff',
item_type: 1,
scheduled_payment_guid: 'SCP-c731988a-712f-4f83-9b3b-0aa5b3d5208b',
top_level_category_guid: 'CAT-9588eaad-90a4-bb5c-66c8-1812503d0db8'
})
};
fetch('https://int-data.moneydesktop.com/spending_plans/{spending_plan_guid}/iterations/current/iteration_items', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://int-data.moneydesktop.com/spending_plans/{spending_plan_guid}/iterations/current/iteration_items",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'planned_amount' => 110,
'category_guid' => 'CAT-40faf068-abb4-405c-8f6a-e883ed541fff',
'item_type' => 1,
'scheduled_payment_guid' => 'SCP-c731988a-712f-4f83-9b3b-0aa5b3d5208b',
'top_level_category_guid' => 'CAT-9588eaad-90a4-bb5c-66c8-1812503d0db8'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/vnd.mx.nexus.v1+json",
"MD-SESSION-TOKEN: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://int-data.moneydesktop.com/spending_plans/{spending_plan_guid}/iterations/current/iteration_items"
payload := strings.NewReader("{\n \"planned_amount\": 110,\n \"category_guid\": \"CAT-40faf068-abb4-405c-8f6a-e883ed541fff\",\n \"item_type\": 1,\n \"scheduled_payment_guid\": \"SCP-c731988a-712f-4f83-9b3b-0aa5b3d5208b\",\n \"top_level_category_guid\": \"CAT-9588eaad-90a4-bb5c-66c8-1812503d0db8\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("MD-SESSION-TOKEN", "<api-key>")
req.Header.Add("Content-Type", "application/vnd.mx.nexus.v1+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://int-data.moneydesktop.com/spending_plans/{spending_plan_guid}/iterations/current/iteration_items")
.header("MD-SESSION-TOKEN", "<api-key>")
.header("Content-Type", "application/vnd.mx.nexus.v1+json")
.body("{\n \"planned_amount\": 110,\n \"category_guid\": \"CAT-40faf068-abb4-405c-8f6a-e883ed541fff\",\n \"item_type\": 1,\n \"scheduled_payment_guid\": \"SCP-c731988a-712f-4f83-9b3b-0aa5b3d5208b\",\n \"top_level_category_guid\": \"CAT-9588eaad-90a4-bb5c-66c8-1812503d0db8\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://int-data.moneydesktop.com/spending_plans/{spending_plan_guid}/iterations/current/iteration_items")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["MD-SESSION-TOKEN"] = '<api-key>'
request["Content-Type"] = 'application/vnd.mx.nexus.v1+json'
request.body = "{\n \"planned_amount\": 110,\n \"category_guid\": \"CAT-40faf068-abb4-405c-8f6a-e883ed541fff\",\n \"item_type\": 1,\n \"scheduled_payment_guid\": \"SCP-c731988a-712f-4f83-9b3b-0aa5b3d5208b\",\n \"top_level_category_guid\": \"CAT-9588eaad-90a4-bb5c-66c8-1812503d0db8\"\n}"
response = http.request(request)
puts response.read_body{
"iteration_item": {
"actual_amount": 345,
"category_guid": "CAT-40faf068-abb4-405c-8f6a-e883ed541fff",
"created_at": "2016-10-13T18:08:00+00:00",
"guid": "SPL-e5f9a5bd-c5b3-4901-bdc0-62119b9db262",
"item_type": "0",
"planned_amount": 345,
"scheduled_payment_guid": "SCP-54bed778-6600-4262-908c-8822f141cc30",
"spending_plan_iteration_guid": "SPI-848e6648-3fa3-4632-ac8f-e65f03167102",
"top_level_category_guid": "CAT-50af068-abb4-405c-8f6a-e883ed541f4f",
"transaction_guids": [
"TRN-265abee9-889b-af6a-c69b-25157db2bdd9"
],
"updated_at": "2016-10-13T18:09:00.000Z",
"user_guid": "USR-fa7537f3-48aa-a683-a02a-b18940482f54"
},
"pagination": {
"current_page": 1,
"per_page": 25,
"total_entries": 1,
"total_pages": 1
}
}Create a spending plan iteration item
This endpoint creates a new spending_plan_iteration_item.
curl --request POST \
--url https://int-data.moneydesktop.com/spending_plans/{spending_plan_guid}/iterations/current/iteration_items \
--header 'Content-Type: application/vnd.mx.nexus.v1+json' \
--header 'MD-SESSION-TOKEN: <api-key>' \
--data '
{
"planned_amount": 110,
"category_guid": "CAT-40faf068-abb4-405c-8f6a-e883ed541fff",
"item_type": 1,
"scheduled_payment_guid": "SCP-c731988a-712f-4f83-9b3b-0aa5b3d5208b",
"top_level_category_guid": "CAT-9588eaad-90a4-bb5c-66c8-1812503d0db8"
}
'import requests
url = "https://int-data.moneydesktop.com/spending_plans/{spending_plan_guid}/iterations/current/iteration_items"
payload = {
"planned_amount": 110,
"category_guid": "CAT-40faf068-abb4-405c-8f6a-e883ed541fff",
"item_type": 1,
"scheduled_payment_guid": "SCP-c731988a-712f-4f83-9b3b-0aa5b3d5208b",
"top_level_category_guid": "CAT-9588eaad-90a4-bb5c-66c8-1812503d0db8"
}
headers = {
"MD-SESSION-TOKEN": "<api-key>",
"Content-Type": "application/vnd.mx.nexus.v1+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'MD-SESSION-TOKEN': '<api-key>',
'Content-Type': 'application/vnd.mx.nexus.v1+json'
},
body: JSON.stringify({
planned_amount: 110,
category_guid: 'CAT-40faf068-abb4-405c-8f6a-e883ed541fff',
item_type: 1,
scheduled_payment_guid: 'SCP-c731988a-712f-4f83-9b3b-0aa5b3d5208b',
top_level_category_guid: 'CAT-9588eaad-90a4-bb5c-66c8-1812503d0db8'
})
};
fetch('https://int-data.moneydesktop.com/spending_plans/{spending_plan_guid}/iterations/current/iteration_items', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://int-data.moneydesktop.com/spending_plans/{spending_plan_guid}/iterations/current/iteration_items",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'planned_amount' => 110,
'category_guid' => 'CAT-40faf068-abb4-405c-8f6a-e883ed541fff',
'item_type' => 1,
'scheduled_payment_guid' => 'SCP-c731988a-712f-4f83-9b3b-0aa5b3d5208b',
'top_level_category_guid' => 'CAT-9588eaad-90a4-bb5c-66c8-1812503d0db8'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/vnd.mx.nexus.v1+json",
"MD-SESSION-TOKEN: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://int-data.moneydesktop.com/spending_plans/{spending_plan_guid}/iterations/current/iteration_items"
payload := strings.NewReader("{\n \"planned_amount\": 110,\n \"category_guid\": \"CAT-40faf068-abb4-405c-8f6a-e883ed541fff\",\n \"item_type\": 1,\n \"scheduled_payment_guid\": \"SCP-c731988a-712f-4f83-9b3b-0aa5b3d5208b\",\n \"top_level_category_guid\": \"CAT-9588eaad-90a4-bb5c-66c8-1812503d0db8\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("MD-SESSION-TOKEN", "<api-key>")
req.Header.Add("Content-Type", "application/vnd.mx.nexus.v1+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://int-data.moneydesktop.com/spending_plans/{spending_plan_guid}/iterations/current/iteration_items")
.header("MD-SESSION-TOKEN", "<api-key>")
.header("Content-Type", "application/vnd.mx.nexus.v1+json")
.body("{\n \"planned_amount\": 110,\n \"category_guid\": \"CAT-40faf068-abb4-405c-8f6a-e883ed541fff\",\n \"item_type\": 1,\n \"scheduled_payment_guid\": \"SCP-c731988a-712f-4f83-9b3b-0aa5b3d5208b\",\n \"top_level_category_guid\": \"CAT-9588eaad-90a4-bb5c-66c8-1812503d0db8\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://int-data.moneydesktop.com/spending_plans/{spending_plan_guid}/iterations/current/iteration_items")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["MD-SESSION-TOKEN"] = '<api-key>'
request["Content-Type"] = 'application/vnd.mx.nexus.v1+json'
request.body = "{\n \"planned_amount\": 110,\n \"category_guid\": \"CAT-40faf068-abb4-405c-8f6a-e883ed541fff\",\n \"item_type\": 1,\n \"scheduled_payment_guid\": \"SCP-c731988a-712f-4f83-9b3b-0aa5b3d5208b\",\n \"top_level_category_guid\": \"CAT-9588eaad-90a4-bb5c-66c8-1812503d0db8\"\n}"
response = http.request(request)
puts response.read_body{
"iteration_item": {
"actual_amount": 345,
"category_guid": "CAT-40faf068-abb4-405c-8f6a-e883ed541fff",
"created_at": "2016-10-13T18:08:00+00:00",
"guid": "SPL-e5f9a5bd-c5b3-4901-bdc0-62119b9db262",
"item_type": "0",
"planned_amount": 345,
"scheduled_payment_guid": "SCP-54bed778-6600-4262-908c-8822f141cc30",
"spending_plan_iteration_guid": "SPI-848e6648-3fa3-4632-ac8f-e65f03167102",
"top_level_category_guid": "CAT-50af068-abb4-405c-8f6a-e883ed541f4f",
"transaction_guids": [
"TRN-265abee9-889b-af6a-c69b-25157db2bdd9"
],
"updated_at": "2016-10-13T18:09:00.000Z",
"user_guid": "USR-fa7537f3-48aa-a683-a02a-b18940482f54"
},
"pagination": {
"current_page": 1,
"per_page": 25,
"total_entries": 1,
"total_pages": 1
}
}Authorizations
MX Session Token
- Request an API token using the read API token endpoint in the MX SSO API.
- Exchange an API token for a session token.
- A session token is obtained by sending a POST request to /sessions
- The session token will be used in each request made for the user. It should be passed in an
MD-SESSION-TOKENHTTP header as shown below. - This session token is valid for 30 minutes from the time it was created. The 30 minute expiration counter is refreshed with each call.
- If you send a request with an expired session token you'll receive an error code of
4011.
curl -i https://int-data.moneydesktop.com/accounts \ -H 'MD-SESSION-TOKEN: CWforZl1Vn2vC_v6H4rnQRT1DoWpDouJAV-_5TBmiQRAtA8rsOG_BoajTiOSsL0A3bd-bmHXlA-eQzc9ywItKg' \ -H 'Content-Type: application/vnd.mx.nexus.v1+json' \ -H 'Accept: application/vnd.mx.nexus.v1+json'
In documentation code examples, replace <API_KEY_VALUE> with the session token.
Path Parameters
The unique ID for the spending_plan.
Query Parameters
The unique id for a user.
Body
Iteration item to be created with required parameter (planned_amount)
Response
OK
Hide child attributes
Hide child attributes
The sum of the transactions associated with the spending_plan_iteration_item.
345
The unique identifier for the category_guid associated with the spending_plan_iteration_item. Defined by MX.
"CAT-40faf068-abb4-405c-8f6a-e883ed541fff"
The date and time at which the spending_plan_iteration_item was created.
"2016-10-13T18:08:00+00:00"
The unique identifier for the spending_plan_iteration_item. Defined by MX.
"SPL-e5f9a5bd-c5b3-4901-bdc0-62119b9db262"
The type of transaction grouping for the spending_plan_iteration_item. 0 = RECURRING_EXPENSE, 1 = PLANNED_EXPENSE, 2 = OTHER_EXPENSE, 3 = INCOME.
"0"
The total amount planned for a spending_plan_iteration_item.
345
The unique identifier for the scheduled_payment_guid associated with the spending_plan_iteration_item. Defined by MX.
"SCP-54bed778-6600-4262-908c-8822f141cc30"
The unique identifier for the spending_plan_iteration_item. Defined by MX.
"SPI-848e6648-3fa3-4632-ac8f-e65f03167102"
The unique identifier for the top_level_category_guid associated with the spending_plan_iteration_item. Defined by MX.
"CAT-50af068-abb4-405c-8f6a-e883ed541f4f"
An array of transaction GUIDs that are relevant to the spending_plan_iteration_item. Defined by MX.
"TRN-265abee9-889b-af6a-c69b-25157db2bdd9"
The date and time at which the spending_plan_iteration_item was most recently updated.
"2016-10-13T18:09:00.000Z"
The unique identifier for the user to which the spending_plan_iteration_item belongs. Defined by MX.
"USR-fa7537f3-48aa-a683-a02a-b18940482f54"

