> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.sqril.io/llms.txt.
> For full documentation content, see https://docs.sqril.io/llms-full.txt.

# Get Transaction

GET https://stg-api.sqril.io/getTransaction

Retrieves a specific transaction by transaction ID for the authenticated exchange app.

**Authentication:**
- **REQUIRED**: Provide client_id and client_secret via:
  - Basic Auth: `Authorization: Basic base64(client_id:client_secret)`

- The `exchange_app_id` is automatically derived from authenticated credentials (not required in request)

**Query Parameters:**
- `transaction_id` (required): The transaction ID to lookup

**Response:**
- `transaction`: Sanitized transaction object (if found and belongs to authenticated exchange_app_id)
  - **Note:** Responses are sanitized: `provider` and `provider_tx_id` are removed for security, and any field whose name starts with `_` (internal server-only data) is never returned.

**Returns 404 if transaction not found or doesn't belong to the authenticated exchange_app_id**

Reference: https://docs.sqril.io/sqril-saa-s-api/transaction-management/get-transaction

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /getTransaction:
    get:
      operationId: get-transaction
      summary: Get Transaction
      description: >-
        Retrieves a specific transaction by transaction ID for the authenticated
        exchange app.


        **Authentication:**

        - **REQUIRED**: Provide client_id and client_secret via:
          - Basic Auth: `Authorization: Basic base64(client_id:client_secret)`

        - The `exchange_app_id` is automatically derived from authenticated
        credentials (not required in request)


        **Query Parameters:**

        - `transaction_id` (required): The transaction ID to lookup


        **Response:**

        - `transaction`: Sanitized transaction object (if found and belongs to
        authenticated exchange_app_id)
          - **Note:** Responses are sanitized: `provider` and `provider_tx_id` are removed for security, and any field whose name starts with `_` (internal server-only data) is never returned.

        **Returns 404 if transaction not found or doesn't belong to the
        authenticated exchange_app_id**
      tags:
        - subpackage_transactionManagement
      parameters:
        - name: transaction_id
          in: query
          description: 'Required: The transaction ID to lookup'
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Transaction Management_Get
                  Transaction_Response_200
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetGettransactionRequestBadRequestError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetGettransactionRequestUnauthorizedError'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetGettransactionRequestNotFoundError'
servers:
  - url: https://stg-api.sqril.io
components:
  schemas:
    GetTransactionGetResponsesContentApplicationJsonSchemaTransactionSender:
      type: object
      properties:
        name_first:
          type: string
        name_last:
          type: string
      required:
        - name_first
        - name_last
      title: GetTransactionGetResponsesContentApplicationJsonSchemaTransactionSender
    GetTransactionGetResponsesContentApplicationJsonSchemaTransactionRecipient:
      type: object
      properties:
        name:
          type: string
        account_no:
          type: string
        bank_no:
          type: string
      required:
        - name
        - account_no
        - bank_no
      title: >-
        GetTransactionGetResponsesContentApplicationJsonSchemaTransactionRecipient
    GetTransactionGetResponsesContentApplicationJsonSchemaTransaction:
      type: object
      properties:
        id:
          type: string
        exchange_app_id:
          type: string
        status:
          type: string
        amount:
          type: integer
        amount_usd:
          type: number
          format: double
        fee:
          type: number
          format: double
        percentage_fee:
          type: number
          format: double
        fixed_fee:
          type: number
          format: double
        total:
          type: number
          format: double
        currency:
          type: string
        country_code:
          type: string
        recipient_bank_no:
          type: string
        recipient_account_no:
          type: string
        recipient_account_name:
          type: string
        sender:
          $ref: >-
            #/components/schemas/GetTransactionGetResponsesContentApplicationJsonSchemaTransactionSender
        recipient:
          $ref: >-
            #/components/schemas/GetTransactionGetResponsesContentApplicationJsonSchemaTransactionRecipient
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - exchange_app_id
        - status
        - amount
        - amount_usd
        - fee
        - percentage_fee
        - fixed_fee
        - total
        - currency
        - country_code
        - recipient_bank_no
        - recipient_account_no
        - recipient_account_name
        - sender
        - recipient
        - created_at
        - updated_at
      title: GetTransactionGetResponsesContentApplicationJsonSchemaTransaction
    Transaction Management_Get Transaction_Response_200:
      type: object
      properties:
        transaction:
          $ref: >-
            #/components/schemas/GetTransactionGetResponsesContentApplicationJsonSchemaTransaction
      required:
        - transaction
      title: Transaction Management_Get Transaction_Response_200
    GetGettransactionRequestBadRequestError:
      type: object
      properties:
        error:
          type: string
      required:
        - error
      title: GetGettransactionRequestBadRequestError
    GetGettransactionRequestUnauthorizedError:
      type: object
      properties:
        error:
          type: string
      required:
        - error
      title: GetGettransactionRequestUnauthorizedError
    GetGettransactionRequestNotFoundError:
      type: object
      properties:
        error:
          type: string
        transaction_id:
          type: string
      required:
        - error
        - transaction_id
      title: GetGettransactionRequestNotFoundError

```

## SDK Code Examples

```python Transaction Management_Get Transaction_example
import requests

url = "https://stg-api.sqril.io/getTransaction"

querystring = {"transaction_id":"{{tx_id}}"}

response = requests.get(url, params=querystring)

print(response.json())
```

```javascript Transaction Management_Get Transaction_example
const url = 'https://stg-api.sqril.io/getTransaction?transaction_id=%7B%7Btx_id%7D%7D';
const options = {method: 'GET'};

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

```go Transaction Management_Get Transaction_example
package main

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

func main() {

	url := "https://stg-api.sqril.io/getTransaction?transaction_id=%7B%7Btx_id%7D%7D"

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

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Transaction Management_Get Transaction_example
require 'uri'
require 'net/http'

url = URI("https://stg-api.sqril.io/getTransaction?transaction_id=%7B%7Btx_id%7D%7D")

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

request = Net::HTTP::Get.new(url)

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

```java Transaction Management_Get Transaction_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://stg-api.sqril.io/getTransaction?transaction_id=%7B%7Btx_id%7D%7D")
  .asString();
```

```php Transaction Management_Get Transaction_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://stg-api.sqril.io/getTransaction?transaction_id=%7B%7Btx_id%7D%7D');

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

```csharp Transaction Management_Get Transaction_example
using RestSharp;

var client = new RestClient("https://stg-api.sqril.io/getTransaction?transaction_id=%7B%7Btx_id%7D%7D");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift Transaction Management_Get Transaction_example
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://stg-api.sqril.io/getTransaction?transaction_id=%7B%7Btx_id%7D%7D")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

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()
```