Approval

Once the payment is processed through iyzico, the funds are kept in a safe escrow account till the sub-merchant approves the item or payment breakdown mentioned in the transaction. During this period, the sub-merchant may cancel the payment, may refund the payment breakdown, -if the buyer has received the item without any problems- may give confirmation for the payment, or withdraw their confirmation.

The payment breakdown id (paymentTransactionId) must be sent in order to confirm the item. Confirmed payment breakdown id (paymentTransactionId) will then be returned from the service.

Request

Parameters to be sent to the service are as follows:

Input Name Data Type Mandatory Description
paymentTransactionId String Yes ID of basket item. Merchants should keep payment ID in their system
conversationId String No If set, conversation ID to match request and response
locale String No Language (default: tr)

Please note that items can not be confirmed on iyzico side by any means. Since the control panel lacks this kind of functionality, the confirmation requests must be sent on code level.

Response

Parameters to be returned from the service are as follows:

Output Name Type Description
paymentTransactionId String ID of basket item. Merchants should keep payment ID in their system
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\CreateApprovalRequest();
$request->setLocale(\Iyzipay\Model\Locale::TR);
$request->setConversationId("123456789");
$request->setPaymentTransactionId("1");

$approval = \Iyzipay\Model\Approval::create($request, Config::options());
CreateApprovalRequest request = new CreateApprovalRequest();
request.Locale = Locale.TR.ToString();
request.ConversationId = "123456789";
request.PaymentTransactionId = "1";

Approval approval = Approval.Create(request, options);
CreateApprovalRequest request = new CreateApprovalRequest();
request.setLocale(Locale.TR.getValue());
request.setConversationId("123456789");
request.setPaymentTransactionId("1");

Approval approval = Approval.create(request, options);
iyzipay.approval.create({
    locale: Iyzipay.LOCALE.TR,
    conversationId: "123456789",
    paymentTransactionId: "1"
}, function (err, result) {
    console.log(err, result);
    done();
});
request = {
    locale: 'tr',
    conversationId: '123456789',
    paymentTransactionId: '699'
}
approval = Iyzipay::Model::Approval.new.create(request, @options)
request = dict([('locale', 'tr')])
request['conversationId'] = '123456789'
request['paymentTransactionId'] = '1'

approval = iyzipay.Approval()
approval_response = approval.create(request, options)
//Request
{
    "locale": "tr",
    "conversationId": "123456789",
    "paymentTransactionId": "38248"
}

//Response
{
    "status": "success",
    "locale": "tr",
    "systemTime": 1470733388749,
    "conversationId": "123456789",
    "paymentTransactionId": "38248"
}

The payment breakdown id (paymentTransactionId) needs to be sent in order to withdraw the item confirmation. Withdrawn payment breakdown id (paymentTransactionId) will then be returned from the service.

Request

Parameters to be sent to the service are as follows:

Input Name Data Type Mandatory Description
paymentTransactionId String Yes ID of basket item. Merchants should keep payment ID in their system
conversationId String No If set, conversation ID to match request and response
locale String No Language (default: tr)

Response

Parameters to be returned from the service are as follows:

Output Name Type Description
paymentTransactionId String ID of basket item. Merchants should keep payment ID in their system
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\CreateApprovalRequest();
$request->setLocale(\Iyzipay\Model\Locale::TR);
$request->setConversationId("123456789");
$request->setPaymentTransactionId("1");

$disapproval = \Iyzipay\Model\Disapproval::create($request, Config::options());
CreateApprovalRequest request = new CreateApprovalRequest();
request.Locale = Locale.TR.ToString();
request.ConversationId = "123456789";
request.PaymentTransactionId = "1";

Disapproval disapproval = Disapproval.Create(request, options);
CreateApprovalRequest request = new CreateApprovalRequest();
request.setLocale(Locale.TR.getValue());
request.setConversationId("123456789");
request.setPaymentTransactionId("1");

Disapproval disapproval = Disapproval.create(request, options);
iyzipay.disapproval.create({
    locale: Iyzipay.LOCALE.TR,
    conversationId: '123456789',
    paymentTransactionId: '1'
}, function (err, result) {
    console.log(err, result);
    done();
});
request = {
    locale: 'tr',
    conversationId: '123456789',
    paymentTransactionId: '699'
}
disapproval = Iyzipay::Model::Disapproval.new.create(request, @options)
request = dict([('locale', 'tr')])
request['conversationId'] = '123456789'
request['paymentTransactionId'] = '1'

disapproval = iyzipay.Disapproval()
disapproval_response = disapproval.create(request, options)
//Request
{
    "locale": "tr",
    "conversationId": "123456789",
    "paymentTransactionId": "38248"
}

//Response
{
    "status": "success",
    "locale": "tr",
    "systemTime": 1470733437268,
    "conversationId": "123456789",
    "paymentTransactionId": "38248"
}

Questions

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