/transactions/{name}/{guid}

GET SYNC

Retrieve a specific transaction from a wallet.

GET /api/v1/transactions/{name}/{guid}
Alias: /get-transaction-details/{name}/{guid}

Description

Retrieves the full details for a single transaction receipt, identified by its unique GUID, from a specific wallet.

Path Parameters

ParameterTypeRequiredDescription
name string Yes The name of the wallet containing the transaction.
guid string Yes The 32-character unique identifier (GUID) of the transaction receipt.

Response

Returns a `200 OK` response with a JSON object containing the details of the specified transaction.

Example Response

{
    "amount": 3000000020,
    "message": "Receive",
    "type": "GetFromLocker",
    "datetime": "2023-03-10T10:09:36+03:00",
    "receiptid": "801329d510eac664035cfdd895305275",
    "details": null,
    "running_balance": 3000000020,
    "negative": false
}

Examples

JavaScript Example

const apiHost = 'http://localhost:8006';

async function getTransaction(walletName, guid) {
    try {
        const response = await fetch(`${apiHost}/api/v1/transactions/${walletName}/${guid}`);
        if (!response.ok) {
            throw new Error(`HTTP error! Status: ${response.status}`);
        }
        const transaction = await response.json();
        console.log('Transaction Details:', transaction);
    } catch (error) {
        console.error('Error fetching transaction:', error);
    }
}

getTransaction('Default', '801329d510eac664035cfdd895305275');

cURL Example

# Get a specific transaction by its GUID from the "Default" wallet
curl -X GET "http://localhost:8006/api/v1/transactions/Default/801329d510eac664035cfdd895305275"

Go Example

package main

import (
    "encoding/json"
    "fmt"
    "log"
    "net/http"
)

const apiHost = "http://localhost:8006/api/v1"

type Transaction struct {
    Amount         uint64      `json:"amount"`
    Message        string      `json:"message"`
    Type           string      `json:"type"`
    DateTime       string      `json:"datetime"`
    ReceiptID      string      `json:"receiptid"`
    Details        interface{} `json:"details"`
    RunningBalance uint64      `json:"running_balance"`
    IsNegative     bool        `json:"negative"`
}

func getTransaction(walletName, guid string) {
    url := fmt.Sprintf("%s/transactions/%s/%s", apiHost, walletName, guid)
    resp, err := http.Get(url)
    if err != nil {
        log.Fatalf("Request failed: %v", err)
    }
    defer resp.Body.Close()

    if resp.StatusCode != http.StatusOK {
        log.Fatalf("Failed to get transaction, status: %s", resp.Status)
    }

    var transaction Transaction
    if err := json.NewDecoder(resp.Body).Decode(&transaction); err != nil {
        log.Fatalf("Failed to decode response: %v", err)
    }

    fmt.Printf("Transaction Details: %+v\n", transaction)
}

func main() {
    getTransaction("Default", "801329d510eac664035cfdd895305275")
}