Global API
...
Request
Payment
Update
1min
the following is an example of update payment the payment id (id) and customer id (id) are required to update the payment (see payment docid\ asrn2gzjqlqi 5jexdwaa for the available fields) note you can only update one record at a time when you want to update specific fields of an entity without affecting others, use a sparse update operation by setting sparse= 'true' in your request this approach is more efficient and less prone to unintended changes than a full update request // create a map to store all the data of a customer map\<string, object> paymentmap = new map\<string, object>(); paymentmap put('id','889'); paymentmap put('totalamt','200'); paymentmap put('customerref' , new map\<string, object>{'value' => '226'}); 	paymentmap put('synctoken','0'); 	paymentmap put('privatenote','memo field updated'); 	 // required, make sure you add all lines, otherwise, the payment will not be applied to any invoices // initializing the requestjson data to be passed map\<string, object> requestjsonmap = new map\<string, object>(); requestjsonmap put('payments', new list\<object>{paymentmap}); string reqjson = json serialize(requestjsonmap); map\<string, object> reqobj = new map\<string, object>(); reqobj put('version', '1 0'); reqobj put('action', 'updatepayment'); reqobj put('requestjson', reqjson); //required, if quickbooks multi org is enabled in breadwinner reqobj put('qborgid', '4620816365285051610'); // placing a request to breadwinner global api map\<string, object> respmap = breadwinner qbo breadwinnerqbapi call(reqobj); system debug(respmap); response { action=updatepayment, responsejson={ "statuscode" 200, "payments" \[ { "unappliedamt" 200 00, "txndate" "2023 05 30", "totalamt" 200 00, "synctoken" "1", "sparse" false, "privatenote" "memo field updated", "metadata" { "lastupdatedtime" "2023 05 30t06 18 32 07 00", "createtime" "2023 05 30t04 59 07 07 00" }, "line" \[ { "amount" 300, "linkedtxn" \[ { "txnid" "67", "txntype" "invoice" } ] }, ], "id" "889", "exchangerate" 1, "deposittoaccountref" { "value" "4" }, "customerref" { "value" "226", "name" "john melton" }, "currencyref" { "value" "cad", "name" "canadian dollar" } } ] }, timestamp=1685452713054, validrequest=true, version=1 0 }