> For a complete page index, fetch https://docs.transak.com/llms.txt

# Document details

POST https://api-gateway-stg.transak.com/kyc/v2/reliance/document-details
Content-Type: application/json

Submits **ID proof** document images and metadata as part of the KYC Reliance flow.
Call **`POST /kyc/v2/reliance/identity-details`** first to initialize the KYC request; then use this endpoint to upload document images (base64-encoded). Optional back image applies when the document type requires a reverse side.

Reference: https://docs.transak.com/api/whitelabel/kyc-reliance-api/kyc-reliance-document-details

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: whitelabel-api
  version: 1.0.0
paths:
  /kyc/v2/reliance/document-details:
    post:
      operationId: kyc-reliance-document-details
      summary: Document details
      description: >-
        Submits **ID proof** document images and metadata as part of the KYC
        Reliance flow.

        Call **`POST /kyc/v2/reliance/identity-details`** first to initialize
        the KYC request; then use this endpoint to upload document images
        (base64-encoded). Optional back image applies when the document type
        requires a reverse side.
      tags:
        - subpackage_kycRelianceApi
      parameters:
        - name: x-access-token
          in: header
          description: >-
            Your Partner Access Token. Please refer
            [here](/guides/how-to-create-partner-access-token) for a tutorial on
            generating your access token. 



            Note: This is applicable only for [Auth Reliance
            Flows](/features/auth-reliance)
          required: false
          schema:
            type: string
        - name: x-user-identifier
          in: header
          description: >-
            our authenticated user Email Id address.



            Note: This is applicable only for [Auth Reliance
            Flows](/features/auth-reliance)
          required: false
          schema:
            type: string
        - name: authorization
          in: header
          description: >-
            Authorization token is the accessToken received from the API -`
            api/v2/auth/verify`           




            Note: This is not applicable for [Auth Reliance
            Flows](/features/auth-reliance)
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Success — document step initialized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KycRelianceSuccessResponse'
        '400':
          description: Bad Request — validation or processing failure
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Kyc-reliance-document-detailsRequestBadRequestError
        '401':
          description: Unauthorized — invalid token or user not onboarded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '404':
          description: Not Found — KYC request does not exist for this user/session
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentDetailsRequest'
servers:
  - url: https://api-gateway-stg.transak.com
components:
  schemas:
    DocumentProof:
      type: object
      properties:
        idType:
          type: string
          description: >-
            Type of identity document (e.g. `PASSPORT`, driver license, national
            ID — values as supported by the API).
        idCountry:
          type: string
          description: >-
            Two-letter ISO 3166-1 alpha-2 country code the document was issued
            in (uppercase).
        idNumber:
          type: string
          description: Document identification number as printed on the ID.
        frontImage:
          type: string
          description: >-
            Front image of the document as a base64-encoded string (e.g.
            `data:image/jpeg;base64,...`). Maximum size approximately **5 MB**
            after decoding.
        backImage:
          type: string
          description: >-
            Optional back image of the document as base64 (required for
            two-sided documents). Same size limits as `frontImage`.
      required:
        - idType
        - idCountry
        - idNumber
        - frontImage
      title: DocumentProof
    DocumentDetailsRequest:
      type: object
      properties:
        documentProof:
          $ref: '#/components/schemas/DocumentProof'
      required:
        - documentProof
      title: DocumentDetailsRequest
    KycRelianceSuccessResponseData:
      type: object
      properties:
        status:
          type: string
          description: >-
            Step or flow status (e.g. `INITIALIZED` after identity or document
            steps, `SUBMITTED` after biometrics, or terminal outcomes such as
            `DONE` / `FAILED` as returned by the API).
      required:
        - status
      title: KycRelianceSuccessResponseData
    KycRelianceSuccessResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/KycRelianceSuccessResponseData'
      required:
        - data
      title: KycRelianceSuccessResponse
    ErrorEnvelopeError:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          type: string
        errorCode:
          type: integer
      required:
        - statusCode
        - message
      title: ErrorEnvelopeError
    ErrorEnvelope:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ErrorEnvelopeError'
      required:
        - error
      title: ErrorEnvelope
    KycRelianceFlatError:
      type: object
      properties:
        statusCode:
          type: integer
        errorCode:
          type: integer
        message:
          type: string
      required:
        - statusCode
        - errorCode
        - message
      title: KycRelianceFlatError
    Kyc-reliance-document-detailsRequestBadRequestError:
      oneOf:
        - $ref: '#/components/schemas/ErrorEnvelope'
        - $ref: '#/components/schemas/KycRelianceFlatError'
      title: Kyc-reliance-document-detailsRequestBadRequestError

```

## SDK Code Examples

```python Success
import requests

url = "https://api-gateway-stg.transak.com/kyc/v2/reliance/document-details"

payload = { "documentProof": {
        "idType": "PASSPORT",
        "idCountry": "US",
        "idNumber": "123456789",
        "frontImage": "data:image/jpeg;base64,SGVsbG8gV29ybGQ=",
        "backImage": "data:image/jpeg;base64,SGVsbG8gV29ybGQ="
    } }
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Success
const url = 'https://api-gateway-stg.transak.com/kyc/v2/reliance/document-details';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"documentProof":{"idType":"PASSPORT","idCountry":"US","idNumber":"123456789","frontImage":"data:image/jpeg;base64,SGVsbG8gV29ybGQ=","backImage":"data:image/jpeg;base64,SGVsbG8gV29ybGQ="}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Success
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api-gateway-stg.transak.com/kyc/v2/reliance/document-details"

	payload := strings.NewReader("{\n  \"documentProof\": {\n    \"idType\": \"PASSPORT\",\n    \"idCountry\": \"US\",\n    \"idNumber\": \"123456789\",\n    \"frontImage\": \"data:image/jpeg;base64,SGVsbG8gV29ybGQ=\",\n    \"backImage\": \"data:image/jpeg;base64,SGVsbG8gV29ybGQ=\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Success
require 'uri'
require 'net/http'

url = URI("https://api-gateway-stg.transak.com/kyc/v2/reliance/document-details")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"documentProof\": {\n    \"idType\": \"PASSPORT\",\n    \"idCountry\": \"US\",\n    \"idNumber\": \"123456789\",\n    \"frontImage\": \"data:image/jpeg;base64,SGVsbG8gV29ybGQ=\",\n    \"backImage\": \"data:image/jpeg;base64,SGVsbG8gV29ybGQ=\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Success
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api-gateway-stg.transak.com/kyc/v2/reliance/document-details")
  .header("Content-Type", "application/json")
  .body("{\n  \"documentProof\": {\n    \"idType\": \"PASSPORT\",\n    \"idCountry\": \"US\",\n    \"idNumber\": \"123456789\",\n    \"frontImage\": \"data:image/jpeg;base64,SGVsbG8gV29ybGQ=\",\n    \"backImage\": \"data:image/jpeg;base64,SGVsbG8gV29ybGQ=\"\n  }\n}")
  .asString();
```

```php Success
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api-gateway-stg.transak.com/kyc/v2/reliance/document-details', [
  'body' => '{
  "documentProof": {
    "idType": "PASSPORT",
    "idCountry": "US",
    "idNumber": "123456789",
    "frontImage": "data:image/jpeg;base64,SGVsbG8gV29ybGQ=",
    "backImage": "data:image/jpeg;base64,SGVsbG8gV29ybGQ="
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Success
using RestSharp;

var client = new RestClient("https://api-gateway-stg.transak.com/kyc/v2/reliance/document-details");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"documentProof\": {\n    \"idType\": \"PASSPORT\",\n    \"idCountry\": \"US\",\n    \"idNumber\": \"123456789\",\n    \"frontImage\": \"data:image/jpeg;base64,SGVsbG8gV29ybGQ=\",\n    \"backImage\": \"data:image/jpeg;base64,SGVsbG8gV29ybGQ=\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Success
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = ["documentProof": [
    "idType": "PASSPORT",
    "idCountry": "US",
    "idNumber": "123456789",
    "frontImage": "data:image/jpeg;base64,SGVsbG8gV29ybGQ=",
    "backImage": "data:image/jpeg;base64,SGVsbG8gV29ybGQ="
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api-gateway-stg.transak.com/kyc/v2/reliance/document-details")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```