Skip to content

docs(webhook): restructure PaymentInstructionEvent status payload#24

Open
diegopereira90 wants to merge 2 commits intomainfrom
docs/payment-instruction-event-state
Open

docs(webhook): restructure PaymentInstructionEvent status payload#24
diegopereira90 wants to merge 2 commits intomainfrom
docs/payment-instruction-event-state

Conversation

@diegopereira90
Copy link
Copy Markdown
Contributor

@diegopereira90 diegopereira90 commented May 8, 2026

Summary

Lock-step companion to fx-payment#79. Two changes to the SNS payload for BENEFICIARY_PAYMENT_INSTRUCTION_*:

  1. Wrap the status in currentState to match OperationEvent / TransactionEvent and surface the rejection reason.
  2. Rename the enum PaymentInstructionEventStatusPaymentInstructionStatus. The Event suffix was an artifact of when the enum sat directly on PaymentInstructionEvent.status; now that it lives inside PaymentInstructionState.status, the suffix no longer reflects its role. The new name is consistent with OperationStatus / TransactionStatus and with the surrounding PaymentInstructionEvent / PaymentInstructionState family.
 PaymentInstructionEvent:
   properties:
     id: ...
     asset: ...
-    status:
-      $ref: '#/components/schemas/PaymentInstructionEventStatus'
+    currentState:
+      $ref: '#/components/schemas/PaymentInstructionState'
     address: ...
+
+PaymentInstructionState:
+  properties:
+    status:    # PaymentInstructionStatus enum (renamed)
+    reason:    # populated on REJECTED, null otherwise
+    createdAt: # when the instruction entered this status

Enum values (PENDING_REVIEW, APPROVED, REJECTED) and JSON field paths are unchanged. Webhook event-type prose for BENEFICIARY_PAYMENT_INSTRUCTION_APPROVED / _REJECTED updated to reference currentState.status (and currentState.reason on rejection).

Test plan

  • redocly lint shows no new error categories — PaymentInstructionState.reason follows the same allOf + nullable pattern as the existing OperationState.reason / TransactionState.reason
  • Visual review on the published Mintlify preview
  • Land together with fx-payment#79

🤖 Generated with Claude Code

Match the SNS payload now emitted by fx-payment (PR #79) and align
with the State<T> wrapper already used by OperationEvent and
TransactionEvent — `currentState.status` plus `currentState.reason`
(populated on REJECTED) and `currentState.createdAt`.

The PaymentInstructionEventStatus enum is preserved as
PaymentInstructionState.status — no enum value changes.
@mintlify
Copy link
Copy Markdown

mintlify Bot commented May 8, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
tracefinance 🟢 Ready View Preview May 8, 2026, 1:35 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

…tionStatus

The `Event` suffix was an artifact of when this enum lived directly on `PaymentInstructionEvent.status`. Now that it sits inside `PaymentInstructionState.status`, the suffix no longer reflects the schema's role. Rename to match the surrounding `PaymentInstructionEvent` / `PaymentInstructionState` family.

Companion to the same rename in fx-payment.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@diegopereira90 diegopereira90 changed the title docs(webhook): wrap PaymentInstructionEvent.status in currentState docs(webhook): restructure PaymentInstructionEvent status payload May 8, 2026
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