# Creditor

Source: https://docs.gocardless.com/docs/api-reference/creditor

## Create a creditor

`POST /creditors`

Creates a new creditor.

### Request body

Wrap request body attributes in a `creditors` object.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | No | The creditor's trading name. |
| `country_code` | string | No | [ISO 3166-1 alpha-2 code.](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) |
| `creditor_type` | string | No | The type of business of the creditor. Currently, `individual`, `company`, `charity`, `partnership`, and `trust` are supported. |
| `bank_reference_prefix` | string | No | Prefix for the bank reference of payouts sent to this creditor. For instance, if the creditor's `bank_reference_prefix` was `ACME`, the bank reference of a payout sent to that creditor could be `ACME-8G7Q8`.  This prefix is also used for refunds in EUR and GBP. |
| `links` | object | No |  |

### Responses

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

---

## List creditors

`GET /creditors`

Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your creditors.

### Responses

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

---

## Get a single creditor

`GET /creditors/{creditor_id}`

Retrieves the details of an existing creditor.

### Parameters

| Name | Location | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `creditor_id` | path | string | Yes | The creditor id |

### Responses

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

---

## Update a creditor

`PUT /creditors/{creditor_id}`

Updates a creditor object. Supports all of the fields supported when creating a creditor.

### Parameters

| Name | Location | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `creditor_id` | path | string | Yes | The creditor id |

### Request body

Wrap request body attributes in a `creditors` object.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | No | The creditor's trading name. |
| `address_line1` | string | No | The first line of the creditor's address. |
| `address_line2` | string | No | The second line of the creditor's address. |
| `address_line3` | string | No | The third line of the creditor's address. |
| `city` | string | No | The city of the creditor's address. |
| `region` | string | No | The creditor's address region, county or department. |
| `postal_code` | string | No | The creditor's postal code. |
| `country_code` | string | No | [ISO 3166-1 alpha-2 code.](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) |
| `bank_reference_prefix` | string | No | Prefix for the bank reference of payouts sent to this creditor. For instance, if the creditor's `bank_reference_prefix` was `ACME`, the bank reference of a payout sent to that creditor could be `ACME-8G7Q8`.  This prefix is also used for refunds in EUR and GBP. |
| `links` | object | No |  |

### Responses

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