# Create Session

This service generates the session key required for services that use a mobile session token. Requests to this service can only be sent from the merchant server with a static IP address registered on the Paynet side and must include the dealer-specific secret key in the request header.

## Authorize – get\_auth\_key

> Generates a mobile session key (session\_key).\
> Only servers whose IP addresses are defined by Paynet can call this service.<br>

```json
{"openapi":"3.0.3","info":{"title":"PayPOS (Paynet) API","version":"1.0.0"},"tags":[{"name":"Authorize"}],"servers":[{"url":"https://api.paynet.com.tr","description":"Production"},{"url":"https://pts-api.paynet.com.tr","description":"Sandbox"}],"paths":{"/v1/agent/get_auth_key":{"post":{"summary":"Authorize – get_auth_key","description":"Generates a mobile session key (session_key).\nOnly servers whose IP addresses are defined by Paynet can call this service.\n","tags":["Authorize"],"parameters":[{"$ref":"#/components/parameters/AuthorizationHeader"},{"$ref":"#/components/parameters/PaynetMobileHeader"},{"$ref":"#/components/parameters/ContentTypeHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthRequest"}}}},"responses":{"200":{"description":"Successful","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"parameters":{"AuthorizationHeader":{"name":"Authorization","in":"header","required":true,"description":"Dealer-specific generated secret_key. Example: \"Basic sck_xxx\".","schema":{"type":"string"}},"PaynetMobileHeader":{"name":"PaynetMobile","in":"header","required":true,"description":"Indicates a mobile request. Example in the document; 2.","schema":{"type":"string"}},"ContentTypeHeader":{"name":"Content-Type","in":"header","required":true,"description":"Content type.","schema":{"type":"string"}}},"schemas":{"AuthRequest":{"type":"object","required":["agent_id","user_id"],"properties":{"agent_id":{"type":"string","description":"Agent Id."},"user_id":{"type":"string","description":"User Id."}}},"AuthResponse":{"type":"object","properties":{"session_key":{"type":"string","description":"Session key."},"expired_date":{"type":"string","description":"Expired date."},"agent_id":{"type":"string","description":"Agent Id."},"company_code":{"type":"string","description":"Company code."},"user_id":{"type":"string","description":"User Id."},"user_unique_id":{"type":"string","description":"User unique Id."},"is_okc_inquiry":{"type":"boolean","description":"ÖKC exemption result."},"object_name":{"type":"string","description":"Object name."},"code":{"type":"integer","description":"Code."},"message":{"type":"string","description":"Message."}}},"ErrorResponse":{"type":"object","properties":{"object_name":{"type":"string","description":"Object name."},"code":{"type":"integer","description":"Code."},"message":{"type":"string","description":"Message."}}}}}}
```


---

# 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/products/paypos-app2app/paypos-app2app-integration/create-session.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.
