Skip to main content

Architecture

PlayCamp SDK API is integrated through the game server.

Role Distribution

ComponentRole
Game ClientUser interface (creator selection UI, coupon input screen, etc.)
Game ServerAPI calls, business logic processing, Server Key storage
PlayCamp SDK APIData storage, settlement calculation, statistics aggregation, webhook delivery

Data Flow Example

1

Creator Selection

User selects a creator in the game
2

Sponsor Registration

Game server calls POST /v1/server/sponsors
3

In-game Payment

User makes an in-game payment
4

Payment Registration

Game server calls POST /v1/server/payments
5

Auto Attribution

SDK API automatically attributes the payment to the creator
6

Settlement

Creator revenue is calculated at end of month settlement

Getting Started

Required Integration APIs

Three Server APIs that must be integrated for campaign operation:
FunctionAPIDescription
Create SponsorPOST /sponsorsUser sponsors a creator. Core for payment attribution
Validate CouponPOST /coupons/validateValidate coupon code
Create PaymentPOST /paymentsRegister in-game payment. Base data for settlement
Integration verification required for campaign publishing. Each of the 3 APIs above must be called at least once on the Live environment before your campaign can be published. Without this, the campaign approval screen will show:“Game is not linked with PlayCamp. API integration required.”You can use isTest: true for these verification calls — test mode requests count toward integration verification while not saving any actual data.
Integration verification flow:
1

Integrate APIs

Implement the 3 required APIs in your game server
2

Call each API on Live

Make at least one request per API to the Live environment (https://sdk-api.playcamp.io). Using isTest: true is allowed.
3

Request campaign approval

Once all 3 APIs have been verified, request approval from the PlayCamp admin
4

Campaign published

After approval, the integration warning disappears and the campaign moves to published status
Campaign/Creator queries and webhooks can be integrated optionally.

API Key Issuance

Create a project on the PlayCamp platform to receive API keys.
Key TypePurposeStorage Location
Server KeyAll API calls (read/write)Game server (store securely)
Client KeyQuery APIs only (read-only)Game client (optional use)
Never expose Server Key to the client.

Authentication

All API requests use Bearer Token authentication.
Authorization: Bearer {keyId}:{secret}
Example:
Authorization: Bearer ak_server_abc123def456:xyz789secretkey

Server Environments

EnvironmentURLPurpose
Sandboxhttps://sandbox-sdk-api.playcamp.ioDevelopment/Testing
Livehttps://sdk-api.playcamp.ioProduction
Use the Sandbox environment during development. Sandbox is completely isolated from Live.

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

SDKs

For type-safe integration, use the official SDKs instead of raw HTTP calls:
npm install @playcamp/node-sdk
import { PlayCampServer } from '@playcamp/node-sdk';

const server = new PlayCampServer('your_server_key:your_secret', {
  environment: 'sandbox',
});
See the Node SDK guide for full documentation.

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
Recommended: Use isTest: true when integrating before campaign launch. isTest can be used in both Sandbox and Live environments. Remove the isTest parameter for actual campaign operation.
See Test Mode for more details.