# Accept your first payment (/docs/get-started/quickstart)

Take a test payment end to end: create a checkout session from your terminal, pay it on Monime's hosted checkout page, and confirm the result. Everything runs in **Test mode**, so no real money moves. Mark each step as done to keep your place.

> **Before you begin:**
>
> - A [Monimeer account](/docs/dashboard-guide/setting-up-your-account) and a [Monime Space](/docs/dashboard-guide/creating-a-space)
> - A terminal with `curl`

1. **Create a test access token**

   In the dashboard, open **Developer → Access Tokens** and click **Create token**. Turn **Test Mode** on: test tokens start with `mon_test_` and only process simulated transactions.

   Copy the token straight away — it is shown only once. See [Personal Access Tokens](/docs/dashboard-guide/personal-access-tokens) for every option.

2. **Find your Space ID**

   Every request names the Space it acts on. Open **Developer** in the dashboard to see your Spaces and their **Space IDs**.

3. **Save your credentials in your shell**

   The rest of this quickstart reads them from environment variables.

   ```bash
   export MONIME_ACCESS_TOKEN="mon_test_..."   # your test token
   export MONIME_SPACE_ID="spc-k6Em1Aap25VZ8oWg7ajhxHX3JqF"   # your Space ID
   ```

4. **Create a checkout session**

   Create a session for one line item. Amounts are in minor units, so `25000` is SLE 250.00.

   ```bash
   curl https://api.monime.io/v1/checkout-sessions \
     -H "Authorization: Bearer $MONIME_ACCESS_TOKEN" \
     -H "Monime-Space-Id: $MONIME_SPACE_ID" \
     -H "Idempotency-Key: first-payment-1" \
     -H "Content-Type: application/json" \
     -d '{
       "name": "Order #1042",
       "successUrl": "https://example.com/checkout/success",
       "cancelUrl": "https://example.com/checkout/cancel",
       "lineItems": [{
         "type": "custom",
         "name": "Event ticket",
         "quantity": 1,
         "price": { "currency": "SLE", "value": 25000 }
       }]
     }'
   ```

   The response includes the session `id` and a `redirectUrl` — the Monime-hosted checkout page for this session. Keep both for the next steps. Hover over a field to see what it means.

   ```json
   {
     "success": true,
     "messages": [],
     "result": {
       "id": "cos-6gyBvKXqbTVUpqf2HNk9nm",
       "status": "pending",
       "name": "Order #1042",
       "orderNumber": "1042",
       "redirectUrl": "https://checkout.monime.io/cos-6gyBvKXqbTVUpqf2HNk9nm",
       "successUrl": "https://example.com/checkout/success",
       "cancelUrl": "https://example.com/checkout/cancel",
       "expireTime": "2026-09-30T13:30:00Z",
       "createTime": "2026-09-30T12:30:00Z"
     }
   }
   ```

5. **Pay on the hosted checkout page**

   Open the `redirectUrl` in your browser and complete the payment on Monime's checkout page. With a test token, the transaction is simulated.

   When the customer finishes, Monime sends them to your `successUrl`; if they cancel, to your `cancelUrl`.

6. **Confirm the payment**

   Retrieve the session with the `id` from step 4. A paid session has the status `completed`.

   ```bash
   curl https://api.monime.io/v1/checkout-sessions/$SESSION_ID \
     -H "Authorization: Bearer $MONIME_ACCESS_TOKEN" \
     -H "Monime-Space-Id: $MONIME_SPACE_ID"
   ```

   In production, don't poll: subscribe to the `checkout_session.completed` webhook event instead. The [webhooks getting-started guide](/docs/developer-resources/guides/webhook/getting-started) walks through it.

## Next steps

- [**Receive webhooks**](/docs/developer-resources/guides/webhook/getting-started)

  Get notified the moment a checkout completes.

- [**Checkout Session guide**](/docs/developer-resources/guides/checkout-session/overview)

  Payment options, redirects and a Next.js example.

- [**API reference**](/apis/versions/caph-2025-08-23/checkout-session/create-checkout-session)

  Every field of the Create Checkout Session request.
