Surcharges via REST Api

Fooman Surcharges will automatically appear in REST responses for individual orders/invoices/creditmemos under the extension_attributes key. 

For example the below response for salesOrderRepositoryV1Get will list the surcharges under extension_attributes > fooman_total_group > items:

2ac7e9ba9e9eb1f551718d029b66b9a2.pngCreating Refunds for Orders with Surcharges

By default when creating a creditmemo the whole surcharge amount will be refunded. If you wish to adjust the amount to a lower amount you can append an amount override to the REST Api url like the below:
?creditmemo[fooman_surcharge][payment1]=3.50
where payment1 is the type id as seen in the previous API response.

So the full url would be something like this

/V1/order/:orderId/refund?creditmemo[fooman_surcharge][payment1]=3.50

for offline payment methods. And this for creating an online refund:

/V1/invoice/:invoiceId/refund?creditmemo[fooman_surcharge][payment1]=3.50

Which results in
5877435c6a9fbc47ace7c11a4fb7f6d6.png

Still need help? Contact Us Contact Us