How Can I Update Customer's metafield immediately once Checkout Successfully

Topic summary

Issue: A custom Checkout UI extension for loyalty points stores balances in a customer metafield and uses Shopify Flow to deduct points when used at checkout. Due to ~5s delay before the metafield updates, a customer can check out simultaneously on two devices with maximum points, resulting in double-spend and inconsistent balances.

Details:

  • Checkout UI extension: customizes Shopify’s checkout experience.
  • Metafield: custom data field attached to a customer record.
  • Shopify Flow: event-driven automation; observed to update the metafield with a short lag.

Risk: Concurrency/race condition during the delay window lets two payments succeed before the deduction is reflected, effectively duplicating point usage.

Request: Guidance on how to update the customer metafield immediately upon successful checkout to prevent double-spend.

Latest update: Another participant asked whether a solution was found and expressed concern about data inconsistency.

Status: Unresolved. No confirmed solution or mitigation steps shared yet; key question remains how to perform an immediate, atomic update at checkout success.

Summarized with AI on December 30. AI used: gpt-5.

I built a custom app using checkout UI extension to implement loyalty points.

I saved loyalty points in customer’s metafield. And when customer use this point to their order, i used Shopify Flow to minus the points they used.

But have a delay about 5 seconds to customer’s metafield was updated.

And in the delay time, if customer use 2 devices, and use maximum loyalty points, they click pay button as the same time, they still checkout successfully. It means loyalty points was doubled. This is a very large risk, right?
So i want to know how can I update the customer metafield immediately once checkout successfully?
Please help me.

Thank in advance.

Hello @vy2902 , have you found a solution to your concern? I’m also worried about the delay, as it may caused inconsistency in the data.