Mercantry Bookings API

The Bookings API from Mercantry — 5 operation(s) for bookings.

GitHub OpenAPI

Operations 5

POST /v1/bookings Place a reservation (async — a call is placed to the merchant) #
GET /v1/bookings/{booking_id} Booking status: state machine position + structured outcome #
POST /v1/bookings/{booking_id}/modify Amend a booking / resolve needs_input #
POST /v1/bookings/{booking_id}/cancel Cancel a booking (mandatory when plans change — no-shows are tracked) #
POST /v1/bookings/{booking_id}/feedback Post-visit feedback (confirmed bookings only, once, within 14 days) #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/mercantry-org:mercantry-org-bookings-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

mercantry-org-bookings-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Registry — agent-native merchant registry (REST mirror)…
  version: 1.0.0
  description: 'Structured merchant data and phone-fulfilled restaurant reservations for AI agents. San Francisco, CA, ~500 merchants. This REST surface mirrors the MCP server at POST /mcp (Streamable HTTP) — same data, same booking state machine. Honest by design: filter-based search in deterministic order (never ranked), transaction-verified feedback only, availability checked on the call at booking time (`performed_at_booking`). Reads are free and unauthenticated; API keys are optional and exist for abuse control, not gating. Errors are machine-actionable: every 4xx/5xx body carries a stable `error` code plus `field`/`allowed`/`example`/`message`/`docs` where known (schema AgentError); 429s set Retry-After.'
servers:
- url: https://mercantry.org
tags:
- name: Bookings
paths:
  /v1/bookings:
    post:
      summary: Place a reservation (async — a call is placed to the merchant)
      description: 'Returns booking_id with state=queued immediately. Poll GET /v1/bookings/{id} or supply callback_url for webhooks. With accept_within_window=true (recommended), merchant counter-offers inside ±window_minutes auto-confirm without a round-trip. Retry safety: send a unique client_reference_id (or Idempotency-Key header); retrying with the same value returns the existing booking (200, idempotent_replay=true) instead of double-booking.'
      security:
      - {}
      - apiKey: []
      parameters:
      - name: Idempotency-Key
        in: header
        required: false
        schema:
          type: string
          maxLength: 128
        description: Alias for body field client_reference_id (body wins if both are sent).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - merchant_id
              - party_size
              - datetime
              - reservation_name
              properties:
                merchant_id:
                  type: string
                  format: uuid
                party_size:
                  type: integer
                  minimum: 1
                datetime:
                  type: string
                  description: Requested time, ISO-8601. Naive (2026-07-18T19:00) means the merchant's local wall time; an explicit offset is also accepted.
                window_minutes:
                  type: integer
                  minimum: 0
                  maximum: 240
                accept_within_window:
                  type: boolean
                reservation_name:
                  type: string
                contact:
                  type: string
                  description: Optional phone/email for confirmation relay to the end human.
                special_requests:
                  type: string
                  maxLength: 280
                callback_url:
                  type: string
                  description: Webhook URL for booking state-change events.
                client_reference_id:
                  type: string
                  maxLength: 128
                  description: Your unique ID for this booking request (a UUID is ideal). Retrying with the same value returns the existing booking instead of creating a duplicate; scoped per API key.
                sandbox_outcome:
                  type: string
                  enum:
                  - confirmed
                  - no_answer
                  - counter_offer
                  - fully_booked
                  - merchant_declined
                  - bad_data
                  description: 'TEST ONLY, sandbox merchants (sandbox: true): force the simulated call''s result so an integration can exercise a chosen branch on demand. Rejected with sandbox_outcome_requires_sandbox_merchant for real merchants. Walkthrough: /demo.'
      responses:
        '200':
          description: 'Idempotent replay: {ok, booking_id, state, idempotent_replay: true} — an existing booking matched client_reference_id; nothing new was created.'
        '201':
          description: 'Accepted: {ok, booking_id, state: queued}.'
        '400':
          description: Structured rejection, e.g. merchant_not_phone_verified, requires_deposit_not_supported_in_v1, party_size_out_of_range (with the merchant's real range in `allowed`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentError'
        '401':
          description: invalid_api_key | key_throttled_high_no_show_rate (keys are optional; omit rather than guess).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentError'
        '404':
          description: unknown_merchant.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentError'
        '409':
          description: 'client_reference_conflict: this client_reference_id was already used with different request parameters — use a fresh reference for a genuinely new booking.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentError'
        '429':
          description: rate_limited — wait Retry-After seconds, then resume.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentError'
      tags:
      - Bookings
      operationId: postV1Bookings
      x-operation-id-source: derived
  /v1/bookings/{booking_id}:
    get:
      summary: 'Booking status: state machine position + structured outcome'
      parameters:
      - name: booking_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: include_events
        in: query
        schema:
          type: boolean
        description: Include the full audit log.
      responses:
        '200':
          description: Booking status.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookingStatus'
        '404':
          description: unknown_booking.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentError'
      tags:
      - Bookings
      operationId: getV1BookingsByBookingId
      x-operation-id-source: derived
  /v1/bookings/{booking_id}/modify:
    post:
      summary: Amend a booking / resolve needs_input
      description: 'In needs_input: pass accept_option_index to take a merchant-offered time (confirms immediately) or amend datetime/party_size to re-queue. Modifying a confirmed booking cancels and rebooks (new booking_id returned).'
      parameters:
      - name: booking_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                datetime:
                  type: string
                party_size:
                  type: integer
                  minimum: 1
                window_minutes:
                  type: integer
                  minimum: 0
                  maximum: 240
                accept_option_index:
                  type: integer
                  minimum: 0
      responses:
        '200':
          description: Updated state.
        '400':
          description: invalid_option_index | booking_in_terminal_state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentError'
        '404':
          description: unknown_booking.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentError'
      tags:
      - Bookings
      operationId: postV1BookingsByBookingIdModify
      x-operation-id-source: derived
  /v1/bookings/{booking_id}/cancel:
    post:
      summary: Cancel a booking (mandatory when plans change — no-shows are tracked)
      parameters:
      - name: booking_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                reason:
                  type: string
      responses:
        '200':
          description: Cancelled.
        '400':
          description: booking_in_terminal_state — already failed/cancelled.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentError'
        '404':
          description: unknown_booking.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentError'
      tags:
      - Bookings
      operationId: postV1BookingsByBookingIdCancel
      x-operation-id-source: derived
  /v1/bookings/{booking_id}/feedback:
    post:
      summary: Post-visit feedback (confirmed bookings only, once, within 14 days)
      description: Served raw to all agents via the merchant record — never editorialized, never scored (REQ-FBK-3).
      parameters:
      - name: booking_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - reservation_honored
              properties:
                reservation_honored:
                  type: boolean
                seated_on_time:
                  type: boolean
                matched_description:
                  type: boolean
                would_repeat:
                  type: boolean
                free_text:
                  type: string
                  maxLength: 500
      responses:
        '201':
          description: Recorded.
        '400':
          description: feedback_requires_confirmed_booking | feedback_window_expired | feedback_already_submitted | free_text_too_long.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentError'
        '404':
          description: unknown_booking.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentError'
      tags:
      - Bookings
      operationId: postV1BookingsByBookingIdFeedback
      x-operation-id-source: derived
components:
  schemas:
    BookingStatus:
      type: object
      description: Booking state machine position with structured outcome details.
      properties:
        booking_id:
          type: string
          format: uuid
        merchant_id:
          type: string
          format: uuid
        state:
          type: string
          enum:
          - pending
          - queued
          - in_progress
          - needs_input
          - confirmed
          - failed
          - cancelled
        failure_reason:
          type: string
          enum:
          - no_answer
          - fully_booked
          - closed
          - policy_mismatch
          - merchant_declined
          - bad_data
          - expired_sla
          - needs_input_timeout
        requested_time:
          type: string
        window_minutes:
          type: integer
        party_size:
          type: integer
        confirmed_time:
          type: string
        confirmation_code:
          type: string
        merchant_instructions:
          type: string
        needs_input_options:
          type: array
          items:
            type: object
            properties:
              time:
                type: string
              note:
                type: string
          description: Merchant-offered alternatives awaiting the agent's decision (resolve via /v1/bookings/{id}/modify).
        needs_input_deadline:
          type: string
        attempts:
          type: integer
        sla_deadline:
          type: string
          description: Terminal state guaranteed by this time (REQ-FUL-6).
        created_at:
          type: string
        updated_at:
          type: string
    AgentError:
      type: object
      description: Agent-actionable error, returned on every 4xx/5xx. `error` is a stable machine code — match on it exactly. Where known, `field` names the offending input, `allowed`/`example` say what would be accepted, `message` explains the fix, and `docs` links this document. 429s additionally set the Retry-After header and `retry_after_s`.
      required:
      - error
      properties:
        ok:
          type: boolean
          const: false
        error:
          type: string
          description: Stable machine code, e.g. party_size_out_of_range, unknown_merchant, rate_limited.
        message:
          type: string
          description: What went wrong and what to do instead.
        field:
          type: string
          description: The offending request field, when the error is input-specific.
        allowed:
          type: string
          description: Accepted values/range for `field`, e.g. '1-8'.
        example:
          type: string
          description: An example of an accepted value.
        docs:
          type: string
          description: URL of this OpenAPI document.
        retry_after_s:
          type: integer
          description: Seconds to wait before retrying (429 only; mirrors the Retry-After header).
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: 'Optional developer key from POST /v1/keys. Also accepted as Authorization: Bearer <key>.'
x-rate-limits:
  per_minute: 300
  headers:
  - X-RateLimit-Limit
  - X-RateLimit-Remaining
  - X-RateLimit-Reset
  on_429: Retry-After header (seconds) + retry_after_s/limit/remaining/reset in the body — wait exactly that long, then resume.
x-mcp:
  endpoint: /mcp
  transport: streamable-http
  note: Agents with MCP support should prefer the MCP endpoint; tools self-describe via tools/list.