# Online Payment

Marketplace product offer multiple online payment methods. Followings are 4 different payment methods;

### Payment Method Decision

<table data-card-size="large" data-view="cards"><thead><tr><th data-type="content-ref"></th></tr></thead><tbody><tr><td><a href="../../../payment-methods/api/non-3ds">non-3ds</a></td></tr><tr><td><a href="../../../payment-methods/api/3ds">3ds</a></td></tr><tr><td><a href="../../../payment-methods/checkoutform">checkoutform</a></td></tr><tr><td><a href="../../../payment-methods/paywithiyzico">paywithiyzico</a></td></tr></tbody></table>

{% hint style="info" %}
If you also wish to sell as a submerchant or a marketplace owner, there are two methods available:

1. Either create a submerchant under your account and assign yourself to this submerchant as well as your products.
2. If you prefer to sell without creating a submerchant, you can use the `paymentGroup` parameter with the value `LISTING`. (Please note that when using this approach, the subMerchantKey parameter cannot be utilized.)
   {% endhint %}

After choosing one of the four payment types, you will need to include two additional parameters: **subMerchantKey** and **subMerchantPrice**. It is essential to assign these parameters to each product in the payment request.

<table><thead><tr><th width="194">Input Name</th><th width="77">Type</th><th width="115">Require</th><th>Description</th></tr></thead><tbody><tr><td><strong>subMerchantKey</strong></td><td>string</td><td>yes</td><td>Returned value from submerchant create request</td></tr><tr><td><strong>subMerchantPrice</strong></td><td>string</td><td>yes</td><td>Amount that needs to be transferred for sub merchant</td></tr></tbody></table>

## Marketplace Payment (Non3D)

> Example shows the \*\*Non3D\*\* method. In a marketplace flow, each basket split \*\*must\*\*\
> include sub-merchant fields.<br>

```json
{"openapi":"3.0.3","info":{"title":"Non3D Payment (Marketplace)","version":"1.0.4"},"servers":[{"url":"https://api.iyzipay.com","description":"iyzico API"}],"paths":{"/payment/auth":{"post":{"summary":"Marketplace Payment (Non3D)","description":"Example shows the **Non3D** method. In a marketplace flow, each basket split **must**\ninclude sub-merchant fields.\n","tags":["Payment Methods"],"parameters":[{"$ref":"#/components/parameters/AuthHeader"},{"$ref":"#/components/parameters/ContentTypeHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Non3DMarketplaceRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Non3DMarketplaceResponse"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"parameters":{"AuthHeader":{"name":"Authorization","in":"header","required":true,"description":"Authorization header; a signed hash value that starts with **IYZWSv2** and is generated in Base64 format.","schema":{"type":"string"}},"ContentTypeHeader":{"name":"Content-Type","in":"header","required":true,"description":"Request body content type.","schema":{"type":"string","enum":["application/json"]}}},"schemas":{"Non3DMarketplaceRequest":{"type":"object","required":["price","paidPrice","shippingAddress","billingAddress","paymentCard","basketItems","buyer"],"description":"Non3D payment request. In the marketplace model, each basket split **must** include\nsub-merchant fields.\n","properties":{"locale":{"type":"string","enum":["tr","en"],"description":"Response language."},"conversationId":{"type":"string","description":"Correlation value that is echoed back in the response."},"price":{"type":"decimal","description":"Basket (cart) total. **Sum of basket item prices must equal `price`.**"},"paidPrice":{"type":"decimal","description":"Final amount to be charged at POS; can be less than, greater than, or equal to `price`."},"currency":{"type":"string","enum":["TRY","USD","EUR","GBP"],"description":"Payment currency (default TRY)."},"installment":{"type":"integer","enum":[1,2,3,6,9,12],"description":"Installment count. Default; 1"},"paymentChannel":{"type":"string","enum":["WEB","MOBILE","MOBILE_WEB","MOBILE_IOS","MOBILE_ANDROID","MOBILE_WINDOWS","MOBILE_TABLET","MOBILE_PHONE"],"description":"Payment channel. Default; \"WEB\""},"basketId":{"type":"string","description":"Basket/order identifier on the merchant side."},"paymentGroup":{"type":"string","enum":["PRODUCT","LISTING","SUBSCRIPTION","OTHER"],"description":"Payment group."},"paymentCard":{"type":"object","required":["cardHolderName","cardNumber","expireMonth","expireYear","cvc"],"description":"Card details.","properties":{"cardHolderName":{"type":"string","description":"Name on card."},"cardNumber":{"type":"string","description":"PAN."},"expireYear":{"type":"string","description":"Expiration year (YYYY)."},"expireMonth":{"type":"string","description":"Expiration month (MM)."},"cvc":{"type":"string","description":"Security code."},"registerCard":{"type":"integer","enum":[0,1],"description":"Send 1 to store the card (card storage feature must be enabled)."}}},"buyer":{"type":"object","description":"Buyer information.","required":["id","name","surname","identityNumber","email","gsmNumber","registrationAddress","city","country"],"properties":{"id":{"type":"string","description":"Merchant-side user ID."},"name":{"type":"string","description":"First name."},"surname":{"type":"string","description":"Last name."},"identityNumber":{"type":"string","description":"National ID (TR)."},"email":{"type":"string","description":"Email."},"gsmNumber":{"type":"string","description":"GSM number (prefer E.164)."},"registrationDate":{"type":"string","description":"Registration date."},"lastLoginDate":{"type":"string","description":"Last login date."},"registrationAddress":{"type":"string","description":"Registration address."},"city":{"type":"string","description":"City."},"country":{"type":"string","description":"Country."},"zipCode":{"type":"string","description":"ZIP/Postal code."},"ip":{"type":"string","description":"Client IP address."}}},"shippingAddress":{"$ref":"#/components/schemas/Address"},"billingAddress":{"$ref":"#/components/schemas/BillingAddress"},"basketItems":{"type":"array","minItems":1,"description":"Basket items. **For marketplace**, sub-merchant fields are required.","items":{"$ref":"#/components/schemas/BasketItemMarketplace"}}}},"Address":{"type":"object","description":"Shipping Address. Required if at least one basket item has itemType = \"PHYSICAL\". Not required if all items are \"VIRTUAL\".\n","required":["address","contactName","city","country"],"properties":{"address":{"type":"string","description":"Full address."},"zipCode":{"type":"string","description":"ZIP/Postal code."},"contactName":{"type":"string","description":"Contact name."},"city":{"type":"string","description":"City."},"country":{"type":"string","description":"Country."}}},"BillingAddress":{"type":"object","description":"Billing Address.","required":["address","contactName","city","country"],"properties":{"address":{"type":"string","description":"Full address."},"zipCode":{"type":"string","description":"ZIP/Postal code."},"contactName":{"type":"string","description":"Contact name."},"city":{"type":"string","description":"City."},"country":{"type":"string","description":"Country."}}},"BasketItemMarketplace":{"type":"object","description":"Basket item definition for marketplace payments.","required":["id","price","name","category1","itemType","subMerchantKey","subMerchantPrice"],"properties":{"id":{"type":"string","description":"Item ID per split on merchant side."},"name":{"type":"string","description":"Split name."},"price":{"type":"decimal","description":"Split amount; cannot be 0. Sum of splits must equal `price` (basket total)."},"category1":{"type":"string","description":"Primary category."},"category2":{"type":"string","description":"Secondary category."},"itemType":{"type":"string","enum":["PHYSICAL","VIRTUAL"],"description":"Item type."},"subMerchantKey":{"type":"string","description":"Sub-merchant **key** (required for marketplace)."},"subMerchantPrice":{"type":"decimal","description":"Sub-merchant’s payable amount (required for marketplace)."},"withholdingTax":{"type":"decimal","description":"Withholding tax amount. If the marketplace withholds tax from the sub-merchant payout and wants it to appear in the payment result and **Payout Report**, `withholdingTax` must be sent. (Recorded for information only; iyzico does not calculate it.)\n"}}},"Non3DMarketplaceResponse":{"type":"object","description":"Successful Non3D payment response.","properties":{"status":{"type":"string","enum":["success","failure"],"description":"Operation result."},"locale":{"type":"string","enum":["tr","en"],"description":"Response language."},"systemTime":{"type":"integer","description":"Operation time (epoch ms)."},"conversationId":{"type":"string","description":"Correlation ID."},"price":{"type":"decimal","description":"Basket total."},"paidPrice":{"type":"decimal","description":"Charged total amount (via POS)."},"installment":{"type":"integer","description":"Installment count."},"paymentId":{"type":"string","description":"iyzico payment ID."},"fraudStatus":{"type":"integer","enum":[0,-1,1],"description":"Fraud filter result:\n- **1**: Approved — merchant may proceed (ship).\n- **0**: Under review — wait for a later notification.\n- **-1**: Rejected.\n"},"merchantCommissionRate":{"type":"decimal","description":"Merchant commission rate."},"merchantCommissionRateAmount":{"type":"decimal","description":"Merchant commission amount."},"iyziCommissionRateAmount":{"type":"decimal","description":"iyzico commission rate amount."},"iyziCommissionFee":{"type":"decimal","description":"iyzico fixed fee."},"cardType":{"type":"string","description":"Card type."},"cardAssociation":{"type":"string","description":"Card scheme."},"cardFamily":{"type":"string","description":"Card family/brand."},"binNumber":{"type":"string","description":"First 6 digits of the card."},"lastFourDigits":{"type":"string","description":"Last 4 digits of the card."},"basketId":{"type":"string","description":"Basket ID."},"currency":{"type":"string","description":"Currency."},"itemTransactions":{"type":"array","description":"Per-item split results.","items":{"type":"object","properties":{"itemId":{"type":"string","description":"Split ID."},"paymentTransactionId":{"type":"string","description":"Split transaction ID."},"transactionStatus":{"type":"integer","enum":[0,-1,1,2],"description":"Split status:\n- **0**: In fraud check\n- **-1**: Rejected after fraud check\n- **1**: Approved (**Marketplace meaning:** Waiting for merchant approval)\n- **2**: Approved (**Marketplace meaning:** Merchant-approved)\n"},"price":{"type":"decimal","description":"Split amount."},"paidPrice":{"type":"decimal","description":"Charged amount for the split."},"merchantCommissionRate":{"type":"decimal","description":"Merchant commission rate on split."},"merchantCommissionRateAmount":{"type":"decimal","description":"Merchant commission amount on split."},"iyziCommissionRateAmount":{"type":"decimal","description":"iyzico commission rate amount on split."},"iyziCommissionFee":{"type":"decimal","description":"iyzico fixed fee on split."},"blockageRate":{"type":"integer","description":"Blockage rate."},"blockageRateAmountMerchant":{"type":"decimal","description":"Merchant blockage amount."},"blockageRateAmountSubMerchant":{"type":"decimal","description":"Sub-merchant blockage amount."},"withholdingTax":{"type":"decimal","description":"Withholding tax amount."},"blockageResolvedDate":{"type":"string","description":"Blockage resolve date (YYYY-MM-DD hh:mm:ss)."},"subMerchantKey":{"type":"string","description":"Sub-merchant key."},"externalSubMerchantId":{"type":"string","description":"Merchant’s external ID for the sub-merchant."},"subMerchantPrice":{"type":"decimal","description":"Amount payable to the sub-merchant."},"subMerchantPayoutRate":{"type":"decimal","description":"Sub-merchant payout rate."},"subMerchantPayoutAmount":{"type":"decimal","description":"Amount to be paid to sub-merchant."},"merchantPayoutAmount":{"type":"decimal","description":"Amount to be paid to merchant."},"convertedPayout":{"type":"object","description":"Summary (in converted currency).","properties":{"paidPrice":{"type":"decimal","description":"Charged amount (converted)."},"iyziCommissionRateAmount":{"type":"decimal","description":"Commission rate amount (converted)."},"iyziCommissionFee":{"type":"decimal","description":"Fixed commission (converted)."},"blockageRateAmountMerchant":{"type":"decimal","description":"Merchant blockage (converted)."},"blockageRateAmountSubMerchant":{"type":"decimal","description":"Sub-merchant blockage (converted)."},"subMerchantPayoutAmount":{"type":"decimal","description":"Sub-merchant payable (converted)."},"merchantPayoutAmount":{"type":"decimal","description":"Merchant payable (converted)."},"iyziConversionRate":{"type":"decimal","description":"FX conversion rate."},"iyziConversionRateAmount":{"type":"decimal","description":"FX conversion amount."},"currency":{"type":"string","description":"Converted currency."}}}}}},"authCode":{"type":"string","description":"Bank authorization code."},"phase":{"type":"string","description":"Transaction phase (AUTH/PREAUTH etc.)."},"hostReference":{"type":"string","description":"Host reference."},"signature":{"type":"string","description":"Response signature (for verification)."}}},"ErrorResponse":{"type":"object","description":"Error response.","properties":{"status":{"type":"string","enum":["failure"],"description":"Operation result."},"errorCode":{"type":"string","description":"Error code."},"errorMessage":{"type":"string","description":"Error message."},"locale":{"type":"string","enum":["tr","en"],"description":"Response language."},"systemTime":{"type":"integer","description":"Operation time (epoch ms)."},"conversationId":{"type":"string","description":"Correlation ID."}}}}}}
```

#### Sample Codes

<table data-view="cards"><thead><tr><th></th></tr></thead><tbody><tr><td><a href="https://github.com/iyzico/iyzipay-php/blob/master/samples/create_marketplace_payment.php">PHP</a></td></tr><tr><td><a href="https://github.com/iyzico/iyzipay-java/blob/master/src/test/java/com/iyzipay/sample/PaymentSample.java#L128">Java</a></td></tr><tr><td><a href="https://github.com/iyzico/iyzipay-dotnet/blob/master/Iyzipay.Samples/PaymentSample.cs#L206">.Net</a></td></tr><tr><td><a href="https://github.com/iyzico/iyzipay-node/blob/master/samples/IyzipaySamples.js#L653">Node.Js</a></td></tr><tr><td><a href="https://github.com/iyzico/iyzipay-python/blob/master/samples/create_marketplace_payment.py">Python</a></td></tr><tr><td><a href="https://www.postman.com/iyzico/iyzico/folder/m5s7knc/1-2-create-marketplace-payment">Postman</a></td></tr></tbody></table>
