This is basically a request to integrate some of the functionality of File (Field) Paths into core. Here's the file field configuration page, once the module is enabled:

The redirect and active/retractive update bit can be left for contrib (or to be solved by #854); the transliteration bit is already implemented in Backdrop (admin/config/media/file-system); the redirect can be left for a separate issue (or contrib); what I find a valuable feature though is the ability to use tokens for file names and file paths. The later is what this issue here is about.
Original request
There is a feature request for this filed in the File (Field) Paths module issue queue that is marked as "closed/fixed". It states that Entity API exposes this as a token (I think it's the Entity Token sub-module actually):

Looking at our token browser though, the deepest I could get to is [node:field_image].
Recent comments
In a blog post titled "Github Tips and Tricks for Contrib Maintainers", I'd like to see some of the following topics: When is the README sufficient for documentation? When should...
Github Tips and Tricks for Contrib Maintainers
Thanks Alejandro. That was the clues I needed.
Ubercart - Programmatically add product to cart and straight to Checkout
Have you tried uc_cart_add_item()? You need to provide the nid of the product. Then you can use backdrop_goto('cart/checkout'); to send the user to the checkout screen. uc_cart_add_item...
Ubercart - Programmatically add product to cart and straight to Checkout