> 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

Submit ID proof document images and metadata as part of the KYC Reliance flow.

Call the [Identity Details API](/api/whitelabel/kyc-reliance-api/kyc-reliance-identity-details) first to initialize the KYC request, then use this endpoint to upload the user's document images.

**Supported `idType` values**

| idType | Accepted values |
|--------|----------------|
| `PASSPORT` | `passport` |
| `DRIVING_LICENCE` | `driving_licence`, `DriversLicense` |
| `ID_CARD` | `national_identity_card`, `AadharCard` |
| `PROOF_OF_RESIDENCE` | `bank_statement`, `resident_permit`, `utility_bill`, `payslip` |
| `VISA` | `visa` |
| `UNKNOWN` | Any other value not listed above |

**Image formats**

| Field | Required | Accepted formats |
|-------|----------|------------------|
| **frontImage** | Yes | `JPEG`, `PNG`, `WEBP`  |
| **backImage** | Only for two-sided documents | `JPEG`, `PNG`, `WEBP` |

All images must be sent as base64-encoded data URIs.

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: >-
        Submit ID proof document images and metadata as part of the KYC Reliance
        flow.


        Call the [Identity Details
        API](/api/whitelabel/kyc-reliance-api/kyc-reliance-identity-details)
        first to initialize the KYC request, then use this endpoint to upload
        the user's document images.


        **Supported `idType` values**


        | idType | Accepted values |

        |--------|----------------|

        | `PASSPORT` | `passport` |

        | `DRIVING_LICENCE` | `driving_licence`, `DriversLicense` |

        | `ID_CARD` | `national_identity_card`, `AadharCard` |

        | `PROOF_OF_RESIDENCE` | `bank_statement`, `resident_permit`,
        `utility_bill`, `payslip` |

        | `VISA` | `visa` |

        | `UNKNOWN` | Any other value not listed above |


        **Image formats**


        | Field | Required | Accepted formats |

        |-------|----------|------------------|

        | **frontImage** | Yes | `JPEG`, `PNG`, `WEBP`  |

        | **backImage** | Only for two-sided documents | `JPEG`, `PNG`, `WEBP` |


        All images must be sent as base64-encoded data URIs.
      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
    description: Staging
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).
        idCountryCode:
          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 data URI.
            **Supported formats:** JPEG, PNG, WEBP. Must use the format
            `data:<mime-type>;base64,<base64_encoded_data>` (e.g.
            `data:image/jpeg;base64,...`, `data:image/png;base64,...`,
            `data:image/webp;base64,...`). Maximum size approximately **5 MB**
            after decoding.
        backImage:
          type: string
          description: >-
            Optional back image of the document as a base64-encoded data URI
            (required for two-sided documents). **Supported formats:** JPEG,
            PNG, WEBP. Must use the format
            `data:<mime-type>;base64,<base64_encoded_data>` (e.g.
            `data:image/jpeg;base64,...`). Same size limits as `frontImage`.
      required:
        - idType
        - idCountryCode
        - 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).
        kycType:
          type: string
          description: KYC flow type returned for the initialized request.
      required:
        - status
        - kycType
      title: KycRelianceSuccessResponseData
    KycRelianceSuccessResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/KycRelianceSuccessResponseData'
      required:
        - data
      title: KycRelianceSuccessResponse
    ErrorEnvelopeError:
      type: object
      properties:
        statusCode:
          type: integer
        error:
          type: string
          description: HTTP error title (e.g. `Bad Request`).
        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

```

## Examples



**Request**

```json
{
  "documentProof": {
    "idType": "passport",
    "idCountryCode": "US",
    "idNumber": "123456789",
    "frontImage": "data:image/jpeg;base64,SGVsbG8gV29ybGQ=",
    "backImage": "data:image/jpeg;base64,SGVsbG8gV29ybGQ="
  }
}
```

**Response**

```json
{
  "data": {
    "status": "INITIALIZED",
    "kycType": "STANDARD"
  }
}
```

**SDK Code**

```python Success
import requests

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

payload = { "documentProof": {
        "idType": "passport",
        "idCountryCode": "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","idCountryCode":"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    \"idCountryCode\": \"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    \"idCountryCode\": \"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    \"idCountryCode\": \"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",
    "idCountryCode": "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    \"idCountryCode\": \"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",
    "idCountryCode": "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()
```