Architecture and getting started with PlayCamp SDK API integration
Architecture
PlayCamp SDK API is integrated through the game server.
Role Distribution
| Component | Role |
|---|---|
| Game Client | User interface (creator selection UI, coupon input screen, etc.) |
| Game Server | API calls, business logic processing, Server Key storage |
| PlayCamp SDK API | Data storage, settlement calculation, statistics aggregation, webhook delivery |
Data Flow Example
Getting Started
Required Integration APIs
Three Server APIs that must be integrated for campaign operation:
| Function | API | Description |
|---|---|---|
| Create Sponsor | POST /sponsors |
User sponsors a creator. Core for payment attribution |
| Validate Coupon | POST /coupons/validate |
Validate coupon code |
| Create Payment | POST /payments |
Register in-game payment. Base data for settlement |
API Key Issuance
Create a project on the PlayCamp platform to receive API keys.
| Key Type | Purpose | Storage Location |
|---|---|---|
| Server Key | All API calls (read/write) | Game server (store securely) |
| Client Key | Query APIs only (read-only) | Game client (optional use) |
Authentication
All API requests use Bearer Token authentication.
Authorization: Bearer {keyId}:{secret}Example:
Authorization: Bearer ak_server_abc123def456:xyz789secretkey
Server Environments
| Environment | URL | Purpose |
|---|---|---|
| Sandbox | https://sandbox-sdk-api.playcamp.io |
Development/Testing |
| Live | https://sdk-api.playcamp.io |
Production |
Integration Flow
1. POST /sponsors → User selects creator (sponsor) 2. POST /coupons/validate → Validate coupon code 3. POST /payments → Register when in-game payment occurs
Test Mode
Before campaign launch, use isTest: true parameter to test API integration.
curl -X POST "https://sandbox-sdk-api.playcamp.io/v1/server/payments" \
-H "Authorization: Bearer ak_server_xxx:secret" \
-H "Content-Type: application/json" \
-d '{
"userId": "test_user",
"transactionId": "test_txn_001",
"productId": "gem_pack_100",
"amount": 9900,
"currency": "KRW",
"platform": "Android",
"distributionType": "MOBILE_STORE",
"purchasedAt": "2024-01-15T10:30:00.000Z",
"isTest": true
}'Test Mode Features:
- Request parameter validation is performed identically to production
- Data is not saved to DB
- Returns mock response
See Test Mode for more details.