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

# Merchant Validations

> Issue retail dining waivers from POS terminals, validate QR codes, and reconcile merchant grants.

Shopping malls, cinema chains, and F\&B tenants can issue digital parking validations directly from their POS or loyalty apps without printed paper vouchers.

## Two Issuance Patterns

```mermaid theme={null}
sequenceDiagram
  autonumber
  participant POS as "Merchant POS / App"
  participant AKE as "AKE Parking API"

  alt Direct Grant by Plate or Ticket
    POS->>AKE: "POST /v1/validations/grant (credential + templateId)"
    AKE-->>POS: "grantId, validationCode, status: ACTIVE"
  else Customer Claims Printed or Dynamic QR Code
    POS->>AKE: "POST /v1/validations/claimByCode (claimCode + credential)"
    AKE-->>POS: "grantId, validationCode, status: ACTIVE"
  end
```

## Recommended Flow

**1. Sync participating merchants and templates**

Fetch authorized merchants with `POST /v1/merchants/list` (check `requiresActiveSession` to know whether a vehicle must already be parked before granting) and retrieve available templates via `POST /v1/validations/templates/list`.

Supported `discountType` modes include `FREE_MINUTES`, `FIXED_AMOUNT`, `PERCENTAGE`, `CAPPED_RATE`, `FULL_WAIVER`, and `MULTI_USE_WAIVER`, along with `stackable` / `maxStackCount` rules and `settlementModel`:

* **`PREPAID`**: Drawn from a pre-purchased merchant quota (`inventoryBatchId` required when granting).
* **`POSTPAID`**: Billed upon redemption (`allowCustomValue` optionally enables cashier-specified amount/minute overrides up to `maxCustomValue`).

**2. Issue validation after qualifying spend**

When a retail checkout succeeds, call `POST /v1/validations/grant` with `Idempotency-Key` and your internal `externalReceiptNo` for auditability.

**3. Handle retail returns with revocation**

If a customer refunds their retail purchase before exiting the facility, call `POST /v1/validations/revoke`. If the validation has already been used for checkout, the API returns `409` (`VALIDATION_ALREADY_REDEEMED`).

**4. Reconcile monthly merchant billing**

Use `POST /v1/validations/listGrants` to pull all granted and redeemed validations per merchant across your billing period.


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