# Refunds

## List refunds

> Get a paginated list of refunds with optional filtering

```json
{"openapi":"3.1.1","info":{"title":"Alternative Payments","version":"1.1.0"},"servers":[{"url":"http://public-api.alternativepayments.io"}],"security":[{"OAuth2ClientCredentials":[]}],"components":{"securitySchemes":{"OAuth2ClientCredentials":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"/oauth/token","scopes":{"read":"Read access","write":"Write access"}}}}},"schemas":{"PaginatedResponse-RefundReply":{"properties":{"data":{"items":{"$ref":"#/components/schemas/RefundReply"},"type":"array"},"end_cursor":{"type":"string"},"has_next_page":{"type":"boolean"},"has_previous_page":{"type":"boolean"},"start_cursor":{"type":"string"}},"type":"object"},"RefundReply":{"properties":{"created_at":{"type":"string"},"customer_id":{"type":"string"},"due_date":{"type":"string"},"fees":{"items":{"$ref":"#/components/schemas/RefundFee"},"type":"array"},"id":{"type":"string"},"payment_method":{"type":"string"},"sub_total":{"type":"number"},"total":{"type":"number"}},"type":"object"},"RefundFee":{"properties":{"amount":{"type":"number"},"covered_by_customer":{"type":"boolean"},"name":{"type":"string"},"type":{"description":"@enum FT_LATE_PAYMENT,FT_PRODUCT,FT_METHOD,FT_INTEREST","enum":["FT_LATE_PAYMENT","FT_PRODUCT","FT_METHOD","FT_INTEREST"],"type":"string"}},"type":"object"},"HttpError":{"properties":{"code":{"type":"string"},"message":{"type":"string"},"validation_errors":{"additionalProperties":{"type":"string"},"type":"object"}},"type":"object"}}},"paths":{"/refunds":{"get":{"description":"Get a paginated list of refunds with optional filtering","operationId":"listRefunds","parameters":[{"schema":{"type":"integer","default":100},"description":"Number of items to return","in":"query","name":"limit"},{"schema":{"type":"string"},"description":"Specifies the cursor after which to start returning results. For the first page, this should be left empty. For subsequent pages, use the value of the end_cursor field from the previous response.","in":"query","name":"after"},{"schema":{"type":"string"},"description":"Specifies the cursor before which to return results. Use this to paginate backwards. For example, to load the previous page, provide the value of the start_cursor field from the last response.","in":"query","name":"before"},{"schema":{"type":"string"},"description":"Filter by customer ID","in":"query","name":"customer_id"},{"schema":{"type":"string"},"description":"Filter by invoice ID","in":"query","name":"invoice_id"},{"schema":{"type":"string","enum":["card","standard_ach","same_day_ach","manual"]},"description":"Filter by payment method","in":"query","name":"payment_method"},{"schema":{"type":"string"},"description":"Filter by creation date start (RFC3339 format)","in":"query","name":"created_at_start"},{"schema":{"type":"string"},"description":"Filter by creation date end (RFC3339 format)","in":"query","name":"created_at_end"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse-RefundReply"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}}}},"summary":"List refunds","tags":["Refunds"]}}}}
```

## Create refund

> Create a full refund for a payment. Partial refunds are not supported.

```json
{"openapi":"3.1.1","info":{"title":"Alternative Payments","version":"1.1.0"},"servers":[{"url":"http://public-api.alternativepayments.io"}],"security":[{"OAuth2ClientCredentials":[]}],"components":{"securitySchemes":{"OAuth2ClientCredentials":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"/oauth/token","scopes":{"read":"Read access","write":"Write access"}}}}},"schemas":{"HttpError":{"properties":{"code":{"type":"string"},"message":{"type":"string"},"validation_errors":{"additionalProperties":{"type":"string"},"type":"object"}},"type":"object"},"CreateRefundRequest":{"description":"Request body for creating a refund","properties":{"amount":{"type":"string"},"idempotency_key":{"type":"string"},"payment_id":{"type":"string"},"reason":{"$ref":"#/components/schemas/RefundReasonDetail"}},"type":"object"},"RefundReasonDetail":{"description":"The reason for the refund. If 'Other', please specify the reason in more detail.","properties":{"description":{"type":"string"},"type":{"allOf":[{"$ref":"#/components/schemas/refunds_api.RefundType"}],"description":"@enum Customer Request, Duplicate, Fraud, Other"}},"type":"object"},"refunds_api.RefundType":{"enum":["Customer Request","Duplicate","Fraud","Other"],"type":"string"}}},"paths":{"/refunds":{"post":{"description":"Create a full refund for a payment. Partial refunds are not supported.","operationId":"createRefund","responses":{"201":{"description":"Refund is being processed!","content":{"application/json":{"schema":{"type":"string"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}}}},"summary":"Create refund","tags":["Refunds"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRefundRequest"}}},"description":"Refund details","required":true}}}}}
```

## Get refund by ID

> Retrieve detailed information about a specific refund

```json
{"openapi":"3.1.1","info":{"title":"Alternative Payments","version":"1.1.0"},"servers":[{"url":"http://public-api.alternativepayments.io"}],"security":[{"OAuth2ClientCredentials":[]}],"components":{"securitySchemes":{"OAuth2ClientCredentials":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"/oauth/token","scopes":{"read":"Read access","write":"Write access"}}}}},"schemas":{"RefundReply":{"properties":{"created_at":{"type":"string"},"customer_id":{"type":"string"},"due_date":{"type":"string"},"fees":{"items":{"$ref":"#/components/schemas/RefundFee"},"type":"array"},"id":{"type":"string"},"payment_method":{"type":"string"},"sub_total":{"type":"number"},"total":{"type":"number"}},"type":"object"},"RefundFee":{"properties":{"amount":{"type":"number"},"covered_by_customer":{"type":"boolean"},"name":{"type":"string"},"type":{"description":"@enum FT_LATE_PAYMENT,FT_PRODUCT,FT_METHOD,FT_INTEREST","enum":["FT_LATE_PAYMENT","FT_PRODUCT","FT_METHOD","FT_INTEREST"],"type":"string"}},"type":"object"},"HttpError":{"properties":{"code":{"type":"string"},"message":{"type":"string"},"validation_errors":{"additionalProperties":{"type":"string"},"type":"object"}},"type":"object"}}},"paths":{"/refunds/{id}":{"get":{"description":"Retrieve detailed information about a specific refund","operationId":"getRefund","parameters":[{"schema":{"type":"string"},"description":"Refund ID","in":"path","name":"id","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundReply"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}}}},"summary":"Get refund by ID","tags":["Refunds"]}}}}
```
