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

# Commerce (overview)

> The mental model for selling on Crevio — how accounts, products, price variants, experiences, checkouts, orders, and subscriptions fit together.

**Commerce on Crevio is a small set of primitives that compose into anything you can sell** — a one-time download, a monthly membership, a payment-plan course, or a pay-what-you-want lead magnet.

You rarely have to assemble all of this by hand. Crevio is AI-native: you can just ask the agent to "create a \$49 course with a 3-payment plan and a launch discount" and it will build the products, price variants, and discounts for you through the same API documented here. The primitives below are what those tools (and your own integrations) operate on.

## The mental model

Everything hangs off your **account** (the tenant). Within it, the flow looks like this:

```
Account
  └─ Product (the thing you list — draft → active → archived)
       └─ Price Variant (how it's priced & billed — free | fixed | custom; one_time | subscription | payment_plan)
            └─ Experience (what the buyer actually receives — course, content, download, booking)

Checkout (a buyer pays for one or more price variants)
  └─ Order (the completed purchase — a read model)
       └─ Order Item (one line per price variant bought)
       └─ Charge (the payment)

Subscription (recurring price variants)   Invoice (a request to pay)   Refund (money back on an order)
```

Read it as a sentence: **a product bundles experiences via its price variants; a buyer pays through a checkout, which produces an order made of order items; recurring purchases become subscriptions, and you can invoice or refund along the way.**

## The primitives

| Primitive     | Prefix   | What it is                                                                                                                                                                                        |
| ------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Product       | `prod_`  | The listing a buyer sees. Has a lifecycle (`draft` → `active` → `archived`). Bundles experiences through its price variants.                                                                      |
| Price variant | `price_` | How a product is priced and billed. A single product can have several (e.g. "monthly" and "annual"). Drives free / fixed / pay-what-you-want and one-time / subscription / payment-plan behavior. |
| Experience    | `exp_`   | What the buyer actually receives — a course, content library, download, or booking. **Courses and content live under `/experiences`, not `/products`.** Read-only over the API.                   |
| Checkout      | `co_`    | A pay-for-this session. Takes line items (`{ price_variant, quantity }`), an email or customer, and optional discount code. Can also pay an invoice.                                              |
| Checkout link | `cl_`    | A reusable, shareable URL that opens a pre-built checkout. Great for "buy now" buttons and campaigns.                                                                                             |
| Order         | `ord_`   | A completed purchase. A read model — you create orders indirectly by completing checkouts.                                                                                                        |
| Order item    | `ordi_`  | One line of an order: a price variant and quantity.                                                                                                                                               |
| Charge        | `ch_`    | The payment record attached to an order.                                                                                                                                                          |
| Customer      | `cus_`   | A buyer or lead (`paid` \| `free` \| `lead`).                                                                                                                                                     |
| Subscription  | `sub_`   | A recurring purchase. Cancel / pause / resume over the API.                                                                                                                                       |
| Invoice       | `inv_`   | A request for payment. Paid by creating a checkout with the `invoice` param.                                                                                                                      |
| Discount      | `disc_`  | A code (`percentage` \| `fixed`) that reduces price at checkout.                                                                                                                                  |
| Refund        | —        | Money returned on an order, full or partial.                                                                                                                                                      |

<Note>
  **Products vs. experiences.** A product is the *listing and pricing*; an experience is the *deliverable*. When you sell a course, the course content is an experience, and the product is what wraps it in a name, images, and one or more price variants. The Experiences API is read-only (`GET` list and `GET` one) — you create and shape deliverables in the dashboard or by asking Crevio.
</Note>

## Two conventions that trip people up

Crevio's API follows a few consistent conventions. Two are worth internalizing before you write any commerce code:

* **Money is in cents.** `amount: 4900` is \$49.00. `currency` is lowercase ISO, e.g. `"usd"`.
* **Associations are a bare resource name plus a prefix-id string.** Link a price variant to a product with `product: "prod_abc123"` — not `product_id`. The same holds for `customer`, `order`, `discount`, and `price_variant`.

```bash theme={null}
# Create a price variant for an existing product
curl -X POST https://api.crevio.co/v1/price_variants \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "product": "prod_abc123",
    "name": "One-time",
    "amount_type": "fixed",
    "billing_type": "one_time",
    "amount": 4900,
    "currency": "usd"
  }'
```

<Warning>
  **Creation order matters.** Publishing a product requires at least one price variant. Creating a product with `status: "active"` in a single call fails with `422`. The correct sequence is always: create the product as a draft → add one or more price variants → `PATCH` the product to `status: "active"`. See [Products & pricing](/developer/guides/products-and-pricing).
</Warning>

## Next steps

<CardGroup cols={2}>
  <Card title="Products & pricing" icon="tag" href="/developer/guides/products-and-pricing">
    The product lifecycle and the full price variant model, with worked examples for every billing type.
  </Card>

  <Card title="Checkouts" icon="cart-shopping" href="/developer/guides/checkouts">
    Create one-off checkouts and reusable checkout links to take payment.
  </Card>

  <Card title="Subscriptions & billing" icon="arrows-rotate" href="/developer/guides/subscriptions-and-billing">
    Manage recurring revenue, invoices, refunds, and the order read model.
  </Card>

  <Card title="Discounts" icon="percent" href="/developer/guides/discounts">
    Build promo codes and apply them at checkout or on checkout links.
  </Card>
</CardGroup>
