Sample Authentication

Lets take one another example

Request Data

The authorization process begins with a request payload containing information about the iyzilink you are going to create. Here's a summary of the key elements in the request payload:

conversationId: Unique identifier for the conversation.

price: Total price of iyzilink that contains your product.

name: Name of the iyzilink that contains your product.

description: Description of the product.

currencyCode: Currency of the iyzilink that contains your product.

encodedImageFile: base64 encoded version of the image file of iyzilink product.

Uri Path

The variable uri_path is determined based on the content of the requestUrl. It extracts a portion of the URL starting from the occurrence of "/v2" until the occurrence of "?" if present, otherwise, it extracts from "/v2" to the end of the URL. Essentially, uri_path captures the path segment of the URL after "/v2" up to but excluding the query parameters, if any.

Payload

Payload is the variable that combines your request data with the uri path created.

Data Encryption

After some operations, we take the data and encrypt it by using HMac SHA256 encoding algorithm. The secretKey your merchant has serve as the key for the SHA256 encoding. It serves as a unique identifier and ensures data integrity. An example of HMac SHA256 ouput will look like: dZrE2sY6W4BpB56GKBSra5t8L/yIzT9Vum/MPxjyNNo=

Authorization

By using your API Key, generated random key and the data that encrypted, authorizaton string is created. After that, the generated string is encrypted by using Base64. And by concatenating IYZWSv2 with your string that generated, the authorization process is done. If everything is done correctly, your auth string will look like below:

IYZWSv2 YXBpS2V......

Response

Upon successful authorization, you will receive a response that includes a status ("success" in this case), a conversation ID, a token, data that contains the variables of token, url of the iyzilink and url of the image.

Token

The token received in the response is crucial for further actions, such as updating or deleting the iyzilink.

URL and Image URL

These URLs provide links to the payment page. You can redirect the user to these URLs to complete the payment process.

In summary, the process involves creating a request payload, encyription of the data and using your secret key to create an authorization code. The response provides important information, including a token for further actions and URLs for completing the payment.

Last updated