PHP code example of anilken / turkpin-api

1. Go to this page and download the library: Download anilken/turkpin-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

anilken / turkpin-api example snippets


use Anilken\Turkpin\Turkpin;

$api = new Turkpin('username', 'password');

$api->epinList();

// Example Output

[
  {
    "id": "5",
    "name": "Echo of Soul (EOS)"
  },
  {
    "id": "633",
    "name": "Google Play kodu"
  }
  ...
]


$api->epinProducts($epin_id);

// Example Output

[
  {
    "name": "Google Play kodu 25 TL",
    "id": "8209",
    "stock": "377",
    "min_order": "1",
    "max_order": "0",
    "price": "24.5000",
    "tax_type": []
  },
  ...
]

$api->epinOrder($epin_id, $product_id, $qty = 1, $character = '');

// Example Output

{
  "status": "Success",
  "order_no": "21061113513501",
  "total_amount": "1",
  "list": [
    {
      "code": "8PFG-XXXX-FL3C-XXXX",
      "desc": "Test Ürün"
    }
  ]
}

$api->checkStatus($order_no);

// Example Output

{
  "status_code": "000",
  "order_no": "21061113513501",
  "order_code": "2",
  "order_status_description": "Siparişiniz Tamamlandı",
  "check_date": "11-06-2021 13:51:53",
  "extra": "İPTAL SEBEBI",
}

$api->checkBalance();

// Example Output

{
  "balance": "996501.2300",
  "credit": "0.0000",
  "bonus": "0.000",
  "spending": "3498.7700"
}