> 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/bacs-direct-debit-mandate-initiation-response-confirmation.md).

# Bacs Direct Debit Mandate Initiation Response Confirmation

Mandate Initiation Response 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\_MANDATE\_CONFIRM
{% 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-mandate-initiation-response-pain.012).

## 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.012 message id. (GrpHdr.MsgId from pain.012)</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.012 fail processing status.</td><td></td></tr><tr><td>Messages.OrgnlMsgInf.MsgId</td><td></td><td><strong>Mandatory.</strong> Original pain.009 message id. (GrpHdr.MsgId from pain.009)</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> Mandate response status: If the value is true, the mandate 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 <a href="#error-codes">here</a></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 <a href="#error-codes">here</a></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 mandate responses in pain.012 have been processed successfully.
{% endhint %}

```json
{
  "GrpHdr.MsgId": "pain012_message_id",
  "AcceptanceStatus": "OK",
  "Messages": [
    {
      "OrgnlMsgInf.MsgId": "message_id_pain009",
      "Confirmed": true
    },
    {
      "OrgnlMsgInf.MsgId": "message_id_pain009_2",
      "Confirmed": true
    }
  ]
}
```

{% endtab %}

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

```json
{
  "GrpHdr.MsgId": "pain012_message_id",
  "AcceptanceStatus": "PARTIAL",
  "Messages": [
    {
      "OrgnlMsgInf.MsgId": "message_id_pain009",
      "Confirmed": true
    },
    {
      "OrgnlMsgInf.MsgId": "invalid_message_id",
      "Confirmed": false,
      "ErrorInfo": {
        "ErrorCode": "NOT_FOUND",
        "ErrorDescription": "Mandate not found"
      }
    }
  ]
}
```

{% endtab %}

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

```
{
  "GrpHdr.MsgId": "pain012_message_id",
  "AcceptanceStatus": "FAILED",
  "Messages": [
    {
      "OrgnlMsgInf.MsgId": "pain009_message_id",
      "Confirmed": false,
      "ErrorInfo": {
        "ErrorCode": "INVALID_ACCEPTANCE_DATA",
        "ErrorDescription": "Invalid acceptance data"
      }
    }
  ]
}
```

{% endtab %}
{% endtabs %}

### Error codes

| Error Code                      | Error Description                                                 | Comment                                                                                                                                                                             |
| ------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| MANDATE\_NOT\_FOUND             | Mandate not found                                                 | Mandate does not exist. The pain.009 id may be invalid in pain.012 message (UndrlygAccptncDtls.OrgnlMsgInf.MsgId)                                                                   |
| MANDATE\_INVALID\_STATUS        | Mandate is expected to be in status PENDING, but is in status ... | A mandate can be confirmed or rejected only when it is in pending status. If the mandate is already confirmed, returned, activated, etc., it can no longer be accepted or rejected. |
| DUPLICATE\_MESSAGE\_ID          | Duplicate message in file                                         | There is duplicate pain.009 message id on pain.012 file.                                                                                                                            |
| MANDATE\_FILE\_NOT\_FOUND       | pain.009 message file not found                                   | Original Mandate Initiation Request does not exist. The pain.009 id may be invalid in pain.012 message (UndrlygAccptncDtls.OrgnlMsgInf.MsgId)                                       |
| NO\_RIGHTS\_TO\_DEBTOR\_ACCOUNT | User have no rights to debtor account                             | User have no rights to debtor account.                                                                                                                                              |
| INVALID\_ACCEPTANCE\_DATA       | Invalid acceptance data                                           | Acceptance data in pain.012 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/bacs-direct-debit-mandate-initiation-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.
