Transfer refunds 
=================

#### API reference for refunding transfers 

For how-to guidance, see the [transfer refunds documentation](https://plaid.com/docs/transfer/refunds/index.html.md) .

| Refunds |  |
| --- | --- |
| [/transfer/refund/create](https://plaid.com/docs/api/products/transfer/refunds/index.html.md#transferrefundcreate) | Create a refund for a transfer |
| [/transfer/refund/cancel](https://plaid.com/docs/api/products/transfer/refunds/index.html.md#transferrefundcancel) | Cancel a refund |
| [/transfer/refund/get](https://plaid.com/docs/api/products/transfer/refunds/index.html.md#transferrefundget) | Retrieve information about a refund |

\=\*=\*=\*=

#### /transfer/refund/create 

#### Create a refund 

Use the [/transfer/refund/create](https://plaid.com/docs/api/products/transfer/refunds/index.html.md#transferrefundcreate) endpoint to create a refund for a transfer. A transfer can be refunded if the transfer was initiated in the past 180 days.

Refunds come out of the available balance of the ledger used for the original debit transfer. If there are not enough funds in the available balance to cover the refund amount, the refund will be rejected. You can create a refund at any time. Plaid does not impose any hold time on refunds.

A refund can still be issued even if the Item's `access_token` is no longer valid (e.g. if the user revoked OAuth consent or the Item was deleted via [/item/remove](https://plaid.com/docs/api/items/index.html.md#itemremove) ), as long as the account and routing number pair used to make the original transaction is still valid. A refund cannot be issued if the Item has an [invalidated TAN](https://plaid.com/docs/auth/index.html.md#tokenized-account-numbers) , which can occur at Chase or PNC.

#### Request fields 

string

Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body.

string

Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body.

required, string

The ID of the transfer to refund.

required, string

The amount of the refund (decimal string with two digits of precision e.g. "10.00").

required, string

A random key provided by the client, per unique refund. Maximum of 50 characters.

The API supports idempotency for safely retrying requests without accidentally performing the same operation twice. For example, if a request to create a refund fails due to a network connection error, you can retry the request with the same idempotency key to guarantee that only a single refund is created.

Max length: `50`

```node
const request: TransferRefundCreateRequest = {
  transfer_id: '460cbe92-2dcc-8eae-5ad6-b37d0ec90fd9',
  amount: '12.34',
  idempotency_key: 'VEK2ea3X6LKywsc8J6pg',
};

try {
  const response = await client.transferRefundCreate(request);
} catch (error) {
  // handle error
}

```

```bash
curl -X POST https://sandbox.plaid.com/transfer/refund/create \
 -H 'Content-Type: application/json' \
 -d '{
   "client_id": "${PLAID_CLIENT_ID}",
   "secret": "${PLAID_SECRET}",
   "transfer_id": "460cbe92-2dcc-8eae-5ad6-b37d0ec90fd9",
   "amount": "12.34",
   "idempotency_key": "VEK2ea3X6LKywsc8J6pg"
 }'

```

```ruby
request = Plaid::TransferRefundCreateRequest.new(
  {
    transfer_id: '460cbe92-2dcc-8eae-5ad6-b37d0ec90fd9',
    amount: '12.34',
    idempotency_key: 'VEK2ea3X6LKywsc8J6pg',
  }
)
response = client.transfer_refund_create(request)

```

```java
TransferRefundCreateRequest request = new TransferRefundCreateRequest()
  .transferId("460cbe92-2dcc-8eae-5ad6-b37d0ec90fd9")
  .amount("12.34")
  .idempotencyKey("VEK2ea3X6LKywsc8J6pg");

Response response = client()
  .transferRefundCreate(request)
  .execute();

```

```python
request = TransferRefundCreateRequest(
    transfer_id='460cbe92-2dcc-8eae-5ad6-b37d0ec90fd9',
    amount='12.34',
    idempotency_key='VEK2ea3X6LKywsc8J6pg',
)
response = client.transfer_refund_create(request)

```

```go
request := plaid.NewTransferRefundCreateRequest(
  "460cbe92-2dcc-8eae-5ad6-b37d0ec90fd9",
  "12.34",
  "VEK2ea3X6LKywsc8J6pg",
)

response, _, err := client.PlaidApi.TransferRefundCreate(ctx).TransferRefundCreateRequest(*request).Execute()

```

#### Response fields 

object

Represents a refund within the Transfers API.

string

Plaid's unique identifier for a refund.

string

The ID of the transfer to refund.

string

The amount of the refund (decimal string with two digits of precision e.g. "10.00").

string

The status of the refund.

`pending`: A new refund was created; it is in the pending state. `posted`: The refund has been successfully submitted to the payment network. `settled`: Credits have been refunded to the Plaid linked account. `cancelled`: The refund was cancelled by the client. `failed`: The refund has failed. `returned`: The refund was returned.

Possible values: `pending`, `posted`, `cancelled`, `failed`, `settled`, `returned`

nullable, object

The failure reason if the event type for a refund is `"failed"` or `"returned"`. Null value otherwise.

nullable, string

The failure code, e.g. `R01`. A failure code will be provided if and only if the refund status is `returned`. See [ACH return codes](https://plaid.com/docs/errors/transfer/index.html.md#ach-return-codes) for a full listing of ACH return codes and [RTP/RfP error codes](https://plaid.com/docs/errors/transfer/index.html.md#rtprfp-error-codes) for RTP error codes.

deprecated, nullable, string

The ACH return code, e.g. `R01`. A return code will be provided if and only if the refund status is `returned`. For a full listing of ACH return codes, see [Transfer errors](https://plaid.com/docs/errors/transfer/index.html.md#ach-return-codes) . This field is deprecated in favor of the more versatile `failure_code`, which encompasses non-ACH failure codes as well.

string

A human-readable description of the reason for the failure or reversal.

nullable, string

Plaid's unique identifier for a Plaid Ledger Balance.

string

The datetime when this refund was created. This will be of the form `2006-01-02T15:04:05Z`

Format: `date-time`

nullable, string

The trace identifier for the transfer based on its network. This will only be set after the transfer has posted.

For `ach` or `same-day-ach` transfers, this is the ACH trace number. For `rtp` transfers, this is the Transaction Identification number. For `wire` transfers, this is the IMAD (Input Message Accountability Data) number.

string

A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive.

Response Object

```json
{
  "refund": {
    "id": "667af684-9ee1-4f5f-862a-633ec4c545cc",
    "transfer_id": "460cbe92-2dcc-8eae-5ad6-b37d0ec90fd9",
    "amount": "12.34",
    "status": "pending",
    "created": "2020-08-06T17:27:15Z",
    "failure_reason": null,
    "network_trace_id": null
  },
  "request_id": "saKrIBuEB9qJZno"
}
```

\=\*=\*=\*=

#### /transfer/refund/cancel 

#### Cancel a refund 

Use the [/transfer/refund/cancel](https://plaid.com/docs/api/products/transfer/refunds/index.html.md#transferrefundcancel) endpoint to cancel a refund. A refund is eligible for cancellation if it has not yet been submitted to the payment network.

#### Request fields 

string

Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body.

string

Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body.

required, string

Plaid's unique identifier for a refund.

```node
const request: TransferRefundCancelRequest = {
  refund_id: '460cbe92-2dcc-8eae-5ad6-b37d0ec90fd9',
};

try {
  const response = await client.transferRefundCancel(request);
} catch (error) {
  // handle error
}

```

```bash
curl -X POST https://sandbox.plaid.com/transfer/refund/cancel \
 -H 'Content-Type: application/json' \
 -d '{
   "client_id": "${PLAID_CLIENT_ID}",
   "secret": "${PLAID_SECRET}",
   "refund_id": "460cbe92-2dcc-8eae-5ad6-b37d0ec90fd9"
 }'

```

```ruby
request = Plaid::TransferRefundCancelRequest.new(
  {
    refund_id: '460cbe92-2dcc-8eae-5ad6-b37d0ec90fd9',
  }
)
response = client.transfer_refund_cancel(request)

```

```java
TransferRefundCancelRequest request = new TransferRefundCancelRequest()
  .refundId("460cbe92-2dcc-8eae-5ad6-b37d0ec90fd9");

Response response = client()
  .transferRefundCancel(request)
  .execute();

```

```python
request = TransferRefundCancelRequest(
    refund_id='460cbe92-2dcc-8eae-5ad6-b37d0ec90fd9',
)
response = client.transfer_refund_cancel(request)

```

```go
request := plaid.NewTransferRefundCancelRequest(
  "460cbe92-2dcc-8eae-5ad6-b37d0ec90fd9",
)

response, _, err := client.PlaidApi.TransferRefundCancel(ctx).TransferRefundCancelRequest(*request).Execute()

```

#### Response fields 

string

A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive.

Response Object

```json
{
  "request_id": "saKrIBuEB9qJZno"
}
```

\=\*=\*=\*=

#### /transfer/refund/get 

#### Retrieve a refund 

The [/transfer/refund/get](https://plaid.com/docs/api/products/transfer/refunds/index.html.md#transferrefundget) endpoint fetches information about the refund corresponding to the given `refund_id`.

#### Request fields 

string

Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body.

string

Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body.

required, string

Plaid's unique identifier for a refund.

```node
const request: TransferRefundGetRequest = {
  refund_id: '460cbe92-2dcc-8eae-5ad6-b37d0ec90fd9',
};

try {
  const response = await client.transferRefundGet(request);
} catch (error) {
  // handle error
}

```

```bash
curl -X POST https://sandbox.plaid.com/transfer/refund/get \
 -H 'Content-Type: application/json' \
 -d '{
   "client_id": "${PLAID_CLIENT_ID}",
   "secret": "${PLAID_SECRET}",
   "refund_id": "460cbe92-2dcc-8eae-5ad6-b37d0ec90fd9"
 }'

```

```ruby
request = Plaid::TransferRefundGetRequest.new(
  {
    refund_id: '460cbe92-2dcc-8eae-5ad6-b37d0ec90fd9',
  }
)
response = client.transfer_refund_get(request)

```

```java
TransferRefundGetRequest request = new TransferRefundGetRequest()
  .refundId("460cbe92-2dcc-8eae-5ad6-b37d0ec90fd9");

Response response = client()
  .transferRefundGet(request)
  .execute();

```

```python
request = TransferRefundGetRequest(
    refund_id='460cbe92-2dcc-8eae-5ad6-b37d0ec90fd9',
)
response = client.transfer_refund_get(request)

```

```go
request := plaid.NewTransferRefundGetRequest(
  "460cbe92-2dcc-8eae-5ad6-b37d0ec90fd9",
)

response, _, err := client.PlaidApi.TransferRefundGet(ctx).TransferRefundGetRequest(*request).Execute()

```

#### Response fields 

object

Represents a refund within the Transfers API.

string

Plaid's unique identifier for a refund.

string

The ID of the transfer to refund.

string

The amount of the refund (decimal string with two digits of precision e.g. "10.00").

string

The status of the refund.

`pending`: A new refund was created; it is in the pending state. `posted`: The refund has been successfully submitted to the payment network. `settled`: Credits have been refunded to the Plaid linked account. `cancelled`: The refund was cancelled by the client. `failed`: The refund has failed. `returned`: The refund was returned.

Possible values: `pending`, `posted`, `cancelled`, `failed`, `settled`, `returned`

nullable, object

The failure reason if the event type for a refund is `"failed"` or `"returned"`. Null value otherwise.

nullable, string

The failure code, e.g. `R01`. A failure code will be provided if and only if the refund status is `returned`. See [ACH return codes](https://plaid.com/docs/errors/transfer/index.html.md#ach-return-codes) for a full listing of ACH return codes and [RTP/RfP error codes](https://plaid.com/docs/errors/transfer/index.html.md#rtprfp-error-codes) for RTP error codes.

deprecated, nullable, string

The ACH return code, e.g. `R01`. A return code will be provided if and only if the refund status is `returned`. For a full listing of ACH return codes, see [Transfer errors](https://plaid.com/docs/errors/transfer/index.html.md#ach-return-codes) . This field is deprecated in favor of the more versatile `failure_code`, which encompasses non-ACH failure codes as well.

string

A human-readable description of the reason for the failure or reversal.

nullable, string

Plaid's unique identifier for a Plaid Ledger Balance.

string

The datetime when this refund was created. This will be of the form `2006-01-02T15:04:05Z`

Format: `date-time`

nullable, string

The trace identifier for the transfer based on its network. This will only be set after the transfer has posted.

For `ach` or `same-day-ach` transfers, this is the ACH trace number. For `rtp` transfers, this is the Transaction Identification number. For `wire` transfers, this is the IMAD (Input Message Accountability Data) number.

string

A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive.

Response Object

```json
{
  "refund": {
    "id": "667af684-9ee1-4f5f-862a-633ec4c545cc",
    "transfer_id": "460cbe92-2dcc-8eae-5ad6-b37d0ec90fd9",
    "amount": "12.34",
    "status": "pending",
    "created": "2020-08-06T17:27:15Z",
    "failure_reason": null,
    "network_trace_id": null
  },
  "request_id": "saKrIBuEB9qJZno"
}
```