> ## Documentation Index
> Fetch the complete documentation index at: https://docs.finventi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Respond to Cancellation Requests

> Accept or reject incoming cancellation requests for SEPA payments.

# Handle Cancellation Requests from Other Banks

When an originating bank requests cancellation of a payment you received, you decide: accept and return the funds, or reject and keep them. Inventi handles the messaging — you make the business decision.

<Info>
  **What happens when a cancellation request arrives:**

  1. The originating bank sends a **camt.056** cancellation request
  2. Inventi notifies you via webhook with the request details
  3. You review and decide to accept or reject
  4. Inventi sends the response message automatically
</Info>

## API Reference

<CardGroup cols={2}>
  <Card title="Accept Cancellation" icon="check" href="/payments/api/sepa/cancellation-request-accept">
    Accept the request and return funds
  </Card>

  <Card title="Reject Cancellation" icon="xmark" href="/payments/api/sepa/cancellation-request-reject">
    Reject the request and keep funds
  </Card>

  <Card title="Cancellation Status Webhook" icon="bell" href="/payments/webhooks/payment-cancellation-status-change">
    Receive requests and track status
  </Card>

  <Card title="Get Cancellation Request" icon="magnifying-glass" href="/payments/api/accounts/get-cancellation-request">
    Retrieve cancellation details
  </Card>
</CardGroup>

## How It Works

<AccordionGroup>
  <Accordion title="When you receive a request" icon="inbox">
    A webhook arrives with status `CANCELLATION_IN_PROGRESS`. This indicates the originating bank is requesting cancellation of a payment you received.

    <Info>
      The cancellation request includes the original transaction reference and reason for the request.
    </Info>
  </Accordion>

  <Accordion title="Making your decision" icon="scale-balanced">
    Review the request and decide based on:

    * Whether funds have been credited to the beneficiary
    * Beneficiary's consent to return
    * Compliance or fraud flags

    <Warning>
      Once you accept, funds will be returned. This action cannot be undone.
    </Warning>
  </Accordion>

  <Accordion title="After you respond" icon="paper-plane">
    * **Accept**: Platform creates a return transaction and sends the return (pacs.004) to the originator
    * **Reject**: Platform sends a refusal message, funds remain with the beneficiary
  </Accordion>
</AccordionGroup>

```mermaid actions={true} theme={null}
sequenceDiagram
  autonumber
  participant Platform as Payments Platform
  participant Webhook as Your Webhook
  participant App as Your System
  participant DB as Your Database

  Platform-->>Webhook: Cancellation request received
  Webhook->>DB: Store request

  alt Accept
    App->>Platform: POST /v1/cancellation-requests/{id}:accept
    Platform-->>App: 200 OK
    Platform-->>Webhook: Returning funds
    Platform-->>Webhook: Payment returned
  else Reject
    App->>Platform: POST /v1/cancellation-requests/{id}:reject
    Platform-->>App: 200 OK
    Platform-->>Webhook: Cancellation refused
  end

  Webhook->>DB: Update final status
```

## Accept a Cancellation

When you accept, the platform creates a return transaction and sends a pacs.004 message.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.pgw-sandbox.finventi.com/v1/cancellation-requests/{id}:accept \
    -H "Authorization: Bearer {token}" \
    -H "Content-Type: application/json"
  ```
</CodeGroup>

The platform:

* Validates the cancellation request
* Creates a payment return transaction
* Sends the return message to the originating bank
* Updates the cancellation status via webhook

## Reject a Cancellation

When you reject, the platform sends a refusal message and funds remain with the beneficiary.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.pgw-sandbox.finventi.com/v1/cancellation-requests/{id}:reject \
    -H "Authorization: Bearer {token}" \
    -H "Content-Type: application/json" \
    -d '{
      "reason": "CUST",
      "additionalReason": "Beneficiary confirmed payment is valid"
    }'
  ```
</CodeGroup>

## Cancellation Statuses

<Tabs>
  <Tab title="Accept Flow">
    | Status                     | Description                      |
    | -------------------------- | -------------------------------- |
    | `CANCELLATION_IN_PROGRESS` | Awaiting your decision           |
    | `RETURNING`                | You accepted, return in progress |
    | `PAYMENT_RETURNED`         | Funds returned - final status    |
  </Tab>

  <Tab title="Reject Flow">
    | Status                     | Description                       |
    | -------------------------- | --------------------------------- |
    | `CANCELLATION_IN_PROGRESS` | Awaiting your decision            |
    | `REFUSING`                 | You rejected, refusal in progress |
    | `CANCELLATION_REFUSED`     | Refusal sent - final status       |
  </Tab>
</Tabs>

## Decision Criteria

<CardGroup cols={3}>
  <Card title="Accept When" icon="circle-check">
    * Funds not yet used
    * Beneficiary agrees
    * Fraud suspected
    * Compliance flags
  </Card>

  <Card title="Reject When" icon="circle-xmark">
    * Funds already withdrawn
    * Beneficiary disputes
    * Valid payment confirmed
    * No grounds for return
  </Card>

  <Card title="Consider" icon="scale-balanced">
    * Transaction amount
    * Time since receipt
    * Customer relationship
    * Regulatory requirements
  </Card>
</CardGroup>

## Data Model

<ResponseField name="cancellationId" type="string" required>
  Request identifier from webhook
</ResponseField>

<ResponseField name="trx_id" type="string">
  Related transaction (if provided)
</ResponseField>

<ResponseField name="decision" type="string" required>
  Your accept/reject decision with reason
</ResponseField>

<ResponseField name="status_history" type="array" required>
  Full lifecycle for audit
</ResponseField>

## Integration Checklist

<Steps>
  <Step title="Monitor cancellation webhooks">
    Watch for `CANCELLATION_IN_PROGRESS` status to identify pending requests
  </Step>

  <Step title="Implement decision logic">
    Build rules to accept or reject based on your business requirements
  </Step>

  <Step title="Secure the endpoints">
    Protect accept/reject actions with proper authorization
  </Step>

  <Step title="Track final status via webhooks">
    Use webhook statuses as the source of truth, not just the API response
  </Step>
</Steps>

## What's Next?

You now understand how to handle incoming cancellation requests. Complete your exception handling with returns and reconciliation:

<CardGroup cols={2}>
  <Card title="Cancel Outbound Payments" icon="ban" href="/payments/integration-guide/outbound-cancellation">
    Request cancellation of your outgoing payments
  </Card>

  <Card title="Return Inbound Payments" icon="rotate-left" href="/payments/integration-guide/as">
    Return funds when you can't credit the beneficiary
  </Card>

  <Card title="Track and Reconcile" icon="chart-line" href="/payments/integration-guide/payment-information">
    Monitor transactions and reconcile with statements
  </Card>
</CardGroup>
