Startbutton Product API
  • Startbutton API doc
    • Get Started
    • Accept Payments
    • Server-to-Server Integration
      • S2S Integration for Virtual Accounts
        • S2S Virtual account (NGN)
        • S2S Virtual account (GHS)
        • S2S EFT (ZAR)
      • S2S Integration for Mobile Money
        • S2S MoMo (KES and GHS)
        • S2S MoMo (TZS and UGX)
        • S2S MoMo (RWF)
        • S2S MoMo XOF and XAF
    • Re-charge Card
    • Subscriptions
    • Payment Links
    • Currency Conversion
    • Get Wallet Balance
    • Transfer
      • Bank List
    • Security Measures.
      • IP Whitelisting
    • Webhook
    • Transaction Status
    • Get FX Rate
    • Under and Overpayments
    • Refunds
      • Refund Transaction Status (TSQ)
    • Available Currencies
    • FAQs
  • Advanced Security
    • Signed Payload for Transfer Requests.
Powered by GitBook
On this page
  • Initiate S2S
  • OTP Verify
  1. Startbutton API doc
  2. Server-to-Server Integration
  3. S2S Integration for Mobile Money

S2S MoMo (KES and GHS)

Initiate S2S

Authorization
Set to Bearer PUBLIC_KEY

Content-Type

Set value to application/json

The public key can be gotten from the 'Settings' page on your Startbutton dashboard.

Post a request to the URL below, where the base URL is determined by the environment you are in.

BaseUrls

PROD : https://api.startbutton.tech

DEV/ Staging: https://api-dev.startbutton.tech

POST {{baseurl}}/transaction/initialize/s2s/mobile_money

Here's a sample request below

{
    "provider": "mpesa",
    "phone": "0710000000",
    "email": "kass1-pms@customer.com",
    "amount": 3000,
    "currency": "KES"
}
{
    "provider": "mpesa",
    "phone": "+254710000000",
    "email": "kass1-pms@customer.com",
    "amount": 3000,
    "currency": "KES",
    "reference": "de432cr4d34e"
}
{
    "provider": "MTN",
    "phone": "0551234987",
    "amount": 300000,
    "currency": "GHS",
    "email": "test-pms@customer.com"
}

We have 3 providers for GHS: - MTN- passed as "MTN" - AIRTEL passed as "ATL" - VODAFONE- passed as "VOD"

{
    "provider": "MTN",
    "phone": "0551234987",
    "amount": 300000,
    "currency": "GHS",
    "reference": "de432cr4d34e",
    "email": "test-pms@customer.com"
}

The amount should be in fractional units.

Here's a sample response

{
    "success": true,
    "message": "Charge attempted, requery to get status",
    "data": {
        "nextStep": "PIN",
        "reference": "610ae86889ee"
    }
}
{
    "success": true,
    "message": "Charge attempted, requery to get status",
    "data": {
        "nextStep": "PIN",
        "reference": "42452be51db0"
    }
}
{
    "success": false,
    "message": "unknown provider"
}

The next step can either be OTP or PIN. If your customer is new to the service, they'll receive an OTP initially. Afterwards, for subsequent transactions, they'll be provided with a PIN.

When it is an OTP; you need to present the User with a screen to enter OTP and then call the endpoint below

OTP Verify

POST {{baseurl}}/transaction/initialize/s2s/mobile_money/otp-verify

Authorization
Set to Bearer PUBLIC_KEY

Here's a sample response

{
  "reference": "610ae86889ee",
  "otp": "123456"
}

Here's a sample response

{
    "status": true,
    "message": "Charge attempted",
    "data": {
        "status": "requery",
        "message": "Confirming payment"
    }
}
{
    "success": false,
    "message": "Invalid OTP",
    "data": null
}

However, if the next step is a PIN your users only need to enter their PIN on the prompt on their phone.

PreviousS2S Integration for Mobile MoneyNextS2S MoMo (TZS and UGX)

Last updated 2 months ago