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

# Create credit product

> Create a credit entity for a given product with an optional balance.



## OpenAPI

````yaml post /v1/customers/{id}/credits
openapi: 3.1.0
info:
  title: Hyperline API
  version: 0.0.0
servers:
  - url: https://api.hyperline.co
  - url: https://sandbox.api.hyperline.co
security: []
paths:
  /v1/customers/{id}/credits:
    post:
      tags:
        - Customers > Credits
      summary: Create credit product
      description: Create a credit entity for a given product with an optional balance.
      operationId: createCustomerCredit
      parameters:
        - schema:
            type: string
          required: true
          name: id
          in: path
      requestBody:
        description: Create credit payload
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCredit'
      responses:
        '201':
          description: Credit created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Credit'
      security:
        - bearer: []
components:
  schemas:
    CreateCredit:
      type: object
      properties:
        product_id:
          type: string
          description: Credit product ID.
          example: itm_3kXODDF42QXtnL
        name:
          type: string
          description: Credit name.
          example: Credit name
        current_balance:
          type: number
          description: Current credit balance.
          example: 2000
        low_count_threshold:
          type:
            - number
            - 'null'
          description: Value indicating a low threshold.
          example: 10
        auto_topup:
          type: object
          properties:
            credit_count:
              type: number
              description: >-
                Value indicating a number of credits to add. If `price_id` is
                defined, this value must correspond to a full credit pack for
                the price.
              example: 32
            amount_excluding_tax:
              type: number
              description: >-
                Custom amount for the added credits. Either
                `amount_excluding_tax` or `price_id` must be defined. Expressed
                in currency's smallest unit.
              example: 2000
            price_id:
              type: string
              description: >-
                Price ID used to add credits. The price must be of type
                `bundle`. Either `amount_excluding_tax` or `price_id` must be
                defined.
          required:
            - credit_count
          description: Auto top-up options.
      required:
        - product_id
    Credit:
      type: object
      properties:
        product_id:
          type: string
          description: Credit product ID.
          example: itm_3kXODDF42QXtnL
        customer_id:
          type: string
          description: Customer ID related to the credit.
          example: cus_Typ0px2W0aiEtl
        name:
          type: string
          description: Credit name.
          example: Credit name
        current_balance:
          type: number
          description: Current credit balance.
          example: 2000
        low_count_threshold:
          type:
            - number
            - 'null'
          description: Value indicating a low threshold.
          example: 10
        last_refreshed_at:
          type: string
          format: date-time
          description: >-
            Credit last refresh date. UTC date time string in the [ISO
            8601](https://en.wikipedia.org/wiki/ISO_8601) format.
          example: '2025-11-23T09:00:01.860Z'
        auto_topup:
          type:
            - object
            - 'null'
          properties:
            credit_count:
              type: number
              description: >-
                Value indicating a number of credits to add. If `price_id` is
                defined, this value must correspond to a full credit pack for
                the price.
              example: 32
            amount_excluding_tax:
              type:
                - number
                - 'null'
              description: >-
                Custom amount for the added credits. Either
                `amount_excluding_tax` or `price_id` must be defined. Expressed
                in currency's smallest unit.
              example: null
            price_id:
              type:
                - string
                - 'null'
              description: >-
                Price ID used to add credits. The price must be of type
                `bundle`. Either `amount_excluding_tax` or `price_id` must be
                defined.
              example: null
          required:
            - credit_count
            - amount_excluding_tax
            - price_id
          description: Auto top-up options.
        created_at:
          type: string
          format: date-time
          description: >-
            Credit creation date. UTC date time string in the [ISO
            8601](https://en.wikipedia.org/wiki/ISO_8601) format.
          example: '2025-10-12T07:00:01.860Z'
        updated_at:
          type: string
          format: date-time
          description: >-
            Credit last edition date. UTC date time string in the [ISO
            8601](https://en.wikipedia.org/wiki/ISO_8601) format.
          example: '2025-10-13T10:00:01.860Z'
      required:
        - product_id
        - customer_id
        - name
        - current_balance
        - low_count_threshold
        - last_refreshed_at
        - auto_topup
        - created_at
        - updated_at
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````