Example to add payment costs to the rest api. Follow the example to add the payment costs to the order.
If you want different payment cost for credits, make sure to add the payment cost to the credit as well.
Here, they should be added to the extension_attributes.xcore_payment_cost. This is different than the order, where they should be added to the payment.extension_attributes.xcore_payment_cost property.