Selcom
SelcomService connects a business's own Selcom account (ADR 76) to take card and mobile money payments on invoice links, and to pay suppliers' purchase orders to their mobile money wallets (M-Pesa, Mixx by Yas, Airtel Money, HaloPesa) from the Selcom float.
Connecting and disconnecting need settings.manage, from the dashboard; paying suppliers needs finance.manage. The invoice checkout calls are public, reached through the customer's invoice link.
GetSelcomAccount#
Request body
No fields: send {}.
Response
accountSelcomAccountcurl https://api.buziin.tech/holygrail.selcom.v1.SelcomService/GetSelcomAccount \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'{
"account": {
"available": false,
"connected": false,
"environment": "",
"keyHint": "",
"vendor": "",
"payouts": false,
"cashAccountId": "",
"cashAccountName": "Amina Mushi",
"connectedAt": ""
}
}ConnectSelcom#
Request body
environmentstringapiKeystringapi_keyapiSecretstringapi_secretvendorstringpinstringThe float PIN, to pay suppliers; empty to take payments only.
cashAccountIdstringcash_account_idWhere Selcom money is kept in the books.
Response
accountSelcomAccountcurl https://api.buziin.tech/holygrail.selcom.v1.SelcomService/ConnectSelcom \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'{
"account": {
"available": false,
"connected": false,
"environment": "",
"keyHint": "",
"vendor": "",
"payouts": false,
"cashAccountId": "",
"cashAccountName": "Amina Mushi",
"connectedAt": ""
}
}DisconnectSelcom#
Request body
No fields: send {}.
Response
No fields: send {}.
curl https://api.buziin.tech/holygrail.selcom.v1.SelcomService/DisconnectSelcom \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'{}LookupWallet#
LookupWallet returns the name a wallet is registered to, where the network offers it, so the payer can check before sending.
Request body
phonestringnetworkstringmpesa, mixx, airtel, halopesa; empty to guess from the number.
Response
phonestring255XXXXXXXXX.
networkstringnamestringEmpty when the network doesn't say (M-Pesa).
curl https://api.buziin.tech/holygrail.selcom.v1.SelcomService/LookupWallet \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"phone": "+255712345678"
}'{
"phone": "+255712345678",
"network": "",
"name": "Amina Mushi"
}PayPurchaseOrder#
PayPurchaseOrder sends money to the supplier's wallet. When Selcom confirms, it is recorded as a payment on the purchase order from the Selcom cash account. When Selcom says it is still in progress, it is asked about again every few minutes, never sent twice.
Request body
idstringA new id per payout; sending the same id again returns it.
purchaseOrderIdstringpurchase_order_idphonestringnetworkstringamountint64 stringMinor units; at most what is still owed on the order.
Response
payoutPayoutcurl https://api.buziin.tech/holygrail.selcom.v1.SelcomService/PayPurchaseOrder \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"phone": "+255712345678",
"amount": "150000"
}'{
"payout": {
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"purchaseOrderId": "",
"purchaseOrderNumber": "",
"vendorName": "Amina Mushi",
"phone": "+255712345678",
"network": "",
"recipientName": "Amina Mushi",
"amount": "150000",
"currency": "TZS",
"status": "",
"message": "",
"receipt": "",
"createdAt": ""
}
}ListPayouts#
Request body
purchaseOrderIdstringpurchase_order_idEmpty for the latest payouts of every order.
Response
payoutsPayout[]curl https://api.buziin.tech/holygrail.selcom.v1.SelcomService/ListPayouts \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'{
"payouts": [
{
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"purchaseOrderId": "",
"purchaseOrderNumber": "",
"vendorName": "Amina Mushi",
"phone": "+255712345678",
"network": "",
"recipientName": "Amina Mushi",
"amount": "150000",
"currency": "TZS",
"status": "",
"message": "",
"receipt": "",
"createdAt": ""
}
]
}CheckPayout#
CheckPayout asks Selcom now about a payout still in progress.
Request body
idstringResponse
payoutPayoutcurl https://api.buziin.tech/holygrail.selcom.v1.SelcomService/CheckPayout \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01"
}'{
"payout": {
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"purchaseOrderId": "",
"purchaseOrderNumber": "",
"vendorName": "Amina Mushi",
"phone": "+255712345678",
"network": "",
"recipientName": "Amina Mushi",
"amount": "150000",
"currency": "TZS",
"status": "",
"message": "",
"receipt": "",
"createdAt": ""
}
}GetInvoiceCheckout#
Public: whether an invoice link can be paid online, and how much.
Request body
tokenstringResponse
availablebooleandueint64 stringcurrencystringpaidbooleanWhether the last checkout for it was paid and is being recorded.
curl https://api.buziin.tech/holygrail.selcom.v1.SelcomService/GetInvoiceCheckout \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'{
"available": false,
"due": "0",
"currency": "TZS",
"paid": false
}StartInvoiceCheckout#
Public: starts a Selcom checkout for what the invoice still owes and returns the page where the customer pays by card or mobile money.
Request body
tokenstringphonestringThe customer's phone, for mobile money; optional.
emailstringResponse
paymentUrlstringpayment_urlcurl https://api.buziin.tech/holygrail.selcom.v1.SelcomService/StartInvoiceCheckout \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"phone": "+255712345678",
"email": "amina@example.co.tz"
}'{
"paymentUrl": ""
}GetPayLaterCheckout#
Public: whether a pay later plan link (ADR 121) can be paid online, and what is due now and in all.
Request body
tokenstringResponse
availablebooleandueNowint64 stringdue_nowOverdue installments and the next one.
balanceint64 stringcurrencystringpaidbooleancurl https://api.buziin.tech/holygrail.selcom.v1.SelcomService/GetPayLaterCheckout \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'{
"available": false,
"dueNow": "0",
"balance": "150000",
"currency": "TZS",
"paid": false
}StartPayLaterCheckout#
Public: starts a Selcom checkout for the plan's next installment (and anything overdue), or for everything still owed.
Request body
tokenstringphonestringemailstringpayAllbooleanpay_allPay everything still owed rather than what is due now.
Response
paymentUrlstringpayment_urlcurl https://api.buziin.tech/holygrail.selcom.v1.SelcomService/StartPayLaterCheckout \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"phone": "+255712345678",
"email": "amina@example.co.tz"
}'{
"paymentUrl": ""
}Types
The messages and enums these methods use. Field names are lowerCamelCase in JSON; the snake_case names work too. Enum values are sent as their names.
GetSelcomAccountRequest
holygrail.selcom.v1.GetSelcomAccountRequest
No fields.
ConnectSelcomRequest
holygrail.selcom.v1.ConnectSelcomRequest
environmentstringapiKeystringapi_keyapiSecretstringapi_secretvendorstringpinstringThe float PIN, to pay suppliers; empty to take payments only.
cashAccountIdstringcash_account_idWhere Selcom money is kept in the books.
DisconnectSelcomRequest
holygrail.selcom.v1.DisconnectSelcomRequest
No fields.
DisconnectSelcomResponse
holygrail.selcom.v1.DisconnectSelcomResponse
No fields.
LookupWalletRequest
holygrail.selcom.v1.LookupWalletRequest
phonestringnetworkstringmpesa, mixx, airtel, halopesa; empty to guess from the number.
LookupWalletResponse
holygrail.selcom.v1.LookupWalletResponse
phonestring255XXXXXXXXX.
networkstringnamestringEmpty when the network doesn't say (M-Pesa).
PayPurchaseOrderRequest
holygrail.selcom.v1.PayPurchaseOrderRequest
idstringA new id per payout; sending the same id again returns it.
purchaseOrderIdstringpurchase_order_idphonestringnetworkstringamountint64 stringMinor units; at most what is still owed on the order.
ListPayoutsRequest
holygrail.selcom.v1.ListPayoutsRequest
purchaseOrderIdstringpurchase_order_idEmpty for the latest payouts of every order.
CheckPayoutRequest
holygrail.selcom.v1.CheckPayoutRequest
idstringGetInvoiceCheckoutRequest
holygrail.selcom.v1.GetInvoiceCheckoutRequest
tokenstringGetInvoiceCheckoutResponse
holygrail.selcom.v1.GetInvoiceCheckoutResponse
availablebooleandueint64 stringcurrencystringpaidbooleanWhether the last checkout for it was paid and is being recorded.
StartInvoiceCheckoutRequest
holygrail.selcom.v1.StartInvoiceCheckoutRequest
tokenstringphonestringThe customer's phone, for mobile money; optional.
emailstringStartInvoiceCheckoutResponse
holygrail.selcom.v1.StartInvoiceCheckoutResponse
paymentUrlstringpayment_urlGetPayLaterCheckoutRequest
holygrail.selcom.v1.GetPayLaterCheckoutRequest
tokenstringGetPayLaterCheckoutResponse
holygrail.selcom.v1.GetPayLaterCheckoutResponse
availablebooleandueNowint64 stringdue_nowOverdue installments and the next one.
balanceint64 stringcurrencystringpaidbooleanStartPayLaterCheckoutRequest
holygrail.selcom.v1.StartPayLaterCheckoutRequest
tokenstringphonestringemailstringpayAllbooleanpay_allPay everything still owed rather than what is due now.
StartPayLaterCheckoutResponse
holygrail.selcom.v1.StartPayLaterCheckoutResponse
paymentUrlstringpayment_urlSelcomAccount
holygrail.selcom.v1.SelcomAccount
availablebooleanWhether this server can take Selcom's payment notifications.
connectedbooleanenvironmentstringsandbox or live.
keyHintstringkey_hintvendorstringpayoutsbooleanWhether a PIN was given, so suppliers can be paid.
cashAccountIdstringcash_account_idcashAccountNamestringcash_account_nameconnectedAtstringconnected_atPayout
holygrail.selcom.v1.Payout
idstringpurchaseOrderIdstringpurchase_order_idpurchaseOrderNumberstringpurchase_order_numbervendorNamestringvendor_namephonestringnetworkstringrecipientNamestringrecipient_nameamountint64 stringcurrencystringstatusstringsending, checking, paid or failed.
messagestringreceiptstringcreatedAtstringcreated_atBase URL https://api.buziin.tech. Every method is POST with a JSON body; see Making requests.