Update budget line item
curl --request PATCH \
--url https://app.msportal.ai/api/public/v1/budgets/{id}/items/{itemId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "<string>",
"quantity": 1,
"unitPrice": 1,
"termMonths": 60,
"currency": "<string>",
"notes": "<string>",
"categoryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"linkedItemId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://app.msportal.ai/api/public/v1/budgets/{id}/items/{itemId}"
payload = {
"description": "<string>",
"quantity": 1,
"unitPrice": 1,
"termMonths": 60,
"currency": "<string>",
"notes": "<string>",
"categoryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"linkedItemId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: '<string>',
quantity: 1,
unitPrice: 1,
termMonths: 60,
currency: '<string>',
notes: '<string>',
categoryId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
linkedItemId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://app.msportal.ai/api/public/v1/budgets/{id}/items/{itemId}', 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://app.msportal.ai/api/public/v1/budgets/{id}/items/{itemId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'description' => '<string>',
'quantity' => 1,
'unitPrice' => 1,
'termMonths' => 60,
'currency' => '<string>',
'notes' => '<string>',
'categoryId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'linkedItemId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://app.msportal.ai/api/public/v1/budgets/{id}/items/{itemId}"
payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"quantity\": 1,\n \"unitPrice\": 1,\n \"termMonths\": 60,\n \"currency\": \"<string>\",\n \"notes\": \"<string>\",\n \"categoryId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"linkedItemId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://app.msportal.ai/api/public/v1/budgets/{id}/items/{itemId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"quantity\": 1,\n \"unitPrice\": 1,\n \"termMonths\": 60,\n \"currency\": \"<string>\",\n \"notes\": \"<string>\",\n \"categoryId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"linkedItemId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.msportal.ai/api/public/v1/budgets/{id}/items/{itemId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"<string>\",\n \"quantity\": 1,\n \"unitPrice\": 1,\n \"termMonths\": 60,\n \"currency\": \"<string>\",\n \"notes\": \"<string>\",\n \"categoryId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"linkedItemId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"quantity": 1,
"unitPrice": 1,
"termMonths": 2,
"annualisedCost": 123,
"currency": "<string>",
"notes": "<string>",
"category": {
"id": "<string>",
"name": "<string>"
},
"linkedItem": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"requestId": "<string>",
"details": "<unknown>",
"code": "<string>"
}{
"error": "<string>",
"requestId": "<string>",
"details": "<unknown>",
"code": "<string>"
}{
"error": "<string>",
"requestId": "<string>",
"details": "<unknown>",
"code": "<string>"
}{
"error": "<string>",
"requestId": "<string>",
"details": "<unknown>",
"code": "<string>"
}Budgets
Update budget line item
Update an existing line item. Only provided fields will be updated.
PATCH
/
api
/
public
/
v1
/
budgets
/
{id}
/
items
/
{itemId}
Update budget line item
curl --request PATCH \
--url https://app.msportal.ai/api/public/v1/budgets/{id}/items/{itemId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "<string>",
"quantity": 1,
"unitPrice": 1,
"termMonths": 60,
"currency": "<string>",
"notes": "<string>",
"categoryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"linkedItemId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://app.msportal.ai/api/public/v1/budgets/{id}/items/{itemId}"
payload = {
"description": "<string>",
"quantity": 1,
"unitPrice": 1,
"termMonths": 60,
"currency": "<string>",
"notes": "<string>",
"categoryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"linkedItemId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: '<string>',
quantity: 1,
unitPrice: 1,
termMonths: 60,
currency: '<string>',
notes: '<string>',
categoryId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
linkedItemId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://app.msportal.ai/api/public/v1/budgets/{id}/items/{itemId}', 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://app.msportal.ai/api/public/v1/budgets/{id}/items/{itemId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'description' => '<string>',
'quantity' => 1,
'unitPrice' => 1,
'termMonths' => 60,
'currency' => '<string>',
'notes' => '<string>',
'categoryId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'linkedItemId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://app.msportal.ai/api/public/v1/budgets/{id}/items/{itemId}"
payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"quantity\": 1,\n \"unitPrice\": 1,\n \"termMonths\": 60,\n \"currency\": \"<string>\",\n \"notes\": \"<string>\",\n \"categoryId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"linkedItemId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://app.msportal.ai/api/public/v1/budgets/{id}/items/{itemId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"quantity\": 1,\n \"unitPrice\": 1,\n \"termMonths\": 60,\n \"currency\": \"<string>\",\n \"notes\": \"<string>\",\n \"categoryId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"linkedItemId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.msportal.ai/api/public/v1/budgets/{id}/items/{itemId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"<string>\",\n \"quantity\": 1,\n \"unitPrice\": 1,\n \"termMonths\": 60,\n \"currency\": \"<string>\",\n \"notes\": \"<string>\",\n \"categoryId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"linkedItemId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"quantity": 1,
"unitPrice": 1,
"termMonths": 2,
"annualisedCost": 123,
"currency": "<string>",
"notes": "<string>",
"category": {
"id": "<string>",
"name": "<string>"
},
"linkedItem": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"requestId": "<string>",
"details": "<unknown>",
"code": "<string>"
}{
"error": "<string>",
"requestId": "<string>",
"details": "<unknown>",
"code": "<string>"
}{
"error": "<string>",
"requestId": "<string>",
"details": "<unknown>",
"code": "<string>"
}{
"error": "<string>",
"requestId": "<string>",
"details": "<unknown>",
"code": "<string>"
}Authorizations
Use your API key as a Bearer token. API keys can be generated in Settings → Integrations → API Access.
Body
application/json
Item type
Available options:
Software, Hardware, Labour, Other, Subscription Item description
Required string length:
1 - 1000Quantity
Required range:
x >= 0Unit price
Required range:
x >= 0Recurrence
Available options:
One-Time, Monthly, Annual Term in months
Required range:
1 <= x <= 120Status
Available options:
pending, approved, rejected, draft Currency code
Required string length:
3Item notes (null to clear)
Maximum string length:
5000Category ID (null to clear)
Linked item ID (null to clear)
Linked item type (null to clear)
Available options:
device, planner, goal, other Response
Line item updated successfully
Show child attributes
Show child attributes
Was this page helpful?
⌘I