Skip to content

Sending consumption information

Using transmitting consumption information from additional services, app users can send their consumption behavior information to the app market when requesting a refund.

Note

Currently, the transmission of consumption information is only supported by the Apple App Store.

Overview

The consumer information to be sent to the app market also contains data that exists only on the game server. Therefore, for the Hive server to send this data to the app market, the game server must pass the data to the Hive server.

The game server URL is the API endpoint opened by the game server for the game server to send data to the Hive server. After configuring the API endpoint according to the protocol below and registering it to the game server URL, the Hive server will send a POST request to this API endpoint every time a user requests a refund and will receive the necessary data from the game server. The Hive server aggregates this data and completes the transmission of consumer information to the app market on behalf of the app developer.

In summary, the entire process is as follows.

  1. App developer: Prepare the server URL by configuring the API endpoint
  2. App developer: Select Enable Consumption Information Transmission in the Hive console and register the server URL
  3. App user: Agree to transmit in-app product consumption information while the app is running
  4. App user: Request a refund in the app
  5. Hive server: POST API request to the server URL registered by the app developer, receive data as a response
  6. Hive server: Transmit consumption information to the app market
Warning

If the app user does not agree to the information transmission in the consent popup, the Hive server will not transmit the data to the app market, even if it receives data from the game server.

API endpoint configuration (server url)

The API endpoint to be registered with the server URL must aggregate game user-specific data (consumption_status, play_time, refund_preference, sample_content_provided) when a request is received, and respond with the aggregated data that can be queried using the user information (CS_CODE) in the request parameters.

Disable firewall rules

Disabling the firewall inbound rules allows API communication between the game server and the Hive server. You need to disable the firewall inbound rules for the IP addresses below on the game server.

Hive Server Type IP Address
Commercial IP 43.201.165.236
Sandbox IP 43.155.181.83

After disabling the firewall rules, refer to the information below to configure the API endpoint.

API request (Hive server → game server) configuration

This is the POST request information sent from the Hive server to the game server.

API Information Description
Method POST
Response Format JSON
Content-type application/json

The following is the Request Body information.

Name Type Required (Required: M, Optional: O) Description
gameindex String M Hive App Center Game Index
appid String M Hive App Center AppID
user_seq String M In-game User CS CODE


The following is an example of a Request Body.

{
    "gameindex": "539",
    "appid": "com.com2us.hivesdk.normal.freefull.apple.global.ios.universal",
    "user_seq": "222333"
}

API response (game server → Hive server) configuration

This is the response value information that must be sent from the game server to the Hive server when the response is successful.

Name Type Required (Required: M, Optional: O) Description
code Integer M Response code (100: Success)
message String M Result message according to the response code
data Object M Response data
(Returned only if the response is successful, not returned in case of an error)
┕ consumption_status Integer M Consumption status of consumable items ("0" or "3" must be selected as a fixed value response)
┕ play_time Integer M Game play time
┕ refund_preference Integer M Refund preference
┕ sample_content_provided Integer M Sample content provided status


The following is an example of the response value when the response is successful.

// success
{
    "code": 100,
    "message": "OK",
    "data": {
        "consumption_status": 0,
        "play_time": 1,
        "refund_preference": 2,
        "sample_content_provided": 0
    }
}

The following is an example of a response value in case of a response failure.

// Errors due to wrong parameters
{
    "code": 400,
    "message": "No parameter, or invalid parameter name."
}
// Errors due to invalid user information
{
    "code": 200,
    "message": "No data, or invalid cs_code."
}

Here are the response codes.

Code Description
100 Success
200 Invalid user information (CS_CODE)
400 Request parameter error
401 Request JSON error
500 Server processing error
501 DB communication error