latestOpenAPI 3.0.42026-08-134969330.3 KB

db09d0fd5c94

Cases

Create a payment on a case

Records a payment received for a collection case.

Use Case: Use this endpoint when you receive a payment from the debtor. Provide the payment amount and, in the normal case, nothing else for the split — omit both PayoutCreditor and PayoutCollectionPartner and Debitura computes the creditor/partner split server-side from the case's pricing terms (success fee). This is the default and recommended usage for almost every integration.

Advanced override — PayoutCreditor / PayoutCollectionPartner: Supplying both fields lets you dictate the split explicitly instead of using the computed one. This is an advanced, opt-in override for legitimate edge cases (e.g. a negotiated split where the collection partner already holds funds) — it is not the normal path and most integrations should never set it. When supplied:

  • Both fields are required together, and MUST sum to PaymentAmount (within 0.01 tolerance).
  • The response's Warnings array surfaces (without blocking the request) if the split allocates zero to the creditor, or if the case had no outstanding balance before this payment — both are signs of a misconfigured or duplicate payment and should be reviewed.

Currency: Payment must be in the same currency as the invoice. The currency is automatically determined from the case.

PaymentRecipient Options:

  • Creditor - Payment was received by the creditor (your client). When using this option, you MUST also specify CommissionPaymentStatus.
  • CollectionPartner - Payment was received by you (the collection partner). Commission is automatically marked as Paid since you already have the funds.

CommissionPaymentStatus: This field tracks whether the collection partner's commission has been paid. It's only required when PaymentRecipient is 'Creditor'.

  • Paid - The creditor has already paid your commission
  • Unpaid - The creditor has not yet paid your commission

Note: When PaymentRecipient is 'CollectionPartner', this field is automatically set to 'Paid' since you already have the money.

Critical Validation:

  • PayoutCreditor and PayoutCollectionPartner are optional but must be supplied together. When supplied, they MUST equal PaymentAmount (within 0.01 tolerance). When omitted (recommended), the split is computed from the case terms.
  • An explicit split that zeroes the creditor, or that is supplied on an already-settled (zero-remainder) case, is accepted but surfaced as a warning in the response — not blocked.
  • CommissionPaymentStatus is required only if PaymentRecipient is 'Creditor'

Payment Flow:

  1. Full Payment (payment >= outstanding):

    • If CloseCase=true → closes case with 'Paid' status
    • If CloseCase=false → case remains open
  2. Partial Payment (payment < outstanding):

    • The payment is recorded regardless of CloseCase. The case is NOT closed (CloseCase is honoured only when the payment fully settles the balance) and no error is returned.
    • To close on a partial payment, use the close endpoint with the PartiallyPaid close code.
post/cases/{id}/payments

Path parameters

idstring uuid required

Headers

Idempotency-Keystring

Optional idempotency key (max 255 characters) for safely retrying this request. If a previous request used the same key with an identical body, the original terminal response is replayed verbatim. Reusing the key with a different body returns 422 with Type: "IdempotencyConflict". Field-level 400 validation errors are not stored, so you may fix the request and retry with the same key.

Request body

datestring date-time required

Payment date (when payment was received). Provide date only without time component.

paymentAmountnumber 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.

payoutCreditornumber double nullable

Amount to be paid out to creditor. Optional — omit by default.

Normal usage is to leave this (and PayoutCollectionPartner) unset: the split is then computed server-side from the case's pricing terms (success fee), which is correct for almost every integration. Setting this is an advanced, opt-in override for legitimate edge cases (e.g. a negotiated split where the collection partner already holds funds) — most callers should never need it. When supplied, PayoutCollectionPartner must also be supplied and the two must sum to PaymentAmount. A zero value here (entire payment routed to the partner), or an explicit split supplied on a case that already has no outstanding balance, is accepted but surfaced as a warning in the response (CreatePaymentResponse.Warnings) rather than rejected — review these warnings, as they are signs of a misconfigured or duplicate payment.

payoutCollectionPartnernumber double nullable

Amount to be kept by collection partner (commission). Optional — omit by default.

Normal usage is to leave this (and PayoutCreditor) unset: the split is then computed server-side from the case's pricing terms (success fee), which is correct for almost every integration. Setting this is an advanced, opt-in override for legitimate edge cases (e.g. a negotiated split where the collection partner already holds funds) — most callers should never need it. When supplied, PayoutCreditor must also be supplied and the two must sum to PaymentAmount. See PayoutCreditor (above) for the soft-guard warnings this can trigger.

paymentRecipientstring required

Who received the payment.

Valid values:

  • Creditor: Payment was received by the creditor (client). When used, you must also specify CommissionPaymentStatus.
  • Platform: Payment was received by Debitura platform. Commission is automatically marked as paid.
  • CollectionPartner: Payment was received by the collection partner. Commission is automatically marked as paid.
commissionPaymentStatusstring nullable

Commission payment status. Required only if PaymentRecipient is Creditor.

When PaymentRecipient is CollectionPartner or Platform, this field is ignored and commission is automatically marked as Paid.

Valid values:

  • Paid: Commission has been paid to collection partner
  • Unpaid: Commission has not yet been paid to collection partner
closeCaseboolean
createUnpaidCommissionFollowUpboolean

Whether to run the unpaid-commission follow-up chain when this payment leaves the collection partner's commission Unpaid (PaymentRecipient = Creditor, CommissionPaymentStatus = Unpaid). The chain is: stamp the payout reminder date, email the partner, and create the UnpaidCommissionInvoiceClient follow-up task — which the reminder robot then drives.

Defaults to true, preserving the standard API / UI behaviour. Set to false to opt this source out of the entire chain (no stamp, email, task, reminders or escalation); the Payment and Payout are still created normally. Used by ingestion partners (e.g. ASTOP) that already report commission settlement out of band and must not trigger the chase.

Example request

{
  "date": "2026-07-31",
  "paymentAmount": 5000,
  "payoutCreditor": 4000,
  "payoutCollectionPartner": 1000,
  "paymentRecipient": "Creditor",
  "commissionPaymentStatus": "Paid",
  "closeCase": false
}

Response

Payment created successfully (or duplicate Idempotency-Key — the original response is replayed). Check the Warnings array for non-blocking advisory notices (e.g. about an explicit payout-split override).

paymentIdstring uuid
caseReferencestring nullable required
datestring date-time
paymentAmountnumber double
payoutCreditornumber double
payoutCollectionPartnernumber double
paymentRecipientstring nullable required
commissionPaymentStatusstring nullable required
closeCaseboolean
caseClosedboolean
closeCodestring nullable
remainingAmountnumber double
warningsstring[] nullable

Non-blocking warnings about this payment. Always present (empty when there is nothing to flag). Currently populated only when an explicit PayoutCreditor/PayoutCollectionPartner override was supplied and (a) it allocates zero to the creditor, or (b) the case already had no outstanding balance before this payment — both are signs of a misconfigured or duplicate payment. The payment is still recorded; these are advisory only, not errors. Review and resolve out of band if unexpected (e.g. via the case's Payments view in the Partner Portal, or by contacting Debitura support).