How I restore the complete reciept for this app.?

Hi All,


We have two items, both are non-consumable. And to avoid this to be restored in other app account.


Upon purchased we grab the receipt from appStoreReceiptURL and send it our server for validation and saving the "original_transaction_id" for refference, that this item belongs to this user.

But, upon restoring purchased the receipt only retrieve the latest item purchase.
How can I restore the complete reciept for this app.?
First time restoring.

{
  "receipt": {
    "receipt_type": "ProductionSandbox",
    "adam_id": 0,
    "app_item_id": 0,
    "bundle_id": "com.sample.app",
    "application_version": "1.1.2",
    "download_id": 0,
    "version_external_identifier": 0,
    "receipt_creation_date": "2019-02-18 06:00:50 Etc/GMT",
    "receipt_creation_date_ms": "1550469650000",
    "receipt_creation_date_pst": "2019-02-17 22:00:50 America/Los_Angeles",
    "request_date": "2019-02-19 07:46:15 Etc/GMT",
    "request_date_ms": "1550562375625",
    "request_date_pst": "2019-02-18 23:46:15 America/Los_Angeles",
    "original_purchase_date": "2013-08-01 07:00:00 Etc/GMT",
    "original_purchase_date_ms": "1375340400000",
    "original_purchase_date_pst": "2013-08-01 00:00:00 America/Los_Angeles",
    "original_application_version": "1.0",
    "in_app": [
      {
        "quantity": "1",
        "product_id": "com.sample.klpremium",
        "transaction_id": "1000000502662721",
        "original_transaction_id": "1000000502662721",
        "purchase_date": "2019-02-15 07:25:41 Etc/GMT",
        "purchase_date_ms": "1550215541000",
        "purchase_date_pst": "2019-02-14 23:25:41 America/Los_Angeles",
        "original_purchase_date": "2019-02-15 07:25:41 Etc/GMT",
        "original_purchase_date_ms": "1550215541000",
        "original_purchase_date_pst": "2019-02-14 23:25:41 America/Los_Angeles",
        "is_trial_period": "false"
      }
      {
        "quantity": "1",
        "product_id": "com.sample.book",
        "transaction_id": "1000000503177274",
        "original_transaction_id": "1000000503177274",
        "purchase_date": "2019-02-18 03:22:58 Etc/GMT",
        "purchase_date_ms": "1550460178000",
        "purchase_date_pst": "2019-02-17 19:22:58 America/Los_Angeles",
        "original_purchase_date": "2019-02-18 03:22:58 Etc/GMT",
        "original_purchase_date_ms": "1550460178000",
        "original_purchase_date_pst": "2019-02-17 19:22:58 America/Los_Angeles",
        "is_trial_period": "false"
      },
    ]
  },
  "status": 0,
  "environment": "Sandbox"
}


Second time restoring "Only adds the book"

{
  "receipt": {
    "receipt_type": "ProductionSandbox",
    "adam_id": 0,
    "app_item_id": 0,
    "bundle_id": "com.sample.app",
    "application_version": "1.1.2",
    "download_id": 0,
    "version_external_identifier": 0,
    "receipt_creation_date": "2019-02-18 06:00:50 Etc/GMT",
    "receipt_creation_date_ms": "1550469650000",
    "receipt_creation_date_pst": "2019-02-17 22:00:50 America/Los_Angeles",
    "request_date": "2019-02-19 07:46:15 Etc/GMT",
    "request_date_ms": "1550562375625",
    "request_date_pst": "2019-02-18 23:46:15 America/Los_Angeles",
    "original_purchase_date": "2013-08-01 07:00:00 Etc/GMT",
    "original_purchase_date_ms": "1375340400000",
    "original_purchase_date_pst": "2013-08-01 00:00:00 America/Los_Angeles",
    "original_application_version": "1.0",
    "in_app": [
      {
        "quantity": "1",
        "product_id": "com.sample.book",
        "transaction_id": "1000000503177274",
        "original_transaction_id": "1000000503177274",
        "purchase_date": "2019-02-18 03:22:58 Etc/GMT",
        "purchase_date_ms": "1550460178000",
        "purchase_date_pst": "2019-02-17 19:22:58 America/Los_Angeles",
        "original_purchase_date": "2019-02-18 03:22:58 Etc/GMT",
        "original_purchase_date_ms": "1550460178000",
        "original_purchase_date_pst": "2019-02-17 19:22:58 America/Los_Angeles",
        "is_trial_period": "false"
      },
    ]
  },
  "status": 0,
  "environment": "Sandbox"
}

Accepted Reply

But I just noticed something unusual about your two receipts. They seem to both have the same receipt_creation _date and request_date . That also represents a bug in Apple’s response or your request. I am at a loss to explain how this is possible.

Replies

You wrote "Second time restoring".

"Restore" has an exact meaning - it involves executing restoreCompletedTransactions and getting a new receipt at updatedTransactions. But, for clarity, aren't you sending the exact same receipt to the Apple servers twice? The first time it returns two items and the second time it returns only one item. Is that correct?


Are you certain that "both are non-consumable"?

Hi thank you for a reply.


" The first time it returns two items and the second time it returns only one item. Is that correct?" Yap, this is right.
Yes it is both non-consumable

This is a bug in the way Apple is handling your receipt or You or Apple mistakenly classified that 2nd IAP as a consumable.

But I just noticed something unusual about your two receipts. They seem to both have the same receipt_creation _date and request_date . That also represents a bug in Apple’s response or your request. I am at a loss to explain how this is possible.

Is there a way were i can download again the reciept.?

The app has to call refresh receipt or restoreComoletedTransactions.