Pay With iyzico

The Pay With iyzico method allows you to complete the transaction by directing the end user to the iyzico wallet account offered by iyzico.

This method is ideal for partners who want to integrate quickly and leave the UI to iyzico. This service should be used for API-API Pay With iyzico.

Initialize Pay with iyzico

POST https://api.iyzipay.com/v1/pay-with-iyzico/third-party-session/pwi/init

Headers

Name
Value

Content-Type

application/json

Authorization

Authorization

Request Parameters

Parametre
Type
Mandatory
Description

paidPrice

Decimal

Yes

Final amount (including installment fee) that will be charged to customer’s card

locale

String

No

Language (default: tr)

price

Decimal

Yes

Total amount of basket. The sum of basket items’ amount must be equal to the price of basket.

conversationId

String

No

Conversation ID to match request and response

paymentGroup

String

Yes

Payment group (default: PRODUCT). Valid values are PRODUCT, LISTING, SUBSCRIPTION

callbackUrl

String

Yes

Merchant callback URL for payment result notification. callBackUrl address should have SSL.

currency

String

Yes

Currency (default: TRY). Alternatively, you can set USD, EUR, GBP

basketId

String

No

Merchant's basket ID

buyerId

String

Yes

ID of buyer.

buyerName

String

Yes

Name of buyer

buyerSurname

String

Yes

Surname of buyer

identityNumber

String

Yes

Identity number of buyer. TCKN for Turkish merchants, passport number for foreign merchants

email

String

Yes

Email of buyer

gsmNumber

String

No

GSM number of buyer

registrationAddress

String

Yes

Registration address of buyer

city

String

Yes

City of buyer

country

String

Yes

Country of buyer

IP

String

No

IP of buyer

zipCode

String

Yes

Zip code of buyer

address(shippingAddress)

String

Yes

Address details of shipping address. If one of the itemType in basket is PHYSICAL, then this parameter will be mandatory

contactName(shippingAddress)

String

Yes

Contact name of shipping address. 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.

zipCode(shippingAddress)

String

Yes

Zip code of shipping address.

address(billingAddress)

String

Yes

Address details of billing address.

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.

basketItemId

String

Yes

Basket Item ID.

It can take a maximum of 500 characters.

basketItemPrice

String

Yes

Price value for each item. Must be greater than zero.

basketItemName

String

Yes

Name of the item in the basket.

basketItemCategory1

String

Yes

Category 1 for item in the basket.

basketItemCategory2

String

No

Category 2 for item in the basket.

basketItemItemType

String

Yes

Item Type. Valid values are PHYSICAL,VIRTUAL

INIT PWI Request

{
    "paidPrice": 1.0,
    "locale": "en",
    "enabledInstallments": [ 
        1,
        2,
        3,
        6,
        9,
        12
    ],
    "price": 1.0,
    "conversationId": "2224",
    "paymentGroup": "PRODUCT",
    "callbackUrl": "https://merchant-callback.com",
    "currency": "TRY",
    "basketId": "B67832",
    "buyer": {
        "id": "BY789",
        "name": "John",
        "surname": "Doe",
        "identityNumber": "74300864711",
        "email": "[email protected]",
        "gsmNumber": "+9055555555",
        "registrationAddress": "Adres",
        "city": "Istanbul",
        "country": "Turkey",
        "ip": "buyer Ip",
        "zipCode": "34580"
    },
    "shippingAddress": {
        "address": "Altunizade Mah. İnci Çıkmazı Sokak No: 3 İç Kapı No: 10",
        "contactName": "Jane Doe",
        "city": "Istanbul",
        "country": "Turkey",
        "zipCode": "34580"
    },
    "billingAddress": {
        "address": "Altunizade Mah. İnci Çıkmazı Sokak No: 3 İç Kapı No: 10",
        "contactName": "Jane Doe",
        "city": "Istanbul",
        "country": "Turkey",
        "zipCode": "34580"
    },
    "basketItems": [
        {
            "id": "BI101",
            "price": 1.0,
            "name": "Binocular",
            "category1": "Collectibles",
            "itemType": "PHYSICAL"
        }
    ]
}

Response

{
    "status": "success",
    "locale": "tr",
    "systemTime": 1749027773192,
    "conversationId": "2224",
    "token": "d9d9fc30-8178-4ca9-8f93-1b150f465da6",
    "signature": "a53e433a982bc9f927aed4e0383d083bd48de9cff343490ba7477f9964cfbfb1",
    "payWithIyzicoPageUrl": "https://sandbox-ode.iyzico.com/sdk?token=d9d9fc30-8178-4ca9-8f93-1b150f465da6&lang=tr",
    "tokenExpireTime": 600,
    "tokenExpireDate": 1749028373178
}

Response Parameters

Parameter
Type
Description

status

String

Service response result. (success / failure)

locale

String

Language (default: tr).

systemTime

Long

Response system unix timestamp value.

conversationId

String

If set, conversation ID to match request and response.

token

String

Unique value created for each pay with iyzico request. This token is also used to access the payment result.

payWithIyzicoPageUrl

String

Unique link of pay with iyzico page. The end user should be directed to this page.

tokenExpireTime

Long

Expiration time of the token and pay with iyzico page.

tokenExpireDate

Long

The date when the token will expire in the Epoch timeframe.

errorCode

String

Error code if service response status is failure.

errorMessage

String

If the operation is erroneous, this is a message detailing the error, with language support according to the locale parameter.

Last updated