Refund

Merchants are able to refund any payment 24/7, 365 days a year. Refund transactions will show in a buyer’s card statement. Merchants are able to refund either the full amount or just a partial amount of any payment. The refund amount can’t be greater than the total amount (e.g. if item paidPrice=100 TL, then refundPrice can not be greater than 100 TL; if item paidPrice =100 TL and refundPrice=80 TL, then the price after refund will be 20 TL. So for the next refund request, refundPrice must be between 0.01 TL and 20 TL.

Request

Parameters to be sent to the service are as follows:

Input Name Data Type Mandatory Description
paymentTransactionId String Yes ID of the basket item that needs to be refunded
price String Yes Amount that needs to be refunded
ip String No Buyer IP address
locale String No Language (default: tr)
conversationId String No Conversation ID to match request and response

Response

Parameters to be returned from the service are as follows:

Output Name Data Type Description
price string Refunded amount
currency string Currency of payment
paymentid integer ID of refunded payment
paymentTransactionId string ID of the basket item that was refunded
status string Service response result (success / failure)
errorCode string Error code if service response status is failure
errorMessage string Error message if service response status is failure
errorGroup string Error group if service response status is failure
locale string Language (default: tr)
systemTime integer Response system timestamp value
conversationId string If set, conversation ID to match request and response

Sample Codes

Sample codes that can be found in iyzico clients:

$request = new \Iyzipay\Request\CreateRefundRequest();
$request->setLocale(\Iyzipay\Model\Locale::TR);
$request->setConversationId("123456789");
$request->setPaymentTransactionId("1");
$request->setPrice("0.5");
$request->setCurrency(\Iyzipay\Model\Currency::TL);
$request->setIp("85.34.78.112");

$refund = \Iyzipay\Model\Refund::create($request, Config::options());
CreateRefundRequest request = new CreateRefundRequest();
request.ConversationId = "123456789";
request.Locale = Locale.TR.ToString();
request.PaymentTransactionId = "1";
request.Price = "0.5";
request.Ip = "85.34.78.112";
request.Currency = Currency.TRY.ToString();

Refund refund = Refund.Create(request, options);
CreateRefundRequest request = new CreateRefundRequest();
request.setLocale(Locale.TR.getValue());
request.setConversationId("123456789");
request.setPaymentTransactionId("1");
request.setPrice(new BigDecimal("0.5"));
request.setCurrency(Currency.TRY.name());
request.setIp("85.34.78.112");

Refund refund = Refund.create(request, options);
iyzipay.refund.create({
    locale: Iyzipay.LOCALE.TR,
    conversationId: '123456789',
    paymentTransactionId: '1',
    price: '0.5',
    currency: Iyzipay.CURRENCY.TRY,
    ip: '85.34.78.112'
}, function (err, result) {
    console.log(err, result);
    done();
});
request = {
    locale: 'tr',
    conversationId: '123456789',
    paymentTransactionId: '702',
    price: '0.1',
    ip: '85.34.78.112',
    currency: Iyzipay::Model::Currency::TRY
}
refund = Iyzipay::Model::Refund.new.create(request, @options)
request = dict([('locale', 'tr')])
request['conversationId'] = '123456789'
request['paymentTransactionId'] = '1'
request['price'] = '0.1'
request['ip'] = '85.34.78.112'
request['currency'] = 'TRY'

refund = iyzipay.Refund()
refund_response = refund.create(request, options)
//Request
{
    "locale": "tr",
    "conversationId": "123456789",
    "paymentTransactionId": "36532",
    "price": "50.0",
    "ip": "85.34.78.112",
    "currency": "TRY"
}

//Response
{
    "status": "success",
    "locale": "tr",
    "systemTime": 1470730913791,
    "conversationId": "123456789",
    "paymentId": "25132",
    "paymentTransactionId": "36532",
    "price": 50,
    "currency": "TRY"
}

Questions

If you have questions about this service, get in touch with us and find out how we can help you.