# Update Purpose Of Usage POST https://api-gateway-stg.transak.com/api/v2/kyc/purpose-of-usage Content-Type: application/json The **Purpose Of Usage** is an **authenticated API call** that is a mandatory step in the **KYC process** for both **Simple KYC and Standard KYC**. As part of regulatory compliance, users must declare the **purpose of their cryptocurrency transactions**. This API allows you to submit the user’s **intended use case** by passing an array of supported purposes. **How It Works** - The purposeList parameter **must be an array** of one or more supported options. - You can submit **one or multiple purposes** at a time. - This is a required step **before proceeding with order placement and further transactions**. **Supported Purposes:** - "Buying/selling crypto for investments" - "Buying NFTs" - "Buying crypto to use a web3 protocol" Reference: https://docs.transak.com/api/whitelabel/kyc/update-purpose-of-usage ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: whitelabel-api version: 1.0.0 paths: /api/v2/kyc/purpose-of-usage: post: operationId: update-purpose-of-usage summary: Update Purpose Of Usage description: >- The **Purpose Of Usage** is an **authenticated API call** that is a mandatory step in the **KYC process** for both **Simple KYC and Standard KYC**. As part of regulatory compliance, users must declare the **purpose of their cryptocurrency transactions**. This API allows you to submit the user’s **intended use case** by passing an array of supported purposes. **How It Works** - The purposeList parameter **must be an array** of one or more supported options. - You can submit **one or multiple purposes** at a time. - This is a required step **before proceeding with order placement and further transactions**. **Supported Purposes:** - "Buying/selling crypto for investments" - "Buying NFTs" - "Buying crypto to use a web3 protocol" 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_update-purpose-of-usage_Response_200' '400': description: 400 - Bad Request content: application/json: schema: $ref: >- #/components/schemas/Update-purpose-of-usageRequestBadRequestError '401': description: 401 - Unauthorized content: application/json: schema: $ref: >- #/components/schemas/Update-purpose-of-usageRequestUnauthorizedError '500': description: 500 - Internal Server Error content: application/json: schema: $ref: >- #/components/schemas/Update-purpose-of-usageRequestInternalServerError requestBody: content: application/json: schema: type: object properties: purposeList: type: array items: type: string required: - purposeList servers: - url: https://api-gateway-stg.transak.com components: schemas: ApiV2KycPurposeOfUsagePostResponsesContentApplicationJsonSchemaData: type: object properties: status: type: string required: - status title: ApiV2KycPurposeOfUsagePostResponsesContentApplicationJsonSchemaData KYC_update-purpose-of-usage_Response_200: type: object properties: data: $ref: >- #/components/schemas/ApiV2KycPurposeOfUsagePostResponsesContentApplicationJsonSchemaData required: - data title: KYC_update-purpose-of-usage_Response_200 ApiV2KycPurposeOfUsagePostResponsesContentApplicationJsonSchemaError: type: object properties: statusCode: type: integer message: type: string required: - statusCode - message title: ApiV2KycPurposeOfUsagePostResponsesContentApplicationJsonSchemaError Update-purpose-of-usageRequestBadRequestError: type: object properties: error: $ref: >- #/components/schemas/ApiV2KycPurposeOfUsagePostResponsesContentApplicationJsonSchemaError required: - error title: Update-purpose-of-usageRequestBadRequestError Update-purpose-of-usageRequestUnauthorizedError: type: object properties: error: $ref: >- #/components/schemas/ApiV2KycPurposeOfUsagePostResponsesContentApplicationJsonSchemaError required: - error title: Update-purpose-of-usageRequestUnauthorizedError Update-purpose-of-usageRequestInternalServerError: type: object properties: error: $ref: >- #/components/schemas/ApiV2KycPurposeOfUsagePostResponsesContentApplicationJsonSchemaError required: - error title: Update-purpose-of-usageRequestInternalServerError ``` ## SDK Code Examples ```python Success import requests url = "https://api-gateway-stg.transak.com/api/v2/kyc/purpose-of-usage" headers = { "authorization": "YOUR_USER_AUTH_TOKEN", "x-user-identifier": "USER_EMAIL_ID", "x-access-token": "YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.post(url, headers=headers) print(response.json()) ``` ```javascript Success const url = 'https://api-gateway-stg.transak.com/api/v2/kyc/purpose-of-usage'; const options = { method: 'POST', headers: { authorization: 'YOUR_USER_AUTH_TOKEN', 'x-user-identifier': 'USER_EMAIL_ID', 'x-access-token': 'YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: undefined }; 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" "net/http" "io" ) func main() { url := "https://api-gateway-stg.transak.com/api/v2/kyc/purpose-of-usage" req, _ := http.NewRequest("POST", url, nil) 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") 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/api/v2/kyc/purpose-of-usage") 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["Content-Type"] = 'application/json' 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/purpose-of-usage") .header("authorization", "YOUR_USER_AUTH_TOKEN") .header("x-user-identifier", "USER_EMAIL_ID") .header("x-access-token", "YOUR_ACCESS_TOKEN") .header("Content-Type", "application/json") .asString(); ``` ```php Success request('POST', 'https://api-gateway-stg.transak.com/api/v2/kyc/purpose-of-usage', [ 'headers' => [ 'Content-Type' => 'application/json', '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/purpose-of-usage"); 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", "application/json"); 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", "Content-Type": "application/json" ] let request = NSMutableURLRequest(url: NSURL(string: "https://api-gateway-stg.transak.com/api/v2/kyc/purpose-of-usage")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers 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_update-purpose-of-usage_example import requests url = "https://api-gateway-stg.transak.com/api/v2/kyc/purpose-of-usage" payload = { "purposeList": ["Buying/selling crypto for investments", "Buying NFTs", "Buying crypto to use a web3 protocol"] } headers = { "authorization": "YOUR_USER_AUTH_TOKEN", "x-user-identifier": "USER_EMAIL_ID", "x-access-token": "YOUR_ACCESS_TOKEN", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript KYC_update-purpose-of-usage_example const url = 'https://api-gateway-stg.transak.com/api/v2/kyc/purpose-of-usage'; const options = { method: 'POST', headers: { authorization: 'YOUR_USER_AUTH_TOKEN', 'x-user-identifier': 'USER_EMAIL_ID', 'x-access-token': 'YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' }, body: '{"purposeList":["Buying/selling crypto for investments","Buying NFTs","Buying crypto to use a web3 protocol"]}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go KYC_update-purpose-of-usage_example package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api-gateway-stg.transak.com/api/v2/kyc/purpose-of-usage" payload := strings.NewReader("{\n \"purposeList\": [\n \"Buying/selling crypto for investments\",\n \"Buying NFTs\",\n \"Buying crypto to use a web3 protocol\"\n ]\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") 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 KYC_update-purpose-of-usage_example require 'uri' require 'net/http' url = URI("https://api-gateway-stg.transak.com/api/v2/kyc/purpose-of-usage") 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["Content-Type"] = 'application/json' request.body = "{\n \"purposeList\": [\n \"Buying/selling crypto for investments\",\n \"Buying NFTs\",\n \"Buying crypto to use a web3 protocol\"\n ]\n}" response = http.request(request) puts response.read_body ``` ```java KYC_update-purpose-of-usage_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/purpose-of-usage") .header("authorization", "YOUR_USER_AUTH_TOKEN") .header("x-user-identifier", "USER_EMAIL_ID") .header("x-access-token", "YOUR_ACCESS_TOKEN") .header("Content-Type", "application/json") .body("{\n \"purposeList\": [\n \"Buying/selling crypto for investments\",\n \"Buying NFTs\",\n \"Buying crypto to use a web3 protocol\"\n ]\n}") .asString(); ``` ```php KYC_update-purpose-of-usage_example request('POST', 'https://api-gateway-stg.transak.com/api/v2/kyc/purpose-of-usage', [ 'body' => '{ "purposeList": [ "Buying/selling crypto for investments", "Buying NFTs", "Buying crypto to use a web3 protocol" ] }', 'headers' => [ 'Content-Type' => 'application/json', 'authorization' => 'YOUR_USER_AUTH_TOKEN', 'x-access-token' => 'YOUR_ACCESS_TOKEN', 'x-user-identifier' => 'USER_EMAIL_ID', ], ]); echo $response->getBody(); ``` ```csharp KYC_update-purpose-of-usage_example using RestSharp; var client = new RestClient("https://api-gateway-stg.transak.com/api/v2/kyc/purpose-of-usage"); 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", "application/json"); request.AddParameter("application/json", "{\n \"purposeList\": [\n \"Buying/selling crypto for investments\",\n \"Buying NFTs\",\n \"Buying crypto to use a web3 protocol\"\n ]\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift KYC_update-purpose-of-usage_example import Foundation let headers = [ "authorization": "YOUR_USER_AUTH_TOKEN", "x-user-identifier": "USER_EMAIL_ID", "x-access-token": "YOUR_ACCESS_TOKEN", "Content-Type": "application/json" ] let parameters = ["purposeList": ["Buying/selling crypto for investments", "Buying NFTs", "Buying crypto to use a web3 protocol"]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api-gateway-stg.transak.com/api/v2/kyc/purpose-of-usage")! 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() ```