Add and remove handling fee lines with Flow

Prev Next

Use these invocable actions when your storefront needs to show a handling charge as a cart summary row instead of as a normal buyer-editable product line.

OrderCentral provides two Flow actions in the OrderCentral Cart category:

  • Upsert Fee Line
  • Remove Fee Line

These actions are designed for cart-level fee scenarios where the business decides when the fee should apply, but OrderCentral should still price the fee from the cart price book and recalculate cart totals automatically.

What these actions do

The fee-line actions let a Flow create, update, or remove a handling-fee-style row on a shopping cart.

When a fee line is upserted, OrderCentral creates or updates a cart item that is:

  • read-only to the buyer
  • shown in the cart summary area instead of the main cart item list
  • treated as a fee item for cart total calculation
  • priced from the product and price book on the cart, not from a manually entered amount

When a fee line is removed, OrderCentral deletes the matching fee row and recalculates the cart.

Before you start

Make sure these prerequisites are in place before you call either action from Flow:

  • You have the target Shopping Cart Id.
  • You have a Product2 record that represents the fee.
  • That fee product is priceable in the cart's price book.
  • The shopping cart has a price book assigned.
  • Your Flow uses the same Fee Type consistently when it updates or removes the fee later.

For most handling-fee implementations, use Fee as the Fee Type value. This is the standard fee cart item type in OrderCentral, and the same Fee Type value is also used as the lookup key when OrderCentral decides whether it should create a new fee row or update an existing one.

The upsert action does not accept an arbitrary amount. It resolves price from the fee product in the cart price book. If the product cannot be priced, the action fails.

Upsert Fee Line

Use Upsert Fee Line when your Flow should add a handling fee if it is missing or refresh the existing fee row if it already exists.

Inputs

Flow input Required What it does
Shopping Cart Id Yes Identifies the cart that should receive the fee line.
Fee Type Yes Identifies the fee row type and acts as the upsert key. Reuse the same value when you update or remove the fee later.
Product Id Yes Identifies the Product2 record used to price the fee line.
Display Sequence No Controls the ordering of summary rows in the cart summary. Lower values appear first.

Result fields

Result field What it means
Fee Line Id The created or updated Shopping Cart Item record.
Success Returns true when the upsert completes successfully.

How matching works

OrderCentral looks for an existing fee line by:

  • Shopping Cart Id
  • Fee Type
  • fee financial type

If a matching fee line already exists, the action updates that row instead of creating a duplicate. If no matching fee line exists, the action creates a new summary fee row.

This means Fee Type is not just descriptive input. It is the key that determines whether the action inserts a new line or updates the existing fee line.

What OrderCentral sets automatically

When OrderCentral creates the fee line, it automatically sets the row up for summary-only storefront behavior:

  • the line is marked read-only
  • the line is placed in summary-only display mode
  • the line is priced by OrderCentral
  • the line is treated as a fee financial type

Your Flow only decides whether the fee should exist, which fee product to use, and optionally where the row should appear among other summary rows.

Remove Fee Line

Use Remove Fee Line when the cart should no longer include the handling fee.

Inputs

Flow input Required What it does
Shopping Cart Id Yes Identifies the cart that should be checked for the fee line.
Fee Type Yes Identifies which fee line should be removed.

Result fields

Result field What it means
Success Returns true when the action completes successfully.

If no matching fee line exists, the action still returns success and does not throw an error just because the fee row is already absent.

How fee lines appear in the cart

Handling fee lines created through these actions are meant to behave like summary rows, not normal merchandise rows.

In the storefront cart experience, buyers should expect these lines to:

  • appear in the cart summary area rather than in the main item table
  • remain visible without behaving like a normal editable product row
  • participate in the cart's final amount without being treated as merchandise subtotal

Display Sequence is optional, but it matters when the summary contains more than one summary-only row. When you provide a sequence, OrderCentral sorts summary rows by that value. Rows without a sequence appear after rows that do have one.

What recalculates automatically

Both actions trigger standard cart recalculation after the fee line is added, updated, or removed.

In standard OrderCentral cart calculation:

  • product rows continue to determine cart subtotal
  • fee rows contribute to total amount
  • discount rows also contribute to total amount

This means a handling fee line changes the cart total, but it does not change the merchandise subtotal.

When you remove a fee line, OrderCentral recalculates the remaining cart totals again so the cart stays consistent.

Simple Flow design example

Use this pattern when a storefront should add a handling fee when an order falls below a threshold or when a special fulfillment condition applies.

Example design

  1. Start with a Flow that already knows the active Shopping Cart Id.
  2. Add decision logic that determines whether the cart should include the handling fee.
  3. If the fee should apply, call Upsert Fee Line.
  4. Set Shopping Cart Id to the current cart.
  5. Set Fee Type to Fee.
  6. Set Product Id to the Product2 record used for the handling fee.
  7. Optionally set Display Sequence if the fee should appear in a specific summary position.
  8. Check the returned Success value.
  9. If the fee should not apply, call Remove Fee Line with the same Shopping Cart Id and Fee Type.

Example input values

Input Example value
Shopping Cart Id current cart record Id from the Flow context
Fee Type Fee
Product Id Handling Fee product record Id
Display Sequence 20

This pattern keeps the Flow responsible for fee eligibility while leaving pricing and cart recalculation to the standard OrderCentral cart services.

Validation and troubleshooting

Check these items first if the Flow action fails or the fee does not appear as expected.

The upsert action fails before creating the fee line

Confirm that:

  • Shopping Cart Id is populated
  • Fee Type is populated
  • Product Id is populated
  • the shopping cart exists
  • the shopping cart has a price book

The fee line is created but the action fails on pricing

Confirm that the fee product can be priced from the cart price book.

The action does not let Flow pass a custom amount directly. If no price can be resolved for the fee product, the upsert fails.

The wrong fee line is updated or removed

Confirm that the Flow uses the same Fee Type value every time for the same handling-fee concept.

Fee Type is the identifier OrderCentral uses to find the existing fee line. If you change the value between Flow runs, the action can no longer match the same row consistently.

The fee is not visible where buyers expect it

Confirm that the storefront cart experience supports cart summary rendering and that your team is reviewing the summary area, not only the main cart item list.

These fee lines are intentionally created as summary-only rows.

When to use these actions

Use the fee-line Flow actions when:

  • the fee should be shown clearly but not treated like a normal product row
  • the fee amount should come from standard product pricing instead of custom Flow math
  • the fee should be added or removed by business rules in automation
  • the cart should recalculate automatically after fee changes

If your design requires a completely custom fee amount model that does not come from product pricing, these actions are not the right fit on their own.