3D Auth

Request

Parameters to be sent to the service are as follows:

Input Name Type Mandatory Description
price Decimal Yes Total amount of basket. The sum of basket items’ amount must be equal to the price of basket
paidPrice Decimal Yes Final amount (including installment fee) that will be charged to customer’s card
currency String Yes Currency (default: TRY). Alternatively, you can set USD, EUR, GBP and IRR
installment Integer Yes Installment value. For single installment payments it should be 1 (valid values: 1, 2, 3, 6, 9, 12)
cardNumber String Yes 15 (AMEX) or 16 (VISA, MC) digits card number
expireYear String Yes Expiration year of the card
expireMonth String Yes Expiration month of the card (2 digits)
cvc String Yes 4 (AMEX) or 3 (VISA, MC, TROY) digits card verification code
cardHolderName String Yes Name of the card owner
callbackUrl String Yes Redirection URL
id(Buyer) String Yes ID of buyer.
name(Buyer) String Yes Name of buyer
surname(Buyer) String Yes Surname of buyer
identityNumber(Buyer) String Yes Identity number of buyer. TCKN for Turkish merchants, passport number for foreign merchants
city(Buyer) String Yes City of buyer
country(Buyer) String Yes Country of buyer
email(Buyer) String Yes Email of buyer
ip(Buyer) String Yes IP of buyer
registrationAddress(Buyer) String Yes Registration address of buyer
contactName(BillingAddress) String Yes Contact name of billing address
city(BillingAddress) String Yes City name of billing address
country(BillingAddress) String Yes Country name of billing address
address(BillingAddress) String Yes Address details of billing address
contactName(ShippingAddress) String Yes Contact name of shipping adress. If one of the itemType in basket is PHYSICAL, then this parameter will be mandatory
city(ShippingAddress) String Yes City name of shipping address. If one of the itemType in basket is PHYSICAL, then this parameter will be mandatory
country(ShippingAddress) String Yes Country name of shipping address. If one of the itemType in basket is PHYSICAL, then this parameter will be mandatory
address(ShippingAddress) String Yes Address details of shipping address. If one of the itemType in basket is PHYSICAL, then this parameter will be mandatory
id(BasketItems) String Yes Basket Item ID
itemType(BasketItems) String Yes Item Type. Valid values are PHYSICAL,VIRTUAL
price(BasketItems) Decimal Yes Price value for each item. Must be greater than zero
name(BasketItems) String Yes Name of the item in the basket
category1(BasketItems) String Yes Category 1 for item in the basket
zipCode(Buyer) String No Zip code of buyer
zipCode(ShippingAddress) String No Zip code of shipping address
zipCode(BillingAddress) String No Zip code of billing address
category2(BasketItems) String No Category 2 for item in the basket
gsmNumber(Buyer) String No GSM number of buyer
subMerchantPrice(BasketItem) Decimal No Payout amount to subMerchant of each item. Must be greater than zero. Mandatory value for marketplace solution
subMerchantKey(BasketItem) String No Submerchant ID value. Mandatory value for marketplace solution
registerCard Integer No Parameter that shows card details will store or not. Default value is 0 and valid values are 0 or 1
cardAlias Integer No If registerCard value is 1 cardAlias can send within request.
registrationDate(Buyer) String No Registration date of buyer. Format should be “2015-09-17 23:45:06”
lastLoginDate(Buyer) String No Last login date of buyer. Format should be “2015-09-17 23:45:06”
locale String No Language (default: tr)
conversationId String No Conversation ID to match request and response
basketId String No Merchant's basket ID
paymentChannel String No Payment channel. Valid values are WEB, MOBILE, MOBILE_WEB, MOBILE_IOS, MOBILE_ANDROID, MOBILE_WINDOWS, MOBILE_TABLET, MOBILE_PHONE
paymentGroup String No Payment group (default: PRODUCT). Valid values are PRODUCT, LISTING, SUBSCRIPTION
paymentSource String No Payment source. Valid values are SHOPIFY, MAGENTO, PRESTASHOP, WOOCOMMERCE, OPENCART

Response

Parameters to be returned from the service are as follows:

Output Name Type Description
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 Long Response system timestamp value
conversationId String If set, conversation ID to match request and response
threeDSHtmlContent String 3D verification screen in HTML format

Test Cards

Test cards that can be used to simulate test transactions:

Card Number Bank Card type
5890040000000016 Akbank Master Card (Debit)
5526080000000006 Akbank Master Card (Credit)
4766620000000001 Denizbank Visa (Debit)
4603450000000000 Denizbank Visa (Credit)
4987490000000002 Finansbank Visa (Debit)
5311570000000005 Finansbank Master Card (Credit)
9792020000000001 Finansbank Troy (Debit)
9792030000000000 Finansbank Troy (Credit)
5170410000000004 Garanti Bankası Master Card (Debit)
5400360000000003 Garanti Bankası Master Card (Credit)
374427000000003 Garanti Bankası American Express
4475050000000003 Halkbank Visa (Debit)
5528790000000008 Halkbank Master Card (Credit)
4059030000000009 HSBC Bank Visa (Debit)
5504720000000003 HSBC Bank Master Card (Credit)
5892830000000000 Türkiye İş Bankası Master Card (Debit)
4543590000000006 Türkiye İş Bankası Visa (Credit)
4910050000000006 Vakıfbank Visa (Debit)
4157920000000002 Vakıfbank Visa (Credit)
5168880000000002 Yapı ve Kredi Bankası Master Card (Debit)
5451030000000000 Yapı ve Kredi Bankası Master Card (Credit)

Cross border test cards:

Card Number Country
5400010000000004 Non-Turkish (Credit)
4054180000000007 Non-Turkish (Debit)
6221060000000004 Iran

Test cards to get specific error codes:

Card Number Description
5406670000000009 Success but cannot be cancelled, refund or post auth
4111111111111129 Not sufficient funds
4129111111111111 Do not honour
4128111111111112 Invalid transaction
4127111111111113 Lost card
4126111111111114 Stolen card
4125111111111115 Expired card
4124111111111116 Invalid cvc2
4123111111111117 Not permitted to card holder
4122111111111118 Not permitted to terminal
4121111111111119 Fraud suspect
4120111111111110 Pickup card
4130111111111118 General error
4131111111111117 Success but mdStatus is 0
4141111111111115 Success but mdStatus is 4
4151111111111112 3dsecure initialize failed

Sample Codes

Sample codes that can be found in iyzico clients:

$request = new \Iyzipay\Request\CreatePaymentRequest();
$request->setLocale(\Iyzipay\Model\Locale::TR);
$request->setConversationId("123456789");
$request->setPrice("1");
$request->setPaidPrice("1.2");
$request->setCurrency(\Iyzipay\Model\Currency::TL);
$request->setInstallment(1);
$request->setBasketId("B67832");
$request->setPaymentChannel(\Iyzipay\Model\PaymentChannel::WEB);
$request->setPaymentGroup(\Iyzipay\Model\PaymentGroup::PRODUCT);
$request->setCallbackUrl("https://www.merchant.com/callback");
$paymentCard = new \Iyzipay\Model\PaymentCard();
$paymentCard->setCardHolderName("John Doe");
$paymentCard->setCardNumber("5528790000000008");
$paymentCard->setExpireMonth("12");
$paymentCard->setExpireYear("2030");
$paymentCard->setCvc("123");
$paymentCard->setRegisterCard(0);
$request->setPaymentCard($paymentCard);
$buyer = new \Iyzipay\Model\Buyer();
$buyer->setId("BY789");
$buyer->setName("John");
$buyer->setSurname("Doe");
$buyer->setGsmNumber("+905350000000");
$buyer->setEmail("email@email.com");
$buyer->setIdentityNumber("74300864791");
$buyer->setLastLoginDate("2015-10-05 12:43:35");
$buyer->setRegistrationDate("2013-04-21 15:12:09");
$buyer->setRegistrationAddress("Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1");
$buyer->setIp("85.34.78.112");
$buyer->setCity("Istanbul");
$buyer->setCountry("Turkey");
$buyer->setZipCode("34732");
$request->setBuyer($buyer);
$shippingAddress = new \Iyzipay\Model\Address();
$shippingAddress->setContactName("Jane Doe");
$shippingAddress->setCity("Istanbul");
$shippingAddress->setCountry("Turkey");
$shippingAddress->setAddress("Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1");
$shippingAddress->setZipCode("34742");
$request->setShippingAddress($shippingAddress);
$billingAddress = new \Iyzipay\Model\Address();
$billingAddress->setContactName("Jane Doe");
$billingAddress->setCity("Istanbul");
$billingAddress->setCountry("Turkey");
$billingAddress->setAddress("Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1");
$billingAddress->setZipCode("34742");
$request->setBillingAddress($billingAddress);
$basketItems = array();
$firstBasketItem = new \Iyzipay\Model\BasketItem();
$firstBasketItem->setId("BI101");
$firstBasketItem->setName("Binocular");
$firstBasketItem->setCategory1("Collectibles");
$firstBasketItem->setCategory2("Accessories");
$firstBasketItem->setItemType(\Iyzipay\Model\BasketItemType::PHYSICAL);
$firstBasketItem->setPrice("0.3");
$basketItems[0] = $firstBasketItem;
$secondBasketItem = new \Iyzipay\Model\BasketItem();
$secondBasketItem->setId("BI102");
$secondBasketItem->setName("Game code");
$secondBasketItem->setCategory1("Game");
$secondBasketItem->setCategory2("Online Game Items");
$secondBasketItem->setItemType(\Iyzipay\Model\BasketItemType::VIRTUAL);
$secondBasketItem->setPrice("0.5");
$basketItems[1] = $secondBasketItem;
$thirdBasketItem = new \Iyzipay\Model\BasketItem();
$thirdBasketItem->setId("BI103");
$thirdBasketItem->setName("Usb");
$thirdBasketItem->setCategory1("Electronics");
$thirdBasketItem->setCategory2("Usb / Cable");
$thirdBasketItem->setItemType(\Iyzipay\Model\BasketItemType::PHYSICAL);
$thirdBasketItem->setPrice("0.2");
$basketItems[2] = $thirdBasketItem;
$request->setBasketItems($basketItems);

$threedsInitialize = \Iyzipay\Model\ThreedsInitialize::create($request, Config::options());
CreatePaymentRequest request = new CreatePaymentRequest();
request.Locale = Locale.TR.ToString();
request.ConversationId = "123456789";
request.Price = "1";
request.PaidPrice = "1.2";
request.Currency = Currency.TRY.ToString();
request.Installment = 1;
request.BasketId = "B67832";
request.PaymentChannel = PaymentChannel.WEB.ToString();
request.PaymentGroup = PaymentGroup.PRODUCT.ToString();
request.CallbackUrl = "https://www.merchant.com/callback";

PaymentCard paymentCard = new PaymentCard();
paymentCard.CardHolderName = "John Doe";
paymentCard.CardNumber = "5528790000000008";
paymentCard.ExpireMonth = "12";
paymentCard.ExpireYear = "2030";
paymentCard.Cvc = "123";
paymentCard.RegisterCard = 0;
request.PaymentCard = paymentCard;

Buyer buyer = new Buyer();
buyer.Id = "BY789";
buyer.Name = "John";
buyer.Surname = "Doe";
buyer.GsmNumber = "+905350000000";
buyer.Email = "email@email.com";
buyer.IdentityNumber = "74300864791";
buyer.LastLoginDate = "2015-10-05 12:43:35";
buyer.RegistrationDate = "2013-04-21 15:12:09";
buyer.RegistrationAddress = "Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1";
buyer.Ip = "85.34.78.112";
buyer.City = "Istanbul";
buyer.Country = "Turkey";
buyer.ZipCode = "34732";
request.Buyer = buyer;

Address shippingAddress = new Address();
shippingAddress.ContactName = "Jane Doe";
shippingAddress.City = "Istanbul";
shippingAddress.Country = "Turkey";
shippingAddress.Description = "Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1";
shippingAddress.ZipCode = "34742";
request.ShippingAddress = shippingAddress;

Address billingAddress = new Address();
billingAddress.ContactName = "Jane Doe";
billingAddress.City = "Istanbul";
billingAddress.Country = "Turkey";
billingAddress.Description = "Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1";
billingAddress.ZipCode = "34742";
request.BillingAddress = billingAddress;

List<BasketItem> basketItems = new List<BasketItem>();
BasketItem firstBasketItem = new BasketItem();
firstBasketItem.Id = "BI101";
firstBasketItem.Name = "Binocular";
firstBasketItem.Category1 = "Collectibles";
firstBasketItem.Category2 = "Accessories";
firstBasketItem.ItemType = BasketItemType.PHYSICAL.ToString();
firstBasketItem.Price = "0.3";
basketItems.Add(firstBasketItem);

BasketItem secondBasketItem = new BasketItem();
secondBasketItem.Id = "BI102";
secondBasketItem.Name = "Game code";
secondBasketItem.Category1 = "Game";
secondBasketItem.Category2 = "Online Game Items";
secondBasketItem.ItemType = BasketItemType.VIRTUAL.ToString();
secondBasketItem.Price = "0.5";
basketItems.Add(secondBasketItem);

BasketItem thirdBasketItem = new BasketItem();
thirdBasketItem.Id = "BI103";
thirdBasketItem.Name = "Usb";
thirdBasketItem.Category1 = "Electronics";
thirdBasketItem.Category2 = "Usb / Cable";
thirdBasketItem.ItemType = BasketItemType.PHYSICAL.ToString();
thirdBasketItem.Price = "0.2";
basketItems.Add(thirdBasketItem);
request.BasketItems = basketItems;

ThreedsInitialize threedsInitialize = ThreedsInitialize.Create(request, options);
CreatePaymentRequest request = new CreatePaymentRequest();
request.setLocale(Locale.TR.getValue());
request.setConversationId("123456789");
request.setPrice(new BigDecimal("1"));
request.setPaidPrice(new BigDecimal("1.2"));
request.setCurrency(Currency.TRY.name());
request.setInstallment(1);
request.setBasketId("B67832");
request.setPaymentChannel(PaymentChannel.WEB.name());
request.setPaymentGroup(PaymentGroup.PRODUCT.name());
request.setCallbackUrl("https://www.merchant.com/callback");

PaymentCard paymentCard = new PaymentCard();
paymentCard.setCardHolderName("John Doe");
paymentCard.setCardNumber("5528790000000008");
paymentCard.setExpireMonth("12");
paymentCard.setExpireYear("2030");
paymentCard.setCvc("123");
paymentCard.setRegisterCard(0);
request.setPaymentCard(paymentCard);

Buyer buyer = new Buyer();
buyer.setId("BY789");
buyer.setName("John");
buyer.setSurname("Doe");
buyer.setGsmNumber("+905350000000");
buyer.setEmail("email@email.com");
buyer.setIdentityNumber("74300864791");
buyer.setLastLoginDate("2015-10-05 12:43:35");
buyer.setRegistrationDate("2013-04-21 15:12:09");
buyer.setRegistrationAddress("Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1");
buyer.setIp("85.34.78.112");
buyer.setCity("Istanbul");
buyer.setCountry("Turkey");
buyer.setZipCode("34732");
request.setBuyer(buyer);

Address shippingAddress = new Address();
shippingAddress.setContactName("Jane Doe");
shippingAddress.setCity("Istanbul");
shippingAddress.setCountry("Turkey");
shippingAddress.setAddress("Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1");
shippingAddress.setZipCode("34742");
request.setShippingAddress(shippingAddress);

Address billingAddress = new Address();
billingAddress.setContactName("Jane Doe");
billingAddress.setCity("Istanbul");
billingAddress.setCountry("Turkey");
billingAddress.setAddress("Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1");
billingAddress.setZipCode("34742");
request.setBillingAddress(billingAddress);

List<BasketItem> basketItems = new ArrayList<BasketItem>();
BasketItem firstBasketItem = new BasketItem();
firstBasketItem.setId("BI101");
firstBasketItem.setName("Binocular");
firstBasketItem.setCategory1("Collectibles");
firstBasketItem.setCategory2("Accessories");
firstBasketItem.setItemType(BasketItemType.PHYSICAL.name());
firstBasketItem.setPrice(new BigDecimal("0.3"));
basketItems.add(firstBasketItem);

BasketItem secondBasketItem = new BasketItem();
secondBasketItem.setId("BI102");
secondBasketItem.setName("Game code");
secondBasketItem.setCategory1("Game");
secondBasketItem.setCategory2("Online Game Items");
secondBasketItem.setItemType(BasketItemType.VIRTUAL.name());
secondBasketItem.setPrice(new BigDecimal("0.5"));
basketItems.add(secondBasketItem);

BasketItem thirdBasketItem = new BasketItem();
thirdBasketItem.setId("BI103");
thirdBasketItem.setName("Usb");
thirdBasketItem.setCategory1("Electronics");
thirdBasketItem.setCategory2("Usb / Cable");
thirdBasketItem.setItemType(BasketItemType.PHYSICAL.name());
thirdBasketItem.setPrice(new BigDecimal("0.2"));
basketItems.add(thirdBasketItem);
request.setBasketItems(basketItems);

ThreedsInitialize threedsInitialize = ThreedsInitialize.create(request, options);
var request = {
    locale: Iyzipay.LOCALE.TR,
    conversationId: '123456789',
    price: '1',
    paidPrice: '1.2',
    currency: Iyzipay.CURRENCY.TRY,
    installment: '1',
    basketId: 'B67832',
    paymentChannel: Iyzipay.PAYMENT_CHANNEL.WEB,
    paymentGroup: Iyzipay.PAYMENT_GROUP.PRODUCT,
    callbackUrl: 'https://www.merchant.com/callback',
    paymentCard: {
        cardHolderName: 'John Doe',
        cardNumber: '5528790000000008',
        expireMonth: '12',
        expireYear: '2030',
        cvc: '123',
        registerCard: '0'
    },
    buyer: {
        id: 'BY789',
        name: 'John',
        surname: 'Doe',
        gsmNumber: '+905350000000',
        email: 'email@email.com',
        identityNumber: '74300864791',
        lastLoginDate: '2015-10-05 12:43:35',
        registrationDate: '2013-04-21 15:12:09',
        registrationAddress: 'Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1',
        ip: '85.34.78.112',
        city: 'Istanbul',
        country: 'Turkey',
        zipCode: '34732'
    },
    shippingAddress: {
        contactName: 'Jane Doe',
        city: 'Istanbul',
        country: 'Turkey',
        address: 'Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1',
        zipCode: '34742'
    },
    billingAddress: {
        contactName: 'Jane Doe',
        city: 'Istanbul',
        country: 'Turkey',
        address: 'Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1',
        zipCode: '34742'
    },
    basketItems: [
        {
            id: 'BI101',
            name: 'Binocular',
            category1: 'Collectibles',
            category2: 'Accessories',
            itemType: Iyzipay.BASKET_ITEM_TYPE.PHYSICAL,
            price: '0.3'
        },
        {
            id: 'BI102',
            name: 'Game code',
            category1: 'Game',
            category2: 'Online Game Items',
            itemType: Iyzipay.BASKET_ITEM_TYPE.VIRTUAL,
            price: '0.5'
        },
        {
            id: 'BI103',
            name: 'Usb',
            category1: 'Electronics',
            category2: 'Usb / Cable',
            itemType: Iyzipay.BASKET_ITEM_TYPE.PHYSICAL,
            price: '0.2'
        }
    ]
};

iyzipay.threedsInitialize.create(request, function (err, result) {
    console.log(err, result);
    done();
});
payment_card = {
    cardHolderName: 'John Doe',
    cardNumber: '5528790000000008',
    expireYear: '2030',
    expireMonth: '12',
    cvc: '123',
    registerCard: 0
}
buyer = {
    id: 'BY789',
    name: 'John',
    surname: 'Doe',
    identityNumber: '74300864791',
    email: 'email@email.com',
    gsmNumber: '+905350000000',
    registrationDate: '2013-04-21 15:12:09',
    lastLoginDate: '2015-10-05 12:43:35',
    registrationAddress: 'Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1',
    city: 'Istanbul',
    country: 'Turkey',
    zipCode: '34732',
    ip: '85.34.78.112'
}
address = {
    address: 'Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1',
    zipCode: '34732',
    contactName: 'John Doe',
    city: 'Istanbul',
    country: 'Turkey'
}

item1 = {
    id: 'BI101',
    name: 'Binocular',
    category1: 'Collectibles',
    category2: 'Accessories',
    itemType: Iyzipay::Model::BasketItemType::PHYSICAL,
    price: '0.3',
}
item2 = {
    id: 'BI102',
    name: 'Game code',
    category1: 'Game',
    category2: 'Online Game Items',
    itemType: Iyzipay::Model::BasketItemType::VIRTUAL,
    price: '0.5',
}
item3 = {
    id: 'BI103',
    name: 'Usb',
    category1: 'Electronics',
    category2: 'Usb / Cable',
    itemType: Iyzipay::Model::BasketItemType::PHYSICAL,
    price: '0.2',
}
request = {
    locale: 'tr',
    conversationId: '123456789',
    price: '1.0',
    paidPrice: '1.1',
    installment: 1,
    paymentChannel: Iyzipay::Model::PaymentChannel::WEB,
    basketId: 'B67832',
    paymentGroup: Iyzipay::Model::PaymentGroup::PRODUCT,
    callbackUrl: 'https://www.merchant.com/callback',
    currency: Iyzipay::Model::Currency::TRY,
    paymentCard: payment_card,
    buyer: buyer,
    billingAddress: address,
    shippingAddress: address,
    basketItems: [item1, item2, item3]
}
threeds_initialize = Iyzipay::Model::ThreedsInitialize.new.create(request, @options)
request = dict([('locale', 'tr')])
request['conversationId'] = '123456789'
request['price'] = '1'
request['paidPrice'] = '1.1'
request['installment'] = '1'
request['basketId'] = 'B67832'
request['paymentChannel'] = 'WEB'
request['paymentGroup'] = 'PRODUCT'
request['callbackUrl'] = 'https://www.merchant.com/callback'
request['currency'] = 'TRY'

payment_card = dict([('cardHolderName', 'John Doe')])
payment_card['cardNumber'] = '5528790000000008'
payment_card['expireMonth'] = '12'
payment_card['expireYear'] = '2030'
payment_card['cvc'] = '123'
payment_card['registerCard'] = '0'
request['paymentCard'] = payment_card

buyer = dict([('id', 'BY789')])
buyer['name'] = 'John'
buyer['surname'] = 'Doe'
buyer['gsmNumber'] = '+905350000000'
buyer['email'] = 'email@email.com'
buyer['identityNumber'] = '74300864791'
buyer['lastLoginDate'] = '2015-10-05 12:43:35'
buyer['registrationDate'] = '2013-04-21 15:12:09'
buyer['registrationAddress'] = 'Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1'
buyer['ip'] = '85.34.78.112'
buyer['city'] = 'Istanbul'
buyer['country'] = 'Turkey'
buyer['zipCode'] = '34732'
request['buyer'] = buyer

address = dict([('address', 'Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1')])
address['zipCode'] = '34732'
address['contactName'] = 'Jane Doe'
address['city'] = 'Istanbul'
address['country'] = 'Turkey'
request['shippingAddress'] = address
request['billingAddress'] = address

basket_items = []
basket_item_first = dict([('id', 'BI101')])
basket_item_first['name'] = 'Binocular'
basket_item_first['category1'] = 'Collectibles'
basket_item_first['category2'] = 'Accessories'
basket_item_first['itemType'] = 'PHYSICAL'
basket_item_first['price'] = '0.3'
basket_item_first['subMerchantKey'] = 'sub merchant key'
basket_item_first['subMerchantPrice'] = '0.27'
basket_items.append(basket_item_first)

basket_item_second = dict([('id', 'BI102')])
basket_item_second['name'] = 'Game code'
basket_item_second['category1'] = 'Game'
basket_item_second['category2'] = 'Online Game Items'
basket_item_second['itemType'] = 'VIRTUAL'
basket_item_second['price'] = '0.5'
basket_item_second['subMerchantKey'] = 'sub merchant key'
basket_item_second['subMerchantPrice'] = '0.42'
basket_items.append(basket_item_second)

basket_item_third = dict([('id', 'BI103')])
basket_item_third['name'] = 'Usb'
basket_item_third['category1'] = 'Electronics'
basket_item_third['category2'] = 'Usb / Cable'
basket_item_third['itemType'] = 'PHYSICAL'
basket_item_third['price'] = '0.2'
basket_item_third['subMerchantKey'] = 'sub merchant key'
basket_item_third['subMerchantPrice'] = '0.18'
basket_items.append(basket_item_third)

request['basketItems'] = basket_items

three_d_s_initialize = iyzipay.ThreeDSInitialize()
three_d_s_initialize_response = three_d_s_initialize.create(request, options)
//Request
 {
    "locale": "tr",
    "conversationId": "123456789",
    "price": "1.0",
    "paidPrice": "1.2",
    "installment": 1,
    "paymentChannel": "WEB",
    "basketId": "B67832",
    "paymentGroup": "PRODUCT",
    "paymentCard": {
        "cardHolderName": "John Doe",
        "cardNumber": "5528790000000008",
        "expireYear": "2030",
        "expireMonth": "12",
        "cvc": "123"
    },
    "buyer": {
        "id": "BY789",
        "name": "John",
        "surname": "Doe",
        "identityNumber": "74300864791",
        "email": "email@email.com",
        "gsmNumber": "+905350000000",
        "registrationDate": "2013-04-21 15:12:09",
        "lastLoginDate": "2015-10-05 12:43:35",
        "registrationAddress": "Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1",
        "city": "Istanbul",
        "country": "Turkey",
        "zipCode": "34732",
        "ip": "85.34.78.112"
    },
    "shippingAddress": {
        "address": "Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1",
        "zipCode": "34742",
        "contactName": "Jane Doe",
        "city": "Istanbul",
        "country": "Turkey"
    },
    "billingAddress": {
        "address": "Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1",
        "zipCode": "34742",
        "contactName": "Jane Doe",
        "city": "Istanbul",
        "country": "Turkey"
    },
    "basketItems": [
        {
            "id": "BI101",
            "price": "0.3",
            "name": "Binocular",
            "category1": "Collectibles",
            "category2": "Accessories",
            "itemType": "PHYSICAL"
        },
        {
            "id": "BI102",
            "price": "0.5",
            "name": "Game code",
            "category1": "Game",
            "category2": "Online Game Items",
            "itemType": "VIRTUAL"
        },
        {
            "id": "BI103",
            "price": "0.2",
            "name": "Usb",
            "category1": "Electronics",
            "category2": "Usb / Cable",
            "itemType": "PHYSICAL"
        }
    ],
    "currency": "TRY",
    "callbackUrl": "https://www.merchant.com/callback"
}

//Response
{
    "status": "success",
    "locale": "tr",
    "systemTime": 1475507060559,
    "conversationId": "123456789",
    "threeDSHtmlContent": "PCFkb2N0eXBlIGh0bWw+CjxodG1sIGxhbmc9ImVuIj4KPGhlYWQ+C
    iAgICA8dGl0bGU+aXl6aWNvIE1vY2sgM0QtU2VjdXJlIFByb2Nlc3NpbmcgUGFnZTwvdGl0bGU+Cj
    wvaGVhZD4KPGJvZHk+Cjxmb3JtIGlkPSJpeXppY28tM2RzLWZvcm0iIGFjdGlvbj0iaHR0cHM6Ly9
    zYW5kYm94LWFwaS5peXppcGF5LmNvbS9wYXltZW50L21vY2svaW5pdDNkcyIgbWV0aG9kPSJwb3N0
    Ij4KICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIG5hbWU9Im9yZGVySWQiIHZhbHVlPSJtb2NrNDYtMj
    E0MTFpeXppb3JkIj4KICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIG5hbWU9ImJpbiIgdmFsdWU9IjU
    1Mjg3OSI+CiAgICA8aW5wdXQgdHlwZT0iaGlkZGVuIiBuYW1lPSJzdWNjZXNzVXJsIiB2YWx1ZT0
    iaHR0cHM6Ly9zYW5kYm94LWFwaS5peXppcGF5LmNvbS9wYXltZW50L2l5emlwb3MvY2FsbGJhY2
    szZHMvc3VjY2Vzcy8yNyI+CiAgICA8aW5wdXQgdHlwZT0iaGlkZGVuIiBuYW1lPSJmYWlsdXJlVX
    JsIiB2YWx1ZT0iaHR0cHM6Ly9zYW5kYm94LWFwaS5peXppcGF5LmNvbS9wYXltZW50L2l5emlwb3
    MvY2FsbGJhY2szZHMvZmFpbHVyZS8yNyI+CiAgICA8aW5wdXQgdHlwZT0iaGlkZGVuIiBuYW1lPS
    Jjb25maXJtYXRpb25VcmwiIHZhbHVlPSJodHRwczovL3NhbmRib3gtYXBpLml5emlwYXkuY29tL3
    BheW1lbnQvbW9jay9jb25maXJtM2RzIj4KICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIG5hbWU9IlB
    hUmVxIiB2YWx1ZT0iYzU1ZmM5NzctNzVmNC00MDM4LWFjMzgtYzQ1YTg5OGZmNzI4Ij4KPC9mb3J
    tPgo8c2NyaXB0IHR5cGU9InRleHQvamF2YXNjcmlwdCI+CiAgICBkb2N1bWVudC5nZXRFbGVtZW50Q
    nlJZCgiaXl6aWNvLTNkcy1mb3JtIikuc3VibWl0KCk7Cjwvc2NyaXB0Pgo8L2JvZHk+CjwvaHRtbD4="
}

Callback Post
Input Name Type Description
status String Service response result (success / failure)
paymentId String If verification is successful, iyzico will return a paymentid. It must be set in Auth request
conversationData String If verification is successful, iyzico might return. If returns, it must be set in Auth request
conversationId Long If set, conversation ID to match request and response
mdStatus String 1 for successful payment, 0,2,3,4,5,6,7,8 for failure payments

mdStatus
mdStatus Description
mdStatus = 0 Invalid 3D Secure signature or verification
mdStatus = 2 Card holder or Issuer not registered to 3D Secure network
mdStatus = 3 Issuer is not registered to 3D secure network
mdStatus = 4 Verification is not possible, card holder chosen to register later on system
mdStatus = 5 Verification is not possbile
mdStatus = 6 3D Secure error
mdStatus = 7 System error
mdStatus = 8 Unknown card

Auth Request
Input Name Type Mandatory Description
locale String No Language (default: tr)
conversationId String No Conversation ID to match request and response
paymentId string evet ID of the payment. Merchants should keep payment ID in their system (this ID will be used for cancel requests)
conversationData string hayır 3D dönüş bağlantı adresinizden alacağınız conversationData değeridir. Bu parametre bir değer ile dönüş yapmış ise 3D ödeme sorgusunda eklenmelidir.

Auth Response

Parameters to be returned from the service are as follows:

Output Name Type Description
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 Long Response system timestamp value
conversationId String If set, conversation ID to match request and response
paymentId String ID of the payment. Merchants should keep payment ID in their system (this ID will be used for cancel requests)
price Decimal Total amount of basket. The sum of basket items’ amount must be equal to the price of basket
paidPrice Decimal Final amount (including installment fee) that will be charged to customer’s card. Merchants should store this value in their system
currency String Currency of request
installment Integer Installment number of payment, for single payments it returns 1. Valid values are 1, 2, 3, 6, 9, 12
basketId String Merchant's basket ID
binNumber String First 6 digit of card
cardAssociation String Valid values are VISA, MASTER_CARD, AMERICAN_EXPRESS, TROY
cardFamily String Valid values are Bonus, Axess, World, Maximum, Paraf, CardFinans, Advantage
cardType String Valid values are CREDIT_CARD, DEBIT_CARD, PREPAID_CARD
fraudStatus Integer Fraud risk status for payment request (0 for review / 1 for accept)
iyziCommissionFee Decimal iyzico commission fee for payment transaction
iyziCommissionRateAmount Decimal iyzico commission rate amount for payment transaction
merchantCommissionRate Decimal Merchant commission rate (e.g. price=100 & paidPrice=110, then merchant commission rate = 10)
merchantCommissionRateAmount Decimal Merchant commission rate amount (e.g. price=100 & paidPrice=110, then merchant commission rate amount = 10)
paymentTransactionId (ItemTransactions) String ID of basket item. Merchants should keep payment ID in their system (this ID will be used for cancel requests)
itemId(ItemTransactions) String Item ID of each item in basket
price(ItemTransactions) Decimal Item price of each item in basket
paidPrice(ItemTransactions) Decimal Captured amount from card based on each item. Merchants should keep paidPrice in their system
transactionStatus (ItemTransactions) Integer Status of a payment transaction. (0 for waiting / -1 for rejected by fraud / 1 for waiting for approval / 2 for approved
blockageRate(ItemTransactions) Decimal Blockage rate based on each item.
blockageRateAmountMerchant(ItemTransactions) Decimal Blockage rate amount for merchant based on each item
blockageResolvedDate(ItemTransactions) String Blockage resolve date based on each item. Date format should be “2015-10-19 14:36:52”
iyziCommissionFee(ItemTransactions) Decimal iyzico commission fee based on each item
iyziCommissionRateAmount(ItemTransactions) Decimal iyzico commission rate amount based on each item
merchantCommissionRate(ItemTransactions) Decimal Merchant commission rate (e.g. price=100 & paidPrice=110, then merchant commission rate = 10)
merchantCommissionRateAmount(ItemTransactions) Decimal Merchant commission rate amount (e.g. price=100 & paidPrice=110, then merchant commission rate amount = 10)
merchantPayoutAmount(ItemTransactions) Decimal Payout amount for each item transaction. This is the amount that remains after after substracting iyzicoCommissionRateAmount, iyzicoCommissionFee and blockageRateAmountMerchant from paidPrice(ItemTransactions)
paidPrice(ItemTransactions)(convertedPayout) Decimal Converted charged amount to card based on each item. Merchants should keep paidPrice in their system.
iyziCommissionFee(ItemTransactions)(convertedPayout) Decimal Converted iyzico commission fee based on each item
iyziCommissionRateAmount(ItemTransactions)(convertedPayout) Decimal Converted iyzico commission rate amount based on each item
blockageRateAmountMerchant(ItemTransactions)(convertedPayout) Decimal Converted blockage rate amount for merchant based on each item
merchantPayoutAmount(ItemTransactions)(convertedPayout) Decimal Converted payout amount for each item transaction. This the amount that remains after substracting iyzicoCommissionRateAmount, iyzicoCommissionFee and blockageRateAmountMerchant from paidPrice(ItemTransactions)
iyziConversationRate(ItemTransactions)(convertedPayout) Decimal iyzico conversation rate
iyziConversationRateAmount(ItemTransactions)(convertedPayout) Decimal iyzico conversation rate amount
currency(ItemTransactions)(convertedPayout) String Currency for payout conversion

Sample Codes

Sample codes that can be found in iyzico clients:

$request = new \Iyzipay\Request\CreateThreedsPaymentRequest();
$request->setLocale(\Iyzipay\Model\Locale::TR);
$request->setConversationId("123456789");
$request->setPaymentId("1");
$request->setConversationData("conversation data");

$threedsPayment = \Iyzipay\Model\ThreedsPayment::create($request, Config::options());
CreateThreedsPaymentRequest request = new CreateThreedsPaymentRequest();
request.Locale = Locale.TR.ToString();
request.ConversationId = "123456789";
request.PaymentId = "1";
request.ConversationData = "conversation data";

ThreedsPayment threedsPayment = ThreedsPayment.Create(request, options);
CreateThreedsPaymentRequest request = new CreateThreedsPaymentRequest();
request.setLocale(Locale.TR.getValue());
request.setConversationId("123456789");
request.setPaymentId("1");
request.setConversationData("conversation data");

ThreedsPayment threedsPayment = ThreedsPayment.create(request, options);
iyzipay.threedsPayment.create({
    conversationId: '123456789',
    locale: Iyzipay.LOCALE.TR,
    paymentId: '1',
    conversationData: 'conversation data'
}, function (err, result) {
    console.log(err, result);
    done();
});
request = {
    locale: 'tr',
    conversationId: '123456789',
    paymentId: '1',
    conversationData: 'conversation data',
}
threeds_payment = Iyzipay::Model::ThreedsPayment.new.create(request, @options)
request = dict([('locale', 'tr')])
request['conversationId'] = '123456789'
request['paymentId'] = '1'
request['conversationData'] = 'conversation data'

three_d_s_auth = iyzipay.ThreeDSAuth()
three_d_s_auth_response = three_d_s_auth.create(request, options)
//Request
  {
    "locale": "tr",
    "conversationId": "123456789",
    "paymentId": "26132",
    "conversationData": ""
}
//Response
{
    "status": "success",
    "locale": "tr",
    "systemTime": 1470728762958,
    "conversationId": "123456789",
    "price": 1,
    "paidPrice": 1.1,
    "installment": 1,
    "paymentId": "26132",
    "fraudStatus": 1,
    "merchantCommissionRate": 10,
    "merchantCommissionRateAmount": 0.1,
    "iyziCommissionRateAmount": 0.03245,
    "iyziCommissionFee": 0.25,
    "cardType": "CREDIT_CARD",
    "cardAssociation": "MASTER_CARD",
    "cardFamily": "Paraf",
    "binNumber": "552879",
    "basketId": "B67832",
    "currency": "TRY",
    "itemTransactions": [
        {
            "itemId": "BI101",
            "paymentTransactionId": "38211",
            "transactionStatus": 2,
            "price": 0.3,
            "paidPrice": 0.33,
            "merchantCommissionRate": 10,
            "merchantCommissionRateAmount": 0.03,
            "iyziCommissionRateAmount": 0.009735,
            "iyziCommissionFee": 0.075,
            "blockageRate": 10,
            "blockageRateAmountMerchant": 0.033,
            "blockageRateAmountSubMerchant": 0,
            "blockageResolvedDate": "2016-08-16 10:46:02",
            "subMerchantPrice": 0,
            "subMerchantPayoutRate": 0,
            "subMerchantPayoutAmount": 0,
            "merchantPayoutAmount": 0.212265,
            "convertedPayout": {
                "paidPrice": 0.33,
                "iyziCommissionRateAmount": 0.009735,
                "iyziCommissionFee": 0.075,
                "blockageRateAmountMerchant": 0.033,
                "blockageRateAmountSubMerchant": 0,
                "subMerchantPayoutAmount": 0,
                "merchantPayoutAmount": 0.212265,
                "iyziConversionRate": 0,
                "iyziConversionRateAmount": 0,
                "currency": "TRY"
            }
        },
        {
            "itemId": "BI102",
            "paymentTransactionId": "38212",
            "transactionStatus": 2,
            "price": 0.5,
            "paidPrice": 0.55,
            "merchantCommissionRate": 10,
            "merchantCommissionRateAmount": 0.05,
            "iyziCommissionRateAmount": 0.016225,
            "iyziCommissionFee": 0.125,
            "blockageRate": 10,
            "blockageRateAmountMerchant": 0.055,
            "blockageRateAmountSubMerchant": 0,
            "blockageResolvedDate": "2016-08-16 10:46:02",
            "subMerchantPrice": 0,
            "subMerchantPayoutRate": 0,
            "subMerchantPayoutAmount": 0,
            "merchantPayoutAmount": 0.353775,
            "convertedPayout": {
                "paidPrice": 0.55,
                "iyziCommissionRateAmount": 0.016225,
                "iyziCommissionFee": 0.125,
                "blockageRateAmountMerchant": 0.055,
                "blockageRateAmountSubMerchant": 0,
                "subMerchantPayoutAmount": 0,
                "merchantPayoutAmount": 0.353775,
                "iyziConversionRate": 0,
                "iyziConversionRateAmount": 0,
                "currency": "TRY"
            }
        },
        {
            "itemId": "BI103",
            "paymentTransactionId": "38213",
            "transactionStatus": 2,
            "price": 0.2,
            "paidPrice": 0.22,
            "merchantCommissionRate": 10,
            "merchantCommissionRateAmount": 0.02,
            "iyziCommissionRateAmount": 0.00649,
            "iyziCommissionFee": 0.05,
            "blockageRate": 10,
            "blockageRateAmountMerchant": 0.022,
            "blockageRateAmountSubMerchant": 0,
            "blockageResolvedDate": "2016-08-16 10:46:02",
            "subMerchantPrice": 0,
            "subMerchantPayoutRate": 0,
            "subMerchantPayoutAmount": 0,
            "merchantPayoutAmount": 0.14151,
            "convertedPayout": {
                "paidPrice": 0.22,
                "iyziCommissionRateAmount": 0.00649,
                "iyziCommissionFee": 0.05,
                "blockageRateAmountMerchant": 0.022,
                "blockageRateAmountSubMerchant": 0,
                "subMerchantPayoutAmount": 0,
                "merchantPayoutAmount": 0.14151,
                "iyziConversionRate": 0,
                "iyziConversionRateAmount": 0,
                "currency": "TRY"
            }
        }
    ]
}

Questions

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