<style>p { margin: 0; }span.fr-emoticon.fr-emoticon-img { background-repeat: no-repeat !important; font-size: inherit; height: 1em; width: 1em; min-height: 20px; min-width: 20px; display: inline-block; margin: -0.1em 0.1em 0.1em; line-height: 1; vertical-align: middle; } span.fr-emoticon { font-weight: normal; font-family: "Apple Color Emoji", "Segoe UI Emoji", "NotoColorEmoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols"; display: inline; line-height: 0; } blockquote { border-left: solid 2px #5e35b1; color: #5e35b1; margin-left:0; padding-left:5px;}blockquote blockquote{ border-color: #00bcd4; color: #00bcd4;}blockquote blockquote blockquote{ border-color: #43a047; color: #43a047;} table.grid{ border-collapse: collapse;} table.grid td, table.grid th { border: 1px solid #ddd;} .fr-fic.fr-dib{ display: block; margin: 5px auto;}.fr-fic.fr-dib.fr-fir{ text-align: right; margin: 5px 0 5px auto;}.fr-fic.fr-dib.fr-fil{ text-align: left; margin: 5px auto 5px 0;}.fr-fic.fr-dii{ float: none; margin: 5px auto;}.fr-fic.fr-dii.fr-fil{ float: left; margin: 5px auto;}.fr-fic.fr-dii.fr-fir{ float: right; margin: 5px auto;}img.fr-dib.fr-fir { margin-right: 0; text-align: right;}img.fr-dib.fr-fil { margin-left: 0; text-align: left;}img.fr-dib { margin: 5px auto; display: block; float: none;}img.fr-bordered { box-sizing: content-box; border: solid 5px #CCC;}img.fr-shadow { box-shadow: 10px 10px 5px 0px #cccccc;}img.fr-rounded { border-radius: 10px; -moz-border-radius: 10px; -webkit-border-radius: 10px; -moz-background-clip: padding; -webkit-background-clip: padding-box; background-clip: padding-box;}</style><style>
p {
margin: 0;
}
span.fr-emoticon.fr-emoticon-img {
background-repeat: no-repeat !important; font-size: inherit; height: 1em; width: 1em; min-height: 20px; min-width: 20px; display: inline-block; margin: -0.1em 0.1em 0.1em; line-height: 1; vertical-align: middle;
}
span.fr-emoticon {
font-weight: normal; font-family: "Apple Color Emoji", "Segoe UI Emoji", "NotoColorEmoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols"; display: inline; line-height: 0;
}
blockquote {
border-left: solid 2px #5e35b1; color: #5e35b1; margin-left: 0; padding-left: 5px;
}
blockquote blockquote {
border-color: #00bcd4; color: #00bcd4;
}
blockquote blockquote blockquote {
border-color: #43a047; color: #43a047;
}
table.grid {
border-collapse: collapse;
}
table.grid td,
table.grid th {
border: 1px solid #ddd;
}
.fr-fic.fr-dib {
display: block; margin: 5px auto;
}
.fr-fic.fr-dib.fr-fir {
text-align: right; margin: 5px 0 5px auto;
}
.fr-fic.fr-dib.fr-fil {
text-align: left; margin: 5px auto 5px 0;
}
.fr-fic.fr-dii {
float: none; margin: 5px auto;
}
.fr-fic.fr-dii.fr-fil {
float: left; margin: 5px auto;
}
.fr-fic.fr-dii.fr-fir {
float: right; margin: 5px auto;
}
img.fr-dib.fr-fir {
margin-right: 0; text-align: right;
}
img.fr-dib.fr-fil {
margin-left: 0; text-align: left;
}
img.fr-dib {
margin: 5px auto; display: block; float: none;
}
img.fr-bordered {
box-sizing: content-box; border: solid 5px #CCC;
}
img.fr-shadow {
box-shadow: 10px 10px 5px 0px #cccccc;
}
img.fr-rounded {
border-radius: 10px; -moz-border-radius: 10px; -webkit-border-radius: 10px; -moz-background-clip: padding; -webkit-background-clip: padding-box; background-clip: padding-box;
}
</style><p><strong>DISCLAIMER: This is just an example of using runbooks, configuring an automation to work in this way is very difficult due to the different set up you may have on your sales orders and invoices. The idea of this guide is to give a good example of the different configuration options within runbooks.</strong></p><p><br></p><p>After creating an API connection for your Halo instance (check the iterative runbook guide for detailed instructions on doing this). You can begin setting up the methods for the runbook. </p><p><br></p><p>Navigate to the runbooks area by going into Configuration>Integrations>Custom Integrations>Integration Runbooks:</p><p><img src="https://halo.haloservicedesk.com/api/attachment/image?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjM3N2FhM2QzLTUxODYtNDE4ZS05ZjI4LTQ5NzJiNGQ3ZTVjMCJ9.gyPNR2WzAAQTf1Z3Ab1inQD3ahvS-pklfohsVc9x-Cc" class="fr-fic fr-fil fr-dib" width="798" height="534"></p><p><strong>Fig 1. Runbooks Button</strong></p><p><br></p><p><strong><span style="font-size: 14pt;">Runbook Step 1</span></strong></p><p>Create a new runbook and configure the first step in the following way:</p><p><iframe src="https://scribehow.com/embed/Configure_Custom_Integration_Runbook_for_Customer_Data_Retrieval__CFO2mJ_zRde3TYWsc873QA" width="100%" height="640" allowfullscreen="" frameborder="0"><span class="fr-mk" style="display: none;"> </span><span class="fr-mk" style="display: none;"> </span><span class="fr-mk" style="display: none;"> </span><span class="fr-mk" style="display: none;"> </span><span class="fr-mk" style="display: none;"> </span></iframe></p><p><br></p><p><strong><span style="font-size: 14pt;">Runbook Step 2</span></strong></p><p><span style="font-size: 11pt;">We are going to create another integration method with the following details:</span></p><p><span style="font-size: 11pt;"><img src="https://halo.haloservicedesk.com/api/attachment/image?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImJhMDA2ZDIyLWI4ZGEtNDFlMi05MGM0LTA5YWJhNzM5MmM5NCJ9.BO_hNxHC3gAW6enfJxRaglQcV3OxfKM5QfhdiyvPIYE" class="fr-fic fr-fil fr-dib" width="1853" height="772"></span><strong>Fig 2. The Second Runbook Method</strong></p><p><br></p><p>We then have to get the recurring invoice ID for the specific client we are appending the recurring invoice lines to:</p><p><img src="https://halo.haloservicedesk.com/api/attachment/image?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6Ijk0YTY5YzEyLTgyMDItNGM0YS1iOGUwLTVlNzJhZjE3OGZiYSJ9.grs8oSitUtfEV3lQN1tlkwVJKNdU0jDT7BOLXRFMmDY" class="fr-fic fr-fil fr-dib" width="1871" height="322"></p><p><strong>Fig 3. Creating the GET Method for the Recurring Invoice ID</strong></p><p><br></p><p>The endpoint appended to the base URL is:</p><p>/RecurringInvoice?pageinate=true&page_size=15&page_no=1&includeinactive=undefined&client_id=<<Customer ID>>&includeinvoices=true&includecredits=true&includepoinvoices=false&order=nextcreationdate</p><p><br></p><p>This was found from the URL of the recurring invoice for a client, instead of putting the actual ID for that client, the output variable from our first method is introduced to the endpoint:</p><p><img src="https://halo.haloservicedesk.com/api/attachment/image?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjIzNzE3MWVhLTJmN2MtNDgyMy04N2EwLWRiMzRiMjhiNDEzZiJ9.sLwOfHA3EjFCFkkWUiECWHHk8_qzpyYAuiYdWrvQywE" class="fr-fic fr-fil fr-dib" width="1273" height="151"></p><p><strong>Fig 4. Output Variables from the first Runbook Method</strong></p><p><br></p><p>The URL has <<Customer ID>>, this is how we can generalise the endpoint of the method, so that it will work with any customer ID. The Next method is used to iterate through the Lines of the Sales Order, so we can check to see which lines are recurring:</p><p><img src="https://halo.haloservicedesk.com/api/attachment/image?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImZmMjNjOTFmLWFkMDItNDhkYi04NGU5LWE5MWE2MzFhZjEwNyJ9.5E00L2wHrsIRHhIjf8O8LuACvOVcEixHxWnsmTNjpFU" class="fr-fic fr-fil fr-dib" width="1508" height="809"></p><p><strong>Fig 5. Array Iteration of the Sales Order Lines</strong></p><p><br></p><p>We can now do a condition to check if the line is recurring or not:</p><p><strong><img src="https://halo.haloservicedesk.com/api/attachment/image?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjU4NWQ5NGY0LTEwNGYtNGQ4Mi04Zjk1LTE5NzQ5ZTNiZGY1NyJ9.6A8_5GR8t-rYO5Zp_6y1soxLVfH7xYHi8uCKh14B8q8" class="fr-fic fr-fil fr-dib" width="1515" height="678"></strong><strong>Fig 6. Condition to Check if the Line is Recurring</strong></p><p><br></p><p>Now we will POST the Recurring Invoice lines (using the import recurring invoice lines option of Halo) to the Recurring Invoice lines endpoint, this is the second last method:</p><p><img src="https://halo.haloservicedesk.com/api/attachment/image?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6Ijk3MmNhNmNmLTljYmUtNGNlOC1iMzRlLThjYWQ1YWYzMGJkOSJ9.GJG45rnI2OOHvvflILhrPQ_qLOLz78puur_sCxpH4QQ" class="fr-fic fr-fil fr-dib" width="1245" height="441"></p><p><strong>Fig 7. The JSON POST to the Recurring Invoice</strong></p><p><br></p><p>As there may be multiple lines to add to the Recurring Invoice, we must do an iteration method:</p><p><br></p><p><img src="https://halo.haloservicedesk.com/api/attachment/image?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImQ3ZmEyYzVlLTY3NDctNDgwYi04MTliLWRkOTIyZThhMGY0MSJ9.b8_wUnhL0B219MWNXK6cJHY_cvO1tFUwuzYKkd-a1_I" class="fr-fic fr-fil fr-dib" width="1214" height="478"></p><p><strong>Fig 8. The Iteration Being Carried Out</strong></p><p><br></p><p>This <strong>(Fig 9) </strong>is the final functional step of the runbook, after this we set the end step:</p><p><img src="https://halo.haloservicedesk.com/api/attachment/image?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVlYjY0ZTZiLTQ2ZjMtNDY3MC04MGQ3LThkZGQwYzAwMDdiNyJ9.GpeGaasQIYRzSjivRGmjjms1cpXznyPf8u1GuiT3zvQ" class="fr-fic fr-fil fr-dib" width="1112" height="612"></p><p><strong>Fig 9. Iteration for Adding Recurring Lines</strong></p><p><br></p><p>For best practice, you can have one end step(failed, retry from the start) that connects to all other steps, instead of having an end step per method.</p><p><strong><img src="https://halo.haloservicedesk.com/api/attachment/image?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjA3NDIzNDdiLWUzZWMtNDhiZi05YzdlLTM5ODY4MWUyNzYwMiJ9.OXTR339uBdwHOHHrrnp9iVFaJZ1rOeasDopbEw-dqXE" class="fr-fic fr-fil fr-dib" width="1488" height="495"></strong><strong>Fig 10. The Entire Runbook</strong></p><p><br></p><p>Step 3 is configured in the following way:</p><p><strong><img src="https://halo.haloservicedesk.com/api/attachment/image?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImY3NjU2NzIyLWIwZDUtNGFjMi1hYjBjLTg0YmNhYjRiNTliYyJ9.G3JVdGe3rFQ2F2Mpy6OpE6blcMatLiWRXe3zWvDu5XM" class="fr-fic fr-fil fr-dib" width="1086" height="383"></strong><strong>Fig 11. The Fail and Retry Step</strong></p>