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

# Add Stripe Credits

> Creates a Stripe payment link to purchase custom credits using a specified payment method.



## OpenAPI

````yaml POST /add_credits/
openapi: 3.1.0
info:
  title: CloserX.ai API
  description: >-
    The CloserX.ai API provides programmatic access to manage AI-powered calling
    operations, including agent creation, campaign management, contact handling,
    telephony integration, and more. This API enables seamless automation and
    integration with CRM systems, telephony providers, and other third-party
    services for enhanced client communication and business operations.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://app.closerx.ai/api
security:
  - api_key: []
paths:
  /add_credits/:
    post:
      summary: Add Stripe Credits
      description: >-
        Creates a Stripe payment link to purchase custom credits using a
        specified payment method.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddCreditsRequest'
      responses:
        '200':
          description: Stripe payment link successfully created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddCreditsResponse'
        '400':
          description: Invalid request parameters or payment error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    AddCreditsRequest:
      type: object
      required:
        - custom_credits
        - custom_amount
        - payment_method
      properties:
        custom_credits:
          type: integer
          description: Number of credits the user wants to purchase
          example: 1000
        custom_amount:
          type: number
          format: float
          description: Amount to be paid for the credits (in dollars)
          example: 99
        payment_method:
          type: string
          description: Payment gateway used for transaction
          example: stripe
    AddCreditsResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        errors:
          type: array
          items:
            type: string
        response:
          type: object
          properties:
            amount:
              type: integer
              description: Total amount in smallest currency unit (e.g., cents)
              example: 9900
            url:
              type: string
              format: uri
              description: Stripe payment URL to complete the transaction
            email:
              type: string
              format: email
              description: User's email associated with the transaction
              example: abc@gmail.com
        message:
          type: string
          example: Stripe Payment Link for credit purchase created
    Error:
      required:
        - success
        - message
        - data
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
        data:
          type: object
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: api_key

````