Need customers to be able to enter discount code on draft order invoices

Axel - Any chance you can explain how your app is using the Shopify API to do this? Thanks