GS2-Money2 SDK API Reference

Specification of models and API references for GS2-Money2 SDK for various programming languages

Models

Namespace

Namespace

A Namespace allows multiple independent instances of the same service within a single project by separating data spaces and usage contexts. Each GS2 service is managed on a per-namespace basis. Even when using the same service, if the namespace differs, the data is treated as a completely independent data space.

Therefore, you must create a namespace before you can start using each service.

Details
Type Condition Required Default Value Limits Description
namespaceId string
*
~ 1024 chars Namespace GRN
* Set automatically by the server
name string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
description string ~ 1024 chars Description
transactionSetting TransactionSetting Transaction Setting
Settings for distributed transactions used when depositing or withdrawing currency.
currencyUsagePriority string (enum)
enum {
  “PrioritizeFree”,
  “PrioritizePaid”
}
Consumption priority
Determines the order in which paid and free currency are consumed when withdrawing from the wallet. “PrioritizeFree” consumes free currency first, while “PrioritizePaid” consumes paid currency first.
DefinitionDescription
“PrioritizeFree”Prioritize the use of free currency
“PrioritizePaid”Prioritize the use of paid currency
sharedFreeCurrency bool
Share the free currency with different slots
When enabled, free currency balance is shared across all wallet slots (platforms). Paid currency remains separate per slot. This setting can only be configured at namespace creation time and cannot be changed later.
platformSetting PlatformSetting
Store platform settings
Configuration for each supported store platform (Apple App Store, Google Play, Fake for testing). Includes credentials and keys required for receipt verification on each platform.
depositBalanceScript ScriptSetting Script setting to be executed when depositing wallet balance
Script Trigger Reference - deposit
withdrawBalanceScript ScriptSetting Script setting to be executed when withdrawing wallet balance
Script Trigger Reference - withdraw
verifyReceiptScript ScriptSetting Script setting to be executed when verifying a receipt
Script Trigger Reference - verifyReceipt
subscribeScript string ~ 1024 chars GS2-Script script GRN to be executed when subscribing to a new contract(Not called when the user associated with the subscription is changed / Called when re-subscribing after contract expiration)
Script Trigger Reference - subscribe
renewScript string ~ 1024 chars GS2-Script script GRN to be executed when renewing a contract
Script Trigger Reference - renew
unsubscribeScript string ~ 1024 chars GS2-Script script GRN to be executed when unsubscribing from a contract(Not called when the user associated with the subscription is changed)
Script Trigger Reference - unsubscribe
takeOverScript ScriptSetting Script setting to be executed when taking over a contract
Script Trigger Reference - takeOver
changeSubscriptionStatusNotification NotificationSetting Push notification when the subscription status changes
Configures push notifications delivered via GS2-Gateway when a subscription status changes (e.g., activated, renewed, canceled, expired, or revoked). Allows the game client to respond to subscription state transitions in real-time.
logSetting LogSetting Log Output Setting
Specifies the GS2-Log namespace to which API request and response logs for this namespace will be output. Useful for tracking deposits, withdrawals, receipt verifications, and subscription events.
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server
updatedAt long
*
Current time Last Updated Timestamp
Unix time, milliseconds
* Set automatically by the server
revision long 0 0 ~ 9223372036854775805 Revision

TransactionSetting

Transaction Setting

Transaction Setting controls execution methods, consistency, asynchronous processing, and conflict avoidance mechanisms of transactions. Combining features like AutoRun, AtomicCommit, asynchronous execution using GS2-Distributor, batch application of script results, and asynchronous processing of Acquire Actions via GS2-JobQueue enables robust transaction management tailored to game logic.

Details
Type Condition Required Default Value Limits Description
enableAutoRun bool false Whether to automatically execute issued transactions on the server side
enableAtomicCommit bool {enableAutoRun} == true false Whether to commit the execution of transactions atomically
* Enabled only if enableAutoRun is true
transactionUseDistributor bool {enableAtomicCommit} == true false Whether to execute transactions asynchronously
* Enabled only if enableAtomicCommit is true
commitScriptResultInUseDistributor bool {transactionUseDistributor} == true false Whether to execute the commit processing of the script result asynchronously
* Enabled only if transactionUseDistributor is true
acquireActionUseJobQueue bool {enableAtomicCommit} == true false Whether to use GS2-JobQueue to execute the acquire action
* Enabled only if enableAtomicCommit is true
distributorNamespaceId string “grn:gs2:{region}:{ownerId}:distributor:default” ~ 1024 chars GS2-Distributor Namespace GRN used to execute transactions
queueNamespaceId string “grn:gs2:{region}:{ownerId}:queue:default” ~ 1024 chars GS2-JobQueue Namespace GRN used to execute transactions

ScriptSetting

Script Setting

In GS2, you can associate custom scripts with microservice events and execute them. This model holds the settings for triggering script execution.

There are two main ways to execute a script: synchronous execution and asynchronous execution. Because synchronous execution blocks processing until the script finishes executing, you can use the script result to stop the API execution or control the API response.

In contrast, asynchronous execution does not block processing until the script has finished executing. However, because the script result cannot be used to stop the API execution or modify the API response, asynchronous execution does not affect the API response flow and is generally recommended.

There are two types of asynchronous execution methods: GS2-Script and Amazon EventBridge. By using Amazon EventBridge, you can write processing in languages other than Lua.

Details
Type Condition Required Default Value Limits Description
triggerScriptId string ~ 1024 chars GS2-Script script GRN executed synchronously when the API is executed
Must be specified in GRN format starting with “grn:gs2:”.
doneTriggerTargetType string (enum)
enum {
  “none”,
  “gs2_script”,
  “aws”
}
“none” How to execute asynchronous scripts
Specifies the type of script to use for asynchronous execution.
You can choose from “Do not use asynchronous execution (none)”, “Use GS2-Script (gs2_script)”, and “Use Amazon EventBridge (aws)”.
DefinitionDescription
“none”None
“gs2_script”GS2-Script
“aws”Amazon EventBridge
doneTriggerScriptId string {doneTriggerTargetType} == “gs2_script” ~ 1024 chars GS2-Script script GRN for asynchronous execution
Must be specified in GRN format starting with “grn:gs2:”.
* Enabled only if doneTriggerTargetType is “gs2_script”
doneTriggerQueueNamespaceId string {doneTriggerTargetType} == “gs2_script” ~ 1024 chars GS2-JobQueue namespace GRN to execute asynchronous execution scripts
If you want to execute asynchronous execution scripts via GS2-JobQueue instead of executing them directly, specify the GS2-JobQueue namespace GRN.
There are not many cases where GS2-JobQueue is required, so you generally do not need to specify it unless you have a specific reason.
* Enabled only if doneTriggerTargetType is “gs2_script”

NotificationSetting

Push Notification Setting

Configuration for sending push notifications when events occur in GS2 microservices. The push notification here refers to the processing via the WebSocket interface provided by GS2-Gateway, and is different from the push notification of a smartphone. For example, when matchmaking is completed or a friend request is received, the GS2-Gateway can send a push notification via the WebSocket interface, and the game client can detect the change of the state.

GS2-Gateway’s push notifications can be used to forward notifications to mobile push notification services when the destination device is offline. By properly utilizing mobile push notifications, you can implement a flow in which players are notified even if they exit the game during matchmaking and later return to it.

Details
Type Condition Required Default Value Limits Description
gatewayNamespaceId string “grn:gs2:{region}:{ownerId}:gateway:default” ~ 1024 chars GS2-Gateway namespace to use for push notifications
Specify the GS2-Gateway namespace ID in GRN format starting with “grn:gs2:”.
enableTransferMobileNotification bool? false Whether to forward the notification as a mobile push notification
When an attempt is made to send this notification and the destination device is offline, specify whether it should be forwarded as a mobile push notification.
sound string {enableTransferMobileNotification} == true ~ 1024 chars Sound file name to be used for mobile push notifications
The sound file name specified here is used when sending mobile push notifications, and you can send notifications with a special sound.
* Enabled only if enableTransferMobileNotification is true
enable string (enum)
enum {
  “Enabled”,
  “Disabled”
}
“Enabled” Whether to enable push notifications
DefinitionDescription
“Enabled”Enabled
“Disabled”Disabled

LogSetting

Log Output Setting

Log Output Setting defines how log data is exported. This type holds the GS2-Log namespace identifier (Namespace ID), which is used to export log data. Specify the GS2-Log namespace where log data is collected and stored in the GRN format for the Log Namespace ID (loggingNamespaceId). Configuring this setting ensures that log data for API requests and responses occurring within the specified namespace is output to the target GS2-Log namespace. GS2-Log provides real-time logs that can be used for system monitoring, analysis, debugging, and other operational purposes.

Details
Type Condition Required Default Value Limits Description
loggingNamespaceId string
~ 1024 chars GS2-Log namespace GRN to output logs
Must be specified in GRN format starting with “grn:gs2:”.

GitHubCheckoutSetting

Setting for checking out master data from GitHub

Details
Type Condition Required Default Value Limits Description
apiKeyId string
~ 1024 chars GitHub API Key GRN
repositoryName string
~ 1024 chars Repository Name
sourcePath string
~ 1024 chars Master data (JSON) file path
referenceType string (enum)
enum {
  “commit_hash”,
  “branch”,
  “tag”
}
Source of code
DefinitionDescription
“commit_hash”Commit hash
“branch”Branch
“tag”Tag
commitHash string {referenceType} == “commit_hash”
✓*
~ 1024 chars Commit hash
* Required if referenceType is “commit_hash”
branchName string {referenceType} == “branch”
✓*
~ 1024 chars Branch Name
* Required if referenceType is “branch”
tagName string {referenceType} == “tag”
✓*
~ 1024 chars Tag Name
* Required if referenceType is “tag”

Wallet

Wallet

Currency in the wallet is managed separately for currency purchased for a fee and currency obtained for free. Currency purchased for a fee is further managed by the unit price at the time of purchase, allowing for refunds in the event of service termination, or to determine if the balance is sufficient to meet the requirements of the Funds Settlement Act.

The wallet has slots and each slot has a different balance. If balances cannot be shared across platforms, they can be managed separately by using different slots for each platform. Currency acquired for free can also be shared across all platforms.

Details
Type Condition Required Default Value Limits Description
walletId string
*
~ 1024 chars Wallet GRN
* Set automatically by the server
userId string
~ 128 chars User ID
slot int
0 ~ 100000000 Slot Number
Identifies the wallet slot. Different slots can be used to manage currency separately per platform (e.g., one slot for iOS, another for Android) when cross-platform balance sharing is not allowed.
summary WalletSummary
Wallet Status
A summary of the wallet’s current balance, broken down into paid currency, free currency, and total amounts. Calculated from the deposit transactions.
depositTransactions List<DepositTransaction> [] 0 ~ 1000 items List of deposit transactions
Records of all deposits into this wallet. Each transaction tracks the purchase price, currency code, quantity, and deposit time. Paid deposits (price > 0) are managed per unit price for refund calculation and regulatory compliance.
sharedFreeCurrency bool
Share free currency
Indicates whether the free currency in this wallet is shared across all slots. Inherited from the namespace setting at wallet creation time.
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server
updatedAt long
*
Current time Last Updated Timestamp
Unix time, milliseconds
* Set automatically by the server
revision long 0 0 ~ 9223372036854775805 Revision

Event

Event

Event are entities that record payment history. Payment history includes not only requests for increases or decreases in billing currency, but also the history of payment transactions on various delivery platforms.

Details
Type Condition Required Default Value Limits Description
eventId string
*
~ 1024 chars Event GRN
* Set automatically by the server
transactionId string
~ 1024 chars Transaction ID
The unique identifier for this payment event. Corresponds to the store platform’s transaction ID for receipt verification events.
userId string
~ 128 chars User ID
eventType string (enum)
enum {
  “VerifyReceipt”,
  “Deposit”,
  “Withdraw”,
  “Refund”
}
Event Type
The type of payment event. “VerifyReceipt” records store receipt verification, “Deposit” records currency additions, “Withdraw” records currency consumption, and “Refund” records refund processing.
DefinitionDescription
“VerifyReceipt”Verify Receipt
“Deposit”Deposit
“Withdraw”Withdraw
“Refund”Refunded
verifyReceiptEvent VerifyReceiptEvent Verify Receipt Event
Details of the receipt verification event. Set when eventType is “VerifyReceipt”. Contains the store content name, platform, and platform-specific verification results.
depositEvent DepositEvent Deposit Event
Details of the deposit event. Set when eventType is “Deposit”. Contains the wallet slot, deposit transactions, and resulting wallet status.
withdrawEvent WithdrawEvent Withdraw Event
Details of the withdraw event. Set when eventType is “Withdraw”. Contains the wallet slot, withdrawal details, and resulting wallet status.
refundEvent RefundEvent Refund Event
Details of the refund event. Set when eventType is “Refund”. Contains the store content name, platform, and platform-specific refund information.
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server
revision long 0 0 ~ 9223372036854775805 Revision

SubscribeTransaction

Subscription purchase information

Represents a subscription purchase record from a store platform. Tracks the detailed subscription status through its lifecycle including active, trial, intro offer, grace period, canceled, expired, and revoked states. Each transaction is linked to a specific store platform and user.

Details
Type Condition Required Default Value Limits Description
subscribeTransactionId string
*
~ 1024 chars Subscription Transaction GRN
* Set automatically by the server
contentName string
~ 128 chars Store Subscription Content Model name
transactionId string
~ 1024 chars Transaction ID
The unique transaction identifier assigned by the store platform. Used to prevent duplicate processing of the same purchase.
store string (enum)
enum {
  “AppleAppStore”,
  “GooglePlay”,
  “fake”
}
Store
The store platform where the purchase was made. Determines which verification method is used for receipt validation.
DefinitionDescription
“AppleAppStore”Apple App Store
“GooglePlay”Google Play
“fake”Fake
userId string ~ 128 chars User ID
statusDetail string (enum)
enum {
  “active@active”,
  “active@converted_from_trial”,
  “active@in_trial”,
  “active@in_intro_offer”,
  “grace@canceled”,
  “grace@grace_period”,
  “grace@on_hold”,
  “inactive@expired”,
  “inactive@revoked”
}
Status
The detailed subscription status. Prefixed with the simplified category (active/grace/inactive) followed by the specific state. Active states indicate the subscription is usable; grace states indicate payment issues but temporary access; inactive states indicate the subscription is no longer valid.
DefinitionDescription
“active@active”Active
“active@converted_from_trial”Converted from free trial to paid plan
“active@in_trial”In free trial
“active@in_intro_offer”In introductory offer
“grace@canceled”User has manually canceled
“grace@grace_period”The payment failed, but it is within the grace period.
“grace@on_hold”Payment has failed. If payment is not completed within a specified period, the service will be unavailable.
“inactive@expired”Subscription has expired
“inactive@revoked”Subscription has been revoked
expiresAt long
Expiration time
The timestamp at which this subscription transaction expires. Updated when the subscription is renewed by the store platform.
lastAllocatedAt long Last time allocated to user
The timestamp when this subscription transaction was last assigned to a user. Used with reallocateSpanDays to determine if the subscription can be reassigned to a different user.
lastTakeOverAt long Last time taken over by user
The timestamp when the user associated with this subscription was last changed (taken over). Tracks account transfer history for the subscription.
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server
updatedAt long
*
Current time Last Updated Timestamp
Unix time, milliseconds
* Set automatically by the server
revision long 0 0 ~ 9223372036854775805 Revision

SubscriptionStatus

Subscription status

Tracks a user’s subscription contract status for a specific subscription content. Provides a simplified active/inactive status derived from the detailed subscription transaction states, along with the expiration time and the list of associated subscription transactions.

Details
Type Condition Required Default Value Limits Description
userId string ~ 128 chars User ID
contentName string
~ 128 chars Store Subscription Content Model name
status string (enum)
enum {
  “active”,
  “inactive”
}
Status
The simplified subscription status. “active” includes active, trial, intro offer, and grace period states. “inactive” includes expired and revoked states.
DefinitionDescription
“active”Active
“inactive”Inactive
expiresAt long
Expiration time
The timestamp at which the subscription expires. Updated when the subscription is renewed or its status changes.
detail List<SubscribeTransaction> [] 0 ~ 100 items Subscription status details
The list of subscription transactions associated with this subscription. Each transaction represents a purchase record from a store platform with detailed status information (active, trial, grace period, expired, revoked, etc.).

RefundHistory

Refund history information

Records a refund event with the date, user, and details of the refund. Tracks refund transactions processed by store platforms (Apple App Store, Google Play).

Details
Type Condition Required Default Value Limits Description
refundHistoryId string
*
~ 1024 chars Subscription Transaction GRN
* Set automatically by the server
transactionId string
~ 1024 chars Transaction ID
The unique transaction identifier assigned by the store platform. Used to prevent duplicate processing of the same purchase.
year int
2000 ~ 3000 Year
month int
1 ~ 12 Month
day int
1 ~ 31 Day
userId string ~ 128 chars User ID
detail RefundEvent
Refund event information
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server

DailyTransactionHistory

Daily Transaction History

Aggregates daily transaction data including total deposit amounts (revenue), withdrawal amounts (consumption), issued currency count, and consumed currency count, broken down by currency code. Used for financial reporting and monitoring.

Details
Type Condition Required Default Value Limits Description
dailyTransactionHistoryId string
*
~ 1024 chars Transaction History of Daily Transactions GRN
* Set automatically by the server
year int
2000 ~ 3000 Year
month int
1 ~ 12 Month
day int
1 ~ 31 Day
currency string
~ 8 chars Currency Code
depositAmount double 0 0 ~ 281474976710654 Deposit Amount
The total real-money amount deposited (revenue) on this day, in the specified currency.
withdrawAmount double 0 0 ~ 281474976710654 Withdraw Amount
The total real-money equivalent of currency consumed (withdrawn) on this day, calculated from the per-unit price of each consumed deposit transaction.
issueCount long 0 0 ~ 9223372036854775805 Issue Count
The total number of virtual currency units deposited (issued) on this day, including both paid and free currency.
consumeCount long 0 0 ~ 9223372036854775805 Consume Count
The total number of virtual currency units consumed (withdrawn) on this day.
updatedAt long
*
Current time Last Updated Timestamp
Unix time, milliseconds
* Set automatically by the server
revision long 0 0 ~ 9223372036854775805 Revision

UnusedBalance

Unused Balance

Entity that holds the Unused Balance of billing currency for each currency.

Details
Type Condition Required Default Value Limits Description
unusedBalanceId string
*
~ 1024 chars Unused Balance GRN
* Set automatically by the server
currency string
~ 8 chars Currency Code
The ISO currency code (e.g., “JPY”, “USD”) for which the unused balance is tracked.
balance double
0 ~ 16777214 Unused balance
The total monetary value of paid currency that remains unused across all users, denominated in the specified currency. Used for compliance with the Funds Settlement Act and similar regulations.
updatedAt long
*
Current time Last Updated Timestamp
Unix time, milliseconds
* Set automatically by the server
revision long 0 0 ~ 9223372036854775805 Revision

StoreContentModel

Store Content Model

This is a model for storing content from various store platforms.

Details
Type Condition Required Default Value Limits Description
storeContentModelId string
*
~ 1024 chars Store Content Model GRN
* Set automatically by the server
name string
~ 128 chars Store Content Model name
metadata string ~ 1024 chars Metadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
appleAppStore AppleAppStoreContent Apple AppStore Content
The Apple App Store product information (product ID) for this store content. Used during receipt verification to match the purchased product.
googlePlay GooglePlayContent Google Play Content
The Google Play product information (product ID) for this store content. Used during receipt verification to match the purchased product.

StoreSubscriptionContentModel

Store Subscription Content Model

This is a model for storing subscription-based content from various store platforms.

Details
Type Condition Required Default Value Limits Description
storeSubscriptionContentModelId string
*
~ 1024 chars Subscription Content Model GRN
* Set automatically by the server
name string
~ 128 chars Store Subscription Content Model name
metadata string ~ 1024 chars Metadata
scheduleNamespaceId string
~ 1024 chars Namespace GRN of GS2-Schedule to link the subscription period
triggerName string
~ 128 chars Trigger name to reflect the subscription period
The name of the GS2-Schedule trigger that will be activated to reflect the subscription’s active period. The trigger duration is set to the subscription’s expiration time.
triggerExtendMode string (enum)
enum {
  “just”,
  “rollupHour”
}
“just” Mode to reflect the subscription period on the trigger
Controls how the subscription expiration is mapped to the trigger duration. “just” uses the exact subscription period. “rollupHour” extends the period to the next specified hour (UTC) to avoid mid-day expirations.
DefinitionDescription
“just”Reflect the subscription period as it is
“rollupHour”Extend the subscription period to the next day crossing time
rollupHour int {triggerExtendMode} == “rollupHour” 0 0 ~ 23 Hour of the day to roll up the subscription period (UTC)
When triggerExtendMode is “rollupHour”, the subscription period is extended to this hour (0-23, UTC) on the expiration day. This prevents subscriptions from expiring in the middle of a user’s play session.
* Enabled only if triggerExtendMode is “rollupHour”
reallocateSpanDays int 30 0 ~ 365 Time span (days) that allows subscription contract information to be assigned to other users
The number of days after the last allocation before a subscription contract can be reassigned to a different user. This prevents abuse when users change accounts, by enforcing a waiting period before the subscription can be transferred.
appleAppStore AppleAppStoreSubscriptionContent Apple AppStore Content
The Apple App Store subscription information (subscription group identifier) for this subscription content.
googlePlay GooglePlaySubscriptionContent Google Play Content
The Google Play subscription information (product ID) for this subscription content.

Receipt

Receipt of store platform

Represents a purchase receipt from a store platform (Apple App Store, Google Play, or Fake for testing). Contains the transaction ID and payload data needed for server-side receipt verification.

Details
Type Condition Required Default Value Limits Description
Store string (enum)
enum {
  “AppleAppStore”,
  “GooglePlay”,
  “fake”
}
Store
The store platform where the purchase was made. Determines which verification method is used for receipt validation.
DefinitionDescription
“AppleAppStore”Apple App Store
“GooglePlay”Google Play
“fake”Fake
TransactionID string
~ 1024 chars Transaction ID
The unique transaction identifier assigned by the store platform. Used to prevent duplicate processing of the same purchase.
Payload string
~ 1048576 chars Payload
The receipt data from the store platform. The format varies by platform: for Apple App Store, this is the transaction receipt; for Google Play, this is the purchase token and related data.

PlatformSetting

Platform Setting

Aggregates the settings for all supported store platforms. Contains configuration for Apple App Store, Google Play, and Fake (for testing in Unity Editor). Each platform setting includes the credentials and keys necessary for receipt verification.

Details
Type Condition Required Default Value Limits Description
appleAppStore AppleAppStoreSetting Apple AppStore Setting
Credentials for Apple App Store receipt verification, including bundle ID, shared secret key, issuer ID, key ID, and private key.
googlePlay GooglePlaySetting Google Play Setting
Credentials for Google Play receipt verification, including the package name and public key for signature verification.
fake FakeSetting Fake (Unity Editor) Setting
Configuration for accepting fake receipts generated by Unity Editor during development and testing.

AppleAppStoreSetting

Apple AppStore Setting

Configuration for verifying Apple App Store receipts. Contains the credentials required to communicate with Apple’s receipt verification servers, including the bundle ID, shared secret, App Store Connect issuer ID, key ID, and private key.

Details
Type Condition Required Default Value Limits Description
bundleId string ~ 1024 chars Apple AppStore Bundle ID
sharedSecretKey string ~ 1024 chars Shared secret key used to encrypt the receipt issued by AppStore Connect
issuerId string ~ 1024 chars Issuer ID of in-app purchases registered with AppStore Connect
keyId string ~ 1024 chars Key ID registered with Apple
privateKeyPem string ~ 10240 chars Private Key received from Apple

GooglePlaySetting

Google Play Setting

Configuration for verifying Google Play receipts. Contains the package name and public key required for validating purchase signatures from Google Play.

Details
Type Condition Required Default Value Limits Description
packageName string ~ 5120 chars Package Name to be distributed on Google Play
publicKey string ~ 5120 chars Public key used for signature verification

FakeSetting

Fake Setting for Debug

Configuration for handling fake receipts generated by Unity Editor during development. Controls whether fake receipts are accepted or rejected, allowing developers to test in-app purchase flows without real store platforms.

Details
Type Condition Required Default Value Limits Description
acceptFakeReceipt string (enum)
enum {
  “Accept”,
  “Reject”
}
“Reject” Whether to allow payments using fake receipts output by Unity Editor
Controls acceptance of fake receipts. Should be set to “Accept” during development/testing and “Reject” in production to prevent unauthorized currency deposits.
DefinitionDescription
“Accept”Accept
“Reject”Reject

WalletSummary

Wallet Status

A summary view of a wallet’s currency balance, separating paid and free amounts. Calculated by aggregating all deposit transactions in the wallet based on their price (paid if price > 0, free if price = 0).

Details
Type Condition Required Default Value Limits Description
paid int 0 0 ~ 2147483646 Count of paid currency
The total amount of currency that was purchased with real money (deposit transactions with price > 0).
free int 0 0 ~ 2147483646 Count of free currency
The total amount of currency obtained for free (deposit transactions with price = 0), such as login bonuses or event rewards.
total int 0 0 ~ 2147483646 Total
The total currency balance (paid + free). Represents the overall available amount in the wallet.

DepositTransaction

Deposit Transaction

Represents a single deposit record in the wallet. Paid deposits (price > 0) are tracked per unit price to enable accurate refund calculations and compliance with the Funds Settlement Act. Free deposits (price = 0) are tracked separately. When withdrawing, deposit transactions are consumed based on the namespace’s currency usage priority.

Details
Type Condition Required Default Value Limits Description
price double
0.0 ~ 100000000.0 Purchase Price
The real-money price paid for this deposit in the local currency. A value of 0 indicates free currency. Used to calculate per-unit cost for refund purposes.
currency string {price} > 0
✓*
~ 8 chars Currency Code
The ISO currency code (e.g., “JPY”, “USD”) of the real-money payment. Only applicable for paid deposits (price > 0).
* Required if price is greater than 0
count int
0 ~ 2147483646 Quantity of premium currency
The number of virtual currency units in this deposit. Decreases as currency is withdrawn from the wallet.
depositedAt long Deposit Date
The timestamp when this deposit was made.

VerifyReceiptEvent

Verify Receipt Event

Records the details of a store receipt verification, including which store content was verified, the platform used, and platform-specific verification results.

Details
Type Condition Required Default Value Limits Description
contentName string
~ 128 chars Store Content Model name
platform string (enum)
enum {
  “AppleAppStore”,
  “GooglePlay”,
  “fake”
}
Store Platform
The store platform from which the receipt was issued. Determines which verification flow was used.
DefinitionDescription
“AppleAppStore”Apple AppStore
“GooglePlay”Google Play
“fake”Fake
appleAppStoreVerifyReceiptEvent AppleAppStoreVerifyReceiptEvent Apple AppStore Verify Receipt Event
Verification result from the Apple App Store. Contains the environment (sandbox or production) information. Set when platform is “AppleAppStore”.
googlePlayVerifyReceiptEvent GooglePlayVerifyReceiptEvent Google Play Verify Receipt Event
Verification result from Google Play. Contains the purchase token. Set when platform is “GooglePlay”.

DepositEvent

Deposit Event

Records the details of a currency deposit into a wallet, including the deposit transactions and the wallet’s status after the deposit.

Details
Type Condition Required Default Value Limits Description
slot int
0 ~ 100000000 Slot Number
Identifies the wallet slot. Different slots can be used to manage currency separately per platform (e.g., one slot for iOS, another for Android) when cross-platform balance sharing is not allowed.
depositTransactions List<DepositTransaction> [] 0 ~ 1000 items List of deposit transactions
The deposit transactions that were added to the wallet in this event.
status WalletSummary
Wallet Status
The wallet’s balance summary (paid, free, total) after the deposit was applied.

WithdrawEvent

Withdraw Event

Records the details of a currency withdrawal from a wallet, including the breakdown of consumed deposit transactions and the wallet’s status after the withdrawal.

Details
Type Condition Required Default Value Limits Description
slot int
0 ~ 100000000 Slot Number
Identifies the wallet slot. Different slots can be used to manage currency separately per platform (e.g., one slot for iOS, another for Android) when cross-platform balance sharing is not allowed.
withdrawDetails List<DepositTransaction> [] 0 ~ 1000 items List of details of the withdrawn wallet
The breakdown of deposit transactions from which currency was consumed. Shows which deposits (paid or free, at what unit price) were drawn from.
status WalletSummary
Wallet Status
The wallet’s balance summary (paid, free, total) after the withdrawal was applied.

RefundEvent

Refund Event

Records the details of a refund event, including which store content was refunded, the platform where the refund was processed, and platform-specific refund information.

Details
Type Condition Required Default Value Limits Description
contentName string
~ 128 chars Store Content Model name
platform string (enum)
enum {
  “AppleAppStore”,
  “GooglePlay”,
  “fake”
}
Store Platform
The store platform from which the refund was issued.
DefinitionDescription
“AppleAppStore”Apple AppStore
“GooglePlay”Google Play
“fake”Fake
appleAppStoreRefundEvent AppleAppStoreVerifyReceiptEvent Apple AppStore Verify Receipt Event
googlePlayRefundEvent GooglePlayVerifyReceiptEvent Google Play Verify Receipt Event

AppleAppStoreVerifyReceiptEvent

Apple AppStore Receipt

Contains the result of an Apple App Store receipt verification, including the environment (sandbox or production) in which the purchase was made.

Details
Type Condition Required Default Value Limits Description
environment string (enum)
enum {
  “sandbox”,
  “production”
}
Environment
The Apple App Store environment where the receipt was generated. “sandbox” indicates a test purchase, “production” indicates a real purchase.
DefinitionDescription
“sandbox”Sandbox
“production”Production

GooglePlayVerifyReceiptEvent

Google Play Receipt Verification Event

Contains the result of a Google Play receipt verification, including the purchase token used to validate the purchase.

Details
Type Condition Required Default Value Limits Description
purchaseToken string ~ 4096 chars Purchase Token
The purchase token returned by Google Play after a successful purchase. Used to verify and acknowledge the purchase with Google Play’s servers.

AppleAppStoreContent

Content of Apple AppStore

Contains the Apple App Store product ID that corresponds to an in-app purchase product. Used to match receipts during verification.

Details
Type Condition Required Default Value Limits Description
productId string ~ 1024 chars Product ID
The Apple App Store product identifier registered in App Store Connect for this in-app purchase item.

GooglePlayContent

Content of Google Play

Contains the Google Play product ID that corresponds to an in-app purchase product. Used to match receipts during verification.

Details
Type Condition Required Default Value Limits Description
productId string ~ 1024 chars Product ID
The Google Play product identifier registered in Google Play Console for this in-app purchase item.

AppleAppStoreSubscriptionContent

Subscription content of Apple AppStore

Contains the Apple App Store subscription group identifier for subscription-based products. Used to manage and verify auto-renewable subscriptions.

Details
Type Condition Required Default Value Limits Description
subscriptionGroupIdentifier string ~ 64 chars Subscription Group ID
The subscription group identifier registered in App Store Connect. Subscriptions within the same group are mutually exclusive, meaning a user can only subscribe to one at a time.

GooglePlaySubscriptionContent

Google Play Subscription Content

Contains the Google Play product ID for subscription-based products. Used to manage and verify auto-renewable subscriptions on Google Play.

Details
Type Condition Required Default Value Limits Description
productId string ~ 1024 chars Product ID

GooglePlayRealtimeNotificationMessage

RTDN Message

Represents a Google Play Real-Time Developer Notification (RTDN) message. RTDN messages are sent by Google Play to notify the server of subscription state changes such as renewals, cancellations, and expirations.

Details
Type Condition Required Default Value Limits Description
data string
~ 1048576 chars Data
The base64-encoded notification payload containing subscription state change information from Google Play.
messageId string
~ 1024 chars Message ID
The unique identifier for this RTDN message. Used for deduplication.
publishTime string
~ 1024 chars Publish Time
The timestamp when the notification was published, in RFC 3339 format.

CurrentModelMaster

Currently active Models master data

This master data defines the Models currently active within the namespace. GS2 uses JSON format files for managing master data. By uploading these files, the master data are updated on the server.

To create JSON files, GS2 provides a master data editor within the management console. Additionally, you can create tools better suited for game operations and export JSON files in the appropriate format.

Details
Type Condition Required Default Value Limits Description
namespaceId string
*
~ 1024 chars Namespace GRN
* Set automatically by the server
settings string
~ 5242880 bytes (5MB) Master Data

StoreContentModelMaster

Store Content Model Master

The Store Content Model is a model that stores content from various store platforms.

Details
Type Condition Required Default Value Limits Description
storeContentModelId string
*
~ 1024 chars Content Model Master GRN
* Set automatically by the server
name string
~ 128 chars Store Content Model name
description string ~ 1024 chars Description
metadata string ~ 1024 chars Metadata
appleAppStore AppleAppStoreContent Apple AppStore Content
The Apple App Store product information (product ID) for this store content. Used during receipt verification to match the purchased product.
googlePlay GooglePlayContent Google Play Content
The Google Play product information (product ID) for this store content. Used during receipt verification to match the purchased product.
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server
updatedAt long
*
Current time Last Updated Timestamp
Unix time, milliseconds
* Set automatically by the server
revision long 0 0 ~ 9223372036854775805 Revision

StoreSubscriptionContentModelMaster

Store Subscription Content Model Master

The Store Subscription Content Model is a model that stores subscription-based content from various store platforms.

Details
Type Condition Required Default Value Limits Description
storeSubscriptionContentModelId string
*
~ 1024 chars Subscription Content Model Master GRN
* Set automatically by the server
name string
~ 128 chars Store Subscription Content Model name
description string ~ 1024 chars Description
metadata string ~ 1024 chars Metadata
scheduleNamespaceId string
~ 1024 chars Namespace GRN of GS2-Schedule to link the subscription period
triggerName string
~ 128 chars Trigger name to reflect the subscription period
The name of the GS2-Schedule trigger that will be activated to reflect the subscription’s active period. The trigger duration is set to the subscription’s expiration time.
reallocateSpanDays int 30 0 ~ 365 Time span (days) that allows subscription contract information to be assigned to other users
The number of days after the last allocation before a subscription contract can be reassigned to a different user. This prevents abuse when users change accounts, by enforcing a waiting period before the subscription can be transferred.
triggerExtendMode string (enum)
enum {
  “just”,
  “rollupHour”
}
“just” Mode to reflect the subscription period on the trigger
Controls how the subscription expiration is mapped to the trigger duration. “just” uses the exact subscription period. “rollupHour” extends the period to the next specified hour (UTC) to avoid mid-day expirations.
DefinitionDescription
“just”Reflect the subscription period as it is
“rollupHour”Extend the subscription period to the next day crossing time
rollupHour int {triggerExtendMode} == “rollupHour” 0 0 ~ 23 Hour of the day to roll up the subscription period (UTC)
When triggerExtendMode is “rollupHour”, the subscription period is extended to this hour (0-23, UTC) on the expiration day. This prevents subscriptions from expiring in the middle of a user’s play session.
* Enabled only if triggerExtendMode is “rollupHour”
appleAppStore AppleAppStoreSubscriptionContent Apple AppStore Content
The Apple App Store subscription information (subscription group identifier) for this subscription content.
googlePlay GooglePlaySubscriptionContent Google Play Content
The Google Play subscription information (product ID) for this subscription content.
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server
updatedAt long
*
Current time Last Updated Timestamp
Unix time, milliseconds
* Set automatically by the server
revision long 0 0 ~ 9223372036854775805 Revision

Methods

describeNamespaces

Get a list of Namespaces

Retrieves a list of namespaces that have been created on a per-service basis within the project. You can use the optional page token to start acquiring data from a specific location in the list. You can also limit the number of namespaces to be acquired.

Details

Request

Type Condition Required Default Value Limits Description
namePrefix string ~ 64 chars Filter by Namespace name prefix
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data items to retrieve

Result

Type Description
items List<Namespace> List of Namespaces
nextPageToken string Page token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.DescribeNamespaces(
    &money2.DescribeNamespacesRequest {
        NamePrefix: nil,
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\DescribeNamespacesRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->describeNamespaces(
        (new DescribeNamespacesRequest())
            ->withNamePrefix(null)
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.DescribeNamespacesRequest;
import io.gs2.money2.result.DescribeNamespacesResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    DescribeNamespacesResult result = client.describeNamespaces(
        new DescribeNamespacesRequest()
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<Namespace> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
    new Gs2.Gs2Money2.Request.DescribeNamespacesRequest()
        .WithNamePrefix(null)
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.describeNamespaces(
        new Gs2Money2.DescribeNamespacesRequest()
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.describe_namespaces(
        money2.DescribeNamespacesRequest()
            .with_name_prefix(None)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.describe_namespaces({
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('money2')

api_result_handler = client.describe_namespaces_async({
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

createNamespace

Create a new Namespace

You must specify detailed information including the name, description, and various settings of the namespace.

Details

Request

Type Condition Required Default Value Limits Description
name string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
currencyUsagePriority string (enum)
enum {
  “PrioritizeFree”,
  “PrioritizePaid”
}
Consumption priority
Determines the order in which paid and free currency are consumed when withdrawing from the wallet. “PrioritizeFree” consumes free currency first, while “PrioritizePaid” consumes paid currency first.
DefinitionDescription
“PrioritizeFree”Prioritize the use of free currency
“PrioritizePaid”Prioritize the use of paid currency
description string ~ 1024 chars Description
transactionSetting TransactionSetting Transaction Setting
Settings for distributed transactions used when depositing or withdrawing currency.
sharedFreeCurrency bool
Share the free currency with different slots
When enabled, free currency balance is shared across all wallet slots (platforms). Paid currency remains separate per slot. This setting can only be configured at namespace creation time and cannot be changed later.
platformSetting PlatformSetting
Store platform settings
Configuration for each supported store platform (Apple App Store, Google Play, Fake for testing). Includes credentials and keys required for receipt verification on each platform.
depositBalanceScript ScriptSetting Script setting to be executed when depositing wallet balance
Script Trigger Reference - deposit
withdrawBalanceScript ScriptSetting Script setting to be executed when withdrawing wallet balance
Script Trigger Reference - withdraw
verifyReceiptScript ScriptSetting Script setting to be executed when verifying a receipt
Script Trigger Reference - verifyReceipt
subscribeScript string ~ 1024 chars GS2-Script script GRN to be executed when subscribing to a new contract(Not called when the user associated with the subscription is changed / Called when re-subscribing after contract expiration)
Script Trigger Reference - subscribe
renewScript string ~ 1024 chars GS2-Script script GRN to be executed when renewing a contract
Script Trigger Reference - renew
unsubscribeScript string ~ 1024 chars GS2-Script script GRN to be executed when unsubscribing from a contract(Not called when the user associated with the subscription is changed)
Script Trigger Reference - unsubscribe
takeOverScript ScriptSetting Script setting to be executed when taking over a contract
Script Trigger Reference - takeOver
changeSubscriptionStatusNotification NotificationSetting Push notification when the subscription status changes
Configures push notifications delivered via GS2-Gateway when a subscription status changes (e.g., activated, renewed, canceled, expired, or revoked). Allows the game client to respond to subscription state transitions in real-time.
logSetting LogSetting Log Output Setting
Specifies the GS2-Log namespace to which API request and response logs for this namespace will be output. Useful for tracking deposits, withdrawals, receipt verifications, and subscription events.

Result

Type Description
item Namespace Namespace created

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.CreateNamespace(
    &money2.CreateNamespaceRequest {
        Name: pointy.String("namespace-0001"),
        CurrencyUsagePriority: pointy.String("PrioritizeFree"),
        Description: nil,
        TransactionSetting: nil,
        SharedFreeCurrency: pointy.Bool(false),
        PlatformSetting: nil,
        DepositBalanceScript: nil,
        WithdrawBalanceScript: nil,
        VerifyReceiptScript: nil,
        SubscribeScript: nil,
        RenewScript: nil,
        UnsubscribeScript: nil,
        TakeOverScript: nil,
        ChangeSubscriptionStatusNotification: nil,
        LogSetting: &money2.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\CreateNamespaceRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->createNamespace(
        (new CreateNamespaceRequest())
            ->withName("namespace-0001")
            ->withCurrencyUsagePriority("PrioritizeFree")
            ->withDescription(null)
            ->withTransactionSetting(null)
            ->withSharedFreeCurrency(false)
            ->withPlatformSetting(null)
            ->withDepositBalanceScript(null)
            ->withWithdrawBalanceScript(null)
            ->withVerifyReceiptScript(null)
            ->withSubscribeScript(null)
            ->withRenewScript(null)
            ->withUnsubscribeScript(null)
            ->withTakeOverScript(null)
            ->withChangeSubscriptionStatusNotification(null)
            ->withLogSetting((new \Gs2\Money2\Model\LogSetting())
                ->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.CreateNamespaceRequest;
import io.gs2.money2.result.CreateNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    CreateNamespaceResult result = client.createNamespace(
        new CreateNamespaceRequest()
            .withName("namespace-0001")
            .withCurrencyUsagePriority("PrioritizeFree")
            .withDescription(null)
            .withTransactionSetting(null)
            .withSharedFreeCurrency(false)
            .withPlatformSetting(null)
            .withDepositBalanceScript(null)
            .withWithdrawBalanceScript(null)
            .withVerifyReceiptScript(null)
            .withSubscribeScript(null)
            .withRenewScript(null)
            .withUnsubscribeScript(null)
            .withTakeOverScript(null)
            .withChangeSubscriptionStatusNotification(null)
            .withLogSetting(new io.gs2.money2.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
    new Gs2.Gs2Money2.Request.CreateNamespaceRequest()
        .WithName("namespace-0001")
        .WithCurrencyUsagePriority("PrioritizeFree")
        .WithDescription(null)
        .WithTransactionSetting(null)
        .WithSharedFreeCurrency(false)
        .WithPlatformSetting(null)
        .WithDepositBalanceScript(null)
        .WithWithdrawBalanceScript(null)
        .WithVerifyReceiptScript(null)
        .WithSubscribeScript(null)
        .WithRenewScript(null)
        .WithUnsubscribeScript(null)
        .WithTakeOverScript(null)
        .WithChangeSubscriptionStatusNotification(null)
        .WithLogSetting(new Gs2.Gs2Money2.Model.LogSetting()
            .WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001")),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.createNamespace(
        new Gs2Money2.CreateNamespaceRequest()
            .withName("namespace-0001")
            .withCurrencyUsagePriority("PrioritizeFree")
            .withDescription(null)
            .withTransactionSetting(null)
            .withSharedFreeCurrency(false)
            .withPlatformSetting(null)
            .withDepositBalanceScript(null)
            .withWithdrawBalanceScript(null)
            .withVerifyReceiptScript(null)
            .withSubscribeScript(null)
            .withRenewScript(null)
            .withUnsubscribeScript(null)
            .withTakeOverScript(null)
            .withChangeSubscriptionStatusNotification(null)
            .withLogSetting(new Gs2Money2.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.create_namespace(
        money2.CreateNamespaceRequest()
            .with_name('namespace-0001')
            .with_currency_usage_priority('PrioritizeFree')
            .with_description(None)
            .with_transaction_setting(None)
            .with_shared_free_currency(False)
            .with_platform_setting(None)
            .with_deposit_balance_script(None)
            .with_withdraw_balance_script(None)
            .with_verify_receipt_script(None)
            .with_subscribe_script(None)
            .with_renew_script(None)
            .with_unsubscribe_script(None)
            .with_take_over_script(None)
            .with_change_subscription_status_notification(None)
            .with_log_setting(
                money2.LogSetting()
                    .with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.create_namespace({
    name="namespace-0001",
    currencyUsagePriority="PrioritizeFree",
    description=nil,
    transactionSetting=nil,
    sharedFreeCurrency=false,
    platformSetting=nil,
    depositBalanceScript=nil,
    withdrawBalanceScript=nil,
    verifyReceiptScript=nil,
    subscribeScript=nil,
    renewScript=nil,
    unsubscribeScript=nil,
    takeOverScript=nil,
    changeSubscriptionStatusNotification=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
    },
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.create_namespace_async({
    name="namespace-0001",
    currencyUsagePriority="PrioritizeFree",
    description=nil,
    transactionSetting=nil,
    sharedFreeCurrency=false,
    platformSetting=nil,
    depositBalanceScript=nil,
    withdrawBalanceScript=nil,
    verifyReceiptScript=nil,
    subscribeScript=nil,
    renewScript=nil,
    unsubscribeScript=nil,
    takeOverScript=nil,
    changeSubscriptionStatusNotification=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

getNamespaceStatus

Get Namespace status

Get the current status of the specified namespace. This includes whether the Namespace is active, pending, or in some other state.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
status string

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.GetNamespaceStatus(
    &money2.GetNamespaceStatusRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
status := result.Status
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\GetNamespaceStatusRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->getNamespaceStatus(
        (new GetNamespaceStatusRequest())
            ->withNamespaceName("namespace-0001")
    );
    $status = $result->getStatus();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.GetNamespaceStatusRequest;
import io.gs2.money2.result.GetNamespaceStatusResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    GetNamespaceStatusResult result = client.getNamespaceStatus(
        new GetNamespaceStatusRequest()
            .withNamespaceName("namespace-0001")
    );
    String status = result.getStatus();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
    new Gs2.Gs2Money2.Request.GetNamespaceStatusRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var status = result.Status;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.getNamespaceStatus(
        new Gs2Money2.GetNamespaceStatusRequest()
            .withNamespaceName("namespace-0001")
    );
    const status = result.getStatus();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.get_namespace_status(
        money2.GetNamespaceStatusRequest()
            .with_namespace_name('namespace-0001')
    )
    status = result.status
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.get_namespace_status({
    namespaceName="namespace-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
status = result.status;
client = gs2('money2')

api_result_handler = client.get_namespace_status_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
status = result.status;

getNamespace

Get a Namespace

Get detailed information about the specified namespace. This includes the name, description, and other settings of the namespace.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item Namespace Namespace

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.GetNamespace(
    &money2.GetNamespaceRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\GetNamespaceRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->getNamespace(
        (new GetNamespaceRequest())
            ->withNamespaceName("namespace-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.GetNamespaceRequest;
import io.gs2.money2.result.GetNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    GetNamespaceResult result = client.getNamespace(
        new GetNamespaceRequest()
            .withNamespaceName("namespace-0001")
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
    new Gs2.Gs2Money2.Request.GetNamespaceRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.getNamespace(
        new Gs2Money2.GetNamespaceRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.get_namespace(
        money2.GetNamespaceRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.get_namespace({
    namespaceName="namespace-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.get_namespace_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

updateNamespace

Update Namespace

Update the settings of the specified Namespace. You can change the description and other settings of the Namespace.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
currencyUsagePriority string (enum)
enum {
  “PrioritizeFree”,
  “PrioritizePaid”
}
Consumption priority
Determines the order in which paid and free currency are consumed when withdrawing from the wallet. “PrioritizeFree” consumes free currency first, while “PrioritizePaid” consumes paid currency first.
DefinitionDescription
“PrioritizeFree”Prioritize the use of free currency
“PrioritizePaid”Prioritize the use of paid currency
description string ~ 1024 chars Description
transactionSetting TransactionSetting Transaction Setting
Settings for distributed transactions used when depositing or withdrawing currency.
platformSetting PlatformSetting
Store platform settings
Configuration for each supported store platform (Apple App Store, Google Play, Fake for testing). Includes credentials and keys required for receipt verification on each platform.
depositBalanceScript ScriptSetting Script setting to be executed when depositing wallet balance
Script Trigger Reference - deposit
withdrawBalanceScript ScriptSetting Script setting to be executed when withdrawing wallet balance
Script Trigger Reference - withdraw
verifyReceiptScript ScriptSetting Script setting to be executed when verifying a receipt
Script Trigger Reference - verifyReceipt
subscribeScript string ~ 1024 chars GS2-Script script GRN to be executed when subscribing to a new contract(Not called when the user associated with the subscription is changed / Called when re-subscribing after contract expiration)
Script Trigger Reference - subscribe
renewScript string ~ 1024 chars GS2-Script script GRN to be executed when renewing a contract
Script Trigger Reference - renew
unsubscribeScript string ~ 1024 chars GS2-Script script GRN to be executed when unsubscribing from a contract(Not called when the user associated with the subscription is changed)
Script Trigger Reference - unsubscribe
takeOverScript ScriptSetting Script setting to be executed when taking over a contract
Script Trigger Reference - takeOver
changeSubscriptionStatusNotification NotificationSetting Push notification when the subscription status changes
Configures push notifications delivered via GS2-Gateway when a subscription status changes (e.g., activated, renewed, canceled, expired, or revoked). Allows the game client to respond to subscription state transitions in real-time.
logSetting LogSetting Log Output Setting
Specifies the GS2-Log namespace to which API request and response logs for this namespace will be output. Useful for tracking deposits, withdrawals, receipt verifications, and subscription events.

Result

Type Description
item Namespace Namespace updated

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.UpdateNamespace(
    &money2.UpdateNamespaceRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CurrencyUsagePriority: pointy.String("PrioritizePaid"),
        Description: pointy.String("description1"),
        TransactionSetting: nil,
        PlatformSetting: &money2.PlatformSetting{
        },
        DepositBalanceScript: &money2.ScriptSetting{
            TriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1003"),
            DoneTriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1004"),
        },
        WithdrawBalanceScript: &money2.ScriptSetting{
            TriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1005"),
            DoneTriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1006"),
        },
        VerifyReceiptScript: nil,
        SubscribeScript: nil,
        RenewScript: nil,
        UnsubscribeScript: nil,
        TakeOverScript: nil,
        ChangeSubscriptionStatusNotification: nil,
        LogSetting: &money2.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\UpdateNamespaceRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->updateNamespace(
        (new UpdateNamespaceRequest())
            ->withNamespaceName("namespace-0001")
            ->withCurrencyUsagePriority("PrioritizePaid")
            ->withDescription("description1")
            ->withTransactionSetting(null)
            ->withPlatformSetting((new \Gs2\Money2\Model\PlatformSetting()))
            ->withDepositBalanceScript((new \Gs2\Money2\Model\ScriptSetting())
                ->withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1003")
                ->withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1004"))
            ->withWithdrawBalanceScript((new \Gs2\Money2\Model\ScriptSetting())
                ->withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1005")
                ->withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1006"))
            ->withVerifyReceiptScript(null)
            ->withSubscribeScript(null)
            ->withRenewScript(null)
            ->withUnsubscribeScript(null)
            ->withTakeOverScript(null)
            ->withChangeSubscriptionStatusNotification(null)
            ->withLogSetting((new \Gs2\Money2\Model\LogSetting())
                ->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.UpdateNamespaceRequest;
import io.gs2.money2.result.UpdateNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    UpdateNamespaceResult result = client.updateNamespace(
        new UpdateNamespaceRequest()
            .withNamespaceName("namespace-0001")
            .withCurrencyUsagePriority("PrioritizePaid")
            .withDescription("description1")
            .withTransactionSetting(null)
            .withPlatformSetting(new io.gs2.money2.model.PlatformSetting())
            .withDepositBalanceScript(new io.gs2.money2.model.ScriptSetting()
                .withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1003")
                .withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1004"))
            .withWithdrawBalanceScript(new io.gs2.money2.model.ScriptSetting()
                .withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1005")
                .withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1006"))
            .withVerifyReceiptScript(null)
            .withSubscribeScript(null)
            .withRenewScript(null)
            .withUnsubscribeScript(null)
            .withTakeOverScript(null)
            .withChangeSubscriptionStatusNotification(null)
            .withLogSetting(new io.gs2.money2.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
    new Gs2.Gs2Money2.Request.UpdateNamespaceRequest()
        .WithNamespaceName("namespace-0001")
        .WithCurrencyUsagePriority("PrioritizePaid")
        .WithDescription("description1")
        .WithTransactionSetting(null)
        .WithPlatformSetting(new Gs2.Gs2Money2.Model.PlatformSetting())
        .WithDepositBalanceScript(new Gs2.Gs2Money2.Model.ScriptSetting()
            .WithTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1003")
            .WithDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1004"))
        .WithWithdrawBalanceScript(new Gs2.Gs2Money2.Model.ScriptSetting()
            .WithTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1005")
            .WithDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1006"))
        .WithVerifyReceiptScript(null)
        .WithSubscribeScript(null)
        .WithRenewScript(null)
        .WithUnsubscribeScript(null)
        .WithTakeOverScript(null)
        .WithChangeSubscriptionStatusNotification(null)
        .WithLogSetting(new Gs2.Gs2Money2.Model.LogSetting()
            .WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001")),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.updateNamespace(
        new Gs2Money2.UpdateNamespaceRequest()
            .withNamespaceName("namespace-0001")
            .withCurrencyUsagePriority("PrioritizePaid")
            .withDescription("description1")
            .withTransactionSetting(null)
            .withPlatformSetting(new Gs2Money2.model.PlatformSetting())
            .withDepositBalanceScript(new Gs2Money2.model.ScriptSetting()
                .withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1003")
                .withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1004"))
            .withWithdrawBalanceScript(new Gs2Money2.model.ScriptSetting()
                .withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1005")
                .withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1006"))
            .withVerifyReceiptScript(null)
            .withSubscribeScript(null)
            .withRenewScript(null)
            .withUnsubscribeScript(null)
            .withTakeOverScript(null)
            .withChangeSubscriptionStatusNotification(null)
            .withLogSetting(new Gs2Money2.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.update_namespace(
        money2.UpdateNamespaceRequest()
            .with_namespace_name('namespace-0001')
            .with_currency_usage_priority('PrioritizePaid')
            .with_description('description1')
            .with_transaction_setting(None)
            .with_platform_setting(
                money2.PlatformSetting())
            .with_deposit_balance_script(
                money2.ScriptSetting()
                    .with_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1003')
                    .with_done_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1004'))
            .with_withdraw_balance_script(
                money2.ScriptSetting()
                    .with_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1005')
                    .with_done_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1006'))
            .with_verify_receipt_script(None)
            .with_subscribe_script(None)
            .with_renew_script(None)
            .with_unsubscribe_script(None)
            .with_take_over_script(None)
            .with_change_subscription_status_notification(None)
            .with_log_setting(
                money2.LogSetting()
                    .with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.update_namespace({
    namespaceName="namespace-0001",
    currencyUsagePriority="PrioritizePaid",
    description="description1",
    transactionSetting=nil,
    platformSetting={
    },
    depositBalanceScript={
        triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1003",
        doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1004",
    },
    withdrawBalanceScript={
        triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1005",
        doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1006",
    },
    verifyReceiptScript=nil,
    subscribeScript=nil,
    renewScript=nil,
    unsubscribeScript=nil,
    takeOverScript=nil,
    changeSubscriptionStatusNotification=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
    },
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.update_namespace_async({
    namespaceName="namespace-0001",
    currencyUsagePriority="PrioritizePaid",
    description="description1",
    transactionSetting=nil,
    platformSetting={
    },
    depositBalanceScript={
        triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1003",
        doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1004",
    },
    withdrawBalanceScript={
        triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1005",
        doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1006",
    },
    verifyReceiptScript=nil,
    subscribeScript=nil,
    renewScript=nil,
    unsubscribeScript=nil,
    takeOverScript=nil,
    changeSubscriptionStatusNotification=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

deleteNamespace

Delete Namespace

Delete the specified Namespace. This operation is irreversible and all data associated with the deleted Namespace will be lost.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item Namespace The deleted Namespace

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.DeleteNamespace(
    &money2.DeleteNamespaceRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\DeleteNamespaceRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->deleteNamespace(
        (new DeleteNamespaceRequest())
            ->withNamespaceName("namespace-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.DeleteNamespaceRequest;
import io.gs2.money2.result.DeleteNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    DeleteNamespaceResult result = client.deleteNamespace(
        new DeleteNamespaceRequest()
            .withNamespaceName("namespace-0001")
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
    new Gs2.Gs2Money2.Request.DeleteNamespaceRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.deleteNamespace(
        new Gs2Money2.DeleteNamespaceRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.delete_namespace(
        money2.DeleteNamespaceRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.delete_namespace({
    namespaceName="namespace-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.delete_namespace_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

getServiceVersion

Get the microservice version

Details

Request

Request parameters: None

Result

Type Description
item string Version

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.GetServiceVersion(
    &money2.GetServiceVersionRequest {
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\GetServiceVersionRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->getServiceVersion(
        (new GetServiceVersionRequest())
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.GetServiceVersionRequest;
import io.gs2.money2.result.GetServiceVersionResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    GetServiceVersionResult result = client.getServiceVersion(
        new GetServiceVersionRequest()
    );
    String item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.GetServiceVersionResult> asyncResult = null;
yield return client.GetServiceVersion(
    new Gs2.Gs2Money2.Request.GetServiceVersionRequest(),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.getServiceVersion(
        new Gs2Money2.GetServiceVersionRequest()
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.get_service_version(
        money2.GetServiceVersionRequest()
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.get_service_version({
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.get_service_version_async({
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

dumpUserDataByUserId

Dump data associated with the specified user ID

Can be used to meet legal requirements for the protection of personal information, or to back up or migrate data.

Details

Request

Type Condition Required Default Value Limits Description
userId string
~ 128 chars User ID
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.DumpUserDataByUserId(
    &money2.DumpUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\DumpUserDataByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->dumpUserDataByUserId(
        (new DumpUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.DumpUserDataByUserIdRequest;
import io.gs2.money2.result.DumpUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    DumpUserDataByUserIdResult result = client.dumpUserDataByUserId(
        new DumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DumpUserDataByUserIdResult> asyncResult = null;
yield return client.DumpUserDataByUserId(
    new Gs2.Gs2Money2.Request.DumpUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.dumpUserDataByUserId(
        new Gs2Money2.DumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.dump_user_data_by_user_id(
        money2.DumpUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.dump_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
client = gs2('money2')

api_result_handler = client.dump_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result

checkDumpUserDataByUserId

Check if the dump of the data associated with the specified user ID is complete

Details

Request

Type Condition Required Default Value Limits Description
userId string
~ 128 chars User ID
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
url string URL of output data

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.CheckDumpUserDataByUserId(
    &money2.CheckDumpUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
url := result.Url
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\CheckDumpUserDataByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->checkDumpUserDataByUserId(
        (new CheckDumpUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $url = $result->getUrl();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.CheckDumpUserDataByUserIdRequest;
import io.gs2.money2.result.CheckDumpUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    CheckDumpUserDataByUserIdResult result = client.checkDumpUserDataByUserId(
        new CheckDumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    String url = result.getUrl();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.CheckDumpUserDataByUserIdResult> asyncResult = null;
yield return client.CheckDumpUserDataByUserId(
    new Gs2.Gs2Money2.Request.CheckDumpUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var url = result.Url;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.checkDumpUserDataByUserId(
        new Gs2Money2.CheckDumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const url = result.getUrl();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.check_dump_user_data_by_user_id(
        money2.CheckDumpUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    url = result.url
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.check_dump_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
url = result.url;
client = gs2('money2')

api_result_handler = client.check_dump_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
url = result.url;

cleanUserDataByUserId

Delete user data

Execute cleaning of data associated with the specified user ID This allows you to safely delete specific user data from the project.

Details

Request

Type Condition Required Default Value Limits Description
userId string
~ 128 chars User ID
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.CleanUserDataByUserId(
    &money2.CleanUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\CleanUserDataByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->cleanUserDataByUserId(
        (new CleanUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.CleanUserDataByUserIdRequest;
import io.gs2.money2.result.CleanUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    CleanUserDataByUserIdResult result = client.cleanUserDataByUserId(
        new CleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.CleanUserDataByUserIdResult> asyncResult = null;
yield return client.CleanUserDataByUserId(
    new Gs2.Gs2Money2.Request.CleanUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.cleanUserDataByUserId(
        new Gs2Money2.CleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.clean_user_data_by_user_id(
        money2.CleanUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.clean_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
client = gs2('money2')

api_result_handler = client.clean_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result

checkCleanUserDataByUserId

Check if the clean of the data associated with the specified user ID is complete

Details

Request

Type Condition Required Default Value Limits Description
userId string
~ 128 chars User ID
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.CheckCleanUserDataByUserId(
    &money2.CheckCleanUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\CheckCleanUserDataByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->checkCleanUserDataByUserId(
        (new CheckCleanUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.CheckCleanUserDataByUserIdRequest;
import io.gs2.money2.result.CheckCleanUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    CheckCleanUserDataByUserIdResult result = client.checkCleanUserDataByUserId(
        new CheckCleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.CheckCleanUserDataByUserIdResult> asyncResult = null;
yield return client.CheckCleanUserDataByUserId(
    new Gs2.Gs2Money2.Request.CheckCleanUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.checkCleanUserDataByUserId(
        new Gs2Money2.CheckCleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.check_clean_user_data_by_user_id(
        money2.CheckCleanUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.check_clean_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
client = gs2('money2')

api_result_handler = client.check_clean_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result

prepareImportUserDataByUserId

Execute import of data associated with the specified user ID

The data that can be used for import is limited to the data exported by GS2, and old data may fail to import. You can import data with a user ID different from the one you exported, but if the user ID is included in the payload of the user data, this may not be the case.

You can start the actual import process by uploading the exported zip file to the URL returned in the return value of this API and calling importUserDataByUserId.

Details

Request

Type Condition Required Default Value Limits Description
userId string
~ 128 chars User ID
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
uploadToken string Token used to reflect results after upload
uploadUrl string URL used to upload user data

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.PrepareImportUserDataByUserId(
    &money2.PrepareImportUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
uploadToken := result.UploadToken
uploadUrl := result.UploadUrl
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\PrepareImportUserDataByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->prepareImportUserDataByUserId(
        (new PrepareImportUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $uploadToken = $result->getUploadToken();
    $uploadUrl = $result->getUploadUrl();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.PrepareImportUserDataByUserIdRequest;
import io.gs2.money2.result.PrepareImportUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    PrepareImportUserDataByUserIdResult result = client.prepareImportUserDataByUserId(
        new PrepareImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    String uploadToken = result.getUploadToken();
    String uploadUrl = result.getUploadUrl();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.PrepareImportUserDataByUserIdResult> asyncResult = null;
yield return client.PrepareImportUserDataByUserId(
    new Gs2.Gs2Money2.Request.PrepareImportUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var uploadToken = result.UploadToken;
var uploadUrl = result.UploadUrl;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.prepareImportUserDataByUserId(
        new Gs2Money2.PrepareImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const uploadToken = result.getUploadToken();
    const uploadUrl = result.getUploadUrl();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.prepare_import_user_data_by_user_id(
        money2.PrepareImportUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    upload_token = result.upload_token
    upload_url = result.upload_url
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.prepare_import_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;
client = gs2('money2')

api_result_handler = client.prepare_import_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;

importUserDataByUserId

Execute import of data associated with the specified user ID

The data that can be used for import is limited to the data exported by GS2, and old data may fail to import. You can import data with a user ID different from the one you exported, but if the user ID is included in the payload of the user data, this may not be the case.

Before calling this API, you must call prepareImportUserDataByUserId to complete the upload preparation.

Details

Request

Type Condition Required Default Value Limits Description
userId string
~ 128 chars User ID
uploadToken string
~ 1024 chars Token received in preparation for upload
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.ImportUserDataByUserId(
    &money2.ImportUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        UploadToken: pointy.String("upload-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\ImportUserDataByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->importUserDataByUserId(
        (new ImportUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withUploadToken("upload-0001")
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.ImportUserDataByUserIdRequest;
import io.gs2.money2.result.ImportUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    ImportUserDataByUserIdResult result = client.importUserDataByUserId(
        new ImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withUploadToken("upload-0001")
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.ImportUserDataByUserIdResult> asyncResult = null;
yield return client.ImportUserDataByUserId(
    new Gs2.Gs2Money2.Request.ImportUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithUploadToken("upload-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.importUserDataByUserId(
        new Gs2Money2.ImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withUploadToken("upload-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.import_user_data_by_user_id(
        money2.ImportUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_upload_token('upload-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.import_user_data_by_user_id({
    userId="user-0001",
    uploadToken="upload-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
client = gs2('money2')

api_result_handler = client.import_user_data_by_user_id_async({
    userId="user-0001",
    uploadToken="upload-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result

checkImportUserDataByUserId

Check if the import of the data associated with the specified user ID is complete

Details

Request

Type Condition Required Default Value Limits Description
userId string
~ 128 chars User ID
uploadToken string
~ 1024 chars Token received in preparation for upload
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
url string URL of log data

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.CheckImportUserDataByUserId(
    &money2.CheckImportUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        UploadToken: pointy.String("upload-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
url := result.Url
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\CheckImportUserDataByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->checkImportUserDataByUserId(
        (new CheckImportUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withUploadToken("upload-0001")
            ->withTimeOffsetToken(null)
    );
    $url = $result->getUrl();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.CheckImportUserDataByUserIdRequest;
import io.gs2.money2.result.CheckImportUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    CheckImportUserDataByUserIdResult result = client.checkImportUserDataByUserId(
        new CheckImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withUploadToken("upload-0001")
            .withTimeOffsetToken(null)
    );
    String url = result.getUrl();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.CheckImportUserDataByUserIdResult> asyncResult = null;
yield return client.CheckImportUserDataByUserId(
    new Gs2.Gs2Money2.Request.CheckImportUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithUploadToken("upload-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var url = result.Url;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.checkImportUserDataByUserId(
        new Gs2Money2.CheckImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withUploadToken("upload-0001")
            .withTimeOffsetToken(null)
    );
    const url = result.getUrl();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.check_import_user_data_by_user_id(
        money2.CheckImportUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_upload_token('upload-0001')
            .with_time_offset_token(None)
    )
    url = result.url
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.check_import_user_data_by_user_id({
    userId="user-0001",
    uploadToken="upload-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
url = result.url;
client = gs2('money2')

api_result_handler = client.check_import_user_data_by_user_id_async({
    userId="user-0001",
    uploadToken="upload-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
url = result.url;

describeWallets

Get a list of wallets

Retrieves a paginated list of wallets for the requesting user. Each wallet manages a separate balance with paid and free currency tracked independently.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessToken string
~ 128 chars Access token
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data items to retrieve

Result

Type Description
items List<Wallet> List of Wallets
nextPageToken string Page token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.DescribeWallets(
    &money2.DescribeWalletsRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\DescribeWalletsRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->describeWallets(
        (new DescribeWalletsRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.DescribeWalletsRequest;
import io.gs2.money2.result.DescribeWalletsResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    DescribeWalletsResult result = client.describeWallets(
        new DescribeWalletsRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<Wallet> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DescribeWalletsResult> asyncResult = null;
yield return client.DescribeWallets(
    new Gs2.Gs2Money2.Request.DescribeWalletsRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.describeWallets(
        new Gs2Money2.DescribeWalletsRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.describe_wallets(
        money2.DescribeWalletsRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.describe_wallets({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('money2')

api_result_handler = client.describe_wallets_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

describeWalletsByUserId

Get a list of wallets by specifying a user ID

Retrieves a paginated list of wallets for the specified user.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data items to retrieve
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
items List<Wallet> List of Wallets
nextPageToken string Page token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.DescribeWalletsByUserId(
    &money2.DescribeWalletsByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\DescribeWalletsByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->describeWalletsByUserId(
        (new DescribeWalletsByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withPageToken(null)
            ->withLimit(null)
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.DescribeWalletsByUserIdRequest;
import io.gs2.money2.result.DescribeWalletsByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    DescribeWalletsByUserIdResult result = client.describeWalletsByUserId(
        new DescribeWalletsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<Wallet> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DescribeWalletsByUserIdResult> asyncResult = null;
yield return client.DescribeWalletsByUserId(
    new Gs2.Gs2Money2.Request.DescribeWalletsByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithPageToken(null)
        .WithLimit(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.describeWalletsByUserId(
        new Gs2Money2.DescribeWalletsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.describe_wallets_by_user_id(
        money2.DescribeWalletsByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_page_token(None)
            .with_limit(None)
            .with_time_offset_token(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.describe_wallets_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('money2')

api_result_handler = client.describe_wallets_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

getWallet

Get Wallet

Retrieves the wallet for the specified slot for the requesting user, including the paid and free currency balances.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessToken string
~ 128 chars Access token
slot int
0 ~ 100000000 Slot Number
Identifies the wallet slot. Different slots can be used to manage currency separately per platform (e.g., one slot for iOS, another for Android) when cross-platform balance sharing is not allowed.

Result

Type Description
item Wallet Wallet

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.GetWallet(
    &money2.GetWalletRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Slot: pointy.Int32(0),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\GetWalletRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->getWallet(
        (new GetWalletRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withSlot(0)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.GetWalletRequest;
import io.gs2.money2.result.GetWalletResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    GetWalletResult result = client.getWallet(
        new GetWalletRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withSlot(0)
    );
    Wallet item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.GetWalletResult> asyncResult = null;
yield return client.GetWallet(
    new Gs2.Gs2Money2.Request.GetWalletRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithSlot(0),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.getWallet(
        new Gs2Money2.GetWalletRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withSlot(0)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.get_wallet(
        money2.GetWalletRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_slot(0)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.get_wallet({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    slot=0,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.get_wallet_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    slot=0,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

getWalletByUserId

Get Wallet by specifying a user ID

Retrieves the wallet for the specified slot for the specified user.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
slot int
0 ~ 100000000 Slot Number
Identifies the wallet slot. Different slots can be used to manage currency separately per platform (e.g., one slot for iOS, another for Android) when cross-platform balance sharing is not allowed.
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item Wallet Wallet

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.GetWalletByUserId(
    &money2.GetWalletByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        Slot: pointy.Int32(0),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\GetWalletByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->getWalletByUserId(
        (new GetWalletByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withSlot(0)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.GetWalletByUserIdRequest;
import io.gs2.money2.result.GetWalletByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    GetWalletByUserIdResult result = client.getWalletByUserId(
        new GetWalletByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withSlot(0)
            .withTimeOffsetToken(null)
    );
    Wallet item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.GetWalletByUserIdResult> asyncResult = null;
yield return client.GetWalletByUserId(
    new Gs2.Gs2Money2.Request.GetWalletByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithSlot(0)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.getWalletByUserId(
        new Gs2Money2.GetWalletByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withSlot(0)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.get_wallet_by_user_id(
        money2.GetWalletByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_slot(0)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.get_wallet_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    slot=0,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.get_wallet_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    slot=0,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

depositByUserId

Deposit balance to Wallet by specifying a user ID

Adds the specified deposit transactions to the wallet for the specified user. An event log is recorded for each deposit transaction.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
slot int
0 ~ 100000000 Slot Number
Identifies the wallet slot. Different slots can be used to manage currency separately per platform (e.g., one slot for iOS, another for Android) when cross-platform balance sharing is not allowed.
depositTransactions List<DepositTransaction>
1 ~ 1000 items List of Deposit transactions
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item Wallet Wallet after deposit

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.DepositByUserId(
    &money2.DepositByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        Slot: pointy.Int32(0),
        DepositTransactions: []money2.DepositTransaction{
            money2.DepositTransaction{
                Price: pointy.Float64(120),
                Currency: pointy.String("JPY"),
                Count: pointy.Int32(50),
            },
        },
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\DepositByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->depositByUserId(
        (new DepositByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withSlot(0)
            ->withDepositTransactions([
                (new DepositTransaction())
                    ->withPrice(120)
                    ->withCurrency("JPY")
                    ->withCount(50),
            ])
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.DepositByUserIdRequest;
import io.gs2.money2.result.DepositByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    DepositByUserIdResult result = client.depositByUserId(
        new DepositByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withSlot(0)
            .withDepositTransactions(Arrays.asList(
                new DepositTransaction()
                    .withPrice(120)
                    .withCurrency("JPY")
                    .withCount(50)
            ))
            .withTimeOffsetToken(null)
    );
    Wallet item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DepositByUserIdResult> asyncResult = null;
yield return client.DepositByUserId(
    new Gs2.Gs2Money2.Request.DepositByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithSlot(0)
        .WithDepositTransactions(new Gs2.Gs2Money2.Model.DepositTransaction[] {
            new Gs2.Gs2Money2.Model.DepositTransaction()
                .WithPrice(120)
                .WithCurrency("JPY")
                .WithCount(50),
        })
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.depositByUserId(
        new Gs2Money2.DepositByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withSlot(0)
            .withDepositTransactions([
                new Gs2Money2.model.DepositTransaction()
                    .withPrice(120)
                    .withCurrency("JPY")
                    .withCount(50),
            ])
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.deposit_by_user_id(
        money2.DepositByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_slot(0)
            .with_deposit_transactions([
                money2.DepositTransaction()
                    .with_price(120)
                    .with_currency('JPY')
                    .with_count(50),
            ])
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.deposit_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    slot=0,
    depositTransactions={
        {
            price=120,
            currency="JPY",
            count=50,
        }
    },
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.deposit_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    slot=0,
    depositTransactions={
        {
            price=120,
            currency="JPY",
            count=50,
        }
    },
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

withdraw

Withdraw balance from wallet

Withdraws the specified amount of currency from the wallet for the requesting user. If paidOnly is false, free currency is consumed first, then paid currency. If paidOnly is true, only paid currency is consumed.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessToken string
~ 128 chars Access token
slot int
0 ~ 100000000 Slot Number
Identifies the wallet slot. Different slots can be used to manage currency separately per platform (e.g., one slot for iOS, another for Android) when cross-platform balance sharing is not allowed.
withdrawCount int
1 ~ 2147483646 Quantity of premium currency to be consumed
paidOnly bool false Whether to target only paid currency

Result

Type Description
item Wallet Post-withdraw Wallet
withdrawTransactions List<DepositTransaction> List of consumed deposit transactions

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.Withdraw(
    &money2.WithdrawRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Slot: pointy.Int32(0),
        WithdrawCount: pointy.Int32(50),
        PaidOnly: pointy.Bool(false),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
withdrawTransactions := result.WithdrawTransactions
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\WithdrawRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->withdraw(
        (new WithdrawRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withSlot(0)
            ->withWithdrawCount(50)
            ->withPaidOnly(false)
    );
    $item = $result->getItem();
    $withdrawTransactions = $result->getWithdrawTransactions();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.WithdrawRequest;
import io.gs2.money2.result.WithdrawResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    WithdrawResult result = client.withdraw(
        new WithdrawRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withSlot(0)
            .withWithdrawCount(50)
            .withPaidOnly(false)
    );
    Wallet item = result.getItem();
    List<DepositTransaction> withdrawTransactions = result.getWithdrawTransactions();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.WithdrawResult> asyncResult = null;
yield return client.Withdraw(
    new Gs2.Gs2Money2.Request.WithdrawRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithSlot(0)
        .WithWithdrawCount(50)
        .WithPaidOnly(false),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var withdrawTransactions = result.WithdrawTransactions;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.withdraw(
        new Gs2Money2.WithdrawRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withSlot(0)
            .withWithdrawCount(50)
            .withPaidOnly(false)
    );
    const item = result.getItem();
    const withdrawTransactions = result.getWithdrawTransactions();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.withdraw(
        money2.WithdrawRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_slot(0)
            .with_withdraw_count(50)
            .with_paid_only(False)
    )
    item = result.item
    withdraw_transactions = result.withdraw_transactions
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.withdraw({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    slot=0,
    withdrawCount=50,
    paidOnly=false,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
withdrawTransactions = result.withdrawTransactions;
client = gs2('money2')

api_result_handler = client.withdraw_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    slot=0,
    withdrawCount=50,
    paidOnly=false,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
withdrawTransactions = result.withdrawTransactions;

withdrawByUserId

Withdraw balance from Wallet by specifying a user ID

Withdraws the specified amount of currency from the wallet for the specified user. If paidOnly is false, free currency is consumed first, then paid currency.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
slot int
0 ~ 100000000 Slot Number
Identifies the wallet slot. Different slots can be used to manage currency separately per platform (e.g., one slot for iOS, another for Android) when cross-platform balance sharing is not allowed.
withdrawCount int
1 ~ 2147483646 Quantity of premium currency to be consumed
paidOnly bool false Whether to target only paid currency
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item Wallet Post-withdraw Wallet
withdrawTransactions List<DepositTransaction> List of consumed deposit transactions

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.WithdrawByUserId(
    &money2.WithdrawByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        Slot: pointy.Int32(0),
        WithdrawCount: pointy.Int32(50),
        PaidOnly: pointy.Bool(false),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
withdrawTransactions := result.WithdrawTransactions
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\WithdrawByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->withdrawByUserId(
        (new WithdrawByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withSlot(0)
            ->withWithdrawCount(50)
            ->withPaidOnly(false)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $withdrawTransactions = $result->getWithdrawTransactions();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.WithdrawByUserIdRequest;
import io.gs2.money2.result.WithdrawByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    WithdrawByUserIdResult result = client.withdrawByUserId(
        new WithdrawByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withSlot(0)
            .withWithdrawCount(50)
            .withPaidOnly(false)
            .withTimeOffsetToken(null)
    );
    Wallet item = result.getItem();
    List<DepositTransaction> withdrawTransactions = result.getWithdrawTransactions();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.WithdrawByUserIdResult> asyncResult = null;
yield return client.WithdrawByUserId(
    new Gs2.Gs2Money2.Request.WithdrawByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithSlot(0)
        .WithWithdrawCount(50)
        .WithPaidOnly(false)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var withdrawTransactions = result.WithdrawTransactions;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.withdrawByUserId(
        new Gs2Money2.WithdrawByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withSlot(0)
            .withWithdrawCount(50)
            .withPaidOnly(false)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const withdrawTransactions = result.getWithdrawTransactions();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.withdraw_by_user_id(
        money2.WithdrawByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_slot(0)
            .with_withdraw_count(50)
            .with_paid_only(False)
            .with_time_offset_token(None)
    )
    item = result.item
    withdraw_transactions = result.withdraw_transactions
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.withdraw_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    slot=0,
    withdrawCount=50,
    paidOnly=false,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
withdrawTransactions = result.withdrawTransactions;
client = gs2('money2')

api_result_handler = client.withdraw_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    slot=0,
    withdrawCount=50,
    paidOnly=false,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
withdrawTransactions = result.withdrawTransactions;

describeEventsByUserId

Get a list of Events

Retrieves a paginated list of purchase events for the specified user within the specified date range. The default date range is the last 30 days.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
begin long The absolute time 30 days prior to the current time Search start date and time
end long Current time Search end date and time
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data items to retrieve
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
items List<Event> List of Events
nextPageToken string Page token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.DescribeEventsByUserId(
    &money2.DescribeEventsByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        Begin: nil,
        End: nil,
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\DescribeEventsByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->describeEventsByUserId(
        (new DescribeEventsByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withBegin(null)
            ->withEnd(null)
            ->withPageToken(null)
            ->withLimit(null)
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.DescribeEventsByUserIdRequest;
import io.gs2.money2.result.DescribeEventsByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    DescribeEventsByUserIdResult result = client.describeEventsByUserId(
        new DescribeEventsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withBegin(null)
            .withEnd(null)
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<Event> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DescribeEventsByUserIdResult> asyncResult = null;
yield return client.DescribeEventsByUserId(
    new Gs2.Gs2Money2.Request.DescribeEventsByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithBegin(null)
        .WithEnd(null)
        .WithPageToken(null)
        .WithLimit(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.describeEventsByUserId(
        new Gs2Money2.DescribeEventsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withBegin(null)
            .withEnd(null)
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.describe_events_by_user_id(
        money2.DescribeEventsByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_begin(None)
            .with_end(None)
            .with_page_token(None)
            .with_limit(None)
            .with_time_offset_token(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.describe_events_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    begin=nil,
    end=nil,
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('money2')

api_result_handler = client.describe_events_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    begin=nil,
    end=nil,
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

getEventByTransactionId

Get Event by specifying transaction ID

Retrieves a specific purchase event by its transaction ID.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
transactionId string
~ 1024 chars Transaction ID
The unique identifier for this payment event. Corresponds to the store platform’s transaction ID for receipt verification events.

Result

Type Description
item Event Event

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.GetEventByTransactionId(
    &money2.GetEventByTransactionIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        TransactionId: pointy.String("transaction-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\GetEventByTransactionIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->getEventByTransactionId(
        (new GetEventByTransactionIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withTransactionId("transaction-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.GetEventByTransactionIdRequest;
import io.gs2.money2.result.GetEventByTransactionIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    GetEventByTransactionIdResult result = client.getEventByTransactionId(
        new GetEventByTransactionIdRequest()
            .withNamespaceName("namespace-0001")
            .withTransactionId("transaction-0001")
    );
    Event item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.GetEventByTransactionIdResult> asyncResult = null;
yield return client.GetEventByTransactionId(
    new Gs2.Gs2Money2.Request.GetEventByTransactionIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithTransactionId("transaction-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.getEventByTransactionId(
        new Gs2Money2.GetEventByTransactionIdRequest()
            .withNamespaceName("namespace-0001")
            .withTransactionId("transaction-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.get_event_by_transaction_id(
        money2.GetEventByTransactionIdRequest()
            .with_namespace_name('namespace-0001')
            .with_transaction_id('transaction-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.get_event_by_transaction_id({
    namespaceName="namespace-0001",
    transactionId="transaction-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.get_event_by_transaction_id_async({
    namespaceName="namespace-0001",
    transactionId="transaction-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

verifyReceipt

Record receipt

Verifies a purchase receipt against the store content model and records it as used. An event log is recorded and the verify receipt script configured in the namespace is executed.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessToken string
~ 128 chars Access token
contentName string
~ 128 chars Store Content Model name
receipt Receipt
Receipt

Result

Type Description
item Event Event

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.VerifyReceipt(
    &money2.VerifyReceiptRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        ContentName: pointy.String("content-0001"),
        Receipt: &money2.Receipt{
            Store: pointy.String("AppleAppStore"),
            TransactionID: pointy.String("transaction-0001"),
            Payload: pointy.String("payload"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\VerifyReceiptRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->verifyReceipt(
        (new VerifyReceiptRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withContentName("content-0001")
            ->withReceipt((new Receipt())
                ->withStore("AppleAppStore")
                ->withTransactionID("transaction-0001")
                ->withPayload("payload")
            )
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.VerifyReceiptRequest;
import io.gs2.money2.result.VerifyReceiptResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    VerifyReceiptResult result = client.verifyReceipt(
        new VerifyReceiptRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withContentName("content-0001")
            .withReceipt(new Receipt()
                .withStore("AppleAppStore")
                .withTransactionID("transaction-0001")
                .withPayload("payload")
            )
    );
    Event item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.VerifyReceiptResult> asyncResult = null;
yield return client.VerifyReceipt(
    new Gs2.Gs2Money2.Request.VerifyReceiptRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithContentName("content-0001")
        .WithReceipt(new Gs2.Gs2Money2.Model.Receipt()
            .WithStore("AppleAppStore")
            .WithTransactionID("transaction-0001")
            .WithPayload("payload")
        ),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.verifyReceipt(
        new Gs2Money2.VerifyReceiptRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withContentName("content-0001")
            .withReceipt(new Gs2Money2.model.Receipt()
                .withStore("AppleAppStore")
                .withTransactionID("transaction-0001")
                .withPayload("payload")
            )
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.verify_receipt(
        money2.VerifyReceiptRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_content_name('content-0001')
            .with_receipt(money2.Receipt()
                .with_store('AppleAppStore')
                .with_transaction_i_d('transaction-0001')
                .with_payload('payload')
            )
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.verify_receipt({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    contentName="content-0001",
    receipt={
        store="AppleAppStore",
        transaction_i_d="transaction-0001",
        payload="payload",
    },
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.verify_receipt_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    contentName="content-0001",
    receipt={
        store="AppleAppStore",
        transaction_i_d="transaction-0001",
        payload="payload",
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

verifyReceiptByUserId

Mark a receipt as used by specifying a user ID

Verifies a purchase receipt for the specified user and records it as used. An event log is recorded and the verify receipt script configured in the namespace is executed.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
contentName string
~ 128 chars Store Content Model name
receipt Receipt
Receipt
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item Event Event

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.VerifyReceiptByUserId(
    &money2.VerifyReceiptByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        ContentName: pointy.String("content-0001"),
        Receipt: &money2.Receipt{
            Store: pointy.String("AppleAppStore"),
            TransactionID: pointy.String("transaction-0001"),
            Payload: pointy.String("payload"),
        },
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\VerifyReceiptByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->verifyReceiptByUserId(
        (new VerifyReceiptByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withContentName("content-0001")
            ->withReceipt((new Receipt())
                ->withStore("AppleAppStore")
                ->withTransactionID("transaction-0001")
                ->withPayload("payload")
            )
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.VerifyReceiptByUserIdRequest;
import io.gs2.money2.result.VerifyReceiptByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    VerifyReceiptByUserIdResult result = client.verifyReceiptByUserId(
        new VerifyReceiptByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withContentName("content-0001")
            .withReceipt(new Receipt()
                .withStore("AppleAppStore")
                .withTransactionID("transaction-0001")
                .withPayload("payload")
            )
            .withTimeOffsetToken(null)
    );
    Event item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.VerifyReceiptByUserIdResult> asyncResult = null;
yield return client.VerifyReceiptByUserId(
    new Gs2.Gs2Money2.Request.VerifyReceiptByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithContentName("content-0001")
        .WithReceipt(new Gs2.Gs2Money2.Model.Receipt()
            .WithStore("AppleAppStore")
            .WithTransactionID("transaction-0001")
            .WithPayload("payload")
        )
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.verifyReceiptByUserId(
        new Gs2Money2.VerifyReceiptByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withContentName("content-0001")
            .withReceipt(new Gs2Money2.model.Receipt()
                .withStore("AppleAppStore")
                .withTransactionID("transaction-0001")
                .withPayload("payload")
            )
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.verify_receipt_by_user_id(
        money2.VerifyReceiptByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_content_name('content-0001')
            .with_receipt(money2.Receipt()
                .with_store('AppleAppStore')
                .with_transaction_i_d('transaction-0001')
                .with_payload('payload')
            )
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.verify_receipt_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    contentName="content-0001",
    receipt={
        store="AppleAppStore",
        transaction_i_d="transaction-0001",
        payload="payload",
    },
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.verify_receipt_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    contentName="content-0001",
    receipt={
        store="AppleAppStore",
        transaction_i_d="transaction-0001",
        payload="payload",
    },
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

describeSubscriptionStatuses

Get a list of Store Subscription Statuses

Retrieves the subscription statuses for all subscription content models for the requesting user.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessToken string ~ 128 chars Access token

Result

Type Description
items List<SubscriptionStatus> List of Subscription statuses

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.DescribeSubscriptionStatuses(
    &money2.DescribeSubscriptionStatusesRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\DescribeSubscriptionStatusesRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->describeSubscriptionStatuses(
        (new DescribeSubscriptionStatusesRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.DescribeSubscriptionStatusesRequest;
import io.gs2.money2.result.DescribeSubscriptionStatusesResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    DescribeSubscriptionStatusesResult result = client.describeSubscriptionStatuses(
        new DescribeSubscriptionStatusesRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
    );
    List<SubscriptionStatus> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DescribeSubscriptionStatusesResult> asyncResult = null;
yield return client.DescribeSubscriptionStatuses(
    new Gs2.Gs2Money2.Request.DescribeSubscriptionStatusesRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.describeSubscriptionStatuses(
        new Gs2Money2.DescribeSubscriptionStatusesRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.describe_subscription_statuses(
        money2.DescribeSubscriptionStatusesRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.describe_subscription_statuses({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
client = gs2('money2')

api_result_handler = client.describe_subscription_statuses_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;

describeSubscriptionStatusesByUserId

Get a list of Store Subscription Statuses by specifying a user ID

Retrieves the subscription statuses for all subscription content models for the specified user.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string ~ 128 chars User ID
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
items List<SubscriptionStatus> List of Subscription statuses

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.DescribeSubscriptionStatusesByUserId(
    &money2.DescribeSubscriptionStatusesByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\DescribeSubscriptionStatusesByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->describeSubscriptionStatusesByUserId(
        (new DescribeSubscriptionStatusesByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.DescribeSubscriptionStatusesByUserIdRequest;
import io.gs2.money2.result.DescribeSubscriptionStatusesByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    DescribeSubscriptionStatusesByUserIdResult result = client.describeSubscriptionStatusesByUserId(
        new DescribeSubscriptionStatusesByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    List<SubscriptionStatus> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DescribeSubscriptionStatusesByUserIdResult> asyncResult = null;
yield return client.DescribeSubscriptionStatusesByUserId(
    new Gs2.Gs2Money2.Request.DescribeSubscriptionStatusesByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.describeSubscriptionStatusesByUserId(
        new Gs2Money2.DescribeSubscriptionStatusesByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.describe_subscription_statuses_by_user_id(
        money2.DescribeSubscriptionStatusesByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.describe_subscription_statuses_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
client = gs2('money2')

api_result_handler = client.describe_subscription_statuses_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;

getSubscriptionStatus

Get subscription status

Retrieves the subscription status for the specified content for the requesting user.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessToken string ~ 128 chars Access token
contentName string
~ 128 chars Store Subscription Content Model name

Result

Type Description
item SubscriptionStatus Subscription status

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.GetSubscriptionStatus(
    &money2.GetSubscriptionStatusRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        ContentName: pointy.String("content-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\GetSubscriptionStatusRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->getSubscriptionStatus(
        (new GetSubscriptionStatusRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withContentName("content-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.GetSubscriptionStatusRequest;
import io.gs2.money2.result.GetSubscriptionStatusResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    GetSubscriptionStatusResult result = client.getSubscriptionStatus(
        new GetSubscriptionStatusRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withContentName("content-0001")
    );
    SubscriptionStatus item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.GetSubscriptionStatusResult> asyncResult = null;
yield return client.GetSubscriptionStatus(
    new Gs2.Gs2Money2.Request.GetSubscriptionStatusRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithContentName("content-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.getSubscriptionStatus(
        new Gs2Money2.GetSubscriptionStatusRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withContentName("content-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.get_subscription_status(
        money2.GetSubscriptionStatusRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_content_name('content-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.get_subscription_status({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    contentName="content-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.get_subscription_status_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    contentName="content-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

getSubscriptionStatusByUserId

Get subscription status by specifying a user ID

Retrieves the subscription status for the specified content for the specified user.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string ~ 128 chars User ID
contentName string
~ 128 chars Store Subscription Content Model name
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item SubscriptionStatus Subscription status

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.GetSubscriptionStatusByUserId(
    &money2.GetSubscriptionStatusByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        ContentName: pointy.String("content-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\GetSubscriptionStatusByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->getSubscriptionStatusByUserId(
        (new GetSubscriptionStatusByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withContentName("content-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.GetSubscriptionStatusByUserIdRequest;
import io.gs2.money2.result.GetSubscriptionStatusByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    GetSubscriptionStatusByUserIdResult result = client.getSubscriptionStatusByUserId(
        new GetSubscriptionStatusByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withContentName("content-0001")
            .withTimeOffsetToken(null)
    );
    SubscriptionStatus item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.GetSubscriptionStatusByUserIdResult> asyncResult = null;
yield return client.GetSubscriptionStatusByUserId(
    new Gs2.Gs2Money2.Request.GetSubscriptionStatusByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithContentName("content-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.getSubscriptionStatusByUserId(
        new Gs2Money2.GetSubscriptionStatusByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withContentName("content-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.get_subscription_status_by_user_id(
        money2.GetSubscriptionStatusByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_content_name('content-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.get_subscription_status_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    contentName="content-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.get_subscription_status_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    contentName="content-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

allocateSubscriptionStatus

Allocate subscription status from receipt

Allocates a subscription to the requesting user by verifying the receipt against the store platform (Apple App Store / Google Play). If the subscription is newly allocated, the subscribe script configured in the namespace is executed and the schedule trigger is updated.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessToken string ~ 128 chars Access token
receipt string
~ 1024 chars Receipt

Result

Type Description
item SubscriptionStatus Subscription status

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.AllocateSubscriptionStatus(
    &money2.AllocateSubscriptionStatusRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Receipt: pointy.String("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\AllocateSubscriptionStatusRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->allocateSubscriptionStatus(
        (new AllocateSubscriptionStatusRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withReceipt("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.AllocateSubscriptionStatusRequest;
import io.gs2.money2.result.AllocateSubscriptionStatusResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    AllocateSubscriptionStatusResult result = client.allocateSubscriptionStatus(
        new AllocateSubscriptionStatusRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withReceipt("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}")
    );
    SubscriptionStatus item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.AllocateSubscriptionStatusResult> asyncResult = null;
yield return client.AllocateSubscriptionStatus(
    new Gs2.Gs2Money2.Request.AllocateSubscriptionStatusRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithReceipt("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.allocateSubscriptionStatus(
        new Gs2Money2.AllocateSubscriptionStatusRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withReceipt("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.allocate_subscription_status(
        money2.AllocateSubscriptionStatusRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_receipt('{"Store": "AppleAppStore", "TransactionID": "transaction-0001", "Payload": "payload"}')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.allocate_subscription_status({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    receipt="{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.allocate_subscription_status_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    receipt="{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

allocateSubscriptionStatusByUserId

Allocate subscription status by specifying a user ID from receipt

Allocates a subscription to the specified user by verifying the receipt against the store platform. If the subscription is already allocated to a different user, an AlreadyUsed error is returned.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string ~ 128 chars User ID
receipt string
~ 1024 chars Receipt
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item SubscriptionStatus Subscription status

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.AllocateSubscriptionStatusByUserId(
    &money2.AllocateSubscriptionStatusByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        Receipt: pointy.String("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\AllocateSubscriptionStatusByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->allocateSubscriptionStatusByUserId(
        (new AllocateSubscriptionStatusByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withReceipt("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.AllocateSubscriptionStatusByUserIdRequest;
import io.gs2.money2.result.AllocateSubscriptionStatusByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    AllocateSubscriptionStatusByUserIdResult result = client.allocateSubscriptionStatusByUserId(
        new AllocateSubscriptionStatusByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withReceipt("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}")
            .withTimeOffsetToken(null)
    );
    SubscriptionStatus item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.AllocateSubscriptionStatusByUserIdResult> asyncResult = null;
yield return client.AllocateSubscriptionStatusByUserId(
    new Gs2.Gs2Money2.Request.AllocateSubscriptionStatusByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithReceipt("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.allocateSubscriptionStatusByUserId(
        new Gs2Money2.AllocateSubscriptionStatusByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withReceipt("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.allocate_subscription_status_by_user_id(
        money2.AllocateSubscriptionStatusByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_receipt('{"Store": "AppleAppStore", "TransactionID": "transaction-0001", "Payload": "payload"}')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.allocate_subscription_status_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    receipt="{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.allocate_subscription_status_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    receipt="{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

takeoverSubscriptionStatus

Take over the subscription status of a subscription that is already assigned to another user

Transfers a subscription that is currently assigned to another user to the requesting user. The take over script configured in the namespace is executed, and the schedule trigger is updated for both the old and new users.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessToken string ~ 128 chars Access token
receipt string
~ 1024 chars Receipt

Result

Type Description
item SubscriptionStatus Subscription status

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.TakeoverSubscriptionStatus(
    &money2.TakeoverSubscriptionStatusRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Receipt: pointy.String("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\TakeoverSubscriptionStatusRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->takeoverSubscriptionStatus(
        (new TakeoverSubscriptionStatusRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withReceipt("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.TakeoverSubscriptionStatusRequest;
import io.gs2.money2.result.TakeoverSubscriptionStatusResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    TakeoverSubscriptionStatusResult result = client.takeoverSubscriptionStatus(
        new TakeoverSubscriptionStatusRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withReceipt("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}")
    );
    SubscriptionStatus item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.TakeoverSubscriptionStatusResult> asyncResult = null;
yield return client.TakeoverSubscriptionStatus(
    new Gs2.Gs2Money2.Request.TakeoverSubscriptionStatusRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithReceipt("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.takeoverSubscriptionStatus(
        new Gs2Money2.TakeoverSubscriptionStatusRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withReceipt("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.takeover_subscription_status(
        money2.TakeoverSubscriptionStatusRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_receipt('{"Store": "AppleAppStore", "TransactionID": "transaction-0001", "Payload": "payload"}')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.takeover_subscription_status({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    receipt="{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.takeover_subscription_status_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    receipt="{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

takeoverSubscriptionStatusByUserId

Take over the subscription status of a subscription that is already assigned to another user by specifying a user ID

Transfers a subscription that is currently assigned to another user to the specified user. The take over script is executed and subscription triggers are updated for both users.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string ~ 128 chars User ID
receipt string
~ 1024 chars Receipt
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item SubscriptionStatus Subscription status

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.TakeoverSubscriptionStatusByUserId(
    &money2.TakeoverSubscriptionStatusByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        Receipt: pointy.String("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\TakeoverSubscriptionStatusByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->takeoverSubscriptionStatusByUserId(
        (new TakeoverSubscriptionStatusByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withReceipt("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.TakeoverSubscriptionStatusByUserIdRequest;
import io.gs2.money2.result.TakeoverSubscriptionStatusByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    TakeoverSubscriptionStatusByUserIdResult result = client.takeoverSubscriptionStatusByUserId(
        new TakeoverSubscriptionStatusByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withReceipt("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}")
            .withTimeOffsetToken(null)
    );
    SubscriptionStatus item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.TakeoverSubscriptionStatusByUserIdResult> asyncResult = null;
yield return client.TakeoverSubscriptionStatusByUserId(
    new Gs2.Gs2Money2.Request.TakeoverSubscriptionStatusByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithReceipt("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.takeoverSubscriptionStatusByUserId(
        new Gs2Money2.TakeoverSubscriptionStatusByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withReceipt("{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.takeover_subscription_status_by_user_id(
        money2.TakeoverSubscriptionStatusByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_receipt('{"Store": "AppleAppStore", "TransactionID": "transaction-0001", "Payload": "payload"}')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.takeover_subscription_status_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    receipt="{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.takeover_subscription_status_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    receipt="{\"Store\": \"AppleAppStore\", \"TransactionID\": \"transaction-0001\", \"Payload\": \"payload\"}",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

describeRefundHistoriesByUserId

Get a list of store refund history by specifying a user ID

Retrieves a paginated list of refund history records for the specified user. Each record contains details about the refund event, including the content name and platform information.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string ~ 128 chars User ID
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data items to retrieve
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
items List<RefundHistory> List of refund history
nextPageToken string Page token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.DescribeRefundHistoriesByUserId(
    &money2.DescribeRefundHistoriesByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\DescribeRefundHistoriesByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->describeRefundHistoriesByUserId(
        (new DescribeRefundHistoriesByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withPageToken(null)
            ->withLimit(null)
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.DescribeRefundHistoriesByUserIdRequest;
import io.gs2.money2.result.DescribeRefundHistoriesByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    DescribeRefundHistoriesByUserIdResult result = client.describeRefundHistoriesByUserId(
        new DescribeRefundHistoriesByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<RefundHistory> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DescribeRefundHistoriesByUserIdResult> asyncResult = null;
yield return client.DescribeRefundHistoriesByUserId(
    new Gs2.Gs2Money2.Request.DescribeRefundHistoriesByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithPageToken(null)
        .WithLimit(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.describeRefundHistoriesByUserId(
        new Gs2Money2.DescribeRefundHistoriesByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.describe_refund_histories_by_user_id(
        money2.DescribeRefundHistoriesByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_page_token(None)
            .with_limit(None)
            .with_time_offset_token(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.describe_refund_histories_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('money2')

api_result_handler = client.describe_refund_histories_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

describeRefundHistoriesByDate

Get a list of store refund history by year and month

Retrieves a paginated list of refund history records filtered by year and month. Can optionally filter by day.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
year int
2000 ~ 3000 Year
month int
1 ~ 12 Month
day int 1 ~ 31 Day
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data items to retrieve

Result

Type Description
items List<RefundHistory> List of refund history
nextPageToken string Page token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.DescribeRefundHistoriesByDate(
    &money2.DescribeRefundHistoriesByDateRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Year: pointy.Int32(2025),
        Month: pointy.Int32(1),
        Day: nil,
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\DescribeRefundHistoriesByDateRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->describeRefundHistoriesByDate(
        (new DescribeRefundHistoriesByDateRequest())
            ->withNamespaceName("namespace-0001")
            ->withYear(2025)
            ->withMonth(1)
            ->withDay(null)
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.DescribeRefundHistoriesByDateRequest;
import io.gs2.money2.result.DescribeRefundHistoriesByDateResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    DescribeRefundHistoriesByDateResult result = client.describeRefundHistoriesByDate(
        new DescribeRefundHistoriesByDateRequest()
            .withNamespaceName("namespace-0001")
            .withYear(2025)
            .withMonth(1)
            .withDay(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<RefundHistory> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DescribeRefundHistoriesByDateResult> asyncResult = null;
yield return client.DescribeRefundHistoriesByDate(
    new Gs2.Gs2Money2.Request.DescribeRefundHistoriesByDateRequest()
        .WithNamespaceName("namespace-0001")
        .WithYear(2025)
        .WithMonth(1)
        .WithDay(null)
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.describeRefundHistoriesByDate(
        new Gs2Money2.DescribeRefundHistoriesByDateRequest()
            .withNamespaceName("namespace-0001")
            .withYear(2025)
            .withMonth(1)
            .withDay(null)
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.describe_refund_histories_by_date(
        money2.DescribeRefundHistoriesByDateRequest()
            .with_namespace_name('namespace-0001')
            .with_year(2025)
            .with_month(1)
            .with_day(None)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.describe_refund_histories_by_date({
    namespaceName="namespace-0001",
    year=2025,
    month=1,
    day=nil,
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('money2')

api_result_handler = client.describe_refund_histories_by_date_async({
    namespaceName="namespace-0001",
    year=2025,
    month=1,
    day=nil,
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

getRefundHistory

Get refund history by specifying a transaction ID

Retrieves a specific refund history record by its transaction ID.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
transactionId string
~ 1024 chars Transaction ID
The unique transaction identifier assigned by the store platform. Used to prevent duplicate processing of the same purchase.

Result

Type Description
item RefundHistory Subscription status

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.GetRefundHistory(
    &money2.GetRefundHistoryRequest {
        NamespaceName: pointy.String("namespace-0001"),
        TransactionId: pointy.String("transaction-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\GetRefundHistoryRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->getRefundHistory(
        (new GetRefundHistoryRequest())
            ->withNamespaceName("namespace-0001")
            ->withTransactionId("transaction-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.GetRefundHistoryRequest;
import io.gs2.money2.result.GetRefundHistoryResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    GetRefundHistoryResult result = client.getRefundHistory(
        new GetRefundHistoryRequest()
            .withNamespaceName("namespace-0001")
            .withTransactionId("transaction-0001")
    );
    RefundHistory item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.GetRefundHistoryResult> asyncResult = null;
yield return client.GetRefundHistory(
    new Gs2.Gs2Money2.Request.GetRefundHistoryRequest()
        .WithNamespaceName("namespace-0001")
        .WithTransactionId("transaction-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.getRefundHistory(
        new Gs2Money2.GetRefundHistoryRequest()
            .withNamespaceName("namespace-0001")
            .withTransactionId("transaction-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.get_refund_history(
        money2.GetRefundHistoryRequest()
            .with_namespace_name('namespace-0001')
            .with_transaction_id('transaction-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.get_refund_history({
    namespaceName="namespace-0001",
    transactionId="transaction-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.get_refund_history_async({
    namespaceName="namespace-0001",
    transactionId="transaction-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

describeDailyTransactionHistoriesByCurrency

Get a list of daily transaction histories by specifying currency

Retrieves a paginated list of daily transaction histories filtered by the specified currency and year. Can optionally filter by month.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
currency string
~ 8 chars Currency Code
year int
2000 ~ 3000 Year
month int 1 ~ 12 Month
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data items to retrieve

Result

Type Description
items List<DailyTransactionHistory> List of Daily Transaction Histories
nextPageToken string Page token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.DescribeDailyTransactionHistoriesByCurrency(
    &money2.DescribeDailyTransactionHistoriesByCurrencyRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Currency: pointy.String("JPY"),
        Year: pointy.Int32(2024),
        Month: pointy.Int32(1),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\DescribeDailyTransactionHistoriesByCurrencyRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->describeDailyTransactionHistoriesByCurrency(
        (new DescribeDailyTransactionHistoriesByCurrencyRequest())
            ->withNamespaceName("namespace-0001")
            ->withCurrency("JPY")
            ->withYear(2024)
            ->withMonth(1)
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.DescribeDailyTransactionHistoriesByCurrencyRequest;
import io.gs2.money2.result.DescribeDailyTransactionHistoriesByCurrencyResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    DescribeDailyTransactionHistoriesByCurrencyResult result = client.describeDailyTransactionHistoriesByCurrency(
        new DescribeDailyTransactionHistoriesByCurrencyRequest()
            .withNamespaceName("namespace-0001")
            .withCurrency("JPY")
            .withYear(2024)
            .withMonth(1)
            .withPageToken(null)
            .withLimit(null)
    );
    List<DailyTransactionHistory> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DescribeDailyTransactionHistoriesByCurrencyResult> asyncResult = null;
yield return client.DescribeDailyTransactionHistoriesByCurrency(
    new Gs2.Gs2Money2.Request.DescribeDailyTransactionHistoriesByCurrencyRequest()
        .WithNamespaceName("namespace-0001")
        .WithCurrency("JPY")
        .WithYear(2024)
        .WithMonth(1)
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.describeDailyTransactionHistoriesByCurrency(
        new Gs2Money2.DescribeDailyTransactionHistoriesByCurrencyRequest()
            .withNamespaceName("namespace-0001")
            .withCurrency("JPY")
            .withYear(2024)
            .withMonth(1)
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.describe_daily_transaction_histories_by_currency(
        money2.DescribeDailyTransactionHistoriesByCurrencyRequest()
            .with_namespace_name('namespace-0001')
            .with_currency('JPY')
            .with_year(2024)
            .with_month(1)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.describe_daily_transaction_histories_by_currency({
    namespaceName="namespace-0001",
    currency="JPY",
    year=2024,
    month=1,
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('money2')

api_result_handler = client.describe_daily_transaction_histories_by_currency_async({
    namespaceName="namespace-0001",
    currency="JPY",
    year=2024,
    month=1,
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

describeDailyTransactionHistories

Get a list of daily transaction histories

Retrieves a paginated list of daily transaction histories for the specified year. Can optionally filter by month, and further by day when a month is specified.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
year int
2000 ~ 3000 Year
month int 1 ~ 12 Month
day int {month} > 0 1 ~ 31 Day
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data items to retrieve

Result

Type Description
items List<DailyTransactionHistory> List of Daily Transaction Histories
nextPageToken string Page token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.DescribeDailyTransactionHistories(
    &money2.DescribeDailyTransactionHistoriesRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Year: pointy.Int32(2024),
        Month: pointy.Int32(1),
        Day: pointy.Int32(2),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\DescribeDailyTransactionHistoriesRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->describeDailyTransactionHistories(
        (new DescribeDailyTransactionHistoriesRequest())
            ->withNamespaceName("namespace-0001")
            ->withYear(2024)
            ->withMonth(1)
            ->withDay(2)
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.DescribeDailyTransactionHistoriesRequest;
import io.gs2.money2.result.DescribeDailyTransactionHistoriesResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    DescribeDailyTransactionHistoriesResult result = client.describeDailyTransactionHistories(
        new DescribeDailyTransactionHistoriesRequest()
            .withNamespaceName("namespace-0001")
            .withYear(2024)
            .withMonth(1)
            .withDay(2)
            .withPageToken(null)
            .withLimit(null)
    );
    List<DailyTransactionHistory> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DescribeDailyTransactionHistoriesResult> asyncResult = null;
yield return client.DescribeDailyTransactionHistories(
    new Gs2.Gs2Money2.Request.DescribeDailyTransactionHistoriesRequest()
        .WithNamespaceName("namespace-0001")
        .WithYear(2024)
        .WithMonth(1)
        .WithDay(2)
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.describeDailyTransactionHistories(
        new Gs2Money2.DescribeDailyTransactionHistoriesRequest()
            .withNamespaceName("namespace-0001")
            .withYear(2024)
            .withMonth(1)
            .withDay(2)
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.describe_daily_transaction_histories(
        money2.DescribeDailyTransactionHistoriesRequest()
            .with_namespace_name('namespace-0001')
            .with_year(2024)
            .with_month(1)
            .with_day(2)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.describe_daily_transaction_histories({
    namespaceName="namespace-0001",
    year=2024,
    month=1,
    day=2,
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('money2')

api_result_handler = client.describe_daily_transaction_histories_async({
    namespaceName="namespace-0001",
    year=2024,
    month=1,
    day=2,
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

getDailyTransactionHistory

Get daily transaction history by specifying date and currency

Retrieves a specific daily transaction history record for the specified date and currency. The record contains deposit/withdrawal amounts and issue/consume counts for that day.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
year int
2000 ~ 3000 Year
month int
1 ~ 12 Month
day int
1 ~ 31 Day
currency string
~ 8 chars Currency Code

Result

Type Description
item DailyTransactionHistory DailyTransactionHistory

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.GetDailyTransactionHistory(
    &money2.GetDailyTransactionHistoryRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Year: pointy.Int32(2024),
        Month: pointy.Int32(1),
        Day: pointy.Int32(2),
        Currency: pointy.String("JPY"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\GetDailyTransactionHistoryRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->getDailyTransactionHistory(
        (new GetDailyTransactionHistoryRequest())
            ->withNamespaceName("namespace-0001")
            ->withYear(2024)
            ->withMonth(1)
            ->withDay(2)
            ->withCurrency("JPY")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.GetDailyTransactionHistoryRequest;
import io.gs2.money2.result.GetDailyTransactionHistoryResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    GetDailyTransactionHistoryResult result = client.getDailyTransactionHistory(
        new GetDailyTransactionHistoryRequest()
            .withNamespaceName("namespace-0001")
            .withYear(2024)
            .withMonth(1)
            .withDay(2)
            .withCurrency("JPY")
    );
    DailyTransactionHistory item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.GetDailyTransactionHistoryResult> asyncResult = null;
yield return client.GetDailyTransactionHistory(
    new Gs2.Gs2Money2.Request.GetDailyTransactionHistoryRequest()
        .WithNamespaceName("namespace-0001")
        .WithYear(2024)
        .WithMonth(1)
        .WithDay(2)
        .WithCurrency("JPY"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.getDailyTransactionHistory(
        new Gs2Money2.GetDailyTransactionHistoryRequest()
            .withNamespaceName("namespace-0001")
            .withYear(2024)
            .withMonth(1)
            .withDay(2)
            .withCurrency("JPY")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.get_daily_transaction_history(
        money2.GetDailyTransactionHistoryRequest()
            .with_namespace_name('namespace-0001')
            .with_year(2024)
            .with_month(1)
            .with_day(2)
            .with_currency('JPY')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.get_daily_transaction_history({
    namespaceName="namespace-0001",
    year=2024,
    month=1,
    day=2,
    currency="JPY",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.get_daily_transaction_history_async({
    namespaceName="namespace-0001",
    year=2024,
    month=1,
    day=2,
    currency="JPY",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

describeUnusedBalances

Get a list of Unused Balances

Retrieves a paginated list of unused balance records for the namespace. Each record represents the unused paid currency balance for a specific currency.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data items to retrieve

Result

Type Description
items List<UnusedBalance> List of Unused Balances
nextPageToken string Page token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.DescribeUnusedBalances(
    &money2.DescribeUnusedBalancesRequest {
        NamespaceName: pointy.String("namespace-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\DescribeUnusedBalancesRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->describeUnusedBalances(
        (new DescribeUnusedBalancesRequest())
            ->withNamespaceName("namespace-0001")
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.DescribeUnusedBalancesRequest;
import io.gs2.money2.result.DescribeUnusedBalancesResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    DescribeUnusedBalancesResult result = client.describeUnusedBalances(
        new DescribeUnusedBalancesRequest()
            .withNamespaceName("namespace-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<UnusedBalance> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DescribeUnusedBalancesResult> asyncResult = null;
yield return client.DescribeUnusedBalances(
    new Gs2.Gs2Money2.Request.DescribeUnusedBalancesRequest()
        .WithNamespaceName("namespace-0001")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.describeUnusedBalances(
        new Gs2Money2.DescribeUnusedBalancesRequest()
            .withNamespaceName("namespace-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.describe_unused_balances(
        money2.DescribeUnusedBalancesRequest()
            .with_namespace_name('namespace-0001')
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.describe_unused_balances({
    namespaceName="namespace-0001",
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('money2')

api_result_handler = client.describe_unused_balances_async({
    namespaceName="namespace-0001",
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

getUnusedBalance

Get Unused Balance by specifying a currency

Retrieves the unused balance for the specified currency.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
currency string
~ 8 chars Currency Code
The ISO currency code (e.g., “JPY”, “USD”) for which the unused balance is tracked.

Result

Type Description
item UnusedBalance Unused Balance

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.GetUnusedBalance(
    &money2.GetUnusedBalanceRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Currency: pointy.String("JPY"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\GetUnusedBalanceRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->getUnusedBalance(
        (new GetUnusedBalanceRequest())
            ->withNamespaceName("namespace-0001")
            ->withCurrency("JPY")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.GetUnusedBalanceRequest;
import io.gs2.money2.result.GetUnusedBalanceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    GetUnusedBalanceResult result = client.getUnusedBalance(
        new GetUnusedBalanceRequest()
            .withNamespaceName("namespace-0001")
            .withCurrency("JPY")
    );
    UnusedBalance item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.GetUnusedBalanceResult> asyncResult = null;
yield return client.GetUnusedBalance(
    new Gs2.Gs2Money2.Request.GetUnusedBalanceRequest()
        .WithNamespaceName("namespace-0001")
        .WithCurrency("JPY"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.getUnusedBalance(
        new Gs2Money2.GetUnusedBalanceRequest()
            .withNamespaceName("namespace-0001")
            .withCurrency("JPY")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.get_unused_balance(
        money2.GetUnusedBalanceRequest()
            .with_namespace_name('namespace-0001')
            .with_currency('JPY')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.get_unused_balance({
    namespaceName="namespace-0001",
    currency="JPY",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.get_unused_balance_async({
    namespaceName="namespace-0001",
    currency="JPY",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

describeStoreContentModels

Get a list of Store Content Model

Retrieves the list of currently active store content models. These models define the purchasable content items with their platform-specific product identifiers.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
items List<StoreContentModel> List of Store Content Models

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.DescribeStoreContentModels(
    &money2.DescribeStoreContentModelsRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\DescribeStoreContentModelsRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->describeStoreContentModels(
        (new DescribeStoreContentModelsRequest())
            ->withNamespaceName("namespace-0001")
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.DescribeStoreContentModelsRequest;
import io.gs2.money2.result.DescribeStoreContentModelsResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    DescribeStoreContentModelsResult result = client.describeStoreContentModels(
        new DescribeStoreContentModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    List<StoreContentModel> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DescribeStoreContentModelsResult> asyncResult = null;
yield return client.DescribeStoreContentModels(
    new Gs2.Gs2Money2.Request.DescribeStoreContentModelsRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.describeStoreContentModels(
        new Gs2Money2.DescribeStoreContentModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.describe_store_content_models(
        money2.DescribeStoreContentModelsRequest()
            .with_namespace_name('namespace-0001')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.describe_store_content_models({
    namespaceName="namespace-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
client = gs2('money2')

api_result_handler = client.describe_store_content_models_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;

getStoreContentModel

Get Store Content Model

Retrieves the specified store content model including its Apple App Store and Google Play configurations.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
contentName string
~ 128 chars Store Content Model name

Result

Type Description
item StoreContentModel Store Content Model

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.GetStoreContentModel(
    &money2.GetStoreContentModelRequest {
        NamespaceName: pointy.String("namespace-0001"),
        ContentName: pointy.String("content-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\GetStoreContentModelRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->getStoreContentModel(
        (new GetStoreContentModelRequest())
            ->withNamespaceName("namespace-0001")
            ->withContentName("content-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.GetStoreContentModelRequest;
import io.gs2.money2.result.GetStoreContentModelResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    GetStoreContentModelResult result = client.getStoreContentModel(
        new GetStoreContentModelRequest()
            .withNamespaceName("namespace-0001")
            .withContentName("content-0001")
    );
    StoreContentModel item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.GetStoreContentModelResult> asyncResult = null;
yield return client.GetStoreContentModel(
    new Gs2.Gs2Money2.Request.GetStoreContentModelRequest()
        .WithNamespaceName("namespace-0001")
        .WithContentName("content-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.getStoreContentModel(
        new Gs2Money2.GetStoreContentModelRequest()
            .withNamespaceName("namespace-0001")
            .withContentName("content-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.get_store_content_model(
        money2.GetStoreContentModelRequest()
            .with_namespace_name('namespace-0001')
            .with_content_name('content-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.get_store_content_model({
    namespaceName="namespace-0001",
    contentName="content-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.get_store_content_model_async({
    namespaceName="namespace-0001",
    contentName="content-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

describeStoreSubscriptionContentModels

Get a list of Store Subscription Content Models

Retrieves the list of currently active store subscription content models. These models define the subscription products with their platform-specific settings and scheduling parameters.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
items List<StoreSubscriptionContentModel> List of Store Subscription Content Models

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.DescribeStoreSubscriptionContentModels(
    &money2.DescribeStoreSubscriptionContentModelsRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\DescribeStoreSubscriptionContentModelsRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->describeStoreSubscriptionContentModels(
        (new DescribeStoreSubscriptionContentModelsRequest())
            ->withNamespaceName("namespace-0001")
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.DescribeStoreSubscriptionContentModelsRequest;
import io.gs2.money2.result.DescribeStoreSubscriptionContentModelsResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    DescribeStoreSubscriptionContentModelsResult result = client.describeStoreSubscriptionContentModels(
        new DescribeStoreSubscriptionContentModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    List<StoreSubscriptionContentModel> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DescribeStoreSubscriptionContentModelsResult> asyncResult = null;
yield return client.DescribeStoreSubscriptionContentModels(
    new Gs2.Gs2Money2.Request.DescribeStoreSubscriptionContentModelsRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.describeStoreSubscriptionContentModels(
        new Gs2Money2.DescribeStoreSubscriptionContentModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.describe_store_subscription_content_models(
        money2.DescribeStoreSubscriptionContentModelsRequest()
            .with_namespace_name('namespace-0001')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.describe_store_subscription_content_models({
    namespaceName="namespace-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
client = gs2('money2')

api_result_handler = client.describe_store_subscription_content_models_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;

getStoreSubscriptionContentModel

Get Store Subscription Content Model

Retrieves the specified store subscription content model.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
contentName string
~ 128 chars Store Subscription Content Model name

Result

Type Description
item StoreSubscriptionContentModel Store Subscription Content Model

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.GetStoreSubscriptionContentModel(
    &money2.GetStoreSubscriptionContentModelRequest {
        NamespaceName: pointy.String("namespace-0001"),
        ContentName: pointy.String("content-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\GetStoreSubscriptionContentModelRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->getStoreSubscriptionContentModel(
        (new GetStoreSubscriptionContentModelRequest())
            ->withNamespaceName("namespace-0001")
            ->withContentName("content-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.GetStoreSubscriptionContentModelRequest;
import io.gs2.money2.result.GetStoreSubscriptionContentModelResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    GetStoreSubscriptionContentModelResult result = client.getStoreSubscriptionContentModel(
        new GetStoreSubscriptionContentModelRequest()
            .withNamespaceName("namespace-0001")
            .withContentName("content-0001")
    );
    StoreSubscriptionContentModel item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.GetStoreSubscriptionContentModelResult> asyncResult = null;
yield return client.GetStoreSubscriptionContentModel(
    new Gs2.Gs2Money2.Request.GetStoreSubscriptionContentModelRequest()
        .WithNamespaceName("namespace-0001")
        .WithContentName("content-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.getStoreSubscriptionContentModel(
        new Gs2Money2.GetStoreSubscriptionContentModelRequest()
            .withNamespaceName("namespace-0001")
            .withContentName("content-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.get_store_subscription_content_model(
        money2.GetStoreSubscriptionContentModelRequest()
            .with_namespace_name('namespace-0001')
            .with_content_name('content-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.get_store_subscription_content_model({
    namespaceName="namespace-0001",
    contentName="content-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.get_store_subscription_content_model_async({
    namespaceName="namespace-0001",
    contentName="content-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

exportMaster

Export Model Master in a master data format that can be activated

Exports the currently registered model masters (store content models and subscription content models) in an activatable master data format.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item CurrentModelMaster Master data that can be activated

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.ExportMaster(
    &money2.ExportMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\ExportMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->exportMaster(
        (new ExportMasterRequest())
            ->withNamespaceName("namespace-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.ExportMasterRequest;
import io.gs2.money2.result.ExportMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    ExportMasterResult result = client.exportMaster(
        new ExportMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    CurrentModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.ExportMasterResult> asyncResult = null;
yield return client.ExportMaster(
    new Gs2.Gs2Money2.Request.ExportMasterRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.exportMaster(
        new Gs2Money2.ExportMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.export_master(
        money2.ExportMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.export_master({
    namespaceName="namespace-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.export_master_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

getCurrentModelMaster

Get currently active Models master data

Retrieves the currently active model master data including store content models and subscription content models.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item CurrentModelMaster Updated master data of the currently active Models

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.GetCurrentModelMaster(
    &money2.GetCurrentModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\GetCurrentModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->getCurrentModelMaster(
        (new GetCurrentModelMasterRequest())
            ->withNamespaceName("namespace-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.GetCurrentModelMasterRequest;
import io.gs2.money2.result.GetCurrentModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    GetCurrentModelMasterResult result = client.getCurrentModelMaster(
        new GetCurrentModelMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    CurrentModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.GetCurrentModelMasterResult> asyncResult = null;
yield return client.GetCurrentModelMaster(
    new Gs2.Gs2Money2.Request.GetCurrentModelMasterRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.getCurrentModelMaster(
        new Gs2Money2.GetCurrentModelMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.get_current_model_master(
        money2.GetCurrentModelMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.get_current_model_master({
    namespaceName="namespace-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.get_current_model_master_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

preUpdateCurrentModelMaster

Update currently active Models master data (3-phase version)

When uploading master data larger than 1MB, the update is performed in 3 phases.

  1. Execute this API to obtain a token and URL for uploading.
  2. Upload the master data to the obtained URL.
  3. Execute UpdateCurrentModelMaster by passing the token obtained from the the upload to reflect the master data.
Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
uploadToken string Token used to reflect results after upload
uploadUrl string URL used to upload

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.PreUpdateCurrentModelMaster(
    &money2.PreUpdateCurrentModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
uploadToken := result.UploadToken
uploadUrl := result.UploadUrl
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\PreUpdateCurrentModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->preUpdateCurrentModelMaster(
        (new PreUpdateCurrentModelMasterRequest())
            ->withNamespaceName("namespace-0001")
    );
    $uploadToken = $result->getUploadToken();
    $uploadUrl = $result->getUploadUrl();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.PreUpdateCurrentModelMasterRequest;
import io.gs2.money2.result.PreUpdateCurrentModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    PreUpdateCurrentModelMasterResult result = client.preUpdateCurrentModelMaster(
        new PreUpdateCurrentModelMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    String uploadToken = result.getUploadToken();
    String uploadUrl = result.getUploadUrl();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.PreUpdateCurrentModelMasterResult> asyncResult = null;
yield return client.PreUpdateCurrentModelMaster(
    new Gs2.Gs2Money2.Request.PreUpdateCurrentModelMasterRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var uploadToken = result.UploadToken;
var uploadUrl = result.UploadUrl;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.preUpdateCurrentModelMaster(
        new Gs2Money2.PreUpdateCurrentModelMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    const uploadToken = result.getUploadToken();
    const uploadUrl = result.getUploadUrl();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.pre_update_current_model_master(
        money2.PreUpdateCurrentModelMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    upload_token = result.upload_token
    upload_url = result.upload_url
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.pre_update_current_model_master({
    namespaceName="namespace-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;
client = gs2('money2')

api_result_handler = client.pre_update_current_model_master_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;

updateCurrentModelMaster

Update currently active Models master data

Updates the currently active model master data. Supports both direct update mode and pre-upload mode for handling large master data.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
mode string (enum)
enum {
  “direct”,
  “preUpload”
}
“direct” Update mode
DefinitionDescription
“direct”Directly update master data
“preUpload”Upload master data and then update
settings string {mode} == “direct”
✓*
~ 5242880 chars Master Data
* Required if mode is “direct”
uploadToken string {mode} == “preUpload”
✓*
~ 1024 chars Token obtained by pre-upload
Used to apply the uploaded master data.
* Required if mode is “preUpload”

Result

Type Description
item CurrentModelMaster Updated master data of the currently active Models

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.UpdateCurrentModelMaster(
    &money2.UpdateCurrentModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Mode: pointy.String("direct"),
        Settings: pointy.String("{\"version\": \"2024-06-20\", \"storeContentModels\": [{\"name\": \"content-0001\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product1\"}, \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product1\"}}, {\"name\": \"content-0002\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product2\"}, \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product2\"}}, {\"name\": \"apple-only-0001\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product3\"}}, {\"name\": \"google-only-0001\", \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product3\"}}]}"),
        UploadToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\UpdateCurrentModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->updateCurrentModelMaster(
        (new UpdateCurrentModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withMode("direct")
            ->withSettings("{\"version\": \"2024-06-20\", \"storeContentModels\": [{\"name\": \"content-0001\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product1\"}, \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product1\"}}, {\"name\": \"content-0002\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product2\"}, \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product2\"}}, {\"name\": \"apple-only-0001\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product3\"}}, {\"name\": \"google-only-0001\", \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product3\"}}]}")
            ->withUploadToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.UpdateCurrentModelMasterRequest;
import io.gs2.money2.result.UpdateCurrentModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    UpdateCurrentModelMasterResult result = client.updateCurrentModelMaster(
        new UpdateCurrentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\"version\": \"2024-06-20\", \"storeContentModels\": [{\"name\": \"content-0001\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product1\"}, \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product1\"}}, {\"name\": \"content-0002\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product2\"}, \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product2\"}}, {\"name\": \"apple-only-0001\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product3\"}}, {\"name\": \"google-only-0001\", \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product3\"}}]}")
            .withUploadToken(null)
    );
    CurrentModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.UpdateCurrentModelMasterResult> asyncResult = null;
yield return client.UpdateCurrentModelMaster(
    new Gs2.Gs2Money2.Request.UpdateCurrentModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithMode("direct")
        .WithSettings("{\"version\": \"2024-06-20\", \"storeContentModels\": [{\"name\": \"content-0001\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product1\"}, \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product1\"}}, {\"name\": \"content-0002\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product2\"}, \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product2\"}}, {\"name\": \"apple-only-0001\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product3\"}}, {\"name\": \"google-only-0001\", \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product3\"}}]}")
        .WithUploadToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.updateCurrentModelMaster(
        new Gs2Money2.UpdateCurrentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\"version\": \"2024-06-20\", \"storeContentModels\": [{\"name\": \"content-0001\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product1\"}, \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product1\"}}, {\"name\": \"content-0002\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product2\"}, \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product2\"}}, {\"name\": \"apple-only-0001\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product3\"}}, {\"name\": \"google-only-0001\", \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product3\"}}]}")
            .withUploadToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.update_current_model_master(
        money2.UpdateCurrentModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_mode('direct')
            .with_settings('{"version": "2024-06-20", "storeContentModels": [{"name": "content-0001", "appleAppStore": {"productId": "io.gs2.sample.apple.product1"}, "googlePlay": {"productId": "io.gs2.sample.google.product1"}}, {"name": "content-0002", "appleAppStore": {"productId": "io.gs2.sample.apple.product2"}, "googlePlay": {"productId": "io.gs2.sample.google.product2"}}, {"name": "apple-only-0001", "appleAppStore": {"productId": "io.gs2.sample.apple.product3"}}, {"name": "google-only-0001", "googlePlay": {"productId": "io.gs2.sample.google.product3"}}]}')
            .with_upload_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.update_current_model_master({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\"version\": \"2024-06-20\", \"storeContentModels\": [{\"name\": \"content-0001\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product1\"}, \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product1\"}}, {\"name\": \"content-0002\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product2\"}, \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product2\"}}, {\"name\": \"apple-only-0001\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product3\"}}, {\"name\": \"google-only-0001\", \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product3\"}}]}",
    uploadToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.update_current_model_master_async({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\"version\": \"2024-06-20\", \"storeContentModels\": [{\"name\": \"content-0001\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product1\"}, \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product1\"}}, {\"name\": \"content-0002\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product2\"}, \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product2\"}}, {\"name\": \"apple-only-0001\", \"appleAppStore\": {\"productId\": \"io.gs2.sample.apple.product3\"}}, {\"name\": \"google-only-0001\", \"googlePlay\": {\"productId\": \"io.gs2.sample.google.product3\"}}]}",
    uploadToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

updateCurrentModelMasterFromGitHub

Update currently active Models master data from GitHub

Updates the currently active model master data by checking out master data from a GitHub repository using the specified checkout settings.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
checkoutSetting GitHubCheckoutSetting
Setting for checking out master data from GitHub

Result

Type Description
item CurrentModelMaster Updated master data of the currently active Models

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.UpdateCurrentModelMasterFromGitHub(
    &money2.UpdateCurrentModelMasterFromGitHubRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CheckoutSetting: &money2.GitHubCheckoutSetting{
            ApiKeyId: pointy.String("apiKeyId-0001"),
            RepositoryName: pointy.String("gs2io/master-data"),
            SourcePath: pointy.String("path/to/file.json"),
            ReferenceType: pointy.String("branch"),
            BranchName: pointy.String("develop"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\UpdateCurrentModelMasterFromGitHubRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->updateCurrentModelMasterFromGitHub(
        (new UpdateCurrentModelMasterFromGitHubRequest())
            ->withNamespaceName("namespace-0001")
            ->withCheckoutSetting((new GitHubCheckoutSetting())
                ->withApiKeyId("apiKeyId-0001")
                ->withRepositoryName("gs2io/master-data")
                ->withSourcePath("path/to/file.json")
                ->withReferenceType("branch")
                ->withBranchName("develop")
            )
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.UpdateCurrentModelMasterFromGitHubRequest;
import io.gs2.money2.result.UpdateCurrentModelMasterFromGitHubResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    UpdateCurrentModelMasterFromGitHubResult result = client.updateCurrentModelMasterFromGitHub(
        new UpdateCurrentModelMasterFromGitHubRequest()
            .withNamespaceName("namespace-0001")
            .withCheckoutSetting(new GitHubCheckoutSetting()
                .withApiKeyId("apiKeyId-0001")
                .withRepositoryName("gs2io/master-data")
                .withSourcePath("path/to/file.json")
                .withReferenceType("branch")
                .withBranchName("develop")
            )
    );
    CurrentModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.UpdateCurrentModelMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentModelMasterFromGitHub(
    new Gs2.Gs2Money2.Request.UpdateCurrentModelMasterFromGitHubRequest()
        .WithNamespaceName("namespace-0001")
        .WithCheckoutSetting(new Gs2.Gs2Money2.Model.GitHubCheckoutSetting()
            .WithApiKeyId("apiKeyId-0001")
            .WithRepositoryName("gs2io/master-data")
            .WithSourcePath("path/to/file.json")
            .WithReferenceType("branch")
            .WithBranchName("develop")
        ),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.updateCurrentModelMasterFromGitHub(
        new Gs2Money2.UpdateCurrentModelMasterFromGitHubRequest()
            .withNamespaceName("namespace-0001")
            .withCheckoutSetting(new Gs2Money2.model.GitHubCheckoutSetting()
                .withApiKeyId("apiKeyId-0001")
                .withRepositoryName("gs2io/master-data")
                .withSourcePath("path/to/file.json")
                .withReferenceType("branch")
                .withBranchName("develop")
            )
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.update_current_model_master_from_git_hub(
        money2.UpdateCurrentModelMasterFromGitHubRequest()
            .with_namespace_name('namespace-0001')
            .with_checkout_setting(money2.GitHubCheckoutSetting()
                .with_api_key_id('apiKeyId-0001')
                .with_repository_name('gs2io/master-data')
                .with_source_path('path/to/file.json')
                .with_reference_type('branch')
                .with_branch_name('develop')
            )
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.update_current_model_master_from_git_hub({
    namespaceName="namespace-0001",
    checkoutSetting={
        api_key_id="apiKeyId-0001",
        repository_name="gs2io/master-data",
        source_path="path/to/file.json",
        reference_type="branch",
        branch_name="develop",
    },
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.update_current_model_master_from_git_hub_async({
    namespaceName="namespace-0001",
    checkoutSetting={
        api_key_id="apiKeyId-0001",
        repository_name="gs2io/master-data",
        source_path="path/to/file.json",
        reference_type="branch",
        branch_name="develop",
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

describeStoreContentModelMasters

Get a list of Store Content Model Masters

Retrieves a paginated list of store content model masters. Can filter by name prefix.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
namePrefix string ~ 64 chars Filter by Store Content name prefix
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data items to retrieve

Result

Type Description
items List<StoreContentModelMaster> List of Store Content Model Masters
nextPageToken string Page token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.DescribeStoreContentModelMasters(
    &money2.DescribeStoreContentModelMastersRequest {
        NamespaceName: pointy.String("namespace-0001"),
        NamePrefix: nil,
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\DescribeStoreContentModelMastersRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->describeStoreContentModelMasters(
        (new DescribeStoreContentModelMastersRequest())
            ->withNamespaceName("namespace-0001")
            ->withNamePrefix(null)
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.DescribeStoreContentModelMastersRequest;
import io.gs2.money2.result.DescribeStoreContentModelMastersResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    DescribeStoreContentModelMastersResult result = client.describeStoreContentModelMasters(
        new DescribeStoreContentModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<StoreContentModelMaster> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DescribeStoreContentModelMastersResult> asyncResult = null;
yield return client.DescribeStoreContentModelMasters(
    new Gs2.Gs2Money2.Request.DescribeStoreContentModelMastersRequest()
        .WithNamespaceName("namespace-0001")
        .WithNamePrefix(null)
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.describeStoreContentModelMasters(
        new Gs2Money2.DescribeStoreContentModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.describe_store_content_model_masters(
        money2.DescribeStoreContentModelMastersRequest()
            .with_namespace_name('namespace-0001')
            .with_name_prefix(None)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.describe_store_content_model_masters({
    namespaceName="namespace-0001",
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('money2')

api_result_handler = client.describe_store_content_model_masters_async({
    namespaceName="namespace-0001",
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

createStoreContentModelMaster

Create a new store content master

Creates a new store content model master with platform-specific settings for Apple App Store and Google Play product identifiers.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
name string
~ 128 chars Store Content Model name
description string ~ 1024 chars Description
metadata string ~ 1024 chars Metadata
appleAppStore AppleAppStoreContent Apple AppStore Content
The Apple App Store product information (product ID) for this store content. Used during receipt verification to match the purchased product.
googlePlay GooglePlayContent Google Play Content
The Google Play product information (product ID) for this store content. Used during receipt verification to match the purchased product.

Result

Type Description
item StoreContentModelMaster Store Content Master created

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.CreateStoreContentModelMaster(
    &money2.CreateStoreContentModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Name: pointy.String("content-0001"),
        Description: nil,
        Metadata: nil,
        AppleAppStore: &money2.AppleAppStoreContent{
            ProductId: pointy.String("io.gs2.sample.apple.product1"),
        },
        GooglePlay: &money2.GooglePlayContent{
            ProductId: pointy.String("io.gs2.sample.google.product1"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\CreateStoreContentModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->createStoreContentModelMaster(
        (new CreateStoreContentModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withName("content-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withAppleAppStore((new \Gs2\Money2\Model\AppleAppStoreContent())
                ->withProductId("io.gs2.sample.apple.product1"))
            ->withGooglePlay((new \Gs2\Money2\Model\GooglePlayContent())
                ->withProductId("io.gs2.sample.google.product1"))
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.CreateStoreContentModelMasterRequest;
import io.gs2.money2.result.CreateStoreContentModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    CreateStoreContentModelMasterResult result = client.createStoreContentModelMaster(
        new CreateStoreContentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("content-0001")
            .withDescription(null)
            .withMetadata(null)
            .withAppleAppStore(new io.gs2.money2.model.AppleAppStoreContent()
                .withProductId("io.gs2.sample.apple.product1"))
            .withGooglePlay(new io.gs2.money2.model.GooglePlayContent()
                .withProductId("io.gs2.sample.google.product1"))
    );
    StoreContentModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.CreateStoreContentModelMasterResult> asyncResult = null;
yield return client.CreateStoreContentModelMaster(
    new Gs2.Gs2Money2.Request.CreateStoreContentModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithName("content-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithAppleAppStore(new Gs2.Gs2Money2.Model.AppleAppStoreContent()
            .WithProductId("io.gs2.sample.apple.product1"))
        .WithGooglePlay(new Gs2.Gs2Money2.Model.GooglePlayContent()
            .WithProductId("io.gs2.sample.google.product1")),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.createStoreContentModelMaster(
        new Gs2Money2.CreateStoreContentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("content-0001")
            .withDescription(null)
            .withMetadata(null)
            .withAppleAppStore(new Gs2Money2.model.AppleAppStoreContent()
                .withProductId("io.gs2.sample.apple.product1"))
            .withGooglePlay(new Gs2Money2.model.GooglePlayContent()
                .withProductId("io.gs2.sample.google.product1"))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.create_store_content_model_master(
        money2.CreateStoreContentModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_name('content-0001')
            .with_description(None)
            .with_metadata(None)
            .with_apple_app_store(
                money2.AppleAppStoreContent()
                    .with_product_id('io.gs2.sample.apple.product1'))
            .with_google_play(
                money2.GooglePlayContent()
                    .with_product_id('io.gs2.sample.google.product1'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.create_store_content_model_master({
    namespaceName="namespace-0001",
    name="content-0001",
    description=nil,
    metadata=nil,
    appleAppStore={
        productId="io.gs2.sample.apple.product1",
    },
    googlePlay={
        productId="io.gs2.sample.google.product1",
    },
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.create_store_content_model_master_async({
    namespaceName="namespace-0001",
    name="content-0001",
    description=nil,
    metadata=nil,
    appleAppStore={
        productId="io.gs2.sample.apple.product1",
    },
    googlePlay={
        productId="io.gs2.sample.google.product1",
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

getStoreContentModelMaster

Get Store Content Master

Retrieves the specified store content model master.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
contentName string
~ 128 chars Store Content Model name

Result

Type Description
item StoreContentModelMaster Store Content Master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.GetStoreContentModelMaster(
    &money2.GetStoreContentModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        ContentName: pointy.String("content-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\GetStoreContentModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->getStoreContentModelMaster(
        (new GetStoreContentModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withContentName("content-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.GetStoreContentModelMasterRequest;
import io.gs2.money2.result.GetStoreContentModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    GetStoreContentModelMasterResult result = client.getStoreContentModelMaster(
        new GetStoreContentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withContentName("content-0001")
    );
    StoreContentModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.GetStoreContentModelMasterResult> asyncResult = null;
yield return client.GetStoreContentModelMaster(
    new Gs2.Gs2Money2.Request.GetStoreContentModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithContentName("content-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.getStoreContentModelMaster(
        new Gs2Money2.GetStoreContentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withContentName("content-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.get_store_content_model_master(
        money2.GetStoreContentModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_content_name('content-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.get_store_content_model_master({
    namespaceName="namespace-0001",
    contentName="content-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.get_store_content_model_master_async({
    namespaceName="namespace-0001",
    contentName="content-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

updateStoreContentModelMaster

Update Store Content Master

Updates the specified store content model master.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
contentName string
~ 128 chars Store Content Model name
description string ~ 1024 chars Description
metadata string ~ 1024 chars Metadata
appleAppStore AppleAppStoreContent Apple AppStore Content
The Apple App Store product information (product ID) for this store content. Used during receipt verification to match the purchased product.
googlePlay GooglePlayContent Google Play Content
The Google Play product information (product ID) for this store content. Used during receipt verification to match the purchased product.

Result

Type Description
item StoreContentModelMaster Store Content Master updated

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.UpdateStoreContentModelMaster(
    &money2.UpdateStoreContentModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        ContentName: pointy.String("content-0001"),
        Description: pointy.String("description1"),
        Metadata: nil,
        AppleAppStore: &money2.AppleAppStoreContent{
            ProductId: pointy.String("io.gs2.sample.apple.product2"),
        },
        GooglePlay: &money2.GooglePlayContent{
            ProductId: pointy.String("io.gs2.sample.google.product2"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\UpdateStoreContentModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->updateStoreContentModelMaster(
        (new UpdateStoreContentModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withContentName("content-0001")
            ->withDescription("description1")
            ->withMetadata(null)
            ->withAppleAppStore((new \Gs2\Money2\Model\AppleAppStoreContent())
                ->withProductId("io.gs2.sample.apple.product2"))
            ->withGooglePlay((new \Gs2\Money2\Model\GooglePlayContent())
                ->withProductId("io.gs2.sample.google.product2"))
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.UpdateStoreContentModelMasterRequest;
import io.gs2.money2.result.UpdateStoreContentModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    UpdateStoreContentModelMasterResult result = client.updateStoreContentModelMaster(
        new UpdateStoreContentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withContentName("content-0001")
            .withDescription("description1")
            .withMetadata(null)
            .withAppleAppStore(new io.gs2.money2.model.AppleAppStoreContent()
                .withProductId("io.gs2.sample.apple.product2"))
            .withGooglePlay(new io.gs2.money2.model.GooglePlayContent()
                .withProductId("io.gs2.sample.google.product2"))
    );
    StoreContentModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.UpdateStoreContentModelMasterResult> asyncResult = null;
yield return client.UpdateStoreContentModelMaster(
    new Gs2.Gs2Money2.Request.UpdateStoreContentModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithContentName("content-0001")
        .WithDescription("description1")
        .WithMetadata(null)
        .WithAppleAppStore(new Gs2.Gs2Money2.Model.AppleAppStoreContent()
            .WithProductId("io.gs2.sample.apple.product2"))
        .WithGooglePlay(new Gs2.Gs2Money2.Model.GooglePlayContent()
            .WithProductId("io.gs2.sample.google.product2")),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.updateStoreContentModelMaster(
        new Gs2Money2.UpdateStoreContentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withContentName("content-0001")
            .withDescription("description1")
            .withMetadata(null)
            .withAppleAppStore(new Gs2Money2.model.AppleAppStoreContent()
                .withProductId("io.gs2.sample.apple.product2"))
            .withGooglePlay(new Gs2Money2.model.GooglePlayContent()
                .withProductId("io.gs2.sample.google.product2"))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.update_store_content_model_master(
        money2.UpdateStoreContentModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_content_name('content-0001')
            .with_description('description1')
            .with_metadata(None)
            .with_apple_app_store(
                money2.AppleAppStoreContent()
                    .with_product_id('io.gs2.sample.apple.product2'))
            .with_google_play(
                money2.GooglePlayContent()
                    .with_product_id('io.gs2.sample.google.product2'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.update_store_content_model_master({
    namespaceName="namespace-0001",
    contentName="content-0001",
    description="description1",
    metadata=nil,
    appleAppStore={
        productId="io.gs2.sample.apple.product2",
    },
    googlePlay={
        productId="io.gs2.sample.google.product2",
    },
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.update_store_content_model_master_async({
    namespaceName="namespace-0001",
    contentName="content-0001",
    description="description1",
    metadata=nil,
    appleAppStore={
        productId="io.gs2.sample.apple.product2",
    },
    googlePlay={
        productId="io.gs2.sample.google.product2",
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

deleteStoreContentModelMaster

Delete Store Content Master

Deletes the specified store content model master.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
contentName string
~ 128 chars Store Content Model name

Result

Type Description
item StoreContentModelMaster Store Content Master deleted

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.DeleteStoreContentModelMaster(
    &money2.DeleteStoreContentModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        ContentName: pointy.String("content-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\DeleteStoreContentModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->deleteStoreContentModelMaster(
        (new DeleteStoreContentModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withContentName("content-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.DeleteStoreContentModelMasterRequest;
import io.gs2.money2.result.DeleteStoreContentModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    DeleteStoreContentModelMasterResult result = client.deleteStoreContentModelMaster(
        new DeleteStoreContentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withContentName("content-0001")
    );
    StoreContentModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DeleteStoreContentModelMasterResult> asyncResult = null;
yield return client.DeleteStoreContentModelMaster(
    new Gs2.Gs2Money2.Request.DeleteStoreContentModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithContentName("content-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.deleteStoreContentModelMaster(
        new Gs2Money2.DeleteStoreContentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withContentName("content-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.delete_store_content_model_master(
        money2.DeleteStoreContentModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_content_name('content-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.delete_store_content_model_master({
    namespaceName="namespace-0001",
    contentName="content-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.delete_store_content_model_master_async({
    namespaceName="namespace-0001",
    contentName="content-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

describeStoreSubscriptionContentModelMasters

Get a list of Store Subscription Content Model Masters

Retrieves a paginated list of store subscription content model masters. Can filter by name prefix.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
namePrefix string ~ 64 chars Filter by store subscription content name prefix
pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data
limit int 30 1 ~ 1000 Number of data items to retrieve

Result

Type Description
items List<StoreSubscriptionContentModelMaster> List of Store Subscription Content Model Masters
nextPageToken string Page token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.DescribeStoreSubscriptionContentModelMasters(
    &money2.DescribeStoreSubscriptionContentModelMastersRequest {
        NamespaceName: pointy.String("namespace-0001"),
        NamePrefix: nil,
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\DescribeStoreSubscriptionContentModelMastersRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->describeStoreSubscriptionContentModelMasters(
        (new DescribeStoreSubscriptionContentModelMastersRequest())
            ->withNamespaceName("namespace-0001")
            ->withNamePrefix(null)
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.DescribeStoreSubscriptionContentModelMastersRequest;
import io.gs2.money2.result.DescribeStoreSubscriptionContentModelMastersResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    DescribeStoreSubscriptionContentModelMastersResult result = client.describeStoreSubscriptionContentModelMasters(
        new DescribeStoreSubscriptionContentModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<StoreSubscriptionContentModelMaster> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DescribeStoreSubscriptionContentModelMastersResult> asyncResult = null;
yield return client.DescribeStoreSubscriptionContentModelMasters(
    new Gs2.Gs2Money2.Request.DescribeStoreSubscriptionContentModelMastersRequest()
        .WithNamespaceName("namespace-0001")
        .WithNamePrefix(null)
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.describeStoreSubscriptionContentModelMasters(
        new Gs2Money2.DescribeStoreSubscriptionContentModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.describe_store_subscription_content_model_masters(
        money2.DescribeStoreSubscriptionContentModelMastersRequest()
            .with_namespace_name('namespace-0001')
            .with_name_prefix(None)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.describe_store_subscription_content_model_masters({
    namespaceName="namespace-0001",
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('money2')

api_result_handler = client.describe_store_subscription_content_model_masters_async({
    namespaceName="namespace-0001",
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

createStoreSubscriptionContentModelMaster

Create a new Store Subscription Content Model Master

Creates a new store subscription content model master with scheduling parameters and platform-specific settings for Apple App Store and Google Play.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
name string
~ 128 chars Store Subscription Content Model name
description string ~ 1024 chars Description
metadata string ~ 1024 chars Metadata
scheduleNamespaceId string
~ 1024 chars Namespace GRN of GS2-Schedule to link the subscription period
triggerName string
~ 128 chars Trigger name to reflect the subscription period
The name of the GS2-Schedule trigger that will be activated to reflect the subscription’s active period. The trigger duration is set to the subscription’s expiration time.
triggerExtendMode string (enum)
enum {
  “just”,
  “rollupHour”
}
“just” Mode to reflect the subscription period on the trigger
Controls how the subscription expiration is mapped to the trigger duration. “just” uses the exact subscription period. “rollupHour” extends the period to the next specified hour (UTC) to avoid mid-day expirations.
DefinitionDescription
“just”Reflect the subscription period as it is
“rollupHour”Extend the subscription period to the next day crossing time
rollupHour int {triggerExtendMode} == “rollupHour” 0 0 ~ 23 Hour of the day to roll up the subscription period (UTC)
When triggerExtendMode is “rollupHour”, the subscription period is extended to this hour (0-23, UTC) on the expiration day. This prevents subscriptions from expiring in the middle of a user’s play session.
* Required if triggerExtendMode is “rollupHour”
reallocateSpanDays int 30 0 ~ 365 Time span (days) that allows subscription contract information to be assigned to other users
The number of days after the last allocation before a subscription contract can be reassigned to a different user. This prevents abuse when users change accounts, by enforcing a waiting period before the subscription can be transferred.
appleAppStore AppleAppStoreSubscriptionContent Apple AppStore Content
The Apple App Store subscription information (subscription group identifier) for this subscription content.
googlePlay GooglePlaySubscriptionContent Google Play Content
The Google Play subscription information (product ID) for this subscription content.

Result

Type Description
item StoreSubscriptionContentModelMaster Store Subscription Content Model Master created

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.CreateStoreSubscriptionContentModelMaster(
    &money2.CreateStoreSubscriptionContentModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Name: pointy.String("content-0001"),
        Description: nil,
        Metadata: nil,
        ScheduleNamespaceId: pointy.String("grn:ap-northeast-1:YourOwnerId:schedule:namespaceName"),
        TriggerName: pointy.String("trigger-0001"),
        TriggerExtendMode: nil,
        RollupHour: nil,
        ReallocateSpanDays: nil,
        AppleAppStore: &money2.AppleAppStoreSubscriptionContent{
            SubscriptionGroupIdentifier: pointy.String("21642260"),
        },
        GooglePlay: &money2.GooglePlaySubscriptionContent{
            ProductId: pointy.String("io.gs2.sample.google.product1"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\CreateStoreSubscriptionContentModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->createStoreSubscriptionContentModelMaster(
        (new CreateStoreSubscriptionContentModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withName("content-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withScheduleNamespaceId("grn:ap-northeast-1:YourOwnerId:schedule:namespaceName")
            ->withTriggerName("trigger-0001")
            ->withTriggerExtendMode(null)
            ->withRollupHour(null)
            ->withReallocateSpanDays(null)
            ->withAppleAppStore((new \Gs2\Money2\Model\AppleAppStoreSubscriptionContent())
                ->withSubscriptionGroupIdentifier("21642260"))
            ->withGooglePlay((new \Gs2\Money2\Model\GooglePlaySubscriptionContent())
                ->withProductId("io.gs2.sample.google.product1"))
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.CreateStoreSubscriptionContentModelMasterRequest;
import io.gs2.money2.result.CreateStoreSubscriptionContentModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    CreateStoreSubscriptionContentModelMasterResult result = client.createStoreSubscriptionContentModelMaster(
        new CreateStoreSubscriptionContentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("content-0001")
            .withDescription(null)
            .withMetadata(null)
            .withScheduleNamespaceId("grn:ap-northeast-1:YourOwnerId:schedule:namespaceName")
            .withTriggerName("trigger-0001")
            .withTriggerExtendMode(null)
            .withRollupHour(null)
            .withReallocateSpanDays(null)
            .withAppleAppStore(new io.gs2.money2.model.AppleAppStoreSubscriptionContent()
                .withSubscriptionGroupIdentifier("21642260"))
            .withGooglePlay(new io.gs2.money2.model.GooglePlaySubscriptionContent()
                .withProductId("io.gs2.sample.google.product1"))
    );
    StoreSubscriptionContentModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.CreateStoreSubscriptionContentModelMasterResult> asyncResult = null;
yield return client.CreateStoreSubscriptionContentModelMaster(
    new Gs2.Gs2Money2.Request.CreateStoreSubscriptionContentModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithName("content-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithScheduleNamespaceId("grn:ap-northeast-1:YourOwnerId:schedule:namespaceName")
        .WithTriggerName("trigger-0001")
        .WithTriggerExtendMode(null)
        .WithRollupHour(null)
        .WithReallocateSpanDays(null)
        .WithAppleAppStore(new Gs2.Gs2Money2.Model.AppleAppStoreSubscriptionContent()
            .WithSubscriptionGroupIdentifier("21642260"))
        .WithGooglePlay(new Gs2.Gs2Money2.Model.GooglePlaySubscriptionContent()
            .WithProductId("io.gs2.sample.google.product1")),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.createStoreSubscriptionContentModelMaster(
        new Gs2Money2.CreateStoreSubscriptionContentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("content-0001")
            .withDescription(null)
            .withMetadata(null)
            .withScheduleNamespaceId("grn:ap-northeast-1:YourOwnerId:schedule:namespaceName")
            .withTriggerName("trigger-0001")
            .withTriggerExtendMode(null)
            .withRollupHour(null)
            .withReallocateSpanDays(null)
            .withAppleAppStore(new Gs2Money2.model.AppleAppStoreSubscriptionContent()
                .withSubscriptionGroupIdentifier("21642260"))
            .withGooglePlay(new Gs2Money2.model.GooglePlaySubscriptionContent()
                .withProductId("io.gs2.sample.google.product1"))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.create_store_subscription_content_model_master(
        money2.CreateStoreSubscriptionContentModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_name('content-0001')
            .with_description(None)
            .with_metadata(None)
            .with_schedule_namespace_id('grn:ap-northeast-1:YourOwnerId:schedule:namespaceName')
            .with_trigger_name('trigger-0001')
            .with_trigger_extend_mode(None)
            .with_rollup_hour(None)
            .with_reallocate_span_days(None)
            .with_apple_app_store(
                money2.AppleAppStoreSubscriptionContent()
                    .with_subscription_group_identifier('21642260'))
            .with_google_play(
                money2.GooglePlaySubscriptionContent()
                    .with_product_id('io.gs2.sample.google.product1'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.create_store_subscription_content_model_master({
    namespaceName="namespace-0001",
    name="content-0001",
    description=nil,
    metadata=nil,
    scheduleNamespaceId="grn:ap-northeast-1:YourOwnerId:schedule:namespaceName",
    triggerName="trigger-0001",
    triggerExtendMode=nil,
    rollupHour=nil,
    reallocateSpanDays=nil,
    appleAppStore={
        subscriptionGroupIdentifier="21642260",
    },
    googlePlay={
        productId="io.gs2.sample.google.product1",
    },
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.create_store_subscription_content_model_master_async({
    namespaceName="namespace-0001",
    name="content-0001",
    description=nil,
    metadata=nil,
    scheduleNamespaceId="grn:ap-northeast-1:YourOwnerId:schedule:namespaceName",
    triggerName="trigger-0001",
    triggerExtendMode=nil,
    rollupHour=nil,
    reallocateSpanDays=nil,
    appleAppStore={
        subscriptionGroupIdentifier="21642260",
    },
    googlePlay={
        productId="io.gs2.sample.google.product1",
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

getStoreSubscriptionContentModelMaster

Get Store Subscription Content Model Master

Retrieves the specified store subscription content model master.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
contentName string
~ 128 chars Store Subscription Content Model name

Result

Type Description
item StoreSubscriptionContentModelMaster Store Subscription Content Model Master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.GetStoreSubscriptionContentModelMaster(
    &money2.GetStoreSubscriptionContentModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        ContentName: pointy.String("content-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\GetStoreSubscriptionContentModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->getStoreSubscriptionContentModelMaster(
        (new GetStoreSubscriptionContentModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withContentName("content-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.GetStoreSubscriptionContentModelMasterRequest;
import io.gs2.money2.result.GetStoreSubscriptionContentModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    GetStoreSubscriptionContentModelMasterResult result = client.getStoreSubscriptionContentModelMaster(
        new GetStoreSubscriptionContentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withContentName("content-0001")
    );
    StoreSubscriptionContentModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.GetStoreSubscriptionContentModelMasterResult> asyncResult = null;
yield return client.GetStoreSubscriptionContentModelMaster(
    new Gs2.Gs2Money2.Request.GetStoreSubscriptionContentModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithContentName("content-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.getStoreSubscriptionContentModelMaster(
        new Gs2Money2.GetStoreSubscriptionContentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withContentName("content-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.get_store_subscription_content_model_master(
        money2.GetStoreSubscriptionContentModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_content_name('content-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.get_store_subscription_content_model_master({
    namespaceName="namespace-0001",
    contentName="content-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.get_store_subscription_content_model_master_async({
    namespaceName="namespace-0001",
    contentName="content-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

updateStoreSubscriptionContentModelMaster

Update Store Subscription Content Model Master

Updates the specified store subscription content model master.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
contentName string
~ 128 chars Store Subscription Content Model name
description string ~ 1024 chars Description
metadata string ~ 1024 chars Metadata
scheduleNamespaceId string
~ 1024 chars Namespace GRN of GS2-Schedule to link the subscription period
triggerName string
~ 128 chars Trigger name to reflect the subscription period
The name of the GS2-Schedule trigger that will be activated to reflect the subscription’s active period. The trigger duration is set to the subscription’s expiration time.
triggerExtendMode string (enum)
enum {
  “just”,
  “rollupHour”
}
“just” Mode to reflect the subscription period on the trigger
Controls how the subscription expiration is mapped to the trigger duration. “just” uses the exact subscription period. “rollupHour” extends the period to the next specified hour (UTC) to avoid mid-day expirations.
DefinitionDescription
“just”Reflect the subscription period as it is
“rollupHour”Extend the subscription period to the next day crossing time
rollupHour int {triggerExtendMode} == “rollupHour” 0 0 ~ 23 Hour of the day to roll up the subscription period (UTC)
When triggerExtendMode is “rollupHour”, the subscription period is extended to this hour (0-23, UTC) on the expiration day. This prevents subscriptions from expiring in the middle of a user’s play session.
* Required if triggerExtendMode is “rollupHour”
reallocateSpanDays int 30 0 ~ 365 Time span (days) that allows subscription contract information to be assigned to other users
The number of days after the last allocation before a subscription contract can be reassigned to a different user. This prevents abuse when users change accounts, by enforcing a waiting period before the subscription can be transferred.
appleAppStore AppleAppStoreSubscriptionContent Apple AppStore Content
The Apple App Store subscription information (subscription group identifier) for this subscription content.
googlePlay GooglePlaySubscriptionContent Google Play Content
The Google Play subscription information (product ID) for this subscription content.

Result

Type Description
item StoreSubscriptionContentModelMaster Store Subscription Content Model Master updated

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.UpdateStoreSubscriptionContentModelMaster(
    &money2.UpdateStoreSubscriptionContentModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        ContentName: pointy.String("content-0001"),
        Description: pointy.String("description1"),
        Metadata: nil,
        ScheduleNamespaceId: pointy.String("grn:ap-northeast-1:YourOwnerId:schedule:namespaceName"),
        TriggerName: pointy.String("trigger-0001"),
        TriggerExtendMode: nil,
        RollupHour: nil,
        ReallocateSpanDays: pointy.Int32(45),
        AppleAppStore: &money2.AppleAppStoreSubscriptionContent{
            SubscriptionGroupIdentifier: pointy.String("21642260"),
        },
        GooglePlay: &money2.GooglePlaySubscriptionContent{
            ProductId: pointy.String("io.gs2.sample.google.product2"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\UpdateStoreSubscriptionContentModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->updateStoreSubscriptionContentModelMaster(
        (new UpdateStoreSubscriptionContentModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withContentName("content-0001")
            ->withDescription("description1")
            ->withMetadata(null)
            ->withScheduleNamespaceId("grn:ap-northeast-1:YourOwnerId:schedule:namespaceName")
            ->withTriggerName("trigger-0001")
            ->withTriggerExtendMode(null)
            ->withRollupHour(null)
            ->withReallocateSpanDays(45)
            ->withAppleAppStore((new \Gs2\Money2\Model\AppleAppStoreSubscriptionContent())
                ->withSubscriptionGroupIdentifier("21642260"))
            ->withGooglePlay((new \Gs2\Money2\Model\GooglePlaySubscriptionContent())
                ->withProductId("io.gs2.sample.google.product2"))
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.UpdateStoreSubscriptionContentModelMasterRequest;
import io.gs2.money2.result.UpdateStoreSubscriptionContentModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    UpdateStoreSubscriptionContentModelMasterResult result = client.updateStoreSubscriptionContentModelMaster(
        new UpdateStoreSubscriptionContentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withContentName("content-0001")
            .withDescription("description1")
            .withMetadata(null)
            .withScheduleNamespaceId("grn:ap-northeast-1:YourOwnerId:schedule:namespaceName")
            .withTriggerName("trigger-0001")
            .withTriggerExtendMode(null)
            .withRollupHour(null)
            .withReallocateSpanDays(45)
            .withAppleAppStore(new io.gs2.money2.model.AppleAppStoreSubscriptionContent()
                .withSubscriptionGroupIdentifier("21642260"))
            .withGooglePlay(new io.gs2.money2.model.GooglePlaySubscriptionContent()
                .withProductId("io.gs2.sample.google.product2"))
    );
    StoreSubscriptionContentModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.UpdateStoreSubscriptionContentModelMasterResult> asyncResult = null;
yield return client.UpdateStoreSubscriptionContentModelMaster(
    new Gs2.Gs2Money2.Request.UpdateStoreSubscriptionContentModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithContentName("content-0001")
        .WithDescription("description1")
        .WithMetadata(null)
        .WithScheduleNamespaceId("grn:ap-northeast-1:YourOwnerId:schedule:namespaceName")
        .WithTriggerName("trigger-0001")
        .WithTriggerExtendMode(null)
        .WithRollupHour(null)
        .WithReallocateSpanDays(45)
        .WithAppleAppStore(new Gs2.Gs2Money2.Model.AppleAppStoreSubscriptionContent()
            .WithSubscriptionGroupIdentifier("21642260"))
        .WithGooglePlay(new Gs2.Gs2Money2.Model.GooglePlaySubscriptionContent()
            .WithProductId("io.gs2.sample.google.product2")),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.updateStoreSubscriptionContentModelMaster(
        new Gs2Money2.UpdateStoreSubscriptionContentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withContentName("content-0001")
            .withDescription("description1")
            .withMetadata(null)
            .withScheduleNamespaceId("grn:ap-northeast-1:YourOwnerId:schedule:namespaceName")
            .withTriggerName("trigger-0001")
            .withTriggerExtendMode(null)
            .withRollupHour(null)
            .withReallocateSpanDays(45)
            .withAppleAppStore(new Gs2Money2.model.AppleAppStoreSubscriptionContent()
                .withSubscriptionGroupIdentifier("21642260"))
            .withGooglePlay(new Gs2Money2.model.GooglePlaySubscriptionContent()
                .withProductId("io.gs2.sample.google.product2"))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.update_store_subscription_content_model_master(
        money2.UpdateStoreSubscriptionContentModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_content_name('content-0001')
            .with_description('description1')
            .with_metadata(None)
            .with_schedule_namespace_id('grn:ap-northeast-1:YourOwnerId:schedule:namespaceName')
            .with_trigger_name('trigger-0001')
            .with_trigger_extend_mode(None)
            .with_rollup_hour(None)
            .with_reallocate_span_days(45)
            .with_apple_app_store(
                money2.AppleAppStoreSubscriptionContent()
                    .with_subscription_group_identifier('21642260'))
            .with_google_play(
                money2.GooglePlaySubscriptionContent()
                    .with_product_id('io.gs2.sample.google.product2'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.update_store_subscription_content_model_master({
    namespaceName="namespace-0001",
    contentName="content-0001",
    description="description1",
    metadata=nil,
    scheduleNamespaceId="grn:ap-northeast-1:YourOwnerId:schedule:namespaceName",
    triggerName="trigger-0001",
    triggerExtendMode=nil,
    rollupHour=nil,
    reallocateSpanDays=45,
    appleAppStore={
        subscriptionGroupIdentifier="21642260",
    },
    googlePlay={
        productId="io.gs2.sample.google.product2",
    },
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.update_store_subscription_content_model_master_async({
    namespaceName="namespace-0001",
    contentName="content-0001",
    description="description1",
    metadata=nil,
    scheduleNamespaceId="grn:ap-northeast-1:YourOwnerId:schedule:namespaceName",
    triggerName="trigger-0001",
    triggerExtendMode=nil,
    rollupHour=nil,
    reallocateSpanDays=45,
    appleAppStore={
        subscriptionGroupIdentifier="21642260",
    },
    googlePlay={
        productId="io.gs2.sample.google.product2",
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

deleteStoreSubscriptionContentModelMaster

Delete Store Subscription Content Model Master

Deletes the specified store subscription content model master.

Details

Request

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
contentName string
~ 128 chars Store Subscription Content Model name

Result

Type Description
item StoreSubscriptionContentModelMaster Store Subscription Content Model Master deleted

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/money2"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := money2.Gs2Money2RestClient{
    Session: &session,
}
result, err := client.DeleteStoreSubscriptionContentModelMaster(
    &money2.DeleteStoreSubscriptionContentModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        ContentName: pointy.String("content-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Money2\Gs2Money2RestClient;
use Gs2\Money2\Request\DeleteStoreSubscriptionContentModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2Money2RestClient(
    $session
);

try {
    $result = $client->deleteStoreSubscriptionContentModelMaster(
        (new DeleteStoreSubscriptionContentModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withContentName("content-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.money2.rest.Gs2Money2RestClient;
import io.gs2.money2.request.DeleteStoreSubscriptionContentModelMasterRequest;
import io.gs2.money2.result.DeleteStoreSubscriptionContentModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Money2RestClient client = new Gs2Money2RestClient(session);

try {
    DeleteStoreSubscriptionContentModelMasterResult result = client.deleteStoreSubscriptionContentModelMaster(
        new DeleteStoreSubscriptionContentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withContentName("content-0001")
    );
    StoreSubscriptionContentModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2Money2RestClient(session);

AsyncResult<Gs2.Gs2Money2.Result.DeleteStoreSubscriptionContentModelMasterResult> asyncResult = null;
yield return client.DeleteStoreSubscriptionContentModelMaster(
    new Gs2.Gs2Money2.Request.DeleteStoreSubscriptionContentModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithContentName("content-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Money2 from '@/gs2/money2';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Money2.Gs2Money2RestClient(session);

try {
    const result = await client.deleteStoreSubscriptionContentModelMaster(
        new Gs2Money2.DeleteStoreSubscriptionContentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withContentName("content-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import money2

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = money2.Gs2Money2RestClient(session)

try:
    result = client.delete_store_subscription_content_model_master(
        money2.DeleteStoreSubscriptionContentModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_content_name('content-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('money2')

api_result = client.delete_store_subscription_content_model_master({
    namespaceName="namespace-0001",
    contentName="content-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('money2')

api_result_handler = client.delete_store_subscription_content_model_master_async({
    namespaceName="namespace-0001",
    contentName="content-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;