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

# Quickstart

> Place your first Sandbox order: find a product, build a cart, get a quote, pay and confirm the order.

About 15 minutes
By the end you will have a placed order with a Sandbox test store, made with the same calls you will use in production.

## How it works

1. Your server finds products from merchants your app can sell.
2. Your server creates a cart for the shopper and adds items and a delivery address.
3. Ignyt asks each store for live prices, shipping and tax, and returns one **quote**.
4. The shopper approves the exact total, and your server submits the cart once.
5. The shopper pays on the payment provider's page. Ignyt places one order with each store.
6. You confirm the result by reading the purchase or receiving a webhook.

## Before you start

**1. Get Sandbox access**

Sign in to the Ignyt dashboard and select your company's **Sandbox** environment. If you don't have access yet, ask your Ignyt contact for an invitation.

**2. Add a test store**

In the dashboard, connect a built-in Sandbox test store. It has a fixed catalog with scenario products, described in [Test in Sandbox](https://docs.ignyt.si/sandbox-testing.md). You can also use a merchant that Ignyt has approved for your Sandbox app.

**3. Create a server API key**

Create a key with the scopes `catalog:read`, `cart:write`, `checkout:write` and `orders:read`. Keep it on your server. Never put it in browser code or a URL.

Set your environment. Use the API host that Ignyt assigned to your Sandbox app; never send a key to an unconfirmed host.

```bash theme={"theme":{"light":"github-light","dark":"vesper"}}
export IGNITE_API_BASE_URL="https://<your-assigned-sandbox-api-host>"
export IGNITE_API_KEY="<your-sandbox-server-key>"
```

The commands below use [jq](https://jqlang.org) to save the IDs each step returns, so later steps can use them.

> [!NOTE]
>
> Response examples on this page are based on a real Sandbox run against the built-in test store, shortened to the fields you need. Your IDs will differ. Amounts are in minor units: `24900` means AED 249.00.

## 1. Check your key

```bash theme={"theme":{"light":"github-light","dark":"vesper"}}
curl "$IGNITE_API_BASE_URL/v1/me" \
  -H "Authorization: Bearer $IGNITE_API_KEY"
```

```json Response (abridged) theme={"theme":{"light":"github-light","dark":"vesper"}}
{
  "tenant_id": "ten_01M8NWKB7QBZ9MT2V1JS5R93Y6",
  "app_id": "app_01M8NWKB87FY3FFYWYNW29BBJ3",
  "environment": "sandbox",
  "scopes": ["cart:write", "catalog:read", "checkout:write", "orders:read"]
}
```

Confirm that `environment` is `sandbox` and the scopes include the four above. `GET /v1/me` is described in the [API reference](https://docs.ignyt.si/api-reference/integration/identity/get.md).

## 2. Find a product

```bash theme={"theme":{"light":"github-light","dark":"vesper"}}
curl -s "$IGNITE_API_BASE_URL/v1/catalog/products?limit=20&variant_limit=5" \
  -H "Authorization: Bearer $IGNITE_API_KEY" | tee products.json

export VARIANT_ID=$(jq -r '.items[0].variants[0].id' products.json)
```

```json Response (abridged) theme={"theme":{"light":"github-light","dark":"vesper"}}
{
  "items": [
    {
      "id": "prd_01M8NWKBAYPRODUCTOUD50000",
      "title": "Royal Oud Perfume 50ml",
      "merchant_id": "mer_01M8NWKB9S489CK7E4ABQ2V773",
      "variants": [
        {
          "id": "var_01M8NWKBAYTH0HJ78BAJDY180R",
          "sku": "OUD-50",
          "title": "50ml",
          "price_minor": 24900,
          "currency": "AED",
          "stock_state": "in_stock"
        }
      ]
    }
  ]
}
```

The command saves the first **variant** `id`; you add variants to carts, not products. If `items` is empty, your app has no merchant with selected products yet; see [Merchant access](https://docs.ignyt.si/merchants.md).

## 3. Create a cart

```bash theme={"theme":{"light":"github-light","dark":"vesper"}}
curl -s -X POST "$IGNITE_API_BASE_URL/v1/carts" \
  -H "Authorization: Bearer $IGNITE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"shopper_ref": "sandbox-shopper-001"}' | tee cart.json

export CART_ID=$(jq -r '.id' cart.json)
```

```json Response (abridged) theme={"theme":{"light":"github-light","dark":"vesper"}}
{
  "id": "crt_01M8NWKBQJ7QD9Q3EC170036J0",
  "status": "open",
  "version": 1,
  "shopper_ref": "sandbox-shopper-001",
  "country": "AE",
  "currency": "AED"
}
```

`shopper_ref` is your own identifier for the shopper. Don't put an email or name in it.

## 4. Add an item and a delivery address

```bash theme={"theme":{"light":"github-light","dark":"vesper"}}
curl -X POST "$IGNITE_API_BASE_URL/v1/carts/$CART_ID/lines" \
  -H "Authorization: Bearer $IGNITE_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"variant_id\": \"$VARIANT_ID\", \"qty\": 1}"

curl -X PUT "$IGNITE_API_BASE_URL/v1/carts/$CART_ID/address" \
  -H "Authorization: Bearer $IGNITE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"address": {"name": "Aisha K", "line1": "12 Palm St", "city": "Dubai",
       "emirate": "Dubai", "country": "AE", "phone": "+971500000000"}}'
```

Each change returns the whole cart with a higher `version`. Items are grouped by store in `merchant_groups`, because one cart can contain products from several stores.

## 5. Get a quote

```bash theme={"theme":{"light":"github-light","dark":"vesper"}}
curl -s -X POST "$IGNITE_API_BASE_URL/v1/carts/$CART_ID/quotes" \
  -H "Authorization: Bearer $IGNITE_API_KEY" | tee quote.json

export QUOTE_ID=$(jq -r '.id' quote.json)
export APPROVED_TOTAL=$(jq -r '.total_minor' quote.json)
```

```json Response (abridged) theme={"theme":{"light":"github-light","dark":"vesper"}}
{
  "id": "quo_01M8NWKBS5BSSVVT8WFVF8TTQW",
  "cart_id": "crt_01M8NWKBQJ7QD9Q3EC170036J0",
  "status": "active",
  "currency": "AED",
  "subtotal_minor": 24900,
  "discount_minor": 0,
  "shipping_minor": 1500,
  "tax_minor": 1320,
  "total_minor": 27720,
  "unsupported": [],
  "expires_at": "2026-11-30T09:44:27.587063+00:00"
}
```

The quote freezes prices, shipping and tax from each store until `expires_at`. Show the shopper the `total_minor` and get their approval. If `unsupported` lists any lines, those items can't be bought right now; tell the shopper before you continue.

## 6. Submit the cart

Send the quote ID and the exact total the shopper approved. The `Idempotency-Key` makes the submission safe to retry: create it once, save it, and send the same key and body again if you don't get a response.

```bash theme={"theme":{"light":"github-light","dark":"vesper"}}
curl -s -X POST "$IGNITE_API_BASE_URL/v1/carts/$CART_ID/submit" \
  -H "Authorization: Bearer $IGNITE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: checkout-sandbox-shopper-001-1" \
  -d "{\"quote_id\": \"$QUOTE_ID\", \"approved_total_minor\": $APPROVED_TOTAL,
       \"partial_order_policy\": \"allow_partial\",
       \"shopper_contact\": {\"email\": \"shopper@example.com\"}}" | tee submission.json

export PURCHASE_ID=$(jq -r '.purchase_id' submission.json)
```

```json Response theme={"theme":{"light":"github-light","dark":"vesper"}}
{
  "submission_id": "sub_01M8NWKBT0JPSPQGM95NYC374X",
  "purchase_id": "pur_01M8NWKBT0GVA1JP2W3KE36PGY",
  "status": "accepted",
  "duplicate": false,
  "note": "The purchase executes durably; poll /v1/purchases/{purchase_id} or consume webhooks."
}
```

`202 Accepted` means Ignyt has the order and will process it. It does not yet mean the payment succeeded.

## 7. Take the payment

Read the cart's purchase to get the payment step:

```bash theme={"theme":{"light":"github-light","dark":"vesper"}}
curl "$IGNITE_API_BASE_URL/v1/carts/$CART_ID/purchase" \
  -H "Authorization: Bearer $IGNITE_API_KEY"
```

```json Response (abridged) theme={"theme":{"light":"github-light","dark":"vesper"}}
{
  "purchase": { "id": "pur_01M8NWKBT0GVA1JP2W3KE36PGY", "status": "paying" },
  "payment": {
    "status": "requires_action",
    "provider": "mamo",
    "amount_minor": 27720,
    "currency": "AED",
    "payment_action": {
      "type": "redirect",
      "presentation": "redirect",
      "url": "https://<provider-payment-page>"
    }
  }
}
```

Open `payment_action.url` for `presentation: "redirect"`. An app enabled for inline checkout can also
receive `presentation: "embed"` and load the provider form in its checkout iframe. The provider
collects the card details in both cases. Use a test card from [Test in Sandbox](https://docs.ignyt.si/sandbox-testing.md).
If `payment` is still `pending`, read the original cart purchase again after a few seconds.

## 8. Confirm the order

After the shopper returns, read the purchase. Don't rely on the return URL alone; only Ignyt's response confirms the payment.

```bash theme={"theme":{"light":"github-light","dark":"vesper"}}
curl "$IGNITE_API_BASE_URL/v1/purchases/$PURCHASE_ID" \
  -H "Authorization: Bearer $IGNITE_API_KEY"
```

```json Response (abridged) theme={"theme":{"light":"github-light","dark":"vesper"}}
{
  "id": "pur_01M8NWKBT0GVA1JP2W3KE36PGY",
  "status": "placed",
  "currency": "AED",
  "total_minor": 27720,
  "merchant_orders": [
    {
      "id": "mord_01M8NWKBVMYAHB227PECJHN2G7",
      "merchant_id": "mer_01M8NWKB9S489CK7E4ABQ2V773",
      "status": "placed",
      "external_order_id": "SB-FB677EC8031D59D3EF481AA2879267C7",
      "total_minor": 27720
    }
  ],
  "all_children_resolved": true
}
```

Your first order is placed. Each store's order is in `merchant_orders` with its own status, because a purchase can include several stores.

## Next steps

> [card] [Build your checkout](https://docs.ignyt.si/checkout-and-refunds.md)
>
> Handle quote changes, partial orders and lost responses.

> [card] [Receive webhooks](https://docs.ignyt.si/webhooks.md)
>
> Get notified when payments and orders change.

> [card] [Test in Sandbox](https://docs.ignyt.si/sandbox-testing.md)
>
> Trigger sold-out items, price changes and failed orders.

> [card] [Error codes](https://docs.ignyt.si/error-codes.md)
>
> What each error means and what to do next.


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