> ## Documentation Index
> Fetch the complete documentation index at: https://docs.palpluss.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Postman collection

> Try every PalPluss API request in Postman, with live and test environments ready to import.

# 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.

> [card] [palpluss-postman-collections on GitHub](https://github.com/Palpluss/palpluss-postman-collections)
>
> Download the collection and environments, or open an issue or pull request.

## What's included

| File | What it is |
| - | - |
| `PalPluss-API.postman_collection.json` | 24 requests: Account, STK Push, Transactions, Wallets, B2C Payouts, Payment Channels, Payment Links and Approvals |
| `PalPluss-Test.postman_environment.json` | For a **test key** (`pp_test_…`): simulated money |
| `PalPluss-Live.postman_environment.json` | For a **live key** (`pp_live_…`): real money |

## Set it up

**1. Download the files**

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

```bash theme={null}
git clone https://github.com/Palpluss/palpluss-postman-collections.git
```

**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](https://console.palpluss.com) → **API Keys** into `apiKey`. Start with a test key: nothing reaches M-Pesa. See [Test mode](https://docs.palpluss.com/guides/test-mode.md).

**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](https://docs.palpluss.com/guides/authentication.md).

## 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.

> [!NOTE]
>
> 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](https://github.com/postmanlabs/newman) runs the collection from the command line, for example as a smoke test with a test key:

```bash theme={null}
npx newman run PalPluss-API.postman_collection.json \
  -e PalPluss-Test.postman_environment.json \
  --env-var apiKey="$PALPLUSS_TEST_KEY" \
  --folder "Account" --folder "STK Push" --folder "Transactions" --folder "Wallets" --folder "B2C Payouts"
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.