> ## 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 거래 토큰 발급 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 ko/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: >-
        앱이 Didit SDK에 전달할 수 있는 단기 범위 지정 token을 발급하여, SDK가 `POST
        /v1/transactions/`를 통해 최종 사용자의 기기에서 직접 거래를 제출할 수 있도록 합니다. 이 token은 하나의
        `vendor_data`(사용자 ID)에 바인딩됩니다. 해당 token으로 제출된 모든 거래는 해당 바인딩을 통해 서버 측에서
        주체 신원이 강제 적용되므로, 변조된 클라이언트가 다른 사용자를 대신하여 제출할 수 없습니다. token은 반드시 백엔드에서
        발급하십시오. API 키 자체를 앱에 포함하여 배포해서는 안 됩니다. 카멜 표기법 별칭(`vendorData`,
        `ttlSeconds`, `maxUses`)도 지원됩니다.
      operationId: createTransactionSdkToken
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                vendor_data:
                  type: string
                  description: >-
                    이 token의 범위가 지정된 최종 사용자에 대한 귀하의 내부 식별자입니다. 해당 token으로 제출되는
                    모든 거래의 주체 ID로 적용됩니다.
                  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`을 앱에 전달하세요. 이 token은 `expires_at`까지
            `X-Transaction-Token` 헤더를 통해 디바이스 대상 `/v1/transactions/` endpoint를
            인증합니다.
          content:
            application/json:
              schema:
                type: object
                properties:
                  sdk_token:
                    type: string
                    description: SDK에 전달할 스코프가 지정된 거래 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: >-
        Business Console의 Developers -> API keys에서 발급받은 귀하 애플리케이션의 API 키입니다. 기본
        키는 전체 접근 권한을 갖습니다. 이름이 지정된 키는 리소스별 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.