# /paymentmethods/idealqr/v1/transactions/{transactionId}/payments/{paymentId}/refunds

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Payments Gateway",
    "description": "Common payments API",
    "version": "1.23.0"
  },
  "security": [
    {
      "oAuth2ClientCredentials": []
    }
  ],
  "servers": [
    {
      "url": "/api/v1/"
    }
  ],
  "paths": {
    "/paymentmethods/idealqr/v1/transactions/{transactionId}/payments/{paymentId}/refunds": {
      "post": {
        "tags": [
          "idealqr"
        ],
        "operationId": "createIdealQRTransactionRefund",
        "parameters": [
          {
            "name": "transactionId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "paymentId",
            "in": "path",
            "required": true,
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Uuid"
                },
                {
                  "example": "db82a0d1-ae23-4412-86ad-6af913f81270"
                }
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Refund"
              }
            }
          }
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/IdealqrPayment"
          },
          "4XX": {
            "$ref": "#/components/responses/UserError"
          },
          "5XX": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Uuid": {
        "description": "Unique identifier",
        "type": "string",
        "format": "uuid",
        "minLength": 36,
        "maxLength": 36,
        "example": "8db1e7fa-ba8a-4189-92fd-67a20217443d"
      },
      "Datetime": {
        "description": "ISO 8601 date and time",
        "type": "string",
        "format": "date-time",
        "minLength": 20,
        "example": "2006-01-02T15:04:05Z"
      },
      "Amount": {
        "description": "Denomination in the smallest currency subunit, as for example eurocents.",
        "type": "integer",
        "minimum": 1,
        "maximum": 99999999,
        "example": 1200
      },
      "BIC": {
        "description": "Bank Identification Code",
        "type": "string",
        "minLength": 8,
        "maxLength": 11,
        "example": "RABONL2U"
      },
      "Refunds": {
        "description": "Details of refunds for a transaction",
        "type": "object",
        "required": [
          "refundedAmount",
          "refundedPendingAmount"
        ],
        "properties": {
          "refundedAmount": {
            "description": "Amount in the smallest currency subunit, as for example eurocents, that has already been refunded.",
            "type": "integer",
            "minimum": 0,
            "maximum": 99999999,
            "example": 300
          },
          "refundedPendingAmount": {
            "description": "Amount in the smallest currency subunit, as for example eurocents, that has been requested to be refunded.",
            "type": "integer",
            "minimum": 1,
            "maximum": 99999999,
            "example": 100
          }
        }
      },
      "IdealqrPayment": {
        "type": "object",
        "required": [
          "payment",
          "transaction",
          "idealTransactionId",
          "status",
          "createdAt"
        ],
        "properties": {
          "payment": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "example": "433a3406-3460-4795-b7ed-b5b9ad1aa9bf"
              }
            ]
          },
          "transaction": {
            "$ref": "#/components/schemas/Uuid"
          },
          "idealTransactionId": {
            "description": "The 16-digit transaction ID within the iDEAL scheme as known by the acquirer and issuing bank, and \nused in the credit transfer. The value can have leading zeros.\nThis value is `null` if the status `FAILURE`.",
            "type": "string",
            "nullable": true,
            "minLength": 16,
            "maxLength": 16,
            "example": 1234567890123456
          },
          "status": {
            "description": "* `SUCCESS`   - Payment has succeeded.\n* `CANCELLED` - Payment has not succeeded; cancelled by the consumer.\n* `EXPIRED`   - Payment has not succeeded; expired.\n* `FAILURE`   - Payment has not succeeded; unknown reason.\n",
            "type": "string",
            "enum": [
              "SUCCESS",
              "FAILURE",
              "CANCELLED",
              "EXPIRED"
            ]
          },
          "createdAt": {
            "$ref": "#/components/schemas/Datetime"
          },
          "amount": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Amount"
              },
              {
                "description": "Denomination in the smallest currency subunit, as for example eurocents.\nOnly present in successful payments.\n"
              }
            ]
          },
          "consumerName": {
            "description": "Name of the consumer. Only present in successful payments.",
            "type": "string",
            "example": "John"
          },
          "consumerBic": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BIC"
              },
              {
                "description": "Bank Identification Code. Only present in successful payments."
              }
            ]
          },
          "consumerIban": {
            "description": "IBAN of the consumer. Only present in successful payments.",
            "type": "string",
            "example": "NL24RABO8487376045"
          }
        }
      },
      "Refund": {
        "description": "Refund an already successfully processed payment.",
        "type": "object",
        "properties": {
          "amount": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Amount"
              },
              {
                "description": "Denomination in the smallest currency subunit, as for example eurocents.\nIf empty, the refund amount will be the remaining available amount of the transaction\n(i.e., total payment amount minus already refunded amounts minus the amounts of the pending refund requests).\n"
              }
            ]
          },
          "reason": {
            "description": "The description for the refund.\n",
            "type": "string",
            "example": "Refund required by customer.",
            "maxLength": 255
          }
        }
      }
    },
    "responses": {
      "IdealqrPayment": {
        "description": "iDEAL-QR Payment details",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/IdealqrPayment"
                },
                {
                  "properties": {
                    "refunds": {
                      "$ref": "#/components/schemas/Refunds"
                    }
                  }
                }
              ]
            }
          }
        }
      },
      "InternalError": {
        "description": "Internal server error. This can be caused by an unresponsive backend",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "id",
                "message"
              ],
              "properties": {
                "id": {
                  "$ref": "#/components/schemas/Uuid"
                },
                "message": {
                  "type": "string",
                  "example": "Service Unavailable"
                }
              }
            }
          }
        }
      },
      "UserError": {
        "description": "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)",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "id",
                "message"
              ],
              "properties": {
                "id": {
                  "$ref": "#/components/schemas/Uuid"
                },
                "message": {
                  "type": "string",
                  "example": "no authorization methods provided"
                }
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "oAuth2ClientCredentials": {
        "type": "oauth2",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "/api/v1/authorization/oauth2/token",
            "scopes": {}
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 103,
      "1": 234,
      "2": 76,
      "3": 191,
      "4": 145,
      "5": 198,
      "6": 48,
      "7": 79,
      "8": 46,
      "9": 249,
      "10": 185,
      "11": 249
    }
  }
}
```