Skip to main content
After the transaction has been created, the app can get the latest details and status using the transaction ID submitted in the form or passed back in the onComplete callback. This transaction ID can be used with the SDK to fetch additional details about the transaction.
using Gr4vy;
using Gr4vy.Models.Components;

var sdk = new Gr4vySDK(
    merchantAccountId: "default",
    bearerAuth: "<YOUR_BEARER_TOKEN_HERE>"
);

var res = await sdk.Transactions.GetAsync(transactionId: "7099948d-7286-47e4-aad8-b68f7eb44591");

// handle response
package main

import(
	"context"
	gr4vygo "github.com/gr4vy/gr4vy-go"
	"os"
	"log"
)

func main() {
    ctx := context.Background()

    s := gr4vygo.New(
        gr4vygo.WithMerchantAccountID("default"),
        gr4vygo.WithSecurity(os.Getenv("GR4VY_BEARER_AUTH")),
    )

    res, err := s.Transactions.Get(ctx, "7099948d-7286-47e4-aad8-b68f7eb44591")
    if err != nil {
        log.Fatal(err)
    }
    if res != nil {
        // handle response
    }
}
package hello.world;

import com.gr4vy.sdk.Gr4vy;
import com.gr4vy.sdk.models.errors.*;
import com.gr4vy.sdk.models.operations.GetTransactionResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        Gr4vy sdk = Gr4vy.builder()
                .merchantAccountId("default")
                .bearerAuth("<YOUR_BEARER_TOKEN_HERE>")
            .build();

        GetTransactionResponse res = sdk.transactions().get()
                .transactionId("7099948d-7286-47e4-aad8-b68f7eb44591")
                .call();

        if (res.transaction().isPresent()) {
            // handle response
        }
    }
}
declare(strict_types=1);

require 'vendor/autoload.php';

use Gr4vy;

$sdk = Gr4vy\SDK::builder()
    ->setMerchantAccountId('default')
    ->setSecurity(
        '<YOUR_BEARER_TOKEN_HERE>'
    )
    ->build();



$response = $sdk->transactions->get(
    transactionId: '7099948d-7286-47e4-aad8-b68f7eb44591'
);

if ($response->transaction !== null) {
    // handle response
}
from gr4vy import Gr4vy
import os


with Gr4vy(
    merchant_account_id="default",
    bearer_auth=os.getenv("GR4VY_BEARER_AUTH", ""),
) as g_client:

    res = g_client.transactions.get(transaction_id="7099948d-7286-47e4-aad8-b68f7eb44591")

    # Handle response
    print(res)

The transaction includes details about the payment method used, and the status of the transaction.
{
  "type": "transaction",
  "id": "f7099948d-7286-47e4-aad8-b68f7eb44591",
  "status": "authorized",
  "amount": 1299,
  "currency": "AUD",
  "payment_method": {
    "type": "payment-method",
    "id": "77a76f7e-d2de-4bbc-ada9-d6a0015e6bd5",
    "method": "card",
    ...
  },
  ...
}
Visit the API reference documentation for full details about the transaction resource, and any other API.