Skip to main content

Orders

Last updated on

Overview

Players can acquire an item found in your store by ordering it. After a player places an order for an item and pays for it, the Cloud Fulfillment service is triggered and the player is granted the item they ordered.

  • Player orders can be viewed and refunded from the Admin Portal.

Permissions

Permissions are used to grant access to specific resources within our services. Make sure your account has the following permissions before you attempt to manage orders in the Admin Portal. For a full list of permissions that impact orders management, see the Platform/Commerce tab of the permissions reference.

UsagePermission TagAction
Query user ordersADMIN:NAMESPACE:{namespace}:USER:{userId}:ORDERRead
Get user orders historyADMIN:NAMESPACE:{namespace}:USER:{userId}:ORDERRead
Download user order receiptADMIN:NAMESPACE:{namespace}:USER:{userId}:ORDERRead
Refund orderADMIN:NAMESPACE:{namespace}:USER:{userId}:ORDERUpdate

Permissions work slightly differently depending on whether they are assigned to IAM Clients or Roles assigned to users. For more information, read the Authentication and Authorization documentation.

Manage Orders in the Admin Portal

Query an Order

  1. In the Admin Portal, choose the Publisher Namespace.

  2. Go to the E-Commerce section and open the Orders menu.

  3. In the Orders menu, find the desired order using either the Email address of the player who made the order, the full Order ID of the order, the User ID of the player who made the order, or the Payment Processor Reference ID. You can also filter your search by order Status. The possible order statuses are explained in the table below. When you're done setting your search parameters, press Enter.

    StatusDescription
    ALLDisplay all orders, regardless of status.
    UnpaidUnpaid orders occur if there has been an issue with the payment process, or when the player did not proceed to payment.
    PaidPaid orders are orders that have been successfully paid for.
    ChargebackChargeback indicates that the player has issued a complaint regarding the transaction to their credit card or payment provider and that they have been issued a refund. You can either accept or dispute the chargeback.
    Chargeback ReversedChargeback Reversed indicates that you have successfully disputed a chargeback request and the disputed funds have been returned to you.
    FulfilledFulfilled indicates that the order was successful and the player has been granted the item.
    Fulfill FailedFulfill Failed occurs when the ordered item is no longer available, so the order cannot be fulfilled. If this happens, you'll need to refund the player for the order.
    RefundingRefunding occurs when our platform has already sent a refund request to the 3rd party payment provider but has not yet received a notification.
    RefundedRefunded indicates that the refund for the order has been successfully processed.
    Refund FailedRefund Failed indicates that a technical issue has prevented the refund from being processed.
    ClosedClosed indicates that an order has been left unpaid for so long that it's expired. Unpaid orders expire after 10 minutes.
  4. The list of orders will appear. Click View in an order's Action column to open more detailed information about the order.

  5. The Order Details page will appear. Here you can see more detailed information about the order. You can also open the player's order history by clicking the Order History button.

  6. Click the Order History button so see a complete order history for the selected player.

Download an Order Receipt

  1. In the Admin Portal, choose the Publisher Namespace.

  2. Go to the E-Commerce section and open the Orders menu.

  3. In the Orders menu, find the desired order using either the Email address of the player who made the order, the full Order ID of the order, the User ID of the player who made the order, or the Payment Processor Reference ID. You can also filter your search by order Status. The possible order statuses are explained in the table below. When you're done setting your search parameters, press Enter.

    Order Status
    StatusDescription
    ALLDisplay all orders, regardless of status.
    UnpaidUnpaid orders occur if there has been an issue with the payment process, or when the player did not proceed to payment.
    PaidPaid orders are orders that have been successfully paid for.
    ChargebackChargeback indicates that the player has issued a complaint regarding the transaction to their credit card or payment provider and that they have been issued a refund. You can either accept or dispute the chargeback.
    Chargeback ReversedChargeback Reversed indicates that you have successfully disputed a chargeback request and the disputed funds have been returned to you.
    FulfilledFulfilled indicates that the order was successful and the player has been granted the item.
    Fulfill FailedFulfill Failed occurs when the ordered item is no longer available, so the order cannot be fulfilled. If this happens, you'll need to refund the player for the order.
    RefundingRefunding occurs when our platform has already sent a refund request to the 3rd party payment provider but has not yet received a notification.
    RefundedRefunded indicates that the refund for the order has been successfully processed.
    Refund FailedRefund Failed indicates that a technical issue has prevented the refund from being processed.
    ClosedClosed indicates that an order has been left unpaid for so long that it's expired. Unpaid orders expire after 10 minutes.
  4. The Orders list will appear. Click View next to an order to open it.

  5. In the Order Details panel, click the Order Receipt button.

  6. The download will start immediately. The order receipt will be saved as a PDF file.

Refund an Order

  1. In the Admin Portal, choose the Publisher Namespace.

  2. Go to the E-Commerce section and open the Orders menu.

  3. In the Orders menu, find the desired order using either the Email address of the player who made the order, the full Order ID of the order, the User ID of the player who made the order, or the Payment Processor Reference ID. You can also filter your search by order Status. The possible order statuses are explained in the table below. When you're done setting your search parameters, press Enter.

  4. The Orders list will appear. Click View next to an order to open it.

  5. In the Order Details panel, click the Refund button.

  6. The Refund Order form will appear. Type the reason for the refund in the Reason field. Once completed, click Refund.

Implement Orders using Client SDKs

Our SDK can be used to allow a game client to create an order.

Create an Order

The following function can be triggered to create an order. When an order is created, the ordered items will be identified by their Item IDs, a unique identifier created by our platform for each item you create. For more information about items, see the Catalog documentation.

The ordered item will be granted automatically to the player as an Entitlement after the Payment is successful.

FAccelByteModelsOrderCreate OrderCreate;
// You can check the link above to see the catalog documentation to get more information about the item, the item information need to fill up the order create request
OrderCreate.ItemId = FString("SomeItemId");
OrderCreate.Price = 500;
OrderCreate.Region = FString("SomeRegion");
OrderCreate.Language = FString("SomeLanguage");
OrderCreate.Quantity = 2;
OrderCreate.CurrencyCode = FString("SomeCurrencyCode");
OrderCreate.DiscountedPrice = 200;
OrderCreate.ReturnUrl = FString("https://accelbyte.io");

FRegistry::Order.CreateNewOrder(OrderCreate, THandler<FAccelByteModelsOrderInfo>::CreateLambda([](const FAccelByteModelsOrderInfo& Result)
{
// Do something if CreateNewOrder has been successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if CreateNewOrder has an error
UE_LOG(LogTemp, Log, TEXT("Error CreateNewOrder, Error Code: %d Error Message: %s"), ErrorCode, *ErrorMessage);
}));

If you encounter the following error, it means that the player already owns the maximum number of the item that they can. You can verify this using the Check Entitlement function.

ErrorCode.ExceedItemMaxCountPerUser

Cancel an Order

You can use the following code to allow players to cancel orders they've made in-game.

FString OrderNo = "MyOrderNumber";

FRegistry::Order.CancelOrder(OrderNo, THandler<FAccelByteModelsOrderInfo>::CreateLambda([](const FAccelByteModelsOrderInfo& OnError)
{
// Do something if CancelOrder has been successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if CancelOrder has an error
UE_LOG(LogTemp, Log, TEXT("Error CancelOrder, Error Code: %d, Error Message: %s"), ErrorCode, *ErrorMessage);
}));

Retrieve an Order

Call this function to retrieve information about a particular order. The order number is used to retrieve the information about the order. That information includes the User ID of the player that made the order, the Item ID of the item ordered, the price of that item, the current status of the order, and other information.

FString OrderNo = "MyOrderNumber";

FRegistry::Order.GetUserOrder(OrderNo, THandler<FAccelByteModelsOrderInfo>::CreateLambda([](const FAccelByteModelsOrderInfo& Result)
{
// Do something if GetUserOrder has been successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if GetUserOrder has an error
UE_LOG(LogTemp, Log, TEXT("Error GetUserOrder, Error Code: %d, Error Message: %s"), ErrorCode, *ErrorMessage);
}));

Retrieve a List of a Player's Orders

This function returns a list of all of the orders the player has made. The list will include the User ID of the player that made the order, the Item ID of the item ordered, the price of that item, the current status of the order, and other information. You can define the pagination of these records by setting the Page and Size parameters in the function below. Page refers to the offset, or which record you want to start on, whereas Size refers to how many records will be displayed per page. So for example, if you set Page to 1 and Size to 5, the player's orders will be displayed starting from their first order, with five orders appearing on each page.

int32 Page = 2;
int32 Size = 5;

FRegistry::Order.GetUserOrders(Page, Size, THandler<FAccelByteModelsPagedOrderInfo>::CreateLambda([](const FAccelByteModelsPagedOrderInfo& Result)
{
// Do something if GetUserORders has been successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if GetUserOrders has an error
UE_LOG(LogTemp, Log, TEXT("Error GetUserOrders, Error Code: %d Error Message: %s"), ErrorCode, *ErrorMessage);
}));

Retrieve a Player's Complete Order History

This function can be used to retrieve a player's order history. Each order the player has made will be listed, along with the status each order went through and at what time. For example, precise timestamps will be given for when each order was Unpaid, Paid, Fulfilled, and so on.

FString OrderNo = FString("MyOrderNumber");

FRegistry::Order.GetUserOrderHistory(OrderNo, THandler<TArray<FAccelByteModelsOrderHistoryInfo>>::CreateLambda([](const TArray<FAccelByteModelsOrderHistoryInfo>& Result)
{
// Do something if GetUserOrderHistory has been successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if GetUserOrderHistory has an error
UE_LOG(LogTemp, Log, TEXT("Error GetUserORderHistory, Error Code: %d Error Message: %s"), ErrorCode, *ErrorMessage);
}));
  • Read Wallets to learn more about how users can store virtual currency they can use to make orders.
  • Read more about Fulfillment.