Skip to main content
Connect to https://mcp.opencommerce.sh/mcp with your Commerce SDK credentials as Authorization: Bearer <YOUR_CLIENT_ID>:<YOUR_CLIENT_SECRET>. See Connect your agent.
cancel_order isn’t available on the server yet. Until it is, a call answers order_actions_unavailable.
Behavior: Changes state on the second call only. The quote changes nothing and can be asked again. Never resend the confirm.

What it does

Cancels a placed order in two calls. The first call, without confirm_token, returns a quote with the refund, the card it goes back to, a confirm_token, and its expires_at, and changes nothing. Show the shopper the refund and ask. Only after the shopper says yes to that quote, call again with its confirm_token. That cancels the order once.

Inputs

Returns

Example calls

Ask for the quote:
After the shopper says yes to the quote, send the same call with its token:

Notes

  • If the confirming call’s result is uncertain, such as a timeout or an upstream error, call get_order to see whether it went through. Never resend it.
  • cancel_not_supported and cancel_too_late mean the store can’t cancel this order. Tell the shopper the reason and the next step the message names.
  • order_id_ambiguous means the id matches orders at more than one store. Call again with merchant set to one of the stores the message names.
  • order_actions_unavailable means cancelling isn’t available yet. Tell the shopper to contact the store, or check the order with get_order.