Dealing with sold out products and the PayPal BMSetInventory API method

I’ve just built a WordPress custom post type which allows you to sell a few simple products on your site by interacting with the PayPal Button Management API. (It wasn’t easy. PayPal’s documentation is full of duplicated informal, distributed all over the place, and badly maintained.) One thing which isn’t mentioned in the documentation is …