> ## 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.

# Update credit topup expiration

> Update the expiration date of a topup credit transaction. Only non-expired topup transactions can be updated.



## OpenAPI

````yaml patch /v1/customers/{id}/credits/{productId}/transactions/{transactionId}
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/{productId}/transactions/{transactionId}:
    patch:
      tags:
        - Customers > Credits
      summary: Update credit topup expiration
      description: >-
        Update the expiration date of a topup credit transaction. Only
        non-expired topup transactions can be updated.
      operationId: updateCustomerCreditTopupExpiration
      parameters:
        - schema:
            type: string
          required: true
          name: id
          in: path
        - schema:
            type: string
          required: true
          name: productId
          in: path
        - schema:
            type: string
          required: true
          name: transactionId
          in: path
      requestBody:
        description: Update credit topup expiration payload
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCreditTopupExpiration'
      responses:
        '200':
          description: The updated credit transaction
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditTransaction'
      security:
        - bearer: []
components:
  schemas:
    UpdateCreditTopupExpiration:
      type: object
      properties:
        expires_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            Expiration date for credits linked to this transaction. UTC date
            time string in the [ISO
            8601](https://en.wikipedia.org/wiki/ISO_8601) format.
          example: '2024-12-20T16:04:11Z'
      required:
        - expires_at
    CreditTransaction:
      type: object
      properties:
        id:
          type: string
          description: Credit transaction ID.
          example: cdt_BPZ19obsBS2qyo
        product_id:
          type:
            - string
            - 'null'
          description: ID of the product related to the transaction.
          example: itm_3kXODDF42QXtnL
        price:
          type:
            - object
            - 'null'
          properties:
            id:
              type: string
            amount:
              type: number
              description: Monetary amount. Expressed in currency's smallest unit.
            pack_size:
              type: number
          required:
            - id
            - amount
            - pack_size
          description: Price details related to the transaction.
          example:
            id: pri_0Jv8EbMDOGsHcn
            amount: 20000
            pack_size: 120
        customer_id:
          type: string
          description: ID of the customer related to the transaction.
          example: cus_Typ0px2W0aiEtl
        payment_method_id:
          type:
            - string
            - 'null'
          description: ID of the payment method related to the transaction.
          example: pm_1xMpj5bwRqN7LM
        invoice_id:
          type:
            - string
            - 'null'
          description: ID of the invoice related to the transaction.
          example: inv_1eTaiytfA0i2Va
        event_id:
          type:
            - string
            - 'null'
          description: ID of the event related to the credit consumption.
          example: null
        aggregator_id:
          type:
            - string
            - 'null'
          description: >-
            ID of the aggregator that triggered this usage (for multi-aggregator
            credits).
          example: null
        expires_at:
          type:
            - string
            - 'null'
          format: date
          description: Expiration date for credits linked to this transaction
          example: null
        type:
          type: string
          enum:
            - topup
            - usage
            - expiration
          description: Type of credit transaction.
          example: topup
        source:
          type: string
          enum:
            - app
            - portal
            - api
            - system
          description: Deprecated field, we recommend no longer using it.
          example: system
          deprecated: true
        amount_excluding_tax:
          type:
            - number
            - 'null'
          description: Monetary amount. Expressed in currency's smallest unit.
        credit_count:
          type: number
          description: Value of credits related to the transaction.
          example: 32
        balance_after:
          type: number
          description: Credit balance after the transaction.
          example: 2000
        created_at:
          type: string
          format: date-time
          description: >-
            Credit transaction creation date. UTC date time string in the [ISO
            8601](https://en.wikipedia.org/wiki/ISO_8601) format.
          example: '2024-10-13T07:00:01.860Z'
        updated_at:
          type: string
          format: date-time
          description: >-
            Credit transaction last edition date. UTC date time string in the
            [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
          example: '2024-10-13T07:00:01.860Z'
      required:
        - id
        - product_id
        - price
        - customer_id
        - payment_method_id
        - invoice_id
        - event_id
        - aggregator_id
        - expires_at
        - type
        - source
        - amount_excluding_tax
        - credit_count
        - balance_after
        - created_at
        - updated_at
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````