---
title: Crypto purchases in Unreal Engine
description: Wire a crypto checkout into Unreal Engine with the HTTP module: the client requests a checkout URL from your backend, opens it, and grants items only on a verified server-side webhook.
url: https://gaapay.com/integrations/unreal
updated: 2026-12-04
language: en
type: guide
---

# Crypto purchases in Unreal Engine

> Unreal’s HTTP module is enough for the client half: POST to your backend, parse `checkout_url`, open it externally. Entitlement lives on your game server and is granted by the payment webhook, never by the client.

The architecture is identical to Unity: a thin client, a signing backend, a webhook that grants. Unreal adds one wrinkle — shipping builds are easy to inspect, so “obfuscated key” is not a security model. Keep the secret on the server.

## Client request (C++)

```cpp
#include "HttpModule.h"
#include "Interfaces/IHttpRequest.h"
#include "Interfaces/IHttpResponse.h"

void UShopSubsystem::Buy(const FString& Sku)
{
    const FString Body = FString::Printf(
        TEXT("{\"sku\":\"%s\",\"player\":\"%s\"}"), *Sku, *PlayerId);

    auto Request = FHttpModule::Get().CreateRequest();
    Request->SetURL(BackendUrl + TEXT("/shop/checkout"));
    Request->SetVerb(TEXT("POST"));
    Request->SetHeader(TEXT("Content-Type"), TEXT("application/json"));
    Request->SetContentAsString(Body);
    Request->OnProcessRequestComplete().BindLambda(
        [](FHttpRequestPtr, FHttpResponsePtr Response, bool bOk)
        {
            if (!bOk || !Response.IsValid()) return;
            FString Url;
            FJsonObjectWrapper Json;
            if (Json.JsonObjectFromString(Response->GetContentAsString()))
            {
                Json.JsonObject->TryGetStringField(TEXT("checkout_url"), Url);
                FPlatformProcess::LaunchURL(*Url, nullptr, nullptr);
            }
        });
    Request->ProcessRequest();
}
```

## The server half

Your game backend owns the order: it signs the GaaPay request, keeps `player_id` opaque in metadata, and grants the entitlement when a verified webhook arrives. The Unreal client only opens a URL and later asks the backend what the player owns.

For dedicated servers this is straightforward: the entitlement check is already server-authoritative, so a forged client request changes nothing.

## Unreal pitfalls

- **Do not block the game thread.** The HTTP call is async; keep the UI responsive and show a “waiting for payment” state.
- **LaunchURL is platform-dependent.** On Windows it opens the default browser; on consoles there may be no browser, so the checkout has to be a web view or a companion app. Design for the platform you ship on.
- **Entitlements must survive a crash.** The webhook grants; the client re-queries on login.
- **Never put the secret in DefaultGame.ini.** Packaged builds are readable.

## Unreal questions

### Can Unreal sign requests directly?

It can compute an HMAC, but the secret would ship with the game. Use your backend; it also gives you a place to store entitlements.

### Does this work on consoles?

The API works, but console platforms have no general browser. You need a web view, a companion app, or a platform-approved purchase flow.

### How do I handle refunds?

Refunds are merchant-initiated and go to the original address. Treat a refund as a revoke event in your entitlement service; do not wait for the client to notice.

[Node guide](/integrations/node) — **Start from the Node backend**: The sandbox is the default. Create an app, create an order, watch a webhook arrive — then flip one environment variable.

## Related

- https://gaapay.com/integrations/unity
- https://gaapay.com/integrations/node
- https://gaapay.com/docs/events
- https://gaapay.com/docs/api-query
