In the marketplace solution, once the payment has been processed by iyzico, the funds are securely held in a protected pool until the submerchant grants approval for the payment breakdown or specific product. During this period, the submerchant has the flexibility to cancel the payment, issue a refund for a particular item, or provide approval for the fund transfer if the product has been successfully delivered to the buyer and the transaction has been completed without any issues. Additionally, the submerchant can withdraw their approval for the transaction if necessary.
For such usages iyzico offers 2 ways of finalize the payment;
Approve
To provide approve for a product, you must provide the payment breakdown ID (paymentTransactionId). The service will return the ID of the approved payment breakdown (paymentTransactionId).
Approve Request
POST
https://api.iyzipay.com/payment/iyzipos/item/approve
Request Body
If set, conversation ID to match request and response
ID of basket item. Merchants should keep payment ID in their system that comes in payment responses
200: OK
Copy {
"status":"success",
"locale":"tr",
"systemTime":1686434789050,
"conversationId":"123456789",
"paymentTransactionId":"20947103"
}
Approve Response
Parameters to be returned from the service are as follows:
Output Name
Type
Description
ID of basket item. Merchants should keep payment ID in their system
Service response result (success / failure)
Error code if service response status is failure
Error message if service response status is failure
Error group if service response status is failure
Response system timestamp value
If set, conversation ID to match request and response
Approve Sample Codes
PHP .NET JAVA NodeJS Python Ruby JSON
Copy $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());
Copy CreateApprovalRequest request = new CreateApprovalRequest();
request.Locale = Locale.TR.ToString();
request.ConversationId = "123456789";
request.PaymentTransactionId = "1";
Approval approval = Approval.Create(request, options);
Copy CreateApprovalRequest request = new CreateApprovalRequest();
request.setLocale(Locale.TR.getValue());
request.setConversationId("123456789");
request.setPaymentTransactionId("1");
Approval approval = Approval.create(request, options);
Copy iyzipay.approval.create({
locale: Iyzipay.LOCALE.TR,
conversationId: "123456789",
paymentTransactionId: "1"
}, function (err, result) {
console.log(err, result);
done();
});
Copy request = dict([('locale', 'tr')])
request['conversationId'] = '123456789'
request['paymentTransactionId'] = '1'
approval = iyzipay.Approval()
approval_response = approval.create(request, options)
Copy request = {
locale: 'tr',
conversationId: '123456789',
paymentTransactionId: '699'
}
approval = Iyzipay::Model::Approval.new.create(request, @options)
Copy //Request
{
"locale": "tr",
"conversationId": "123456789",
"paymentTransactionId": "38248"
}
//Response
{
"status": "success",
"locale": "tr",
"systemTime": 1470733388749,
"conversationId": "123456789",
"paymentTransactionId": "38248"
}
Disapprove
To withdraw the approval for a product, please provide the payment breakdown ID (paymentTransactionId). The service will return the ID of the revoked approval for the payment breakdown (paymentTransactionId).
Disapprove Request
POST
https://api.iyzipay.com/payment/iyzipos/item/disapprove
Request Body
If set, conversation ID to match request and response
ID of basket item. Merchants should keep payment ID in their system
200: OK
Copy {
"status":"success",
"locale":"tr",
"systemTime":1686434789050,
"conversationId":"123456789",
"paymentTransactionId":"20947103"
}
Disapprove Response
Parameters to be returned from the service are as follows:
Output Name
Type
Description
ID of basket item. Merchants should keep payment ID in their system
Service response result (success / failure)
Error code if service response status is failure
Error message if service response status is failure
Error group if service response status is failure
Response system timestamp value
If set, conversation ID to match request and response
Disapprove Sample Codes
PHP .NET JAVA NodeJS Python Ruby JSON
Copy $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());
Copy CreateApprovalRequest request = new CreateApprovalRequest();
request.Locale = Locale.TR.ToString();
request.ConversationId = "123456789";
request.PaymentTransactionId = "1";
Disapproval disapproval = Disapproval.Create(request, options);
Copy CreateApprovalRequest request = new CreateApprovalRequest();
request.setLocale(Locale.TR.getValue());
request.setConversationId("123456789");
request.setPaymentTransactionId("1");
Disapproval disapproval = Disapproval.create(request, options);
Copy iyzipay.disapproval.create({
locale: Iyzipay.LOCALE.TR,
conversationId: '123456789',
paymentTransactionId: '1'
}, function (err, result) {
console.log(err, result);
done();
});
Copy request = dict([('locale', 'tr')])
request['conversationId'] = '123456789'
request['paymentTransactionId'] = '1'
disapproval = iyzipay.Disapproval()
disapproval_response = disapproval.create(request, options)
Copy request = {
locale: 'tr',
conversationId: '123456789',
paymentTransactionId: '699'
}
disapproval = Iyzipay::Model::Disapproval.new.create(request, @options)
Copy //Request
{
"locale": "tr",
"conversationId": "123456789",
"paymentTransactionId": "38248"
}
//Response
{
"status": "success",
"locale": "tr",
"systemTime": 1470733437268,
"conversationId": "123456789",
"paymentTransactionId": "38248"
}