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

# Getting Started

> Base URL, authentication, sandbox testing, and your first request

## Base URL

```
https://sayabelipay.com/api
```

The same base URL is used for sandbox and live — what decides whether a payment is real is your account's mode (see [Sandbox testing](#sandbox-testing)).

## Authentication

Every request is authenticated with **HTTP Basic Auth**, using your **Client ID** as the username and your **Client Secret** as the password. Both are shown on your merchant dashboard under **Merchant → Edit**.

```bash cURL theme={null}
curl https://sayabelipay.com/api/transactions \
  -u "YOUR_CLIENT_ID:YOUR_CLIENT_SECRET"
```

```javascript Node.js theme={null}
const auth = Buffer.from(`${clientId}:${clientSecret}`).toString("base64");

const res = await fetch("https://sayabelipay.com/api/transactions", {
  headers: { Authorization: `Basic ${auth}` },
});
```

```php PHP theme={null}
$response = Http::withBasicAuth($clientId, $clientSecret)
    ->get('https://sayabelipay.com/api/transactions');
```

A missing or wrong Client ID/Secret returns HTTP `401`:

```json theme={null}
{ "error": "Unauthorized" }
```

> [!WARNING]
>
> Your Client Secret must only ever be used from your server. Never put it in a mobile app, browser JavaScript, or anything a customer can download.

## Sandbox testing

New merchant accounts start in **sandbox (test) mode**. In sandbox:

* You use the **same base URL, endpoints and credentials** as live.
* **No real money moves.** The checkout page is a test page where you choose whether the payment succeeds or fails — no real bank login or e-wallet scan is needed.
* Test transactions are kept separate from live ones and never affect your balance.
* After checkout, the customer's browser returns to your **Callback URL (test)** instead of your live Callback URL.

Test every outcome before going live: a successful payment, a failed payment, and a customer who abandons checkout (each lands on a different [status](https://docs.sayabelipay.com/guides/payment-status.md)).

> [!NOTE]
>
> Only the channels listed in [Payment Channels](https://docs.sayabelipay.com/guides/payment-channels.md) will work once you're live.

### Going live

1. Ask SayaBeliPay to **enable live payments** for your account.
2. Once enabled, a **Test Mode / Live Mode** toggle appears at the bottom of your dashboard's sidebar. Switch it to **Live Mode**.

Your Client ID and Client Secret stay the same — from then on, payments are real. You can switch back to Test Mode at any time to test again.

## Callback URL

Your account has a **Callback URL**, and a separate **Callback URL (test)** for sandbox, set on your merchant dashboard. This is where the customer's browser is sent after completing or abandoning checkout. See [Getting Payment Status](https://docs.sayabelipay.com/guides/payment-status.md) for what's appended to it and why you shouldn't rely on it alone.

## Next steps

> [card] [Create a payment](https://docs.sayabelipay.com/api-reference/create-payment.md)
>
> Make your first payment request

> [card] [Payment channels](https://docs.sayabelipay.com/guides/payment-channels.md)
>
> FPX and DuitNow QR


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