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

# Find Credits

> Search credits with given parameters



## OpenAPI

````yaml https://api.getmeasure.com/api/v1/docs/api_spec.json post /companies/{company_id}/credits/find
openapi: 3.1.0
info:
  title: Measure API
  description: APIs to communicate with Measure
  version: 1.0.0
servers:
  - url: https://api.getmeasure.com/api/v1
security: []
paths:
  /companies/{company_id}/credits/find:
    post:
      tags:
        - Credits
      summary: Find Credits
      description: Search credits with given parameters
      operationId: Find_Credits
      parameters:
        - name: company_id
          in: path
          description: 'The company ID with the prefix ''cmp_''. '
          required: true
          schema:
            description: 'The company ID with the prefix ''cmp_''. '
            type: string
        - name: Idempotency-Key
          in: header
          description: >-
            The idempotency key that will be used to ensure the request is only
            performed once
          schema:
            description: >-
              The idempotency key that will be used to ensure the request is
              only performed once
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestFindCreditRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseFindCreditResponse'
      deprecated: false
      security:
        - apiKey:
            - ''
components:
  schemas:
    RequestFindCreditRequest:
      properties:
        include_meta:
          description: >-
            Whether to include additional metadata in the pagination response
            such the number of total results
          type:
            - boolean
            - 'null'
        pagination:
          $ref: '#/components/schemas/RequestPaginationRequest'
          description: The pagination parameters for the request
        query:
          $ref: '#/components/schemas/RequestFindCreditQueryCriteria'
          description: The query criteria for the request
        sort_key:
          default: createdAtDesc
          enum:
            - createdAtDesc
            - createdAtAsc
            - updatedAtAsc
            - updatedAtDesc
            - expirationDateAsc
            - expirationDateDesc
            - statusPriority
          type: string
      required:
        - pagination
      type: object
    ResponseFindCreditResponse:
      properties:
        pagination:
          $ref: '#/components/schemas/ResponsePaginationResponse'
        results:
          items:
            $ref: '#/components/schemas/ResponseCreditRepresentation'
          type:
            - array
            - 'null'
      type: object
    RequestPaginationRequest:
      description: The pagination parameters for the request
      properties:
        from_key:
          type:
            - 'null'
            - string
        limit:
          default: 20
          format: int64
          maximum: 200
          minimum: 0
          type: integer
      type: object
    RequestFindCreditQueryCriteria:
      properties:
        currency:
          description: Credit if amount is assigned to  currency
          type:
            - 'null'
            - string
        customer_id:
          description: The customer ID to which the credits belong
          type:
            - 'null'
            - string
        search:
          description: Any search string to match customers
          type:
            - 'null'
            - string
        status:
          description: >-
            The specific status of the customer that can be one of ACTIVE
            CONSUMED REVOKED or EXPIRED
          enum:
            - ACTIVE
            - CONSUMED
            - REVOKED
            - EXPIRED
          type:
            - 'null'
            - string
        statuses:
          description: >-
            The status of the customers that can include ACTIVE CONSUMED REVOKED
            or EXPIRED
          enum:
            - ACTIVE
            - CONSUMED
            - REVOKED
            - EXPIRED
          items:
            type: string
          type:
            - array
            - 'null'
        subscription_id:
          description: The subscription ID to which the credits belong
          type:
            - 'null'
            - string
        type:
          description: The credit type that can be one of AMOUNT or UNITS
          type:
            - 'null'
            - string
      type:
        - object
        - 'null'
    ResponsePaginationResponse:
      properties:
        from_key:
          type:
            - 'null'
            - string
        limit:
          format: int64
          type: integer
      type: object
    ResponseCreditRepresentation:
      properties:
        amount:
          $ref: '#/components/schemas/ModelAmount'
        coupon_id:
          type:
            - 'null'
            - string
        created_at:
          format: date-time
          type: string
        customer_id:
          type: string
        expiration_date:
          format: date-time
          type:
            - 'null'
            - string
        id:
          type: string
        import_created_at_ref:
          format: date-time
          type:
            - 'null'
            - string
        import_ref:
          type:
            - 'null'
            - string
        imported_from:
          type:
            - 'null'
            - string
        issued_amount:
          $ref: '#/components/schemas/ModelAmount'
        issued_units:
          format: double
          type: number
        item:
          $ref: '#/components/schemas/ResponseBillableItemRepresentation'
        item_id:
          type:
            - 'null'
            - string
        metric_record_id:
          type:
            - 'null'
            - string
        name:
          type: string
        one_time_billable_id:
          type:
            - 'null'
            - string
        proration_date:
          format: date-time
          type:
            - 'null'
            - string
        state:
          type: string
        subscription_id:
          type:
            - 'null'
            - string
        type:
          type: string
        units:
          format: double
          type: number
      type: object
    ModelAmount:
      description: The amount which has value in cents and a currency
      properties:
        currency:
          type: string
        value_in_cents:
          format: int64
          type: integer
      type: object
    ResponseBillableItemRepresentation:
      properties:
        company_id:
          description: The company ID for the billable item
          type: string
        created_at:
          description: The date the billable item was created
          format: date-time
          type: string
        description:
          description: Any description attached to the billable item
          type: string
        display_type:
          description: >-
            The display type of the billable item which can be one of UNITS,
            AMOUNT, THOUSAND_UNITS, MILLION_UNITS
          type: string
        editable:
          description: Whether the billable item can be further edited
          type: boolean
        external_name:
          description: The public name of the billable item
          type: string
        id:
          description: The ID of the billable item in Measure
          type: string
        name:
          description: The name of the billable item
          type: string
        standard:
          description: >-
            Whether this is a standard billable item in Measure or a custom
            billable item
          type: boolean
        type:
          description: >-
            The type of the billable item which can be one of CUSTOM_USAGE or
            CUSTOM_OBJ, based on usage-based item or object-based item
          type: string
        updated_at:
          description: The date the billable item was last updated
          format: date-time
          type: string
      type: object
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer

````