---
updatedAt: 2026-05-27T19:14:56.000Z
agentTools:
  projectIndex: https://docs.bamboopayment.com/llms.txt
---

# Refund

The Refunds endpoint reverts a previously approved purchase, either partially or fully. **The operation generates a new transaction linked to the original purchase.**

Only purchases in status **APPROVED** are eligible for refund operations.

This section provides the full endpoint definition, including request structure, response schema and validation behavior.

<Callout icon="📘" theme="info">
  For functional rules, restrictions, and availability by payment method, refer to the **[Refunds Guide](https://docs.bamboopayment.com/docs/refunds#/)** in the documentation.
</Callout>

<br />

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "Gateway.ServiceFacade.API",
    "version": "3"
  },
  "paths": {
    "/v3/api/Purchase/{id}/Refund": {
      "post": {
        "tags": [
          "Purchase"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefundCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RefundCommand"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RefundCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RefundResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RefundResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RefundResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "Authorization": []
          }
        ],
        "summary": "Refund"
      }
    }
  },
  "components": {
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "ErrorCode": {
            "type": "string",
            "nullable": true
          },
          "ErrorDescription": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "RefundCommand": {
        "type": "object",
        "properties": {
          "Amount": {
            "type": "integer",
            "format": "int64"
          },
          "TaxableAmount": {
            "type": "integer",
            "format": "int64"
          },
          "MetadataIn": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "nullable": true
          },
          "TransactionId": {
            "type": "integer",
            "format": "int64",
            "readOnly": true
          }
        },
        "additionalProperties": false
      },
      "RefundResponse": {
        "type": "object",
        "properties": {
          "ErrorCode": {
            "type": "string",
            "nullable": true
          },
          "ErrorDescription": {
            "type": "string",
            "nullable": true
          },
          "TransactionId": {
            "type": "string",
            "nullable": true
          },
          "Result": {
            "type": "string",
            "nullable": true
          },
          "Status": {
            "type": "string",
            "nullable": true
          },
          "Created": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "AuthorizationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "AuthorizationCode": {
            "type": "string",
            "nullable": true
          },
          "Amount": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "Currency": {
            "type": "string",
            "nullable": true
          },
          "MetadataOut": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "Authorization": {
        "type": "apiKey",
        "description": "Commerce account Private Key",
        "name": "Authorization",
        "in": "header"
      }
    }
  },
  "servers": [
    {
      "url": "https://api.bamboopayment.com"
    }
  ],
  "x-readme": {}
}
```