API Live

API reference

Methods

GET /methods

List the payment rails this gateway offers

The machine-readable source of truth for which rails are available and how to invoke each one. Call this first — it is what the hosted checkout builds its picker from, so it is exactly what a customer can choose.

Each entry carries kind (the source.type to send on POST /charges), requires_phone, the currency and country filters, amount bounds, and connector — the implementation behind the rail. A connector named mock_* does NOT move money; in live mode the checkout refuses to offer those, so a rail present in test mode may legitimately be absent in live.

For one payment (optional): currency drops the rails whose currencies exclude it; amount (decimal major units) drops those whose min_amount/max_amount it falls outside. Called with an account's key, the list also leaves out the rails that account cannot charge now (a dry run of the charge's route: no connector binding, a routing rule, a PSP's capability matrix or the launch matrix that refuses it). Each entry says payer_code: true when the rail is charged with a one-time code the payer reads from their wallet rather than by a push to their phone. Also served at /v1/methods.

Parameters

NameInTypeDescription
currencyquerystring ISO 4217 code: only the rails that take it.
amountquerystring Decimal major units: only the rails whose bounds admit it.

Responses

  • 200 The catalogue, plus the gateway's current mode.
  • 400 invalid_request: a malformed currency or amount.

Request

curl -X GET "$KULPAY_URL/methods" \
  -H "Authorization: Bearer $KULPAY_KEY"
200 Response application/json
{
  "methods": [
    {
      "connector": "mock_redirect",
      "kind": "bank_redirect",
      "label": "Bank Redirect",
      "max_amount": 50000000,
      "method": "bank_redirect",
      "min_amount": 0.01,
      "payer_code": false,
      "subtitle": "Open banking / PSD2"
    },
    {
      "connector": "mock_bank_transfer",
      "kind": "bank_transfer",
      "label": "Bank Transfer",
      "max_amount": 50000000,
      "method": "bank_transfer",
      "min_amount": 100,
      "payer_code": false,
      "subtitle": "Direct transfer"
    }
  ],
  "mode": "test"
}
400 Error · invalid_request application/problem+json
{
  "code": "invalid_request",
  "detail": "currency must be an ISO 4217 code, for example MZN.",
  "error": {
    "code": "invalid_request",
    "message": "currency must be an ISO 4217 code, for example MZN."
  },
  "status": 400,
  "title": "Invalid currency",
  "type": "about:blank"
}

GET /v1/methods

List the payment rails (same as GET /methods)

The machine-readable source of truth for which rails are available and how to invoke each one. Call this first — it is what the hosted checkout builds its picker from, so it is exactly what a customer can choose.

Each entry carries kind (the source.type to send on POST /charges), requires_phone, the currency and country filters, amount bounds, and connector — the implementation behind the rail. A connector named mock_* does NOT move money; in live mode the checkout refuses to offer those, so a rail present in test mode may legitimately be absent in live.

For one payment (optional): currency drops the rails whose currencies exclude it; amount (decimal major units) drops those whose min_amount/max_amount it falls outside. Called with an account's key, the list also leaves out the rails that account cannot charge now (a dry run of the charge's route: no connector binding, a routing rule, a PSP's capability matrix or the launch matrix that refuses it). Each entry says payer_code: true when the rail is charged with a one-time code the payer reads from their wallet rather than by a push to their phone. Also served at /v1/methods.

Parameters

NameInTypeDescription
currencyquerystring ISO 4217 code: only the rails that take it.
amountquerystring Decimal major units: only the rails whose bounds admit it.

Responses

  • 200 The catalogue, plus the gateway's current mode.
  • 400 invalid_request: a malformed currency or amount.

Request

curl -X GET "$KULPAY_URL/v1/methods" \
  -H "Authorization: Bearer $KULPAY_KEY"
200 Response application/json
{
  "methods": [
    {
      "connector": "mock_redirect",
      "kind": "bank_redirect",
      "label": "Bank Redirect",
      "max_amount": 50000000,
      "method": "bank_redirect",
      "min_amount": 0.01,
      "payer_code": false,
      "subtitle": "Open banking / PSD2"
    },
    {
      "connector": "mock_bank_transfer",
      "kind": "bank_transfer",
      "label": "Bank Transfer",
      "max_amount": 50000000,
      "method": "bank_transfer",
      "min_amount": 100,
      "payer_code": false,
      "subtitle": "Direct transfer"
    }
  ],
  "mode": "test"
}
400 Error · invalid_request application/problem+json
{
  "code": "invalid_request",
  "detail": "currency must be an ISO 4217 code, for example MZN.",
  "error": {
    "code": "invalid_request",
    "message": "currency must be an ISO 4217 code, for example MZN."
  },
  "status": 400,
  "title": "Invalid currency",
  "type": "about:blank"
}

GET /v1/mobile-networks

Which numbers belong to which mobile wallet

The enabled mobile networks and their prefixes, as every wallet charge is checked: a charge whose number belongs to another network is refused with phone_network_mismatch. Read it to recognise a number the way the Gateway will (KulOffice caches it a few minutes). phone_pattern is the same numbers as a regular expression. The set is changed by one operator and approved by another; version 0 is the built-in values.

Responses

  • 200 The networks in force.
  • 401 Missing or invalid bearer token. unauthorized

Request

curl -X GET "$KULPAY_URL/v1/mobile-networks" \
  -H "Authorization: Bearer $KULPAY_KEY"
200 Response application/json
{
  "networks": [
    {
      "code": "mpesa",
      "collectable": true,
      "country_code": "258",
      "enabled": true,
      "label": "M-Pesa",
      "national_length": 9,
      "operator": "Vodacom",
      "phone_pattern": "^\\+258\\s?(84|85)\\s?\\d{3}\\s?\\d{4}$",
      "prefixes": [
        "84",
        "85"
      ]
    },
    {
      "code": "emola",
      "collectable": true,
      "country_code": "258",
      "enabled": true,
      "label": "e-Mola",
      "national_length": 9,
      "operator": "Movitel",
      "phone_pattern": "^\\+258\\s?(86|87)\\s?\\d{3}\\s?\\d{4}$",
      "prefixes": [
        "86",
        "87"
      ]
    },
    {
      "code": "mkesh",
      "collectable": false,
      "country_code": "258",
      "enabled": true,
      "label": "mKesh",
      "national_length": 9,
      "operator": "Tmcel",
      "phone_pattern": "^\\+258\\s?(82|83)\\s?\\d{3}\\s?\\d{4}$",
      "prefixes": [
        "82",
        "83"
      ]
    }
  ],
  "version": 0
}
401 Error · unauthorized application/problem+json
{
  "code": "unauthorized",
  "detail": "Missing or invalid API key.",
  "error": {
    "code": "unauthorized",
    "message": "Missing or invalid API key."
  },
  "status": 401,
  "title": "Unauthorized",
  "type": "about:blank"
}