---
title: "Fail Pending Transaction"
method: POST
path: "/api/v1/simulation/wallets/{walletId}/fail-transaction"
tags: ["Simulations"]
---

# Fail Pending Transaction

`POST /api/v1/simulation/wallets/{walletId}/fail-transaction`

## Request

- Base URL: `https://merchant-api.accruesavings.com`
- URL: `https://merchant-api.accruesavings.com/api/v1/simulation/wallets/{walletId}/fail-transaction`
- Auth: none declared. Required headers: `Client-ID`, `Authorization`
- TypeScript: <https://skmtc.dev/byaccrue/apis/accrue-merchant-api/docs/api/v1/simulation/wallets/:walletId/fail-transaction/post.ts> (a function with typed inputs; its response is checked against the schema)

Fail a pending transaction for a wallet (ACH or card).

  Fails a pending transaction either by transaction ID or the first pending transaction if no ID is provided.

  An optional failure reason can be specified to simulate different failure scenarios.

  **This endpoint is only available in development, sandbox, and local testing environments.**

## Path parameters

- `walletId` string, uuid, required: Wallet ID

## Headers

- `Client-ID` string, uuid, required: The unique identifier of the client making the request. This header is required to retrieve the client-specific configuration and ensure that the response is tailored to the client's settings and permissions.
- `Authorization` string, uuid, required: Secure secret to access privileged endpoints.

## Request body

- object
  - `data` FailPendingTransactionRequest: Fail Pending Transaction request
    - `id` string, uuid, required: Unique identifier for the object.
    - `type` 'FailPendingTransaction', required
    - `attributes` object, required
      - `transactionId` string, uuid: Optional transaction ID. If not provided, the first pending transaction will be failed.
      - `reason` 'Canceled' | 'HardDecline' | 'SoftDecline' | 'Expired' | 'InsufficientFunds' | 'Reversed' | 'Unknown': Transaction failure reason applied when failing the pending transaction (ACH or card). If not provided, defaults to Unknown.

## Response `204`

No Content - Transaction failed successfully

## Other responses

- `400`: Bad Request - Invalid transaction
- `404`: Wallet not found

---

[API](https://skmtc.dev/byaccrue/apis/accrue-merchant-api.md) - [All operations](https://skmtc.dev/byaccrue/apis/accrue-merchant-api/llms.txt) - [OpenAPI document](https://skmtc.dev/byaccrue/apis/accrue-merchant-api/revisions/3e2d97ef2e6e?raw)
