-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yml
More file actions
874 lines (872 loc) · 33.3 KB
/
openapi.yml
File metadata and controls
874 lines (872 loc) · 33.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
openapi: 3.0.0
info:
title: Safaricom APIs
description: M-Pesa API client for Daraja
version: 1.0.0
servers:
- url: https://sandbox.safaricom.co.ke
- url: https://api.safaricom.co.ke
paths:
/mpesa/b2b/v1/paymentrequest:
post:
tags:
- payments
summary: Make a B2B Payment Request
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/B2BPaymentRequest"
responses:
"200":
description: Successful response
content:
application/json:
schema:
$ref: "#/components/schemas/B2BPaymentResponse"
examples:
response:
value: |-
{
"OriginatorConversationID": "5118-111210482-1",
"ConversationID": "AG_20230420_2010759fd5662ef6d054",
"ResponseCode": "0",
"ResponseDescription": "Accept the service request successfully."
}
/mpesa/reversal/v1/request:
post:
tags:
- experience
summary: Reverse an M-Pesa Transaction
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/TransactionReversalRequest"
responses:
"200":
description: Successful response
content:
application/json:
schema:
$ref: "#/components/schemas/TransactionReversalResponse"
examples:
response:
value: |-
{
"OriginatorConversationID":"71840-27539181-07",
"ConversationID": "AG_20210709_12346c8e6f8858d7b70a",
"ResponseCode":"0",
"ResponseDescription": "Accept the service request successfully."
}
/mpesa/transactionstatus/v1/query:
post:
tags:
- experience
summary: Query the Transaction Status of an M-Pesa Transaction
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/TransactionStatusQueryRequest"
responses:
"200":
description: Successful response
content:
application/json:
schema:
$ref: "#/components/schemas/TransactionStatusQueryResponse"
examples:
response:
value: |-
{
"OriginatorConversationID": "1236-7134259-1",
"ConversationID": "AG_20210709_1234409f86436c583e3f ",
"ResponseCode": "0",
"ResponseDescription": "Accept the service request successfully."
}
/mpesa/c2b/v1/simulate:
post:
tags:
- payments
summary: Simulate a C2B Payment
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/C2BPaymentSimulationRequest"
responses:
"200":
description: Successful response
content:
application/json:
schema:
$ref: "#/components/schemas/C2BPaymentSimulationResponse"
examples:
response:
value: |-
{} # Empty response schema
/mpesa/stkpushquery/v1/query:
post:
tags:
- experience
summary: Query the status of a Lipa na M-Pesa Online Payment
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/StkPushQueryRequest"
responses:
"200":
description: Successful response
content:
application/json:
schema:
$ref: "#/components/schemas/StkPushQueryResponse"
examples:
response:
value: |-
{
"ResponseCode":"0",
"ResponseDescription": "The service request has been accepted successfully",
"MerchantRequestID":"22205-34066-1",
"CheckoutRequestID": "ws_CO_13012021093521236557",
"ResultCode":"0",
"ResultDesc":"The service request is processed successfully."
}
/mpesa/b2c/v3/paymentrequest:
post:
tags:
- disbursement
summary: Make a B2C Payment Request
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/B2CPaymentRequest"
responses:
"200":
description: Successful response
content:
application/json:
schema:
$ref: "#/components/schemas/B2CPaymentResponse"
examples:
response:
value:
ConversationID: "AG_20191219_00005797af5d7d75f652"
OriginatorConversationID: "16740-34861180-1"
ResponseCode: "0"
ResponseDescription: "Accept the service request successfully."
"4XX":
description: Client Error - Request validation failures, authentication issues, or invalid parameters
content:
application/json:
schema:
$ref: "#/components/schemas/B2CErrorResponse"
examples:
invalid_token:
value:
requestId: "11728-2929992-1"
errorCode: "401.002.01"
errorMessage: "Error Occurred - Invalid Access Token - BJGFGOXv5aZnw90KkA4TDtu4Xdyf"
"5XX":
description: Server Error - M-Pesa system errors or temporary service unavailability
content:
application/json:
schema:
$ref: "#/components/schemas/B2CErrorResponse"
/mpesa/stkpush/v1/processrequest:
post:
tags:
- payments
summary: Initiate a Lipa na M-Pesa Online Payment
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/StkPushRequest"
responses:
"200":
description: Successful response
content:
application/json:
schema:
$ref: "#/components/schemas/StkPushResponse"
examples:
response:
value: |-
{} # Empty response schema
/mpesa/accountbalance/v1/query:
post:
tags:
- experience
summary: Make an Account Balance query
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/AccountBalanceQueryRequest"
responses:
"200":
description: Successful response
content:
application/json:
schema:
$ref: "#/components/schemas/AccountBalanceQueryResponse"
examples:
response:
value: |-
{
"OriginatorConversationID": " ",
"ConversationID": " ",
"ResponseCode": " ",
"ResponseDescription": " "
}
/oauth/v1/generate:
get:
tags:
- security
summary: Generate an OAuth Access Token
security:
- basicAuth: []
parameters:
- name: grant_type
in: query
schema:
type: string
default: client_credentials
responses:
"200":
description: Successful response
content:
application/json:
schema:
$ref: "#/components/schemas/OAuthAccessTokenResponse"
examples:
credentials:
value: |-
{
"access_token": "c9SQxWWhmdVRlyh0zh8gZDTkubVF",
"expires_in":"3599"
}
/mpesa/c2b/v2/registerurl:
post:
tags:
- payments
summary: Register C2B Confirmation and Validation URLs
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/C2BURLRegistrationRequest"
responses:
"200":
description: Successful response
content:
application/json:
schema:
$ref: "#/components/schemas/C2BURLRegistrationResponse"
examples:
response:
value: |-
{
"OriginatorCoversationID": "7619-37765134-1",
"ResponseCode": "0",
"ResponseDescription": "success"
}
components:
securitySchemes:
bearerAuth:
type: apiKey
in: header
name: Authorization
basicAuth:
type: http
scheme: basic
schemas:
B2CErrorResponse:
type: object
required:
- requestId
- errorCode
- errorMessage
properties:
requestId:
type: string
description: Unique identifier for the failed request
example: "11728-2929992-1"
errorCode:
type: string
description: Specific error code indicating the type of failure
example: "401.002.01"
errorMessage:
type: string
description: Detailed error message explaining what went wrong
example: "Error Occurred - Invalid Access Token - BJGFGOXv5aZnw90KkA4TDtu4Xdyf"
B2BPaymentRequest:
type: object
required:
- Initiator
- SecurityCredential
- CommandID
- SenderIdentifierType
- ReceiverIdentifierType
- Amount
- PartyA
- PartyB
- AccountReference
- Remarks
- QueueTimeOutURL
- ResultURL
properties:
Initiator:
type: string
description: The M-Pesa API operator username. This user needs Org Business Pay Bill API initiator role on M-Pesa
SecurityCredential:
type: string
description: Encrypted credential of the user getting transaction status
CommandID:
type: string
enum:
- BusinessPayBill
- BusinessPayToBulk
description: >
This is a unique command that specifies B2B transaction type.
BusinessPayBill: This supports sending money to both registered and unregistered M-Pesa customers.
BusinessPayToBulk: This is a normal business to customer payment, supports only M-PESA registered customers.
SenderIdentifierType:
type: integer
format: int64
enum:
- 4
description: The type of shortcode from which money is deducted. For this API, only "4" is allowed.
ReceiverIdentifierType:
type: integer
format: int64
enum:
- 4
description: The type of shortcode to which money is sent. For this API, only "4" is allowed.
Amount:
type: integer
format: int64
description: The transaction amount.
PartyA:
type: integer
format: int64
description: Your shortcode. The shortcode from which money will be deducted.
PartyB:
type: integer
format: int64
description: The shortcode to which money will be moved
AccountReference:
type: string
description: The account number to be associated with the payment. Up to 13 characters.
Remarks:
type: string
description: Comments that are sent along with the transaction
QueueTimeOutURL:
type: string
description: A URL that will be used to notify your system in case the request times out before processing.
ResultURL:
type: string
description: A URL that will be used to send transaction results after processing.
B2BPaymentResponse:
type: object
properties:
OriginatorConversationID:
type: string
description: Unique request identifier assigned by Daraja upon successful request submission.
ConversationID:
type: string
description: Unique request identifier assigned by M-Pesa upon successful request submission.
ResponseCode:
type: string
description: The numeric status code indicates the status of transaction processing. 0 means success and any other code means an error occurred or the transaction failed.
ResponseDescription:
type: string
description: Response description message
TransactionReversalRequest:
type: object
required:
- Initiator
- SecurityCredential
- CommandID
- TransactionID
- Amount
- ReceiverParty
- ReceiverIdentifierType
- ResultURL
- QueueTimeOutURL
- Remarks
properties:
Initiator:
type: string
description: The name of the initiator initiating the request.
SecurityCredential:
type: string
description: Encrypted credential of the user getting transaction status
CommandID:
type: string
enum:
- TransactionReversal
description: Takes only the 'TransactionReversal' Command ID.
TransactionID:
type: string
description: Unique identifier to identify a transaction on Mpesa
Amount:
type: integer
format: int64
description: The amount of money being sent to the customer.
ReceiverParty:
type: integer
format: int64
description: The organization that receives the transaction.
ReceiverIdentifierType:
type: string
description: Type of organization receiving the transaction
ResultURL:
type: string
description: URL where the results will be sent by M-Pesa API
QueueTimeOutURL:
type: string
description: URL where the results will be sent by M-Pesa API
Remarks:
type: string
description: Comments that are sent along with the transaction
Occasion:
type: string
description: Any additional information to be associated with the transaction.
TransactionReversalResponse:
type: object
properties:
OriginatorConversationID:
type: string
description: The unique request ID for tracking a transaction
ConversationID:
type: string
description: The unique request ID returned my M-PESA for each request made
ResponseCode:
type: string
description: he numeric status code indicates the status transaction processing. 0 means success and any other code means an error occurred or the transaction failed. Success submission message or an error description
ResponseDescription:
type: string
description: Response description message
TransactionStatusQueryRequest:
type: object
required:
- Initiator
- SecurityCredential
- CommandID
- TransactionID
- PartyA
- IdentifierType
- ResultURL
- QueueTimeOutURL
- Remarks
properties:
Initiator:
type: string
description: The name of the initiator initiating the request.
SecurityCredential:
type: string
description: Encrypted credential of the user getting transaction status
CommandID:
type: string
enum:
- TransactionStatusQuery
description: Takes only the 'TransactionStatusQuery' Command ID.
TransactionID:
type: string
description: Unique identifier to identify a transaction on Mpesa
PartyA:
type: integer
format: int64
description: Organization/MSISDN receiving the transaction
IdentifierType:
type: string
description: Type of organization receiving the transaction
ResultURL:
type: string
description: URL where the results will be sent by M-Pesa API
QueueTimeOutURL:
type: string
description: URL where the results will be sent by M-Pesa API
Remarks:
type: string
description: Comments that are sent along with the transaction
Occasion:
type: string
TransactionStatusQueryResponse:
type: object
properties:
OriginatorConversationID:
type: string
description: The unique request ID for tracking a transaction
ConversationID:
type: string
description: The unique request ID returned my M-PESA for each request made
ResponseCode:
type: integer
format: int64
description: he numeric status code indicates the status transaction processing. 0 means success and any other code means an error occurred or the transaction failed. Success submission message or an error description
ResponseDescription:
type: string
description: Response description message
C2BPaymentSimulationRequest:
type: object
required:
- ShortCode
- CommandID
- Amount
- Msisdn
- BillRefNumber
properties:
ShortCode:
type: string
CommandID:
type: string
Amount:
type: integer
format: int64
Msisdn:
type: string
BillRefNumber:
type: string
C2BPaymentSimulationResponse:
type: object
properties: {}
StkPushQueryRequest:
type: object
required:
- BusinessShortCode
- Password
- Timestamp
- CheckoutRequestID
properties:
BusinessShortCode:
type: integer
format: int64
description: This is the organization's shortcode (Paybill or Buygoods - a 5 to 7-digit account number) used to identify an organization and receive the transaction.
Password:
type: string
description: This is the password used for encrypting the request sent. a base64 encoded string. (The base64 string is a combination of Shortcode+Passkey+Timestamp).
Timestamp:
type: string
pattern: '^\d{14}$'
description: This is the Timestamp of the transaction, normally in the format of YEAR+MONTH+DATE+HOUR+MINUTE+SECOND (YYYYMMDDHHMMSS). Each part should be at least two digits, apart from the year which takes four digits.
CheckoutRequestID:
type: string
description: This is a global unique identifier of the processed checkout transaction request.
StkPushQueryResponse:
type: object
properties:
ResponseCode:
type: integer
format: int64
description: This is a numeric status code that indicates the status of the request. 0 means the request was successful.
ResponseDescription:
type: string
description: Response description is an acknowledgment message from the API that gives the status of the request submission usually maps to a specific ResponseCode value. It can be a "Success" submission message or an error description.
MerchantRequestID:
type: string
description: This is a global unique Identifier for any submitted payment request.
CheckoutRequestID:
type: string
description: This is a global unique identifier of the processed checkout transaction request.
ResultCode:
type: integer
format: int64
description: This is a numeric status code that indicates the status of the request. 0 means the request was successful.
ResultDesc:
type: string
B2CPaymentRequest:
type: object
required:
- InitiatorName
- SecurityCredential
- CommandID
- Amount
- PartyA
- PartyB
- Remarks
properties:
OriginatorConversationID:
type: string
description: This is a unique string you specify for every API request you simulate. If not provided, the system may generate one automatically.
example: "feb5e3f2-fbbc-4745-844c-ee37b546f627"
maxLength: 50
InitiatorName:
type: string
description: This is an API user created by the Business Administrator of the M-PESA Bulk disbursement account that is active and authorised to initiate B2C transactions via API.
example: "testapi"
maxLength: 50
SecurityCredential:
type: string
description: This is the value obtained after encrypting the API initiator password. The password on Sandbox has been provisioned on the simulator. However, on production the password is created when the user is being created on the M-PESA organisation portal.
example: "EsJocK7+NjqZPC3I3EO+TbvS+xVb9TymWwaKABoaZr/Z/n0UysSs.."
CommandID:
type: string
enum:
- SalaryPayment
- BusinessPayment
- PromotionPayment
description: |
This is a unique command that specifies B2C transaction type:
- **SalaryPayment**: This supports sending money to both registered and unregistered M-Pesa customers.
- **BusinessPayment**: This is a normal business to customer payment, supports only M-PESA registered customers.
- **PromotionPayment**: This is a promotional payment to customers. The M-PESA notification message is a congratulatory message. Supports only M-PESA registered customers.
example: "BusinessPayment"
Amount:
type: integer
description: The amount of money being sent to the customer (whole numbers only).
example: 10
PartyA:
type: integer
description: This is the B2C organisation shortcode from which the money is sent from (5-7 digits).
example: 600996
PartyB:
type: integer
description: This is the customer mobile number to receive the amount. The number should have the country code (254) without the plus sign.
example: 254728762287
Remarks:
type: string
maxLength: 100
description: Any additional information to be associated with the transaction.
example: "here are my remarks"
QueueTimeOutURL:
type: string
format: uri
description: This is the URL to be specified in your request that will be used by API Proxy to send notification in case the payment request is timed out while awaiting processing in the queue. Optional - if not provided, no timeout notifications will be sent.
example: "https://mydomain.com/b2c/queue"
ResultURL:
type: string
format: uri
description: This is the URL to be specified in your request that will be used by M-PESA to send notification upon processing of the payment request. Optional - if not provided, no result notifications will be sent.
example: "https://mydomain.com/b2c/result"
Occasion:
type: string
maxLength: 100
description: Any additional information to be associated with the transaction (optional).
example: "Christmas"
B2CPaymentResponse:
type: object
properties:
ConversationID:
type: string
description: This is a global unique identifier for the transaction request returned by the M-PESA upon successful request submission.
OriginatorConversationID:
type: string
description: This is a global unique identifier for the transaction request returned by the API proxy upon successful request submission.
ResponseCode:
type: string
description: It indicates whether Mobile Money accepts the request or not.
ResponseDescription:
type: string
description: This is the description of the request submission status.
StkPushRequest:
type: object
required:
- BusinessShortCode
- Password
- Timestamp
- TransactionType
- Amount
- PartyA
- PartyB
- PhoneNumber
- CallBackURL
- AccountReference
- TransactionDesc
properties:
BusinessShortCode:
type: integer
format: int64
description: This is the organization's shortcode (Paybill or Buygoods - a 5 to 7-digit account number) used to identify an organization and receive the transaction.
Password:
type: string
description: This is the password used for encrypting the request sent. a base64 encoded string. (The base64 string is a combination of Shortcode+Passkey+Timestamp).
Timestamp:
type: string
pattern: '^\d{14}$'
description: This is the Timestamp of the transaction, normally in the format of YEAR+MONTH+DATE+HOUR+MINUTE+SECOND (YYYYMMDDHHMMSS). Each part should be at least two digits, apart from the year which takes four digits.
TransactionType:
type: string
enum:
- CustomerPayBillOnline
- CustomerBuyGoodsOnline
description: >
This is the transaction type to be used for the request. Only two types are allowed:
CustomerPayBillOnline: This is a transaction where the customer is expected to pay a bill e.g. utility bill.
CustomerBuyGoodsOnline: This is a transaction where the customer is expected to pay for goods e.g. a supermarket.
Amount:
type: integer
format: int64
description: This is the Amount transacted normally a numeric value. Money that the customer pays to the Shortcode. Only whole numbers are supported.
PartyA:
type: integer
format: int64
description: The phone number sending money. The parameter expected is a Valid Safaricom Mobile Number that is M-PESA registered in the format 2547XXXXXXXX
PartyB:
type: integer
format: int64
description: The organization shortcode receiving the funds. The parameter expected is a 5 to 7 digit Paybill number.
PhoneNumber:
type: integer
format: int64
description: The Mobile Number to receive the STK Pin Prompt. This number can be the same as PartyA value above.
CallBackURL:
type: string
description: A CallBack URL is a valid secure URL that is used to receive notifications from M-Pesa API. It is the endpoint to which the results will be sent by M-Pesa API.
AccountReference:
type: string
description: This is an Alpha-Numeric parameter that is defined by your system as an Identifier of the transaction for the CustomerPayBillOnline transaction type. Along with the business name, this value is also displayed to the customer in the STK Pin Prompt message. Maximum of 12 characters.
TransactionDesc:
type: string
description: This is any additional information/comment that can be sent along with the request from your system. Maximum of 13 Characters.
StkPushResponse:
type: object
properties:
MerchantRequestID:
type: string
description: This is a global unique Identifier for any submitted payment request.
CheckoutRequestID:
type: string
description: This is a global unique identifier of the processed checkout transaction request.
ResponseCode:
type: integer
format: int64
description: This is a numeric status code that indicates the status of the request. 0 means the request was successful.
ResponseDescription:
type: string
description: Response description is an acknowledgment message from the API that gives the status of the request submission usually maps to a specific ResponseCode value. It can be a "Success" submission message or an error description.
CustomerMessage:
type: string
description: This is a message that your system can display to the customer as an acknowledgment of the payment request submission.
AccountBalanceQueryRequest:
type: object
required:
- Initiator
- SecurityCredential
- CommandID
- PartyA
- IdentifierType
- Remarks
- QueueTimeOutURL
- ResultURL
properties:
Initiator:
type: string
description: This is the credential/username used to authenticate the transaction request
SecurityCredential:
type: string
description: Base64 encoded string of the M-PESA short code and password, which is encrypted using M-PESA public key and validates the transaction on M-PESA Core system. It indicates the Encrypted credential of the initiator getting the account balance. Its value must match the inputted value of the parameter IdentifierType.
CommandID:
type: string
enum:
- AccountBalance
description: A unique command is passed to the M-PESA system.
PartyA:
type: integer
format: int64
description: The shortcode of the organization querying for the account balance.
IdentifierType:
type: integer
format: int64
description: Type of organization querying for the account balance.
Remarks:
type: string
description: Comments that are sent along with the transaction.
QueueTimeOutURL:
type: string
description: URL where the results will be sent by M-Pesa API.
ResultURL:
type: string
description: URL where the results will be sent by M-Pesa API.
AccountBalanceQueryResponse:
type: object
properties:
OriginatorConversationID:
type: string
description: This is a global unique identifier for the transaction request returned by the API proxy upon successful request submission.
ConversationID:
type: string
description: This is a global unique identifier for the transaction returned by the M-PESA system.
ResponseCode:
type: string
description: It indicates whether Mobile Money accepts the request or not.
ResponseDescription:
type: string
description: This is the description of the request submission status.
C2BURLRegistrationRequest:
type: object
required:
- ShortCode
- ResponseType
- ConfirmationURL
- ValidationURL
properties:
ShortCode:
type: integer
format: int64
description: Usually, a unique number is tagged to an M-PESA pay bill/till number of the organization.
ResponseType:
type: string
enum:
- Completed
- Cancelled
description: >
This parameter specifies what is to happen if for any reason the validation URL is not reachable. Note that, this is the default action value that determines what M-PESA will do in the scenario that your endpoint is unreachable or is unable to respond on time. Only two values are allowed: Completed or Cancelled. Completed means M-PESA will automatically complete your transaction, whereas Cancelled means M-PESA will automatically cancel the transaction, in the event M-PESA is unable to reach your Validation URL.
ConfirmationURL:
type: string
description: This is the URL that receives the confirmation request from API upon payment completion.
ValidationURL:
type: string
description: This is the URL that receives the validation request from the API upon payment submission. The validation URL is only called if the external validation on the registered shortcode is enabled. (By default External Validation is disabled).
C2BURLRegistrationResponse:
type: object
properties:
OriginatorCoversationID:
type: string
description: This is a global unique identifier for the transaction request returned by the API proxy upon successful request submission.
ResponseCode:
type: string
description: It indicates whether Mobile Money accepts the request or not.
ResponseDescription:
type: string
description: This is the status of the request.
OAuthAccessTokenResponse:
type: object
properties:
access_token:
type: string
expires_in:
type: integer
format: int64