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

# Create a new credit transaction

> Create a new credit transaction



## OpenAPI

````yaml billing.latest.product.live POST /credit-transactions
openapi: 3.0.0
info:
  title: Billing
  description: Manage Billing
  version: '0.1'
servers:
  - url: https://dev.seqhq.io/api
    description: DEV
  - url: https://sandbox.sequencehq.com/api
    description: SANDBOX
  - url: https://eu.sequencehq.com/api
    description: PRODUCTION
security: []
tags: []
paths:
  /credit-transactions:
    servers: []
    parameters: []
    post:
      tags:
        - Credits
      summary: Create a new credit transaction
      description: Create a new credit transaction
      operationId: postCreditTransactions
      parameters:
        - name: Authorization
          in: header
          description: >-
            Your [API credentials](/reference/authentication). Eg. `Basic
            {credentials}`.
          required: true
          schema:
            type: string
        - name: On-Behalf-Of
          in: header
          description: The Sequence account that this request is made on behalf of.
          required: true
          schema:
            type: string
        - name: Sequence-Version
          in: header
          description: Use this header to select an API version
          required: false
          schema:
            type: string
            enum:
              - '2024-07-30'
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/CreateCreditTransactionEndpointCreateCreditTransactionRequestModel
              example:
                grantId: 746fc7f2-8098-4fe7-953c-7d51c580a126
                reason: Refund
                invoiceId: 6cedbb5e-4f77-4217-b8d4-020e7e4d33c9
                billingRunId: cbe82021-90bb-47cc-a665-eda41ec4ee5b
                type: DEBIT
                amount: '10'
            examples:
              CreateCreditTransactionEndpointCreateCreditTransactionRequestModel:
                summary: ''
                value:
                  grantId: 746fc7f2-8098-4fe7-953c-7d51c580a126
                  reason: Refund
                  invoiceId: 6cedbb5e-4f77-4217-b8d4-020e7e4d33c9
                  billingRunId: cbe82021-90bb-47cc-a665-eda41ec4ee5b
                  type: DEBIT
                  amount: '10'
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditTransaction'
                example:
                  id: 4a1da26e-4f4a-4607-9597-9652138afcf1
                  grantId: 746fc7f2-8098-4fe7-953c-7d51c580a126
                  reason: Refund
                  invoiceId: 6cedbb5e-4f77-4217-b8d4-020e7e4d33c9
                  billingRunId: cbe82021-90bb-47cc-a665-eda41ec4ee5b
                  type: DEBIT
                  amount: '10'
                  createdAt: '2022-10-07T14:12:08.826121Z'
              examples:
                CreditTransaction:
                  summary: ''
                  value:
                    id: 4a1da26e-4f4a-4607-9597-9652138afcf1
                    grantId: 746fc7f2-8098-4fe7-953c-7d51c580a126
                    reason: Refund
                    invoiceId: 6cedbb5e-4f77-4217-b8d4-020e7e4d33c9
                    billingRunId: cbe82021-90bb-47cc-a665-eda41ec4ee5b
                    type: DEBIT
                    amount: '10'
                    createdAt: '2022-10-07T14:12:08.826121Z'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '500':
          description: Internal Server Error
          content: {}
components:
  schemas:
    CreateCreditTransactionEndpointCreateCreditTransactionRequestModel:
      required:
        - amount
        - grantId
        - type
      type: object
      example:
        grantId: 746fc7f2-8098-4fe7-953c-7d51c580a126
        reason: Refund
        invoiceId: 6cedbb5e-4f77-4217-b8d4-020e7e4d33c9
        billingRunId: cbe82021-90bb-47cc-a665-eda41ec4ee5b
        type: DEBIT
        amount: '10'
      properties:
        grantId:
          type: string
          description: Credit Grant ID
          example: 746fc7f2-8098-4fe7-953c-7d51c580a126
        reason:
          type: string
          description: Transaction Reason
          example: Refund
        invoiceId:
          type: string
          description: Invoice ID where Credit was consumed
          example: 6cedbb5e-4f77-4217-b8d4-020e7e4d33c9
        billingRunId:
          type: string
          description: Billing Run ID where Credit was consumed
          example: cbe82021-90bb-47cc-a665-eda41ec4ee5b
        type:
          type: string
          description: Credit Transaction Type
          example: DEBIT
        amount:
          type: string
          description: Number of units added or consumer
          example: '10'
    CreditTransaction:
      required:
        - amount
        - date
        - grantId
        - type
      type: object
      example:
        id: c770d296-ef09-459b-b8dd-42c334e00dab
        grantId: 5a0faea3-7ad5-4a83-a420-09bb6576f7e6
        reason: because
        invoiceId: c6864c69-42a3-4966-8c22-1c56d7375a05
        billingRunId: e95256be-08e7-4585-b3c7-fa9928aacd90
        type: CREDIT
        amount: '10'
        date: '2024-01-01'
      properties:
        id:
          type: string
          description: Credit Transaction ID
          example: c770d296-ef09-459b-b8dd-42c334e00dab
        grantId:
          type: string
          description: Credit Grant ID
          example: 5a0faea3-7ad5-4a83-a420-09bb6576f7e6
        reason:
          type: string
          description: Transaction Reason
          example: because
        invoiceId:
          type: string
          description: Invoice ID where Credit was consumed
          example: c6864c69-42a3-4966-8c22-1c56d7375a05
        billingRunId:
          type: string
          description: Billing Run ID where Credit was consumed
          example: e95256be-08e7-4585-b3c7-fa9928aacd90
        type:
          type: string
          description: Credit Transaction Type
          example: CREDIT
        amount:
          type: string
          description: Number of units added or consumed
          example: '10'
        date:
          type: string
          description: Date of transaction
          format: date
          example: '2024-01-01'

````