Adding Packages

When adding packages, there may be certain Variables associated with them. These can be filled by providing a variable_data object.

"variable_data": {
    "variable_identifier": "value"
}

Deliverable Types and Variable Data

Gift Card

Packages that deliver a gift card to the user should include giftcard_to mapped to the e-mail address that will receive the gift card:

{
    "package_id": "6276316",
    "quantity": 1,
    "variable_data": {
        "giftcard_to": "tebex-integrations@overwolf.com"
    }
}

Discord Action

Packages that deliver Discord actions should include the user's discord_id:

{
    "package_id": "6276316",
    "quantity": 1,
    "variable_data": {
        "discord_id": "000000000000000000"
    }
}

Game Server Commands

Packages that deliver game server commands should include the username_id of the user, dependent on your store type.

You can get the username_id after creating the basket if you provide the player's username at the time of creation. See Creating a Basket for specific details on Game Servers.

{
    "package_id": "6276316",
    "quantity": 1,
    "variable_data": {
        "username_id": "9e65a968ee4743d19a2a4c9969154491"
    }
}

Custom Data

You can also provide custom data when adding packages which can be referenced by the seller as part of the transaction.

{
    "package_id": "6276316",
    "quantity": 1,
    "variable_data": {
        "username_id": "9e65a968ee4743d19a2a4c9969154491"
    },
    "custom": {
        "key": "value"
    }
}

Special Actions

When adding a package to the basket, you can include certain parameters with the request that can trigger specific functionality.

Gifting a Package to Another Player

You can allow players to gift packages to other players. Include target_username_id when adding the package to the basket and the package will be delivered to that player rather than the buyer:

{
    "package_id": "6276316",
    "target_username_id": "069a79f444e94726a5befca90e38aaf5"
}

Selecting the Package's Game Server

If a package with a Game Server Command has the configuration option:

  • Allow customers to select the game server they want to receive this package on.

You can specify the target game server in the request by including server_id in your package's variable_data:

{
    "package_id": "6276316",
    "quantity": 1,
    "variable_data": {
        "server_id": "127444"
    }
}

A list of your server_ids can be found in your Tebex Control Panel by clicking Edit beside your relevant game server. The server ID is the number at the end of the URL when editing the game server.

Last updated