> For the complete documentation index, see [llms.txt](https://docs.iyzico.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.iyzico.com/en/getting-started/preliminaries/api-reference-beta/refund-and-cancel.md).

# Refund & Cancel

## Refund

> Used to refund a payment. The refund is executed over \*\*paymentTransactionId\*\* (per basket item). You can perform a \*\*full\*\* or \*\*partial\*\* refund for the payment amount.<br>

```json
{"openapi":"3.0.3","info":{"title":"Payment Operations - Cancel & Refund","version":"1.0.0"},"servers":[{"url":"https://api.iyzipay.com","description":"iyzico API"}],"paths":{"/payment/refund":{"post":{"summary":"Refund","description":"Used to refund a payment. The refund is executed over **paymentTransactionId** (per basket item). You can perform a **full** or **partial** refund for the payment amount.\n","tags":["Payment"],"parameters":[{"$ref":"#/components/parameters/AuthHeader"},{"$ref":"#/components/parameters/ContentTypeHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundPaymentRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundPaymentResponse"}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"parameters":{"AuthHeader":{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"},"description":"Authorization header; a signed hash value that starts with **IYZWSv2** and is generated in Base64 format."},"ContentTypeHeader":{"name":"Content-Type","in":"header","required":true,"schema":{"type":"string"},"description":"Content type of the request body."}},"schemas":{"RefundPaymentRequest":{"type":"object","required":["paymentTransactionId","price"],"properties":{"paymentTransactionId":{"type":"string","description":"Basket item (payment breakdown) identifier (**paymentTransactionId**) to be refunded."},"conversationId":{"type":"string","description":"Unique ID for request/response correlation."},"ip":{"type":"string","description":"IP address the request is sent from."},"locale":{"type":"string","enum":["tr","en"],"description":"Response language."},"price":{"type":"decimal","description":"Amount to refund. **Must not exceed** the item price."},"currency":{"type":"string","description":"Payment currency."}}},"RefundPaymentResponse":{"type":"object","properties":{"status":{"type":"string","enum":["success","failure"],"description":"Indicates the outcome of the request."},"locale":{"type":"string","enum":["tr","en"],"description":"Response language."},"systemTime":{"type":"integer","description":"Current **epoch ms** at the time of response."},"conversationId":{"type":"string","description":"Echoes the conversationId sent in the request."},"paymentId":{"type":"string","description":"Payment number."},"paymentTransactionId":{"type":"string","description":"Refunded payment item identifier."},"price":{"type":"decimal","description":"Refunded amount."},"currency":{"type":"string","description":"Currency."},"authCode":{"type":"string","description":"Authorization (auth) code returned by the bank."},"hostReference":{"type":"string","description":"Reference value provided by the bank for the payment."},"refundHostReference":{"type":"string","description":"Reference value provided by the bank for the refund."},"retryable":{"type":"boolean","description":"Indicates whether the operation can be retried.","enum":[true,false]},"signature":{"type":"string","description":"Signature value that can be used for verification."}}},"ErrorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["failure"],"description":"Indicates the request result (failure)."},"errorCode":{"type":"string","description":"Error code."},"errorMessage":{"type":"string","description":"Error message."},"locale":{"type":"string","enum":["tr","en"],"description":"Response language."},"systemTime":{"type":"integer","description":"Current **epoch ms** at the time of response."},"conversationId":{"type":"string","description":"conversationId sent in the request."},"paymentId":{"type":"string","description":"Related payment id (if any)."},"paymentTransactionId":{"type":"string","description":"Related payment transaction id (if any)."},"price":{"type":"decimal","description":"Related amount (if any)."},"retryable":{"type":"boolean","description":"Whether the operation can be retried."}}}}}}
```

## Refund V2

> Enables refunds over \*\*paymentId\*\*. No item breakdown is required; the system determines the basket item to refund. You can perform a \*\*full\*\* or \*\*partial\*\* refund for the payment amount.<br>

```json
{"openapi":"3.0.3","info":{"title":"Payment Operations - Cancel & Refund","version":"1.0.0"},"servers":[{"url":"https://api.iyzipay.com","description":"iyzico API"}],"paths":{"/v2/payment/refund":{"post":{"summary":"Refund V2","description":"Enables refunds over **paymentId**. No item breakdown is required; the system determines the basket item to refund. You can perform a **full** or **partial** refund for the payment amount.\n","tags":["Payment"],"parameters":[{"$ref":"#/components/parameters/AuthHeader"},{"$ref":"#/components/parameters/ContentTypeHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundPaymentV2Request"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundPaymentV2Response"}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"parameters":{"AuthHeader":{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"},"description":"Authorization header; a signed hash value that starts with **IYZWSv2** and is generated in Base64 format."},"ContentTypeHeader":{"name":"Content-Type","in":"header","required":true,"schema":{"type":"string"},"description":"Content type of the request body."}},"schemas":{"RefundPaymentV2Request":{"type":"object","required":["paymentId","price"],"properties":{"paymentId":{"type":"string","description":"Payment identifier to be refunded."},"conversationId":{"type":"string","description":"Unique ID for request/response correlation."},"ip":{"type":"string","description":"IP address the request is sent from."},"locale":{"type":"string","enum":["tr","en"],"description":"Response language."},"price":{"type":"decimal","description":"Amount to refund. **Must not exceed** the payment total."},"currency":{"type":"string","description":"Payment currency."}}},"RefundPaymentV2Response":{"type":"object","properties":{"status":{"type":"string","enum":["success","failure"],"description":"Indicates the outcome of the request."},"locale":{"type":"string","enum":["tr","en"],"description":"Response language."},"systemTime":{"type":"integer","description":"Current **epoch ms** at the time of response."},"conversationId":{"type":"string","description":"Echoes the conversationId sent in the request."},"paymentId":{"type":"string","description":"Refunded payment identifier."},"price":{"type":"decimal","description":"Refunded amount."},"currency":{"type":"string","description":"Currency."},"authCode":{"type":"string","description":"Authorization (auth) code returned by the bank."},"hostReference":{"type":"string","description":"Reference value provided by the bank for the payment."},"refundHostReference":{"type":"string","description":"Reference value provided by the bank for the refund."},"retryable":{"type":"boolean","description":"Indicates whether the operation can be retried.","enum":[true,false]},"signature":{"type":"string","description":"Signature value that can be used for verification."}}},"ErrorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["failure"],"description":"Indicates the request result (failure)."},"errorCode":{"type":"string","description":"Error code."},"errorMessage":{"type":"string","description":"Error message."},"locale":{"type":"string","enum":["tr","en"],"description":"Response language."},"systemTime":{"type":"integer","description":"Current **epoch ms** at the time of response."},"conversationId":{"type":"string","description":"conversationId sent in the request."},"paymentId":{"type":"string","description":"Related payment id (if any)."},"paymentTransactionId":{"type":"string","description":"Related payment transaction id (if any)."},"price":{"type":"decimal","description":"Related amount (if any)."},"retryable":{"type":"boolean","description":"Whether the operation can be retried."}}}}}}
```

## Cancel

> Used to cancel a payment.

```json
{"openapi":"3.0.3","info":{"title":"Payment Operations - Cancel & Refund","version":"1.0.0"},"servers":[{"url":"https://api.iyzipay.com","description":"iyzico API"}],"paths":{"/payment/cancel":{"post":{"summary":"Cancel","description":"Used to cancel a payment.","tags":["Payment"],"parameters":[{"$ref":"#/components/parameters/AuthHeader"},{"$ref":"#/components/parameters/ContentTypeHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelPaymentRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelPaymentResponse"}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"parameters":{"AuthHeader":{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"},"description":"Authorization header; a signed hash value that starts with **IYZWSv2** and is generated in Base64 format."},"ContentTypeHeader":{"name":"Content-Type","in":"header","required":true,"schema":{"type":"string"},"description":"Content type of the request body."}},"schemas":{"CancelPaymentRequest":{"type":"object","required":["paymentId"],"properties":{"paymentId":{"type":"string","description":"The **unique payment number** assigned by iyzico for the payment you want to cancel."},"conversationId":{"type":"string","description":"Unique ID for request/response correlation. Returned as-is in the response."},"ip":{"type":"string","description":"IP address the request is sent from."},"locale":{"type":"string","enum":["tr","en"],"description":"Response language for iyzico messages."}}},"CancelPaymentResponse":{"type":"object","properties":{"status":{"type":"string","enum":["success","failure"],"description":"Indicates the outcome of the request."},"locale":{"type":"string","enum":["tr","en"],"description":"Response language."},"systemTime":{"type":"integer","description":"Current **epoch ms** at the time of response."},"conversationId":{"type":"string","description":"Echoes the conversationId sent in the request."},"paymentId":{"type":"string","description":"Canceled payment number."},"price":{"type":"decimal","description":"Canceled payment amount."},"currency":{"type":"string","description":"Currency (payment currency)."},"authCode":{"type":"string","description":"Authorization (auth) code returned by the bank."},"hostReference":{"type":"string","description":"Transaction reference value."},"cancelHostReference":{"type":"string","description":"Reference value for the cancel transaction."}}},"ErrorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["failure"],"description":"Indicates the request result (failure)."},"errorCode":{"type":"string","description":"Error code."},"errorMessage":{"type":"string","description":"Error message."},"locale":{"type":"string","enum":["tr","en"],"description":"Response language."},"systemTime":{"type":"integer","description":"Current **epoch ms** at the time of response."},"conversationId":{"type":"string","description":"conversationId sent in the request."},"paymentId":{"type":"string","description":"Related payment id (if any)."},"paymentTransactionId":{"type":"string","description":"Related payment transaction id (if any)."},"price":{"type":"decimal","description":"Related amount (if any)."},"retryable":{"type":"boolean","description":"Whether the operation can be retried."}}}}}}
```
