Define Transaction Costs

Define the transaction Costs that you will be charging in your App.

Overview

Transaction costs define the charges applied to various financial operations, such as sending money and withdrawing funds. These costs may vary based on transaction type, destination, amount, and the specific app or product configuration. App owners can customize and manage transaction costs for their users.


Transaction Cost Categories

Category

Destinations

Sending Money

Cooperative Bank Accounts, Other Bank Accounts, Mobile Wallets, Visa/MasterCard, PayPal

Withdrawal Charges

Bank Accounts, Agents, Mobile Wallets


Transaction Costs Structure

Range (KES)

To Coop Bank (KES)

To Other Banks (KES)

To Mobile Wallet (KES)

To Visa/MasterCard (KES)

To PayPal (KES)

10 - 1,000

10

15

20

25

30

1,001 - 10,000

20

25

30

40

50


Endpoints for Managing Transaction Costs

1. Create Transaction Costs

Used to define transaction costs for specific categories and ranges.

Method

POST

URL

/api/transaction-costs/create

Request Body:

{
  "appId": "app123",
  "type": "sendMoney",
  "productId":"prod123",
  "costs": [
    {
      "range": {
        "min": 10,
        "max": 1000
      },
      "toCoopBank": 10,
      "toOtherBanks": 15,
      "toMobileWallet": 20,
      "toVisaMasterCard": 25,
      "toPayPal": 30
    },
    {
      "range": {
        "min": 1001,
        "max": 10000
      },
      "toCoopBank": 20,
      "toOtherBanks": 25,
      "toMobileWallet": 30,
      "toVisaMasterCard": 40,
      "toPayPal": 50
    }
  ]
}

Response:

{
  "status": "success",
  "message": "Transaction costs created successfully."
}

2. Retrieve Transaction Costs

Used to retrieve the transaction costs defined for an app.

Method

GET

URL

/api/transaction-costs/get

Request Body:

{
  "appId": "app123",
  "type": "sendMoney"
}

Response:

{
  "appId": "app123",
  "type": "sendMoney",
  "productId":"prod123",
  "costs": [
    {
      "range": {
        "min": 10,
        "max": 1000
      },
      "toCoopBank": 10,
      "toOtherBanks": 15,
      "toMobileWallet": 20,
      "toVisaMasterCard": 25,
      "toPayPal": 30
    },
    {
      "range": {
        "min": 1001,
        "max": 10000
      },
      "toCoopBank": 20,
      "toOtherBanks": 25,
      "toMobileWallet": 30,
      "toVisaMasterCard": 40,
      "toPayPal": 50
    }
  ]
}

3. Update Transaction Costs

Used to modify transaction costs for specific ranges.

Method

PUT

URL

/api/transaction-costs/update

Request Body:

{
  "appId": "app123",
  "type": "sendMoney",
  "costs": [
    {
      "range": {
        "min": 10,
        "max": 1000
      },
      "toCoopBank": 12,
      "toOtherBanks": 18,
      "toMobileWallet": 22,
      "toVisaMasterCard": 28,
      "toPayPal": 35
    }
  ]
}

Response:

{
  "status": "success",
  "message": "Transaction costs updated successfully."
}

4. Delete Transaction Costs

Used to remove transaction costs for a specific type.

Method

DELETE

URL

/api/transaction-costs/delete

Request Body:

{
  "appId": "app123",
  "productId":"prod123",
  "type": "sendMoney"
}

Response:

{
  "status": "success",
  "message": "Transaction costs deleted successfully."
}

Additional Features and Notes

  • Currency: All transaction costs are denominated in KES unless otherwise specified.

  • Normalization: All requests must include appId for context, and IDs are passed in the body rather than the URL.

  • Flexibility: Costs can vary based on transaction type, destination, and range for tailored customization.

  • Server Whitelisting: Only requests originating from registered servers are accepted.

  • Dynamic Pricing: Enables unique costs per product, service, or app user tier.

  • Webhook Support: Webhooks notify apps of transaction cost updates.


Let me know if this revised version with tables captures your intent!