Is this possible? Updating Store/Curb-Pickup Fulfillment via Orders API as we pick each item

We have a problem described in Recommended workaround to sell variable price item... - The Seller Community. Basically we have items we sell in store that are price embedded barcodes (so variable price, but scan at checkout and tracks inventory - lbs of meat).

We use to print these price embedded barcodes. But we can’t sell exactly 0.67lbs of T-Bone stake online, we’d just list 0.75 lb and 1.0 lb. But we need to refund customers if we pick an order under the price they are asking for. And we can’t make refunds a manual process by the store employees, only managers can refund. (Also orders on the online store come in fully paid for, so we can’t edit it before capturing the payment card).

The Idea:

  • We build an app on an iPad that watches for online orders (POST /v2/orders/search - Square API Explorer for recent ones, or order.updated Webhook - Square API Reference)
  • Then also check each of the line items that they can be fulfilled, in the in-app experience you can do this, we’d do the same
  • WHEN THEY ORDER MEAT, we’d prompt for scanning the exact price embedded barcode that it is fulfilled with and issue a refund for the overage square online charged (e.g. purchased 0.75 lb @ 12.99/lb but only picked 0.67lb the difference would be refunded to the card)
  • When one comes in, we have a notification and the person marks it pending via our app (using UpdateOrder and set fulfillment state to PREPARED, and COMPLETED).

EDIT: It looks like that State field is editable by the API API PUT /v2/orders/{order_id} Can't set fulfillment state or order state - #3 by ryanlath, that thread shows how to do so.

Wanted to make sure these order updates are possible. Will be testing too.

:wave: I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:

Additional Documentation

Publish your App to the App Marketplace
Square Developer
Square Developer Documentation

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.

Yes, your idea is feasible with the Square APIs. You can use the Orders API to watch for online orders and check each of the line items for fulfillment. You can also use the UpdateOrder endpoint to change the fulfillment state to PREPARED and COMPLETED.

For issuing refunds, you can use the Refunds API. When you scan the exact price embedded barcode and calculate the overage, you can create a refund for the difference. This will refund the amount back to the customer’s card.

Remember to handle any errors or edge cases that might occur during this process, such as failed refunds or issues with updating the order status. Also, ensure that your application securely handles sensitive customer information, such as card details, in compliance with PCI standards.

This answer was reviewed by @Bryan-Square.