POSTURL:
https://app.kulmipay.com/api/v1/collect
Authentication
Authenticate with a Bearer token or by passing yourpublic_key in the request body. Do not use both at the same time.
Request
Required fields
Payment method to use. One of:
M-PESA, CARD-PAYMENT, APPLE-PAY, GOOGLE-PAY, PESALINK, BITCOIN, BANK-ACH.Transaction currency. One of:
KES, USD, EUR, GBP. M-Pesa and PesaLink always settle in KES — if you pass a different currency, Kulmi Pay converts the amount using live exchange rates.Payment amount as a decimal string, for example
"1500.00". For M-Pesa the minimum is KES 10 and the maximum is KES 150,000.Your unique reference for this payment, up to 140 characters. Store this value — you use it to reconcile transactions on your side.
Customer identity
Customer phone number. Required for M-Pesa. Use international format, for example
254712345678.Customer email address. Required for CARD-PAYMENT, BITCOIN, and BANK-ACH.
Customer first name. Required for CARD-PAYMENT and BANK-ACH.
Customer last name. Required for CARD-PAYMENT and BANK-ACH.
Authentication alternative
Your publishable API key. Use this instead of a Bearer token when calling from a client-side environment. Must match the environment (sandbox keys contain
test, live keys contain live).Fee configuration
Who pays the processing fee for mobile money payments. Either
BUSINESS-PAYS (fee deducted from your settlement) or CUSTOMER-PAYS (fee added to the customer-facing amount).Who pays the processing fee for card payments. Either
BUSINESS-PAYS or CUSTOMER-PAYS.Wallet routing
The alias ID of a specific wallet to receive the funds. If omitted, funds settle into your default settlement wallet for the transaction currency.
Card payment fields
The following fields are required whenmethod is CARD-PAYMENT.
Full card number, digits only, up to 20 characters.
Card expiry date in
MM/YY format, for example 08/27.Card security code, 3–4 digits.
Two-letter ISO 3166-1 alpha-2 country code for the billing address, for example
US. Required for card payments. Zipcode is also required when the country is US, CA, or GB.Postal or ZIP code for the billing address.
City for the billing address.
State or region for the billing address.
Street address for billing, up to 140 characters.
Response
Details of the invoice created for this payment.
A JWT you use with the payment status endpoint to authenticate status checks without a server-side secret key. Store it alongside the invoice ID.
Code examples
Example response
For M-Pesa payments, the invoice state starts as
PENDING. The customer receives an STK push prompt on their phone and must enter their PIN to complete the payment. Poll the payment status endpoint or use webhooks to detect when the state changes to COMPLETE or FAILED.