riverty logo

Docs

Create a Payment/Credit Waiver Cancellation

Clients can cancel a previously processed payment or credit waiver related to a specific claim using the "Create a Payment/Credit Waiver Cancellation" endpoint. Both actions are executed using the same endpoint, and there are no visible differences in the API request between canceling a payment or a credit waiver. However, clients must ensure they are providing the correct referenceNumber in the body of the request—whether it’s a paymentNumber for payments or a creditWaiverNumber for credit waivers.

Key Details

  • Payment Cancellation: When canceling a payment, the referenceNumber in the body of the request corresponds to the paymentNumber from the original payment transaction.
  • Credit Waiver Cancellation: When canceling a credit waiver, the referenceNumber refers to the creditWaiverNumber from the original credit waiver transaction.

Endpoint

POST {{collection_api_base_url}}/v1/claims/{claimNumber}/accountingDocuments/cancellations

Sample Request Body

{
    "referenceNumber": "string", // Payment number or Credit Waiver number
    "date": "2024-09-09",
    "amount": 0,
    "currency": "str"
}

Sample Response

{
  "requestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}

Confirmation of Cancellation

Once a payment or credit waiver cancellation is successfully processed, the client will receive a confirmation of type: "cancellation" as part of the transaction status, indicating that the cancellation was successful. This confirmation allows the client to verify that the cancellation request has been processed and reflected in the system.

Accounting Documents

While the request structure for both cancellations is identical, the key distinction lies in the accounting documents generated in the response when calling the transaction endpoint. These accounting documents provide essential records for the cancellation process.

  • Payment Cancellation: An accounting document of type: "cancellation" and originalType: "direct_payment", "agency_payment", "direct_debit", or "write_off" is created. The originalType reflects how the original payment was processed or whether it was written off.
  • Credit Waiver Cancellation: An accounting document of type: "cancellation" and originalType: "credit_waiver" is generated to reflect the canceled credit waiver.

Sample Confirmation and Accounting Document (Credit Waiver Cancellation)

{
    "sortNumber": 13,
    "id": "ef617da3-19d3-4fa6-aec7-0dda69ed2fec",
    "type": "CONFIRMATION",
    "claimNumber": "DE-S242243752002",
    "customerNumber": "K305219",
    "confirmation": {
        "date": "2024-08-23",
        "type": "CREDIT_WAIVER",
        "number": "10002",
        "contractNumber": "",
        "amount": 10.0,
        "currency": "EUR"
    }
},
...
    {
    "sortNumber": 29,
    "id": "9d7612bc-566f-499d-9672-e2a3997de05d",
    "type": "ACCOUNTING_DOCUMENT",
    "claimNumber": "DE-S242243752002",
    "customerNumber": "K305219",
    "accountingDocument": {
        "date": "2024-08-23",
        "type": "CREDIT_WAIVER",
        "originalType": null,
        "number": "V202400000120",
        "originalNumber": null,
        "amount": -10.0,
        "lineItems": [
            {
                "id": "B202411177713.3",
                "invoiceNumber": "BILL-305219_01",
                "contractNumber": "V305219",
                "amount": -10.0,
                "allocateTo": "PRINCIPAL_CLAIM"
            }
        ]
    }
}