Game8 Store – Developer Center
Home › Technology & API

Sequence Diagram

📝 This is a reference translation. In case of any discrepancy, the Japanese version prevails.

This page describes the Out-of-app payment sequence as a diagram.

In-game item purchase

👤 UserGame8 StoreGame (publisher API)Payment system👤 UserGame8 StoreGame (publisher API)Payment system1. Enter in-game user ID2. Get player info (GET /user_info)3. Return player infouser_name, user_level4. Show player name and level5. Purchase in-game itemItem, payment info, points and couponCalculate payment amount (billing_amount)opt[When points or a coupon are used]transaction_id issued6. Check purchase eligibility (GET /check)transaction_id, item, billing_amountCheck age group, purchase limit, and stock,then reserve the item7. Return check resultresult_code, purchasable8. Show purchase unavailable (message based onresult_code )Create order (status: pending)9. Execute paymentPayment info, payment amount10. Return payment resultPayment statusopt[billing_amount is 1 yen or more]status: payment_confirmed11. Register purchase (POST /register)transaction_id, item, contents12. Verify order (GET /orders/verify)paid_transaction_id13. Return order statusstatus (at this point payment_confirmed)opt[When the publisher checks the order status]Grant item14. Return registration resultresult_code, item_grantedRecord purchase result (status: completed)15. Display purchase completion screen16. Send purchase notification email17. Cancel payment (refund) if a payment was madeReturn points and coupons and cancel order(status: cancelled)18. Show purchase failedalt[result_code is PUB0000][result_code is not PUB0000]alt[result_code is not PUB0000][result_code is PUB0000]
Diagram source (mermaid)
sequenceDiagram
	autonumber
	actor user as User
	participant S8 as Game8 Store
	participant pub as Game (publisher API)
	participant pay as Payment system

	%% Enter in-game ID and confirm player
	user->>S8: Enter in-game user ID
	S8->>+pub: Get player info (GET /user_info)
	pub->>-S8: Return player info
	note left of pub: user_name, user_level
	S8->>user: Show player name and level

	%% Purchase product
	user->>S8: Purchase in-game item
	note right of user: Item, payment info, points and coupon
	opt When points or a coupon are used
	note over S8: Calculate payment amount (billing_amount)
	end

	%% Purchase eligibility check
	note over S8: transaction_id issued
	S8->>+pub: Check purchase eligibility (GET /check)
	note right of S8: transaction_id, item, billing_amount
	note over pub: Check age group, purchase limit, and stock, then reserve the item
	pub->>-S8: Return check result
	note left of pub: result_code, purchasable

	alt result_code is not PUB0000
	S8->>user: Show purchase unavailable (message based on result_code )
	else result_code is PUB0000
	note over S8: Create order (status: pending)
	opt billing_amount is 1 yen or more
	S8->>+pay: Execute payment
	note right of S8: Payment info, payment amount
	pay->>-S8: Return payment result
	note left of pay: Payment status
	end
	note over S8: status: payment_confirmed

	%% Immediate notification after successful payment
	S8->>+pub: Register purchase (POST /register)
	note right of S8: transaction_id, item, contents
	opt When the publisher checks the order status
	pub->>+S8: Verify order (GET /orders/verify)
	note left of pub: paid_transaction_id
	S8->>-pub: Return order status
	note right of S8: status (at this point payment_confirmed)
	end
	note over pub: Grant item
	pub->>-S8: Return registration result
	note left of pub: result_code, item_granted

	alt result_code is PUB0000
	note over S8: Record purchase result (status: completed)
	S8->>user: Display purchase completion screen
	S8->>user: Send purchase notification email
	else result_code is not PUB0000
	S8->>pay: Cancel payment (refund) if a payment was made
	note over S8: Return points and coupons and cancel order (status: cancelled)
	S8->>user: Show purchase failed
	end
	end