# /paymentmethods/in3/v1/transactions/{transactionId}/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/in3/v1/transactions/{transactionId}/refunds": {
      "post": {
        "tags": [
          "in3"
        ],
        "operationId": "createIN3TransactionRefund",
        "parameters": [
          {
            "name": "transactionId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Refund"
              }
            }
          }
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/RefundResponse"
          },
          "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
      },
      "Digest": {
        "description": "Digest of whole message body",
        "type": "string",
        "example": "sha-256=OWM5MDc3ODYwNzdjYjE5NjU0Y2NjMDM4MzEyYzMxZTA5MTAzMDBjYWM1Y2I1ODM4NTdlMDU2MzhiMzE1ZDhjNw==",
        "externalDocs": {
          "description": "Instance Digests in HTTP",
          "url": "https://datatracker.ietf.org/doc/html/rfc3230"
        }
      },
      "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": {
      "RefundResponse": {
        "description": "Refund details",
        "headers": {
          "Digest": {
            "$ref": "#/components/headers/Digest"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "id",
                "transactionId",
                "amount",
                "reason",
                "status",
                "created",
                "updated"
              ],
              "properties": {
                "id": {
                  "$ref": "#/components/schemas/Uuid"
                },
                "transactionId": {
                  "$ref": "#/components/schemas/Uuid"
                },
                "amount": {
                  "$ref": "#/components/schemas/Amount"
                },
                "reason": {
                  "type": "string",
                  "example": "Refund requested by consumer"
                },
                "created": {
                  "$ref": "#/components/schemas/Datetime"
                },
                "updated": {
                  "$ref": "#/components/schemas/Datetime"
                }
              }
            }
          }
        }
      },
      "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"
                }
              }
            }
          }
        }
      }
    },
    "headers": {
      "Digest": {
        "description": "Digest of whole message body",
        "schema": {
          "$ref": "#/components/schemas/Digest"
        }
      }
    },
    "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
    }
  }
}
```