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

# Get merchant status

> Status snapshot for a merchant: interview-credit balances, subscription type/status, pending-work counts (undecided / ongoing / uncredited interviews), candidate & result totals with 14-day history, and invitation headroom. Scoped to the merchant from the JWT, or to the merchant_id query param when the caller is an admin or sub-merchant operator. The response also echoes the caller identity resolved from the JWT — profile_id and default_merchant_id — alongside the effective merchant_id.



## OpenAPI

````yaml https://cool.jobmojito.com/functions/v1/openapi get /merchant-status
openapi: 3.1.0
info:
  title: JobMojito API
  version: 1.0.0
  description: >-
    Public API for JobMojito, served by Supabase Edge Functions. Authenticate
    with a Supabase JWT access token via the Authorization header.
servers:
  - url: https://cool.jobmojito.com/functions/v1
    description: Production
security: []
tags:
  - name: Interviews
    description: >-
      Create, configure and manage interview / coaching / assessment
      definitions.
  - name: Results
    description: >-
      Interview results, transcripts, reports, re-attempt requests and
      analytics.
  - name: Candidates
    description: List and manage candidates.
  - name: Knowledge base
    description: Upload documents used to generate knowledge-base interviews.
  - name: Resume & Form verification
    description: Pre-screen candidates from resumes and forms.
  - name: Admin
    description: >-
      Account administration — invite team/coaching users, manage sub-merchants
      and avatar templates.
paths:
  /merchant-status:
    get:
      tags:
        - Admin
      summary: Get merchant status
      description: >-
        Status snapshot for a merchant: interview-credit balances, subscription
        type/status, pending-work counts (undecided / ongoing / uncredited
        interviews), candidate & result totals with 14-day history, and
        invitation headroom. Scoped to the merchant from the JWT, or to the
        merchant_id query param when the caller is an admin or sub-merchant
        operator. The response also echoes the caller identity resolved from the
        JWT — profile_id and default_merchant_id — alongside the effective
        merchant_id.
      parameters:
        - schema:
            type: string
            format: uuid
            description: >-
              Optional merchant to scope the results to. Honoured only when the
              caller is an admin or a sub-merchant operator; otherwise the
              merchant from the JWT is always used.
            example: 28106cba-1c27-4e53-b149-32113e5e8e31
          required: false
          name: merchant_id
          in: query
      responses:
        '200':
          description: The merchant status snapshot.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MerchantStatus'
        '401':
          description: Missing or invalid access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Caller is not permitted to read this merchant.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Validation error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    MerchantStatus:
      type: object
      properties:
        profile_id:
          type: string
          description: The calling user's profile id (auth user id), taken from the JWT.
          example: 9b2c1e54-7a3d-4f8e-9c10-2b6a4d5e7f01
        default_merchant_id:
          type: string
          nullable: true
          description: >-
            The caller's home merchant id pinned in the JWT
            (app_metadata.merchant_id). Null if the token carries no merchant.
          example: 28106cba-1c27-4e53-b149-32113e5e8e31
        merchant_id:
          type: string
          description: >-
            The merchant this status is scoped to — the default_merchant_id
            unless an admin / sub-merchant operator overrode it via the
            merchant_id query param.
          example: 28106cba-1c27-4e53-b149-32113e5e8e31
        credits_interview_monthly:
          type: number
          nullable: true
          description: Remaining monthly interview credits.
          example: 8
        credits_interview_monthly_limit:
          type: number
          nullable: true
          description: Monthly interview-credit allowance for the current plan.
          example: 10
        credits_interview_extra:
          type: number
          nullable: true
          description: >-
            Extra (top-up) interview credits available on top of the monthly
            allowance.
          example: 25
        credits_interview_single:
          type: number
          nullable: true
          description: Single-position interview credits available.
          example: 0
        definitions_active:
          type: number
          nullable: true
          description: Count of active interview + position definitions.
          example: 4
        interviews_without_credits:
          type: number
          description: Completed interviews that have not yet consumed a credit.
          example: 2
        interviews_undecided:
          type: number
          description: Completed interviews awaiting a recruiter decision.
          example: 3
        interviews_ongoing:
          type: number
          description: Interviews currently in progress (coach_status = started).
          example: 1
        interview_results:
          type: number
          description: Total non-archived interview results for the merchant.
          example: 137
        candidates:
          type: number
          description: >-
            Total candidates (non-archived profile_interview rows) for the
            merchant.
          example: 212
        candidates_history:
          type: array
          items:
            type: number
          description: Daily new-candidate counts for the last 14 days, most recent first.
          example:
            - 3
            - 5
            - 0
            - 2
            - 8
            - 1
            - 0
            - 4
            - 6
            - 2
            - 1
            - 0
            - 3
            - 5
        interview_result_history:
          type: array
          items:
            type: number
          description: >-
            Daily new-interview-result counts for the last 14 days, most recent
            first.
          example:
            - 1
            - 2
            - 0
            - 1
            - 3
            - 0
            - 0
            - 2
            - 1
            - 1
            - 0
            - 0
            - 1
            - 2
        subscription_type:
          type: string
          nullable: true
          description: Subscription plan name (e.g. Free, Starter, Growth, Special).
          example: Growth
        subscription_status:
          type: string
          nullable: true
          description: >-
            Subscription status (e.g. active, past_due, canceled). Null when no
            subscription.
          example: active
        invitations_sent:
          type: number
          description: Interview invitations sent during the current subscription period.
          example: 18
        invitations_limit:
          type: number
          nullable: true
          description: >-
            Maximum invitations allowed this period (4x available credits). Null
            for unlimited (Special) plans.
          example: 40
        invitations_available:
          type: number
          nullable: true
          description: >-
            Remaining invitations this period. Null for unlimited (Special)
            plans.
          example: 22
      required:
        - profile_id
        - default_merchant_id
        - merchant_id
        - credits_interview_monthly
        - credits_interview_monthly_limit
        - credits_interview_extra
        - credits_interview_single
        - definitions_active
        - interviews_without_credits
        - interviews_undecided
        - interviews_ongoing
        - interview_results
        - candidates
        - candidates_history
        - interview_result_history
        - subscription_type
        - subscription_status
        - invitations_sent
        - invitations_limit
        - invitations_available
      additionalProperties:
        nullable: true
    Error:
      type: object
      properties:
        error:
          type: string
          example: Field is required.
        name:
          type: string
          example: interview_result_id
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Supabase JWT access token, passed as `Authorization: Bearer <token>`.'

````