# Deprecated - Request OTT (Cards, Apple Pay) POST https://api-gateway-stg.transak.com/api/v2/auth/request-ott Content-Type: application/json Deprecated endpoint to request OTT for Cards/Apple Pay flows. Reference: https://docs.transak.com/api/whitelabel/orders/request-ott ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: whitelabel-api version: 1.0.0 paths: /api/v2/auth/request-ott: post: operationId: request-ott summary: Deprecated - Request OTT (Cards, Apple Pay) description: Deprecated endpoint to request OTT for Cards/Apple Pay flows. tags: - subpackage_orders 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: USER_AUTHORIZATION_TOKEN responses: '200': description: 200 - Success content: application/json: schema: $ref: '#/components/schemas/Orders_request-ott_Response_200' '500': description: 500 - Internal Server Error content: application/json: schema: $ref: '#/components/schemas/Request-ottRequestInternalServerError' requestBody: content: application/json: schema: type: object properties: apiKey: type: string default: YOUR_API_KEY description: Your API Key from Transak Dashboard required: - apiKey servers: - url: https://api-gateway-stg.transak.com components: schemas: ApiV2AuthRequestOttPostResponsesContentApplicationJsonSchemaData: type: object properties: ott: type: string required: - ott title: ApiV2AuthRequestOttPostResponsesContentApplicationJsonSchemaData Orders_request-ott_Response_200: type: object properties: data: $ref: >- #/components/schemas/ApiV2AuthRequestOttPostResponsesContentApplicationJsonSchemaData required: - data title: Orders_request-ott_Response_200 ApiV2AuthRequestOttPostResponsesContentApplicationJsonSchemaError: type: object properties: statusCode: type: integer message: type: string required: - statusCode - message title: ApiV2AuthRequestOttPostResponsesContentApplicationJsonSchemaError Request-ottRequestInternalServerError: type: object properties: error: $ref: >- #/components/schemas/ApiV2AuthRequestOttPostResponsesContentApplicationJsonSchemaError required: - error title: Request-ottRequestInternalServerError ``` ## SDK Code Examples ```python request_ott import requests url = "https://api-gateway-stg.transak.com/api/v2/auth/request-ott" payload = { "apiKey": "a1b2c3d4e5f67890abcdef1234567890" } headers = { "Authorization": "USER_AUTHORIZATION_TOKEN", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript request_ott const url = 'https://api-gateway-stg.transak.com/api/v2/auth/request-ott'; const options = { method: 'POST', headers: {Authorization: 'USER_AUTHORIZATION_TOKEN', 'Content-Type': 'application/json'}, body: '{"apiKey":"a1b2c3d4e5f67890abcdef1234567890"}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go request_ott package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api-gateway-stg.transak.com/api/v2/auth/request-ott" payload := strings.NewReader("{\n \"apiKey\": \"a1b2c3d4e5f67890abcdef1234567890\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "USER_AUTHORIZATION_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 request_ott require 'uri' require 'net/http' url = URI("https://api-gateway-stg.transak.com/api/v2/auth/request-ott") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'USER_AUTHORIZATION_TOKEN' request["Content-Type"] = 'application/json' request.body = "{\n \"apiKey\": \"a1b2c3d4e5f67890abcdef1234567890\"\n}" response = http.request(request) puts response.read_body ``` ```java request_ott import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api-gateway-stg.transak.com/api/v2/auth/request-ott") .header("Authorization", "USER_AUTHORIZATION_TOKEN") .header("Content-Type", "application/json") .body("{\n \"apiKey\": \"a1b2c3d4e5f67890abcdef1234567890\"\n}") .asString(); ``` ```php request_ott request('POST', 'https://api-gateway-stg.transak.com/api/v2/auth/request-ott', [ 'body' => '{ "apiKey": "a1b2c3d4e5f67890abcdef1234567890" }', 'headers' => [ 'Authorization' => 'USER_AUTHORIZATION_TOKEN', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp request_ott using RestSharp; var client = new RestClient("https://api-gateway-stg.transak.com/api/v2/auth/request-ott"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "USER_AUTHORIZATION_TOKEN"); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"apiKey\": \"a1b2c3d4e5f67890abcdef1234567890\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift request_ott import Foundation let headers = [ "Authorization": "USER_AUTHORIZATION_TOKEN", "Content-Type": "application/json" ] let parameters = ["apiKey": "a1b2c3d4e5f67890abcdef1234567890"] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api-gateway-stg.transak.com/api/v2/auth/request-ott")! 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() ```