Auth

To charge a credit or a debit card, you can use an Auth request.

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
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
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

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

Error Codes

Error codes that iyzico can return from acquirers:

errorCode errorMessage errorGroup
10051 Insufficient funds NOT_SUFFICIENT_FUNDS
10005 Operation not approved DO_NOT_HONOUR
10012 Invalid transaction INVALID_TRANSACTION
10041 Lost card LOST_CARD
10043 Stolen card STOLEN_CARD
10054 Expired card EXPIRED_CARD
10084 Invalid CVC2 INVALID_CVC2
10057 Operation not permitted to card holder NOT_PERMITTED_TO_CARDHOLDER
10058 Operation not permitted to terminal NOT_PERMITTED_TO_TERMINAL
10034 Fraud suspect FRAUD_SUSPECT
10093 Card is restricted for e-commerce transaction. Please contact your bank. RESTRICTED_BY_LAW
10201 Operation not permitted by card CARD_NOT_PERMITTED
10202 An error occurred while processing payment UNKNOWN
10203 Approval operation is completed APPROVED_COMPLETED
10204 An error occurred while processing payment UNKNOWN
10205 Invalid Email format INVALID_CHARS_IN_EMAIL
10206 Invalid CVC length INVALID_CVC2_LENGTH
10207 Need to receive approval by bank REFER_TO_CARD_ISSUER
10208 Invalid bank merchant category INVALID_MERCHANT_OR_SP
10209 Blocked card BLOCKED_CARD
10210 Invalid CAVV INVALID_CAVV
10211 Invalid ECI INVALID_ECI
10212 CVC max attempts exceeded CVC2_MAX_ATTEMPT
10213 Bin is not found BIN_NOT_FOUND
10214 Communication or system error COMMUNICATION_OR_SYSTEM_ERROR
10215 Invalid card number INVALID_CARD_NUMBER
10216 Issuer not found NO_SUCH_ISSUER
10217 Debit cards require 3D-Secure DEBIT_CARDS_REQUIRES_3DS
10218 Installments not allowed for debit cards DEBIT_CARDS_INSTALLMENT_NOT_ALLOWED
10219 Request timeout REQUEST_TIMEOUT
10220 Payment declined DECLINED
10221 Foreign cards not allowed for the terminal NOT_PERMITTED_TO_FOREIGN_CARD
10222 Installment option not allowed for the terminal NOT_PERMITTED_TO_INSTALLMENT
10223 Requires day end REQUIRES_DAY_END
10224 Withdrawal amount limit is exceeded EXCEEDS_WITHDRAWAL_AMOUNT_LIMIT
10225 Restricted card RESTRICTED_CARD
10226 Max PIN tries exceeded EXCEEDS_ALLOWABLE_PIN_TRIES
10227 Invalid PIN INVALID_PIN
10228 Bank or terminal is not processing operation ISSUER_OR_SWITCH_INOPERATIVE
10229 Expiration year or month is invalid INVALID_EXPIRE_YEAR_MONTH
10230 Request blocked by bank REQUEST_BLOCKED_BY_BANK
10231 Paid price is not be less than reward price SALES_AMOUNT_LESS_THAN_AWARD
10232 Invalid amount INVALID_AMOUNT
10233 Invalid card type INVALID_CARD_TYPE
10234 Not sufficient award NOT_SUFFICIENT_AWARD
10235 American express card related error AMEX_CAN_USE_ONLY_MR
10236 An error occurred while processing payment UNKNOWN
10237 Refund not allowed for this debit card REFUND_NOT_ALLOWED_FOR_THIS_DEBIT_CARD

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);
$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);

$payment = \Iyzipay\Model\Payment::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();

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;

Payment payment = Payment.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());

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);

Payment payment = Payment.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,
    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.payment.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,
    currency: Iyzipay::Model::Currency::TRY,
    paymentCard: payment_card,
    buyer: buyer,
    billingAddress: address,
    shippingAddress: address,
    basketItems: [item1, item2, item3]
}
payment = Iyzipay::Model::Payment.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_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_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_items.append(basket_item_third)

request['basketItems'] = basket_items

# make request
payment_auth = iyzipay.PaymentAuth()
payment_auth_response = payment_auth.create(request, options)
//Request
   {
    "locale": "tr",
    "conversationId": "123456789",
    "price": "1.0",
    "paidPrice": "1.1",
    "installment": 1,
    "paymentChannel": "WEB",
    "basketId": "B67832",
    "paymentGroup": "PRODUCT",
    "paymentCard": {
        "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"
    },
    "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"
}
//Response
{
    "status": "success",
    "locale": "tr",
    "systemTime": 1470727638093,
    "conversationId": "123456789",
    "price": 1,
    "paidPrice": 1.1,
    "installment": 1,
    "paymentId": "26130",
    "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": "38208",
            "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:27:18",
            "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": "38209",
            "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:27:18",
            "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": "38210",
            "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:27:18",
            "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.