> ## 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.

# SDK लेन-देन टोकन जारी करें API: क्लाइंट-साइड KYT

> Didit SDK से निगरानी किए गए लेन-देन सीधे सबमिट करने के लिए अल्पकालिक, सीमित टोकन जारी करें। विषय-बंधन सर्वर-साइड लागू होता है।



SDK लेन-देन token जारी करने का API प्रॉम्प्ट
        प्रॉम्प्ट को क्लिपबोर्ड पर कॉपी करें



      
      

\<pre>

\`Mint a short-lived scoped token that lets the Didit SDKs submit monitored transactions directly from an end-user's device.

Endpoint:
POST https://verification.didit.me/v3/transactions/sdk-token/

Authentication:
Use the x-api-key header with my Didit API key. This call runs on YOUR BACKEND only - the API key must never ship in an app. Only the returned sdk_token travels to the device.

Goal:
\- Get an sdk_token scoped to one end user (vendor_data). The app passes it to the SDK's submitTransaction method (or directly to POST /v1/transactions/ via the X-Transaction-Token header).
\- The token binds the subject identity server-side: every transaction submitted with it has its subject forced to the token's vendor_data, so a tampered client cannot submit on behalf of another user.

Request body (application/json):
\{
"vendor_data": "user-042",   // required - your internal id for the end user
"ttl_seconds": 900,          // optional - default 900 (15 min), max 86400 (24 h)
"max_uses": 3                // optional - max successful submissions; omit for unlimited within the TTL
}
camelCase aliases (vendorData, ttlSeconds, maxUses) are also accepted.

Example call:
curl -X POST "https://verification.didit.me/v3/transactions/sdk-token/" \
-H "x-api-key: YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{"vendor_data":"user-042","ttl_seconds":900,"max_uses":3}'

What to read from the response:
\- sdk_token - hand this to your app; it authenticates POST /v1/transactions/ via the X-Transaction-Token header.
\- expires_at - ISO-8601 expiry; mint a fresh token per user session rather than reusing long-lived ones.

Failure modes:
\- 400 - missing vendor_data or invalid ttl_seconds/max_uses.
\- 401 - missing or malformed x-api-key.

Best practice:
\- Mint per user session, keep max_uses tight when the number of expected submissions is known.
\- A 401 from POST /v1/transactions/ whose detail contains the word "expired" means the token aged out - mint a new one and retry.

For the full client-side submission guide, see /transaction-monitoring/sdk-transaction-submission.`

\</pre>



      
      

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



## OpenAPI

````yaml hi/openapi-25.json POST /v3/transactions/sdk-token/
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/transactions/sdk-token/:
    post:
      tags:
        - Transactions
      summary: SDK लेन-देन token मिंट करें
      description: >-
        एक अल्पकालिक स्कोप्ड token मिंट करें जिसे आपका ऐप Didit SDKs को पास करता
        है ताकि वे `POST /v1/transactions/` के माध्यम से अंतिम उपयोगकर्ता के
        डिवाइस से सीधे लेन-देन सबमिट कर सकें। token एक `vendor_data` (आपकी
        उपयोगकर्ता आईडी) से बंधा होता है: इसके साथ सबमिट किए गए प्रत्येक लेन-देन
        की विषय पहचान उस बाइंडिंग से सर्वर-साइड लागू की जाती है, ताकि छेड़छाड़
        किया गया क्लाइंट किसी अन्य उपयोगकर्ता की ओर से सबमिट न कर सके। अपने
        बैकएंड से token मिंट करें - ऐप में कभी भी API कुंजी स्वयं शिप न करें।
        camelCase उपनाम (`vendorData`, `ttlSeconds`, `maxUses`) भी स्वीकार किए
        जाते हैं।
      operationId: createTransactionSdkToken
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                vendor_data:
                  type: string
                  description: >-
                    उस अंतिम उपयोगकर्ता के लिए आपका आंतरिक पहचानकर्ता जिसके लिए
                    यह token स्कोप किया गया है। token के साथ सबमिट किए गए
                    प्रत्येक लेन-देन की विषय पहचान के रूप में लागू किया जाता है।
                  example: user-042
                ttl_seconds:
                  type: integer
                  default: 900
                  maximum: 86400
                  description: >-
                    token का लाइफ़टाइम, सेकंड में। डिफ़ॉल्ट रूप से 900 (15
                    मिनट); अधिकतम 86400 (24 घंटे)।
                max_uses:
                  type: integer
                  nullable: true
                  description: >-
                    इस token के साथ अनुमत सफल सबमिशन की अधिकतम संख्या। TTL के
                    भीतर असीमित उपयोग के लिए छोड़ दें या null रखें।
              required:
                - vendor_data
            example:
              vendor_data: user-042
              ttl_seconds: 900
              max_uses: 3
      responses:
        '201':
          description: >-
            मिंट किया गया token। अपने ऐप को `sdk_token` सौंपें; यह `expires_at`
            तक `X-Transaction-Token` हेडर के माध्यम से डिवाइस-फ़ेसिंग
            `/v1/transactions/` endpoints को प्रमाणित करता है।
          content:
            application/json:
              schema:
                type: object
                properties:
                  sdk_token:
                    type: string
                    description: SDK को पास करने के लिए स्कोप्ड transaction token।
                  expires_at:
                    type: string
                    format: date-time
                    description: जब token स्वीकार किया जाना बंद हो जाता है।
              example:
                sdk_token: q7Zt...urlsafe
                expires_at: '2026-07-07T12:15:00Z'
        '400':
          description: >-
            सत्यापन विफल रहा: अनुपलब्ध `vendor_data`, या अनुमत सीमा से बाहर
            `ttl_seconds`।
          content:
            application/json:
              examples:
                Missing vendor_data:
                  value:
                    vendor_data:
                      - This field is required.
        '403':
          description: अनुपलब्ध, अमान्य या निरस्त API कुंजी।
          content:
            application/json:
              examples:
                Invalid API Key:
                  value:
                    detail: Invalid API Key.
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: >-
            curl -X POST
            https://verification.didit.me/v3/transactions/sdk-token/ \
              -H 'x-api-key: YOUR_API_KEY' -H 'Content-Type: application/json' \
              -d '{"vendor_data": "user-042", "ttl_seconds": 900, "max_uses": 3}'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.transactions.create_sdk_token(
                vendor_data="user-042",
                ttl_seconds=900,
                max_uses=3,
            )
            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.transactions.createSdkToken({
              vendor_data: "user-042",
              ttl_seconds: 900,
              max_uses: 3,
            });
            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.Transactions.CreateSDKToken(ctx, didit.TransactionsCreateSDKTokenParams{\n\tVendorData: \"user-042\",\n\tTTLSeconds: didit.Int(900),\n\tMaxUses:    didit.Int(3),\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
        - lang: java
          label: Java
          source: >-
            import me.didit.Didit;

            import me.didit.types.TransactionsCreateSdkTokenParams;


            // Reads DIDIT_API_KEY.

            Didit client = new Didit();


            var result =
            client.transactions().createSdkToken(TransactionsCreateSdkTokenParams.builder()
                    .vendorData("user-042")
                    .ttlSeconds(900L)
                    .maxUses(3L)
                    .build());
            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->transactions->createSdkToken([
                'vendor_data' => 'user-042',
                'ttl_seconds' => 900,
                'max_uses' => 3,
            ]);
            print_r($result->toArray());
        - lang: ruby
          label: Ruby
          source: |-
            require "didit"

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

            result = didit.transactions.create_sdk_token(
              vendor_data: "user-042",
              ttl_seconds: 900,
              max_uses: 3
            )
            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.Transactions.CreateSdkTokenAsync(new
            TransactionsCreateSdkTokenParams

            {
                VendorData = "user-042",
                TtlSeconds = 900,
                MaxUses = 3,
            });

            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.