# Get wallet transaction

GET https://services.leadconnectorhq.com/wallet/transactions/{transactionId}

Fetch a single wallet transaction for the sub-account resolved from the access token, including its charge-type specific breakdown. The required settlementTime is taken from the matching record in the transaction list response.

## Authentication

Send `Authorization: Bearer <token>` using:

- **Sub-Account token: OAuth access token or Private Integration Token.** Scopes: `wallet.readonly`

## Parameters

### Header Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Version` | string | Yes | API Version |

### Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `transactionId` | string | Yes | ID of the transaction to fetch |

### Query Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `settlementTime` | string | Yes | Settlement time of the transaction, as returned by the wallet transaction list endpoint. Accepts an ISO 8601 timestamp or epoch milliseconds. |
| `timezone` | string | No | IANA timezone used to normalize timestamps in the response |
| `locationId` | string | No | Narrow the read to one sub-account. Optional with an Agency access token; omit it with a Sub-Account token. |

## OpenAPI Specification

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "HighLevel API",
    "version": "v3"
  },
  "servers": [
    {
      "url": "https://services.leadconnectorhq.com"
    }
  ],
  "paths": {
    "/wallet/transactions/{transactionId}": {
      "get": {
        "summary": "Get wallet transaction",
        "operationId": "getWalletTransaction",
        "description": "Fetch a single wallet transaction for the sub-account resolved from the access token, including its charge-type specific breakdown. The required settlementTime is taken from the matching record in the transaction list response.",
        "parameters": [
          {
            "name": "Version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "v3"
              ]
            }
          },
          {
            "name": "transactionId",
            "required": true,
            "in": "path",
            "description": "ID of the transaction to fetch",
            "schema": {
              "example": "6512bd43d9caa6e02c990b0a",
              "type": "string"
            }
          },
          {
            "name": "settlementTime",
            "required": true,
            "in": "query",
            "description": "Settlement time of the transaction, as returned by the wallet transaction list endpoint. Accepts an ISO 8601 timestamp or epoch milliseconds.",
            "schema": {
              "example": "2024-03-14T09:21:00.000Z",
              "type": "string"
            }
          },
          {
            "name": "timezone",
            "required": false,
            "in": "query",
            "description": "IANA timezone used to normalize timestamps in the response",
            "schema": {
              "example": "America/New_York",
              "type": "string"
            }
          },
          {
            "name": "locationId",
            "required": false,
            "in": "query",
            "description": "Narrow the read to one sub-account. Optional with an Agency access token; omit it with a Sub-Account token.",
            "schema": {
              "example": "AUKAtFVo0lWezBsBQ3FE",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Wallet transaction retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletTransactionDetailResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Resource not found"
          },
          "429": {
            "description": "Too many requests"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "Location-Access": [
              "wallet.readonly"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "Location-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Agency-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency (OR) Private Integration Token of Agency.",
        "type": "http"
      }
    },
    "schemas": {
      "WalletTransactionDetailResponseDto": {
        "type": "object",
        "properties": {
          "transaction": {
            "type": "object",
            "description": "The wallet transaction record",
            "additionalProperties": true,
            "example": {
              "_id": "6512bd43d9caa6e02c990b0a",
              "locationId": "AUKAtFVo0lWezBsBQ3FE",
              "chargeType": "Email",
              "amount": 0.00675,
              "currency": "USD",
              "settlementTime": "2024-03-14T09:21:00.000Z"
            }
          },
          "details": {
            "type": "object",
            "description": "Charge-type specific breakdown for the transaction. An empty object when the transaction carries no itemized detail.",
            "additionalProperties": true,
            "example": {
              "messageType": "Email",
              "emailsSent": 3
            }
          }
        },
        "required": [
          "transaction",
          "details"
        ],
        "title": "WalletTransactionDetailResponseDto"
      }
    }
  }
}
```

## Code Examples

**cURL**

```bash
curl -L -X GET 'https://services.leadconnectorhq.com/wallet/transactions/<transactionId>?settlementTime=<SETTLEMENTTIME>' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Version: v3'
```

**Node.js**

```javascript
const options = {
  method: 'GET',
  headers: {
    Authorization: 'Bearer <TOKEN>',
    Version: 'v3'
  }
};

try {
  const response = await fetch('https://services.leadconnectorhq.com/wallet/transactions/<transactionId>?settlementTime=<SETTLEMENTTIME>', options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**Python**

```python
import requests

url = "https://services.leadconnectorhq.com/wallet/transactions/{transactionId}"

headers = {
    "Authorization": "Bearer <TOKEN>",
    "Version": "v3"
}

params = {
    "settlementTime": "<SETTLEMENTTIME>"
}

response = requests.get(url, params=params, headers=headers)
print(response.json())
```

**PHP**

```php
<?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://services.leadconnectorhq.com/wallet/transactions/<transactionId>?settlementTime=<SETTLEMENTTIME>',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <TOKEN>',
    'Version: v3',
  ],
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;
```

**Java**

```java
HttpResponse<String> response = Unirest
  .get("https://services.leadconnectorhq.com/wallet/transactions/<transactionId>?settlementTime=<SETTLEMENTTIME>")
  .header("Authorization", "Bearer <TOKEN>")
  .header("Version", "v3")
  .asString();
```

**Go**

```go
package main

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

func main() {
  url := "https://services.leadconnectorhq.com/wallet/transactions/<transactionId>?settlementTime=<SETTLEMENTTIME>"
  req, _ := http.NewRequest("GET", url, nil)
  req.Header.Add("Authorization", "Bearer <TOKEN>")
  req.Header.Add("Version", "v3")

  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := io.ReadAll(res.Body)
  fmt.Println(string(body))
}
```

**Ruby**

```ruby
require 'uri'
require 'net/http'

url = URI("https://services.leadconnectorhq.com/wallet/transactions/<transactionId>?settlementTime=<SETTLEMENTTIME>")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer <TOKEN>"
request["Version"] = "v3"

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

**PowerShell**

```powershell
$headers = @{
  "Authorization" = "Bearer <TOKEN>"
  "Version" = "v3"
}

$response = Invoke-RestMethod -Uri 'https://services.leadconnectorhq.com/wallet/transactions/<transactionId>?settlementTime=<SETTLEMENTTIME>' -Method 'GET' -Headers $headers
$response | ConvertTo-Json
```
