İşlemleri Sorgula

getTransactions API, belirli bir tarihe göre satış detaylarına ulaşmak için kullanılmaktadır.

Method URL İçerik Türü
POST /api/getTransactions application/json


Tip Parametre Data Tipi Şart
HEADER Authorization string Zorunlu
HEADER Accept string Zorunlu
HEADER Content-Type string Zorunlu
KEY merchant_key string Zorunlu
KEY hash_key string Zorunlu
KEY date string Zorunlu
KEY invoiceid string Opsiyonel
KEY currency_id int Opsiyonel
KEY paymentmethodid int Opsiyonel
KEY minamount int Opsiyonel
KEY maxamount int Opsiyonel
KEY transactionState int Opsiyonel

Authorization

Authorization bağlantı girişimine izin verildiğini doğrulayan tanımlayan bir başlık anahtarıdır. Yöntem “Bearer” olmalıdır

Örnek değer

Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6Im
RlMGVlZGFiZjdhZDhkODYzYTgyMzQ4Nzk5NTFkYzFlMDZkZ
TUxYjU0NWRjYmU3MzRjMmQ1OGNkMWFlOWE4YjliZTkyMjd
lZGVmZDdlMDliIn0.eyJhdWQiOiIxNSIsImp0aSI6ImRlMGVlZGF
iZjdhZDhkODYzYTgyMzQ4Nzk5NTFkYzFlMDZkZTUxYjU0NWR
jYmU3MzRjMmQ1OGNkMWFlOWE4YjliZTkyMjdlZGVmZDdlMD
liIiwiaWF0IjoxNTczNzUyNDcyLCJuYmYiOjE1NzM3NTI0NzIsImV
4cCI6MTYwNTM3NDg3Miwic3ViIjoiMSIsInNjb3BlcyI6W119.mDtd
zcv15p8SnYjZYJUJrhdskO5NohXbkcAxKWWZ72lNtrg86RZ1yxQwf
QlRu6IPoa1rfG3M4jfsNeH

Accept

accept, istemci tarafında ne tür bir temsilin istendiğini belirler. Değer "application/json" olmalıdır.

Content-Type

Content-Type, Sunucu tarafında ne tür bir temsilin istendiğini belirler. Değer "application/json" olmalıdır.

invoiceid

invoiceid üye iş yeri tarafından gönderilen eşsiz sipariş id'sidir. string değer, nullable.

merchant_key

merchant_key Paybull tarafından üye iş yerine sağlanan eşsiz bir anahtardır.

hash_key

hash_key, aşağıda sağladığımız belirli bir algoritma kullanılarak oluşturulur.


function generateAPIHashKey($merchant_key, $date, invoiceid, $currency_id, $paymentmethodid, $minamount, $maxamount, $transactionState){

    $data = $date.'|'.invoiceid.'|'.$currency_id.'|'.$paymentmethodid.'|'.$minamount.'|'.$maxamount.'|'.$transactionState;

    $iv = substr(sha1(mt_rand()), 0, 16);
    $password = sha1($merchant_key);

    $salt = substr(sha1(mt_rand()), 0, 4);
    $saltWithPassword = hash('sha256', $password . $salt);

    $encrypted = openssl_encrypt(
"$data", 'aes-256-cbc', "$saltWithPassword", null, $iv
    );
    $msg_encrypted_bundle = "$iv:$salt:$encrypted";
    $hash_key = str_replace('/', '__', $msg_encrypted_bundle);
return $hash_key;
}

date

Tarih formatı örnek-'2021-04-20' vb. gibi olmalıdır.

paymentmethodid

int değer, nullable.

currency_id

int değer, nullable.

minamount

int değer, nullable.

maxamount

int değer, nullable.

transactionState

int değer, nullable.

İstek

{
    "merchant_key": "$2y$10$w/ODdbTmfubcbUCUq/ia3OoJFMUmkM1UVNBiIQIuLfUlPmaLUT1he",
    "hash_key": "823e40a698c3ca1f:4c80:cYTC/9s5ehGRtGeYyXA0Tw==",
    "date": "2021-02-10",
    "invoiceid": "",
    "currency_id": "",
    "paymentmethodid": "",
    "minamount": "",
    "maxamount": "",
    "transactionState": ""
}

Başarılı Yanıt


{
    "status_code": 100,
    ""status_description": "Success",
    "data": [
        {
            "id": 275018,
            "user_id": 12,
            "merchant_id": 98950,
            "payment_id": "W7iQ8-M7jb-TC10-98950-100221",
            "transaction_state_id": 11,
            "merchant_commission": 0.665,
            "gross": 11.3,
            "net": 10.635,
            "payment_type_id": 1,
            "product_price": 10,
            "total_refunded_amount": 10,
            "card_holder_bank": "T. VAKIFLAR BANKASI T.A.O.",
            "operator": "",
            "user_name": "",
            "dpl_id": 0,
            "currency_id": 1,
            "invoice_id": "3905388578454743445487",
            "credit_card_no": "535576****7226",
            "installment": 1,
            "rolling_amount": 1.13,
            "gsm_number": "",
            "payment_source": 12,
            "card_program": null,
            "result": "Approved(21041MekI07029311)",
            "settlement_date_merchant": "2021-02-11 14:00:00",
            "created_at": "2021-02-10T12:30:37.000000Z",
            "updated_at": "2021-03-09T15:14:27.000000Z",
            "recurring_id": 0,
            "order_id": "16129494361217",
            "ip": "103.195.141.79",
            "auth_code": "175705",
            "card_issuer_name": null,
            "refunded_chargeback_fee": 50,
            "pos_name": "ISBANK - Günlük TRY MAXIMUM",
            "settlement_date_bank": "2021-02-11 14:00:00",
            "transaction_state_label": "Chargebacked",
            "payment_type_label": "MP Credit Card",
            "currency_code": "TRY",
            "rolling_balance": {
                "id": 10847,
                "sale_id": 275018,
                "effective_date": "2021-08-10 11:00:00"
            },
            "sale_billing": {
                "id": 15043,
                "sale_id": 275018,
                "card_holder_name": "A******"
            },
            "merchant_sale": {
                "id": 161297,
                "sale_id": 275018,
                "merchant_commission_percentage": 5,
                "merchant_commission_fixed": 0.1,
                "end_user_commission_percentage": 3,
                "end_user_commission_fixed": 1,
                "merchant_rolling_percentage": 10,
                "cot_percentage": 0.75,
                "cot_fixed": 0
            },
            "refund_history": [],
            "sale_recurring": null,
            "sale_recurring_history": [],
            "sale_integrator": {
                "id": 2100,
                "sale_id": 275018,
                "integrator_id": 3,
                "commission_percentage": 0.1,
                "commission_fixed": 0,
                "commission_amount": 0.0113,
                "amount": 11.3,
                "integratordata": {
                    "id": 3,
                    "integrator_name": "Aigerim integrator",
                    "status": 1
                }
            },
            "userdata": {
                "id": 12,
                "name": "Test qqqqa"
            },
            "merchant": {
                "user_id": 12,
                "name": "SoftRobotics ",
                "mcc": "6012"
            }
        }
    ]
}

Başarısız Yanıt


{
    "merchant_key": "$2y$10$w/ODdbTmfubcbUCUq/ia3OoJFMUmkM1UVNBiIQIuLfUlPmaLUT1he",
    "hash_key": "823e40a698c3ca1f:4c80:cYTC/9s5ehGRtGeYyXA0Tw==",
    "date": "2021-02-10",
    "invoiceid": "",
    "currency_id": "",
    "paymentmethodid": "",
    "minamount": "",
    "maxamount": "",
    "transactionState": ""
}