> ## 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 для мониторинга на клиенте

> Выпускайте короткоживущий токен Didit для SDK, чтобы отправлять транзакции на мониторинг из приложения. Привязка к субъекту проверяется на сервере.



Промпт для API token транзакции Mint SDK
        Скопировать промпт в буфер обмена



      
      

\<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 ru/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: Выпустить token транзакции для SDK
      description: >-
        Выпустить кратковременный token с ограниченной областью действия,
        который ваше приложение передает в Didit SDK для прямой отправки
        транзакций с устройства конечного пользователя через `POST
        /v1/transactions/`. Token привязан к одному `vendor_data` (вашему
        идентификатору пользователя): для каждой транзакции, отправленной с его
        помощью, идентификатор субъекта принудительно устанавливается на стороне
        сервера на основе этой привязки, поэтому изменённый клиент не может
        отправлять данные от имени другого пользователя. Выпускайте токены со
        своего бэкенда: никогда не встраивайте сам 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: >-
                    Максимальное количество успешных отправок, разрешённых с
                    этим токеном. Не указывайте параметр или передайте null для
                    неограниченного использования в пределах TTL.
              required:
                - vendor_data
            example:
              vendor_data: user-042
              ttl_seconds: 900
              max_uses: 3
      responses:
        '201':
          description: >-
            Сгенерированный token. Передайте `sdk_token` вашему приложению; он
            аутентифицирует endpoints `/v1/transactions/` на стороне устройства
            через заголовок `X-Transaction-Token` до `expires_at`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  sdk_token:
                    type: string
                    description: >-
                      Токен транзакции с ограниченной областью действия для
                      передачи в SDK.
                  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-ключ вашего приложения из раздела «Разработчикам» -> «API-ключи» в
        Business Console. Основной ключ имеет полный доступ. Именованный ключ
        может иметь ограниченную область действия: без доступа, чтение или
        запись для каждого ресурса, ограничение определенными сценариями или
        одобренными сессиями, списком IP-адресов и сроком действия. 401
        означает, что ключ неверен, отозван или его срок действия истек; 403
        означает, что ключ не был передан, у ключа нет доступа к этому ресурсу
        или действию, либо запрос поступил с адреса вне его списка IP-адресов;
        404 на маршруте сессии означает, что сессия не входит в сценарии или
        статусы ключа. Ключ без доступа к медиа получает URL изображений, видео
        и PDF как null, а ключ без прав на запись сессий получает ссылки на
        сессии и токены как null. См. https://docs.didit.me/console/api-keys.

````

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