# Create a Refund

You can use this call to create a refund for a payment made with an in3 transaction.

## Request

```text
POST https://api.pay.cm.com/api/v1/paymentmethods/in3/v1/transactions/{transactionId}/refunds
```

```json
{
  "amount": 1200,
  "reason": "Refund required by customer."
}
```

## Parameters

| Parameter | Type              | Description                                                                    | Constraints                                                     |
| :-------- | :---------------- | :----------------------------------------------------------------------------- | :-------------------------------------------------------------- |
| amount    | Int(1...99999999) | Refund amount. Denomination in the smallest currency subunit (e.g. eurocents). | Must be lower than or equal to the original transaction amount. |
| reason    | String(255)       | The description for the refund.                                                |                                                                 |

## Response

```json
{
  "id": "637ad600-dc6e-4b21-b563-f6584a14978a",
  "transactionId": "e2421986-7f3c-497f-bf3e-483498f7cfd0",
  "amount": 6000,
  "reason": "Refund required by customer.",
  "created": "2024-11-11T16:42:02Z",
  "updated": "2024-11-11T16:42:02Z"
}
```

## Parameters

| Parameter     | Type              | Description                                                                    | Constraints               |
| :------------ | :---------------- | :----------------------------------------------------------------------------- | :------------------------ |
| id            | String(36)        | Refund unique identifier.                                                      |                           |
| transactionId | String(36)        | Unique identifier of the transaction related to this refund.                   |                           |
| amount        | Int(1...99999999) | Refund amount. Denomination in the smallest currency subunit (e.g. eurocents). | Specified in the request. |
| reason        | String(255)       | The description for the refund.                                                | Specified in the request. |
| created       | String(RFC3339)   | Creation time.                                                                 | ISO 8601 date and time.   |
| updated       | String(RFC3339)   | Updated time.                                                                  | ISO 8601 date and time.   |

## Response codes

| HTTP status | Description                                                                                                                                                                                                                                      |
| :---------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 201         | Refund successfully created.                                                                                                                                                                                                                     |
| 4XX         | Client error response (See message for details). This response is given when the User input was incorrect or something illegal was attempted (eg. using a service without having that service configured for the user, or not being authorized). |
| 5XX         | Server error response (See message for details).                                                                                                                                                                                                 |