> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.alphax.asia/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.alphax.asia/_mcp/server.

# Get transaction by ID

GET https://public-api.alphax.com/transactions/{transactionId}

Get transaction details by its ULID

Reference: https://docs.alphax.asia/api-reference/alpha-x-api/transactions/get-transaction-by-id

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: alphax-openapi
  version: 1.0.0
paths:
  /transactions/{transactionId}:
    get:
      operationId: get-transaction-by-id
      summary: Get transaction by ID
      description: Get transaction details by its ULID
      tags:
        - transactions
      parameters:
        - name: transactionId
          in: path
          required: true
          schema:
            type: string
        - name: X-API-Key
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Transaction details
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Transactions_getTransactionById_Response_200
        '403':
          description: Forbidden — transaction does not belong to your account
          content:
            application/json:
              schema:
                description: Any type
        '404':
          description: Transaction not found
          content:
            application/json:
              schema:
                description: Any type
servers:
  - url: https://public-api.alphax.com
    description: Production server
  - url: https://public-api.demo.alphax.asia
    description: Staging server
components:
  schemas:
    TransactionType:
      type: string
      enum:
        - Credit
        - Debit
      description: Credit for incoming, Debit for outgoing
      title: TransactionType
    TransactionStatus:
      type: string
      enum:
        - NEW
        - PENDING
        - PROCESSING
        - PAID
        - SETTLED
        - CANCELLED
        - FAILED
        - REVERSED
        - REFUNDED
      description: Status of the transaction
      title: TransactionStatus
    CardPaymentDetails:
      type: object
      properties:
        last4:
          type:
            - string
            - 'null'
          description: Masked card number as provided by the payment processor
        type:
          type:
            - string
            - 'null'
          description: Card scheme
        country:
          type:
            - string
            - 'null'
          description: Card issuing country (only available for HelloClever payments)
      description: Present when paymentMethod is "card"
      title: CardPaymentDetails
    Transaction:
      type: object
      properties:
        id:
          type: string
          description: Unique ULID of the transaction
        type:
          $ref: '#/components/schemas/TransactionType'
          description: Credit for incoming, Debit for outgoing
        currency:
          type: string
          description: Currency code in ISO 4217 format
        amount:
          type: number
          format: double
          description: Transaction amount (negative for Debit)
        counterpartyName:
          type: string
        counterpartyCode:
          type: string
        counterpartyBankCode:
          type: string
        description:
          type: string
        status:
          $ref: '#/components/schemas/TransactionStatus'
          description: Status of the transaction
        paymentMethod:
          type:
            - string
            - 'null'
          description: Payment method used, present only for checkout payments
        card:
          $ref: '#/components/schemas/CardPaymentDetails'
        createdAt:
          type: string
          format: date-time
      title: Transaction
    Transactions_getTransactionById_Response_200:
      type: object
      properties:
        transaction:
          $ref: '#/components/schemas/Transaction'
      title: Transactions_getTransactionById_Response_200
  securitySchemes:
    xApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

```

## Examples

### Transaction with card payment



**Response**

```json
{
  "transaction": {
    "id": "01kqc6aaq3jshqyz6a0k8nkxfe",
    "type": "Credit",
    "currency": "USD",
    "amount": 1000,
    "counterpartyName": "ADFADF ADSF",
    "counterpartyCode": "",
    "counterpartyBankCode": "",
    "description": "Payment received",
    "status": "SETTLED",
    "paymentMethod": "card",
    "card": {
      "last4": "424242......4242",
      "type": "visa",
      "country": null
    },
    "createdAt": "2026-04-29T08:40:16.000000Z"
  }
}
```

**SDK Code**

```python Transaction with card payment
import requests

url = "https://public-api.alphax.com/transactions/transactionId"

headers = {"X-API-Key": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Transaction with card payment
const url = 'https://public-api.alphax.com/transactions/transactionId';
const options = {method: 'GET', headers: {'X-API-Key': '<apiKey>'}};

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

```go Transaction with card payment
package main

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

func main() {

	url := "https://public-api.alphax.com/transactions/transactionId"

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

	req.Header.Add("X-API-Key", "<apiKey>")

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

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

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

}
```

```ruby Transaction with card payment
require 'uri'
require 'net/http'

url = URI("https://public-api.alphax.com/transactions/transactionId")

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

request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<apiKey>'

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

```java Transaction with card payment
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://public-api.alphax.com/transactions/transactionId")
  .header("X-API-Key", "<apiKey>")
  .asString();
```

```php Transaction with card payment
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://public-api.alphax.com/transactions/transactionId', [
  'headers' => [
    'X-API-Key' => '<apiKey>',
  ],
]);

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

```csharp Transaction with card payment
using RestSharp;

var client = new RestClient("https://public-api.alphax.com/transactions/transactionId");
var request = new RestRequest(Method.GET);
request.AddHeader("X-API-Key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Transaction with card payment
import Foundation

let headers = ["X-API-Key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://public-api.alphax.com/transactions/transactionId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
```

### Transaction without external payment details



**Response**

```json
{
  "transaction": {
    "id": "01kqd06dr6b3h44vxyy4495xch",
    "type": "Debit",
    "currency": "USD",
    "amount": -500,
    "counterpartyName": "Supplier Co.",
    "counterpartyCode": "SUPCO123",
    "counterpartyBankCode": "CITIUS33",
    "description": "Outbound transfer",
    "status": "PAID",
    "paymentMethod": null,
    "createdAt": "2026-04-29T16:12:28.000000Z"
  }
}
```

**SDK Code**

```python Transaction without external payment details
import requests

url = "https://public-api.alphax.com/transactions/transactionId"

headers = {"X-API-Key": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Transaction without external payment details
const url = 'https://public-api.alphax.com/transactions/transactionId';
const options = {method: 'GET', headers: {'X-API-Key': '<apiKey>'}};

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

```go Transaction without external payment details
package main

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

func main() {

	url := "https://public-api.alphax.com/transactions/transactionId"

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

	req.Header.Add("X-API-Key", "<apiKey>")

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

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

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

}
```

```ruby Transaction without external payment details
require 'uri'
require 'net/http'

url = URI("https://public-api.alphax.com/transactions/transactionId")

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

request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<apiKey>'

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

```java Transaction without external payment details
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://public-api.alphax.com/transactions/transactionId")
  .header("X-API-Key", "<apiKey>")
  .asString();
```

```php Transaction without external payment details
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://public-api.alphax.com/transactions/transactionId', [
  'headers' => [
    'X-API-Key' => '<apiKey>',
  ],
]);

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

```csharp Transaction without external payment details
using RestSharp;

var client = new RestClient("https://public-api.alphax.com/transactions/transactionId");
var request = new RestRequest(Method.GET);
request.AddHeader("X-API-Key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Transaction without external payment details
import Foundation

let headers = ["X-API-Key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://public-api.alphax.com/transactions/transactionId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
```