Skip to main content
Initiate a payment for an organization. The behavior depends on the method field in the request body. For mail subscriptions, the amount is always calculated server-side from the plan, seat count, and billing cycle — any client-provided amount is ignored.

Endpoint

POST /v1/billing/pay

Headers

Authorization
string
required
Bearer token. Format: Bearer <token>
X-Organization-Id
string
required
The ID of the organization making the payment.

Request body

method
string
required
Payment method to use. One of card, mobile_money, or saved_method.
amount
number
Amount in KES (whole units, not cents). Required for non-subscription payments. Ignored for mail_subscription — the server enforces the price.
phone
string
Kenyan M-Pesa phone number. Required when method is mobile_money. Only M-Pesa numbers are supported; Airtel numbers are rejected.
paymentMethodId
string
ID of a saved payment method. Required when method is saved_method.
metadata
object
Attach structured context to the payment. Required for mail subscription purchases.

Pricing reference

Prices are in KES per seat per month. The yearly total is 10× the monthly total.
SeatsCoreGrowthScale
1–50100150220
51–50080130200
501–5,00060110180
5,001+4090160

Scenarios

Redirects the user to a Paystack-hosted card checkout page. Use the returned checkoutUrl to complete payment.
curl --request POST \
  --url https://api.nyotaimara.com/v1/billing/pay \
  --header 'Authorization: Bearer <token>' \
  --header 'X-Organization-Id: <org-id>' \
  --header 'Content-Type: application/json' \
  --data '{"method": "card", "amount": 5000}'
{
  "success": true,
  "checkoutUrl": "https://checkout.paystack.com/...",
  "reference": "NI-550e8400-e29b-41d4-a716-446655440000"
}

Response fields

success
boolean
true on a successful request.
checkoutUrl
string
Paystack-hosted checkout URL. Present for card method payments.
reference
string
Unique payment reference in the format NI-<uuid>. Use this to reconcile the transaction.
message
string
Human-readable status message. Present for mobile_money and saved_method payments.