• Multi Bank Virtual POS

Pre Authorization Closure General Concepts

In the pre-authorized transaction performed through Tami, the limit up to the provision amount is blocked on the card. With the closing process, this amount is collected from the card.

Test/Prod Envirenement API User Information

You can access the Sandbox Test Portal at https://sandbox-portal.tami.com.tr. When you log in to the test portal using a test user account, you can view the transactions performed by the merchant associated with that user. These transactions can also be cancelled or refunded. To obtain the test user credentials, please contact TeknikDestek@tami.com.tr.

Hash Calculation

The request sent for many transaction types should include the PG-Auth-Token in the header information. The PG-Auth-Token consists of the values "MerchantNumber:TerminalNumber:Hash".

When calculating the hash here, the merchantNumber, terminalNumber, and secretKey information belonging to the merchant are hashed with sha256 and converted to a string.

public class SHA256Example {\n public static String sha256(Long merchantNumber, Long terminalNumber, String secretKey) {\n String text = merchantNumber.toString() + terminalNumber.toString() + secretKey;\n try {\n MessageDigest digest = MessageDigest.getInstance(\"SHA-256\");\n byte[] hash = digest.digest(text.getBytes(StandardCharsets.UTF_8));\n String sha256Hex = DatatypeConverter.printBase64Binary(hash);\n return sha256Hex;\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n return null;\n }\n }\n}

TAMİ Test Portal Information

You can access the Tami test portal at https://sandbox-portal.tami.com.tr. From this address, you can view the portal screen with the users specified above. 

For your production environment information you can become a member at https://portal.tami.com.tr or You can apply to the e-commerce support unit.

Pre Authorization Closure API Information

In test environment, the "https://sandbox-paymentapi.tami.com.tr/payment/post-auth" URL will be used.

In production environment, the "https://paymentapi.tami.com.tr/payment/post-auth" URL will be used.

Request Parameters and Descriptions

Field Format Max Size (O)psionel / (M)andatory  Description
amount Decimal O It is the information about how much of the pre-authorized transaction will be financialized. If it is not sent, the default value is taken as the transaction amount.
orderId String (2-36) M Order number information of the pre-authorized transaction to be financialized
securityHash String M It is the value expected to be calculated and transmitted according in the document. If it is missing or incorrect, the transaction is not routed to the bank, an error is given.

Pre Authorization Closure API Request Example

{\n \"orderId\": \"orderpostauth\",\n \"amount\": 41.5,\n \"securityHash\": \"749ejdk0wesl33l37335==\"\n}

Pre Authorization Closure API Response Example

{\n \"amount\": 5,\n \"currency\": \"TRY\",\n \"orderId\": \"RND14xxx\",\n \"success\": true,\n \"systemTime\": \"2025-08-09T15:57:09.987033757\",\n \"correlationId\": \"Onuxxxxx\",\n \"securityHash\": \"NXlzLbfTogl4nkG+cE58+hiJR04KSyHxE2w0k3O6E2Q=\",\n \"bankAuthCode\": \"512xx6\",\n \"bankReferenceNumber\": \"52210xxx0x08\"\n}

Pre Authorization Closure API Response Parameters and Descriptions

Parametre Adı Format Açıklama
amount Number The foreign currency code of the successful canceled/refunded transaction.
currency String The foreign currency code of the successful canceled/refunded transaction.
orderId String Order number
success String Reports the result of the operation. If True, the operation succeeds, if False, the operation fails.
systemTime dateTime Time of transaction execution
correlationId String The transaction number value sent by the merchant in the cancellation/refund request.
errorCode String This parameter is passed if the operation fails. Error code information.
errorMessage String This parameter is passed if the operation fails. Error message information.
securityHash String The value to be used to determine that the result of the operation comes from the correct source. The documentation describes how to calculate it.
bankAuthCode String Bank Confirmation Code
bankReferenceNumber String Retref number for the transaction
errorGroup  String Shows the group of the relevant error. Businesses can manage their own rules using error codes and error groups.
POST
Merchant ID
Terminal ID
Secret Key
{\n \"orderId\": \"\",\n \"amount\": 40\n}

Hata Oluştu

Başarılı

Security Hash Calculation

You can use the documentation here to calculate the securityHash field in service requests and incoming service responses. 

Error Codes

You can access the list of error codees on this page.

Test Cards

You can access the list of test cards on this page.

We are here for all your questions and support requests.

Ask a Question Ask a Question