Nexa Developer Docs

Create Gamepass Transaction

Create a transaction for player to buy a Gamepass.

Creating a Gamepass Transaction

Creates a purchase transaction for a player.

Method

String createGamepassTXN(Player player, String gamepassID)

Parameters

ParameterTypeDescription
playerPlayerThe player creating the transaction
gamepassIDStringThe Gamepass ID from the Nexa Panel

Example

String txnId = nexaAPI.createGamepassTXN(player, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");

if (!txnId.startsWith("ERROR_")) {
    player.sendMessage("Transaction Created: " + txnId);
}

Success Response

Returns:

"TXN_ID"

The player will get a clickable message to finish the transaction.

Example:

[Nexa] Transaction Created, Click here to confirm!

Error Response

Returns:

ERROR_GAMEPASS_NOT_FOUND

or another error returned by the API.

Example:

if (txnId.startsWith("ERROR_")) {
    player.sendMessage("Failed: " + txnId);
}

On this page