Skip to main content

Postman collection

Explore the API without writing code. The PalPluss Postman collection has every developer API request ready to send, with live and test environments. It’s open source.

palpluss-postman-collections on GitHub

Download the collection and environments, or open an issue or pull request.

What’s included

Set it up

1

Download the files

Clone the repository, or download the three JSON files from GitHub:
2

Import them into Postman

Choose Import in Postman and drop in the collection and both environment files.
3

Add your API key

Select PalPluss Test in the environment picker, open it, and paste a test key from console.palpluss.com → API Keys into apiKey. Start with a test key: nothing reaches M-Pesa. See Test mode.
4

Send your first request

Send Account → Get the calling API key. It shows the key’s kind and mode. Then try STK Push → Send STK Push, wait about 5 seconds, and send Transactions → Get transaction.
Authentication is set once on the collection: HTTP Basic with the API key as the username and an empty password, as described in Authentication.

How the requests work together

  • IDs carry over. Requests that create something save its ID (transactionId, channelId, paymentLinkId, approvalId), so the next request in the folder works straight away.
  • Idempotency keys. Top-ups and payouts get a fresh Idempotency-Key before each send, so a payment is never made twice.
  • Choose outcomes in test mode with the phone variable: 0700000001 fails, 0700000002 is cancelled, 0700000003 is unreachable, and any other number succeeds.
  • Callbacks go to the callbackUrl variable. Point it at your own HTTPS endpoint, or a request inspector while you test.
Test keys can read payment channels and payment links but can’t change them. Use the PalPluss Live environment for those requests, and remember that live payouts need approved KYC.

Run it in CI

Newman runs the collection from the command line, for example as a smoke test with a test key: