(Script tags will be stripped)


In order to initiate M-Pesa payment with [CentiliPaymentAPI], you need to send request as HTTPS POST with Content-Type: application/json composed of parameters with associated values.

**URL to which request should be posted:**



## POST payment request



## Initiation parameters:

ParameterDescriptionExampleRequired as
**apikey**Centili issued service key, unique for every payment service. Consists of alphanumeric characters and counts up to 32 characters.f31a355df6dad07e49ba474db7ff9b07 **mandatory**
**price**End user price for an ongoing transaction.1.00 **mandatory** Look for **Keep in mind** callout box underneath this table.
**msisdn**Customer mobile phone number. NOTE: The number must be in [E.164](🔗) format, excluding the plus ("+") character.254708374149 **mandatory**
**clientid**Unique identification parameter under your system (pass-through variable).appID1optional
**userid**Identification of the customer.usrId1983 _NOTE: If the value is not set within payment request, this field will contain MSISDN of the particular customer._optional

Keep in mind:

"**price**" parameter can only be an integer as per M-Pesa regulations

## POST payment response

Once request is received, Centili will synchronously respond with POST response containing appropriate HTTP response and a list of parameters and values in JSON format:



## Response parameters:

ParameterDescriptionExample
**status**Indicates status of the current request.Possible values: _ ACCEPTED _ CHARGING_FAILED _ INVALID_REQUEST _ INVALID_SERVICE _ UNAUTHORIZED _ INACTIVE _ INVALID_MSISDN _ INVALID_OPERATOR_CODE _ INVALID_MCCMNC _ INVALID_PRICE _ DAILY_LIMIT_EXCEEDED _ MONTHLY_LIMIT_EXCEEDED
**errorMessage**Error description in case of failed transaction request.Bad request
**transactionId**Unique identifier of transaction in Centili system.123456789
**apikey**Centili issued service key, unique for every payment service. Consists of alphanumeric characters and counts up to 32 characters.f31a355df6dad07e49ba474db7ff9b07
**clientId**Unique identification parameter under your system (pass-through variable reference; max length: 256 characters).appID1
**price**End user price for specific transaction.1.00
**countryCode**Two-letter [ISO 31661 international standard code](🔗).ke (for Kenya)
**operatorCode**Code of Mobile Network Operator in Centili’s system which end user belongs to.KE_SAFARICOM (for Safaricom Kenya)
**mcc**Mobile country code.639 (example for Kenya)
**mnc**Mobile network code.02
**msisdn**Customer mobile phone number. NOTE: The number must be in [E.164](🔗) format, excluding the plus ("+") character.254708374149
**action**Signifies type of flow for the initiated transaction.Possible values: _ URL_REDIRECT _ PREMIUM _ PIN _ HANDSHAKE _NOTE: look for these [instructions](🔗) how to regulate further flow according to data received in our response (underneath this table)._
**sessionStatus**Indicatior of current state of transaction.Possible values: _ PENDING _ FAILED * COMPLETED
**urlRedirect**URL to which user should be redirected in order to continue with payment process (delivered only if action=URL_REDIRECT).
**premiumInstructions**Instruction containing keyword and shortcode user needs to configure a confirmation MO message before sending (delivered only if action=PREMIUM)."Please send GO to 1234 in order to confirm purchase." _NOTE: instruction is displayed in a local language. Check our country [coverage](🔗)._
**shortCode**Shortcode contained in premium instruction (delivered only if action=PREMIUM).1234
**smsBody**Keyword contained in premium instruction (delivered only if action=PREMIUM).GO
**handshakeInstructions**Text instructing user to reply to the received MT message in order to confirm payment (delivered only if action=HANDSHAKE)."Please send YES to 1234 in order to confirm purchase." _NOTE: message is sent in a local language. Check our country [coverage](🔗)._

## Payment Result Notification

Once transaction reaches a final state Payment Result Notification will be delivered to your system.

Payment Result Notification: https://dev.centili.com/v1.1/docs/payment-result-notification