> For the complete documentation index, see [llms.txt](https://docs.lhv.com/home/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lhv.com/home/connect/services/indirect-scheme-access/payment-collection-services/bacs-direct-debit/direct-debit-collection-notification-response-confirmation.md).

# 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](https://docs.lhv.com/home/connect/services/indirect-scheme-access/payment-collection-services/bacs-direct-debit/pages/W3y9bpzjfCNJh0plHe69#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.                                                                                            |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.lhv.com/home/connect/services/indirect-scheme-access/payment-collection-services/bacs-direct-debit/direct-debit-collection-notification-response-confirmation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
