Return (reverse) a single deposit made toward a payin

This POST endpoint returns (reverses) a single deposit received toward a pay-in. A pay-in funded through a temporary bank account may receive multiple ACH or wire deposits over its lifetime; each deposit is identified by its own deposit_token and can be returned independently. This differs from /payin/USER_TOKEN/{payin_token}/reverse, which closes the deposit account itself and stops future deposits.
Incoming ACH and wire deposits auto-fund and settle immediately upon receipt (status COMPLETED), so a return always operates on a settled deposit: the funds are sent back to the sender through the originating network, the returned amount is debited from the destination wallet, and the deposit transitions to RETURNED.
The request must include a normalized reason_code describing why the deposit is being returned — see the DepositReturnReason schema for the full list. MassPay translates the normalized reason into the network-specific return code for the rail the deposit was received on (a NACHA Rxx code for ACH, or an ISO 20022 reason code for wires); the transmitted code is surfaced on the deposit as network_return_code. A free-text reason may also be supplied for audit purposes, and is required when reason_code is OTHER.
A deposit that is not in COMPLETED status — including one already RETURNED — or that does not belong to the given pay-in, returns a 400.
On success the updated deposit object is returned.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
required

Token representing the user the pay-in belongs to

string
required

Token representing the pay-in transaction. Returned in the response when a pay-in is created via /payin/USER_TOKEN

string
required

Token representing the individual deposit to return. Deposit tokens are listed in the deposits array of the pay-in object returned by /payin/USER_TOKEN/{payin_token}

Body Params

Details for returning (reversing) a single deposit made toward a pay-in.

string
enum
required

Normalized reason for returning a deposit. MassPay translates the reason into the network-specific return code for the rail the deposit was received on; the code actually transmitted is surfaced on the deposit as network_return_code. Mappings:

  • REFUSED_BY_BENEFICIARY — Beneficiary refuses to accept the credit (ACH R23 · Wire CUST)
  • UNEXPECTED_PAYMENT — No matching obligation or invoice; undue payment (ACH R23 · Wire UPAY)
  • DUPLICATE_DEPOSIT — Deposit is a duplicate of one already received (ACH R24 · Wire AM05)
  • ACCOUNT_CLOSED — Deposit account has been closed (ACH R02 · Wire AC04)
  • ACCOUNT_NOT_FOUND — No account located for the credit (ACH R03 · Wire AC01)
  • INVALID_ACCOUNT_NUMBER — Account number fails structural validation (ACH R04 · Wire AC01)
  • BENEFICIARY_NAME_MISMATCH — Beneficiary name does not match the account (ACH R03 · Wire BE01)
  • ACCOUNT_FROZEN — Account is frozen or blocked (ACH R16 · Wire AC06)
  • NON_TRANSACTION_ACCOUNT — Account type does not accept this kind of entry (ACH R20 · Wire AG01)
  • SUSPECTED_FRAUD — Deposit is suspected to be fraudulent or unauthorized (ACH R17 · Wire FRAD)
  • REGULATORY_COMPLIANCE — Returned for sanctions/OFAC or other regulatory reasons (ACH R16 · Wire RR04)
  • SENDER_RECALL_REQUEST — Returned in response to the originator's recall/cancellation request (ACH R06 · Wire FOCR)
  • BENEFICIARY_DECEASED — Beneficiary or account holder is deceased (ACH R15 · Wire MD07)
  • OTHER — Reason not covered above; requires a free-text reason (ACH R23 · Wire MS03)

string
length ≤ 255

Free-text reason for the return, stored for audit purposes and forwarded to the partner/network where supported. Optional unless reason_code is OTHER, in which case it is required.

string
enum
Defaults to CLIENT

Who absorbs the return fee. CLIENT (default): the sender receives the full deposit back and the fee is debited from the destination wallet on top of fiat_amount; valid for every deposit method. DEPOSITOR: the fee is withheld from the returned funds — the sender receives the deposit amount minus the fee and the wallet is debited fiat_amount only. Modifying the returned amount is only supported for wire deposits, so DEPOSITOR is rejected with a 400 for ACH/RTP deposits.

Allowed:
Headers
string

Unique key to prevent duplicate processing

Responses

Language
Credentials
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json