Developers
Sign inGet API keys
API reference/Payments

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.

holygrail.selcom.v1.SelcomService11 methodspayments.read · payments.write

GetSelcomAccount#

payments.readRead
POST/holygrail.selcom.v1.SelcomService/GetSelcomAccount

Request body

No fields: send {}.

Response

Request
curl https://api.buziin.tech/holygrail.selcom.v1.SelcomService/GetSelcomAccount \
  -H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
Response example
{
  "account": {
    "available": false,
    "connected": false,
    "environment": "",
    "keyHint": "",
    "vendor": "",
    "payouts": false,
    "cashAccountId": "",
    "cashAccountName": "Amina Mushi",
    "connectedAt": ""
  }
}

ConnectSelcom#

payments.writeWrite
POST/holygrail.selcom.v1.SelcomService/ConnectSelcom

Request body

environmentstring
apiKeystringapi_key
apiSecretstringapi_secret
vendorstring
pinstring

The float PIN, to pay suppliers; empty to take payments only.

cashAccountIdstringcash_account_id

Where Selcom money is kept in the books.

Response

Request
curl https://api.buziin.tech/holygrail.selcom.v1.SelcomService/ConnectSelcom \
  -H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
Response example
{
  "account": {
    "available": false,
    "connected": false,
    "environment": "",
    "keyHint": "",
    "vendor": "",
    "payouts": false,
    "cashAccountId": "",
    "cashAccountName": "Amina Mushi",
    "connectedAt": ""
  }
}

DisconnectSelcom#

payments.writeWrite
POST/holygrail.selcom.v1.SelcomService/DisconnectSelcom

Request body

No fields: send {}.

Response

No fields: send {}.

Request
curl https://api.buziin.tech/holygrail.selcom.v1.SelcomService/DisconnectSelcom \
  -H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
Response example
{}

LookupWallet#

payments.writeWrite
POST/holygrail.selcom.v1.SelcomService/LookupWallet

LookupWallet returns the name a wallet is registered to, where the network offers it, so the payer can check before sending.

Request body

phonestring
networkstring

mpesa, mixx, airtel, halopesa; empty to guess from the number.

Response

phonestring

255XXXXXXXXX.

networkstring
namestring

Empty when the network doesn't say (M-Pesa).

Request
curl https://api.buziin.tech/holygrail.selcom.v1.SelcomService/LookupWallet \
  -H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "phone": "+255712345678"
}'
Response example
{
  "phone": "+255712345678",
  "network": "",
  "name": "Amina Mushi"
}

PayPurchaseOrder#

payments.writeWrite
POST/holygrail.selcom.v1.SelcomService/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

idstring

A new id per payout; sending the same id again returns it.

purchaseOrderIdstringpurchase_order_id
phonestring
networkstring
amountint64 string

Minor units; at most what is still owed on the order.

Response

payoutPayout
Request
curl 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"
}'
Response example
{
  "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#

payments.readRead
POST/holygrail.selcom.v1.SelcomService/ListPayouts

Request body

purchaseOrderIdstringpurchase_order_id

Empty for the latest payouts of every order.

Response

payoutsPayout[]
Request
curl https://api.buziin.tech/holygrail.selcom.v1.SelcomService/ListPayouts \
  -H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
Response example
{
  "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#

payments.writeWrite
POST/holygrail.selcom.v1.SelcomService/CheckPayout

CheckPayout asks Selcom now about a payout still in progress.

Request body

idstring

Response

payoutPayout
Request
curl 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"
}'
Response example
{
  "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#

payments.readRead
POST/holygrail.selcom.v1.SelcomService/GetInvoiceCheckout

Public: whether an invoice link can be paid online, and how much.

Request body

tokenstring

Response

availableboolean
dueint64 string
currencystring
paidboolean

Whether the last checkout for it was paid and is being recorded.

Request
curl https://api.buziin.tech/holygrail.selcom.v1.SelcomService/GetInvoiceCheckout \
  -H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
Response example
{
  "available": false,
  "due": "0",
  "currency": "TZS",
  "paid": false
}

StartInvoiceCheckout#

payments.writeWrite
POST/holygrail.selcom.v1.SelcomService/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

tokenstring
phonestring

The customer's phone, for mobile money; optional.

emailstring

Response

paymentUrlstringpayment_url
Request
curl 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"
}'
Response example
{
  "paymentUrl": ""
}

GetPayLaterCheckout#

payments.readRead
POST/holygrail.selcom.v1.SelcomService/GetPayLaterCheckout

Public: whether a pay later plan link (ADR 121) can be paid online, and what is due now and in all.

Request body

tokenstring

Response

availableboolean
dueNowint64 stringdue_now

Overdue installments and the next one.

balanceint64 string
currencystring
paidboolean
Request
curl https://api.buziin.tech/holygrail.selcom.v1.SelcomService/GetPayLaterCheckout \
  -H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
Response example
{
  "available": false,
  "dueNow": "0",
  "balance": "150000",
  "currency": "TZS",
  "paid": false
}

StartPayLaterCheckout#

payments.writeWrite
POST/holygrail.selcom.v1.SelcomService/StartPayLaterCheckout

Public: starts a Selcom checkout for the plan's next installment (and anything overdue), or for everything still owed.

Request body

tokenstring
phonestring
emailstring
payAllbooleanpay_all

Pay everything still owed rather than what is due now.

Response

paymentUrlstringpayment_url
Request
curl 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"
}'
Response example
{
  "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.

GetSelcomAccountResponse

holygrail.selcom.v1.GetSelcomAccountResponse

ConnectSelcomRequest

holygrail.selcom.v1.ConnectSelcomRequest

environmentstring
apiKeystringapi_key
apiSecretstringapi_secret
vendorstring
pinstring

The float PIN, to pay suppliers; empty to take payments only.

cashAccountIdstringcash_account_id

Where Selcom money is kept in the books.

ConnectSelcomResponse

holygrail.selcom.v1.ConnectSelcomResponse

DisconnectSelcomRequest

holygrail.selcom.v1.DisconnectSelcomRequest

No fields.

DisconnectSelcomResponse

holygrail.selcom.v1.DisconnectSelcomResponse

No fields.

LookupWalletRequest

holygrail.selcom.v1.LookupWalletRequest

phonestring
networkstring

mpesa, mixx, airtel, halopesa; empty to guess from the number.

LookupWalletResponse

holygrail.selcom.v1.LookupWalletResponse

phonestring

255XXXXXXXXX.

networkstring
namestring

Empty when the network doesn't say (M-Pesa).

PayPurchaseOrderRequest

holygrail.selcom.v1.PayPurchaseOrderRequest

idstring

A new id per payout; sending the same id again returns it.

purchaseOrderIdstringpurchase_order_id
phonestring
networkstring
amountint64 string

Minor units; at most what is still owed on the order.

PayPurchaseOrderResponse

holygrail.selcom.v1.PayPurchaseOrderResponse

payoutPayout

ListPayoutsRequest

holygrail.selcom.v1.ListPayoutsRequest

purchaseOrderIdstringpurchase_order_id

Empty for the latest payouts of every order.

ListPayoutsResponse

holygrail.selcom.v1.ListPayoutsResponse

payoutsPayout[]

CheckPayoutRequest

holygrail.selcom.v1.CheckPayoutRequest

idstring

CheckPayoutResponse

holygrail.selcom.v1.CheckPayoutResponse

payoutPayout

GetInvoiceCheckoutRequest

holygrail.selcom.v1.GetInvoiceCheckoutRequest

tokenstring

GetInvoiceCheckoutResponse

holygrail.selcom.v1.GetInvoiceCheckoutResponse

availableboolean
dueint64 string
currencystring
paidboolean

Whether the last checkout for it was paid and is being recorded.

StartInvoiceCheckoutRequest

holygrail.selcom.v1.StartInvoiceCheckoutRequest

tokenstring
phonestring

The customer's phone, for mobile money; optional.

emailstring

StartInvoiceCheckoutResponse

holygrail.selcom.v1.StartInvoiceCheckoutResponse

paymentUrlstringpayment_url

GetPayLaterCheckoutRequest

holygrail.selcom.v1.GetPayLaterCheckoutRequest

tokenstring

GetPayLaterCheckoutResponse

holygrail.selcom.v1.GetPayLaterCheckoutResponse

availableboolean
dueNowint64 stringdue_now

Overdue installments and the next one.

balanceint64 string
currencystring
paidboolean

StartPayLaterCheckoutRequest

holygrail.selcom.v1.StartPayLaterCheckoutRequest

tokenstring
phonestring
emailstring
payAllbooleanpay_all

Pay everything still owed rather than what is due now.

StartPayLaterCheckoutResponse

holygrail.selcom.v1.StartPayLaterCheckoutResponse

paymentUrlstringpayment_url

SelcomAccount

holygrail.selcom.v1.SelcomAccount

availableboolean

Whether this server can take Selcom's payment notifications.

connectedboolean
environmentstring

sandbox or live.

keyHintstringkey_hint
vendorstring
payoutsboolean

Whether a PIN was given, so suppliers can be paid.

cashAccountIdstringcash_account_id
cashAccountNamestringcash_account_name
connectedAtstringconnected_at

Payout

holygrail.selcom.v1.Payout

idstring
purchaseOrderIdstringpurchase_order_id
purchaseOrderNumberstringpurchase_order_number
vendorNamestringvendor_name
phonestring
networkstring
recipientNamestringrecipient_name
amountint64 string
currencystring
statusstring

sending, checking, paid or failed.

messagestring
receiptstring
createdAtstringcreated_at

Base URL https://api.buziin.tech. Every method is POST with a JSON body; see Making requests.