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

# Quickstart

> This guide shows the minimal flow to create a payment, optionally confirm/capture it, and issue a refund using **Paymnt Cloud**.

* **Production:** `https://api.paymnt.cloud`
* **Sandbox:** `https://sandbox.paymnt.cloud`

> You can also use the **API reference** tab with **Try it**. Enter your `api-key` once, and requests will use it automatically.

***

## Prerequisites

* A **secret API key** (server-side only). See [Authentication](/pages/essentials/authentication).
* Optional: `x-profile-id` if profiles are enabled.
* Use **Sandbox** during integration; switch to **Production** with the same code.

***

## 1) Base URL and headers

```text theme={null}
Base URL: https://sandbox.paymnt.cloud
Headers:
  api-key: <YOUR_SECRET_KEY>
  x-profile-id: <pro_...>      # optional
  Idempotency-Key: <uuid-v4>   # recommended for POST/PUT/PATCH
```

***

## 2) Create a payment

Send the minimal request your use case requires. Refer to the API reference for available fields.

```bash theme={null}
curl -X POST "https://sandbox.paymnt.cloud/payments" \
  -H "Content-Type: application/json" \
  -H "api-key: <YOUR_SECRET_KEY>" \
  -H "Idempotency-Key: 3b8f2c34-0a7a-4a2f-9a62-5d0f2a33e6f1" \
  -d '{
    "amount": 1000,
    "currency": "USD",
    "description": "Order #1001"
  }'
```

Check the response and keep the payment\_id for the next steps.

***

## 3) Confirm (if your flow requires it)

If your integration uses a two-step flow or needs an explicit confirmation:

```bash theme={null}
curl -X POST "https://sandbox.paymnt.cloud/payments/{payment_id}/confirm" \
  -H "api-key: <YOUR_SECRET_KEY>"
```

For SCA/3DS flows, follow [3DS & SCA](/pages/guides/payments/3ds-sca) and verify the final status before fulfilling.

***

## 4) Capture or void (for auth-then-capture flows)

Capture a previously authorized payment (full or partial):

```bash theme={null}
curl -X POST "https://sandbox.paymnt.cloud/payments/{payment_id}/capture" \
  -H "Content-Type: application/json" \
  -H "api-key: <YOUR_SECRET_KEY>" \
  -H "Idempotency-Key: <uuid-v4>" \
  -d '{ "amount_to_capture": 1000 }'
```

To cancel an authorization instead of capturing, see [Capture & Void](/pages/guides/payments/capture-void).

***

## 5) Issue a refund

Create a refund for a payment:

```bash theme={null}
curl -X POST "https://sandbox.paymnt.cloud/refunds" \
  -H "Content-Type: application/json" \
  -H "api-key: <YOUR_SECRET_KEY>" \
  -H "Idempotency-Key: <uuid-v4>" \
  -d '{
    "payment_id": "pay_123",
    "amount": 1000,
    "reason": "requested_by_customer"
  }'
```

See [Create & List Refunds](/pages/guides/refunds/create-list) for parameters and pagination.

***

## 6) Webhooks (recommended)

Use webhooks to keep your system in sync (e.g., succeeded, failed, refunded):

* Expose a secure endpoint (e.g., `/webhooks/payments`)
* Verify signatures; retry on 5xx
* Apply idempotent updates using the event id

Start with [Webhooks — Overview](/pages/webhooks/overview) and [Signing & Retries](/pages/webhooks/signing-retries).

***

## 7) Testing

* **Sandbox scenarios**: [Sandbox](/pages/testing/sandbox)
* **Test PANs and SCA**: [Test Cards & 3DS](/pages/testing/test-cards-3ds)

***

## Production readiness checklist

* [Authentication](/pages/essentials/authentication)
* [Idempotency](/pages/essentials/idempotency)
* [Retries & Backoff](/pages/operations/retries-backoff)
* [Error Codes](/pages/essentials/error-codes)
* [Rate Limits](/pages/essentials/rate-limits)
* [Webhooks](/pages/webhooks/overview)
* [Smart Routing, Profiles](/pages/platform/routing)
