store.acknowledgePurchase()

Type Function
Return value none
Revision Release 2026.3728
Keywords Samsung, IAP, in-app purchases, acknowledgePurchase, acknowledge
See also store.purchase()
store.consumePurchase()
store.restore()
store.*

Overview

Acknowledges that the user has been granted a purchased non-consumable item or subscription. Samsung IAP requires every non-consumable item and subscription purchase to be acknowledged after your app delivered it; the acknowledgedStatus field of the "restoreCompleted" storeTransaction event tells whether a purchase still needs to be acknowledged.

Consumable items are not acknowledged; use store.consumePurchase() for them.

The result is dispatched as a storeTransaction event with a state of "acknowledged", one event per purchase identifier. Check statusType ("success" when the purchase was acknowledged) and purchaseId of the event.

Gotchas

Syntax

store.acknowledgePurchase( purchaseId )
purchaseId (required)

String. The purchaseId of the purchase to acknowledge. Several purchases can be acknowledged at once by passing a comma separated string or an array of purchase identifiers. The event.transaction table of a storeTransaction event is accepted as well.

Example

local function transactionListener( event )
    local transaction = event.transaction

    if ( event.name == "storeTransaction" ) then
        if ( transaction.state == "purchased" or transaction.state == "restoreCompleted" ) then
            if ( not transaction.isConsumable and transaction.acknowledgedStatus ~= "acknowledged" ) then
                -- Grant the item or subscription to the user, then acknowledge it
                store.acknowledgePurchase( transaction.purchaseId )
            end

        elseif ( transaction.state == "acknowledged" ) then
            print( "acknowledged " .. transaction.purchaseId .. ": " .. transaction.statusType )
        end
    end
end