> ## 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.

# 登记限时访客车辆

> 为酒店住客、写字楼来宾或预约施工车辆发放带有效起止时间窗的访客通行权益。传入 `maxEntries: null` 表示有效期内不限次进出。

**所需权限 Scope：** `visitors:write`




## OpenAPI

````yaml /openapi/openapi.zh.yaml post /v1/visitors/create
openapi: 3.1.0
info:
  title: AKE Parking 国际版开放平台 API
  version: 1.0.0
  description: >-
    基于零基思维与国际化规范设计的现代 HTTP RPC 接口契约，适用于将第三方电子钱包、购物中心会员 App、商户 POS
    收银、酒店/写字楼物业系统以及园区运营控制台接入 AKE Parking 国际版停车场。


    核心设计规范：

    - **可预测的 HTTP RPC**：统一采用 `POST /v1/<domain>/<action>` 与严格的 `camelCase` JSON
    载荷

    - **以合作方为中心的授权模型**：单个 Bearer API Key 可绑定多个授权车场与细粒度 Scope

    - **部署拓扑无关契约**：云端生产、云端沙箱与局域网本地直连（Local Direct）共用同一套接口

    - **国际化基础原语**：泛化通行凭证（`PLATE`、`CARD`、`TICKET`、`QR_CODE`，不做国家特化字段）、ISO 4217
    最小货币单位整数（兼容 0/2/3 位小数币种）、带时区的 ISO 8601 时间戳、显式税费明细以及游标分页
  contact:
    name: AKE Parking Developer Support
    url: https://www.akeparking.com
servers:
  - url: https://api.akeparking.com
    description: 云端生产环境 — 全球 SaaS 正式生产环境
  - url: https://sandbox-api.akeparking.com
    description: 云端沙箱环境 — 提供模拟车场与虚拟设备的隔离测试环境
  - url: http://{host}:{port}
    description: 本地直连环境 — 车场局域网（LAN）本地部署服务器
    variables:
      host:
        default: 192.168.1.100
        description: 本地停车场服务器 IP 地址或内网主机名
      port:
        default: '8080'
        description: 本地开放平台接口服务端口
security:
  - bearerAuth: []
tags:
  - name: 车场与余位
    description: 发现已授权车场、查询车道拓扑与收费标准，并校准实时车位余数。
  - name: 在场与流水
    description: 查询在场车辆与历史停车流水、纠错误识别车牌，以及手工补录进场记录。
  - name: 算费与缴费
    description: 实时算费报价（含税费与电子券抵扣明细）、回传外部支付成功及同步退款。
  - name: 电子券与商户
    description: 查询合作商户与优惠券模板、发放数字停车券、券码领券、撤回未使用电子券并查询发放台账。
  - name: 月票管理
    description: 管理周期卡、储值卡、计次卡与储时卡等多种模型的月票套餐及月票生命周期。
  - name: 名单与访客
    description: 为酒店住客与写字楼访客发放限时段通行证，并维护 VIP 白名单与黑名单。
  - name: 道闸与设备
    description: 监控车道设备在线状态、执行带审计的远程开关闸、切换通道模式、下发屏显语音以及触发抓拍。
paths:
  /v1/visitors/create:
    post:
      tags:
        - 名单与访客
      summary: 登记限时访客车辆
      description: |
        为酒店住客、写字楼来宾或预约施工车辆发放带有效起止时间窗的访客通行权益。传入 `maxEntries: null` 表示有效期内不限次进出。

        **所需权限 Scope：** `visitors:write`
      operationId: createVisitor
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - facilityId
                - credential
                - visitorName
                - validFrom
                - validUntil
              properties:
                facilityId:
                  $ref: '#/components/schemas/FacilityId'
                credential:
                  $ref: '#/components/schemas/Credential'
                visitorName:
                  type: string
                visitorPhone:
                  type: string
                hostUnit:
                  type: string
                  description: 酒店房号、套房或企业租户单元编号。
                validFrom:
                  $ref: '#/components/schemas/IsoTimestamp'
                validUntil:
                  $ref: '#/components/schemas/IsoTimestamp'
                maxEntries:
                  type:
                    - integer
                    - 'null'
                  minimum: 1
                  default: 1
                  description: 有效时间窗内允许的最大进场次数（`null` 表示不限次数）。
                validAreaCodes:
                  type: array
                  items:
                    type: string
                purpose:
                  type: string
                metadata:
                  $ref: '#/components/schemas/Metadata'
            example:
              facilityId: MY-KL-001
              credential:
                type: PLATE
                value: SBA8821K
              visitorName: Sarah Lim
              visitorPhone: '+6591234567'
              hostUnit: Suite 1804
              validFrom: '2026-11-27T14:00:00+08:00'
              validUntil: '2026-11-28T12:00:00+08:00'
              maxEntries: 5
              purpose: Hotel guest stay
      responses:
        '200':
          description: 访客预约记录创建成功。
          content:
            application/json:
              schema:
                type: object
                required:
                  - visitor
                properties:
                  visitor:
                    $ref: '#/components/schemas/VisitorPass'
              example:
                visitor:
                  visitorId: vis_01JDRDZ77Q
                  facilityId: MY-KL-001
                  credential:
                    type: PLATE
                    value: SBA8821K
                  visitorName: Sarah Lim
                  visitorPhone: '+6591234567'
                  hostUnit: Suite 1804
                  status: SCHEDULED
                  validFrom: '2026-11-27T14:00:00+08:00'
                  validUntil: '2026-11-28T12:00:00+08:00'
                  maxEntries: 5
                  usedEntries: 0
                  remainingEntries: 5
                  validAreaCodes: []
                  purpose: Hotel guest stay
                  metadata: {}
                  createdAt: '2026-11-27T12:00:00+08:00'
        '400':
          $ref: '#/components/responses/BadRequest'
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: 所有写接口强烈建议传入的唯一 UUID，用于在网络超时场景下安全重试而不重复执行。
      schema:
        type: string
        format: uuid
        example: 550e8400-e29b-41d4-a716-446655440000
  schemas:
    FacilityId:
      type: string
      description: 合作方授权范围下的唯一停车场对外编码标识。
      example: MY-KL-001
    Credential:
      type: object
      required:
        - type
        - value
      properties:
        type:
          $ref: '#/components/schemas/CredentialType'
        value:
          type: string
      description: 在目标车场范围内唯一识别车辆或用户的泛化通行凭证（仅包含 `type` 与 `value`）。
    IsoTimestamp:
      type: string
      format: date-time
      description: 带明确时区偏移或 `Z`（UTC）后缀的 ISO 8601 标准时间戳。
      example: '2026-11-27T12:00:00+08:00'
    Metadata:
      type: object
      additionalProperties:
        type: string
      maxProperties: 10
      description: 扁平键值对合作方业务关联元数据（最多 10 个 Key，值仅限字符串）。
    VisitorPass:
      type: object
      required:
        - visitorId
        - facilityId
        - credential
        - visitorName
        - status
        - validFrom
        - validUntil
        - usedEntries
        - createdAt
      properties:
        visitorId:
          type: string
        facilityId:
          $ref: '#/components/schemas/FacilityId'
        credential:
          $ref: '#/components/schemas/Credential'
        visitorName:
          type: string
        visitorPhone:
          type:
            - string
            - 'null'
        hostUnit:
          type:
            - string
            - 'null'
        status:
          type: string
          enum:
            - SCHEDULED
            - ACTIVE
            - EXPIRED
            - CANCELLED
        validFrom:
          $ref: '#/components/schemas/IsoTimestamp'
        validUntil:
          $ref: '#/components/schemas/IsoTimestamp'
        maxEntries:
          type:
            - integer
            - 'null'
        usedEntries:
          type: integer
        remainingEntries:
          type:
            - integer
            - 'null'
        validAreaCodes:
          type: array
          items:
            type: string
        purpose:
          type:
            - string
            - 'null'
        metadata:
          $ref: '#/components/schemas/Metadata'
        createdAt:
          $ref: '#/components/schemas/IsoTimestamp'
    CredentialType:
      type: string
      enum:
        - PLATE
        - CARD
        - TICKET
        - QR_CODE
      description: >-
        泛化通行凭证类型：`PLATE`（标准化车牌编码，大写且去除空格与连字符）、`CARD`（门禁卡/RFID/脱敏卡标识，禁止传入银行卡明文
        PAN）、`TICKET`（纸质或条码票号）、`QR_CODE`（二维码或 App 用户唯一编号）。
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - requestId
          properties:
            code:
              type: string
            message:
              type: string
            requestId:
              type: string
            details:
              type:
                - object
                - 'null'
  responses:
    BadRequest:
      description: 请求体 JSON 格式错误或缺少合法必填参数。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: INVALID_REQUEST
              message: Field 'facilityId' is required.
              requestId: req_01JDR9X7V2M8K
              details: null
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: |
        通过 `Authorization` 请求头传入合作方 API Key：`Authorization: Bearer ak_live_...`
        （云端沙箱使用 `ak_test_...`，局域网本地直连使用 `ak_local_...`）。

````

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