---
description: >-
  Direct Debit Collection Notification Confirmation message is sent to client to
  confirm or reject Direct Debit Collection Notification Response message.
---

# Direct Debit Collection Notification Response Confirmation

Direct Debit Collection Notification Confirmation can be requested via the [Messages service](https://docs.lhv.com/home/connect/services/messages).

{% hint style="info" %}
HTTP Header Message-Response-Type: DIRECT\_DEBIT\_COLLECTION\_CONFIRMATION
{% endhint %}

See the Examples section for a [confirmation message](../samples#example-of-the-confirmation-to-direct-debit-collection-notification-response-pain.002).

## Message structure

For this message, JSON format is used.

<table><thead><tr><th>Name</th><th>Value</th><th>Description</th><th data-hidden></th></tr></thead><tbody><tr><td>GrpHdr.MsgId</td><td></td><td><strong>Mandatory</strong>. Related pain.002 message id. (GrpHdr.MsgId from pain.002)</td><td></td></tr><tr><td>OrgnlGrpInfAndSts.OrgnlMsgId</td><td></td><td><strong>Mandatory.</strong> Original pain.008 message id. (GrpHdr.MsgId from pain.008)</td><td></td></tr><tr><td>AcceptanceStatus</td><td><p><code>OK</code> - All acceptances are processed successfully</p><p><code>PARTIAL</code> - Some of the acceptances failed to process </p><p><code>FAILED</code> - The file was failed to process</p></td><td><strong>Mandatory.</strong> pain.002 fail processing status.</td><td></td></tr><tr><td>Messages.OrgnlPmtInfId</td><td></td><td><strong>Mandatory.</strong> Original payment id. (PmtInf.PmtInfId from pain.008)</td><td></td></tr><tr><td>Messages.Confirmed</td><td><p><code>true</code> - response is confirmed        </p><p><code>false</code> - response is not confirmed</p></td><td><strong>Mandatory.</strong> Direct Debit response status: If the value is true, the Direct Debit response was processed successfully. If the value is false, an error occurred and the ErrorInfo section is presented with error details.</td><td></td></tr><tr><td>Messages.ErrorInfo.ErrorCode</td><td>List of error codes can be found here</td><td><strong>Optional.</strong> Only presented when Message.confirmed is <code>false</code>.</td><td></td></tr><tr><td>Messages.ErrorInfo.ErrorDescription</td><td>List of error code descriptions can be found here</td><td><strong>Optional.</strong> Only presented when Message.confirmed is <code>false</code>.</td><td></td></tr></tbody></table>

{% tabs %}
{% tab title="OK" %}
{% hint style="success" %}
All Direct Debit responses in pain.002 have been processed successfully.
{% endhint %}

```json
{
  "GrpHdr.MsgId": "pain002_message_id",
  "OrgnlGrpInfAndSts.OrgnlMsgId": "message_id_pain008",
  "AcceptanceStatus": "OK",
  "Messages": [
    {
      "OrgnlPmtInfId": "paymentId_1",
      "Confirmed": true
    },
    {
      "OrgnlPmtInfId": "paymentId_2",
      "Confirmed": true
      }
    }
  ]
}
```
{% endtab %}

{% tab title="PARTIAL" %}
{% hint style="warning" %}
Some Direct Debit responses in pain.002 have failed to process.
{% endhint %}

```json
{
  "GrpHdr.MsgId": "pain002_message_id",
  "OrgnlGrpInfAndSts.OrgnlMsgId": "message_id_pain008",
  "AcceptanceStatus": "PARTIAL",
  "Messages": [
    {
      "OrgnlPmtInfId": "paymentId_1",
      "Confirmed": true
    },
    {
      "OrgnlPmtInfId": "paymentId_2",
      "Confirmed": false,
      "ErrorInfo": {
        "ErrorCode": "DIRECT_DEBIT_NOT_FOUND",
        "ErrorDescription": "Direct Debit not found"
      }
    }
  ]
}
```
{% endtab %}

{% tab title="FAILED" %}
{% hint style="danger" %}
Pain.002 has failed to process.
{% endhint %}

```json
{
  "GrpHdr.MsgId": "pain002_message_id",
  "OrgnlGrpInfAndSts.OrgnlMsgId": "message_id_pain008",
  "AcceptanceStatus": "FAILED",
  "Messages": [
    {
      "OrgnlPmtInfId": "paymentId_2",
      "Confirmed": false,
      "ErrorInfo": {
        "ErrorCode": "DIRECT_DEBIT_FILE_INVALID",
        "ErrorDescription": "Payment doesn’t exists in corresponding pain.008 file"
      }
    }
  ]
}
```
{% endtab %}
{% endtabs %}

### Error codes

| Error Code                         | Error Description                                                       | Comment                                                                                                                                                                             |
| ---------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| DIRECT\_DEBIT\_NOT\_FOUND          | Direct Debit not found                                                  | Direct Debit payment is not found.                                                                                                                                                  |
| DIRECT\_DEBIT\_INVALID\_STATUS     | Direct Debit is expected to be in status RECEIVED, but is in status ... | A Direct Debit can be confirmed or rejected only when it is in received status. If the Direct Debit is already confirmed, returned, etc., it can no longer be accepted or rejected. |
| DUPLICATE\_PAYMENT\_ID             | Duplicate payment in file                                               | There is duplicate payment id on pain.002 file.                                                                                                                                     |
| DIRECT\_DEBIT\_RESPONSE\_PROCESSED | Direct Debit response already processed                                 | Direct Debit response is already received and processed.                                                                                                                            |
| DIRECT\_DEBIT\_FILE\_NOT\_FOUND    | pain.008 message file not found                                         | Original Direct Debit Notification does not exist. The pain.008 id may be invalid in pain.002 message (OrgnlGrpInfAndSts.OrgnlMsgId)                                                |
| NO\_RIGHTS\_TO\_DEBTOR\_ACCOUNT    | User have no rights to debtor account                                   | User have no rights to debtor account.                                                                                                                                              |
| DIRECT\_DEBIT\_FILE\_INVALID       | Payment doesn’t exist in corresponding pain.008 file                    | Payment doesn't exist in corresponding pain.008 file. The payment id may be invalid in pain.002 message (OrgnlPmtInfAndSts.OrgnlPmtInfId)                                           |
| INVALID\_REASON\_CODE              | Provided reason code is invalid                                         | Acceptance data in pain.002 is invalid. Status and reason code must be filled correctly.                                                                                            |
