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

# Submit price snapshots to the PRIXO community database

> Upload a checkout screenshot to add dish prices. Vision AI extracts item price, delivery fee, and VAT from your image automatically, earning you 10 points.

Price snapshots are the foundation of PRIXO's community-powered database. When you upload a screenshot of a checkout screen from HungerStation, Keeta, or Jahez, PRIXO's Vision AI reads the image and extracts a structured price record — item price, delivery fee, service fee, and VAT — then stores it against the correct restaurant and dish. Every accepted snapshot awards you **+10 points** toward your contributor rank.

## How snapshot submission works

Snapshot submission is handled through the PRIXO web UI rather than a raw JSON endpoint, because it involves a multipart file upload and a multi-step Vision AI pipeline. The form lives at:

```
/contribute/snapshot/new
```

When you submit the form, the web interface processes the upload through the Vision AI extraction pipeline, validates the result, and — on success — redirects you to `/contribute/snapshot/[id]` where you can review what was extracted.

### Submission form fields

| Field           | Type   | Required | Description                                                                                          |
| --------------- | ------ | :------: | ---------------------------------------------------------------------------------------------------- |
| `platform`      | string |    Yes   | The delivery platform shown in the screenshot. One of `"hungerstation"`, `"keeta"`, or `"jahez"`.    |
| `image`         | file   |    Yes   | A screenshot of the checkout or order summary screen. JPEG, PNG, and WebP are accepted.              |
| `restaurant_id` | string |    No    | The PRIXO restaurant ID if you know it. You can look this up via [`GET /api/places`](/api/places).   |
| `item_name`     | string |    No    | The dish name as it appears on the platform. When omitted, Vision AI infers the name from the image. |

### What the Vision AI extracts

PRIXO's extraction pipeline reads the following fields from your screenshot:

<ResponseField name="itemPrice" type="number">
  The **per-unit price** of the dish, in SAR. If you ordered three shawarmas at 10.5 SAR each, PRIXO records `10.5` — not the cart subtotal of `31.5`. See the note below.
</ResponseField>

<ResponseField name="deliveryFee" type="number">
  The delivery fee charged by the platform for this order, in SAR.
</ResponseField>

<ResponseField name="serviceFee" type="number">
  Any additional service or platform fee shown on the checkout screen, in SAR. `0` if no service fee is displayed.
</ResponseField>

<ResponseField name="vat" type="number">
  The VAT amount applied to this order, in SAR.
</ResponseField>

<ResponseField name="vatIncluded" type="boolean">
  `true` when VAT is already included in the item price rather than added as a separate line item.
</ResponseField>

<ResponseField name="total" type="number">
  The grand total shown on the checkout screen, in SAR. Used to cross-check the extracted components.
</ResponseField>

<ResponseField name="quantity" type="number">
  The number of units of the dish shown in the order. Used together with the subtotal to calculate `itemPrice`.
</ResponseField>

<ResponseField name="detectedPlatform" type="string">
  The delivery platform that Vision AI identified from the screenshot's visual design. Must match the `platform` field you selected in the form — mismatches are rejected.
</ResponseField>

<ResponseField name="confidence" type="number">
  A score between `0` and `1` representing how certain the Vision AI is about the extracted values. Submissions with a confidence below `0.4` are automatically rejected.
</ResponseField>

<Note>
  **`itemPrice` is always the per-unit price.** If your order shows three shawarmas at a subtotal of 31.5 SAR, PRIXO records 10.5 SAR per unit. This ensures prices are comparable across all users regardless of order size, and prevents inflated totals from skewing the community average.
</Note>

## Validation rules

PRIXO applies the following checks before accepting a snapshot. If any check fails, you are returned to the form with an error message.

| Rule                     | Condition                       | Error                                                                                          |
| ------------------------ | ------------------------------- | ---------------------------------------------------------------------------------------------- |
| Item price is positive   | `itemPrice > 0`                 | The screenshot must show a non-zero item price.                                                |
| Confidence threshold met | `confidence ≥ 0.4`              | The image was unclear or cropped. Try a full-screen screenshot with the order summary visible. |
| Platform matches         | `detectedPlatform === platform` | The platform you selected does not match the platform shown in the screenshot.                 |

## Successful submission

When all validation rules pass:

1. The price record is written to the PRIXO database and linked to the restaurant and dish.
2. Your account is awarded **+10 points**.
3. You are redirected to `/contribute/snapshot/[id]`, where you can see a summary of what was extracted and correct any fields if needed.

## The PriceSnapshot data model

Each accepted snapshot produces a `PriceSnapshot` record with the following shape:

```json theme={null}
{
  "id": "snap_abc123",
  "restaurant_id": "place_mama_noura_olaya_01",
  "item_name": "شاورما",
  "platform": "hungerstation",
  "item_price": 10.5,
  "delivery_fee": 5.0,
  "service_fee": 0.0,
  "vat": 0.75,
  "vat_included": false,
  "total": 16.25,
  "quantity": 1,
  "confidence": 0.92,
  "submitted_by": "user_xyz",
  "submitted_at": "2025-01-15T14:32:00Z",
  "status": "accepted"
}
```

<Tip>
  For the best extraction results, take your screenshot **before** placing the order — on the final order review screen where the full price breakdown (item, delivery, service fee, VAT, and total) is visible all at once. Avoid screenshots of post-order confirmation emails, which often omit some fee lines.
</Tip>

<Warning>
  Snapshots that Vision AI suspects are fraudulent — for example, an edited image or a total that does not match the sum of the components — are flagged for manual review and do not award points until a moderator approves them.
</Warning>
