API Reference of GS2-Money2 SDK Specification of models and API references for GS2-SDK for various programming languages
Model Namespace Namespace
Namespace is a mechanism that allows multiple uses of the same service for different purposes within a single project.
Basically, GS2 services have a layer called namespace, and different namespaces are treated as completely different data spaces, even for the same service.
Therefore, it is necessary to create a namespace before starting to use each service.
Type Condition Require Default Limitation Description namespaceId string ✓ ~ 1024 chars Namespace GRN name string ✓ ~ 128 chars Namespace Name description string ~ 1024 chars Description currencyUsagePriority enum { “PrioritizeFree”, “PrioritizePaid” } ✓ ~ 128 chars Consumption priority sharedFreeCurrency bool ✓ Share the free currency with different slots platformSetting PlatformSetting ✓ Store platform settings depositBalanceScript ScriptSetting Script to be executed when depositing wallet balance withdrawBalanceScript ScriptSetting Script to be executed when withdrawing wallet balance subscribeScript string ~ 1024 chars Script to be executed when subscribing to a new contract(Not called when changing user association / Called when re-subscribing after contract expiration) renewScript string ~ 1024 chars Script to be executed when renewing a contract unsubscribeScript string ~ 1024 chars Script to be executed when unsubscribing from a contract(Not called when changing user association) takeOverScript ScriptSetting Script to be executed when taking over a contract changeSubscriptionStatusNotification NotificationSetting Notification when the subscription status of the period changes logSetting LogSetting Log output settings createdAt long ✓ Now Datetime of creation (Unix time unit:milliseconds) updatedAt long ✓ Now Datetime of last update (Unix time unit:milliseconds) revision long 0 ~ 9223372036854775805 Revision
Definition of enumeration type to be specified for currencyUsagePriority Enumerator String Definition Description PrioritizeFree Prioritize the use of free currency PrioritizePaid Prioritize the use of paid currency
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.
Type Condition Require Default Limitation Description walletId string ✓ ~ 1024 chars Wallet GRN userId string ✓ ~ 128 chars User Id slot int ✓ ~ 100000000 Slot Number summary WalletSummary ✓ Wallet Status depositTransactions List<DepositTransaction> [] ~ 1000 items List of deposit transactions sharedFreeCurrency bool ✓ Share Free Currency createdAt long ✓ Now Datetime of creation (Unix time unit:milliseconds) updatedAt long ✓ Now Datetime of last update (Unix time unit:milliseconds) revision long 0 ~ 9223372036854775805 Revision
Event Receipt
Receipts 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.
Type Condition Require Default Limitation Description eventId string ✓ ~ 1024 chars Event GRN transactionId string ✓ ~ 1024 chars Transaction ID userId string ✓ ~ 128 chars User Id eventType enum { “VerifyReceipt”, “Deposit”, “Withdraw”, “Refund” } ✓ ~ 128 chars Event Type verifyReceiptEvent VerifyReceiptEvent Verify Receipt Event depositEvent DepositEvent Deposit Event withdrawEvent WithdrawEvent Withdraw Event refundEvent RefundEvent Refund Event createdAt long ✓ Now Datetime of creation (Unix time unit:milliseconds) revision long 0 ~ 9223372036854775805 Revision
Definition of enumeration type to be specified for eventType Enumerator String Definition Description VerifyReceipt Verify Receipt Deposit Deposit Withdraw Withdraw Refund Refunded
SubscribeTransaction Subscription purchase information
Type Condition Require Default Limitation Description subscribeTransactionId string ✓ ~ 1024 chars Subscription Transaction GRN contentName string ✓ ~ 128 chars Subscription Store Content Model Name transactionId string ✓ ~ 1024 chars Transaction ID store enum { “AppleAppStore”, “GooglePlay”, “fake” } ✓ ~ 128 chars Store userId string ~ 128 chars User Id statusDetail 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” } ✓ ~ 128 chars Status expiresAt long ✓ Expiration date (Unix time unit:milliseconds) lastAllocatedAt long Last time allocated to user (Unix time unit:milliseconds) lastTakeOverAt long Last time taken over by user (Unix time unit:milliseconds) createdAt long ✓ Now Datetime of creation (Unix time unit:milliseconds) updatedAt long ✓ Now Datetime of last update (Unix time unit:milliseconds) revision long 0 ~ 9223372036854775805 Revision
Definition of enumeration type to be specified for store Enumerator String Definition Description AppleAppStore Apple App Store GooglePlay Google Play fake Fake
Definition of enumeration type to be specified for statusDetail Enumerator String Definition Description 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 User has canceled, but still in grace period grace@on_hold User has canceled, but still in grace period inactive@expired Subscription has expired inactive@revoked Subscription has been revoked
SubscriptionStatus Subscription status
Type Condition Require Default Limitation Description userId string ~ 128 chars User Id contentName string ✓ ~ 128 chars Subscription Store Content Model Name status enum { “active”, “inactive” } ✓ ~ 128 chars Status expiresAt long ✓ Expiration date (Unix time unit:milliseconds) detail List<SubscribeTransaction> [] ~ 100 items Subscription status details
Definition of enumeration type to be specified for status Enumerator String Definition Description active Active inactive Inactive
RefundHistory Refund history information
Type Condition Require Default Limitation Description refundHistoryId string ✓ ~ 1024 chars Subscription Transaction GRN transactionId string ✓ ~ 1024 chars Transaction ID 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 ✓ Now Datetime of creation (Unix time unit:milliseconds)
StoreContentModel Content of the store platform
Type Condition Require Default Limitation Description storeContentModelId string ✓ ~ 1024 chars Content Model GRN name string ✓ ~ 128 chars Store Content Model Name metadata string ~ 1024 chars Metadata appleAppStore AppleAppStoreContent Apple AppStore Content googlePlay GooglePlayContent Google Play Content
StoreContentModelMaster Content of the store platform
Type Condition Require Default Limitation Description storeContentModelId string ✓ ~ 1024 chars Content Model Master GRN name string ✓ ~ 128 chars Store Content Model Name description string ~ 1024 chars Description metadata string ~ 1024 chars Metadata appleAppStore AppleAppStoreContent Apple AppStore Content googlePlay GooglePlayContent Google Play Content createdAt long ✓ Now Datetime of creation (Unix time unit:milliseconds) updatedAt long ✓ Now Datetime of last update (Unix time unit:milliseconds) revision long 0 ~ 9223372036854775805 Revision
StoreSubscriptionContentModel Store platform subscription content
Type Condition Require Default Limitation Description storeSubscriptionContentModelId string ✓ ~ 1024 chars Subscription Content Model GRN name string ✓ ~ 128 chars Subscription Store 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 triggerExtendMode enum { “just”, “rollupHour” } ✓ “just” ~ 128 chars Mode to reflect the subscription period on the trigger rollupHour int {triggerExtendMode} == “rollupHour” ✓ 0 ~ 23 Hour of the day to roll up the subscription period (UTC) reallocateSpanDays int ✓ 30 ~ 365 Time span (days) that allows subscription contract information to be assigned to other users appleAppStore AppleAppStoreSubscriptionContent Apple AppStore Content googlePlay GooglePlaySubscriptionContent Google Play Content
Definition of enumeration type to be specified for triggerExtendMode Enumerator String Definition Description just Reflect the subscription period as it is rollupHour Extend the subscription period to the next day crossing time
StoreSubscriptionContentModelMaster Store platform subscription content
Type Condition Require Default Limitation Description storeSubscriptionContentModelId string ✓ ~ 1024 chars Subscription Content Model Master GRN name string ✓ ~ 128 chars Subscription Store 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 reallocateSpanDays int ✓ 30 ~ 365 Time span (days) that allows subscription contract information to be assigned to other users triggerExtendMode enum { “just”, “rollupHour” } ✓ “just” ~ 128 chars Mode to reflect the subscription period on the trigger rollupHour int {triggerExtendMode} == “rollupHour” ✓ 0 ~ 23 Hour of the day to roll up the subscription period (UTC) appleAppStore AppleAppStoreSubscriptionContent Apple AppStore Content googlePlay GooglePlaySubscriptionContent Google Play Content createdAt long ✓ Now Datetime of creation (Unix time unit:milliseconds) updatedAt long ✓ Now Datetime of last update (Unix time unit:milliseconds) revision long 0 ~ 9223372036854775805 Revision
Definition of enumeration type to be specified for triggerExtendMode Enumerator String Definition Description just Reflect the subscription period as it is rollupHour Extend the subscription period to the next day crossing time
CurrentModelMaster Currently available master data
GS2 uses JSON format files for master data management.
By uploading the file, you can actually reflect the settings on the server.
We provide a master data editor on the management console as a way to create JSON files, but you can also create JSON files using the
The service can also be used by creating a tool more appropriate for game management and exporting a JSON file in the appropriate format.
Type Condition Require Default Limitation Description namespaceId string ✓ ~ 1024 chars Currently available Model Master GRN settings string ✓ ~ 5242880 chars Master data
Receipt Receipt of store platform
Type Condition Require Default Limitation Description Store enum { “AppleAppStore”, “GooglePlay”, “fake” } ✓ ~ 128 chars Store TransactionID string ✓ ~ 1024 chars Transaction ID Payload string ✓ ~ 1048576 chars Payload
Definition of enumeration type to be specified for Store Enumerator String Definition Description AppleAppStore Apple App Store GooglePlay Google Play fake Fake
Platform Setting
AppleAppStoreSetting Apple AppStore Setting
Type Condition Require Default Limitation 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
Type Condition Require Default Limitation 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
Type Condition Require Default Limitation Description acceptFakeReceipt enum { “Accept”, “Reject” } ✓ “Reject” ~ 128 chars Able to make a payment with a fake receipt output by UnityEditor
Definition of enumeration type to be specified for acceptFakeReceipt Enumerator String Definition Description Accept Accept Reject Reject
WalletSummary Wallet Status
Type Condition Require Default Limitation Description paid int ✓ 0 ~ 2147483646 Count of Paid free int ✓ 0 ~ 2147483646 Count of Free total int ✓ 0 ~ 2147483646 Count of Total
DepositTransaction Deposit Transaction
Type Condition Require Default Limitation Description price double ✓ ~ 100000000.0 Purchase Price currency string {price} > 0 ✓ ~ 8 chars Currency Code count int ✓ ~ 2147483646 Count depositedAt long Deposit Date (Unix time unit:milliseconds)
VerifyReceiptEvent Verify Receipt Event
Type Condition Require Default Limitation Description contentName string ✓ ~ 128 chars Store Content Model Name platform enum { “AppleAppStore”, “GooglePlay”, “fake” } ✓ ~ 128 chars Store Platform appleAppStoreVerifyReceiptEvent AppleAppStoreVerifyReceiptEvent Apple AppStore Verify Receipt Event googlePlayVerifyReceiptEvent GooglePlayVerifyReceiptEvent Google Play Verify Receipt Event
Enumerator String Definition Description AppleAppStore Apple AppStore GooglePlay Google Play fake Fake
DepositEvent Deposit Event
Type Condition Require Default Limitation Description slot int ✓ ~ 100000000 Slot Number depositTransactions List<DepositTransaction> [] ~ 1000 items List of deposit transactions status WalletSummary ✓ Wallet Status
WithdrawEvent Withdraw Event
Type Condition Require Default Limitation Description slot int ✓ ~ 100000000 Slot Number withdrawDetails List<DepositTransaction> [] ~ 1000 items List of details of the withdrawn wallet status WalletSummary ✓ Wallet Status
RefundEvent Refund Event
Type Condition Require Default Limitation Description contentName string ✓ ~ 128 chars Store Content Model Name platform enum { “AppleAppStore”, “GooglePlay”, “fake” } ✓ ~ 128 chars Store Platform appleAppStoreRefundEvent AppleAppStoreVerifyReceiptEvent Apple AppStore Verify Receipt Event googlePlayRefundEvent GooglePlayVerifyReceiptEvent Google Play Verify Receipt Event
Enumerator String Definition Description AppleAppStore Apple AppStore GooglePlay Google Play fake Fake
AppleAppStoreVerifyReceiptEvent Apple AppStore Receipt
Type Condition Require Default Limitation Description environment enum { “sandbox”, “production” } ✓ ~ 128 chars Environment
Definition of enumeration type to be specified for environment Enumerator String Definition Description sandbox Sandbox production Production
GooglePlayVerifyReceiptEvent Google Play Receipt Verification Event
Type Condition Require Default Limitation Description purchaseToken string ~ 4096 chars Purchase Token
AppleAppStoreContent Content of Apple AppStore
Type Condition Require Default Limitation Description productId string ~ 1024 chars Product ID
GooglePlayContent Content of Google Play
Type Condition Require Default Limitation Description productId string ~ 1024 chars Product ID
AppleAppStoreSubscriptionContent Subscription content of Apple AppStore
Type Condition Require Default Limitation Description subscriptionGroupIdentifier string ~ 64 chars Subscription Group ID
GooglePlaySubscriptionContent Google Play Subscription Content
Type Condition Require Default Limitation Description productId string ~ 1024 chars Product ID
GooglePlayRealtimeNotificationMessage RTDN Message
Type Condition Require Default Limitation Description data string ✓ ~ 1048576 chars Data messageId string ✓ ~ 1024 chars Message ID publishTime string ✓ ~ 1024 chars Publish Time
GitHubCheckoutSetting Setup to check out master data from GitHub
Type Condition Require Default Limitation Description apiKeyId string ✓ ~ 1024 chars GitHub API key GRN repositoryName string ✓ ~ 1024 chars Repository Name sourcePath string ✓ ~ 1024 chars Source code file path referenceType enum { “commit_hash”, “branch”, “tag” } ✓ ~ 128 chars Source of code commitHash string {referenceType} == “commit_hash” ✓ ~ 1024 chars Commit hash branchName string {referenceType} == “branch” ✓ ~ 1024 chars Branch Name tagName string {referenceType} == “tag” ✓ ~ 1024 chars Tag Name
Definition of enumeration type to be specified for referenceType Enumerator String Definition Description commit_hash Commit hash branch Branch tag Tag
ScriptSetting Script settings
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.
Synchronous execution blocks processing until the script has finished executing.
Instead, you can use the script execution result to stop the execution of the API or to tamper with the result of the API.
On the other hand, asynchronous execution does not block processing until the script has finished executing.
Instead, you can use the script execution result to stop the execution of the API or to tamper with the result of the API.
However, asynchronous execution does not block processing until the script has finished executing, so it is generally recommended to use asynchronous execution.
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.
Type Condition Require Default Limitation Description triggerScriptId string ~ 1024 chars Script GRN doneTriggerTargetType enum { “none”, “gs2_script”, “aws” } ✓ “none” ~ 128 chars Notification of Completion doneTriggerScriptId string {doneTriggerTargetType} == “gs2_script” ~ 1024 chars Script GRN doneTriggerQueueNamespaceId string {doneTriggerTargetType} == “gs2_script” ~ 1024 chars Namespace GRN
Definition of enumeration type to be specified for doneTriggerTargetType Enumerator String Definition Description none None gs2_script GS2-Script aws Amazon EventBridge
NotificationSetting Push notification settings
This is a setting for sending push notifications when an event occurs in a GS2 microservice.
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 a 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 send additional processing to mobile push notifications when the destination device is offline.
If you use mobile push notifications well, you may be able to realize a flow in which you can notify the player by using mobile push notifications even if you end the game during matchmaking and return to the game.
Type Condition Require Default Limitation Description gatewayNamespaceId string ✓ “grn:gs2:{region}:{ownerId}:gateway:default” ~ 1024 chars GS2-Gateway namespace to use for push notifications enableTransferMobileNotification bool? false Forwarding to mobile push notification sound string {enableTransferMobileNotification} == true ~ 1024 chars Sound file name to be used for mobile push notifications
LogSetting Log setting
This type manages log output settings.
This type holds the identifier of the log namespace used to output log data.
The log namespace ID specifies the GS2-Log namespace to aggregate and store the log data.
Through this setting, API request and response log data under this namespace will be output to the target GS2-Log.
GS2-Log provides logs in real time, which can be used for system monitoring, analysis, debugging, etc.
Type Condition Require Default Limitation Description loggingNamespaceId string ✓ ~ 1024 chars Namespace GRN
DailyTransactionHistory Transaction History of Daily Transactions
Type Condition Require Default Limitation Description dailyTransactionHistoryId string ✓ ~ 1024 chars Transaction History of Daily Transactions GRN year int ✓ 2000 ~ 3000 Year month int ✓ 1 ~ 12 Month day int ✓ 1 ~ 31 Day currency string ✓ ~ 8 chars Currency Code depositAmount double ✓ 0 ~ 16777214 Deposit Amount withdrawAmount double ✓ 0 ~ 16777214 Withdraw Amount updatedAt long ✓ Now Datetime of last update (Unix time unit:milliseconds) revision long 0 ~ 9223372036854775805 Revision
UnusedBalance Unused Balance
Entity that holds the unused balance of billing currency for each currency.
Type Condition Require Default Limitation Description unusedBalanceId string ✓ ~ 1024 chars Unused balance GRN currency string ✓ ~ 8 chars Currency Code balance double ✓ ~ 16777214 Unused Balance updatedAt long ✓ Now Datetime of last update (Unix time unit:milliseconds) revision long 0 ~ 9223372036854775805 Revision
Methods describeNamespaces Request Type Condition Require Default Limitation Description pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data limit int ✓ 30 1 ~ 1000 Number of data acquired
Result Type Description items List<Namespace> List of Namespace nextPageToken string Page token to retrieve the rest of the listing
Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 {
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 Gs2AccountRestClient (
$session
);
try {
$result = $client -> describeNamespaces (
( new DescribeNamespacesRequest ())
-> 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 ()
. withPageToken ( null )
. withLimit ( null )
);
List < Namespace > items = result . getItems ();
String nextPageToken = result . getNextPageToken ();
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.DescribeNamespacesRequest ;
using Gs2.Gs2Money2.Result.DescribeNamespacesResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2Money2RestClient ( session );
AsyncResult < Gs2 . Gs2Money2 . Result . DescribeNamespacesResult > asyncResult = null ;
yield return client . DescribeNamespaces (
new Gs2 . Gs2Money2 . Request . DescribeNamespacesRequest ()
. 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 ()
. 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_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 ({
pageToken = nil ,
limit = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
items = result.items ;
nextPageToken = result.nextPageToken ;
client = gs2 ( 'money2' )
api_result_handler = client.describe_namespaces_async ({
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 [ 'message' ])
end
result = api_result.result
items = result.items ;
nextPageToken = result.nextPageToken ;
createNamespace Request Type Condition Require Default Limitation Description name string ✓ ~ 128 chars Namespace Name currencyUsagePriority enum { “PrioritizeFree”, “PrioritizePaid” } ✓ ~ 128 chars Consumption priority description string ~ 1024 chars Description sharedFreeCurrency bool ✓ Share the free currency with different slots platformSetting PlatformSetting ✓ Store platform settings depositBalanceScript ScriptSetting Script to be executed when depositing wallet balance withdrawBalanceScript ScriptSetting Script to be executed when withdrawing wallet balance subscribeScript string ~ 1024 chars Script to be executed when subscribing to a new contract(Not called when changing user association / Called when re-subscribing after contract expiration) renewScript string ~ 1024 chars Script to be executed when renewing a contract unsubscribeScript string ~ 1024 chars Script to be executed when unsubscribing from a contract(Not called when changing user association) takeOverScript ScriptSetting Script to be executed when taking over a contract changeSubscriptionStatusNotification NotificationSetting Notification when the subscription status of the period changes logSetting LogSetting Log output settings
Enumeration type definition to specify as currencyUsagePriority Enumerator String Definition Description PrioritizeFree Prioritize the use of free currency PrioritizePaid Prioritize the use of paid currency
Result Type Description item Namespace Namespace created
Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 ,
SharedFreeCurrency : pointy . Bool ( false ),
PlatformSetting : nil ,
DepositBalanceScript : nil ,
WithdrawBalanceScript : 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 Gs2AccountRestClient (
$session
);
try {
$result = $client -> createNamespace (
( new CreateNamespaceRequest ())
-> withName ( "namespace-0001" )
-> withCurrencyUsagePriority ( "PrioritizeFree" )
-> withDescription ( null )
-> withSharedFreeCurrency ( False )
-> withPlatformSetting ( null )
-> withDepositBalanceScript ( null )
-> withWithdrawBalanceScript ( 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 )
. withSharedFreeCurrency ( false )
. withPlatformSetting ( null )
. withDepositBalanceScript ( null )
. withWithdrawBalanceScript ( 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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.CreateNamespaceRequest ;
using Gs2.Gs2Money2.Result.CreateNamespaceResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 )
. WithSharedFreeCurrency ( false )
. WithPlatformSetting ( null )
. WithDepositBalanceScript ( null )
. WithWithdrawBalanceScript ( 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 )
. withSharedFreeCurrency ( false )
. withPlatformSetting ( null )
. withDepositBalanceScript ( null )
. withWithdrawBalanceScript ( 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_shared_free_currency ( False )
. with_platform_setting ( None )
. with_deposit_balance_script ( None )
. with_withdraw_balance_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 ,
sharedFreeCurrency = false ,
platformSetting = nil ,
depositBalanceScript = nil ,
withdrawBalanceScript = 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 [ 'message' ])
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 ,
sharedFreeCurrency = false ,
platformSetting = nil ,
depositBalanceScript = nil ,
withdrawBalanceScript = 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 [ 'message' ])
end
result = api_result.result
item = result.item ;
getNamespaceStatus Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name
Result Type Description status string
Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.GetNamespaceStatusRequest ;
using Gs2.Gs2Money2.Result.GetNamespaceStatusResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
status = result.status ;
getNamespace Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.GetNamespaceRequest ;
using Gs2.Gs2Money2.Result.GetNamespaceResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
updateNamespace Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name currencyUsagePriority enum { “PrioritizeFree”, “PrioritizePaid” } ✓ ~ 128 chars Consumption priority description string ~ 1024 chars Description platformSetting PlatformSetting ✓ Store platform settings depositBalanceScript ScriptSetting Script to be executed when depositing wallet balance withdrawBalanceScript ScriptSetting Script to be executed when withdrawing wallet balance subscribeScript string ~ 1024 chars Script to be executed when subscribing to a new contract(Not called when changing user association / Called when re-subscribing after contract expiration) renewScript string ~ 1024 chars Script to be executed when renewing a contract unsubscribeScript string ~ 1024 chars Script to be executed when unsubscribing from a contract(Not called when changing user association) takeOverScript ScriptSetting Script to be executed when taking over a contract changeSubscriptionStatusNotification NotificationSetting Notification when the subscription status of the period changes logSetting LogSetting Log output settings
Enumeration type definition to specify as currencyUsagePriority Enumerator String Definition Description PrioritizeFree Prioritize the use of free currency PrioritizePaid Prioritize the use of paid currency
Result Type Description item Namespace Updated namespace
Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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" ),
PlatformSetting : & money2 . PlatformSetting {
AppleAppStore : money2 . AppleAppStoreSetting {
BundleId : pointy . String ( "io.gs2.sample" ),
},
GooglePlay : money2 . GooglePlaySetting {
PackageName : pointy . String ( "io.gs2.sample" ),
PublicKey : pointy . String ( "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAicE6mZuA6w39F+xhKQfn+KJw9AVxLuwsJGS8oTRj8K9IPTfs4BVuVLYkgxz7qA0ltO20X2Xvkf/lRfZJBLlwMa1PihXv96/sipj6FPu7xsqlvvaPmDi5JT5+8XirE33M8ezR5M7QlUoNHOuELT+DGxbnFn1s/A3bGI58SYqLzQvoqrEDGHKfKsCtP5ncX1ZwF8AFvk5WQlK5W3wkkrZXrbJbBsfur+5hWpVg5qS+dXAKSrKPfPmq9Fn11rhMDutGmm8BQ+/fDMz5jiuAVWcSjhEn7HI473es7dquQ7OO4NZJ0R9vkpTiQUzrEdnforr51du0riegjJOLTQtXAKLOIQIDAQAB" ),
},
Fake : money2 . FakeSetting {
AcceptFakeReceipt : pointy . String ( "Accept" ),
},
},
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" ),
},
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 Gs2AccountRestClient (
$session
);
try {
$result = $client -> updateNamespace (
( new UpdateNamespaceRequest ())
-> withNamespaceName ( "namespace-0001" )
-> withCurrencyUsagePriority ( "PrioritizePaid" )
-> withDescription ( "description1" )
-> withPlatformSetting (( new \Gs2\Money2\Model\PlatformSetting ())
-> withAppleAppStore (( new \Gs2\Money2\Model\AppleAppStoreSetting ())
-> withBundleId ( "io.gs2.sample" ))
-> withGooglePlay (( new \Gs2\Money2\Model\GooglePlaySetting ())
-> withPackageName ( "io.gs2.sample" )
-> withPublicKey ( "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAicE6mZuA6w39F+xhKQfn+KJw9AVxLuwsJGS8oTRj8K9IPTfs4BVuVLYkgxz7qA0ltO20X2Xvkf/lRfZJBLlwMa1PihXv96/sipj6FPu7xsqlvvaPmDi5JT5+8XirE33M8ezR5M7QlUoNHOuELT+DGxbnFn1s/A3bGI58SYqLzQvoqrEDGHKfKsCtP5ncX1ZwF8AFvk5WQlK5W3wkkrZXrbJbBsfur+5hWpVg5qS+dXAKSrKPfPmq9Fn11rhMDutGmm8BQ+/fDMz5jiuAVWcSjhEn7HI473es7dquQ7OO4NZJ0R9vkpTiQUzrEdnforr51du0riegjJOLTQtXAKLOIQIDAQAB" ))
-> withFake (( new \Gs2\Money2\Model\FakeSetting ())
-> withAcceptFakeReceipt ( "Accept" )))
-> 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" ))
-> 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" )
. withPlatformSetting ( new io . gs2 . money2 . model . PlatformSetting ()
. withAppleAppStore ( new io . gs2 . money2 . model . AppleAppStoreSetting ()
. withBundleId ( "io.gs2.sample" ))
. withGooglePlay ( new io . gs2 . money2 . model . GooglePlaySetting ()
. withPackageName ( "io.gs2.sample" )
. withPublicKey ( "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAicE6mZuA6w39F+xhKQfn+KJw9AVxLuwsJGS8oTRj8K9IPTfs4BVuVLYkgxz7qA0ltO20X2Xvkf/lRfZJBLlwMa1PihXv96/sipj6FPu7xsqlvvaPmDi5JT5+8XirE33M8ezR5M7QlUoNHOuELT+DGxbnFn1s/A3bGI58SYqLzQvoqrEDGHKfKsCtP5ncX1ZwF8AFvk5WQlK5W3wkkrZXrbJbBsfur+5hWpVg5qS+dXAKSrKPfPmq9Fn11rhMDutGmm8BQ+/fDMz5jiuAVWcSjhEn7HI473es7dquQ7OO4NZJ0R9vkpTiQUzrEdnforr51du0riegjJOLTQtXAKLOIQIDAQAB" ))
. withFake ( new io . gs2 . money2 . model . FakeSetting ()
. withAcceptFakeReceipt ( "Accept" )))
. 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" ))
. 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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.UpdateNamespaceRequest ;
using Gs2.Gs2Money2.Result.UpdateNamespaceResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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" )
. WithPlatformSetting ( new Gs2 . Gs2Money2 . Model . PlatformSetting ()
. WithAppleAppStore ( new Gs2 . Gs2Money2 . Model . AppleAppStoreSetting ()
. WithBundleId ( "io.gs2.sample" ))
. WithGooglePlay ( new Gs2 . Gs2Money2 . Model . GooglePlaySetting ()
. WithPackageName ( "io.gs2.sample" )
. WithPublicKey ( "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAicE6mZuA6w39F+xhKQfn+KJw9AVxLuwsJGS8oTRj8K9IPTfs4BVuVLYkgxz7qA0ltO20X2Xvkf/lRfZJBLlwMa1PihXv96/sipj6FPu7xsqlvvaPmDi5JT5+8XirE33M8ezR5M7QlUoNHOuELT+DGxbnFn1s/A3bGI58SYqLzQvoqrEDGHKfKsCtP5ncX1ZwF8AFvk5WQlK5W3wkkrZXrbJbBsfur+5hWpVg5qS+dXAKSrKPfPmq9Fn11rhMDutGmm8BQ+/fDMz5jiuAVWcSjhEn7HI473es7dquQ7OO4NZJ0R9vkpTiQUzrEdnforr51du0riegjJOLTQtXAKLOIQIDAQAB" ))
. WithFake ( new Gs2 . Gs2Money2 . Model . FakeSetting ()
. WithAcceptFakeReceipt ( "Accept" )))
. 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" ))
. 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" )
. withPlatformSetting ( new Gs2Money2 . model . PlatformSetting ()
. withAppleAppStore ( new Gs2Money2 . model . AppleAppStoreSetting ()
. withBundleId ( "io.gs2.sample" ))
. withGooglePlay ( new Gs2Money2 . model . GooglePlaySetting ()
. withPackageName ( "io.gs2.sample" )
. withPublicKey ( "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAicE6mZuA6w39F+xhKQfn+KJw9AVxLuwsJGS8oTRj8K9IPTfs4BVuVLYkgxz7qA0ltO20X2Xvkf/lRfZJBLlwMa1PihXv96/sipj6FPu7xsqlvvaPmDi5JT5+8XirE33M8ezR5M7QlUoNHOuELT+DGxbnFn1s/A3bGI58SYqLzQvoqrEDGHKfKsCtP5ncX1ZwF8AFvk5WQlK5W3wkkrZXrbJbBsfur+5hWpVg5qS+dXAKSrKPfPmq9Fn11rhMDutGmm8BQ+/fDMz5jiuAVWcSjhEn7HI473es7dquQ7OO4NZJ0R9vkpTiQUzrEdnforr51du0riegjJOLTQtXAKLOIQIDAQAB" ))
. withFake ( new Gs2Money2 . model . FakeSetting ()
. withAcceptFakeReceipt ( "Accept" )))
. 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" ))
. 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_platform_setting (
money2 . PlatformSetting ()
. with_apple_app_store ( money2 . AppleAppStoreSetting ()
. with_bundle_id ( 'io.gs2.sample' ))
. with_google_play ( money2 . GooglePlaySetting ()
. with_package_name ( 'io.gs2.sample' )
. with_public_key ( 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAicE6mZuA6w39F+xhKQfn+KJw9AVxLuwsJGS8oTRj8K9IPTfs4BVuVLYkgxz7qA0ltO20X2Xvkf/lRfZJBLlwMa1PihXv96/sipj6FPu7xsqlvvaPmDi5JT5+8XirE33M8ezR5M7QlUoNHOuELT+DGxbnFn1s/A3bGI58SYqLzQvoqrEDGHKfKsCtP5ncX1ZwF8AFvk5WQlK5W3wkkrZXrbJbBsfur+5hWpVg5qS+dXAKSrKPfPmq9Fn11rhMDutGmm8BQ+/fDMz5jiuAVWcSjhEn7HI473es7dquQ7OO4NZJ0R9vkpTiQUzrEdnforr51du0riegjJOLTQtXAKLOIQIDAQAB' ))
. with_fake ( money2 . FakeSetting ()
. with_accept_fake_receipt ( 'Accept' )))
. 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_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" ,
platformSetting = {
appleAppStore = {
bundleId = "io.gs2.sample" ,
},
googlePlay = {
packageName = "io.gs2.sample" ,
publicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAicE6mZuA6w39F+xhKQfn+KJw9AVxLuwsJGS8oTRj8K9IPTfs4BVuVLYkgxz7qA0ltO20X2Xvkf/lRfZJBLlwMa1PihXv96/sipj6FPu7xsqlvvaPmDi5JT5+8XirE33M8ezR5M7QlUoNHOuELT+DGxbnFn1s/A3bGI58SYqLzQvoqrEDGHKfKsCtP5ncX1ZwF8AFvk5WQlK5W3wkkrZXrbJbBsfur+5hWpVg5qS+dXAKSrKPfPmq9Fn11rhMDutGmm8BQ+/fDMz5jiuAVWcSjhEn7HI473es7dquQ7OO4NZJ0R9vkpTiQUzrEdnforr51du0riegjJOLTQtXAKLOIQIDAQAB" ,
},
fake = {
acceptFakeReceipt = "Accept" ,
},
},
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" ,
},
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 [ 'message' ])
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" ,
platformSetting = {
appleAppStore = {
bundleId = "io.gs2.sample" ,
},
googlePlay = {
packageName = "io.gs2.sample" ,
publicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAicE6mZuA6w39F+xhKQfn+KJw9AVxLuwsJGS8oTRj8K9IPTfs4BVuVLYkgxz7qA0ltO20X2Xvkf/lRfZJBLlwMa1PihXv96/sipj6FPu7xsqlvvaPmDi5JT5+8XirE33M8ezR5M7QlUoNHOuELT+DGxbnFn1s/A3bGI58SYqLzQvoqrEDGHKfKsCtP5ncX1ZwF8AFvk5WQlK5W3wkkrZXrbJbBsfur+5hWpVg5qS+dXAKSrKPfPmq9Fn11rhMDutGmm8BQ+/fDMz5jiuAVWcSjhEn7HI473es7dquQ7OO4NZJ0R9vkpTiQUzrEdnforr51du0riegjJOLTQtXAKLOIQIDAQAB" ,
},
fake = {
acceptFakeReceipt = "Accept" ,
},
},
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" ,
},
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
deleteNamespace Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name
Result Type Description item Namespace Deleted namespace
Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.DeleteNamespaceRequest ;
using Gs2.Gs2Money2.Result.DeleteNamespaceResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
dumpUserDataByUserId Get dump data of the data associated with the specified user ID
Request Type Condition Require Default Limitation Description userId string ✓ ~ 128 chars User Id timeOffsetToken string ~ 1024 chars Time offset token
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.DumpUserDataByUserIdRequest ;
using Gs2.Gs2Money2.Result.DumpUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
checkDumpUserDataByUserId Check if the dump of the data associated with the specified user ID is complete
Request Type Condition Require Default Limitation 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
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.CheckDumpUserDataByUserIdRequest ;
using Gs2.Gs2Money2.Result.CheckDumpUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
url = result.url ;
cleanUserDataByUserId Get clean data of the data associated with the specified user ID
Request Type Condition Require Default Limitation Description userId string ✓ ~ 128 chars User Id timeOffsetToken string ~ 1024 chars Time offset token
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.CleanUserDataByUserIdRequest ;
using Gs2.Gs2Money2.Result.CleanUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
checkCleanUserDataByUserId Check if the clean of the data associated with the specified user ID is complete
Request Type Condition Require Default Limitation Description userId string ✓ ~ 128 chars User Id timeOffsetToken string ~ 1024 chars Time offset token
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.CheckCleanUserDataByUserIdRequest ;
using Gs2.Gs2Money2.Result.CheckCleanUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
prepareImportUserDataByUserId Start importing data associated with the specified user ID
Request Type Condition Require Default Limitation 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
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.PrepareImportUserDataByUserIdRequest ;
using Gs2.Gs2Money2.Result.PrepareImportUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
uploadToken = result.uploadToken ;
uploadUrl = result.uploadUrl ;
importUserDataByUserId Start importing data associated with the specified user ID
Request Type Condition Require Default Limitation 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 Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.ImportUserDataByUserIdRequest ;
using Gs2.Gs2Money2.Result.ImportUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
checkImportUserDataByUserId Check if the import of the data associated with the specified user ID is complete
Request Type Condition Require Default Limitation 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
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.CheckImportUserDataByUserIdRequest ;
using Gs2.Gs2Money2.Result.CheckImportUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
url = result.url ;
describeWallets Get list of wallets
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name 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 acquired
Result Type Description items List<Wallet> List of Wallets nextPageToken string Page token to retrieve the rest of the listing
Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.DescribeWalletsRequest ;
using Gs2.Gs2Money2.Result.DescribeWalletsResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
items = result.items ;
nextPageToken = result.nextPageToken ;
describeWalletsByUserId Get list of wallets by specifying user ID
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name 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 acquired 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
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.DescribeWalletsByUserIdRequest ;
using Gs2.Gs2Money2.Result.DescribeWalletsByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
items = result.items ;
nextPageToken = result.nextPageToken ;
getWallet Get Wallet
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name accessToken string ✓ ~ 128 chars Access token slot int ✓ ~ 100000000 Slot Number
Result Type Description item Wallet Wallet
Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.GetWalletRequest ;
using Gs2.Gs2Money2.Result.GetWalletResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
getWalletByUserId Retrieve wallet by specifying user ID
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name userId string ✓ ~ 128 chars User Id slot int ✓ ~ 100000000 Slot Number timeOffsetToken string ~ 1024 chars Time offset token
Result Type Description item Wallet Wallet
Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.GetWalletByUserIdRequest ;
using Gs2.Gs2Money2.Result.GetWalletByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
depositByUserId Deposit balance to wallet by specifying user ID
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name userId string ✓ ~ 128 chars User Id slot int ✓ ~ 100000000 Slot Number 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
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.DepositByUserIdRequest ;
using Gs2.Gs2Money2.Result.DepositByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
withdraw Withdraw balance from wallet
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name accessToken string ✓ ~ 128 chars Access token slot int ✓ ~ 100000000 Slot Number withdrawCount int ✓ 1 ~ 2147483646 Quantity of billable currency to be consumed paidOnly bool ✓ false Only for paid currency
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.WithdrawRequest ;
using Gs2.Gs2Money2.Result.WithdrawResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
withdrawTransactions = result.withdrawTransactions ;
withdrawByUserId Withdraw balance from wallet by specifying user ID
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name userId string ✓ ~ 128 chars User Id slot int ✓ ~ 100000000 Slot Number withdrawCount int ✓ 1 ~ 2147483646 Quantity of billable currency to be consumed paidOnly bool ✓ false Only for paid currency timeOffsetToken string ~ 1024 chars Time offset token
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.WithdrawByUserIdRequest ;
using Gs2.Gs2Money2.Result.WithdrawByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
withdrawTransactions = result.withdrawTransactions ;
depositByStampSheet Execute balance addition to wallet as acquire action
Request Type Condition Require Default Limitation Description stampSheet string ✓ ~ 5242880 chars Transaction keyId string ✓ ~ 1024 chars encryption key GRN
Result Type Description item Wallet Wallet after deposit
Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 . DepositByStampSheet (
& money2 . DepositByStampSheetRequest {
StampSheet : pointy . String ( "stampSheet" ),
KeyId : pointy . String ( "key-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\DepositByStampSheetRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> depositByStampSheet (
( new DepositByStampSheetRequest ())
-> withStampSheet ( "stampSheet" )
-> withKeyId ( "key-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.DepositByStampSheetRequest ;
import io.gs2.money2.result.DepositByStampSheetResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2Money2RestClient client = new Gs2Money2RestClient ( session );
try {
DepositByStampSheetResult result = client . depositByStampSheet (
new DepositByStampSheetRequest ()
. withStampSheet ( "stampSheet" )
. withKeyId ( "key-0001" )
);
Wallet item = result . getItem ();
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.DepositByStampSheetRequest ;
using Gs2.Gs2Money2.Result.DepositByStampSheetResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2Money2RestClient ( session );
AsyncResult < Gs2 . Gs2Money2 . Result . DepositByStampSheetResult > asyncResult = null ;
yield return client . DepositByStampSheet (
new Gs2 . Gs2Money2 . Request . DepositByStampSheetRequest ()
. WithStampSheet ( "stampSheet" )
. WithKeyId ( "key-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 . depositByStampSheet (
new Gs2Money2 . DepositByStampSheetRequest ()
. withStampSheet ( "stampSheet" )
. withKeyId ( "key-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 . deposit_by_stamp_sheet (
money2 . DepositByStampSheetRequest ()
. with_stamp_sheet ( 'stampSheet' )
. with_key_id ( 'key-0001' )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'money2' )
api_result = client.deposit_by_stamp_sheet ({
stampSheet = "stampSheet" ,
keyId = "key-0001" ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
client = gs2 ( 'money2' )
api_result_handler = client.deposit_by_stamp_sheet_async ({
stampSheet = "stampSheet" ,
keyId = "key-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 [ 'message' ])
end
result = api_result.result
item = result.item ;
withdrawByStampTask Execute withdrawal of balance from wallet as consume action
Request Type Condition Require Default Limitation Description stampTask string ✓ ~ 5242880 chars Consume Action keyId string ✓ ~ 1024 chars encryption key GRN
Result Type Description item Wallet Post-withdraw Wallet withdrawTransactions List<DepositTransaction> List of consumed deposit transactions newContextStack string Request of context in which consume action execution results are recorded
Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 . WithdrawByStampTask (
& money2 . WithdrawByStampTaskRequest {
StampTask : pointy . String ( "stampTask" ),
KeyId : pointy . String ( "key-0001" ),
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
withdrawTransactions := result . WithdrawTransactions
newContextStack := result . NewContextStack
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\WithdrawByStampTaskRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> withdrawByStampTask (
( new WithdrawByStampTaskRequest ())
-> withStampTask ( "stampTask" )
-> withKeyId ( "key-0001" )
);
$item = $result -> getItem ();
$withdrawTransactions = $result -> getWithdrawTransactions ();
$newContextStack = $result -> getNewContextStack ();
} 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.WithdrawByStampTaskRequest ;
import io.gs2.money2.result.WithdrawByStampTaskResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2Money2RestClient client = new Gs2Money2RestClient ( session );
try {
WithdrawByStampTaskResult result = client . withdrawByStampTask (
new WithdrawByStampTaskRequest ()
. withStampTask ( "stampTask" )
. withKeyId ( "key-0001" )
);
Wallet item = result . getItem ();
List < DepositTransaction > withdrawTransactions = result . getWithdrawTransactions ();
String newContextStack = result . getNewContextStack ();
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.WithdrawByStampTaskRequest ;
using Gs2.Gs2Money2.Result.WithdrawByStampTaskResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2Money2RestClient ( session );
AsyncResult < Gs2 . Gs2Money2 . Result . WithdrawByStampTaskResult > asyncResult = null ;
yield return client . WithdrawByStampTask (
new Gs2 . Gs2Money2 . Request . WithdrawByStampTaskRequest ()
. WithStampTask ( "stampTask" )
. WithKeyId ( "key-0001" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
var withdrawTransactions = result . WithdrawTransactions ;
var newContextStack = result . NewContextStack ;
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 . withdrawByStampTask (
new Gs2Money2 . WithdrawByStampTaskRequest ()
. withStampTask ( "stampTask" )
. withKeyId ( "key-0001" )
);
const item = result . getItem ();
const withdrawTransactions = result . getWithdrawTransactions ();
const newContextStack = result . getNewContextStack ();
} 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_stamp_task (
money2 . WithdrawByStampTaskRequest ()
. with_stamp_task ( 'stampTask' )
. with_key_id ( 'key-0001' )
)
item = result . item
withdraw_transactions = result . withdraw_transactions
new_context_stack = result . new_context_stack
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'money2' )
api_result = client.withdraw_by_stamp_task ({
stampTask = "stampTask" ,
keyId = "key-0001" ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
withdrawTransactions = result.withdrawTransactions ;
newContextStack = result.newContextStack ;
client = gs2 ( 'money2' )
api_result_handler = client.withdraw_by_stamp_task_async ({
stampTask = "stampTask" ,
keyId = "key-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 [ 'message' ])
end
result = api_result.result
item = result.item ;
withdrawTransactions = result.withdrawTransactions ;
newContextStack = result.newContextStack ;
describeEventsByUserId Get list of receipts
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name userId string ✓ ~ 128 chars User Id begin long ✓ Difference from current time(-30 days) Search start date and time (Unix time unit:milliseconds) end long ✓ Now Search end date and time (Unix time unit:milliseconds) pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data limit int ✓ 30 1 ~ 1000 Number of data acquired 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
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.DescribeEventsByUserIdRequest ;
using Gs2.Gs2Money2.Result.DescribeEventsByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
items = result.items ;
nextPageToken = result.nextPageToken ;
getEventByTransactionId Get receipt by specifying transaction ID
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name transactionId string ✓ ~ 1024 chars Transaction ID
Result Type Description item Event Event
Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.GetEventByTransactionIdRequest ;
using Gs2.Gs2Money2.Result.GetEventByTransactionIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
verifyReceipt Record receipt
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name 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
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.VerifyReceiptRequest ;
using Gs2.Gs2Money2.Result.VerifyReceiptResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
verifyReceiptByUserId Record receipt as used by specifying user ID
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name 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
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.VerifyReceiptByUserIdRequest ;
using Gs2.Gs2Money2.Result.VerifyReceiptByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
verifyReceiptByStampTask Execute receipt verification as consume action
Request Type Condition Require Default Limitation Description stampTask string ✓ ~ 5242880 chars Consume Action keyId string ✓ ~ 1024 chars encryption key GRN
Result Type Description item Event Event newContextStack string Request of context in which consume action execution results are recorded
Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 . VerifyReceiptByStampTask (
& money2 . VerifyReceiptByStampTaskRequest {
StampTask : pointy . String ( "stampTask" ),
KeyId : pointy . String ( "key-0001" ),
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
newContextStack := result . NewContextStack
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\VerifyReceiptByStampTaskRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> verifyReceiptByStampTask (
( new VerifyReceiptByStampTaskRequest ())
-> withStampTask ( "stampTask" )
-> withKeyId ( "key-0001" )
);
$item = $result -> getItem ();
$newContextStack = $result -> getNewContextStack ();
} 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.VerifyReceiptByStampTaskRequest ;
import io.gs2.money2.result.VerifyReceiptByStampTaskResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2Money2RestClient client = new Gs2Money2RestClient ( session );
try {
VerifyReceiptByStampTaskResult result = client . verifyReceiptByStampTask (
new VerifyReceiptByStampTaskRequest ()
. withStampTask ( "stampTask" )
. withKeyId ( "key-0001" )
);
Event item = result . getItem ();
String newContextStack = result . getNewContextStack ();
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.VerifyReceiptByStampTaskRequest ;
using Gs2.Gs2Money2.Result.VerifyReceiptByStampTaskResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2Money2RestClient ( session );
AsyncResult < Gs2 . Gs2Money2 . Result . VerifyReceiptByStampTaskResult > asyncResult = null ;
yield return client . VerifyReceiptByStampTask (
new Gs2 . Gs2Money2 . Request . VerifyReceiptByStampTaskRequest ()
. WithStampTask ( "stampTask" )
. WithKeyId ( "key-0001" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
var newContextStack = result . NewContextStack ;
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 . verifyReceiptByStampTask (
new Gs2Money2 . VerifyReceiptByStampTaskRequest ()
. withStampTask ( "stampTask" )
. withKeyId ( "key-0001" )
);
const item = result . getItem ();
const newContextStack = result . getNewContextStack ();
} 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_stamp_task (
money2 . VerifyReceiptByStampTaskRequest ()
. with_stamp_task ( 'stampTask' )
. with_key_id ( 'key-0001' )
)
item = result . item
new_context_stack = result . new_context_stack
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'money2' )
api_result = client.verify_receipt_by_stamp_task ({
stampTask = "stampTask" ,
keyId = "key-0001" ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
newContextStack = result.newContextStack ;
client = gs2 ( 'money2' )
api_result_handler = client.verify_receipt_by_stamp_task_async ({
stampTask = "stampTask" ,
keyId = "key-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 [ 'message' ])
end
result = api_result.result
item = result.item ;
newContextStack = result.newContextStack ;
describeSubscriptionStatuses Get list of store subscription statuses
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name accessToken string ~ 128 chars Access token
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.DescribeSubscriptionStatusesRequest ;
using Gs2.Gs2Money2.Result.DescribeSubscriptionStatusesResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
items = result.items ;
describeSubscriptionStatusesByUserId Get list of store subscription statuses by user ID
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name userId string ~ 128 chars User Id timeOffsetToken string ~ 1024 chars Time offset token
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.DescribeSubscriptionStatusesByUserIdRequest ;
using Gs2.Gs2Money2.Result.DescribeSubscriptionStatusesByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
items = result.items ;
getSubscriptionStatus Get subscription status
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name accessToken string ~ 128 chars Access token contentName string ✓ ~ 128 chars Subscription Store Content Model Name
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.GetSubscriptionStatusRequest ;
using Gs2.Gs2Money2.Result.GetSubscriptionStatusResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
getSubscriptionStatusByUserId Get subscription status by user ID
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name userId string ~ 128 chars User Id contentName string ✓ ~ 128 chars Subscription Store Content Model Name timeOffsetToken string ~ 1024 chars Time offset token
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.GetSubscriptionStatusByUserIdRequest ;
using Gs2.Gs2Money2.Result.GetSubscriptionStatusByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
allocateSubscriptionStatus Allocate subscription status from receipt
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name accessToken string ~ 128 chars Access token receipt string ✓ ~ 1024 chars Receipt
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.AllocateSubscriptionStatusRequest ;
using Gs2.Gs2Money2.Result.AllocateSubscriptionStatusResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
allocateSubscriptionStatusByUserId Allocate subscription status by user ID from receipt
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name userId string ~ 128 chars User Id receipt string ✓ ~ 1024 chars Receipt timeOffsetToken string ~ 1024 chars Time offset token
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.AllocateSubscriptionStatusByUserIdRequest ;
using Gs2.Gs2Money2.Result.AllocateSubscriptionStatusByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
takeoverSubscriptionStatus Take over the subscription status of a subscription that is already assigned to another user
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name accessToken string ~ 128 chars Access token receipt string ✓ ~ 1024 chars Receipt
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.TakeoverSubscriptionStatusRequest ;
using Gs2.Gs2Money2.Result.TakeoverSubscriptionStatusResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
takeoverSubscriptionStatusByUserId Take over the subscription status of a subscription that is already assigned to another user
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name userId string ~ 128 chars User Id receipt string ✓ ~ 1024 chars Receipt timeOffsetToken string ~ 1024 chars Time offset token
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.TakeoverSubscriptionStatusByUserIdRequest ;
using Gs2.Gs2Money2.Result.TakeoverSubscriptionStatusByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
describeRefundHistoriesByUserId Get list of store refund history by user ID
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name 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 acquired 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
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.DescribeRefundHistoriesByUserIdRequest ;
using Gs2.Gs2Money2.Result.DescribeRefundHistoriesByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
items = result.items ;
nextPageToken = result.nextPageToken ;
describeRefundHistoriesByDate Get list of store refund history by year and month
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name 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 acquired
Result Type Description items List<RefundHistory> List of refund history nextPageToken string Page token to retrieve the rest of the listing
Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.DescribeRefundHistoriesByDateRequest ;
using Gs2.Gs2Money2.Result.DescribeRefundHistoriesByDateResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
items = result.items ;
nextPageToken = result.nextPageToken ;
getRefundHistory Get refund status by user ID
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name transactionId string ✓ ~ 1024 chars Transaction ID
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.GetRefundHistoryRequest ;
using Gs2.Gs2Money2.Result.GetRefundHistoryResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
describeStoreContentModels Get list of store contents
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.DescribeStoreContentModelsRequest ;
using Gs2.Gs2Money2.Result.DescribeStoreContentModelsResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
items = result.items ;
getStoreContentModel Get Store Content Model
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name contentName string ✓ ~ 128 chars Store Content Model Name
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.GetStoreContentModelRequest ;
using Gs2.Gs2Money2.Result.GetStoreContentModelResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
describeStoreContentModelMasters Get list of store content masters
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data limit int ✓ 30 1 ~ 1000 Number of data acquired
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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" ),
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 Gs2AccountRestClient (
$session
);
try {
$result = $client -> describeStoreContentModelMasters (
( new DescribeStoreContentModelMastersRequest ())
-> 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.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" )
. withPageToken ( null )
. withLimit ( null )
);
List < StoreContentModelMaster > items = result . getItems ();
String nextPageToken = result . getNextPageToken ();
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.DescribeStoreContentModelMastersRequest ;
using Gs2.Gs2Money2.Result.DescribeStoreContentModelMastersResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2Money2RestClient ( session );
AsyncResult < Gs2 . Gs2Money2 . Result . DescribeStoreContentModelMastersResult > asyncResult = null ;
yield return client . DescribeStoreContentModelMasters (
new Gs2 . Gs2Money2 . Request . DescribeStoreContentModelMastersRequest ()
. 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 . describeStoreContentModelMasters (
new Gs2Money2 . DescribeStoreContentModelMastersRequest ()
. 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_store_content_model_masters (
money2 . DescribeStoreContentModelMastersRequest ()
. 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_store_content_model_masters ({
namespaceName = "namespace-0001" ,
pageToken = nil ,
limit = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
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" ,
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 [ 'message' ])
end
result = api_result.result
items = result.items ;
nextPageToken = result.nextPageToken ;
createStoreContentModelMaster Create a new store content master
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name name string ✓ ~ 128 chars Store Content Model Name description string ~ 1024 chars Description metadata string ~ 1024 chars Metadata appleAppStore AppleAppStoreContent Apple AppStore Content googlePlay GooglePlayContent Google Play Content
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.CreateStoreContentModelMasterRequest ;
using Gs2.Gs2Money2.Result.CreateStoreContentModelMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
getStoreContentModelMaster Get Store Content Master
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name contentName string ✓ ~ 128 chars Store Content Model Name
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.GetStoreContentModelMasterRequest ;
using Gs2.Gs2Money2.Result.GetStoreContentModelMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
updateStoreContentModelMaster Update Store Content Master
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name contentName string ✓ ~ 128 chars Store Content Model Name description string ~ 1024 chars Description metadata string ~ 1024 chars Metadata appleAppStore AppleAppStoreContent Apple AppStore Content googlePlay GooglePlayContent Google Play Content
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.UpdateStoreContentModelMasterRequest ;
using Gs2.Gs2Money2.Result.UpdateStoreContentModelMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
deleteStoreContentModelMaster Delete Store Content Master
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name contentName string ✓ ~ 128 chars Store Content Model Name
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.DeleteStoreContentModelMasterRequest ;
using Gs2.Gs2Money2.Result.DeleteStoreContentModelMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
describeStoreSubscriptionContentModels Get list of store subscription contents
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.DescribeStoreSubscriptionContentModelsRequest ;
using Gs2.Gs2Money2.Result.DescribeStoreSubscriptionContentModelsResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
items = result.items ;
getStoreSubscriptionContentModel Get Store Subscription Content Model
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name contentName string ✓ ~ 128 chars Subscription Store Content Model Name
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.GetStoreSubscriptionContentModelRequest ;
using Gs2.Gs2Money2.Result.GetStoreSubscriptionContentModelResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
describeStoreSubscriptionContentModelMasters Get list of store subscription content masters
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data limit int ✓ 30 1 ~ 1000 Number of data acquired
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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" ),
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 Gs2AccountRestClient (
$session
);
try {
$result = $client -> describeStoreSubscriptionContentModelMasters (
( new DescribeStoreSubscriptionContentModelMastersRequest ())
-> 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.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" )
. withPageToken ( null )
. withLimit ( null )
);
List < StoreSubscriptionContentModelMaster > items = result . getItems ();
String nextPageToken = result . getNextPageToken ();
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.DescribeStoreSubscriptionContentModelMastersRequest ;
using Gs2.Gs2Money2.Result.DescribeStoreSubscriptionContentModelMastersResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2Money2RestClient ( session );
AsyncResult < Gs2 . Gs2Money2 . Result . DescribeStoreSubscriptionContentModelMastersResult > asyncResult = null ;
yield return client . DescribeStoreSubscriptionContentModelMasters (
new Gs2 . Gs2Money2 . Request . DescribeStoreSubscriptionContentModelMastersRequest ()
. 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 . describeStoreSubscriptionContentModelMasters (
new Gs2Money2 . DescribeStoreSubscriptionContentModelMastersRequest ()
. 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_store_subscription_content_model_masters (
money2 . DescribeStoreSubscriptionContentModelMastersRequest ()
. 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_store_subscription_content_model_masters ({
namespaceName = "namespace-0001" ,
pageToken = nil ,
limit = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
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" ,
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 [ 'message' ])
end
result = api_result.result
items = result.items ;
nextPageToken = result.nextPageToken ;
createStoreSubscriptionContentModelMaster Create a new store subscription content master
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name name string ✓ ~ 128 chars Subscription Store 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 triggerExtendMode enum { “just”, “rollupHour” } ✓ “just” ~ 128 chars Mode to reflect the subscription period on the trigger rollupHour int {triggerExtendMode} == “rollupHour” ✓ 0 ~ 23 Hour of the day to roll up the subscription period (UTC) reallocateSpanDays int ✓ 30 ~ 365 Time span (days) that allows subscription contract information to be assigned to other users appleAppStore AppleAppStoreSubscriptionContent Apple AppStore Content googlePlay GooglePlaySubscriptionContent Google Play Content
Enumeration type definition to specify as triggerExtendMode Enumerator String Definition Description just Reflect the subscription period as it is rollupHour Extend the subscription period to the next day crossing time
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.CreateStoreSubscriptionContentModelMasterRequest ;
using Gs2.Gs2Money2.Result.CreateStoreSubscriptionContentModelMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
getStoreSubscriptionContentModelMaster Get Store Subscription Content Master
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name contentName string ✓ ~ 128 chars Subscription Store Content Model Name
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.GetStoreSubscriptionContentModelMasterRequest ;
using Gs2.Gs2Money2.Result.GetStoreSubscriptionContentModelMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
updateStoreSubscriptionContentModelMaster Update Store Subscription Content Master
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name contentName string ✓ ~ 128 chars Subscription Store 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 triggerExtendMode enum { “just”, “rollupHour” } ✓ “just” ~ 128 chars Mode to reflect the subscription period on the trigger rollupHour int {triggerExtendMode} == “rollupHour” ✓ 0 ~ 23 Hour of the day to roll up the subscription period (UTC) reallocateSpanDays int ✓ 30 ~ 365 Time span (days) that allows subscription contract information to be assigned to other users appleAppStore AppleAppStoreSubscriptionContent Apple AppStore Content googlePlay GooglePlaySubscriptionContent Google Play Content
Enumeration type definition to specify as triggerExtendMode Enumerator String Definition Description just Reflect the subscription period as it is rollupHour Extend the subscription period to the next day crossing time
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.UpdateStoreSubscriptionContentModelMasterRequest ;
using Gs2.Gs2Money2.Result.UpdateStoreSubscriptionContentModelMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
deleteStoreSubscriptionContentModelMaster Delete Store Subscription Content Master
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name contentName string ✓ ~ 128 chars Subscription Store Content Model Name
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.DeleteStoreSubscriptionContentModelMasterRequest ;
using Gs2.Gs2Money2.Result.DeleteStoreSubscriptionContentModelMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
exportMaster Export master data for currently active model masters
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.ExportMasterRequest ;
using Gs2.Gs2Money2.Result.ExportMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
getCurrentModelMaster Get currently active model masters
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.GetCurrentModelMasterRequest ;
using Gs2.Gs2Money2.Result.GetCurrentModelMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
updateCurrentModelMaster Update and currently available model master
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name settings string ✓ ~ 5242880 chars Master data
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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" ),
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.apple.product3\"}}]}" ),
}
)
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 Gs2AccountRestClient (
$session
);
try {
$result = $client -> updateCurrentModelMaster (
( new UpdateCurrentModelMasterRequest ())
-> withNamespaceName ( "namespace-0001" )
-> 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.apple.product3 \" }}]}" )
);
$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" )
. 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.apple.product3\"}}]}" )
);
CurrentModelMaster item = result . getItem ();
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.UpdateCurrentModelMasterRequest ;
using Gs2.Gs2Money2.Result.UpdateCurrentModelMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2Money2RestClient ( session );
AsyncResult < Gs2 . Gs2Money2 . Result . UpdateCurrentModelMasterResult > asyncResult = null ;
yield return client . UpdateCurrentModelMaster (
new Gs2 . Gs2Money2 . Request . UpdateCurrentModelMasterRequest ()
. WithNamespaceName ( "namespace-0001" )
. 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.apple.product3\"}}]}" ),
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" )
. 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.apple.product3\"}}]}" )
);
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_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.apple.product3"}}]}' )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'money2' )
api_result = client.update_current_model_master ({
namespaceName = "namespace-0001" ,
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.apple.product3 \" }}]}" ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
client = gs2 ( 'money2' )
api_result_handler = client.update_current_model_master_async ({
namespaceName = "namespace-0001" ,
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.apple.product3 \" }}]}" ,
})
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
updateCurrentModelMasterFromGitHub Update and currently available model master
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name checkoutSetting GitHubCheckoutSetting ✓ Setup to check out master data from GitHub
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.UpdateCurrentModelMasterFromGitHubRequest ;
using Gs2.Gs2Money2.Result.UpdateCurrentModelMasterFromGitHubResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
describeDailyTransactionHistoriesByCurrency Get list of daily transaction histories by specifying currency
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name 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 acquired
Result Type Description items List<DailyTransactionHistory> List of Daily Transaction Histories nextPageToken string Page token to retrieve the rest of the listing
Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.DescribeDailyTransactionHistoriesByCurrencyRequest ;
using Gs2.Gs2Money2.Result.DescribeDailyTransactionHistoriesByCurrencyResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
items = result.items ;
nextPageToken = result.nextPageToken ;
describeDailyTransactionHistories Get list of daily transaction histories
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name 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 acquired
Result Type Description items List<DailyTransactionHistory> List of Daily Transaction Histories nextPageToken string Page token to retrieve the rest of the listing
Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.DescribeDailyTransactionHistoriesRequest ;
using Gs2.Gs2Money2.Result.DescribeDailyTransactionHistoriesResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
items = result.items ;
nextPageToken = result.nextPageToken ;
getDailyTransactionHistory Get receipt by specifying transaction ID
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name year int ✓ 2000 ~ 3000 Year month int ✓ 1 ~ 12 Month day int ✓ 1 ~ 31 Day currency string ✓ ~ 8 chars Currency Code
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.GetDailyTransactionHistoryRequest ;
using Gs2.Gs2Money2.Result.GetDailyTransactionHistoryResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
item = result.item ;
describeUnusedBalances Get list of receipts
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data limit int ✓ 30 1 ~ 1000 Number of data acquired
Result Type Description items List<UnusedBalance> List of UnusedBalances nextPageToken string Page token to retrieve the rest of the listing
Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.DescribeUnusedBalancesRequest ;
using Gs2.Gs2Money2.Result.DescribeUnusedBalancesResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
items = result.items ;
nextPageToken = result.nextPageToken ;
getUnusedBalance Get receipt by specifying transaction ID
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace Name currency string ✓ ~ 8 chars Currency Code
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script
GS2-Script(Async) 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 Gs2AccountRestClient (
$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.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Money2.Gs2Money2RestClient ;
using Gs2.Gs2Money2.Request.GetUnusedBalanceRequest ;
using Gs2.Gs2Money2.Result.GetUnusedBalanceResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
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 [ 'message' ])
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 [ 'message' ])
end
result = api_result.result
item = result.item ;