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

# Create topup

> Add funds to a company's platform balance by charging a stored payment method. Top-ups have no fees or taxes and do not count as revenue.

Required permissions:
 - `payment:charge`



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/whopsdk/openapi.documented.yml post /topups
openapi: 3.1.0
info:
  title: Whop API
  description: >-
    The Whop REST API. Please see
    https://docs.whop.com/developer/api/getting-started for more details.
  termsOfService: https://whop.com/tos-developer-api/
  version: 1.0.0
servers:
  - url: https://api.whop.com/api/v1
    description: Production Whop API
security: []
tags:
  - name: Products
    description: Products
  - name: Plans
    description: Plans
  - name: Payments
    description: Payments
  - name: Refunds
    description: Refunds
  - name: Disputes
    description: Disputes
  - name: Dispute alerts
    description: Dispute alerts
  - name: Resolution center cases
    description: Resolution center cases
  - name: Checkout configurations
    description: Checkout configurations
  - name: Setup intents
    description: Setup intents
  - name: Payment methods
    description: Payment methods
  - name: Invoices
    description: Invoices
  - name: Promo codes
    description: Promo codes
  - name: Card transactions
    description: Card transactions
  - name: Ledger accounts
    description: Ledger accounts
  - name: Transfers
    description: Transfers
  - name: Withdrawals
    description: Withdrawals
  - name: Payout methods
    description: Payout methods
  - name: Verifications
    description: Verifications
  - name: Payout accounts
    description: Payout accounts
  - name: Topups
    description: Topups
  - name: Users
    description: Users
  - name: Companies
    description: Companies
  - name: Authorized users
    description: Authorized users
  - name: Fee markups
    description: Fee markups
  - name: Members
    description: Members
  - name: Memberships
    description: Memberships
  - name: Leads
    description: Leads
  - name: Entries
    description: Entries
  - name: Shipments
    description: Shipments
  - name: Reviews
    description: Reviews
  - name: Company token transactions
    description: Company token transactions
  - name: Affiliates
    description: Affiliates
  - name: Experiences
    description: Experiences
  - name: Forums
    description: Forums
  - name: Forum posts
    description: Forum posts
  - name: Chat channels
    description: Chat channels
  - name: Support channels
    description: Support channels
  - name: Messages
    description: Messages
  - name: Reactions
    description: Reactions
  - name: Dm members
    description: Dm members
  - name: Dm channels
    description: Dm channels
  - name: Notifications
    description: Notifications
  - name: Courses
    description: Courses
  - name: Course chapters
    description: Course chapters
  - name: Course lessons
    description: Course lessons
  - name: Course students
    description: Course students
  - name: Course lesson interactions
    description: Course lesson interactions
  - name: Apps
    description: Apps
  - name: Webhooks
    description: Webhooks
  - name: App builds
    description: App builds
  - name: Access tokens
    description: Access tokens
  - name: Account links
    description: Account links
  - name: Files
    description: Files
  - name: Ai chats
    description: Ai chats
  - name: Bounties
    description: Bounties
  - name: Stats
    description: Stats
  - name: Ad campaigns
    description: Ad campaigns
  - name: Ad groups
    description: Ad groups
  - name: Ads
    description: Ads
  - name: Conversions
    description: Conversions
paths:
  /topups:
    post:
      tags:
        - Topups
      summary: Create topup
      description: >-
        Add funds to a company's platform balance by charging a stored payment
        method. Top-ups have no fees or taxes and do not count as revenue.


        Required permissions:
         - `payment:charge`
      operationId: createTopup
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                amount:
                  type: number
                  description: >-
                    The amount to add to the balance in the specified currency.
                    For example, 50.00 for $50.00 USD.
                  example: 6.9
                company_id:
                  type: string
                  description: >-
                    The unique identifier of the company to add funds to,
                    starting with 'biz_'.
                  example: biz_xxxxxxxxxxxxxx
                currency:
                  $ref: '#/components/schemas/Currencies'
                  description: The currency for the top-up amount, such as 'usd'.
                payment_method_id:
                  type: string
                  description: >-
                    The unique identifier of the stored payment method to charge
                    for the top-up.
                  example: pmt_xxxxxxxxxxxxxx
              required:
                - amount
                - company_id
                - currency
                - payment_method_id
              description: Parameters for CreateTopup
      responses:
        '200':
          description: A successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Topup'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      message:
                        type: string
                      code:
                        type:
                          - string
                          - 'null'
                        description: >-
                          A short string indicating the specific error code,
                          e.g. 'parameter_missing', 'parameter_invalid',
                          'invalid_json'
                      param:
                        type:
                          - string
                          - 'null'
                        description: The parameter that caused the error, if applicable
                    required:
                      - type
                      - message
                required:
                  - error
              example:
                error:
                  type: invalid_request_error
                  code: parameter_missing
                  message: 'Missing required parameter: amount.'
                  param: amount
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      message:
                        type: string
                      code:
                        type:
                          - string
                          - 'null'
                        description: >-
                          A short string indicating the specific error code,
                          e.g. 'parameter_missing', 'parameter_invalid',
                          'invalid_json'
                      param:
                        type:
                          - string
                          - 'null'
                        description: The parameter that caused the error, if applicable
                    required:
                      - type
                      - message
                required:
                  - error
              example:
                error:
                  type: unauthorized
                  message: Invalid or missing API key
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      message:
                        type: string
                      code:
                        type:
                          - string
                          - 'null'
                        description: >-
                          A short string indicating the specific error code,
                          e.g. 'parameter_missing', 'parameter_invalid',
                          'invalid_json'
                      param:
                        type:
                          - string
                          - 'null'
                        description: The parameter that caused the error, if applicable
                    required:
                      - type
                      - message
                required:
                  - error
              example:
                error:
                  type: forbidden
                  message: You do not have permission to access this resource
        '404':
          description: Not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      message:
                        type: string
                      code:
                        type:
                          - string
                          - 'null'
                        description: >-
                          A short string indicating the specific error code,
                          e.g. 'parameter_missing', 'parameter_invalid',
                          'invalid_json'
                      param:
                        type:
                          - string
                          - 'null'
                        description: The parameter that caused the error, if applicable
                    required:
                      - type
                      - message
                required:
                  - error
              example:
                error:
                  type: not_found
                  message: Resource not found
        '422':
          description: Verification required
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      message:
                        type: string
                      code:
                        type:
                          - string
                          - 'null'
                        description: >-
                          A short string indicating the specific error code,
                          e.g. 'parameter_missing', 'parameter_invalid',
                          'invalid_json'
                      param:
                        type:
                          - string
                          - 'null'
                        description: The parameter that caused the error, if applicable
                    required:
                      - type
                      - message
                required:
                  - error
              example:
                error: null
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      message:
                        type: string
                      code:
                        type:
                          - string
                          - 'null'
                        description: >-
                          A short string indicating the specific error code,
                          e.g. 'parameter_missing', 'parameter_invalid',
                          'invalid_json'
                      param:
                        type:
                          - string
                          - 'null'
                        description: The parameter that caused the error, if applicable
                    required:
                      - type
                      - message
                required:
                  - error
              example:
                error:
                  type: internal_server_error
                  message: An unexpected error occurred
      security:
        - bearerAuth:
            - payment:charge
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Whop from '@whop/sdk';

            const client = new Whop({
              apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
            });

            const topup = await client.topups.create({
              amount: 6.9,
              company_id: 'biz_xxxxxxxxxxxxxx',
              currency: 'usd',
              payment_method_id: 'pmt_xxxxxxxxxxxxxx',
            });

            console.log(topup.id);
        - lang: Python
          source: |-
            import os
            from whop_sdk import Whop

            client = Whop(
                api_key=os.environ.get("WHOP_API_KEY"),  # This is the default and can be omitted
            )
            topup = client.topups.create(
                amount=6.9,
                company_id="biz_xxxxxxxxxxxxxx",
                currency="usd",
                payment_method_id="pmt_xxxxxxxxxxxxxx",
            )
            print(topup.id)
        - lang: Ruby
          source: |-
            require "whop_sdk"

            whop = WhopSDK::Client.new(api_key: "My API Key")

            topup = whop.topups.create(
              amount: 6.9,
              company_id: "biz_xxxxxxxxxxxxxx",
              currency: :usd,
              payment_method_id: "pmt_xxxxxxxxxxxxxx"
            )

            puts(topup)
components:
  schemas:
    Currencies:
      type: string
      enum:
        - usd
        - sgd
        - inr
        - aud
        - brl
        - cad
        - dkk
        - eur
        - nok
        - gbp
        - sek
        - chf
        - hkd
        - huf
        - jpy
        - mxn
        - myr
        - pln
        - czk
        - nzd
        - aed
        - eth
        - ape
        - cop
        - ron
        - thb
        - bgn
        - idr
        - dop
        - php
        - try
        - krw
        - twd
        - vnd
        - pkr
        - clp
        - uyu
        - ars
        - zar
        - dzd
        - tnd
        - mad
        - kes
        - kwd
        - jod
        - all
        - xcd
        - amd
        - bsd
        - bhd
        - bob
        - bam
        - khr
        - crc
        - xof
        - egp
        - etb
        - gmd
        - ghs
        - gtq
        - gyd
        - ils
        - jmd
        - mop
        - mga
        - mur
        - mdl
        - mnt
        - nad
        - ngn
        - mkd
        - omr
        - pyg
        - pen
        - qar
        - rwf
        - sar
        - rsd
        - lkr
        - tzs
        - ttd
        - uzs
        - rub
        - btc
        - cny
        - usdt
        - kzt
      description: The available currencies on the platform
    Topup:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier for the payment.
          example: pay_xxxxxxxxxxxxxx
        status:
          oneOf:
            - $ref: '#/components/schemas/ReceiptStatus'
            - type: 'null'
          description: >-
            The current lifecycle state of this payment (e.g., 'draft', 'open',
            'paid', 'void').
        created_at:
          type: string
          format: date-time
          description: The datetime the payment was created.
          example: '2023-12-01T05:00:00.401Z'
        paid_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            The time at which this payment was successfully collected. Null if
            the payment has not yet succeeded. As a Unix timestamp.
          example: '2023-12-01T05:00:00.401Z'
        currency:
          oneOf:
            - $ref: '#/components/schemas/Currencies'
            - type: 'null'
          description: >-
            The three-letter ISO currency code for this payment (e.g., 'usd',
            'eur').
        total:
          type:
            - number
            - 'null'
          description: The total to show to the creator (excluding buyer fees).
          example: 6.9
        failure_message:
          type:
            - string
            - 'null'
          description: If the payment failed, the reason for the failure.
      required:
        - id
        - status
        - created_at
        - paid_at
        - currency
        - total
        - failure_message
      description: >-
        A payment represents a completed or attempted charge. Payments track the
        amount, status, currency, and payment method used.
    ReceiptStatus:
      type: string
      enum:
        - draft
        - open
        - paid
        - pending
        - uncollectible
        - unresolved
        - void
      description: The status of a receipt
  securitySchemes:
    bearerAuth:
      type: http
      description: >-
        A company API key, company scoped JWT, app API key, or user OAuth token.
        You must prepend your key/token with the word 'Bearer', which will look
        like `Bearer ***************************`
      scheme: bearer
      bearerFormat: auth-scheme

````