İçeriğe geç

Ödeme Profili Yönetimi

Ödeme Profili, pazaryerinin satıcılarına uygulayacağı komisyon oranları, işlem ücretleri, ödeme günleri ve valör hesaplama yöntemlerini içeren yapılandırma setidir.

Pazaryeri, farklı satıcılarla farklı ödeme profilleri kullanarak çalışabilir. Örneğin:

  • Premium satıcılar için %2 komisyon
  • Standart satıcılar için %5 komisyon
  • Yeni satıcılar için %7 komisyon

Ödeme profilinde tanımlanan valör hesaplama tipi, satıcıya ödemenin ne zaman yapılacağını belirler.

KodTipAçıklama
WWEEKLYHaftalık Valör Hesaplama - Haftanın belirli gününde ödeme yapılır
HHALF_MONTHLYYarım Aylık Valör Hesaplama - Ayda iki kez ödeme yapılır
MMONTHLYAylık Valör Hesaplama - Ayın belirli gününde ödeme yapılır
TTRANSACTIONİşlem Tarihi Temelli Valör - İşlem tarihinden N gün sonra ödeme yapılır
DDELIVERYTeslim Tarihi Temelli Valör - Teslim tarihinden N gün sonra ödeme yapılır

Ödeme profili yönetimi için aşağıdaki servisler kullanılır:

  1. CreatePaymentProfile - Yeni ödeme profili oluşturma
  2. GetPaymentProfileById - Ödeme profili sorgulama
  3. UpdatePaymentProfile - Ödeme profili güncelleme
  4. DeletePaymentProfileById - Ödeme profili silme
  5. GetAllPaymentProfileByApiSecretKey - Tüm profilleri listeleme

Yeni bir ödeme profili oluşturur.

TEST:

POST https://apitest.paynkolay.com.tr/marketplace/v1/paymentprofile

PROD:

POST https://api.paynkolay.com.tr/marketplace/v1/paymentprofile
{
"profileExternalId": "IslemValor1",
"apiSecretKey": "sx_value_here",
"name": "Premium Satıcı Profili",
"mpCommissionRate": 5.00,
"mpCost": 0.50,
"paymentDay": null,
"valorDateCount": 1,
"valorCalculationType": "T",
"active": true
}
ParametreTipZorunluAçıklama
profileExternalIdStringTekil dış ID - Kendi sisteminizdeki ID
apiSecretKeyStringPazaryerine ait SX değeri
nameStringProfil adı (ör: “Premium Profil”)
mpCommissionRateBigDecimalPazaryeri komisyon oranı (%)
mpCostBigDecimalİşlem başına sabit ücret (TL)
paymentDayInteger✅*Ödeme günü (1-7 arası, pazartesi=1). Haftalık/Aylık için zorunlu
valorDateCountIntegerPara transferi için bekleme süresi (gün)
valorCalculationTypeStringValör hesaplama tipi (W, H, M, T, D)
activeBooleanProfil aktif mi? (varsayılan: true)
{
"data": {
"profileExternalId": "IslemValor1",
"marketplaceCode": "MP12345",
"name": "Premium Satıcı Profili",
"mpCommissionRate": 5.00,
"mpCost": 0.50,
"paymentDay": "per",
"valorDateCount": 1,
"active": true,
"createDate": "2025-01-15T10:30:00Z",
"updateDate": "2025-01-15T10:30:00Z"
},
"success": true,
"responseCode": "200",
"responseMessage": "SUCCESS"
}

Belirli bir ödeme profilinin detaylarını getirir.

TEST:

POST https://apitest.paynkolay.com.tr/marketplace/v1/paymentprofile/get

PROD:

POST https://api.paynkolay.com.tr/marketplace/v1/paymentprofile/get
{
"profileExternalId": "IslemValor1"
}
{
"data": {
"profileExternalId": "IslemValor1",
"marketplaceCode": "MP12345",
"name": "Premium Satıcı Profili",
"mpCommissionRate": 5.00,
"mpCost": 0.50,
"paymentDay": "per",
"valorDateCount": 1,
"active": true,
"createDate": "2025-01-15T10:30:00Z",
"updateDate": "2025-01-15T10:30:00Z"
},
"success": true,
"responseCode": "200",
"responseMessage": "SUCCESS"
}

Mevcut bir ödeme profilini günceller.

TEST:

POST https://apitest.paynkolay.com.tr/marketplace/v1/paymentprofile/update

PROD:

POST https://api.paynkolay.com.tr/marketplace/v1/paymentprofile/update
{
"profileExternalId": "IslemValor1",
"apiSecretKey": "sx_value_here",
"name": "Güncellenmiş Premium Profil",
"mpCommissionRate": 4.50,
"mpCost": 0.30,
"paymentDay": null,
"valorDateCount": 2,
"valorCalculationType": "T",
"active": true
}
{
"data": {
"profileExternalId": "IslemValor1",
"marketplaceCode": "MP12345",
"name": "Güncellenmiş Premium Profil",
"mpCommissionRate": 4.50,
"mpCost": 0.30,
"paymentDay": "per",
"valorDateCount": 2,
"active": true,
"createDate": "2025-01-15T10:30:00Z",
"updateDate": "2025-01-16T14:20:00Z"
},
"success": true,
"responseCode": "200",
"responseMessage": "SUCCESS"
}

Bir ödeme profilini siler.

TEST:

POST https://apitest.paynkolay.com.tr/marketplace/v1/paymentprofile/delete

PROD:

POST https://api.paynkolay.com.tr/marketplace/v1/paymentprofile/delete
{
"profileExternalId": "IslemValor1"
}
{
"data": null,
"success": true,
"responseCode": "200",
"responseMessage": "SUCCESS"
}

Pazaryerine ait tüm ödeme profillerini listeler.

TEST:

POST https://apitest.paynkolay.com.tr/marketplace/v1/paymentprofile/list

PROD:

POST https://api.paynkolay.com.tr/marketplace/v1/paymentprofile/list
{
"apiSecretKey": "sx_value_here",
"active": true
}
ParametreTipZorunluAçıklama
apiSecretKeyStringPazaryerine ait SX değeri
activeBooleantrue=sadece aktif, false=sadece pasif, null=tümü
{
"data": [
{
"profileExternalId": "Premium1",
"marketplaceCode": "MP12345",
"name": "Premium Satıcı Profili",
"mpCommissionRate": 5.00,
"mpCost": 0.50,
"paymentDay": "per",
"valorDateCount": 1,
"active": true,
"createDate": "2025-01-15T10:30:00Z",
"updateDate": "2025-01-15T10:30:00Z"
},
{
"profileExternalId": "Standard1",
"marketplaceCode": "MP12345",
"name": "Standart Satıcı Profili",
"mpCommissionRate": 7.00,
"mpCost": 1.00,
"paymentDay": "per",
"valorDateCount": 3,
"active": true,
"createDate": "2025-01-10T09:15:00Z",
"updateDate": "2025-01-10T09:15:00Z"
}
],
"success": true,
"responseCode": "200",
"responseMessage": "SUCCESS"
}

Senaryo 1: Farklı Kategoriler için Farklı Profiller

Section titled “Senaryo 1: Farklı Kategoriler için Farklı Profiller”
// Premium satıcılar için profil
await createPaymentProfile({
profileExternalId: "PREMIUM_PROFILE",
name: "Premium Satıcı",
mpCommissionRate: 3.00, // %3 komisyon
mpCost: 0.00,
valorDateCount: 1, // 1 gün sonra ödeme
valorCalculationType: "T"
});
// Standart satıcılar için profil
await createPaymentProfile({
profileExternalId: "STANDARD_PROFILE",
name: "Standart Satıcı",
mpCommissionRate: 5.00, // %5 komisyon
mpCost: 0.50, // İşlem başına 0.50 TL
valorDateCount: 3, // 3 gün sonra ödeme
valorCalculationType: "T"
});
// Yeni satıcılar için profil
await createPaymentProfile({
profileExternalId: "NEW_SELLER_PROFILE",
name: "Yeni Satıcı",
mpCommissionRate: 8.00, // %8 komisyon
mpCost: 1.00,
valorDateCount: 7, // 7 gün sonra ödeme
valorCalculationType: "T"
});
// Her pazartesi ödeme yapılan profil
await createPaymentProfile({
profileExternalId: "WEEKLY_MONDAY",
name: "Haftalık Pazartesi Ödemeli",
mpCommissionRate: 5.00,
mpCost: 0.00,
paymentDay: 1, // 1 = Pazartesi
valorDateCount: 7,
valorCalculationType: "W" // Weekly
});
// Kargo teslim edildikten 2 gün sonra ödeme
await createPaymentProfile({
profileExternalId: "DELIVERY_BASED",
name: "Teslimat Sonrası Ödeme",
mpCommissionRate: 4.00,
mpCost: 0.00,
paymentDay: null,
valorDateCount: 2, // Teslimat sonrası 2 gün
valorCalculationType: "D" // Delivery based
});
const axios = require('axios');
class PaymentProfileManager {
constructor(apiSecretKey, merchantSecretKey, baseURL) {
this.apiSecretKey = apiSecretKey;
this.merchantSecretKey = merchantSecretKey;
this.baseURL = baseURL;
}
async createProfile(profileData) {
const response = await axios.post(
`${this.baseURL}/paymentprofile`,
{
...profileData,
apiSecretKey: this.apiSecretKey
}
);
return response.data;
}
async getProfile(profileExternalId) {
const response = await axios.post(
`${this.baseURL}/paymentprofile/get`,
{ profileExternalId }
);
return response.data;
}
async updateProfile(profileData) {
const response = await axios.post(
`${this.baseURL}/paymentprofile/update`,
{
...profileData,
apiSecretKey: this.apiSecretKey
}
);
return response.data;
}
async deleteProfile(profileExternalId) {
const response = await axios.post(
`${this.baseURL}/paymentprofile/delete`,
{ profileExternalId }
);
return response.data;
}
async listProfiles(activeOnly = null) {
const response = await axios.post(
`${this.baseURL}/paymentprofile/list`,
{
apiSecretKey: this.apiSecretKey,
active: activeOnly
}
);
return response.data;
}
}
// Kullanım
const manager = new PaymentProfileManager(
process.env.API_SECRET_KEY,
process.env.MERCHANT_SECRET_KEY,
'https://apitest.paynkolay.com.tr/marketplace/v1'
);
// Profil oluştur
const newProfile = await manager.createProfile({
profileExternalId: "PROFILE_001",
name: "Test Profili",
mpCommissionRate: 5.00,
mpCost: 0.50,
valorDateCount: 2,
valorCalculationType: "T",
active: true
});

Ödeme profillerini oluşturduktan sonra:

  1. Satıcı Yönetimi - Satıcılarınızı ekleyin ve profil atayın
  2. Ödeme İşlemleri - Ödeme almaya başlayın
  3. Raporlama - Profil bazlı raporlar alın