---
title: "Create a Refund for a PayIn"
method: POST
path: "/v2.01/{ClientId}/payins/{PayInId}/refunds"
tags: ["Refunds"]
---

# Create a Refund for a PayIn

`POST /v2.01/{ClientId}/payins/{PayInId}/refunds`

The pay-in refund is a request to reimburse a pay-in and is supported for most payment methods. You can make partial refunds by providing a debited funds `Amount` value lower than the initial transaction amount.

<Note icon="fa-regular fa-circle-info">
  **Note – Conditions for pay-in refund**

  * The amount value is 1 or above, regardless of the currency.
  * The initial transaction status is `SUCCEEDED`.
  * The initial transaction hasn't been disputed.
  * The initial transaction was made within the time window specified for the [payment method](/guides/payment-methods).
</Note>

[Read more about pay-in refunds](/guides/refunds#pay-in-refunds) **&rarr;**

## Path parameters

- `ClientId` string, required
- `PayInId` string, required

## Headers

- `Authorization` string, required

## Request body

- CreateARefundForAPayInRequest
  - `Tag` string — Max. length: 255 characters Custom data that you can add to this object.
  - `AuthorId` string, required — The unique identifier of the user at the source of the initial transaction.
  - `DebitedFunds` CreateARefundForAPayInRequestDebitedFunds — **Default value:** The amount and currency values of the `DebitedFunds` of the initial transaction. Required if the `Fees` property is sent. Information about the debited funds. The refund `DebitedFunds.Amount`: - Takes by default the amount and currency of the initial transaction. - Must be set manually to perform a partial refund. - Cannot exceed the initial transaction `CreditedFunds.Amount` when set manually. This also applies to the sum of debited funds when making multiple partial refunds.
    - `Currency` string, required — **Allowed values:** The three-letter <a href="/api-reference/overview/data-formats" target="_blank">ISO 4217 code</a> (EUR, GBP, etc.) of a <a href="/guides/currencies" target="_blank">supported currency</a> (depends on feature, contract, and activation settings). The currency of the amount.
    - `Amount` integer, required — The amount of the currency in its minor unit. For example, EUR 12.60 would be represented as `1260` whereas JPY 12 would be represented as just `12`.
  - `Fees` CreateARefundForAPayInRequestFees — **Default value:** The currency and amount (preceded by a minus sign) of the `Fees` of the initial transaction. Required if the `DebitedFunds` property is sent. Information about the fees. The refund `Fees.Amount`: - Must be preceded by a minus sign (-) to refund the fees, otherwise a positive value takes more fees. - Takes by default (when not set) the `Fees.Amount` of the initial transaction (preceded by a minus sign). - Cannot exceed the initial transaction `Fees.Amount`. This alsoapplies to the sum of amounts when making multiple partial refunds.
    - `Currency` string, required — **Allowed values:** The three-letter <a href="/api-reference/overview/data-formats" target="_blank">ISO 4217 code</a> (EUR, GBP, etc.) of a <a href="/guides/currencies" target="_blank">supported currency</a> (depends on feature, contract, and activation settings). The currency of the amount.
    - `Amount` integer, required — The amount of the currency in its minor unit. For example, EUR 12.60 would be represented as `1260` whereas JPY 12 would be represented as just `12`.
  - `StatementDescriptor` string — Max. length: 10 characters; only alphanumeric and spaces Custom description to appear on the user’s bank statement along with the platform name. On refunds, the `StatementDescriptor` is only available when refunding SEPA and BACS [direct debit pay-ins](/api-reference/direct-debit-payins/create-direct-debit-payin) (no other payment methods nor transfers). Different banks may show more or less information. See the <a href="/bank-statements">Customizing bank statement references</a> article for details.

## Response `200`

Success

- PayInRefundResponse
  - `Id` string — Max length: 128 characters (see [data formats](/api-reference/overview/data-formats) for details) The unique identifier of the object.
  - `Tag` string — Max. length: 255 characters Custom data that you can add to this object.
  - `CreationDate` integer — Unix timestamp (UTC) of the date and time the object was created.
  - `AuthorId` string — The unique identifier of the user at the source of the initial transaction.
  - `CreditedUserId` string — **Default value:** The unique identifier of the owner of the credited wallet. The unique identifier of the user whose wallet is credited.
  - `DebitedFunds` PayInRefundResponseDebitedFunds — **Default value:** The amount and currency values of the `DebitedFunds` of the initial transaction. Required if the `Fees` property is sent. Information about the debited funds. The refund `DebitedFunds.Amount`: - Takes by default the amount and currency of the initial transaction. - Must be set manually to perform a partial refund. - Cannot exceed the initial transaction `CreditedFunds.Amount` when set manually. This also applies to the sum of debited funds when making multiple partial refunds.
    - `Currency` string — **Allowed values:** The three-letter <a href="/api-reference/overview/data-formats" target="_blank">ISO 4217 code</a> (EUR, GBP, etc.) of a <a href="/guides/currencies" target="_blank">supported currency</a> (depends on feature, contract, and activation settings). The currency of the amount.
    - `Amount` integer — The amount of the currency in its minor unit. For example, EUR 12.60 would be represented as `1260` whereas JPY 12 would be represented as just `12`.
  - `CreditedFunds` PayInRefundResponseCreditedFunds — Information about the credited funds (`CreditedFunds` = `DebitedFunds` - `Fees`).
    - `Currency` string — **Allowed values:** The three-letter <a href="/api-reference/overview/data-formats" target="_blank">ISO 4217 code</a> (EUR, GBP, etc.) of a <a href="/guides/currencies" target="_blank">supported currency</a> (depends on feature, contract, and activation settings). The currency of the amount.
    - `Amount` integer — The amount of the currency in its minor unit. For example, EUR 12.60 would be represented as `1260` whereas JPY 12 would be represented as just `12`.
  - `Fees` PayInRefundResponseFees — **Default value:** The currency and amount (preceded by a minus sign) of the `Fees` of the initial transaction. Required if the `DebitedFunds` property is sent. Information about the fees. The refund `Fees.Amount`: - Must be preceded by a minus sign (-) to refund the fees, otherwise a positive value takes more fees. - Takes by default (when not set) the `Fees.Amount` of the initial transaction (preceded by a minus sign). - Cannot exceed the initial transaction `Fees.Amount`. This alsoapplies to the sum of amounts when making multiple partial refunds.
    - `Currency` string — **Allowed values:** The three-letter <a href="/api-reference/overview/data-formats" target="_blank">ISO 4217 code</a> (EUR, GBP, etc.) of a <a href="/guides/currencies" target="_blank">supported currency</a> (depends on feature, contract, and activation settings). The currency of the amount.
    - `Amount` integer — The amount of the currency in its minor unit. For example, EUR 12.60 would be represented as `1260` whereas JPY 12 would be represented as just `12`.
  - `Status` string — **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction.
  - `ResultCode` string — The code indicating the result of the operation. This information is mostly used to <a href="/errors/codes">handle errors</a> or for filtering purposes.
  - `ResultMessage` string — The explanation of the result code.
  - `ExecutionDate` integer — Unix timestamp (UTC) of the date and time the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`.
  - `Type` string — **Returned values:** `PAYIN`, `TRANSFER`, `CONVERSION`, `PAYOUT` The type of the transaction.
  - `Nature` string — **Returned values:** `REGULAR`, `REPUDIATION`, `REFUND`, `SETTLEMENT` The nature of the transaction, providing more information about the context in which the transaction occurred: - `REGULAR` – Relative to most of the transactions (pay-ins, payouts, and transfers) in a usual workflow. - `REPUDIATION` – Automatic withdrawal of funds from the platform’s repudiation wallet as part of the dispute process (when the user has requested a chargeback). - `REFUND` – Reimbursement of a transaction to the user (pay-in refund), to a wallet (transfer refund), or of a payout (payout refund, only initiated by Mangopay). - `SETTLEMENT` – Transfer made to the repudiation wallet by the platform to settle a lost dispute.
  - `InitialTransactionId` string — The unique identifier of the initial transaction being refunded.
  - `InitialTransactionType` string — **Returned values:** `PAYIN`, `TRANSFER`, `PAYOUT` The type of the initial transaction being refunded.
  - `InitialTransactionNature` string — **Returned values:** `REGULAR`, `REPUDIATION`, `REFUND`, `SETTLEMENT` The nature of the initial transaction being refunded, providing more information about the context in which the transaction occurred: - REGULAR – Relative to most of the transactions (pay-ins, payouts, and transfers) in a usual workflow. - REPUDIATION – Automatic withdrawal of funds from the platform’s repudiation wallet as part of the dispute process (when the user requested a chargeback). - REFUND – Reimbursement of a transaction to the user (pay-in refund), to a wallet (transfer refund), or of a payout (payout refund, only initiated by Mangopay). - SETTLEMENT – Transfer made to the repudiation wallet by the platform to settle the credit from a repudiation following a lost dispute.
  - `DebitedWalletId` string — The unique identifier of the debited wallet.
  - `CreditedWalletId` string — The unique identifier of the credited wallet.
  - `RefundReason` PayInRefundResponseRefundReason — Information about the reasons for the refund.
    - `RefundReasonMessage` string — Message explaining the reason for the refusal.
    - `RefundReasonType` string — **Returned values:** `INITIALIZED_BY_CLIENT`, `BANKACCOUNT_INCORRECT`, `OWNER_DO_NOT_MATCH_BANKACCOUNT`, `BANKACCOUNT_HAS_BEEN_CLOSED`, `WITHDRAWAL_IMPOSSIBLE_ON_SAVINGS_ACCOUNTS`, `OTHER` The type of reason for the refund.
  - `StatementDescriptor` string — Max. length: 10 characters; only alphanumeric and spaces Custom description to appear on the user’s bank statement along with the platform name. On refunds, the `StatementDescriptor` is only available when refunding SEPA and BACS [direct debit pay-ins](/api-reference/direct-debit-payins/create-direct-debit-payin) (no other payment methods nor transfers). Different banks may show more or less information. See the <a href="/bank-statements">Customizing bank statement references</a> article for details.

## Other responses

- `400` — Bad Request

---

[API](https://skmtc.net/mangopay/apis/api-reference.md) · [All operations](https://skmtc.net/mangopay/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mangopay/api-reference/versions/795281070285/schema)
