Added /api/v1/store-discounts to the Store API. Your own systems can list and read discounts, add a discount code or an automatic discount with the same settings as the discount's page in Store, change it, and deactivate it. A change is saved whole or not at all, and a refused value is named in the answer. These calls need the Manage discounts Store permission.
Store discounts in the API
The Store API can now list, read, add, change and deactivate discount codes and automatic discounts.