> 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 | **idNumber** field is Optional only for `PROOF_OF_RESIDENCE` document type. For all other document types, idNumber is required. **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 ## Request ### Headers - `x-user-ip` (string, required) — End user's originating IP. More details [here](/guides/mandatory-security-changes#user-ip-header-in-apis) - `x-api-key` (string, required) — Partner API Key present in Transak Dashboard. - `x-access-token` (string, optional) — 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) - `x-user-identifier` (string, optional) — our authenticated user Email Id address. Note: This is applicable only for [Auth Reliance Flows](/features/auth-reliance) - `authorization` (string, optional) — 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) ### Body (application/json) This endpoint expects a DocumentDetailsRequest. - `documentProof` (DocumentProof, required) ## Response ### 200 Success — document step initialized - `data` (KycRelianceSuccessResponseData, required) ## Errors ### 400 Bad Request Error Bad Request — validation or processing failure - `Kyc-reliance-document-detailsRequestBadRequestError` ### 401 Unauthorized Error Unauthorized — invalid token or user not onboarded - `error` (ErrorEnvelopeError, required) ### 404 Not Found Error Not Found — KYC request does not exist for this user/session - `error` (ErrorEnvelopeError, required) ## Types ### DocumentProof - `idType` (string, required) — Type of identity document (e.g. `PASSPORT`, driver license, national ID — values as supported by the API). - `idCountryCode` (string, required) — Two-letter ISO 3166-1 alpha-2 country code the document was issued in (uppercase). - `frontImage` (string, required) — Front image of the document as a base64-encoded data URI. **Supported formats:** JPEG, PNG, WEBP. Must use the format `data:;base64,` (e.g. `data:image/jpeg;base64,...`, `data:image/png;base64,...`, `data:image/webp;base64,...`). Maximum size approximately **5 MB** after decoding. - `idNumber` (string, optional) — Document identification number as printed on the ID. Optional only for `PROOF_OF_RESIDENCE` document type; required for all other document types. - `backImage` (string, optional) — 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:;base64,` (e.g. `data:image/jpeg;base64,...`). Same size limits as `frontImage`. ### KycRelianceSuccessResponseData - `status` (string, required) — 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` (string, required) — KYC flow type returned for the initialized request. ### ErrorEnvelope - `error` (ErrorEnvelopeError, required) ### KycRelianceFlatError - `statusCode` (integer, required) - `errorCode` (integer, required) - `message` (string, required) ### ErrorEnvelopeError - `statusCode` (integer, required) - `message` (string, required) - `error` (string, optional) — HTTP error title (e.g. `Bad Request`). - `errorCode` (integer, optional) ## Examples **Request** ```json { "documentProof": { "idType": "", "idCountryCode": "", "frontImage": "", "idNumber": "", "backImage": "" } } ``` **Response** ```json { "data": { "status": "INITIALIZED", "kycType": "STANDARD" } } ``` **SDK Code** ```python Submitted Document Details import requests url = "https://api-gateway-stg.transak.com/kyc/v2/reliance/document-details" payload = { "documentProof": { "idType": "", "idCountryCode": "", "frontImage": "", "idNumber": "", "backImage": "" } } headers = { "x-api-key": "", "x-user-ip": "", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Submitted Document Details const url = 'https://api-gateway-stg.transak.com/kyc/v2/reliance/document-details'; const options = { method: 'POST', headers: {'x-api-key': '', 'x-user-ip': '', 'Content-Type': 'application/json'}, body: '{"documentProof":{"idType":"","idCountryCode":"","frontImage":"","idNumber":"","backImage":""}}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Submitted Document Details 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\": \"\",\n \"idCountryCode\": \"\",\n \"frontImage\": \"\",\n \"idNumber\": \"\",\n \"backImage\": \"\"\n }\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("x-api-key", "") req.Header.Add("x-user-ip", "") 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 Submitted Document Details 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["x-api-key"] = '' request["x-user-ip"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"documentProof\": {\n \"idType\": \"\",\n \"idCountryCode\": \"\",\n \"frontImage\": \"\",\n \"idNumber\": \"\",\n \"backImage\": \"\"\n }\n}" response = http.request(request) puts response.read_body ``` ```java Submitted Document Details import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api-gateway-stg.transak.com/kyc/v2/reliance/document-details") .header("x-api-key", "") .header("x-user-ip", "") .header("Content-Type", "application/json") .body("{\n \"documentProof\": {\n \"idType\": \"\",\n \"idCountryCode\": \"\",\n \"frontImage\": \"\",\n \"idNumber\": \"\",\n \"backImage\": \"\"\n }\n}") .asString(); ``` ```php Submitted Document Details request('POST', 'https://api-gateway-stg.transak.com/kyc/v2/reliance/document-details', [ 'body' => '{ "documentProof": { "idType": "", "idCountryCode": "", "frontImage": "", "idNumber": "", "backImage": "" } }', 'headers' => [ 'Content-Type' => 'application/json', 'x-api-key' => '', 'x-user-ip' => '', ], ]); echo $response->getBody(); ``` ```csharp Submitted Document Details 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("x-api-key", ""); request.AddHeader("x-user-ip", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"documentProof\": {\n \"idType\": \"\",\n \"idCountryCode\": \"\",\n \"frontImage\": \"\",\n \"idNumber\": \"\",\n \"backImage\": \"\"\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Submitted Document Details import Foundation let headers = [ "x-api-key": "", "x-user-ip": "", "Content-Type": "application/json" ] let parameters = ["documentProof": [ "idType": "", "idCountryCode": "", "frontImage": "", "idNumber": "", "backImage": "" ]] 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() ```