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
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