Skip to content

Logo

Klasha

Global trade, local payments - niche payment solutions and APIs for emerging markets.

Supports in this guide: Payments, Payouts

Provider website: klasha.com


What you need to do for start processing transactions (brief summary)

  1. Choose account type
  2. Get your credentials (from Klasha)
  3. Connect in Dashboard
  4. Send an API request

Choose account type

Klasha can be connected in different ways (depending on your needs):

  • If you do direct card payments (H2H, no redirect) -> choose H2H Merchant account
  • If you do mobile money / bank transfer payments, or payouts -> choose Provider account

If you're not sure which one to use, confirm with your Corefy account manager.


Prerequisites: get from Klasha

Contact your Klasha account manager to get your account verified and receive the following credentials.

  • Public key -> Corefy field public_key.
  • Secret key -> Corefy field secret_key.
  • Encryption key -> Corefy field encryption_key - used to encrypt every request Klasha receives.
  • Refund encryption key -> Corefy field refund_encryption_key - H2H Merchant account only; optional at connect time, but required for refunds to work (see Refunds below).
  • Username / Password -> Corefy fields username/password - Provider account only.

Currencies: NGN, TZS, KES, UGX, ZAR, and several other African currencies depending on the service (see Payments/Payouts below). All requests are encrypted with your Encryption Key automatically - no extra setup is needed on your side.


Payments processing (connect H2H Merchant account, create payment-invoice)

Connect H2H Merchant account in Corefy Dashboard

Step 1 - Open connection form

Open Klasha in the provider directory and press Connect at Klasha Provider Overview page in the New connection section. Choose H2H Merchant account.

Step 2 - Fill in fields and select settings

  • Public key
  • Secret key
  • Encryption key
  • Refund encryption key -> optional, but set it if you plan to issue refunds
  • Test Mode -> (enable if you are using sandbox credentials)

Success

You have connected Klasha H2H Merchant account!


First request to Corefy API (MIN)

What it does: creates a payment-invoice; card data itself is collected and submitted separately by Corefy's checkout/SDK layer, not as part of this request.

Payment - MIN

POST /api/payment-invoices

{
  "data": {
    "type": "payment-invoice",
    "attributes": {
      "reference_id": "6be05631-8710-4b14-a369-1928a2b70eda",
      "service": "payment_card_ngn_hpp",
      "currency": "NGN",
      "amount": 100
    }
  }
}

Payment - MAX

POST /api/payment-invoices

{
  "data": {
    "type": "payment-invoice",
    "attributes": {
      "reference_id": "199be985-c243-478a-86a8-4b8c902e5bb6",
      "service": "payment_card_zar_hpp",
      "currency": "ZAR",
      "amount": 100,
      "customer": {
        "reference_id": "cus_123",
        "name": "John Doe",
        "email": "test@test.com",
        "phone": "+2347012345678",
        "address": {
          "full_address": "1 Main street",
          "country": "ZA",
          "city": "Cape Town",
          "region": "Western Cape",
          "post_code": "8001"
        }
      }
    }
  }
}

Important

  • Depending on how the issuing bank responds, Klasha may finish the sale directly, or require a redirect, a PIN entry, or an OTP confirmation - Corefy handles all of these transparently through the checkout/SDK layer, you don't need to branch your integration for them.
  • One response path (AVS, no extra authentication) strictly requires the full billing address (customer.address.full_address/.city/.region/.country/.post_code) - if Klasha's issuer routes your transaction there and these fields are missing, the payment fails validation. Sending them in every request (as in the MAX example) avoids this.
  • If customer.phone is missing and the currency isn't NGN, Corefy sends a fixed placeholder phone number (080344006699) to Klasha instead of leaving the field empty.

Constants (fallback fields)

Constants are static values that Corefy can send to the provider instead of dynamic data from your API request, when those fields are missing in the request.

Priority (predictable rule): 1. If a value is present in the request -> Corefy uses the request value 2. Else if the constant is set -> Corefy uses the constant 3. Else -> provider may reject the request or apply its defaults (depends on provider)

Currently available constants (constant -> Corefy API field)

  • REFUND_REASON -> sent with every refund request, not tied to a customer/payment field

Refunds

Klasha supports partial and multiple refunds per payment.

Important

  • A refund encryption key must be set on the account - without it, Corefy rejects the refund as an invalid-credentials error before ever contacting Klasha.
  • The second and later refund against the same payment is only sent once at least 24 hours have passed since the previous refund - an earlier attempt is held back as delayed rather than rejected outright. The very first refund on a payment has no such delay.

Payments processing (connect Provider account, create payment-invoice)

Connect Provider account in Corefy Dashboard

Step 1 - Open connection form

Open Klasha in the provider directory and press Connect at Klasha Provider Overview page in the New connection section. Choose Provider account.

Step 2 - Fill in fields and select settings

  • Username
  • Password
  • Public key
  • Secret key
  • Encryption key
  • Test Mode -> (enable if you are using sandbox credentials)

Success

You have connected Klasha Provider account!


First request to Corefy API (MIN)

What it does: creates a payment-invoice. This covers two different kinds of local methods: direct bank transfer in NGN/ZAR, and mobile money across a wide range of African mobile network operators (M-Pesa, MTN, Airtel Money, Vodacom, Tigo Pesa, Orange Money, Moov, Wave, and others) across currencies including KES, UGX, ZMW, TZS, XOF, XAF, CDF, MWK, SLL and RWF.

Payment - MIN

POST /api/payment-invoices

{
  "data": {
    "type": "payment-invoice",
    "attributes": {
      "reference_id": "8afec793-9b41-4dc4-b281-c76cc54ffb89",
      "service": "m_pesa_kes_invoice",
      "currency": "KES",
      "amount": 100
    }
  }
}

Payment - MAX

POST /api/payment-invoices

{
  "data": {
    "type": "payment-invoice",
    "attributes": {
      "reference_id": "c22e66d5-48fa-41b0-b322-55a985204e50",
      "service": "bank_transfer_ngn_invoice",
      "currency": "NGN",
      "amount": 100,
      "customer": {
        "reference_id": "cus_123",
        "name": "John Doe",
        "email": "test@test.com",
        "phone": "+2347012345678",
        "address": {
          "country": "NG"
        }
      }
    }
  }
}

Important

  • If customer.address.country, customer.email, or customer.name is missing, and the matching COUNTRY/EMAIL/FULL_NAME Constant isn't set either, Corefy falls back to fixed placeholder values: country KE, email jonhdoe@example.com (this is a real typo in the provider's own fallback), and name John Doe.
  • customer.phone has no such hardcoded fallback - if it's missing and no PHONE Constant is set, it's simply omitted.

Extended request (MAX)

Why add extra fields (typical reasons): - Provide additional customer details for compliance/reconciliation - Positively influence conversion rate - Include optional fields required by your specific flow


Constants (fallback fields)

Currently available constants (constant -> Corefy API field)

  • COUNTRY -> customer.address.country (falls back to KE if unset)
  • EMAIL -> customer.email (falls back to jonhdoe@example.com if unset)
  • FULL_NAME -> customer.name (falls back to John Doe if unset)
  • PHONE -> customer.phone (no fallback value - omitted if unset)

Refunds

Klasha does not support refunds on the Provider account Payments flow.


Payouts processing (connect Provider account, create payout-invoice)

Connect Provider account in Corefy Dashboard

Uses the same Provider account connected above - no separate connection step.

First request to Corefy API (MIN)

What it does: creates a payout-invoice for a bank transfer payout. For most currencies, Klasha exposes a per-bank service (for example a specific Nigerian bank), discovered live from Klasha's own bank list at connection time; for ZMW and TZS a single generic route is used instead.

Payout - MIN

POST /api/payout-invoices

{
  "data": {
    "type": "payout-invoice",
    "attributes": {
      "reference_id": "efbf0a2b-5590-42b7-b10b-94d49452147d",
      "service": "access_bank_nigeria_ngn",
      "currency": "NGN",
      "amount": 150,
      "customer": {
        "reference_id": "cus_123",
        "address": {
          "country": "NG"
        }
      },
      "fields": {
        "account_number": "1222951828",
        "beneficiary_first_name": "John",
        "beneficiary_last_name": "Doe"
      }
    }
  }
}

Important

  • fields.account_number is required; the beneficiary name is built from fields.beneficiary_first_name/.beneficiary_last_name.
  • For ZAR payouts specifically, Corefy additionally sends customer.phone, customer.address.full_address, and customer.email to Klasha.
  • If customer.address.country is missing, Corefy falls back to the COUNTRY Constant if one is set; there's no hardcoded fake country here.

Options

  • validate_account_number -> optional, boolean - validates the recipient's account number with Klasha before sending the payout.

Refunds

Klasha does not support refunds on Payouts.


Additional info

  1. Active reconciliation is available on all flows - both the asynchronous callback and an active status request can finalize Payments and Payouts.
  2. No recurring - this connector does not support saving/charging a token through Corefy.
  3. All outgoing requests are encrypted with your Encryption Key before being sent to Klasha - this is handled automatically.

FAQ / Troubleshooting

  • Invalid credentials / auth error -> verify the keys match the selected environment (test_mode) and account type (H2H Merchant vs Provider)
  • Refund rejected as invalid credentials -> set a Refund encryption key on the H2H Merchant account
  • Second refund on the same payment is stuck -> Klasha only accepts a repeat refund 24 hours after the previous one; it's held back, not failed
  • Payment fails only for certain cards -> the issuer may have routed the transaction through Klasha's AVS path, which requires the customer's full billing address
  • Payout service not available for a currency -> for most currencies the available bank/service list is fetched live from Klasha; confirm your account has banks configured on Klasha's side

Question

Still looking for help connecting your Klasha account? Please contact our support team!