# Mandate Import

Source: https://docs.gocardless.com/docs/api-reference/mandate-import

## Create a new mandate import

`POST /mandate_imports`

Mandate imports are first created, before mandates are added one-at-a-time, so
this endpoint merely signals the start of the import process. Once you've finished
adding entries to an import, you should
[submit](#mandate-imports-submit-a-mandate-import) it.

### Request body

Wrap request body attributes in a `mandate_imports` object.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `scheme` | string | No | A bank payment scheme. Currently "ach", "autogiro", "bacs", "becs", "becs_nz", "betalingsservice", "faster_payments", "pad", "pay_to" and "sepa_core" are supported. |
| `links` | object | No | Related resources |

### Responses

| Status | Description |
| --- | --- |
| 201 | Resource created successfully |
| 400 | Bad Request |
| 401 | Unauthorised |
| 404 | Not found |
| 422 | Validation Error |
| 500 | Internal Error |

---

## Get a mandate import

`GET /mandate_imports/{mandate_import_id}`

Returns a single mandate import.

### Parameters

| Name | Location | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `mandate_import_id` | path | string | Yes | The mandate import id |

### Responses

| Status | Description |
| --- | --- |
| 200 | Successful response |
| 400 | Bad Request |
| 401 | Unauthorised |
| 404 | Not found |
| 422 | Validation Error |
| 500 | Internal Error |

---

## Submit a mandate import

`POST /mandate_imports/{mandate_import_id}/actions/submit`

Submits the mandate import, which allows it to be processed by a member of the
GoCardless team. Once the import has been submitted, it can no longer have entries
added to it.

In our sandbox environment, to aid development, we automatically process mandate
imports approximately 10 seconds after they are submitted. This will allow you to
test both the "submitted" response and wait for the webhook to confirm the
processing has begun.

### Parameters

| Name | Location | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `mandate_import_id` | path | string | Yes | The mandate import id |

### Responses

| Status | Description |
| --- | --- |
| 200 | Action completed successfully |
| 400 | Bad Request |
| 401 | Unauthorised |
| 404 | Not found |
| 422 | Validation Error |
| 500 | Internal Error |

---

## Cancel a mandate import

`POST /mandate_imports/{mandate_import_id}/actions/cancel`

Cancels the mandate import, which aborts the import process and stops the mandates
being set up in GoCardless. Once the import has been cancelled, it can no longer have
entries added to it. Mandate imports which have already been submitted or processed
cannot be cancelled.

### Parameters

| Name | Location | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `mandate_import_id` | path | string | Yes | The mandate import id |

### Responses

| Status | Description |
| --- | --- |
| 200 | Action completed successfully |
| 400 | Bad Request |
| 401 | Unauthorised |
| 404 | Not found |
| 422 | Validation Error |
| 500 | Internal Error |
