# Postman collection

Try the PayLater API in seconds. Import our Postman collection and a ready-to-run environment — authenticate once and every request just works, using `{{base_url}}` and an auto-saved `{{access_token}}`.

## Download

- [Collection](https://docs.paylaterapp.com/downloads/paylater-api.postman_collection.json): PayLater API — all endpoints (Postman Collection v2.1)
- [Sandbox env](https://docs.paylaterapp.com/downloads/paylater-api-sandbox.postman_environment.json): Pre-filled with the published sandbox test credentials
- [Production env](https://docs.paylaterapp.com/downloads/paylater-api-production.postman_environment.json): Blank template — add your own production credentials

## Import & run

1. In Postman, click **Import** and drop in the **collection** plus the **environment** file(s) above.
2. Top-right, select the **PayLater Sandbox** environment.
3. Open **Authentication → Get Access Token** and click **Send**. The token is saved to the environment automatically.
4. Run any other request — they all inherit `Authorization: Bearer {{access_token}}` and use your environment variables.

> **Tip: How auth works**
>
> The **Get Access Token** request has a test script that saves `access_token` to the active environment, and the collection sends it as a Bearer token on every request. To test production, switch to the **PayLater Production** environment and fill in your own `client_id`, `client_secret`, and `outlet_id`.

## Environment variables

| Variable | Purpose |
| --- | --- |
| `base_url` | API host — sandbox (`connect.uat.paylaterapp.com`) or production (`connect.paylaterapp.com`) |
| `client_id` | Your OAuth 2.0 client ID |
| `client_secret` | Your OAuth 2.0 client secret |
| `access_token` | Bearer token — set automatically after Get Access Token |
| `outlet_id` | Your outlet identifier |
| `order_id` | Your unique order reference |
| `merchant_order_reference` | Order reference for Request to Pay |
| `amount` | Order amount, in QAR |
| `expiry_duration` | Payment-link expiry, in minutes |
| `mobile_number` | Shopper mobile number (lookup / Request to Pay) |
| `email` | Shopper email (shopper lookup) |
| `size` | Transactions per page |
| `page` | Transaction list page number |

> **Note: Sandbox credentials**
>
> The Sandbox environment ships with PayLater's published, **sandbox-only** test values (see [Test environment](https://docs.paylaterapp.com/test-environment.html)). Never use them in production.

> **Info: One-click "Run in Postman" button**
>
> Prefer the orange *Run in Postman* button? That requires publishing this collection to a public Postman workspace — ask the docs team and we'll wire it up.
