# Upload Proof Document POST https://api-gateway-stg.transak.com/api/v2/kyc/upload Content-Type: multipart/form-data **Upload Proof Document** is an **authenticated** API call that allows submission of a user’s source of income document proof as part of the KYC verification process. This step is required when Enhanced KYC is triggered and Source of income is submitted. Valid proof documents (e.g., passport, national ID, driver’s license, or utility bill) must be submitted after completing the submission of Source of income Form. **Note:** Any invalid, unclear, or missing documents may lead to KYC verification failure or delays in completing the onboarding process. Reference: https://docs.transak.com/api/whitelabel/kyc/upload-proof-document ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: whitelabel-api version: 1.0.0 paths: /api/v2/kyc/upload: post: operationId: upload-proof-document summary: Upload Proof Document description: >- **Upload Proof Document** is an **authenticated** API call that allows submission of a user’s source of income document proof as part of the KYC verification process. This step is required when Enhanced KYC is triggered and Source of income is submitted. Valid proof documents (e.g., passport, national ID, driver’s license, or utility bill) must be submitted after completing the submission of Source of income Form. **Note:** Any invalid, unclear, or missing documents may lead to KYC verification failure or delays in completing the onboarding process. tags: - subpackage_kyc parameters: - name: authorization in: header description: >- Authorization token is the accessToken received from the API -` api/v2/auth/verify` required: true schema: type: string default: YOUR_USER_AUTH_TOKEN - name: x-user-identifier in: header description: >- Your authenticated user Email Id address. Note: This is applicable only for [Auth Reliance Flows](/features/auth-reliance) required: false schema: type: string default: USER_EMAIL_ID - 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 default: YOUR_ACCESS_TOKEN responses: '200': description: 200 - Success content: application/json: schema: $ref: '#/components/schemas/KYC_upload-proof-document_Response_200' '400': description: 400 - Bad Request content: application/json: schema: $ref: >- #/components/schemas/Upload-proof-documentRequestBadRequestError '401': description: 401 - Unauthorized content: application/json: schema: $ref: >- #/components/schemas/Upload-proof-documentRequestUnauthorizedError '500': description: 500 - Internal Server Error content: application/json: schema: $ref: >- #/components/schemas/Upload-proof-documentRequestInternalServerError requestBody: content: multipart/form-data: schema: type: object properties: docId: type: string default: PAYSLIP description: Document optionId present in the `DOCUMENT_PROOF` Form file: type: string format: binary description: Document Proof required: - docId - file servers: - url: https://api-gateway-stg.transak.com components: schemas: ApiV2KycUploadPostResponsesContentApplicationJsonSchemaData: type: object properties: partnerUserId: type: string docId: type: string originalFileName: type: string required: - partnerUserId - docId - originalFileName title: ApiV2KycUploadPostResponsesContentApplicationJsonSchemaData KYC_upload-proof-document_Response_200: type: object properties: data: $ref: >- #/components/schemas/ApiV2KycUploadPostResponsesContentApplicationJsonSchemaData required: - data title: KYC_upload-proof-document_Response_200 ApiV2KycUploadPostResponsesContentApplicationJsonSchemaError: type: object properties: statusCode: type: integer message: type: string required: - statusCode - message title: ApiV2KycUploadPostResponsesContentApplicationJsonSchemaError Upload-proof-documentRequestBadRequestError: type: object properties: error: $ref: >- #/components/schemas/ApiV2KycUploadPostResponsesContentApplicationJsonSchemaError required: - error title: Upload-proof-documentRequestBadRequestError Upload-proof-documentRequestUnauthorizedError: type: object properties: error: $ref: >- #/components/schemas/ApiV2KycUploadPostResponsesContentApplicationJsonSchemaError required: - error title: Upload-proof-documentRequestUnauthorizedError Upload-proof-documentRequestInternalServerError: type: object properties: error: $ref: >- #/components/schemas/ApiV2KycUploadPostResponsesContentApplicationJsonSchemaError required: - error title: Upload-proof-documentRequestInternalServerError ``` ## SDK Code Examples ```python Success import requests url = "https://api-gateway-stg.transak.com/api/v2/kyc/upload" payload = "-----011000010111000001101001--\r\n" headers = { "authorization": "YOUR_USER_AUTH_TOKEN", "x-user-identifier": "USER_EMAIL_ID", "x-access-token": "YOUR_ACCESS_TOKEN", "Content-Type": "multipart/form-data; boundary=---011000010111000001101001" } response = requests.post(url, data=payload, headers=headers) print(response.json()) ``` ```javascript Success const url = 'https://api-gateway-stg.transak.com/api/v2/kyc/upload'; const form = new FormData(); const options = { method: 'POST', headers: { authorization: 'YOUR_USER_AUTH_TOKEN', 'x-user-identifier': 'USER_EMAIL_ID', 'x-access-token': 'YOUR_ACCESS_TOKEN' } }; options.body = form; 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/api/v2/kyc/upload" payload := strings.NewReader("-----011000010111000001101001--\r\n") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("authorization", "YOUR_USER_AUTH_TOKEN") req.Header.Add("x-user-identifier", "USER_EMAIL_ID") req.Header.Add("x-access-token", "YOUR_ACCESS_TOKEN") 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/api/v2/kyc/upload") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["authorization"] = 'YOUR_USER_AUTH_TOKEN' request["x-user-identifier"] = 'USER_EMAIL_ID' request["x-access-token"] = 'YOUR_ACCESS_TOKEN' request.body = "-----011000010111000001101001--\r\n" response = http.request(request) puts response.read_body ``` ```java Success import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api-gateway-stg.transak.com/api/v2/kyc/upload") .header("authorization", "YOUR_USER_AUTH_TOKEN") .header("x-user-identifier", "USER_EMAIL_ID") .header("x-access-token", "YOUR_ACCESS_TOKEN") .body("-----011000010111000001101001--\r\n") .asString(); ``` ```php Success request('POST', 'https://api-gateway-stg.transak.com/api/v2/kyc/upload', [ 'headers' => [ 'Content-Type' => 'multipart/form-data; boundary=---011000010111000001101001', 'authorization' => 'YOUR_USER_AUTH_TOKEN', 'x-access-token' => 'YOUR_ACCESS_TOKEN', 'x-user-identifier' => 'USER_EMAIL_ID', ], ]); echo $response->getBody(); ``` ```csharp Success using RestSharp; var client = new RestClient("https://api-gateway-stg.transak.com/api/v2/kyc/upload"); var request = new RestRequest(Method.POST); request.AddHeader("authorization", "YOUR_USER_AUTH_TOKEN"); request.AddHeader("x-user-identifier", "USER_EMAIL_ID"); request.AddHeader("x-access-token", "YOUR_ACCESS_TOKEN"); request.AddHeader("Content-Type", "multipart/form-data; boundary=---011000010111000001101001"); request.AddParameter("undefined", "-----011000010111000001101001--\r\n", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Success import Foundation let headers = [ "authorization": "YOUR_USER_AUTH_TOKEN", "x-user-identifier": "USER_EMAIL_ID", "x-access-token": "YOUR_ACCESS_TOKEN" ] let parameters = [] let boundary = "---011000010111000001101001" var body = "" var error: NSError? = nil for param in parameters { let paramName = param["name"]! body += "--\(boundary)\r\n" body += "Content-Disposition:form-data; name=\"\(paramName)\"" if let filename = param["fileName"] { let contentType = param["content-type"]! let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8) if (error != nil) { print(error as Any) } body += "; filename=\"\(filename)\"\r\n" body += "Content-Type: \(contentType)\r\n\r\n" body += fileContent } else if let paramValue = param["value"] { body += "\r\n\r\n\(paramValue)" } } let request = NSMutableURLRequest(url: NSURL(string: "https://api-gateway-stg.transak.com/api/v2/kyc/upload")! 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() ``` ```python KYC_upload-proof-document_example import requests url = "https://api-gateway-stg.transak.com/api/v2/kyc/upload" files = { "file": "open('payslip.pdf', 'rb')" } payload = { "docId": "PAYSLIP" } headers = { "authorization": "YOUR_USER_AUTH_TOKEN", "x-user-identifier": "USER_EMAIL_ID", "x-access-token": "YOUR_ACCESS_TOKEN" } response = requests.post(url, data=payload, files=files, headers=headers) print(response.json()) ``` ```javascript KYC_upload-proof-document_example const url = 'https://api-gateway-stg.transak.com/api/v2/kyc/upload'; const form = new FormData(); form.append('docId', 'PAYSLIP'); form.append('file', 'payslip.pdf'); const options = { method: 'POST', headers: { authorization: 'YOUR_USER_AUTH_TOKEN', 'x-user-identifier': 'USER_EMAIL_ID', 'x-access-token': 'YOUR_ACCESS_TOKEN' } }; options.body = form; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go KYC_upload-proof-document_example package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api-gateway-stg.transak.com/api/v2/kyc/upload" payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"docId\"\r\n\r\nPAYSLIP\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"payslip.pdf\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("authorization", "YOUR_USER_AUTH_TOKEN") req.Header.Add("x-user-identifier", "USER_EMAIL_ID") req.Header.Add("x-access-token", "YOUR_ACCESS_TOKEN") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby KYC_upload-proof-document_example require 'uri' require 'net/http' url = URI("https://api-gateway-stg.transak.com/api/v2/kyc/upload") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["authorization"] = 'YOUR_USER_AUTH_TOKEN' request["x-user-identifier"] = 'USER_EMAIL_ID' request["x-access-token"] = 'YOUR_ACCESS_TOKEN' request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"docId\"\r\n\r\nPAYSLIP\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"payslip.pdf\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n" response = http.request(request) puts response.read_body ``` ```java KYC_upload-proof-document_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api-gateway-stg.transak.com/api/v2/kyc/upload") .header("authorization", "YOUR_USER_AUTH_TOKEN") .header("x-user-identifier", "USER_EMAIL_ID") .header("x-access-token", "YOUR_ACCESS_TOKEN") .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"docId\"\r\n\r\nPAYSLIP\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"payslip.pdf\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n") .asString(); ``` ```php KYC_upload-proof-document_example request('POST', 'https://api-gateway-stg.transak.com/api/v2/kyc/upload', [ 'multipart' => [ [ 'name' => 'docId', 'contents' => 'PAYSLIP' ], [ 'name' => 'file', 'filename' => 'payslip.pdf', 'contents' => null ] ] 'headers' => [ 'authorization' => 'YOUR_USER_AUTH_TOKEN', 'x-access-token' => 'YOUR_ACCESS_TOKEN', 'x-user-identifier' => 'USER_EMAIL_ID', ], ]); echo $response->getBody(); ``` ```csharp KYC_upload-proof-document_example using RestSharp; var client = new RestClient("https://api-gateway-stg.transak.com/api/v2/kyc/upload"); var request = new RestRequest(Method.POST); request.AddHeader("authorization", "YOUR_USER_AUTH_TOKEN"); request.AddHeader("x-user-identifier", "USER_EMAIL_ID"); request.AddHeader("x-access-token", "YOUR_ACCESS_TOKEN"); request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"docId\"\r\n\r\nPAYSLIP\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"payslip.pdf\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift KYC_upload-proof-document_example import Foundation let headers = [ "authorization": "YOUR_USER_AUTH_TOKEN", "x-user-identifier": "USER_EMAIL_ID", "x-access-token": "YOUR_ACCESS_TOKEN" ] let parameters = [ [ "name": "docId", "value": "PAYSLIP" ], [ "name": "file", "fileName": "payslip.pdf" ] ] let boundary = "---011000010111000001101001" var body = "" var error: NSError? = nil for param in parameters { let paramName = param["name"]! body += "--\(boundary)\r\n" body += "Content-Disposition:form-data; name=\"\(paramName)\"" if let filename = param["fileName"] { let contentType = param["content-type"]! let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8) if (error != nil) { print(error as Any) } body += "; filename=\"\(filename)\"\r\n" body += "Content-Type: \(contentType)\r\n\r\n" body += fileContent } else if let paramValue = param["value"] { body += "\r\n\r\n\(paramValue)" } } let request = NSMutableURLRequest(url: NSURL(string: "https://api-gateway-stg.transak.com/api/v2/kyc/upload")! 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() ```