Skip to content

Refund Lifecycle

Models the lifecycle of a Refund — the payment reversal or credit issued to a customer following a return, exchange, or payment correction. A refund originates from an authorised return or adjustment and must be processed through the payment provider before being settled to the customer's original payment method or issued as store credit.

Object: refund · States: 7 · Transitions: 9


State Diagram

flowchart LR

    %% ── classDef palette ─────────────────────────────────────
    classDef stInit  fill:#0d9488,stroke:#0f766e,color:#fff,font-weight:bold
    classDef stNorm  fill:#3b82f6,stroke:#2563eb,color:#fff
    classDef stOk    fill:#16a34a,stroke:#15803d,color:#fff,font-weight:bold
    classDef stFail  fill:#dc2626,stroke:#b91c1c,color:#fff,font-weight:bold
    classDef stHold  fill:#d97706,stroke:#b45309,color:#fff

    %% ── nodes ───────────────────────────────────────────────
    requested(["Requested"])
    pending["Pending"]
    partial["Partially Refunded"]
    completed[["Completed"]]
    failed["Failed"]
    cancelled[["Cancelled"]]
    converted_to_credit[["Converted to Store Credit"]]

    %% ── transitions ─────────────────────────────────
    requested -->|"refund-initiated"| pending
    pending -->|"refund-processed"| partial
    partial -->|"refund-processed"| completed
    pending -->|"refund-processed"| completed
    pending -->|"refund-failed"| failed
    failed -->|"refund-initiated"| pending
    failed -->|"refund-converted"| converted_to_credit
    requested -->|"refund-cancelled"| cancelled
    pending -->|"refund-cancelled"| cancelled

    %% ── class assignments ───────────────────────────
    class requested stInit
    class pending,partial,failed stNorm
    class completed,converted_to_credit stOk
    class cancelled stFail

States

State Label Description Initial Terminal
requested Requested Refund initiated — return or correction authorised. Awaiting payment processing.
pending Pending Refund request submitted to payment provider. Processing in progress.
partial Partially Refunded A portion of the refund amount has been processed. Remainder pending.
completed Completed Full refund amount processed and credited to customer. Confirmed by payment provider.
failed Failed Refund processing failed (expired card, account closed, provider error).
cancelled Cancelled Refund request cancelled before processing (return rejected, dispute resolved).
converted-to-credit Converted to Store Credit Refund could not be issued to original payment method; converted to store credit or gift card by customer agreement or policy.

Transitions

From To Trigger Guards
requested pending refund-initiated Return or correction authorised; Refund amount calculated and confirmed; Original payment reference available
pending partial refund-processed Payment provider confirmed partial amount; Multi-tender split-refund in progress
partial completed refund-processed Remaining amount processed successfully
pending completed refund-processed Full refund amount confirmed by payment provider
pending failed refund-failed Payment provider returned error or rejection
failed pending refund-initiated Updated payment details provided or alternative method selected; Retry within allowed window
failed converted-to-credit refund-converted Customer or policy consent to store credit; Store credit issued and confirmed
requested cancelled refund-cancelled Return rejected or dispute resolved before processing
pending cancelled refund-cancelled Payment provider reversal of refund request before settlement