开发者控制台

适用于Appstore SDK IAP的RVS示例

适用于Appstore SDK IAP的RVS示例

RVS沙盒环境和Amazon RVS生产服务器的RVS示例,以及每个示例的响应。请注意,这些示例使用正常工作的URL,因此如果在浏览器中粘贴请求,则会收到与示例相同的响应。

RVS云沙盒示例

以下请求会在RVS云沙盒中验证收据:

https://appstore-sdk.amazon.com/sandbox/version/1.0/verifyReceiptId/developer/developerSecret/user/l3HL7XppEMhrOGDnur9-ulvqomrSg6qyODKmah76lJU=/receiptId/q1YqVbJSyjH28DGPKChw9c0o8nd3ySststQtzSkrzM8tCk43K6z0d_HOTcwwN8vxCrVV0lEqBmpJzs_VS8xNrMrP0ysuTSo2BAqXKFkZ6SilACUNzQxMzAyNjYyNDQ3MgDKJSlZpiTnFqTpK6UpWJUWlQEYahFELAA

此调用会收到一个来自RVS云沙盒服务器的JSON响应:

{
  "autoRenewing": false,
  "betaProduct": false,
  "cancelDate": null,
  "cancelReason": null,
  "deferredDate": null,
  "deferredSku": null,
  "freeTrialEndDate": 1606985788979,
  "gracePeriodEndDate": 1606985788979,
  "parentProductId": null,
  "productId": "com.amazon.subs1",
  "productType": "SUBSCRIPTION",
  "promotions": null,
  "purchaseDate": 1604613233106,
  "quantity": 1,
  "receiptId": "q1YqVbJSyjH28DGPKChw9c0o8nd3ySststQtzSkrzM8tCk43K6z0d_HOTcwwN8vxCrVV0lEqBmpJzs_VS8xNrMrP0ysuTSo2BAqXKFkZ6SilACUNzQxMzAyNjYyNDQ3MgDKJSlZpiTnFqTpK6UpWJUWlQEYahFELAA",
  "renewalDate": 1606985788979,
  "term": "1 Month",
  "termSku": "com.amazon.subs1_term",
  "testTransaction": true
}

消费品示例

以下请求会在RVS生产服务器上验证消费品购买收据:

https://appstore-sdk.amazon.com/version/1.0/verifyReceiptId/developer/2:smXBjZkWCxDMSBvQ8HBGsUS1PK3jvVc8tuTjLNfPHfYAga6WaDzXJPoWpfemXaHg:iEzHzPjJ-XwRdZ4b4e7Hxw==/user/LRyD0FfW_3zeOlfJyxpVll-Z1rKn6dSf9xD3mUMSFg0=/receiptId/wE1EG1gsEZI9q9UnI5YoZ2OxeoVKPdR5bvPMqyKQq5Y=:1:11

此调用将收到以下示例JSON响应:

{
 "autoRenewing":false,
 "betaProduct":false,
 "cancelDate":null,
 "cancelReason":null,
 "freeTrialEndDate":null,
 "fulfillmentDate":null,
 "fulfillmentResult":null,
 "gracePeriodEndDate":null,
 "parentProductId":null,
 "productId":"com.amazon.iapsamplev2.gold_medal",
 "productType":"CONSUMABLE",
 "promotions":null,
 "purchaseDate":1399070221749,
 "purchaseMetadataMap":null,
 "quantity":1,
 "receiptId":"wE1EG1gsEZI9q9UnI5YoZ2OxeoVKPdR5bvPMqyKQq5Y=:1:11",
 "renewalDate":null,
 "term":null,
 "termSku":null,
 "testTransaction":true
}

purchaseDatecancelDate表示为以毫秒为单位的时间。可以调用java.util.Date(timeInMillis)将值转换为日期对象。cancelDatenull表示购买尚未取消。如果收据针对已取消的购买,则cancelDate将反映亚马逊客户支持取消购买的日期。

订阅示例

以下请求用于在RVS生产服务器上验证订阅购买收据:

https://appstore-sdk.amazon.com/version/1.0/verifyReceiptId/developer/2:SPOkNr03vVx0_u04edvPTf5t6VC-HHS4535VkVviYJp7fCvSepKM5Ys-_ODYdtw8:Y-tOqaWFAXCHluaxssj9VQ==/user/7m7UQpSnce0DcAOgcCZFVW5-sNc2rVYE6aQCGc6URNU=/receiptId/JyGJ5iEtYgFu1ngnQovTqSIHQxR53GsMLqkR1tKLp5c=:3:11

此调用将收到以下示例JSON响应:

{
 "autoRenewing":false,
 "betaProduct":true,
 "cancelDate":1400784371000,
 "cancelReason":1,
 "freeTrialEndDate":null,
 "fulfillmentDate":null,
 "fulfillmentResult":null,
 "gracePeriodEndDate":null,
 "parentProductId":null,
 "productId":"sub1",
 "productType":"SUBSCRIPTION",
 "promotions":null,
 "purchaseDate":1400784241000,
 "purchaseMetadataMap":null,
 "quantity":null,
 "receiptId":"JyGJ5iEtYgFu1ngnQovTqSIHQxR53GsMLqkR1tKLp5c=:3:11",
 "renewalDate":null,
 "term":"1 Week",
 "termSku":"sub1-weekly",
 "testTransaction":true
}

purchaseDatecancelDate表示为以毫秒为单位的时间。可以调用java.util.Date(timeInMillis)将值转换为日期对象。cancelDatenull表示此收据的订阅仍有效。如果收据针对已过期的订阅,则cancelDate会反映订阅过期的日期,或亚马逊客户支持取消该订阅的日期。cancelReason指示取消订阅的原因(可能的值为null、0、1或2,其中每个整数分别代表一项取消原因)。gracePeriodEndDate为“null”表示此收据的订阅不在宽限期内。如果收据针对宽限期内的订阅,则gracePeriodEndDate将反映订阅宽限期的结束日期。

促销定价示例

以下是在以促销定价购买订阅时verifyReceiptId API的响应:

{
 "autoRenewing": true,
 "betaProduct": false,
 "cancelDate": null,
 "cancelReason": null,
 "deferredDate": null,
 "deferredSku": null,
 "freeTrialEndDate": 1651730558000,
 "fulfillmentDate": null,
 "fulfillmentResult": null,
 "gracePeriodEndDate": 1606985788979,
 "parentProductId": null,
 "productId": "1yearOTCharge",
 "productType": "SUBSCRIPTION",
 "promotions": [
    {
      "promotionStatus": "Queued",
      "promotionType": "Introductory Price - All Customers"
    }
 ],
 "purchaseDate": 1651644158000,
 "receiptId": "IhE6m0uPLZ3dPz1WkGU5Ah6dmoDzJSLP3ed82jkxn2Y=:3:11",
 "renewalDate": 1651730558000,
 "term": "1 Week",
 "termSku": "1yearOnetimechargeterm",
 "testTransaction": false
}

权利示例

以下请求用于在RVS生产服务器上验证权利购买收据:

https://appstore-sdk.amazon.com/version/1.0/verifyReceiptId/developer/2:smXBjZkWCxDMSBvQ8HBGsUS1PK3jvVc8tuTjLNfPHfYAga6WaDzXJPoWpfemXaHg:iEzHzPjJ-XwRdZ4b4e7Hxw==/user/LRyD0FfW_3zeOlfJyxpVll-Z1rKn6dSf9xD3mUMSFg0=/receiptId/mINy5VRd1FqjVOz-WBtTqw9FBGWhnuVx07kzTBMR600=:2:11

此调用将收到以下示例JSON响应:

{
 "autoRenewing":false,
 "betaProduct":false,
 "cancelDate":null,
 "cancelReason":null,
 "freeTrialEndDate":null,
 "fulfillmentDate":null,
 "fulfillmentResult":null,
 "gracePeriodEndDate":null,
 "parentProductId":null,
 "productId":"com.amazon.iapsamplev2.gold_medal",
 "productType":"ENTITLED",
 "promotions":null,
 "purchaseDate":1399070221749,
 "purchaseMetadataMap":null,
 "quantity":1,
 "receiptId":"mINy5VRd1FqjVOz-WBtTqw9FBGWhnuVx07kzTBMR600=:2:11",
 "renewalDate":null,
 "term":null,
 "termSku":null,
 "testTransaction":true
}

purchaseDatecancelDate表示为以毫秒为单位的时间。可以调用java.util.Date(timeInMillis)将值转换为日期对象。cancelDatenull表示购买尚未取消。如果收据针对已取消的购买,则cancelDate将反映亚马逊客户支持取消购买的日期。


Last updated: 2024年11月6日