메인 콘텐츠로 건너뛰기
POST
/
v1
/
server
/
payments
결제 등록
curl --request POST \
  --url https://sdk-api.playcamp.io/v1/server/payments \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "userId": "<string>",
  "transactionId": "<string>",
  "productId": "<string>",
  "amount": 1.01,
  "currency": "<string>",
  "platform": "iOS",
  "distributionType": "MOBILE_STORE",
  "purchasedAt": "2023-11-07T05:31:56Z",
  "productName": "<string>",
  "isTest": false
}
'
{
  "data": {
    "id": 123,
    "transactionId": "<string>",
    "userId": "<string>",
    "productId": "<string>",
    "productName": "<string>",
    "amount": 123,
    "currency": "<string>",
    "amountUsd": 123,
    "platform": "iOS",
    "distributionType": "MOBILE_STORE",
    "status": "COMPLETED",
    "campaignId": "<string>",
    "creatorKey": "<string>",
    "purchasedAt": "2023-11-07T05:31:56Z",
    "createdAt": "2023-11-07T05:31:56Z"
  }
}

인증

Authorization
string
header
필수

Server API Key (format: {keyId}:{secret})

본문

application/json
userId
string
필수

유저 ID

transactionId
string
필수

고유 거래 ID (플랫폼 제공)

productId
string
필수

상품 ID

amount
number
필수

결제 금액

필수 범위: x >= 0.01
currency
string
필수

통화 코드 (ISO 4217, 필수)

  • USD, KRW 권장
  • 예: USD, KRW, JPY, EUR
platform
enum<string>
필수

결제 플랫폼

사용 가능한 옵션:
iOS,
Android,
Web,
Roblox,
Other
distributionType
enum<string>
필수

유통 타입 (필수, 스토어 수수료 결정):

  • MOBILE_STORE: 모바일 외부 스토어 (Google Play, App Store) - 30%
  • PC_STORE: PC 외부 스토어 (Steam 등) - 30%
  • MOBILE_SELF_STORE: 모바일 자체 결제 - 0%
  • PC_SELF_STORE: PC 자체 스토어 - 0%
사용 가능한 옵션:
MOBILE_STORE,
MOBILE_SELF_STORE,
PC_STORE,
PC_SELF_STORE
purchasedAt
string<date-time>
필수

실제 결제 발생 시각 (ISO 8601 UTC 형식)

  • 형식: YYYY-MM-DDTHH:mm:ss.sssZ
  • 예시: 2024-01-15T10:30:00.000Z
productName
string

상품 이름 (선택)

isTest
boolean
기본값:false

테스트 모드 (실제 데이터 생성 안 함)

응답

성공

data
object
필수