> ## 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 credit usage

> Per-event credit-usage ledger for a merchant: every billable analytics event (interview, pre-screening, public avatar, simulation, …) that consumed credits, ordered most recent first. Scoped to your token's merchant, or a merchant_id override for admins / sub-merchant operators. The credits consumed by each event are in stats.credit_amount. Capped at 1000 records per page.



## OpenAPI

````yaml https://cool.jobmojito.com/functions/v1/openapi get /merchant-analytics-credits-used
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-analytics-credits-used:
    get:
      tags:
        - Results
      summary: Get merchant credit usage
      description: >-
        Per-event credit-usage ledger for a merchant: every billable analytics
        event (interview, pre-screening, public avatar, simulation, …) that
        consumed credits, ordered most recent first. Scoped to your token's
        merchant, or a merchant_id override for admins / sub-merchant operators.
        The credits consumed by each event are in stats.credit_amount. Capped at
        1000 records per page.
      parameters:
        - schema:
            type: string
            format: uuid
            description: >-
              Optional merchant to scope to. Admins and sub-merchant operators
              only; other callers always use their token's merchant.
            example: 28106cba-1c27-4e53-b149-32113e5e8e31
          required: false
          name: merchant_id
          in: query
        - schema:
            type: string
            format: uuid
            description: >-
              Optional interview (interview_def_set) or position
              (position_def_set) id to drill the credit-usage ledger down to a
              single interview or position. The type is detected automatically:
              for a position the response combines pre-screening and
              interview-result credits across the whole position; for an
              interview it returns that interview's credit events (including
              simulations and report translations).
          required: false
          name: interview_id
          in: query
        - schema:
            type: integer
            minimum: 1
            maximum: 1000
            default: 50
            description: Maximum number of records to return (1–1000).
            example: 50
          required: false
          name: limit
          in: query
        - schema:
            type: integer
            nullable: true
            minimum: 0
            default: 0
            description: Number of records to skip from the start of the result set.
            example: 0
          required: false
          name: offset
          in: query
      responses:
        '200':
          description: A page of credit-usage events with pagination metadata.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MerchantCreditsUsedResponse'
        '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:
    MerchantCreditsUsedResponse:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
                description: Analytics event id.
              event_date:
                type: string
                nullable: true
                description: When the credit-consuming event occurred (ISO 8601).
                example: '2026-01-15T09:30:00.000Z'
              event:
                type: string
                description: >-
                  Billable event type that consumed the credit (e.g. interview,
                  interview_reviewing, interview_failed, interview_incomplete,
                  pre_screening, candidate_report_translation, candidate_kyc,
                  public_avatar, interview_simulation).
                example: interview
              credit_amount:
                type: number
                nullable: true
                description: >-
                  Number of credits deducted by this event, surfaced from
                  stats.credit_amount for convenience. Null when the amount is
                  absent.
                example: 1
              stats:
                nullable: true
                description: >-
                  Event stats JSON. Contains credit_amount (the credits consumed
                  by this event) plus event-specific fields.
              candidate_name:
                type: string
                nullable: true
                description: >-
                  Candidate display name from the linked profile interview, when
                  available.
              profile_id:
                type: string
                nullable: true
                format: uuid
                description: Underlying person (profile) id, when linked.
              profile_interview_id:
                type: string
                nullable: true
                format: uuid
                description: Candidate enrolment (profile interview) id, when linked.
              object_uuid:
                type: string
                nullable: true
                format: uuid
                description: >-
                  Primary object the event refers to (e.g. the interview result
                  / attempt).
              parent_object_uuid:
                type: string
                nullable: true
                format: uuid
                description: >-
                  Parent object of the event (e.g. the interview definition),
                  when applicable.
            required:
              - id
              - event_date
              - event
              - credit_amount
              - candidate_name
              - profile_id
              - profile_interview_id
              - object_uuid
              - parent_object_uuid
            additionalProperties:
              nullable: true
          description: >-
            Credit-consuming analytics events for the merchant, most recent
            first. Each row is one billable event; the credits it consumed are
            in stats.credit_amount.
        pagination:
          $ref: '#/components/schemas/Pagination'
      required:
        - data
        - pagination
    Error:
      type: object
      properties:
        error:
          type: string
          example: Field is required.
        name:
          type: string
          example: interview_result_id
      required:
        - error
    Pagination:
      type: object
      properties:
        total:
          type: integer
          description: Total matching records across all pages.
          example: 137
        limit:
          type: integer
          description: Page size used for this response.
          example: 50
        offset:
          type: integer
          description: Offset used for this response.
          example: 0
        has_more:
          type: boolean
          description: >-
            True when more records exist beyond this page (offset + returned <
            total).
          example: true
      required:
        - total
        - limit
        - offset
        - has_more
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Supabase JWT — `Authorization: Bearer <token>`.'

````