This could be achieved by calling OData actions. OData actions are initiating further data processing on the server and must always be called using the POST method.
Mark order with ID 145 as paid
Note the second line, which consists of optional OData action parameters. They are always sent in the request body, not in the query string. This example also sets the system name of the payment method to
Payments.Sofortueberweisung with which order 145 has been matched.
Other actions that would change the payment status are
PaymentRefund supports the action parameter
True would call the related payment gateway to refund the payment.
False just sets the status offline without calling any payment gateway.
To cancel an order, call the action
Cancel. It does not support any action parameter. To complete an order call