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

# क्रेडिट बैलेंस API प्राप्त करें: KYC बिलिंग

> अपना Didit क्रेडिट बैलेंस और ऑटो टॉप-अप सेटिंग्स प्राप्त करें। एक ही बैलेंस हर उत्पाद का भुगतान करता है, प्लान क्रेडिट और टॉप-अप से।



क्रेडिट बैलेंस प्राप्त करने का प्रॉम्प्ट
        प्रॉम्प्ट को क्लिपबोर्ड पर कॉपी करें



      
      

\<pre>

\`Goal: Read the organization's current pre-paid credit balance (USD) plus its auto-refill configuration.

Endpoint: GET https://verification.didit.me/v3/billing/balance/
Auth header: x-api-key: <DIDIT_API_KEY>

curl:
curl -X GET 'https://verification.didit.me/v3/billing/balance/' \
-H 'x-api-key: YOUR_API_KEY'

Response 200:
\{
"balance": "1234.5600",                  // USD, FIXED-POINT DECIMAL STRING — parse with Decimal/BigDecimal, not float.
"auto_refill_enabled": true,             // boolean
"auto_refill_amount": "500.00",          // USD string or null
"auto_refill_threshold": "100.00"        // USD string or null — auto-refill fires when balance falls below this
}

Notes:
\- Balance is ORGANIZATION-WIDE — shared across every application under the same org.
\- Decreases as verifications are billed; increases when a top-up settles via Stripe webhook.
\- Currency is always USD.
\- Configure auto-refill in Console → Billing; requires a saved Stripe payment method (card, SEPA, or US ACH). The auto-refill amount is $50 to $20,000, added at face value, the same range as a manual top-up.
\- Poll at a low cadence (every few minutes max) — balance only changes when usage is billed or a top-up settles.

Common patterns:
\- Gate session creation in production — stop opening new sessions if balance drops below your operational floor.
\- Power internal dashboards / low-balance alerts.
\- Detect misconfigured auto-refill: auto_refill_enabled=true with null auto_refill_amount/threshold means it's effectively off (or no eligible payment method on file).

Failure modes (envelope {"detail": "..."}):
\- 401 — missing/malformed x-api-key.
\- 403 — key valid but bound application not allowed to read billing.
\- 429 — rate-limited.

See /getting-started/pricing for the credit consumption model and POST /v3/billing/top-up/ to add funds programmatically.

For end-to-end Didit integration, paste in the full prompt at /integration/integration-prompt.`

\</pre>



      
      

यहाँ पेस्ट करें



## OpenAPI

````yaml hi/openapi-25.json GET /v3/billing/balance/
openapi: 3.0.0
info:
  version: 3.0.0
  title: Didit Verification API
  description: पहचान सत्यापन API। x-api-key हेडर के साथ प्रमाणीकृत करें।
servers:
  - url: https://verification.didit.me
security: []
tags: []
paths:
  /v3/billing/balance/:
    get:
      tags:
        - Billing
      summary: क्रेडिट बैलेंस प्राप्त करें
      description: >-
        USD में वर्तमान प्री-पेड क्रेडिट बैलेंस (संगठन-व्यापी) और ऑटो-रिफिल
        कॉन्फ़िगरेशन प्राप्त करें। राशियाँ दशमलव स्ट्रिंग हैं — दशमलव लाइब्रेरी
        के साथ पार्स करें।
      operationId: get_billing_balance
      responses:
        '200':
          description: वर्तमान क्रेडिट बैलेंस और संगठन का ऑटो-रीफ़िल कॉन्फ़िगरेशन।
          content:
            application/json:
              schema:
                type: object
                required:
                  - balance
                  - auto_refill_enabled
                properties:
                  balance:
                    type: string
                    description: >-
                      USD में वर्तमान प्रीपेड क्रेडिट बैलेंस, एक फ़िक्स्ड-पॉइंट
                      दशमलव स्ट्रिंग के रूप में। सत्यापनों के लिए बिल बनने पर
                      घटता है और टॉप अप सेटल होने पर बढ़ता है।
                  auto_refill_enabled:
                    type: boolean
                    description: >-
                      जब `true` होता है, तो बैलेंस द्वारा
                      `auto_refill_threshold` पार करने पर Didit क्रेडिट जोड़ने
                      के लिए सहेजे गए भुगतान माध्यम से स्वचालित रूप से शुल्क
                      लेगा। कंसोल → बिलिंग से कॉन्फ़िगर किया जाता है।
                  auto_refill_amount:
                    type: string
                    nullable: true
                    description: >-
                      प्रत्येक ऑटो-रीफ़िल पर अंकित मूल्य पर चार्ज की जाने वाली
                      और बैलेंस में जोड़ी जाने वाली USD राशि। Console → Billing
                      में \$50 से \$20,000 तक सेट की जाती है। ऑटो-रीफ़िल अक्षम
                      या सेट न किए जाने पर `null`।
                  auto_refill_threshold:
                    type: string
                    nullable: true
                    description: >-
                      USD में ट्रिगर थ्रेशोल्ड। जब `balance` इस मान से नीचे
                      गिरता है तो ऑटो-रीफ़िल सक्रिय हो जाता है। ऑटो-रीफ़िल अक्षम
                      या सेट न होने पर `null`।
              examples:
                Healthy balance with auto-refill:
                  value:
                    balance: '1234.5600'
                    auto_refill_enabled: true
                    auto_refill_amount: '500.00'
                    auto_refill_threshold: '100.00'
                Low balance, manual top-up only:
                  value:
                    balance: '12.0000'
                    auto_refill_enabled: false
                    auto_refill_amount: null
                    auto_refill_threshold: null
        '403':
          description: >-
            अनुपलब्ध, अमान्य या निरस्त API कुंजी, या यह कुंजी इस संगठन के लिए
            बिलिंग डेटा नहीं पढ़ सकती है। अनुपलब्ध कुंजी पर `403` मिलता है; गलत,
            निरस्त या समय-सीमा समाप्त कुंजी पर `401` मिलता है।
          content:
            application/json:
              examples:
                Forbidden:
                  value:
                    detail: You do not have permission to perform this action.
        '429':
          description: >-
            रेट लिमिट पार हो गई; थोड़ा रुकें और `Retry-After` में बताए गए अंतराल
            के बाद पुनः प्रयास करें।
          content:
            application/json:
              examples:
                Throttled:
                  value:
                    detail: Request was throttled. Expected available in 30 seconds.
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: |-
            curl -X GET 'https://verification.didit.me/v3/billing/balance/' \
              -H 'x-api-key: YOUR_API_KEY'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.billing.retrieve_balance()
            print(result)
        - lang: javascript
          label: Node.js
          source: |-
            import Didit from "@didit-protocol/sdk-node";

            // Reads DIDIT_API_KEY.
            const didit = new Didit();

            const result = await didit.billing.retrieveBalance();
            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.Billing.RetrieveBalance(ctx)\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
        - lang: java
          label: Java
          source: |-
            import me.didit.Didit;

            // Reads DIDIT_API_KEY.
            Didit client = new Didit();

            var result = client.billing().retrieveBalance();
            System.out.println(result);
        - lang: php
          label: PHP
          source: |-
            <?php

            require 'vendor/autoload.php';

            use Didit\DiditClient;

            // Reads DIDIT_API_KEY.
            $didit = new DiditClient();

            $result = $didit->billing->retrieveBalance();
            print_r($result->toArray());
        - lang: ruby
          label: Ruby
          source: |-
            require "didit"

            # Reads DIDIT_API_KEY.
            didit = Didit::Client.new

            result = didit.billing.retrieve_balance
            puts result.to_h
        - lang: csharp
          label: .NET
          source: |-
            using System;
            using System.Text.Json;
            using Didit;

            // Reads DIDIT_API_KEY.
            using var client = new DiditClient();

            var result = await client.Billing.RetrieveBalanceAsync();
            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        आपकी एप्लिकेशन की API कुंजी, Business Console में Developers -> API keys
        से। प्राथमिक कुंजी के पास पूर्ण एक्सेस होता है। एक नामित कुंजी को स्कोप
        किया जा सकता है: प्रति संसाधन none, read या write, कुछ वर्कफ़्लो या
        स्वीकृत सत्रों तक सीमित, IP पतों की सूची तक सीमित, और समाप्ति तिथि तक
        सीमित। 401 का अर्थ है कि कुंजी गलत है, निरस्त कर दी गई है या उसकी
        समय-सीमा समाप्त हो गई है; 403 का अर्थ है कि कोई कुंजी नहीं भेजी गई थी,
        कुंजी के पास इस संसाधन या कार्रवाई का एक्सेस नहीं है, या अनुरोध उसकी IP
        सूची से बाहर के पते से आया था; सत्र रूट पर 404 का अर्थ है कि सत्र कुंजी
        के वर्कफ़्लो या स्थितियों से बाहर है। मीडिया एक्सेस के बिना एक कुंजी को
        छवि, वीडियो और PDF URL null के रूप में प्राप्त होते हैं, और सत्र write
        के बिना एक कुंजी को सत्र लिंक और token null के रूप में प्राप्त होते हैं।
        देखें https://docs.didit.me/console/api-keys।

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.