# CF-Initialize

This is the quickest and easiest way to complete your payments. It allows for a seamless payment process without the need for additional queries such as card front side checks, BIN queries, installment queries, 3D Secure checks, or card information saving integrations. By following this process, you can ensure a smooth and efficient integration with iyzico, providing a streamlined payment experience for your customers.

By incorporating these features, you can provide a seamless payment experience for your customers, with real-time feedback on the success or failure of their transactions.

## Checkout Form (CF) Initialize

> Starts a Checkout Form session and returns \`checkoutFormContent\` / \`paymentPageUrl\` and a \`token\` to render the payment page.

```json
{"openapi":"3.0.3","info":{"title":"Checkout Form (CF)","version":"1.0.0"},"servers":[{"url":"https://api.iyzipay.com","description":"iyzico API"}],"paths":{"/payment/iyzipos/checkoutform/initialize/auth/ecom":{"post":{"summary":"Checkout Form (CF) Initialize","description":"Starts a Checkout Form session and returns `checkoutFormContent` / `paymentPageUrl` and a `token` to render the payment page.","tags":["CheckoutForm"],"parameters":[{"$ref":"#/components/parameters/AuthHeader"},{"$ref":"#/components/parameters/ContentTypeHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CFInitializeRequest"}}}},"responses":{"200":{"description":"Successful response (CF initialized)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CFInitializeResponse"}}}},"400":{"description":"Invalid request / validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"parameters":{"AuthHeader":{"name":"Authorization","in":"header","required":true,"description":"Authorization header that starts with **IYZWSv2** and is a signed hash generated in Base64 format.","schema":{"type":"string"}},"ContentTypeHeader":{"name":"Content-Type","in":"header","required":true,"description":"Content-Type value.","schema":{"type":"string"}}},"schemas":{"CFInitializeRequest":{"type":"object","required":["price","paidPrice","currency","callbackUrl","buyer","shippingAddress","billingAddress","basketItems"],"properties":{"locale":{"type":"string","description":"Language code. Default is `tr`. Send `en` to render the form in English.","enum":["tr","en"]},"conversationId":{"type":"string","description":"Request/response correlation ID. The value sent in the request is returned unchanged in the response."},"price":{"type":"decimal","description":"Basket total."},"paidPrice":{"type":"decimal","description":"Total amount to be charged."},"currency":{"type":"string","description":"Currency. Default is `TRY`.","enum":["TRY","USD","EUR","GBP","NOK","CHF"]},"basketId":{"type":"string","description":"Basket ID."},"paymentGroup":{"type":"string","description":"Payment group. Default is `PRODUCT`.","enum":["PRODUCT","LISTING","SUBSCRIPTION"]},"callbackUrl":{"type":"string","description":"Merchant URL that iyzico calls to deliver both success and failure results. Must have a valid SSL certificate."},"enabledInstallments":{"type":"array","description":"Available installment options.","items":{"type":"integer"}},"buyer":{"description":"Buyer information.","$ref":"#/components/schemas/BuyerCF"},"shippingAddress":{"description":"Shipping address. Required if at least one basket item is `PHYSICAL`. If all items are `VIRTUAL`, it is not required.","$ref":"#/components/schemas/Address"},"billingAddress":{"description":"Billing address.","$ref":"#/components/schemas/Address"},"basketItems":{"type":"array","description":"Basket items.","items":{"$ref":"#/components/schemas/BasketItem"}}}},"BuyerCF":{"type":"object","required":["id","name","surname","identityNumber","email","gsmNumber","registrationAddress","city","country"],"properties":{"id":{"type":"string","description":"Customer ID."},"name":{"type":"string","description":"First name."},"surname":{"type":"string","description":"Last name."},"identityNumber":{"type":"string","description":"National ID number."},"email":{"type":"string","description":"Email."},"gsmNumber":{"type":"string","description":"Mobile phone number."},"registrationDate":{"type":"string","description":"Registration date (YYYY-MM-DD hh:mm:ss)."},"lastLoginDate":{"type":"string","description":"Last login date (YYYY-MM-DD hh:mm:ss)."},"registrationAddress":{"type":"string","description":"Registered address."},"city":{"type":"string","description":"City."},"country":{"type":"string","description":"Country."},"zipCode":{"type":"string","description":"Postal code."},"ip":{"type":"string","description":"IP address."}}},"Address":{"type":"object","required":["address","contactName","city","country"],"properties":{"address":{"type":"string","description":"Full address."},"zipCode":{"type":"string","description":"Postal code."},"contactName":{"type":"string","description":"Contact name."},"city":{"type":"string","description":"City."},"country":{"type":"string","description":"Country."}}},"BasketItem":{"type":"object","required":["id","price","name","category1","itemType"],"properties":{"id":{"type":"string","description":"Item ID."},"price":{"type":"decimal","description":"Item price."},"name":{"type":"string","description":"Item name."},"category1":{"type":"string","description":"Primary category."},"category2":{"type":"string","description":"Secondary category (optional)."},"itemType":{"type":"string","description":"Item type.","enum":["PHYSICAL","VIRTUAL"]},"subMerchantKey":{"type":"string","description":"Sub-merchant key for the service provider. Not sent in the standard business model. Required only for the marketplace model."},"subMerchantPrice":{"type":"string","description":"Amount to be transferred to the sub-merchant. Not sent in the standard business model. Required only for the marketplace model."}}},"CFInitializeResponse":{"type":"object","properties":{"status":{"type":"string","description":"Result of the request.","enum":["success","failure"]},"locale":{"type":"string","description":"Response language."},"systemTime":{"type":"integer","description":"System time (epoch ms)."},"conversationId":{"type":"string","description":"Correlation ID that matches the request."},"token":{"type":"string","description":"Unique token generated for the checkout form. Mandatory to retrieve the payment result."},"checkoutFormContent":{"type":"string","description":"HTML content of the payment form (Base64-encoded)."},"paymentPageUrl":{"type":"string","description":"URL of iyzico’s hosted payment page (Common Payment Page)."},"signature":{"type":"string","description":"Signature value that can be used for integrity verification."}}},"ErrorResponse":{"type":"object","properties":{"status":{"type":"string","description":"Result of the request.","enum":["success","failure"]},"errorCode":{"type":"string","description":"Error code."},"errorMessage":{"type":"string","description":"Error message."},"locale":{"type":"string","description":"Response language."},"systemTime":{"type":"integer","description":"System time (epoch ms)."},"conversationId":{"type":"string","description":"Correlation ID that matches the request."}}}}}}
```

#### 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/initialize_checkout_form.php">PHP</a></td></tr><tr><td><a href="https://github.com/iyzico/iyzipay-java/blob/master/src/test/java/com/iyzipay/sample/CheckoutFormSample.java#L21">Java</a></td></tr><tr><td><a href="https://github.com/iyzico/iyzipay-dotnet/blob/master/Iyzipay.Samples/CheckoutFormSample.cs#L12">.Net</a></td></tr><tr><td><a href="https://github.com/iyzico/iyzipay-node/blob/master/samples/IyzipaySamples.js#L270">Node.Js</a></td></tr><tr><td><a href="https://github.com/iyzico/iyzipay-python/blob/master/samples/initialize_checkout_form.py">Python</a></td></tr><tr><td><a href="https://www.postman.com/iyzico/iyzico/request/pxn0vt0/1-initialize-checkout-form">Postman</a></td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.iyzico.com/en/payment-methods/checkoutform/cf-implementation/cf-initialize.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
