Unfortunately, it doesn't look like the apply_shipping_charges python function is whitelisted, so I don't think there's a way to call it through the API, but you can try:
If that doesn't work, you likely will need to whitelist it or create a separate function that calls it. Alternatively, you can create a server side script that uses the before_save hook to call the apply_shipping_rule function.
I can't figure out how the taxes and charges template is applied, so I can't tell you how to implement that one. Hopefully someone else can give a clue.