Skip to main content

Commission Resource

The Commission Resource represents additional fees or charges associated with a payment. Commissions can be charged to the payer (outgoing) or deducted from the beneficiary (incoming).

Quick Start

Learn about commissions in Payment Concepts first.

Commission Object​

Structure

{
"in_commission": 300, // 3 EUR from beneficiary
"out_commission": 500, // 5 EUR from payer
"in_commission_percent": null,
"out_commission_percent": null
}
View Fields Reference
FieldTypeDescription
in_commissionintegerAmount deducted from beneficiary (cents)
out_commissionintegerAmount charged to payer (cents)
in_commission_percentdecimalPercentage deducted from beneficiary
out_commission_percentdecimalPercentage charged to payer

Commission Types​

View Commission Types

Outgoing Commission

Fee paid by payer (added to payment amount):

{
"payments": [{
"description": "Service payment",
"price": 10000, // 100 EUR to beneficiary
"commission": {
"out_commission": 500 // + 5 EUR fee from payer
}
}]
}

Result:

  • Payer pays: 105 EUR (100 + 5)
  • Beneficiary receives: 100 EUR
  • Total commission: 5 EUR

Incoming Commission

Fee deducted from beneficiary (subtracted from payment):

{
"payments": [{
"description": "Service payment",
"price": 10000, // 100 EUR payment
"commission": {
"in_commission": 300 // - 3 EUR from beneficiary
}
}]
}

Result:

  • Payer pays: 100 EUR
  • Beneficiary receives: 97 EUR (100 - 3)
  • Total commission: 3 EUR

Both Commissions

Charge both payer and beneficiary:

{
"payments": [{
"description": "Marketplace transaction",
"price": 10000, // 100 EUR
"commission": {
"out_commission": 500, // + 5 EUR from payer
"in_commission": 300 // - 3 EUR from beneficiary
}
}]
}

Result:

  • Payer pays: 105 EUR (100 + 5)
  • Beneficiary receives: 97 EUR (100 - 3)
  • Total commission: 8 EUR (5 + 3)

Fixed vs Percentage​

View Commission Methods

Fixed Amount

Exact commission amount in cents:

{
"commission": {
"out_commission": 250 // Always 2.50 EUR
}
}

Use when: Commission is always the same regardless of payment amount.

Percentage

Commission calculated as percentage:

{
"commission": {
"out_commission_percent": 2.5 // 2.5% of payment
}
}

For 100 EUR payment: 100 × 0.025 = 2.50 EUR commission

Use when: Commission scales with payment amount.

Mixed

Combine fixed and percentage:

{
"commission": {
"out_commission": 50, // 0.50 EUR fixed
"out_commission_percent": 1.5 // + 1.5% of payment
}
}

For 100 EUR payment: 0.50 + (100 × 0.015) = 2.00 EUR total commission


Common Use Cases​

View Real-World Use Cases

Use Case 1: Processing Fee

Charge payer for payment processing:

{
"payments": [{
"description": "Order #1234",
"price": 4999,
"commission": {
"out_commission": 99 // 0.99 EUR processing fee
}
}]
}

Payer sees: "Total: 50.98 EUR (including 0.99 EUR processing fee)"

Use Case 2: Platform Fee

Marketplace takes cut from seller:

{
"payments": [{
"description": "Product sale",
"price": 10000,
"beneficiary_id": sellerWallet,
"commission": {
"in_commission_percent": 10 // 10% platform fee
}
}]
}

Result:

  • Buyer pays: 100 EUR
  • Seller receives: 90 EUR
  • Platform keeps: 10 EUR

Use Case 3: Service Charge

Both parties pay fees:

{
"payments": [{
"description": "Freelance payment",
"price": 50000,
"commission": {
"out_commission_percent": 2.9, // 2.9% buyer fee
"in_commission_percent": 5.0 // 5.0% seller fee
}
}]
}

Result:

  • Buyer pays: 501.45 EUR (500 + 1.45)
  • Seller receives: 475 EUR (500 - 25)
  • Total fees: 26.45 EUR

Use Case 4: Tiered Commission

Different rates for different amounts:

const getCommission = (amount) => {
if (amount < 1000) {
return { out_commission: 50 }; // 0.50 EUR flat
} else if (amount < 5000) {
return { out_commission_percent: 1.0 }; // 1%
} else {
return { out_commission_percent: 0.5 }; // 0.5% for large
}
};

Who Gets the Commission?​

Outgoing Commission

Goes to payment beneficiary (same wallet receiving the payment):

{
"payments": [{
"price": 10000,
"beneficiary_id": 11111, // Gets 100 EUR + 5 EUR commission
"commission": {
"out_commission": 500 // Additional 5 EUR
}
}]
}

Beneficiary receives: 105 EUR total

Incoming Commission

Taken from beneficiary, typically goes to project owner (you):

{
"payments": [{
"price": 10000,
"beneficiary_id": 11111, // Receives 97 EUR
"commission": {
"in_commission": 300 // Project gets 3 EUR
}
}]
}

Beneficiary receives: 97 EUR
Project owner receives: 3 EUR


Advanced Topics​

Calculations

Manual Calculation

const payment = {
price: 10000, // 100.00 EUR
commission: {
out_commission: 500, // + 5.00 EUR
in_commission_percent: 3 // - 3.00 EUR
}
};

// What payer pays
const payerAmount = payment.price + (payment.commission.out_commission || 0);
// 10000 + 500 = 10500 (105.00 EUR)

// What beneficiary receives
const beneficiaryAmount = payment.price -
(payment.commission.in_commission || 0) -
(payment.price * (payment.commission.in_commission_percent || 0) / 100);
// 10000 - 0 - (10000 * 0.03) = 9700 (97.00 EUR)

// Total commission
const totalCommission = payerAmount - beneficiaryAmount;
// 10500 - 9700 = 800 (8.00 EUR)

Helper Function

const calculateCommission = (price, commission) => {
const outFixed = commission.out_commission || 0;
const outPercent = (commission.out_commission_percent || 0) / 100;
const inFixed = commission.in_commission || 0;
const inPercent = (commission.in_commission_percent || 0) / 100;

const payerPays = price + outFixed + (price * outPercent);
const beneficiaryGets = price - inFixed - (price * inPercent);
const totalFee = payerPays - beneficiaryGets;

return {
payerPays,
beneficiaryGets,
totalFee,
breakdown: {
basePrice: price,
outgoingFee: outFixed + (price * outPercent),
incomingFee: inFixed + (price * inPercent)
}
};
};
Display to Users

Clear Communication

Show commission breakdown:

// Payment summary
const summary = {
subtotal: "100.00 EUR",
processingFee: "+ 2.50 EUR",
total: "102.50 EUR"
};

// Or for seller
const sellerSummary = {
salePrice: "100.00 EUR",
platformFee: "- 5.00 EUR (5%)",
youReceive: "95.00 EUR"
};

UI Example

<div className="payment-summary">
<div className="line-item">
<span>Product price</span>
<span>€100.00</span>
</div>
<div className="line-item fee">
<span>Service fee (2.5%)</span>
<span>€2.50</span>
</div>
<div className="line-item total">
<span>Total to pay</span>
<span>€102.50</span>
</div>
</div>
Common Patterns

Pattern 1: E-Commerce Processing Fee

{
"payments": [{
"description": "Order #12345",
"items": [
{ "title": "Product A", "price": 2999, "quantity": 1 },
{ "title": "Product B", "price": 1999, "quantity": 2 }
],
"commission": {
"out_commission": 99 // 0.99 EUR processing fee
}
}]
}

Pattern 2: Marketplace Commission

{
"payments": [{
"description": "Product sale - Seller receives 85%",
"price": 10000,
"beneficiary_id": sellerWallet,
"commission": {
"in_commission_percent": 15 // 15% marketplace fee
}
}]
}

Pattern 3: Dynamic Fee Based on Amount

const calculateFee = (amount) => {
if (amount < 1000) {
return { out_commission: 50 }; // Under 10 EUR: 0.50 EUR flat
}
if (amount < 10000) {
return { out_commission_percent: 2.0 }; // 10-100 EUR: 2%
}
return { out_commission_percent: 1.5 }; // Over 100 EUR: 1.5%
};
Validation

Validate Commission

const validateCommission = (payment) => {
const commission = payment.commission || {};

// Check commission not negative
if (commission.out_commission < 0 || commission.in_commission < 0) {
throw new Error('Commission cannot be negative');
}

// Check percentage reasonable
if (commission.out_commission_percent > 100 ||
commission.in_commission_percent > 100) {
throw new Error('Commission percentage cannot exceed 100%');
}

// Check incoming commission doesn't exceed payment
const inTotal = (commission.in_commission || 0) +
(payment.price * (commission.in_commission_percent || 0) / 100);

if (inTotal >= payment.price) {
throw new Error('Incoming commission cannot exceed payment amount');
}

return true;
};

API Reference​

Commission is set as part of payment creation:

POST /rest/v1/transaction
{
"payments": [{
"price": 10000,
"commission": {
"out_commission": 500,
"in_commission": 300
}
}]
}

Full API reference: Wallet API Endpoints


What's Next?​

Learn about related resources:

  1. Payment Resource - Payment details
  2. Transaction Resource - Transaction management
  3. Samples & Examples - See commissions in action

Need Help?​

Quick Reference

Outgoing: Payer pays extra (added to total)
Incoming: Beneficiary receives less (deducted from payment)
Both: Can combine for marketplace scenarios
Display: Always show commission clearly to users