---
title: "Sandbox only: settle a pending refund"
method: POST
path: "/api/v1/test-helpers/refunds/{id}/outcome"
tags: ["Payments"]
---

# Sandbox only: settle a pending refund

`POST /api/v1/test-helpers/refunds/{id}/outcome`

## Request

- Base URL: `https://merchant.zahlo.eu`
- URL: `https://merchant.zahlo.eu/api/v1/test-helpers/refunds/{id}/outcome`
- Auth: API key in header `x-api-key`

Settles a pending refund as succeeded or failed; refund.succeeded or refund.failed follows. The provider never sees this outcome; the real handlers apply it, so the real events follow. 404 resource_not_available outside the sandbox; 409 state_conflict when the object is past this step.

## Path parameters

- `id` string, required

## Request body

- TestOutcomeRequest
  - `outcome` 'succeeded' | 'failed', required

## Response `200`

Successful response

- Refund
  - `id` string, required
  - `object` 'refund', required
  - `livemode` boolean, required
  - `createdAt` string, date-time, required
  - `paymentId` string, required: The payment's id, as GET /api/v1/payments/{id} takes it.
  - `amountMinor` integer, required
  - `currency` string, required
  - `status` 'pending' | 'succeeded' | 'failed', required
  - `reason` string, nullable, required
  - `metadata` object, required: Up to 50 key-value pairs; keys up to 40 characters, values strings up to 500 characters.

## Other responses

- `400`: Invalid request
- `401`: Authentication failed
- `404`: Resource not found
- `409`: Request conflicts with existing state

---

[API](https://skmtc.dev/zahlo/apis/zahlo-merchant-api.md) - [All operations](https://skmtc.dev/zahlo/apis/zahlo-merchant-api/llms.txt) - [OpenAPI document](https://skmtc.dev/zahlo/apis/zahlo-merchant-api/revisions/8fcbef981e0d?raw)
