Skip to main content
The merchant BFF owns orchestration because it is the only layer that should see both the authenticated customer and the merchant loyalty key.
1

Preview

Map the open cart and call orders/evaluate; reserve a selected reward before payment.
2

Resolve payment

Reverse on failure. On settled payment, map the paid order and post accrual with the original operation key.
3

Finalize reward

Capture the reservation against the paid order. Retry a failed operation with its original key.
4

Adjust

Post a void or partial-refund adjustment linked to the original order with exact signed deltas.
Decide before launch whether tax, tip, service fees, gift value, comps, and delivery charges earn. Keep store-local business_date separate from event timestamps. Partial refunds reverse only earning/funding attributable to the returned amount; they are not synthetic negative purchases. See the runnable ordering BFF on GitHub.