---
title: "Edit a payment on a test case (managing partner)"
method: PUT
path: "/managed-cases/{id}/payments/{paymentId}"
tags: ["ManagedCases"]
---

# Edit a payment on a test case (managing partner)

`PUT /managed-cases/{id}/payments/{paymentId}`

## Request

- Base URL: `https://collectionpartner-api.debitura.com`
- URL: `https://collectionpartner-api.debitura.com/managed-cases/{id}/payments/{paymentId}`
- Auth: API key in header `XApiKey`

Edits a payment on a test case you submitted as managing partner.

**Test-Only Restriction:** like recording a payment, this only works on cases created with `isTestCase: true`. Production cases return a 400 — the assigned collection partner must edit via `PUT /cases/{id}/payments/{paymentId}`.

**Invoiced payments are frozen:** an already-invoiced payment cannot be edited and returns **422**.

**Reopen consent:** if the edit leaves a previously closed (Paid) case with an outstanding balance, the case is reopened only when `reopenCaseIfNeeded: true`; otherwise the request returns **409 Conflict**.

## Path parameters

- `id` string, uuid, required
- `paymentId` string, uuid, required

## Request body

- DebituraWebExternalApiContractsV1PaymentsUpdatePaymentRequest: Request to edit an existing payment on a case. Mirrors the payout-split semantics of CreatePaymentRequest. **Currency:** A payment's currency cannot be changed — it is fixed to the case currency. **Invoiced payments are frozen:** a payment whose payout has already been invoiced (Stripe/QBO) cannot be edited and returns HTTP 422.
  - `date` string, date-time, required: Payment date (when payment was received). Provide date only without time component.
  - `paymentAmount` number, double, required: Total payment amount received. When both PayoutCreditor and PayoutCollectionPartner are supplied they must sum to this amount. When both are omitted, the split is computed server-side from the case's pricing terms.
  - `payoutCreditor` number, double, nullable: Amount to be paid out to creditor. **Optional.** When omitted (along with PayoutCollectionPartner), the split is computed server-side from the case's pricing terms (success fee). When supplied, PayoutCollectionPartner must also be supplied and the two must sum to PaymentAmount.
  - `payoutCollectionPartner` number, double, nullable: Amount to be kept by collection partner (commission). **Optional.** When omitted (along with PayoutCreditor), the split is computed server-side from the case's pricing terms (success fee). When supplied, PayoutCreditor must also be supplied and the two must sum to PaymentAmount.
  - `paymentRecipient` string, required: Who received the payment. **Valid values:** - **Creditor**: Payment was received by the creditor (client). When used, you must also specify CommissionPaymentStatus. - **CollectionPartner**: Payment was received by the collection partner. Commission is automatically marked as paid.
  - `commissionPaymentStatus` string, nullable: Commission payment status. **Required only if PaymentRecipient is Creditor.** When PaymentRecipient is CollectionPartner, this field is ignored and commission is automatically marked as Paid. **Valid values:** Paid, Unpaid.
  - `reopenCaseIfNeeded` boolean: Consent to reopen the case if this edit lowers the payment so a previously closed (Paid) case is left with a positive outstanding balance. When the edit would reopen the case and this flag is `false` (default), the request is rejected with HTTP 409 Conflict. Resend with `true` to confirm the reopen — the case is reopened to Active and a `case.updated` webhook fires.

## Response `200`

Payment updated successfully

- DebituraWebExternalApiContractsV1PaymentsPaymentDto
  - `id` string, uuid
  - `dateCreated` string, date-time
  - `dateUpdated` string, date-time, nullable
  - `date` string, date-time
  - `grossAmount` number, double
  - `recipient` string, nullable, required
  - `method` string, nullable, required
  - `currency` string, nullable, required
  - `invoice` DebituraWebExternalApiContractsV1PaymentsPaymentRelatedInvoiceDto, required
    - `status` string, nullable, required
    - `reference` string, nullable, required
    - `invoiceId` string, uuid

## Other responses

- `400`: Invalid request or production case
- `404`: Case or payment not found / not submitted by you
- `409`: Edit would reopen the case; resend with reopenCaseIfNeeded=true
- `422`: Payment has already been invoiced and cannot be edited
- `500`: Server error

---

[API](https://skmtc.dev/debitura/apis/debitura-collection-partner-api.md) - [All operations](https://skmtc.dev/debitura/apis/debitura-collection-partner-api/llms.txt) - [OpenAPI document](https://skmtc.dev/debitura/apis/debitura-collection-partner-api/revisions/a7cf0ff022b6?raw)
