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

# Get the authenticated client's package credits

> Returns the signed-in client's remaining package credits on the project. Each entry is a PACKAGE order item the client owns; `quantityRemaining` is the live, authoritative balance. Only PAID orders count, and expired or fully-drawn-down packages are omitted (pass `includeExpired=true` to keep expired ones). `quantityReturned` counts the sessions cancellations have returned to the credit, ever; they are already inside `quantityRemaining`, and a returned session may have been booked again since. Requires both an API key (`x-api-key`) and a client user JWT (`Authorization: Bearer`).



## OpenAPI

````yaml /api-reference/openapi.json get /v1/projects/{projectId}/clients/me/credits
openapi: 3.0.0
info:
  title: MarketBox 2.0 Open API
  version: 1.0.0
  description: >-
    The MarketBox public API for building booking experiences. Core model:
    create an order, then draw its order items down into bookings. Single
    bookings reference an order item per service line; package bookings draw one
    PACKAGE item down across N sessions. To schedule a package, build a slate
    (POST /availability/package-slate) and book it by slateId (POST
    /orders/{orderId}/package-bookings). See the guides for end-to-end
    walkthroughs.
  contact:
    name: MarketBox support
servers:
  - url: https://apiv2.gomarketbox.com
    description: MarketBox Open API
security:
  - ApiKeyAuth: []
paths:
  /v1/projects/{projectId}/clients/me/credits:
    get:
      tags:
        - Clients
      summary: Get the authenticated client's package credits
      description: >-
        Returns the signed-in client's remaining package credits on the project.
        Each entry is a PACKAGE order item the client owns; `quantityRemaining`
        is the live, authoritative balance. Only PAID orders count, and expired
        or fully-drawn-down packages are omitted (pass `includeExpired=true` to
        keep expired ones). `quantityReturned` counts the sessions cancellations
        have returned to the credit, ever; they are already inside
        `quantityRemaining`, and a returned session may have been booked again
        since. Requires both an API key (`x-api-key`) and a client user JWT
        (`Authorization: Bearer`).
      parameters:
        - schema:
            type: string
            minLength: 1
            description: >-
              The project (tenant) that owns the resource. Every resource in
              this API is scoped to a project, and your API key is restricted to
              the projects it was issued for — a project outside that scope
              returns 403.
            example: prj_01kv60qgnef2kt3pvqgwmkbzfr
          required: true
          description: >-
            The project (tenant) that owns the resource. Every resource in this
            API is scoped to a project, and your API key is restricted to the
            projects it was issued for — a project outside that scope returns
            403.
          name: projectId
          in: path
        - schema:
            type: string
            enum:
              - 'true'
              - 'false'
            default: 'false'
          required: false
          name: includeExpired
          in: query
      responses:
        '200':
          description: Client package credits
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        orderId:
                          type: string
                        orderItemId:
                          type: string
                        packageId:
                          type: string
                          nullable: true
                        serviceId:
                          type: string
                        offeringId:
                          type: string
                        quantity:
                          type: integer
                          minimum: 0
                          exclusiveMinimum: true
                        quantityAllocated:
                          type: integer
                          minimum: 0
                        quantityRemaining:
                          type: integer
                          minimum: 0
                        unitPrice:
                          $ref: '#/components/schemas/Money'
                        expiresAt:
                          type: string
                          nullable: true
                          format: date-time
                        orderStatus:
                          type: string
                          enum:
                            - DRAFT
                            - PENDING
                            - PAID
                            - CANCELLED
                        quantityReturned:
                          type: integer
                          minimum: 0
                          description: >-
                            Sessions returned to this credit by cancellations,
                            ever. Already counted in quantityRemaining; a
                            returned session may have been booked again since.
                      required:
                        - orderId
                        - orderItemId
                        - serviceId
                        - offeringId
                        - quantity
                        - quantityAllocated
                        - quantityRemaining
                        - unitPrice
                        - orderStatus
                        - quantityReturned
                required:
                  - data
        '401':
          description: Missing/invalid user token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '403':
          description: >-
            No access to project or unregistered user, or the signed-in user is
            not an ACTIVE member of it holding the route’s permission
            (FORBIDDEN), or X-MB-Acting-Role names a role they do not hold
            (ACTING_ROLE_NOT_HELD)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: Project not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - ApiKeyAuth: []
          EndUserBearer: []
components:
  schemas:
    Money:
      type: object
      properties:
        amount:
          type: integer
          minimum: 0
        currency:
          type: string
          minLength: 1
          maxLength: 3
      required:
        - amount
        - currency
    ErrorMessage:
      type: object
      properties:
        code:
          type: string
          description: Stable machine-readable error code, e.g. NOT_FOUND.
        message:
          type: string
          description: Human-readable description of what went wrong.
        statusCode:
          type: integer
          description: The HTTP status code of this response.
        requestId:
          type: string
          description: >-
            The id of this request, also returned as the X-Request-Id header.
            Quote it in a support ticket.
      required:
        - code
        - message
        - statusCode
        - requestId
      example:
        code: NOT_FOUND
        message: Booking not found
        statusCode: 404
        requestId: a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key minted in the MarketBox dashboard. Scope is restricted to the
        projects you select at creation time. Every route needs the key's
        standard API access (`*`) except `POST /v1/projects/{projectId}/events`,
        which needs `events:write`; a key without `*` is refused with 403
        `CAPABILITY_NOT_GRANTED`.
    EndUserBearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        The signed-in person's Cognito access token, issued to this
        application's app client. Sent with the API key on the /clients/me and
        /suppliers/me routes.

````

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