Skip to content

Reporting Services

With marketplace reporting services, you can analyze your transactions, sellers’ performance, and financial status in detail.

On this page, you will learn about the following reporting services:

  1. GetTransactionReport - Transaction-based reporting
  2. GetSellerTransactionReportByDate - Seller and date-based reporting
  3. GetSellerPaymentList - Seller payment list
  4. GetSellerDebtReport - Seller debt report

Retrieves a detailed report of a specific transaction.

TEST:

POST https://apitest.paynkolay.com.tr/marketplace/v1/transaction/report

PROD:

POST https://api.paynkolay.com.tr/marketplace/v1/transaction/report
{
"trxCode": "ORDER_12345",
"refCode": "REF123456789",
"apiSecretKey": "sx_value"
}
ParameterTypeRequiredDescription
trxCodeStringYour transaction code
refCodeStringPay N Kolay reference code
apiSecretKeyStringSX value
{
"data": [
{
"mpCode": "MP12345",
"mpOrderCode": "ORDER_12345",
"trxType": "SALES",
"trxDatetime": "2025-01-20T14:30:15.204156Z",
"trxCode": "REF123456789",
"trxCurrency": "949",
"trxAmount": 150.00,
"trxStatus": "SUCCESS",
"pfCommissionRate": 2.50,
"pfCommissionAmount": 3.75,
"sellerTransactionList": [
{
"sellerName": "Ahmet Yılmaz",
"trxAmount": 100.00,
"trxCurrency": "TRY",
"trxStatus": "SUCCESS",
"mpCommissionRate": 5.00,
"mpCommissionAmount": 5.00,
"mpCost": 0.50,
"trxType": "SALES",
"withholdingTax": 0.80,
"trxCode": "REF123456789",
"refCode": "REF123456789"
},
{
"sellerName": "Örnek Teknoloji A.Ş.",
"trxAmount": 50.00,
"trxCurrency": "TRY",
"trxStatus": "SUCCESS",
"mpCommissionRate": 7.00,
"mpCommissionAmount": 3.50,
"mpCost": 0.25,
"trxType": "SALES",
"withholdingTax": 0.40,
"trxCode": "REF123456789",
"refCode": "REF123456789"
}
]
}
],
"success": true,
"responseCode": "200",
"responseMessage": "SUCCESS",
"reportTime": "2025-01-20T15:00:00"
}
ParameterTypeDescription
mpCodeStringMarketplace code
mpOrderCodeStringYour transaction code
trxTypeStringTransaction type (SALES, REFUND, CANCEL)
trxDatetimeStringTransaction date (ISO 8601)
trxCodeStringPay N Kolay reference code
trxCurrencyStringCurrency code
trxAmountBigDecimalTotal transaction amount
trxStatusStringTransaction status
pfCommissionRateBigDecimalPay N Kolay commission rate
pfCommissionAmountBigDecimalPay N Kolay commission amount
ParameterTypeDescription
sellerNameStringSeller name
trxAmountBigDecimalSeller’s transaction amount
mpCommissionRateBigDecimalMarketplace commission rate
mpCommissionAmountBigDecimalMarketplace commission amount
mpCostBigDecimalTransaction fee
withholdingTaxBigDecimalWithholding tax amount

Lists all transactions of a seller within a specific date range.

TEST:

POST https://apitest.paynkolay.com.tr/marketplace/v1/transaction/seller/report

PROD:

POST https://api.paynkolay.com.tr/marketplace/v1/transaction/seller/report
{
"from": "2025-01-01",
"to": "2025-01-31",
"sellerExternalId": "SELLER_001",
"apiSecretKey": "sx_value",
"marketplaceCode": "MP12345",
"trxType": "SALES",
"trxStatus": "SUCCESS"
}
ParameterTypeRequiredDescription
fromStringStart date (yyyy-MM-dd)
toStringEnd date (yyyy-MM-dd)
sellerExternalIdStringSeller external ID
apiSecretKeyStringSX value
marketplaceCodeStringMarketplace code
trxTypeStringTransaction type filter (SALES, REFUND, CANCEL)
trxStatusStringStatus filter (SUCCESS, PENDING, FAILED)
{
"countSuccessTransaction": 45,
"countFailedTransaction": 3,
"countSuccessSalesTransaction": 40,
"countSuccessRefundTransaction": 4,
"countSuccessCancelTransaction": 1,
"totalAuthAmount": 12500.00,
"totalPfCommissionAmount": 312.50,
"totalMpCommissionAmount": 625.00,
"totalSellerAmount": 11562.50,
"data": [
{
"sellerName": "Ahmet Yılmaz",
"trxAmount": 250.00,
"trxCurrency": "TRY",
"trxStatus": "SUCCESS",
"mpCommissionRate": 5.00,
"mpCommissionAmount": 12.50,
"mpCost": 0.50,
"trxType": "SALES",
"withholdingTax": 2.00,
"trxCode": "ORDER_001",
"refCode": "REF001"
},
{
"sellerName": "Ahmet Yılmaz",
"trxAmount": 180.00,
"trxCurrency": "TRY",
"trxStatus": "SUCCESS",
"mpCommissionRate": 5.00,
"mpCommissionAmount": 9.00,
"mpCost": 0.50,
"trxType": "SALES",
"withholdingTax": 1.44,
"trxCode": "ORDER_002",
"refCode": "REF002"
}
],
"success": true,
"responseCode": "200",
"responseMessage": "SUCCESS",
"reportTime": "2025-01-20T16:30:00"
}
ParameterDescription
countSuccessTransactionNumber of successful transactions
countFailedTransactionNumber of failed transactions
countSuccessSalesTransactionNumber of successful sales
countSuccessRefundTransactionNumber of successful refunds
countSuccessCancelTransactionNumber of successful cancellations
totalAuthAmountTotal authorized amount
totalPfCommissionAmountTotal Pay N Kolay commission
totalMpCommissionAmountTotal marketplace commission
totalSellerAmountNet amount remaining to seller

Lists payment transfers made to the seller.

TEST:

POST https://apitest.paynkolay.com.tr/marketplace/v1/transaction/seller/payment-report

PROD:

POST https://api.paynkolay.com.tr/marketplace/v1/transaction/seller/payment-report
{
"from": "2025-01-01",
"to": "2025-01-31",
"sellerExternalId": "SELLER_001",
"apiSecretKey": "sx_value",
"marketplaceCode": "MP12345"
}
{
"data": [
{
"sellerName": "Ahmet Yılmaz",
"sellerExternalId": "SELLER_001",
"trxAmount": 5000.00,
"description": "Haftalık Hakediş Ödemesi - Hafta 3",
"currency": "TRY",
"transferDate": "2025-01-20",
"eftOutDate": "2025-01-20"
},
{
"sellerName": "Ahmet Yılmaz",
"sellerExternalId": "SELLER_001",
"trxAmount": 4500.00,
"description": "Haftalık Hakediş Ödemesi - Hafta 2",
"currency": "TRY",
"transferDate": "2025-01-13",
"eftOutDate": "2025-01-13"
}
],
"success": true,
"responseCode": "200",
"responseMessage": "SUCCESS",
"reportTime": "2025-01-20T17:00:00"
}
ParameterTypeDescription
sellerNameStringSeller name
sellerExternalIdStringSeller external ID
trxAmountBigDecimalTransfer amount
descriptionStringTransfer description
currencyStringCurrency
transferDateStringTransfer date
eftOutDateStringEFT outgoing date

Shows the seller’s debt status.

TEST:

POST https://apitest.paynkolay.com.tr/marketplace/v1/transaction/seller/debt-report

PROD:

POST https://api.paynkolay.com.tr/marketplace/v1/transaction/seller/debt-report
{
"from": "2025-01-01T00:00",
"to": "2025-01-31T23:59",
"sellerExternalId": "SELLER_001",
"marketplaceCode": "MP12345",
"apiSecretKey": "sx_value"
}
{
"data": [
{
"sellerName": "Ahmet Yılmaz",
"debtAmount": 150.00,
"trxCurrency": "TRY",
"debtCreateDate": "2025-01-15T14:30:00",
"debtUpdateDate": "2025-01-20T10:00:00",
"debtStatus": true
}
],
"success": true,
"responseCode": "200",
"responseMessage": "SUCCESS",
"reportTime": "2025-01-20T18:00:00"
}
ParameterTypeDescription
sellerNameStringSeller name
debtAmountBigDecimalDebt amount
trxCurrencyStringCurrency
debtCreateDateStringDebt creation date
debtUpdateDateStringDebt update date
debtStatusBooleanIs debt active? (true=active, false=closed)

async function getDailySalesReport(date) {
const report = await getSellerTransactionReportByDate({
from: date,
to: date,
sellerExternalId: 'ALL', // All sellers
apiSecretKey: process.env.API_SECRET_KEY,
trxType: 'SALES',
trxStatus: 'SUCCESS'
});
console.log('Daily Summary:');
console.log(`Total Sales: ${report.countSuccessSalesTransaction}`);
console.log(`Total Amount: ${report.totalAuthAmount} TL`);
console.log(`Commission: ${report.totalMpCommissionAmount} TL`);
console.log(`Net Profit: ${report.totalSellerAmount} TL`);
return report;
}
async function analyzeSellerPerformance(sellerExternalId, month) {
const startDate = `${month}-01`;
const endDate = new Date(month + '-01');
endDate.setMonth(endDate.getMonth() + 1);
endDate.setDate(0);
const lastDay = endDate.toISOString().split('T')[0];
const report = await getSellerTransactionReportByDate({
from: startDate,
to: lastDay,
sellerExternalId,
apiSecretKey: process.env.API_SECRET_KEY
});
const performance = {
seller: sellerExternalId,
period: month,
totalSales: report.countSuccessSalesTransaction,
totalRefunds: report.countSuccessRefundTransaction,
revenue: report.totalSellerAmount,
commission: report.totalMpCommissionAmount,
refundRate: (report.countSuccessRefundTransaction / report.countSuccessSalesTransaction * 100).toFixed(2) + '%'
};
console.table(performance);
return performance;
}
async function trackSellerPayments(sellerExternalId) {
const payments = await getSellerPaymentList({
from: '2025-01-01',
to: '2025-12-31',
sellerExternalId,
apiSecretKey: process.env.API_SECRET_KEY
});
console.log(`\n${sellerExternalId} - Payment History:\n`);
payments.data.forEach(payment => {
console.log(`${payment.transferDate}: ${payment.trxAmount} TL - ${payment.description}`);
});
const totalPaid = payments.data.reduce((sum, p) => sum + p.trxAmount, 0);
console.log(`\nTotal Paid: ${totalPaid} TL`);
return payments;
}
async function checkSellerDebts() {
const sellers = await getAllSellers();
for (const seller of sellers.data) {
const debtReport = await getSellerDebtReport({
from: '2025-01-01T00:00',
to: new Date().toISOString().slice(0, 16),
sellerExternalId: seller.sellerExternalId,
apiSecretKey: process.env.API_SECRET_KEY
});
const activeDebts = debtReport.data.filter(d => d.debtStatus === true);
if (activeDebts.length > 0) {
const totalDebt = activeDebts.reduce((sum, d) => sum + d.debtAmount, 0);
console.log(`⚠️ ${seller.nameSurname}: ${totalDebt} TL debt`);
// Notify seller
await notifySellerAboutDebt(seller.email, totalDebt);
}
}
}

class MarketplaceDashboard {
async getOverview(from, to) {
const allSellers = await this.getAllSellers();
const overview = {
totalSellers: allSellers.data.length,
activeSellers: allSellers.data.filter(s => s.active).length,
totalRevenue: 0,
totalCommission: 0,
totalTransactions: 0,
sellerReports: []
};
for (const seller of allSellers.data) {
const report = await getSellerTransactionReportByDate({
from,
to,
sellerExternalId: seller.sellerExternalId,
apiSecretKey: this.apiSecretKey
});
overview.totalRevenue += report.totalAuthAmount;
overview.totalCommission += report.totalMpCommissionAmount;
overview.totalTransactions += report.countSuccessTransaction;
overview.sellerReports.push({
sellerId: seller.sellerExternalId,
sellerName: seller.nameSurname,
sales: report.countSuccessSalesTransaction,
revenue: report.totalAuthAmount,
commission: report.totalMpCommissionAmount
});
}
// Sort sellers by revenue
overview.sellerReports.sort((a, b) => b.revenue - a.revenue);
return overview;
}
displayDashboard(overview) {
console.log('\n📊 MARKETPLACE DASHBOARD\n');
console.log(`Total Sellers: ${overview.totalSellers}`);
console.log(`Active Sellers: ${overview.activeSellers}`);
console.log(`Total Revenue: ${overview.totalRevenue.toFixed(2)} TL`);
console.log(`Total Commission: ${overview.totalCommission.toFixed(2)} TL`);
console.log(`Total Transactions: ${overview.totalTransactions}\n`);
console.log('🏆 TOP SELLERS:\n');
overview.sellerReports.slice(0, 10).forEach((seller, index) => {
console.log(
`${index + 1}. ${seller.sellerName}: ` +
`${seller.revenue.toFixed(2)} TL (${seller.sales} sales)`
);
});
}
}
// Usage
const dashboard = new MarketplaceDashboard();
const overview = await dashboard.getOverview('2025-01-01', '2025-01-31');
dashboard.displayDashboard(overview);

const ExcelJS = require('exceljs');
async function exportSellerReport(sellerExternalId, from, to) {
const report = await getSellerTransactionReportByDate({
from,
to,
sellerExternalId,
apiSecretKey: process.env.API_SECRET_KEY
});
const workbook = new ExcelJS.Workbook();
const worksheet = workbook.addWorksheet('İşlem Raporu');
// Headers
worksheet.columns = [
{ header: 'İşlem Kodu', key: 'trxCode', width: 20 },
{ header: 'Tarih', key: 'date', width: 15 },
{ header: 'Tutar', key: 'amount', width: 12 },
{ header: 'Komisyon', key: 'commission', width: 12 },
{ header: 'Stopaj', key: 'tax', width: 12 },
{ header: 'Net', key: 'net', width: 12 },
{ header: 'Durum', key: 'status', width: 12 }
];
// Data
report.data.forEach(trx => {
worksheet.addRow({
trxCode: trx.trxCode,
date: trx.trxDate,
amount: trx.trxAmount,
commission: trx.mpCommissionAmount,
tax: trx.withholdingTax,
net: trx.trxAmount - trx.mpCommissionAmount - trx.withholdingTax,
status: trx.trxStatus
});
});
// Style
worksheet.getRow(1).font = { bold: true };
// Save
await workbook.xlsx.writeFile(`seller_report_${sellerExternalId}.xlsx`);
}

After setting up the reporting system:

  1. Payment Transactions - Receive new payments
  2. Seller Management - Add and manage sellers
  3. Payment Profile - Optimize profiles