Dynamic Commission Fees

We have introduced a new enhancement to the Checkout API allowing sub-merchants to dynamically specify a commission amount at the time of checkout. This change provides greater flexibility and control over transaction-level commission settings.

Important Notes

This feature is available only to sub-merchants where:

  • The sub-merchant has Dynamic Commission enabled
  • The parent/main merchant has also enabled Dynamic Commission

If you don't see this option, contact your parent merchant or Hesabe support to enable it.

Implementation Guide

Payment Checkout Integration Steps

Refer Hesabe Checkout API Guides before integrating subscription steps

Pre-requisites Setup

You can follow the Checkout Setup guide to get started.

Hesabe Request Handler

You can follow the Hesabe Request Handler guide to get started.

Dynamic Commission Checkout Flow Logic

How Hesabe Processes Dynamic Commission Requests:

checkout.php
  $baseUrl =  "http://sandbox.hesebe.com/api/";
  $CheckoutApiUrl = "{$baseUrl}/checkout"; 
  $requestData = [
      "merchantCode" => "842217",  // Sandbox
      "amount" => "100.000", 
      "paymentType" => "2", // Refer "List of Payment Types” Section
      "commission" => '0.500', // Total commission amount
      "responseUrl" => "https://sandbox.hesabe.com/customer-response?id=842217", 
      "failureUrl" => "https://sandbox.hesabe.com/customer-response?id=842217", 
      "version" => "2.0", 
      "orderReferenceNumber" => "9874659805", 
      "currency" => "KWD", 
      "name" => "customername", 
      "email" => "customeremail@gmail.com", 
      "mobile_number" => "66666666", 
      "variable1" => "First__variable", 
      "variable2" => "Second__variable", 
      "variable3" => "Third__variable", 
      "variable4" => "forth__variable", 
      "variable5" => "example.com",
      "webhookUrl" => 'https://yourdomain.com/example' 
  ]; 
StepConditionActionResult
1Commission parameter NOT providedSkip dynamic commission feature✅ Proceed with standard checkout flow
2Commission parameter PROVIDEDCheck: Is merchant a sub-merchant?• YES → Continue to Step 3
• NO → ❌ Reject (feature unavailable)
3Sub-merchant confirmedCheck: Does merchant have DC enabled?• YES → Continue to Step 4
• NO → ❌ Reject (DC not enabled)
4Sub-merchant DC enabledCheck: Does parent merchant have DC enabled?• YES → Continue to Step 5
• NO → ❌ Reject (parent DC not enabled)
5Both have DC enabledValidate commission amount against rules• Passes → Continue to Step 6
• Fails → ❌ Return Error 525
6Validation passedProcess payment with your commissionCheckout proceeds successfully
7Validation failedReturn error response❌ Error Code: 525
Message: "Invalid commission. Must be greater than minimum and less than transaction"

Quick Decision Tree:

ScenarioFlowOutcome
No commission providedSkip DC → Use standard checkout✅ Normal payment flow
Commission provided + Sub-merchant + Both DC enabled + Commission validProcess with dynamic rate✅ Payment accepted with your rate
Commission provided + Not a sub-merchantSkip DC❌ Feature unavailable
Commission provided + Sub-merchant DC disabledSkip DC❌ Feature disabled on account
Commission provided + Parent merchant DC disabledSkip DC❌ Parent hasn't enabled DC
Commission provided + Commission invalid (below minimum or above amount)Reject❌ Error 525: Invalid commission

Validation Rules

The provided dynamic commission will be validated against the following criteria:

RulesDescription
Minimum ThresholdThe commission must be greater than or equal to Hesabe platform main merchant commission
Hesabe Indirect Payment MethodIf payment method is indirect, sub-merchant commission must be greater than maximum commission set for main merchant across all available payment methods
Hesabe Direct Payment MethodIf payment method is direct, it is validated commission only against the specific payment type selected

Dynamic Commission Examples

Use Case: Dynamic Commission on a 100 KD Transaction

Aspect✅ Equals Minimum✅ Exceeds Minimum❌ Below Minimum
ScenarioCommission equals Hesabe's minimumCommission exceeds minimumCommission below minimum
Transaction Amount100.000 KD100.000 KD100.000 KD
Hesabe Platform Commission0.200 KD0.200 KD0.200 KD (Required)
Your Commission0.200 KD0.500 KD0.100 KD
Commission Status✅ Equal to minimum✅ Exceeds minimum❌ Below minimum
Result✅ APPROVED✅ APPROVED❌ REJECTED
Distribution0.200 KD → Hesabe
0.000 KD → Parent Merchant
0.200 KD → Hesabe
0.300 KD → Parent Merchant
N/A - Payment Failed
Client Earns0.000 KD0.300 KD0.000 KD (Rejected)
Error Code--525
Error Message--Invalid commission. Must be >= 0.200 KD
Next Steps✅ Payment accepted✅ Payment accepted1. Increase to ≥ 0.200 KD
2. Use default commission
3. Review strategy
SummaryPayment accepted. Commission covers Hesabe fee exactly.Payment accepted. Excess (0.300 KD) shared with parent merchant.Payment rejected. Retry with valid commission.

Create checkout request

Pass the following parameters below:

Sandbox Checkout API

Below Checkout API strictly for sandbox testing only. Never use these sandbox URL's in production environment

https://sandbox.hesabe.com/api/checkout

Production Checkout API

Use the following Checkout API strictly for production transactions. Ensure that you never use these production URLs in the sandbox or testing environment

https://api.hesabe.com/api/checkout
checkout.php
    $baseUrl =  "http://sandbox.hesebe.com/api/";
    $CheckoutApiUrl = "{$baseUrl}/checkout"; 
    $requestData = [
        "merchantCode" => "842217",  // Sandbox
        "amount" => "100.000", 
        "paymentType" => "2", // Refer "List of Payment Types” Section
        "commission" => '0.500', // Total commission amount
        "responseUrl" => "https://sandbox.hesabe.com/customer-response?id=842217", 
        "failureUrl" => "https://sandbox.hesabe.com/customer-response?id=842217", 
        "version" => "2.0", 
        "orderReferenceNumber" => "9874659805", 
        "currency" => "KWD", 
        "name" => "customername", 
        "email" => "customeremail@gmail.com", 
        "mobile_number" => "66666666", 
        "variable1" => "First__variable", 
        "variable2" => "Second__variable", 
        "variable3" => "Third__variable", 
        "variable4" => "forth__variable", 
        "variable5" => "example.com",
        "webhookUrl" => 'https://yourdomain.com/example' 
    ]; 

Here's an subscription transaction parameters details

FieldTypeDescriptionRequired
merchantCode
NumericAssigned by HesabeYes
amount
NumericAmount in currencyYes
commission
decimalMust be between 0.000 and 100000.000 and Allows up to 3 decimal places onlyYes
responseUrl
AlphanumericRedirect URL on successYes
failureUrl
AlphanumericRedirect URL on failureYes
version
Alphanumeric2.0Yes
orderReferenceNumber
StringYour reference / order IDYes
paymentType
NumericRefer to the “List of Payment Types” section below for more informationYes

List of payment types

Below are the available payment method options supported by Hesabe

Payment TypesValue
KNET"1"
MPGS"2"
CYBS"5"
AMEX"7"
MPGS AMEX"8"
MPGS Apple Pay"9"
CYBS Apple Pay"10"
KNET Debit Apple Pay"11"
KNET Credit Apple Pay"12"
KNET Apple Pay International"13"
AMEX Apple Pay International"14"
Google Pay"16"

Additional Checkout API Parameters

Optional parameters that allow you to include extra data or customize the checkout flow in your API request

FieldTypeDescriptionRequired
name
StringCustomer NameOptional
mobile_number
Numeric (8)Customer Mobile Number ( Without country code )Optional
email
StringCustomer Email AddressOptional
webhookUrl
StringYour endpoint for receiving payment statusOptional
variable1
AlphanumericCustom user parameter which will be included in the response when it returnsOptional
variable2
AlphanumericCustom user parameter which will be included in the response when it returnsOptional
variable3
AlphanumericCustom user parameter which will be included in the response when it returnsOptional
variable4
AlphanumericCustom user parameter which will be included in the response when it returnsOptional
variable5
StringCustom user parameter which will be included in the response when it returnsOptional

For Any Technical Assistance

If you encounter any issues or need support during setup or integration, please contact our technical team for assistance.

Hesabe IT Support

Email address:itsupport@hesabe.com