# Payment Confirmation

The service that the credit card payment process is finalized and the relevant amount is withdrawn from the credit card.This service is initializes by Paynet.js or Paynet-custom.js in custom form and embedded form integrations. To use this service, session\_id and token\_id information that Paynet.js posted to your server are required.

{% hint style="warning" %}
You should perform basic authentication with secret\_key to use payment service. [See more](https://doc.paynet.com.tr/authentication#secret-key)
{% endhint %}

{% hint style="success" %}
<https://api.paynet.com.tr/v1/transaction/charge>
{% endhint %}

{% tabs %}
{% tab title="Request Parameters" %}

| Parameter Name             | Type   | Required | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| -------------------------- | ------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **session\_id**            | string | Yes      | Parameter that Paynet.js attacht to your form.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **token\_id**              | string | Yes      | Parameter that Paynet.js attacht to your form.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **amount**                 | string | Yes      | The amount parameter sent to this service is compared with the amount that set with the data-amount parameter when starting the payment process in embedded form or custom forms integration. If the amounts do not match, the payment process cannot be completed and the payment service returns an error. The amount sent to this service should be the same as the amount that set with data-amount in embedded form integration, and the amount set with dataamount in custom forms integration should be multiplied by 100. |
| **transaction\_type**      | char   | Yes      | Sale or pre-authorization. 1 for sale, 3 for pre-authorisations. The default value is sale.                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| **add\_comission\_amount** | bool   | Yes      | It is compared with the value that set with the dataadd\_commission\_amount parameter when starting the payment process in embedded form or custom forms integration. If the values do not match, the payment process cannot be completed, the payment service returns an error.                                                                                                                                                                                                                                                  |
| **ratio\_code**            | string | Yes      | When starting the payment process in embedded form or custom forms integrations, it is compared with the value that set with the dataratio\_code parameter. If the values do not match, the payment process cannot be completed, the payment service returns an error. If the ratio code will not be used, this parameter can be sent as an empty string.                                                                                                                                                                         |
| **installments**           | string | Yes      | When starting the payment process embedded or custom form integrations, it is compared with the value set with the data-installments parameter. If the values do not match, the payment process cannot be completed, the payment service returns an error. If installment limitation will not be used with this parameter, the value of the parameter can be sent as an empty string.                                                                                                                                              |
| **no\_instalment**         | bool   | Yes      | When starting the payment process in embedded form or custom form integrations, it is compared with the value set with the data-no\_instalment parameter. If the values do not match, the payment process cannot be completed, the payment service returns an error.This value can be set as true or false.                                                                                                                                                                                                                        |
| **tds\_required**          | bool   | Yes      | When starting the payment process in embedded form or custom form integrations, it is compared with the value set with the data-tds\_required parameter. If the values do not match, the payment process cannot be completed, the payment service returns an error.This value can be set as true or false.                                                                                                                                                                                                                         |
| **reference\_no**          | string | No       | A reference number to be sent by you to associate with the transaction, such as order number, invoice number. If you send the reference number with a unique value, you can check the status of the transaction through the check transaction service, in cases where you cannot get a response from the charge transaction service. In this way, we will be protected from duplicate transaction. In the example below, the session\_id and token\_id are taken and sent to the payment confirmation service.                     |
| **is\_escrow**             | bool   | No       | If you want the transaction to be approved by the company, you should send "true". If the parameter has not been sent, "false" is accepted.                                                                                                                                                                                                                                                                                                                                                                                        |
| **agent\_customer\_name**  | string | No       | The parameter which you write in this area will be seen as the "Customer's Name". You may write your firm name which you want to be seen by your customer                                                                                                                                                                                                                                                                                                                                                                          |
| **iban**                   | string | No       | It should be entered with a country code (ex "TR") with 26 characters in total.                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| {% endtab %}               |        |          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |

{% tab title="Response Parameters" %}

| Parameter Name                     | Type     | Description                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ---------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **id**                             | string   | Transaction Id.                                                                                                                                                                                                                                                                                                                                                                                                              |
| **xact\_id**                       | string   | Encrypted Transaction Id.                                                                                                                                                                                                                                                                                                                                                                                                    |
| **xact\_date**                     | datetime | Transaction Date.                                                                                                                                                                                                                                                                                                                                                                                                            |
| **transaction\_type**              | char     | 1: sale                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **pos\_type**                      | char     | 5: Paynet POS                                                                                                                                                                                                                                                                                                                                                                                                                |
| **is\_tds**                        | bool     | If the transaction performed with 3D,this value return as true.                                                                                                                                                                                                                                                                                                                                                              |
| **agent\_id**                      | string   | Paynet agent code of the dealer that performed the transaction.                                                                                                                                                                                                                                                                                                                                                              |
| **user\_id**                       | string   | Returns default as PaynetJ.                                                                                                                                                                                                                                                                                                                                                                                                  |
| **email**                          | string   | Mail address.                                                                                                                                                                                                                                                                                                                                                                                                                |
| **phone**                          | string   | Phone number.                                                                                                                                                                                                                                                                                                                                                                                                                |
| **bank\_id**                       | char     | The bank's code in the Paynet system.                                                                                                                                                                                                                                                                                                                                                                                        |
| **bank\_name**                     | string   | The bank's name in the Paynet system.                                                                                                                                                                                                                                                                                                                                                                                        |
| **campaign\_url**                  | string   | The url showing the banks' plus installment and installment postpone selection screen. Call us for more detail information.                                                                                                                                                                                                                                                                                                  |
| **instalment**                     | int      | Installment count.[See More](https://doc.paynet.com.tr/genel-bilgiler/taksit-kodlari)                                                                                                                                                                                                                                                                                                                                        |
| **ratio**                          | float    | Rate that used during transaction.                                                                                                                                                                                                                                                                                                                                                                                           |
| **ratio\_code**                    | string   | Ratio code that used during transaction.                                                                                                                                                                                                                                                                                                                                                                                     |
| **card\_no\_masked**               | string   | Masked card number.                                                                                                                                                                                                                                                                                                                                                                                                          |
| **card\_holder**                   | string   | Card owner.                                                                                                                                                                                                                                                                                                                                                                                                                  |
| **amount**                         | decimal  | Amount that withdrawn from credit card.                                                                                                                                                                                                                                                                                                                                                                                      |
| **net\_amount**                    | decimal  | Amount without commission.                                                                                                                                                                                                                                                                                                                                                                                                   |
| **comission**                      | decimal  | Comission.                                                                                                                                                                                                                                                                                                                                                                                                                   |
| **comission\_tax**                 | decimal  | Comission tax.                                                                                                                                                                                                                                                                                                                                                                                                               |
| **end\_user\_commission**          | decimal  | End user comission.                                                                                                                                                                                                                                                                                                                                                                                                          |
| **end\_user\_ratio**               | float    | User ratio code that used during checkout.                                                                                                                                                                                                                                                                                                                                                                                   |
| **currency**                       | char     | Currency.                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **authorization\_code**            | string   | Bank confirmation code.                                                                                                                                                                                                                                                                                                                                                                                                      |
| **reference\_code**                | string   | Bank reference code.                                                                                                                                                                                                                                                                                                                                                                                                         |
| **order\_id**                      | string   | Bank order no.                                                                                                                                                                                                                                                                                                                                                                                                               |
| **user\_unique\_id**               | string   | Unique id that given to user by member workplace.It’s necessary If card saving will perform at first time.Unique value(card\_owner\_id) assigns to user by Paynet after completion first card saving operation. You must store this value on your system by associating it with your user. Afterwards you should use the card\_owner\_id variable given by Paynet instead of user\_unique\_id for the saved card operations. |
| **card\_owner\_id**                | string   | Unique card holder information that has been generated by Paynet residing on user\_unique\_id after the first card saving process. This value is also used in subsequent card saving and recieving payment processes.                                                                                                                                                                                                        |
| **card\_hash**                     | string   | Hash value of card number.                                                                                                                                                                                                                                                                                                                                                                                                   |
| **card\_bank\_id**                 | string   | The code of the stored card in the Paynet system.                                                                                                                                                                                                                                                                                                                                                                            |
| **card\_logo\_url**                | string   | Logo image of the card.                                                                                                                                                                                                                                                                                                                                                                                                      |
| **is\_succeed**                    | bool     | It returns true if the transaction successful. If the transaction is successful, it returns as http 200 and and is\_succeed return as true. If the bank does not approve transaciton, it returns http 200 and is\_succed return as false is\_save\_card\_succeed: Returns true if the card save operation is successful. Its default value is false.                                                                         |
| **is\_save\_card\_succeed**        | bool     | Returns true if the card save operation is successful. Its default value is false.                                                                                                                                                                                                                                                                                                                                           |
| **save\_card\_result\_message**    | string   | Result message of card save operation.                                                                                                                                                                                                                                                                                                                                                                                       |
| **paynet\_error\_id**              | string   | Paynet system error code.                                                                                                                                                                                                                                                                                                                                                                                                    |
| **paynet\_error\_message**         | string   | Paynet system error code.                                                                                                                                                                                                                                                                                                                                                                                                    |
| **bank\_error\_id**                | string   | Bank error code.                                                                                                                                                                                                                                                                                                                                                                                                             |
| **bank\_error\_message**           | string   | Bank error message.                                                                                                                                                                                                                                                                                                                                                                                                          |
| **bank\_error\_short\_desc**       | string   | Bank error message.                                                                                                                                                                                                                                                                                                                                                                                                          |
| **bank\_error\_long\_desc**        | string   | Bank error message                                                                                                                                                                                                                                                                                                                                                                                                           |
| **agent\_reference\_no**           | string   | Reference number that used in the payment process. It is same as with reference\_no.                                                                                                                                                                                                                                                                                                                                         |
| **object\_name**                   | string   | Transaction.                                                                                                                                                                                                                                                                                                                                                                                                                 |
| **code**                           | string   | System result code . [See more](https://doc.paynet.com.tr/genel-bilgiler/hata-kodlari/doenues-kodlari)                                                                                                                                                                                                                                                                                                                       |
| **message**                        | string   | System message.                                                                                                                                                                                                                                                                                                                                                                                                              |
| **ratio\_code\_method**            | string   | Please contact our support team for more detailed information.                                                                                                                                                                                                                                                                                                                                                               |
| **md\_status**                     | int      | 3D payment confirmation transaction result.                                                                                                                                                                                                                                                                                                                                                                                  |
| **company\_cost\_ratio**           | float    | Value of Parent company service fee.                                                                                                                                                                                                                                                                                                                                                                                         |
| **company\_commission**            | decimal  | The amount of service fee to be charged to the parent company as a result of this transaction.                                                                                                                                                                                                                                                                                                                               |
| **company\_commission\_with\_tax** | decimal  | As a result of this transaction, the amount of service fee with VAT, to be deducted to the parent company.                                                                                                                                                                                                                                                                                                                   |
| **company\_net\_amount**           | decimal  | Net amount to pay parent company.                                                                                                                                                                                                                                                                                                                                                                                            |
| **plus\_installment**              | string   | Plus installment count.                                                                                                                                                                                                                                                                                                                                                                                                      |
| **card\_type**                     | char     | Card Type. [See More](https://doc.paynet.com.tr/genel-bilgiler/veri-tipleri/kart-tipi)                                                                                                                                                                                                                                                                                                                                       |
| **card\_brand\_name**              | string   | Brand of Card Bank (VISA, MASTERCARD, AMEX).                                                                                                                                                                                                                                                                                                                                                                                 |
| {% endtab %}                       |          |                                                                                                                                                                                                                                                                                                                                                                                                                              |

{% tab title="Request" %}

```
{
    "session_id": "js_*****FBWZ/****/tZjhkI8ecXG3HsTm8H76A6I1apMT*****",
    "token_id": "3C72FBF6-****-****-****-CA2CE9AAE900",
    "reference_no": "",
    "transaction_type": 1,
    "add_comission_amount": "true",
    "no_instalment": "false",
    "tds_required": "true",
    "installments": "0,3,6,8,9",
    "ratio_code": "",
    "amount": 1256000
}
```

{% endtab %}

{% tab title="Response" %}

```
{
    "id": 2526145,
    "xact_id": "xk_EAAAAFZ59jeB/zqMRhd0yygDgbCmqfeCJCPOmJSNDIIxBYQ5",
    "xact_date": "2020-01-30T14:38:44.6478544+03:00",
    "transaction_type": 1,
    "pos_type": 5,
    "is_tds": true,
    "agent_id": "1001",
    "user_id": "PaynetApi",
    "email": null,
    "phone": null,
    "bank_id": "AXSS",
    "bank_name": "Axess",
    "instalment": 0,
    "ratio": 0.025,
    "card_no_masked": "435508******4358",
    "card_holder": "TEST",
    "amount": 80,
    "net_amount": 78,
    "comission": 2,
    "comission_tax": 0,
    "currency": "TRY",
    "authorization_code": "aut-1022",
    "reference_code": "ref-1022",
    "order_id": "order-1022",
    "is_succeed": true,
    "paynet_error_id": "",
    "paynet_error_message": "",
    "bank_error_id": "",
    "bank_error_message": "",
    "bank_error_short_desc": "",
    "bank_error_long_desc": "",
    "agent_reference_no": "1000",
    "xact": "2526145",
    "campaign_url": "",
    "end_user_comission": 0,
    "end_user_ratio": 0,
    "ratio_code": "",
    "ratio_code_method": "",
    "is_save_card_succeed": true,
    "save_card_result_message": "Kart saklama islemi basarili",
    "card_owner_id": "2ce0bd9d-aeb3-4af0-9dd6-cf294e72f9cb",
    "user_unique_id": "31",
    "card_hash": "pch_Ie_StuwWK-dFd6H6FtZpWeqs-xq-",
    "card_bank_id": "AXSS",
    "company_cost_ratio":"0.1",
    "company_commission":""
    "company_commission_with_tax":
    "company_net_amount":""
    "plus_installment":""
    "card_type":""
    "card_brand_name":""
    "card_logo_url": "https://pts-statics.paynet.com.tr/img/banklogo/small/AXSS.png",
    "md_status": -1,
    "object_name": "transaction",
    "code": 0,
    "message": "Başarılı İşlem"
}
```

{% endtab %}

{% tab title="Service Url" %}

| System          | URL                                                    |
| --------------- | ------------------------------------------------------ |
| **Live System** | <https://api.paynet.com.tr/v1/transaction/charge>      |
| **Test System** | ​<https://pts-api.paynet.com.tr/v1/transaction/charge> |
| {% endtab %}    |                                                        |
| {% endtabs %}   |                                                        |

In the example below, the session\_id and token\_id are taken and sent to the payment confirmation service.

```
<?php  
			
$secret_key = "sck_pcs_rMnxDSW/43243434/YAzXXXXXXXXXXXX";
$PostURL = "https://pts-api.paynet.com.tr/v1/transaction/charge";
			
$session_id = $_REQUEST["session_id"];
$token_id 	= $_REQUEST["token_id"];
			
	
$params = array(
 'session_id' => $session_id,
 'token_id' => $token_id,
 'transaction_type' => 1, 
 'amount' => '1500',
 'add_comission_amount' => false,
 'ratio_code' => '',
 'installments' => '',
 'no_instalment' => false,
 'tds_required' => true
);
			
$options = array(
			'http' => array(
					'header'  =>"Accept: application/json; charset=UTF-8\r\n".
					"Content-type: application/json; charset=UTF-8\r\n".
					"Authorization: Basic ".$secret_key,
					'method'  => 'POST',
					'content' => json_encode($params),
					'ignore_errors' => true
					),
			);
			
$context  = stream_context_create($options);
$result = json_decode(@file_get_contents($PostURL, false, $context));
			
if($result->is_succeed == true)
{
  echo "Başarılı";
}
else
{
  echo "Başarısız";
}
			
?>
```


---

# 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://doc.paynet.com.tr/english/transaction/payment-confirmation.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.
