• Multi Bank Virtual POS

Installment Inquiry Transaction General Description

The installment inquiry service allows you to learn information about a card and its installment eligibility by sending the first 8 digits of the card (BIN number) to Tami. You can also view the installment options available for that card within the returned response.

Tami Test/Prod Portal Information

Before going live with your integration, you can use the Tami Test Portal to test without creating any real money movement.

Test Portal address: https://sandbox-portal.tami.com.tr

If you would like to log in to the test portal to view your transactions and perform cancellations/refunds when needed, a dedicated test portal user must be defined for you. You can reach our support team for this at TeknikDestek@tami.com.tr.

Prod Portal address: https://portal.tami.com.tr

For your production environment credentials, you can register via this address or contact our ecommerce support team.

Tami Test / Prod API Users

Two different environments are used when integrating with Tami’s APIs: Sandbox (Test) and Prod (Production).

  • Test (Sandbox) Environment

This lets you test your integration without creating any real money movement. Your requests are sent to the test endpoints and can be tracked via the Tami Test Portal above.

Below are the credentials you can use to send a test request via the API in the sandbox environment:

Field Value
Merchant Number 77006950
Terminal Number 84006953
Secret Key 0edad05a-7ea7-40f1-a80c-d600121ca51b
  • Prod (Production) Environment

This is the environment where live transactions take place and real payments are collected.

For your production environment credentials, you can register via https://portal.tami.com.tr or contact our e-commerce support team.

Generating the PG Auth Token

For requests sent to Virtual POS services, the PG-Auth-Token field must be included in the header.

The PG-Auth-Token is generated in the following format:

MerchantNumber:TerminalNumber:Hash

The Hash value is generated by concatenating your Merchant Number, Terminal Number, and Secret Key (in that order), hashing the result with the SHA-256 algorithm, and converting the result to Base64 format.

Below is a sample Java code block demonstrating this calculation:

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}\n

You can generate the PG-Auth-Token header value by combining the Hash value you generated with your Merchant Number and Terminal Number in the format above.

Installment Inquiry Transaction API Information

The endpoint information to be used for the installment inquiry is below:

You must send your requests using the POST method to the endpoint appropriate for the environment you are working in (test/production).

How the Installment Inquiry Request Is Sent

For installment inquiry requests, the values in the body of the request sent are not expected to be transmitted in plain form; instead, a single signed and encrypted value is expected. This value is sent in the signedRequest field.

The response returned by Tami is likewise signed and encrypted, and is delivered in the signedResponse field. Detailed information on how to decode the signedResponse value is provided in the headings below.

In addition, the following information must also be sent in the header:

  • PG-Auth-Token: How this is calculated is explained above under “Generating the PG Auth Token.”
  • CorrelationId: A variable value that must be unique for each request.
  • PG-Api-Version: Must be sent as v4.

Parameters to Be Signed and Encrypted, with Descriptions

For the installment inquiry request, the values in the request body are not sent in plain form; the encrypted value is sent in the signedRequest field.

The field to be included in signedRequest, along with its rule, is specified in the table below. Abbreviations: (O) Optional, (M) Mandatory.

Field Format Length O/M Description
binNumber Number 8 M The first 8 digits of the card number for which details are being requested must be sent.

Generating the Request Token (signedRequest)

For security purposes, information in requests sent by merchants is not sent in plain form. Instead, the request body is expected to contain the signedRequest value, which is generated by signing and encrypting a request built according to the fields requested by Tami.

For a detailed explanation of the signedRequest generation steps and code samples, please see the Generating the Request Token (signedRequest) page.

API Request Example

{\n \"signedRequest\": \"eyJjdHkiOiJKV1QiLCJlbmMiOiJBMjU4R0NNIiwiYWxnIjoiZGlyIn0..9OtbPpXGUdoJYjuawbuf.4alnqd-boqEWR_S5xKczrnfdaKzFA2aZRvpjf0pA-06WwV-NnGj2SinmEPnhsrHCj7Us1odcTL4mqeB0yHXdhF52McIx0srzkkkYqqeEzV3NurtbZ2zmuqedvwhDElmj...\"\n}

The signedRequest value above has been shortened for example/test purposes. A real request contains a much longer JWE (encrypted token) value.

API Response Example

Response for a successful transaction:

{\n \"signedResponse\": \"eyJraWQiOiI4MzQ5ZTA3MVe4MTE5ZXIwYm1xbmNhWpVpWqJjp7InU5Y4Y4VqYjZ8YWVOiOiI0InZ3IiwiYWxnIjoiZGly...\"\n}

Response Parameters and Descriptions

When the transaction is successful, the response delivered by Tami contains only the signedResponse field. All other fields listed in the table below (success, systemTime, correlationId, bankName, installments, etc.) are not present in plain form in this case; all of them are carried in encrypted form inside the signedResponse field. You can only access these fields once the signedResponse value has been decoded. The decoding steps are described in the next heading.

When the transaction is unsuccessful, signedResponse is not returned at all; in this case success, systemTime, correlationId, errorCode, and errorMessage fields are returned directly in plain form.

Parameter Name Format Where It Appears Description
success Boolean Inside signedResponse (plain if transaction unsuccessful) Indicates whether the service returned a successful response. If true, data exists for the card; if false, no data exists for the card.
systemTime dateTime Inside signedResponse (plain if transaction unsuccessful) Indicates the date and time the response was generated by Tami.
correlationId String Inside signedResponse (plain if transaction unsuccessful) The correlationId value sent in the request.
bankName String Inside signedResponse The name of the bank.
bankId String Inside signedResponse The EFT code of the bank.
cardType String Inside signedResponse The card type. DEBIT, CREDIT
cardOrg String Inside signedResponse The card organization information. VISA, MASTERCARD, TROY, AMEX, etc.
commercial Boolean Inside signedResponse Indicates whether the card is a commercial card. If true, it is a commercial card; if false, it is a personal card.
rewardType String Inside signedResponse The reward group of the card. BONUS, AXESS, CHIP, WORLD, etc.
force3ds Boolean Inside signedResponse Indicates, based on the merchant’s authorization, whether the transaction is required to be performed with 3D. If true, an error is received when the transaction is sent without 3D.
forceCvc Boolean Inside signedResponse Indicates, based on the merchant’s authorization, whether the transaction is required to be performed with a CVV. If true, an error is received when the transaction is sent without a CVV.
installments List Inside signedResponse Lists the installment options available based on the queried BIN number.
isInstallment Boolean Inside signedResponse Indicates, based on the merchant’s authorization, whether the transaction may be made in installments. If false, an error is received when the transaction is sent with installments.
errorCode String Plain (only when success:false) The error code returned when the success field is false.
errorMessage String Plain (only when success:false) The description of the error returned when the success field is false.

Decoding the Response Token (signedResponse)

The steps required to decode the value delivered in the signedResponse field in order to access the parameters above will be provided in this section.

For a detailed explanation of the decoding steps and code samples, please see the Decoding the Response Token (signedResponse) page.

Code Examples

Below are links to code samples written in various programming languages. Through the link for your preferred programming language, you can examine in detail code written with pre-defined example values.

These samples contain code covering the relevant transaction type, and since they are written in different languages, it is also possible to observe various approaches and practices. This gives you the opportunity to work with clearer and more authentic examples suited to your preferred programming language.

  • For C# Code Samples, click here.
  • For VB.Net Code Samples, click here.
  • For Java Code Samples, click here.
  • For PHP Code Samples, click here.
  • For NodeJS Code Samples, click here.

Please note that these samples are written with pre-defined values, and the necessary adaptation and security measures may need to be taken for their use in real projects.

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