Skip to content

Require refund_id on events.refund() - #5

Open
alexstandiford wants to merge 1 commit into
mainfrom
fix/require-refund-id
Open

alexstandiford wants to merge 1 commit into
mainfrom
fix/require-refund-id

Conversation

@alexstandiford

Copy link
Copy Markdown
Contributor

Siren now requires refundId on every refund sent to POST /event/refund, whole or partial, and refuses one without it with 400 (Novatorius/siren#1078). The id is the store's own id for this refund, such as WooCommerce refund 2201. externalId names the order and refundId names one refund of it. Siren matches a refund on source, order and refund id, so a resend is recorded once and two refunds of one order with different ids are both recorded.

What changed

  • events.refund() takes a required keyword refund_id and sends it as refundId. Before this it could not send one at all.
  • The README refund example sends one.
  • openapi.yaml marks refundId required on RefundPayload.
  • The tests send it, and one new test checks a call without it raises TypeError.
  • The changelog has a Breaking entry under Unreleased.

This is breaking for callers who send refunds without an id. Siren refuses those refunds after #1078 ships anyway. Merge this together with #1078 or just after it.

Problem: A retried partial refund sent to POST /event/refund with no refundId is recorded again (Conversation 10812)

🤖 Generated with Claude Code

https://claude.ai/code/session_01DCuGdPiGshTjFFSr1fhcKd

Siren now refuses a refund sent to POST /event/refund without a
refundId, the store's own id for that refund, and matches a refund on
its source, order and refund id. events.refund() takes a required
refund_id and sends it as refundId. The README example sends one, and
the OpenAPI spec marks it required.

Siren change: Novatorius/siren#1078
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T22:31:53.589539Z 4885c8c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant