0. Send Log (/log)
/log/writePurchaseLog
Description
Records the purchase log.
Kakaogames corporation will preserve a purchase log for 5 years.
As our policy, game server must send billing logs after successful in-app billing in game.
For Google Play Points payment, please use currency as GPP and price as the point value.
POST
Request Headers
Name | Type | Mandatory | Description |
---|---|---|---|
appId | String | Y | Game app ID |
appSecret | String | Y | Authentication key issued for each game |
playerId | String | Y | User ID issued by the platform |
Content-Type | String | Y | “application/json;charset=UTF-8” |
Authorization | String | Y | Authorization: KakaoAK {ADMIN_KEY} |
Request Body Parameters
Name | Type | Mandatory | Description | Available Values |
---|---|---|---|---|
grade | Long | N | Player grade |
|
playerLv | Long | N | Player level |
|
currency | String | Y | Currency code | The currency code value used when making a payment at the store Currency code specified in ISO 4217 In the case of google, You can use the getSkuDetails() method to determine the currency code of a product. |
price | BigDecimal | Y | Price of merchandise including VAT | Please transfer the amount obtained from the product details API through the store. |
os | String | Y | OS type | Client SDK String osName = KGSystem.getOSName(); ex> android, ios |
country | String | Y | Country code defined in ISO_3166-1 alpha-2 | Send the confirmed country code to client SDK's KGSystem.getCountryCode (); |
market | String | Y | Market type | ex> googlePlay, appStore, kakaogameShop, oneStore |
marketOrderId | String | N | Market order ID | This is orederId in google purchase data sample |
marketProductId | String | Y | Market product ID | in sample below: 'productId' in google purchase data 'product_id' in apple receipt |
marketPurchaseTime | Long | Y | Time market purchase was processed | in sample below: 'purchaseTime' in google purchase data 'puchase_date_ms' in apple receipt |
marketPurchaseData | Map<String,Object> | N | Additional data on market purchase | In the case google, send 'purchaseToken' value in google purchase data sample below and in the case apple, send 'contents of whole Receipt' in apple receipt sample below |
purchasePt | Long | N | Points generated by purchase |
|
purchaseCount | Long | N | Number of purchases |
|
purchaseToken | String | Y | Purchase token | Set only when purchased in Google.
|
Google Purchase_Data Sample
{
"orderId":"GPA.1234-5678-9012-34567",
"packageName":"com.example.app",
"productId":"exampleSku",
"purchaseTime":1345678900000,
"purchaseState":0,
"developerPayload":"bGoa+V7g/yqDXvKRqq+JTFn4uQZbPiQJo4pf9RzJ",
"purchaseToken":"opaque-token-up-to-1000-characters"
} |
Apple Receipt Sample
{
"in_app": [
{
"quantity": "1",
"product_id": "product_id",
"transaction_id": "1000000218147651",
"original_transaction_id": "1000000218147500",
"purchase_date": "2016-06-17 01:32:28 Etc/GMT",
"purchase_date_ms": "1466127148000",
"purchase_date_pst": "2016-06-16 18:32:28 America/Los_Angeles",
"original_purchase_date": "2016-06-17 01:30:33 Etc/GMT",
"original_purchase_date_ms": "1466127033000",
"original_purchase_date_pst": "2016-06-16 18:30:33 America/Los_Angeles",
"expires_date": "2016-06-17 01:37:28 Etc/GMT",
"expires_date_ms": "1466127448000",
"expires_date_pst": "2016-06-16 18:37:28 America/Los_Angeles",
"web_order_line_item_id": "1000000032727764",
"is_trial_period": "false"
}
]
} |
After completing the payment process in the store
Google must complete the purchase and payment by calling the consumePurchase method, and Apple must call the finishTransaction: method.
Response Status Code
Status Code | Description | Details |
---|---|---|
200 | Success | Normal |
400 | Bad Request | Request data not parsed. Lack of required parameters or parameter type error |
401 | Unauthenticated | Authentication failure (e.g., invalid appSecret) |
406 | Not Acceptable | Cannot be processed |
461 | Invalid Message Box | The Message Box requested with the messageBoxId does not exist |
500 | Internal Server Error | Server system internal error |
503 | Service Unavailable | Service unavailable (e.g., timeout between internal servers) |
Response Content
Name | Type | Description |
---|---|---|
logId | String | ID assigned to the recorded log. Not currently used. |
Example Request
POST /service/v3/log/writePurchaseLog HTTP/1.1
Host: openapi-zinny3.game.kakao.com:10443
Content-Type: application/json;charset=UTF-8
appId: 103815
appSecret: 951b75bf17fe0885ab5106ba2a9f9bc9
playerId: 123412341234
Authorization: KakaoAK 11118035a320f23423585acae3ded1111
{
"grade": 100,
"currency": "USD",
"price": 12.23,
"os": "android",
"country": "kr",
"market": "googlePlay",
"marketOrderId": "123098120938.123123123",
"marketProductId": "test gem 0003",
"marketPurchaseTime": 12312312333
} |
Example Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
{
"logId": "9a57db20-0472-11e5-aed4-b182048b2fd8"
} |