About 40,000 for full threading etc. From third party resellers, the only way to get it.
If you ask about anything more affordable or watermarked versions for development they'll just condescendingly advise it is "Enterprise" and and direct you to call a third party reseller.
With some customization Scribus for variable document generation would be free. Adobe InDesign is by far the best option but not feasible, especially when you need to build a custom system around it. Services like Pageflex are similarly priced but you'd be up and running immediately.