Purchase data model, which supports consumables, non-consumables, and auto-renewable subscriptions.
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| environment | Yes | String | Environment type.
|
| purchaseOrderId | Yes | String | Order ID of a purchase. |
| purchaseToken | Yes | String | Purchase token. In a consumable/non-consumable purchase, each purchase token matches a specific order. In a subscription purchase, each purchase token matches a subscription ID. Each purchase token is valid for only one delivery. To avoid duplicate deliveries to the same user, it is necessary to restrict the number of times a purchase token can be used for delivery. |
| applicationId | Yes | String | App ID. For details about how to obtain the ID, please refer to Setting App Identity Information. |
| productId | Yes | String | Product ID. |
| productType | Yes | String | Product type. The options are as follows:
|
| purchaseTime | Yes | Long | Time when a product is purchased. The value is a UTC timestamp, in milliseconds. If the purchase is not complete, this parameter is left empty. |
| finishStatus | No | String | Delivery status. The options are as follows:
|
| needFinish | No | Boolean | Indicates whether it is a must to acknowledge the delivery to complete the purchase. The options are as follows:
|
| price | Yes | Long | Price, in cents. |
| currency | Yes | String | Currency. For details, please refer to the ISO 4217 standard. For example, CNY, USD, and MYR. |
| developerPayload | No | String | Information stored on the merchant side, which an app passes when calling the payment API. |
| purchaseOrderRevocationReasonCode | No | String | Reason for revoking an order.
|
| revocationTime | No | Long | Time when an order is revoked. The value is a UTC timestamp, in milliseconds. |
| offerTypeCode | No | String | Offer type.
|
| offerId | No | String | Offer ID. |
| countryCode | Yes | String | Country or region code, which is used to identify a country or region. The value must comply with the ISO 3166 standard. |
| signedTime | Yes | Long | Time when signing is performed. The value is a UTC timestamp, in milliseconds. |
| Parameters returned only for subscriptions: | |||
| subGroupGenerationId | Yes | String | Generation ID of a subscription group.
|
| subscriptionId | Yes | String | Subscription ID. The ID will changes when:
|
| subGroupId | Yes | String | Subscription group ID. |
| duration | Yes | String | Validity period after a purchase. The value is in ISO 8601 format. For example, P1W indicates a week and P1M indicates a month. |
| durationTypeCode | Yes | String | Type of a subscription cycle.
|
Additional information for a purchase promotion.
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| productItem | Yes | ProductItem | Product information. |
| offerInfo | Yes | OfferInfo | Offer parameters. |
Product information.
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| applicationId | Yes | String | App ID. For details about how to obtain the ID, please refer to Setting App Identity Information. |
| productId | Yes | String | Product ID. |
Offer parameters.
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| offerId | Yes | String | Offer ID. This ID is the same as that specified during promotion settings when you configure product information in AppGallery Connect. For details, please refer to here. |
| applicationUserName | No | String | Obfuscated string that serves as a unique identifier for each user account. This parameter can be passed in the scenario where the offer ID is passed. |
| nonce | Yes | String | A unique, lowercase UUID generated by yourself and guaranteed to be system-wide unique. |