> For a complete page index, fetch https://docs.transak.com/llms.txt

# Transaction Process API

POST https://api-gateway-stg.transak.com/api/v2/transaction-session/request/{requestId}/process
Content-Type: application/json



Reference: https://docs.transak.com/api/headless-apple-pay/transaction-process-api

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: headless-apple-pay-api
  version: 1.0.0
paths:
  /api/v2/transaction-session/request/{requestId}/process:
    post:
      operationId: transaction-process-api
      summary: Transaction Process API
      description: ''
      tags:
        - ''
      parameters:
        - name: requestId
          in: path
          description: Transaction session request identifier.
          required: true
          schema:
            type: string
        - name: x-access-token
          in: header
          description: >-
            Your Partner Access Token. Please refer
            [here](/guides/how-to-create-partner-access-token) for a tutorial
            ongenerating your access token. 
          required: true
          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
        - 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
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderCreatedResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorBody'
        '404':
          description: RequestId Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorBody'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorBody'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorBody'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties: {}
servers:
  - url: https://api-gateway-stg.transak.com
components:
  schemas:
    OrderCreatedResponseData:
      type: object
      properties:
        orderId:
          type: string
          description: Unique identifier for the created order.
        partnerUserId:
          type: string
          description: Partner's user identifier associated with this order.
        status:
          type: string
          description: Current order status (e.g. AWAITING_PAYMENT_FROM_USER).
        isBuyOrSell:
          type: string
          description: Indicates whether the order is a BUY or SELL.
        fiatCurrency:
          type: string
          description: Fiat currency used for the order.
        cryptoCurrency:
          type: string
          description: Crypto asset being purchased.
        paymentMethod:
          type: string
          description: Payment method used. Always `apple_pay` for this flow.
        network:
          type: string
          description: Blockchain network for the crypto asset.
        networkId:
          type: string
          description: Chain ID of the network.
        walletAddress:
          type: string
          description: Destination wallet address for the crypto.
        quoteId:
          type: string
          description: Quote ID used to create this order.
        fiatAmount:
          type: number
          format: double
          description: Fiat amount for the order.
        fiatAmountInUsd:
          type: number
          format: double
          description: Fiat amount converted to USD.
        amountPaid:
          type: number
          format: double
          description: Amount already paid by the user.
        cryptoAmount:
          type: number
          format: double
          description: Crypto amount the user will receive.
        conversionPrice:
          type: number
          format: double
          description: Fiat-to-crypto conversion rate.
        totalFeeInFiat:
          type: number
          format: double
          description: Total fee charged in fiat currency.
        txHash:
          type:
            - string
            - 'null'
          description: >-
            Blockchain transaction hash. Null until the transaction is confirmed
            on-chain.
      required:
        - orderId
        - status
        - isBuyOrSell
        - fiatCurrency
        - cryptoCurrency
        - paymentMethod
        - network
        - fiatAmount
        - fiatAmountInUsd
        - cryptoAmount
      description: >-
        Order details returned after processing the Apple Pay transaction
        session.
      title: OrderCreatedResponseData
    OrderCreatedResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/OrderCreatedResponseData'
          description: >-
            Order details returned after processing the Apple Pay transaction
            session.
      required:
        - data
      description: Order created successfully.
      title: OrderCreatedResponse
    ApiErrorBodyError:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          type: string
        errorCode:
          type: integer
          description: Machine-readable error code for client handling.
      required:
        - statusCode
        - message
      title: ApiErrorBodyError
    ApiErrorBody:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ApiErrorBodyError'
      required:
        - error
      title: ApiErrorBody

```

## SDK Code Examples

```python Success
import requests

url = "https://api-gateway-stg.transak.com/api/v2/transaction-session/request/:requestId/process"

headers = {
    "x-access-token": "",
    "authorization": "",
    "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/transaction-session/request/:requestId/process';
const options = {
  method: 'POST',
  headers: {'x-access-token': '', authorization: '', '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/transaction-session/request/:requestId/process"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("x-access-token", "")
	req.Header.Add("authorization", "")
	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/transaction-session/request/:requestId/process")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-access-token"] = ''
request["authorization"] = ''
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<String> response = Unirest.post("https://api-gateway-stg.transak.com/api/v2/transaction-session/request/:requestId/process")
  .header("x-access-token", "")
  .header("authorization", "")
  .header("Content-Type", "application/json")
  .asString();
```

```php Success
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api-gateway-stg.transak.com/api/v2/transaction-session/request/:requestId/process', [
  'headers' => [
    'Content-Type' => 'application/json',
    'authorization' => '',
    'x-access-token' => '',
  ],
]);

echo $response->getBody();
```

```csharp Success
using RestSharp;

var client = new RestClient("https://api-gateway-stg.transak.com/api/v2/transaction-session/request/:requestId/process");
var request = new RestRequest(Method.POST);
request.AddHeader("x-access-token", "");
request.AddHeader("authorization", "");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Success
import Foundation

let headers = [
  "x-access-token": "",
  "authorization": "",
  "Content-Type": "application/json"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api-gateway-stg.transak.com/api/v2/transaction-session/request/:requestId/process")! 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 transaction-process-api_example
import requests

url = "https://api-gateway-stg.transak.com/api/v2/transaction-session/request/:requestId/process"

payload = {}
headers = {
    "x-access-token": "",
    "authorization": "",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript transaction-process-api_example
const url = 'https://api-gateway-stg.transak.com/api/v2/transaction-session/request/:requestId/process';
const options = {
  method: 'POST',
  headers: {'x-access-token': '', authorization: '', 'Content-Type': 'application/json'},
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go transaction-process-api_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api-gateway-stg.transak.com/api/v2/transaction-session/request/:requestId/process"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-access-token", "")
	req.Header.Add("authorization", "")
	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 transaction-process-api_example
require 'uri'
require 'net/http'

url = URI("https://api-gateway-stg.transak.com/api/v2/transaction-session/request/:requestId/process")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-access-token"] = ''
request["authorization"] = ''
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java transaction-process-api_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api-gateway-stg.transak.com/api/v2/transaction-session/request/:requestId/process")
  .header("x-access-token", "")
  .header("authorization", "")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php transaction-process-api_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api-gateway-stg.transak.com/api/v2/transaction-session/request/:requestId/process', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
    'authorization' => '',
    'x-access-token' => '',
  ],
]);

echo $response->getBody();
```

```csharp transaction-process-api_example
using RestSharp;

var client = new RestClient("https://api-gateway-stg.transak.com/api/v2/transaction-session/request/:requestId/process");
var request = new RestRequest(Method.POST);
request.AddHeader("x-access-token", "");
request.AddHeader("authorization", "");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift transaction-process-api_example
import Foundation

let headers = [
  "x-access-token": "",
  "authorization": "",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api-gateway-stg.transak.com/api/v2/transaction-session/request/:requestId/process")! 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()
```