Global API
...
Request
Get PDF Response
Invoice Flow
10min
custom apex generator this is an example invocable method generated by breadwinner apex generator, which can be invoked by a standard flow this is useful as it shows how you can use salesforce standard automation practices to drive xero record creation using this format, you can extend to update or read in a similar fashion this basic use case shows how easy it is to create robust automation in salesforce to facilitate invoice record creation in xero extending upon this, using the global api requests in this help site you can perform many automated retrieves, create, or update functions directly rather than requiring extensive middleware or endpoint processing to perform apex class generation navigate to breadwinner setup > tools > apex generator step 1 choose the record mode create/edit on a xero object ( invoice ) using a flow step 2 select the option for run this flow as ( i will check "run asynchronously" (on record triggered flow creation page) ) step 3 click on next, it will navigate to the fields selection page click on generate apex step 4 copy the generated apex class / apex test class (optional) save/deploy the copied code to the respective org xero invoice automation using flows step 1 navigate to salesforce setup > flows > new flow > record triggered flow step 2 choose the options similar to those mentioned below, and click on done select the object ( opportunity ) trigger event ( record is updated ) entry conditions (like stgaename is closed won ) run the flow for updated records ( only when record is updated to meet the condition requirements ) optimize flow for ( actions and related records ) check run asynchronously path (only when the option " i will check "run asynchronously" (on record triggered flow creation page)" on step 2) step 3 get line items ( opportunity products query with current record id ( opportunity id )), and click on done select get records (from data section) select object for line records ( opportunity product ) condition for query ( opportunityid opportunityid equals $record > opportunity id $record > opportunity id ) sorting ( ascending by #sortorder #sortorder ) how many record ( all records ) how to store ( automatically store all fields ) step 4 get xero contact info using get records data action, and click on done select get records (from data section) select object for info (xero contact ) condition for query ( breadwinner salesforce account c equals $record > account id > account id $record > account id > account id ) sorting (optional) how many record (only first record ) how to store ( choose fields and salesforce do the rest and select the below fields for further usage) breadwinner xero org id c breadwinner reference id c step 5 create an apex action using the " create xero invoice " invocable method step 6 map the fields to create invoice in " apex action " select object for "invoice line items" input ( opportunity product ) map the input with record fields ( eg {!$record createddate} {!$record createddate} ) map the line records to "invoice line items" (created from step 3, eg {!get opportunity products} {!get opportunity products} ) map the line record fields with api names (field name, eg description) by coping as mentioned in the below image ( line api names (2nd image)) map the xero contact info (created from step 4, eg {!get xero contact information breadwinner salesforce account c} {!get xero contact information breadwinner salesforce account c} ) step 7 connect the flow steps, click save , and activate connect record trigger flow section to get opportunity products (run asynchronously) connect get opportunity products to get xero contact information connect get contact information to create xero invoice on opportunity triggering xero invoice creation step 1 select the opportunity step 2 edit the opportunity to meet trigger criteria ( stagename > closed won ) step 3 evaluate the created invoice at xero if all the details are mapped as expected, your xero invoice automation with breadwinner was successful