# Quickstart
Source: https://paylinky.vercel.app/docs/quickstart

Make your first sandbox payment in five minutes.

# Quickstart

## 1. Create an account and a sandbox key

Register, open **Developers → API Keys** and request a **sandbox** key. Sandbox keys are issued instantly. The full key is shown **once** — store it in an environment variable.

```bash
export PAYLINKY_KEY="plk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
```

## 2. List the active countries and operators

Always load the catalog instead of hard-coding it — operators can be enabled or disabled at any time.

```bash
curl https://paylinky.vercel.app/api/v1/countries \
  -H "Authorization: Bearer $PAYLINKY_KEY"
```

```json
[
  {
    "code": "CM",
    "name": "Cameroon",
    "currency": "XAF",
    "operators": ["MTN Mobile Money", "Orange Money"],
    "unavailable_operators": []
  }
]
```

## 3. Create a Mobile Money payment

Use the sandbox test number `+237000000001` — it always succeeds.

:::tabs
```bash cURL
curl -X POST https://paylinky.vercel.app/api/v1/collect \
  -H "Authorization: Bearer $PAYLINKY_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 1000,
    "currency": "XAF",
    "country_code": "CM",
    "operator": "MTN Mobile Money",
    "phone": "+237000000001",
    "reference": "order_12345"
  }'
```
```javascript Node.js
const res = await fetch("https://paylinky.vercel.app/api/v1/collect", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.PAYLINKY_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    amount: 1000,
    currency: "XAF",
    country_code: "CM",
    operator: "MTN Mobile Money",
    phone: "+237000000001",
    reference: "order_12345",
  }),
});
const payment = await res.json();
```
```python Python
import os, requests

r = requests.post(
    "https://paylinky.vercel.app/api/v1/collect",
    headers={"Authorization": f"Bearer {os.environ['PAYLINKY_KEY']}"},
    json={
        "amount": 1000, "currency": "XAF", "country_code": "CM",
        "operator": "MTN Mobile Money", "phone": "+237000000001",
        "reference": "order_12345",
    },
)
payment = r.json()
```
```php PHP
<?php
$ch = curl_init("https://paylinky.vercel.app/api/v1/collect");
curl_setopt_array($ch, [
  CURLOPT_POST => true,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("PAYLINKY_KEY"), "Content-Type: application/json"],
  CURLOPT_POSTFIELDS => json_encode([
    "amount" => 1000, "currency" => "XAF", "country_code" => "CM",
    "operator" => "MTN Mobile Money", "phone" => "+237000000001", "reference" => "order_12345",
  ]),
]);
$payment = json_decode(curl_exec($ch), true);
```
:::

Response (`200`, sandbox):

```json
{
  "transaction_id": "0b9c7f0e-2d0b-4d76-9f5a-6b8a1c1d2e3f",
  "reference": "PLK-SBX-7XK2M9QPLA",
  "merchant_reference": "order_12345",
  "status": "success",
  "payment_method": "mobile_money",
  "amount": 1000,
  "fee_amount": 50,
  "credited_amount": 950,
  "currency": "XAF",
  "sandbox": true,
  "simulation": true,
  "country_code": "CM",
  "operator": "MTN Mobile Money",
  "phone": "+237000000001",
  "created_at": "2026-01-01T10:00:00.000Z",
  "expires_at": null,
  "message": "Payment confirmed immediately (simulated)."
}
```

## 4. Check the status

```bash
curl https://paylinky.vercel.app/api/v1/transaction/0b9c7f0e-2d0b-4d76-9f5a-6b8a1c1d2e3f \
  -H "Authorization: Bearer $PAYLINKY_KEY"
```

## 5. Go live

1. Complete **KYC** in the app (front and back of your ID + application).
2. Request a **live key** — the Paylinky team reviews and **activates** it.
3. Swap `plk_test_…` for `plk_live_…` and use real numbers.

See the [go-live checklist](/docs/security#go-live-checklist).
