Register an M-Pesa shortcode as a payment channel.
channelId
to route the payment through a particular shortcode.
This is useful when:
isDefault: true to use it automatically when no channelId is
supplied in payment requests. Only one channel can be the default — setting a new default
removes the flag from the previous one.
| Type | Description |
|---|---|
PAYBILL | M-Pesa Paybill shortcode. Requires an accountNumber. |
TILL_NUMBER | M-Pesa Till Number (Buy Goods). No account number needed. |
SEND_MONEY | Direct M-Pesa send money. |
Use your API key as the username. Leave the password field empty.
Authorization: Basic <base64(apikey:)>You can also pass the raw API key:
Authorization: Basic <apikey>Human-readable label for the channel.
"Main Collections Paybill"
PAYBILL, TILL_NUMBER, SEND_MONEY M-Pesa shortcode (Paybill number or Till number).
"123456"
Account number for Paybill channels (not used for Till).
"ACCOUNT001"
Set this channel as the default for payment requests that do not
specify a channelId.