How to attach file to Books Invoice w/ Deluge

I’ve been trying for the last 6 hours.

I got everything working except this.
I am OK next

I am creating an invoice from CRM with deluge and everything is working except I cannot seem attach and upload in one of the fields in the CRM record to the new invoice. I have tried for hours and have exhausted all Internet resources that I can find. The actual API docs are terrible The example they show doesn't even have or contain where to handle the actual file or document that you want to attach so it's useless. I've tried multiple Urls.

I know it's a two-step process. I have downloaded the uploaded attachment from the CRM and I have verified that it is a file object and it will not work.

any help would be greatly appreciated!

Here’s my code:
// 6. FINAL REVISED ATTACHMENT LOGIC
if(createInvoice.get("code") == 0)
{
	newInvoiceId = createInvoice.get("invoice").get("invoice_id");
	da_field_data = deal.get("DA");
	if(da_field_data != null && da_field_data.size() > 0)
	{
		for each  fileObj in da_field_data
		{
			attId = fileObj.get("id");
			// Download from CRM
			getFile = invokeurl
			[
				url :"https://www.zohoapis.com/crm/v6/Deals/" + dealId + "/actions/download_fields_attachment?fields_attachment_id=" + attId
				type :GET
				connection:"crm_all"
			];
			// Check if the download was a file
			if(getFile.isFile())
			{
				info "This is a valid file: " + getFile.getFileName();
			}
			else
			{
				info "Download failed or returned JSON error: " + getFile;
			}
			// Re-assign parameter name immediately before the call
			getFile.setParamName("attachment");
			// Execute the upload using the direct file object in the 'files' parameter
			uploadToBooks = invokeurl
			[
				url :"https://www.zohoapis.com/books/v3/invoices/" + newInvoiceId + "/attachment?organization_id=" + orgID
				type :POST
				files:getFile
				connection:"zoho_books"
			];
			info "Books Upload Status: " + uploadToBooks.get("message");
		}
	}
}