Refund to Balance

Refund to Balance Introduction

“Refund to Balance” feature will allow you to refund instantly to your customers whenever you approve the “refund request”. How?

  • Your customer requests “refund to my iyzico account”
  • If your customer does not have an iyzico account, they can instantly be onboarded by completing e-mail and GSM OTP steps.
  • You can approve that request on the iyzico Merchant Panel.
  • After the refund confirmation, iyzico instantly transfers the refund amount to your customer’s balance.
  • Your customer is notified via e-mail and SMS.
Refund to Balance API reference

Requirements

• Refund to Balance button

  1. You make the “Refund to Balance” initialize API call(when customer clicks the button).
  2. “Refund to Balance” API sends back a response
  3. Use URL parameter returned in the response to redirect the user to the "Refund to Balance" page. That redirects the customer to "Refund to Balance".
  4. When your customer successfully completes their refund to balance process, they are redirected to the success URL that you specified when the initialize API call.
  5. Customer redirects to your web site.

The parameters that should be sent to the service are as follows:

Parameter name Type Mandatory Description
locale string no Language settings (default: tr)
conversationId string no Conversation ID to match request and response
paymentId string yes ID of the related payment.
callbackUrl string yes Redirection URL(https)

The response parameters are as follows:

Parameter name Type Description
token string Unique value created for refund. This token is sent to callBackUrl
url string Url to start the refund to iyzico account process
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

$request = new \Iyzipay\Request\CreateRefundToBalanceRequest();
$request->setPaymentId("11654127");
$request->setCallbackUrl("https://www.callback");

$refundToBalance = \Iyzipay\Model\RefundToBalance::create($request, Config::options());
request = {
    locale: Iyzipay::Model::Locale::TR,
    conversationId: '123456789',
    paymentId: '11661247',
    callbackUrl: 'https://merchanturl.com'
}
    refundToBalance = Iyzipay::Model::RefundToBalance.new.create(request, @options)
//Request
{
    "locale": "tr",
    "conversationId": "123456",    
    "paymentId": "11661247",
    "callbackUrl": "https://merchanturl.com"
}

//Response
{
    "status": "success",
    "locale": "tr",
    "systemTime": 1470730913791,
    "conversationId": "123456",
    "token": "1xxyyzzqq345",
    "url": "https://sandbox-consumer.iyzico.com/xyz"
}

Örnek Kodlar