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

# Sandbox only: settle a pending payment

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

## Request

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

Marks a pending payment paid or declined, so payment.confirmed or payment.failed and checkout.session.completed follow without a browser. Do not also finish the payment on the hosted page. 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

- Transaction: A merchant-scoped transaction projected from Zahlo's persisted payment record. Provider refresh is best effort; status and timeline fields remain stable when a provider is unavailable.
  - `id` string, required
  - `paymentId` string, required: The payment id (`GET /api/v1/payments/{id}`).
  - `status` 'pending' | 'confirmed' | 'failed' | 'cancelled' | 'expired', required
  - `method` 'card' | 'sepa_direct_debit' | 'klarna' | 'ideal' | 'bancontact' | 'apple_pay' | 'google_pay' | 'paypal' | 'unknown'
  - `reference` string, nullable
  - `metadata` object: Up to 50 key-value pairs; keys up to 40 characters, values strings up to 500 characters.
  - `amount` Money, required
    - `amountMinor` integer, required: Amount in the smallest currency unit
    - `currency` string, required
  - `fee` Money
    - `amountMinor` integer, required: Amount in the smallest currency unit
    - `currency` string, required
  - `createdAt` string, date-time, required
  - `occurredAt` string, date-time, required

## 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)
