Base URL: https://igpays.com/api Versiyon: v3.0.1

IG PAYS API Dokümantasyonu

Payment token oluşturma, IBAN atama, çekim talebi ve callback akışları için teknik referans.

Yatırım Akışı

Site payment token üretir ve kullanıcıyı ödeme sayfasına yönlendirir. Kullanıcı transferi onayladığında yatırım talebi kayda alınır.

Otomatik IBAN

Ödeme sayfasında aktif ve tutara uygun IBAN havuzundan otomatik hesap atanır. Yeni hesap isteğinde farklı uygun IBAN döndürülebilir.

Callback

Yatırım veya çekim sonucu değiştiğinde sistem kayıtlı callback_url adresine POST bildirimi gönderir.

Kimlik Doğrulama

İsteklerde X-API-Key ve gerekli endpointlerde X-API-Secret header olarak gönderilir. IP whitelist aktifse istek adresi ayrıca doğrulanır.

Endpointler

POST
/payment/token
Ödeme token’ı oluştur
Payment

Yatırım için ödeme sayfası linki oluşturur. Bu endpoint yatırım talebini hemen oluşturmaz; talep, kullanıcı ödeme sayfasında “Gönderim Yaptım” dediğinde oluşur.

Auth: X-API-Key + X-API-Secret

Headers

X-API-Key API Key (zorunlu)
X-API-Secret API Secret (zorunlu)
Content-Type application/json

Notlar

  • Kullanıcı payment_url adresine yönlendirilmelidir.
  • Ödeme sayfasında IBAN otomatik/random atanır.
  • external_id callback içinde geri döner.

Request Body

{
    "amount": 1000,
    "external_id": "TXN-12345",
    "return_url": "https://merchant.example/payment-return",
    "user_data": {
        "username": "john_doe",
        "name": "John",
        "surname": "Doe",
        "phone": "5551234567",
        "email": "john@example.com",
        "identity_number": "12345678901"
    },
    "callback_data": {
        "source": "checkout"
    }
}

Response Body

{
    "success": true,
    "message": "Ödeme token’ı başarıyla oluşturuldu",
    "data": {
        "amount": 1000,
        "payment_token": "abc123...xyz789",
        "payment_url": "https://igpays.com/payment/abc123...xyz789",
        "expires_at": "2026-07-08 18:00:00"
    }
}
POST
/withdrawal/request
Çekim talebi oluştur
Withdrawal

Kullanıcının IBAN’ına çekim talebi oluşturur. IBAN user_data.iban veya callback_data.iban içinde gönderilmelidir.

Auth: X-API-Key

Headers

X-API-Key API Key (zorunlu)
Content-Type application/json

Notlar

  • IBAN TR ile başlamalı ve geçerli formatta olmalıdır.
  • Kasa bakiyesi yetersizse 1303 hata kodu döner.

Request Body

{
    "investment_account_id": null,
    "amount": 500,
    "external_id": "WD-78901",
    "return_url": "https://merchant.example/withdrawal-return",
    "user_data": {
        "username": "john_doe",
        "name": "John",
        "surname": "Doe",
        "phone": "5551234567",
        "email": "john@example.com",
        "identity_number": "12345678901",
        "iban": "TR340006498096848110310161"
    },
    "callback_data": {
        "source": "withdrawal-form"
    }
}

Response Body

{
    "success": true,
    "message": "Çekim talebi başarıyla oluşturuldu",
    "data": {
        "id": 456,
        "amount": 500,
        "status": "pending",
        "created_at": "2026-07-08 12:00:00"
    }
}
POST
Merchant callback_url
Durum callback’i
Callback

Sistem, talep onaylandığında veya reddedildiğinde merchant callback_url adresine bu formatta POST atar.

Auth: Merchant tarafında opsiyonel doğrulama

Headers

Content-Type application/json

Notlar

  • Callback endpoint’iniz HTTP 200 döndürmelidir.
  • Başarısız callbackler sistem tarafından tekrar denenir.

Request Body

{
    "timestamp": "2026-07-08 12:05:00",
    "request_type": "investment",
    "status": "approved",
    "data": {
        "request_id": 123,
        "external_id": "TXN-12345",
        "status": "approved",
        "amount": 1000,
        "approved_at": "2026-07-08 12:05:00",
        "customer": {
            "name": "John",
            "surname": "Doe",
            "email": "john@example.com",
            "phone": "5551234567"
        },
        "user_data": {
            "username": "john_doe",
            "name": "John",
            "surname": "Doe",
            "phone": "5551234567"
        }
    }
}

Response Body

{
    "success": true
}

Hata Kodları

1000 API Key veya Secret eksik Gerekli kimlik doğrulama headerları gönderilmedi.
1001 Geçersiz API Key veya Secret Bilgiler yanlış veya API kullanıcısı pasif.
1003 IP whitelist hatası Whitelist aktif ve istek IP adresi izinli değil.
1301 Aktif hesap bulunamadı API kullanıcısına bağlı aktif kasa/IBAN yok.
1302 Tutar limit dışında Gönderilen tutar min/max limitleri dışında.
1303 Yetersiz kasa bakiyesi Çekim için kullanılabilir kasa bakiyesi yetersiz.
1400 Token oluşturma hatası Payment token oluşturulurken hata oluştu.

Kod Örnekleri

cURL - Payment token
curl -X POST https://igpays.com/api/payment/token \
  -H "X-API-Key: your_api_key" \
  -H "X-API-Secret: your_api_secret" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 1000,
    "external_id": "TXN-12345",
    "user_data": {
      "username": "john_doe",
      "name": "John",
      "surname": "Doe",
      "phone": "5551234567",
      "email": "john@example.com"
    }
  }'
JavaScript - Fetch
const response = await fetch("https://igpays.com/api/payment/token", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-API-Key": "your_api_key",
    "X-API-Secret": "your_api_secret"
  },
  body: JSON.stringify({
    amount: 1000,
    external_id: "TXN-12345",
    user_data: {
      username: "john_doe",
      name: "John",
      surname: "Doe",
      phone: "5551234567",
      email: "john@example.com"
    }
  })
});

const data = await response.json();
window.location.href = data.data.payment_url;
PHP - Callback receiver
<?php
$payload = json_decode(file_get_contents('php://input'), true);

// external_id ile kendi transaction kaydınızı eşleştirin
$externalId = $payload['data']['external_id'] ?? null;
$status = $payload['status'] ?? null;
$amount = $payload['data']['amount'] ?? null;

if ($status === 'approved') {
    // updateUserBalance($externalId, $amount);
} elseif ($status === 'rejected') {
    // markTransactionRejected($externalId);
}

http_response_code(200);
echo json_encode(['success' => true]);

IG PAYS API Documentation

Technical reference for payment tokens, IBAN assignment, withdrawal requests and callback flows.

Deposit Flow

The site creates a payment token and redirects the user to the payment page. The deposit request is recorded after the user confirms the transfer.

Automatic IBAN

The payment page assigns an active IBAN suitable for the amount. A new-account request can return another eligible IBAN.

Callback

When a deposit or withdrawal status changes, the system sends a POST notification to the registered callback_url.

Authentication

Send X-API-Key and, when required, X-API-Secret as headers. If IP whitelist is enabled, the request address is validated as well.

Endpoints

POST
/payment/token
Create payment token
Payment

Creates a payment page link for deposits. This endpoint does not immediately create a deposit request; the request is created when the user confirms payment on the payment page.

Auth: X-API-Key + X-API-Secret

Headers

X-API-Key API key (required)
X-API-Secret API secret (required)
Content-Type application/json

Notes

  • Redirect the user to payment_url.
  • The payment page automatically/randomly assigns an IBAN.
  • external_id is returned in callbacks.

Request Body

{
    "amount": 1000,
    "external_id": "TXN-12345",
    "return_url": "https://merchant.example/payment-return",
    "user_data": {
        "username": "john_doe",
        "name": "John",
        "surname": "Doe",
        "phone": "5551234567",
        "email": "john@example.com",
        "identity_number": "12345678901"
    },
    "callback_data": {
        "source": "checkout"
    }
}

Response Body

{
    "success": true,
    "message": "Payment token created successfully",
    "data": {
        "amount": 1000,
        "payment_token": "abc123...xyz789",
        "payment_url": "https://igpays.com/payment/abc123...xyz789",
        "expires_at": "2026-07-08 18:00:00"
    }
}
POST
/withdrawal/request
Create withdrawal request
Withdrawal

Creates a withdrawal request to the user’s IBAN. IBAN must be sent in user_data.iban or callback_data.iban.

Auth: X-API-Key

Headers

X-API-Key API key (required)
Content-Type application/json

Notes

  • IBAN should start with TR and use a valid format.
  • If account balance is insufficient, error code 1303 is returned.

Request Body

{
    "investment_account_id": null,
    "amount": 500,
    "external_id": "WD-78901",
    "return_url": "https://merchant.example/withdrawal-return",
    "user_data": {
        "username": "john_doe",
        "name": "John",
        "surname": "Doe",
        "phone": "5551234567",
        "email": "john@example.com",
        "identity_number": "12345678901",
        "iban": "TR340006498096848110310161"
    },
    "callback_data": {
        "source": "withdrawal-form"
    }
}

Response Body

{
    "success": true,
    "message": "Withdrawal request created successfully",
    "data": {
        "id": 456,
        "amount": 500,
        "status": "pending",
        "created_at": "2026-07-08 12:00:00"
    }
}
POST
Merchant callback_url
Status callback
Callback

The system sends this POST payload to the merchant callback_url when a request is approved or rejected.

Auth: Optional merchant-side validation

Headers

Content-Type application/json

Notes

  • Your callback endpoint should return HTTP 200.
  • Failed callbacks are retried by the system.

Request Body

{
    "timestamp": "2026-07-08 12:05:00",
    "request_type": "investment",
    "status": "approved",
    "data": {
        "request_id": 123,
        "external_id": "TXN-12345",
        "status": "approved",
        "amount": 1000,
        "approved_at": "2026-07-08 12:05:00",
        "customer": {
            "name": "John",
            "surname": "Doe",
            "email": "john@example.com",
            "phone": "5551234567"
        },
        "user_data": {
            "username": "john_doe",
            "name": "John",
            "surname": "Doe",
            "phone": "5551234567"
        }
    }
}

Response Body

{
    "success": true
}

Error Codes

1000 Missing API key or secret Required authentication headers were not sent.
1001 Invalid API key or secret Credentials are wrong or API user is inactive.
1003 IP whitelist violation Whitelist is enabled and request IP is not allowed.
1301 No active account found No active account/IBAN is attached to the API user.
1302 Amount outside limits Sent amount is outside min/max limits.
1303 Insufficient account balance Available account balance is insufficient for withdrawal.
1400 Token creation error An error occurred while creating the payment token.

Code Examples

cURL - Payment token
curl -X POST https://igpays.com/api/payment/token \
  -H "X-API-Key: your_api_key" \
  -H "X-API-Secret: your_api_secret" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 1000,
    "external_id": "TXN-12345",
    "user_data": {
      "username": "john_doe",
      "name": "John",
      "surname": "Doe",
      "phone": "5551234567",
      "email": "john@example.com"
    }
  }'
JavaScript - Fetch
const response = await fetch("https://igpays.com/api/payment/token", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-API-Key": "your_api_key",
    "X-API-Secret": "your_api_secret"
  },
  body: JSON.stringify({
    amount: 1000,
    external_id: "TXN-12345",
    user_data: {
      username: "john_doe",
      name: "John",
      surname: "Doe",
      phone: "5551234567",
      email: "john@example.com"
    }
  })
});

const data = await response.json();
window.location.href = data.data.payment_url;
PHP - Callback receiver
<?php
$payload = json_decode(file_get_contents('php://input'), true);

// Match your transaction by external_id
$externalId = $payload['data']['external_id'] ?? null;
$status = $payload['status'] ?? null;
$amount = $payload['data']['amount'] ?? null;

if ($status === 'approved') {
    // updateUserBalance($externalId, $amount);
} elseif ($status === 'rejected') {
    // markTransactionRejected($externalId);
}

http_response_code(200);
echo json_encode(['success' => true]);

OpenAPI JSON

openapi.json
{
    "openapi": "3.0.3",
    "info": {
        "title": "IG PAYS API",
        "version": "3.0.1",
        "description": "Payment token, withdrawal request, callback and API error documentation."
    },
    "servers": [
        {
            "url": "https://igpays.com/api"
        }
    ],
    "components": {
        "securitySchemes": {
            "ApiKeyAuth": {
                "type": "apiKey",
                "in": "header",
                "name": "X-API-Key"
            },
            "ApiSecretAuth": {
                "type": "apiKey",
                "in": "header",
                "name": "X-API-Secret"
            }
        }
    },
    "paths": {
        "/payment/token": {
            "post": {
                "summary": "Create payment token",
                "security": [
                    {
                        "ApiKeyAuth": [],
                        "ApiSecretAuth": []
                    }
                ]
            }
        },
        "/withdrawal/request": {
            "post": {
                "summary": "Create withdrawal request",
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ]
            }
        },
        "/callback": {
            "post": {
                "summary": "Callback receiver sample",
                "security": [
                    {
                        "ApiKeyAuth": [],
                        "ApiSecretAuth": []
                    }
                ]
            }
        }
    }
}