# Preview one payment-method correction

Source: https://docs.fiest.io/api/reference/preview-payment-correction
Canonical sandbox contract: https://docs.fiest.io/openapi.yaml

## POST /v1/restaurants/{restaurantId}/payment-corrections/preview

Builds a before-and-after report for one exact order, tab, tab-split, or other returned payment source. Set action=correct and provide a supported destination method, or set action=undo to restore the source allocation. Preview is required before apply; it does not mutate data and expires shortly after creation. Organization-boundary tokens also require fiest.organization.read; when a token covers several organizations, organization_id must identify an exact organization returned by listOrganizations.

## Authentication

Send an OAuth access token in the `Authorization` header as
`Bearer $FIEST_ACCESS_TOKEN`.

Required scopes: `fiest.restaurant.read`, `fiest.accounting.read`, `fiest.analytics.read`, `fiest.accounting.corrections.write`

## Quick request

```bash
curl --request POST \
  --url 'https://api-sandbox.fiest.io/v1/restaurants/11111111-1111-4111-8111-111111111111/payment-corrections/preview' \
  --header 'Authorization: Bearer $FIEST_ACCESS_TOKEN'
```

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `restaurantId` | path | Yes | string (uuid) | A restaurant identifier returned by the authorized restaurant list. |
| `organization_id` | query | No | string (uuid) | An organizationId returned by GET /v1/organizations. Required for restaurant-scoped calls when a Management portfolio authorization covers more than one organization; omitted for a single-restaurant authorization and optional for a one-organization grant. |

## Success response

### 200 — The exact input, current report revision, expiry, and before/after payment reports.

```json
{
  "data": {
    "restaurantId": "11111111-1111-4111-8111-111111111111",
    "input": {
      "businessDate": "2026-07-15",
      "sourceKind": "order",
      "sourceRecordId": "fiest-50b6d34f-bc6e-4248-b3d6-839b3dda31a1",
      "action": "correct",
      "toMethodKey": "cash",
      "reason": "The receipt was settled in cash at the counter."
    },
    "expectedRevisionId": "11111111-1111-4111-8111-111111111111",
    "previewFingerprint": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
    "expiresAt": "2026-07-15T13:00:00.000Z",
    "before": {
      "refundReporting": {
        "policy": "refund-event-date/v1",
        "legacyTiming": false,
        "incompleteEvidence": false
      },
      "restaurantId": "11111111-1111-4111-8111-111111111111",
      "scope": "day",
      "period": {
        "startDate": "2026-07-15",
        "endDate": "2026-07-15",
        "timeZone": "Europe/Helsinki",
        "dayStartHour": 4
      },
      "currency": "EUR",
      "rawRows": [
        {
          "key": "card",
          "label": "Card",
          "transactionCount": 459,
          "grossMinor": 2795000,
          "netMinor": 2390000,
          "vatMinor": 405000,
          "grossByRateMinor": null,
          "vatByRateMinor": null
        }
      ],
      "adjustedRows": null,
      "rawTotalMinor": 2795000,
      "adjustedTotalMinor": null,
      "status": "review_required",
      "warnings": [
        {
          "code": "correction_ledger_unavailable",
          "message": "Raw values are available; adjusted values need review.",
          "businessDate": null,
          "correctionId": null
        }
      ],
      "days": [],
      "corrections": [],
      "sources": [],
      "appliedCorrectionIds": [],
      "rawSourceBasis": "services_accounting",
      "calculationVersion": "services-accounting/payment-report/1",
      "schemaVersion": null,
      "currentSourceFingerprint": null,
      "readOnly": true
    },
    "after": {
      "refundReporting": {
        "policy": "refund-event-date/v1",
        "legacyTiming": false,
        "incompleteEvidence": false
      },
      "restaurantId": "11111111-1111-4111-8111-111111111111",
      "scope": "day",
      "period": {
        "startDate": "2026-07-15",
        "endDate": "2026-07-15",
        "timeZone": "Europe/Helsinki",
        "dayStartHour": 4
      },
      "currency": "EUR",
      "rawRows": [
        {
          "key": "card",
          "label": "Card",
          "transactionCount": 459,
          "grossMinor": 2795000,
          "netMinor": 2390000,
          "vatMinor": 405000,
          "grossByRateMinor": null,
          "vatByRateMinor": null
        }
      ],
      "adjustedRows": null,
      "rawTotalMinor": 2795000,
      "adjustedTotalMinor": null,
      "status": "review_required",
      "warnings": [
        {
          "code": "correction_ledger_unavailable",
          "message": "Raw values are available; adjusted values need review.",
          "businessDate": null,
          "correctionId": null
        }
      ],
      "days": [],
      "corrections": [],
      "sources": [],
      "appliedCorrectionIds": [],
      "rawSourceBasis": "services_accounting",
      "calculationVersion": "services-accounting/payment-report/1",
      "schemaVersion": null,
      "currentSourceFingerprint": null,
      "readOnly": true
    }
  }
}
```

## Error responses

### 400 — The request parameters are invalid.

```json
{
  "error": "invalid_request",
  "message": "The requested date range is invalid.",
  "request_id": "req_sandbox_invalid_request"
}
```

### 401 — The access token is missing, invalid, or expired.

```json
{
  "error": "invalid_token",
  "error_description": "The access token is invalid.",
  "request_id": "req_sandbox_invalid_token"
}
```

### 403 — The authorization has expired or does not include the required scope.

```json
{
  "error": "insufficient_scope",
  "error_description": "The operation requires an OAuth scope that is not granted.",
  "request_id": "req_sandbox_insufficient_scope"
}
```

### 404 — The restaurant or requested resource does not exist or is outside the authorization.

```json
{
  "error": "not_found",
  "request_id": "req_sandbox_not_found"
}
```

### 413 — The JSON request body exceeds one megabyte.

```json
{
  "error": "payload_too_large",
  "request_id": "req_sandbox_payload_too_large"
}
```

### 429 — The partner request limit has been exceeded.

```json
{
  "error": "rate_limited",
  "request_id": "req_sandbox_rate_limited"
}
```

### 503 — The API or one of its required services is unavailable.

```json
{
  "error": "service_unavailable",
  "request_id": "req_sandbox_service_unavailable"
}
```

## Related

- [Quick start](https://docs.fiest.io/api/quickstart)
- [Stable API errors](https://docs.fiest.io/api/reference/errors)
- [OpenAPI 3.1 contract, YAML](https://docs.fiest.io/openapi.yaml)
- [OpenAPI 3.1 contract, JSON](https://docs.fiest.io/openapi.json)
- [Authorize and call the Fiest Partner API](https://docs.fiest.io/api/quickstart)