en zh

Verify a purchase

iap/v6/receipt enables your server and client app to verify that a specified in-app product purchase and payment transaction was successfully completed.

The API returns a JSON object with a successful status and details about a successful transaction
and the product or with a failure status.

This API can help to prevent malicious purchases and ensure that purchase and payment transactions were successful when the client app experiences network interruptions after a product purchase and payment transaction.

Request

GET
https://iap.samsungapps.com/iap/v6/receipt?purchaseID={purchaseID value}

Query Parameters

Parameter

Type

Description

purchaseID

String

(Required) Unique identifier of the in-app product purchase transaction

Note: The purchase ID is assigned by Samsung IAP. Your app receives it in the PurchaseVo object of the OnPaymentListener interface.
Your app must send the ID to your server independently of Samsung IAP.


Example

GET
http://iap.samsungapps.com/iap/v6/receipt?purchaseID=7efef23271b0a48746a9d7c391e367c7a802980d391d7f9b75010e8138c66c36

Response


Parameters

Parameter

Type

Description

itemId

String

Unique identifier of the in-app product registered in Seller Portal

paymentId

String

Unique identifier assigned to the in-app product payment transaction when it was successful

orderId

String

Unique identifier assigned to the purchase receipt

packageName

String

Package name of the app with a completed transaction

itemName

String

Title of the in-app product registered in Seller Portal

itemDesc

String

Brief explanation of the in-app product registered in Seller Portal

purchaseDate

String

Date and time of the product purchase and payment transaction
(YYYY-MM-DD HH:mm:ss GMT)

paymentAmount

String

Total amount, including the in-app product price and all applicable taxes, billed to the user

status

String

Processing result of the request for the receipt:
"success" Success
"fail" Failed
"cancel" The purchase transaction was canceled

Note: For canceled transactions, the old iap/getPurchaseReceipt only passed "fail", but the iap/v6/receipt passes "cancel" and transaction information together.

paymentMethod

String

Type of payment option used to purchase the product
"Credit Card", "Mobile Micro Purchase", "Prepaid Card", "PSMS", "Carrier Billing" and others.

mode

String

IAP operating mode in effect at the time of purchase:
"TEST" Developer Test Mode which always returns Success or Fail result
"PRODUCTION" Production Mode

consumeYN

String

For consumable items only, whether or not the item has been reported as consumed and is available for purchase again:
"Y" Consumed
"N" Not Consumed

comsumeDate

String

Date and time when the consumable item was reported as consumed
(YYYY-MM-DD HH:mm:ss GMT)

consumeDeviceModel

String

Model name of the device that reported the item as consumed

acknowledgeYN

String

Whether or not acknowledge that the user has been granted entitlement for the purchased non-consumable item or subscription:
"Y" Acknowledged
"N" Not Acknowledged

acknowledgeDate

String

Date and time when the purchase of non-consumable item or subscription was acknowledged
(YYYY-MM-DD HH:mm:ss GMT)

acknowledgeDeviceModel

String

Model name of the device that acknowledged non-consumable item or subscription

passThroughParam

String

Deprecated since IAP 6.4.0
Transaction ID created by your app for security
Returned only if the pass-through parameter was set.

Note: The old iap/getPurchaseReceipt passed the base64 encoded value, but the iap/v6/receipt passes the value as it is set in the game.

currencyCode

String

Currency code (3 characters) of the purchaser's local currency. (for example, EUR, GBP, USD)

currencyUnit

String

Symbol of the purchaser's local currency (for example, €, £, or $)

cancelDate

String

For canceled transaction only, Date and time the purchase transaction was canceled
(YYYY-MM-DD HH:mm:ss GMT)

Note: Added since iap/v6/receipt

errorCode

Integer

For failed request only, error code

errorMessage

String

For failed request only, detailed error message


Example

  • Success

    {
       "itemId": "57515",
       "paymentId": "20191129013006730832TRAN",
       "orderId": "S20191129KRA1908197",
       "packageName": "com.samsung.android.test",
       "itemName": "Test Pack",
       "itemDesc": "IAP Test Item. Best value!",
       "purchaseDate": "2019-11-29 01:32:41",
       "paymentAmount": "100.000",
       "status": "success",
       "paymentMethod": "Credit Card",
       "mode": "PRODUCTION",
       "consumeYN": "Y",
       "consumeDate": "2019-11-29 01:33:28",
       "consumeDeviceModel": "SM-N960N",
       "acknowledgeYN": "Y",
       "acknowledgeDate": "2025-03-20 06:58:06",
       "acknowledgeDeviceModel": "SM-N960N",
       "passThroughParam": "TEST_PASS_THROUGH",
       "currencyCode": "KRW",
       "currencyUnit": "₩"
    }
    
  • Fail

    errorCode

    errorMessage

    1

    "fail"

    1000

    Detailed message about an unexpected system error
    (for example, "parsing error")

    9135

    "not exist order"

    9153

    "wrong param(invalid purchaseID)"

    {
        "status": "fail",
        "errorCode": 9135,
        "errorMessage": "not exist order"
     }
    
  • Canceled purchase transaction

    {
        "itemId": "57515",
        "paymentId": "ZPMTID20191128KRA1908196",
        "orderId": "S20191128KRA1908196",
        "itemName": "Test Pack",
        "itemDesc": "IAP Test Item. Best value!",
        "purchaseDate": "2019-11-28 10:18:09",
        "paymentAmount": "0.000",
        "paymentMethod": "Free",
        "mode": "PRODUCTION",
        "consumeYN": "Y",
        "consumeDate": "2019-11-28 10:18:11",
        "consumeDeviceModel": "SM-G965F",
        "acknowledgeYN": "Y",
        "acknowledgeDate": "2025-03-20 06:58:06",
        "acknowledgeDeviceModel": "SM-N960N",
        "passThroughParam": "TEST_PASS_THROUGH",
        "currencyCode": "KRW",
        "currencyUnit": "₩",
        "status": "cancel",
        "cancelDate": "2019-11-29 00:01:52"
    }
    

Additional Samsung IAP server APIs

Additional Samsung IAP server-to-server APIs are provided as part of the Galaxy Store Developer API and have different requirements:

The following Samsung IAP server SOAP APIs have been deprecated and are no longer supported: