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

# Grant credits to a subscription

> Creates a monetary API-granted credit on a subscription. The grant is immediately available for consumption.



## OpenAPI

````yaml /api-reference/v2/specs/2026-04-01.json post /subscriptions/{id}/credits/grant
openapi: 3.1.0
info:
  title: Alguna Public API
  version: '2026-04-01'
servers:
  - url: https://api.alguna.io
security:
  - bearerAuth: []
tags:
  - name: Billing Events and Metrics
  - name: Credit Notes
  - name: Credits
  - name: Customer Portal Sessions
  - name: Customers
  - name: Insights
  - name: Invoices
  - name: Payments
  - name: Plans
  - name: Product Bundles
  - name: Products
  - name: Refunds
  - name: Revenue Schedules
  - name: Subscription Changes
  - name: Subscription Versions
  - name: Subscriptions
  - name: Wallet Grants
  - name: Wallets
paths:
  /subscriptions/{id}/credits/grant:
    post:
      tags:
        - Subscriptions
      summary: Grant credits to a subscription
      description: >-
        Creates a monetary API-granted credit on a subscription. The grant is
        immediately available for consumption.
      operationId: create-subscription-credit-grant
      parameters:
        - in: header
          name: Alguna-Version
          required: true
          schema:
            enum:
              - '2026-04-01'
            type: string
        - in: header
          name: Idempotency-Key
          schema:
            description: >-
              A unique string used to ensure the request is processed exactly
              once. If you retry a request with the same idempotency key within
              24 hours, the original response is returned without re-executing
              the operation.
            example: ik_a1b2c3d4e5f6
            maxLength: 255
            type: string
        - in: path
          name: id
          required: true
          schema:
            description: Unique identifier for the subscription
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreditGrantRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditGrantResponse'
          description: Success
          headers:
            Idempotency-Key:
              description: Echo of the idempotency key provided in the request
              schema:
                type: string
            Idempotent-Replayed:
              description: >-
                Whether this response was replayed from a previous request
                (true) or freshly executed (false)
              schema:
                type: boolean
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: >-
            Conflict — a request with this idempotency key is currently being
            processed
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Entity
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
components:
  schemas:
    CreditGrantRequest:
      properties:
        amount:
          description: Credit amount to grant
          example: '100.00'
          type: string
        credit_type:
          description: Type of credit
          enum:
            - monetary
            - units
          example: monetary
          type: string
        expires_at:
          description: When the credit grant expires
          example: '2027-01-01T00:00:00Z'
          format: date-time
          nullable: true
          type: string
        reason:
          description: Reason for the credit grant
          example: API promotional credit
          type: string
      required:
        - amount
        - reason
      type: object
    CreditGrantResponse:
      properties:
        amount:
          description: Grant amount
          example: '100.00'
          type: string
        created_at:
          description: When the grant was created
          format: date-time
          type: string
        customer_id:
          description: Customer ID
          type: string
        expires_at:
          description: Expiration date
          format: date-time
          nullable: true
          type: string
        grant_type:
          description: How the grant was created
          example: api
          type: string
        id:
          description: Credit grant ID
          example: cg_abc123
          type: string
        reason:
          description: Reason for the grant
          nullable: true
          type: string
        subscription_id:
          description: Subscription ID
          nullable: true
          type: string
      required:
        - amount
        - created_at
        - customer_id
        - grant_type
        - id
      type: object
    ErrorResponse:
      properties:
        detail:
          type: string
        status:
          format: int64
          type: integer
      required:
        - status
        - detail
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: API Key
      description: API key authentication. Pass your API key as a Bearer token.
      scheme: bearer
      type: http

````