Payment Detail

You can get the transfer detail of the sales transactions made on the date transmitted with this service.

It is divided into two categories as Merchant Payment Detail and Marketplace Payment Detail.

Merchant Payment Detail

1- Send the date you want to see the payment details to https://www.paytr.com/rapor/odeme-detayi/ via POST method.

Field name Explanation
merchant_id Merchant No
date Date:Date Format: 2022-01-01 (YYYY-MM-DD )
paytr_token You should look at the example codes.


The values ​​from the table are queried according to the date. The transfer information of the sales transactions made on the relevant date is returned from the service.

2- Your response to this request is returned in JSON format.

a. If there is no transaction within the given date duration, the status value returns failed. b. If there is a transaction within the given date duration the status value returns as "success" with the information in the table below returns. c. If there is any mistake in the request, the status value returns "error". In this case, you should check the "err_msg" for error details.

When the status value is “successful", the returned values are in the table below.

Field name Explanation Values
merchant_oid Order number of the transaction e.g. ABC123
merchant_iban Merchant IBAN number e.g. TR000000000000000000000000000
merchant_name Merchant name e.g. Test Firm
payment Payment amount e.g. 18
currency Currency e.g. TL


<?php

$merchant_id    = 'XXXXX';
    $merchant_key   = 'YYYYYYYYYYYYY';
    $merchant_salt  = 'YYYYYYYYYYYYY';

    #
    //$date     = "2022-02-07";
    $date     = "2021-07-01";
    #
    ############################################################################################

    $paytr_token = base64_encode(hash_hmac('sha256', $merchant_id . $date . $merchant_salt, $merchant_key, true));

    $post_vals = array('merchant_id' => $merchant_id,
        'date' => $date,
        'paytr_token' => $paytr_token
    );
    #
    ############################################################################################

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, "https://www.paytr.com/rapor/odeme-detayi/");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $post_vals);
    curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
    curl_setopt($ch, CURLOPT_TIMEOUT, 90);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 90);

    $result = @curl_exec($ch);
    //print_r($result);

    if (curl_errno($ch)) {
        echo curl_error($ch);
        curl_close($ch);
        exit;
    }

    curl_close($ch);

    echo "<pre>";
    $result = json_decode($result, 1);

    if ($result['status'] == 'success')
    {

        print_r($result);
    }
    elseif ($result['status'] == 'failed')
    {

        echo "Payment details could not be found on the relevant date.";
    }
    else
    {
        // Hata durumu
        echo $result['err_no'] . " - " . $result['err_msg'];
    }

For merchant payment detail sample codes Click to download.

Marketplace Payment Detail

1- Send the date you want to see the payment details to https://www.paytr.com/rapor/odeme-detayi/ via POST method.

Field name Explanation
merchant_id Merchant No
date Date:Date Format: 2022-01-01 (YYYY-MM-DD )
paytr_token You should look at the example codes.


The values ​​from the table are queried according to the date. The transfer information of the sales transactions made on the relevant date is returned from the service.

2- Your response to this request is returned in JSON format.

a. If there is no transaction within the given date duration, the status value returns failed. b. If there is a transaction within the given date duration the status value returns as "success" with the information in the table below returns. c. If there is any mistake in the request, the status value returns "error". In this case, you should check the "err_msg" for error details.

When the status value is “successful", the returned values are in the table below.

Field name Explanation Values
merchant_oid Order number of the transaction e.g. ABC123
merchant_iban Merchant IBAN number e.g. TR000000000000000000000000000
merchant_name Merchant name e.g. Test Firm
payment Payment amount e.g. 18
currency Currency e.g. TL
amount Amount to be paid to the seller e.g. 140
transfer Seller IBAN detail e.g. TR111111111111111111111, TEST PERSON
currency Currency e.g. TL


Incoming and transferred amounts appear on a daily basis.

<?php

$merchant_id    = 'XXXXX';
    $merchant_key   = 'YYYYYYYYYYYYY';
    $merchant_salt  = 'YYYYYYYYYYYYY';

    ## Gerekli Bilgiler
    #
    //$date     = "2022-02-07";
    $date     = "2021-07-01";
    #
    ############################################################################################

    $paytr_token = base64_encode(hash_hmac('sha256', $merchant_id . $date . $merchant_salt, $merchant_key, true));

    $post_vals = array('merchant_id' => $merchant_id,
        'date' => $date,
        'paytr_token' => $paytr_token
    );
    #
    ############################################################################################

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, "https://www.paytr.com/rapor/odeme-detayi/");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $post_vals);
    curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
    curl_setopt($ch, CURLOPT_TIMEOUT, 90);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 90);

    $result = @curl_exec($ch);
    //print_r($result);

    if (curl_errno($ch)) {
        echo curl_error($ch);
        curl_close($ch);
        exit;
    }

    curl_close($ch);

    echo "<pre>";
    $result = json_decode($result, 1);

    if ($result[status] == 'success')
    {

        print_r($result);
    }
    elseif ($result[status] == 'failed')
    {

        echo "No transaction was found in date duration";
    }
    else
    {

        echo $result[err_no] . " - " . $result[err_msg];
    }

For marketplace payment detail sample codes Click to download.