Global API
Request
Send Invoice
1min
when sending an invoice, use the requestjson to pass the required invoice data the returned response will contain a responsejson section with the send invoice response returned by breadwinner for quickbooks the following is an example of send invoice the quickbooks invoice id (invoiceid) is required to send the invoice note an email address is required to send the invoice if there is an email address on the invoice, you only need to pass in the invoice id if the invoice does not have an email address, or you want to send it to a different address, you must also supply the 'sendto' parameter request // create a map to store all the data of an invoice map\<string, object> invoicemap = new map\<string, object>(); invoicemap put('invoiceid','64'); invoicemap put('sendto','test\@test com'); // initialize the requestjson data to be passed map\<string, object> reqjsonmap = new map\<string, object>(); reqjsonmap put('sendinvoice' , invoicemap); string reqjson = json serialize(reqjsonmap); map\<string, object> finalreqmap = new map\<string, object>(); finalreqmap put('version' , '1 0'); finalreqmap put('action' , 'sendinvoice'); finalreqmap put('requestjson' , reqjson); //required, if quickbooks multi org is enabled in breadwinner finalreqmap put('qborgid', '4620816365285051610'); system debug('request ' + finalreqmap); // placing a request to breadwinner global api map\<string, object> respmap = breadwinner qbo breadwinnerqbapi call(finalreqmap); system debug(respmap); response { action=sendinvoice, responsejson={ "statuscode" 200, "sendinvoice" \[ { "txntaxdetail" { "totaltax" 0 }, "txndate" "2021 08 11", "totalamt" 110 00, "synctoken" "0", "sparse" false, "sfrecordid" "a0a1m000004oi1qeag", "salestermref" { "value" "4", "name" "net 60" }, "salesforcerecordid" "a0a1m000004oi1qeag", "metadata" { "lastupdatedtime" "2023 12 12t04 47 11 08 00", "createtime" "2023 12 12t04 47 11 08 00" }, "line" \[ { "salesitemlinedetail" { "unitprice" 50, "taxcoderef" { "value" "tax" }, "servicedate" "1993 05 25", "qty" 2, "itemref" { "value" "1", "name" "services" } }, "linenum" 1, "id" "1", "detailtype" "salesitemlinedetail", "description" "description", "amount" 100 00 }, { "detailtype" "subtotallinedetail", "amount" 100 00 }, { "salesitemlinedetail" { "itemref" { "value" "shipping item id" } }, "detailtype" "salesitemlinedetail", "amount" 10 00 } ], "invoicelink" "https //developer intuit com/comingsoonview/scs v1 dd2019771bcb4d49b35e5f007aea22652130e4cc705c42a587606982186190aab5813d68c9c24032a6f0fac960274c55?locale=en us\&cta=v3invoicelink", "id" "853", "emailstatus" "emailsent", "duedate" "2021 09 11", "docnumber" "inv 1201", "customfield" \[ { "type" "stringtype", "name" "crew #", "definitionid" "1" }, { "type" "stringtype", "name" "custom field 2", "definitionid" "2" } ], "customerref" { "value" "87", "name" "cool cars2" }, "currencyref" { "value" "usd", "name" "united states dollar" }, "billemail" { "address" "test\@test com" }, "billaddr" { "postalcode" "508238", "line3" "kodad", "line2" "first lane", "line1" "1 24", "id" "1159", "country" "india", "city" "suryapet" }, "balance" 110 00, "allowonlinecreditcardpayment" false, "allowonlineachpayment" false } ] }, timestamp=1702385235117, validrequest=true, version=1 0 }