Order custom fees
The order custom fees extension point displays one or more customized fees or discounts on the following locations:
- The Orders Total section of the Create Order page and related pages in the Admin.
- Invoice pages in the Admin.
- Credit memo pages in the Admin.
- Order history pages on the storefront.
The fee amounts are in the base currency of the store.
Example customization​
The following example enables the display of two fees on the Admin and storefront. The first instance applies a $1.00 fee to all orders. The second instance applies a fee of $5.00 when the order total is $20.00 or more.
order: {
customFees: [
{
id: 'test-fee-1',
label: 'Test Fee 1',
value: 1.00,
applyFeeOnLastCreditMemo: false
},
{
id: 'test-fee-2',
label: 'Test Fee 2',
value: 5.00,
orderMinimumAmount: 20,
applyFeeOnLastInvoice: true
}
]
}
Parameters
Field
Type
Required
Description
idstring
Yes
A unique ID that identifies the fee/discount. We recommended using the format:
<extensionId>::<fee/discountName>.labelstring
Yes
The name of the fee/discount to display.
valuefloat
Yes
The amount of fee/discount to charge, in the base currency.
orderMinimumAmountfloat
No
The minimum amount of the order to apply the fee/discount. Default value:
0.applyFeeOnLastInvoiceboolean
No
Whether to apply the fee/discount to the last invoice. If
false, the fee/discount will be applied to the first invoice. Default value: false.applyFeeOnLastCreditmemoboolean
No
Whether to refund the fee/discount to the last credit memo. If
false, the fee/discount will be refunded to the first credit memo. Default value: true.Sample code
The Adobe Commerce Extensibility Code Samples repository demonstrates how to customize order custom fees.