Accounts

An account is one paybill, till or KopoKopo till your business can take money on. Every payment request names one by its id.

You add accounts in the dashboard with their Daraja or KopoKopo credentials; those stay encrypted and are never returned by the API. An account can also be a Mypayments paybill shared with your business (ownership: "platform"): customers pay it with account numbers issued to you.

Where's my account id?

On the account's page in the dashboard, under Use in the API, with a copy button. Or list them below with an accounts:read key.

List accounts

GET/api/v1/accounts

Scope accounts:read. Returns every account your business owns or has been granted.

# Paste your API key once (it starts with mpk_):
export MYPAYMENTS_KEY="mpk_your_key_here"

curl "https://api.mypayments.co.ke/api/v1/accounts" \
  -H "Authorization: Bearer $MYPAYMENTS_KEY"
json
{
  "success": true,
  "data": [
    {
      "uuid": "5e2989df-905b-40e9-a056-8251c2e34a37",
      "name": "Main paybill",
      "provider": "mpesa",
      "kind": "paybill",
      "environment": "production",
      "shortcode": "4123456",
      "status": "active",
      "ownership": "tenant",
      "has_credentials": true,
      "has_payout_credentials": false,
      "products": {
        "stk": true,
        "c2b": true,
        "b2c": false,
        "b2b": false
      },
      "c2b_registered_at": "2026-12-01T09:12:44Z",
      "created_at": "2026-11-30T08:01:02Z"
    }
  ]
}

Get an account

GET/api/v1/accounts/{account_id}
# Paste your API key once (it starts with mpk_):
export MYPAYMENTS_KEY="mpk_your_key_here"

curl "https://api.mypayments.co.ke/api/v1/accounts/5e2989df-905b-40e9-a056-8251c2e34a37" \
  -H "Authorization: Bearer $MYPAYMENTS_KEY"

The account object

Fields

FieldTypeRequiredDescription
uuidstringNoThe account id. Pass it as account in payment requests.
namestringNoYour label for it.
providerstringNompesa or kopokopo.
kindstringNopaybill or till.
environmentstringNoproduction (real money) or sandbox (Daraja test money).
shortcodestringNoThe paybill or till number customers see.
statusstringNoactive, or disabled: a disabled account starts no payments and declines new C2B payments.
ownershipstringNotenant (yours) or platform (a Mypayments paybill shared with you).
productsobjectNoWhat it may do: stk, c2b, b2c, b2b. B2C and B2B are off until switched on.
has_credentialsbooleanNoIts provider keys are set (values are never returned).
has_payout_credentialsbooleanNoAn initiator for payouts and Transaction Status is set.
c2b_registered_atstringNoWhen its C2B URLs were registered with Safaricom, if they were.
grantobjectNoShared accounts only: allow_stk and allow_c2b for your business.