In-App Purchase Details

Overview

The In-App Purchases details can be obtained via different sources. To better understand each values received from the different sources, this guide will explain all the correlations between the data given and how to obtain extra data apart from the default information received after a Purchase is complete in the Android Billing SDK.

Sources that provide Purchase data

The sources that provide information about a Purchase are the following:

Android Billing SDK

After a Purchase is made, the Android Billing SDK, using the PurchasesUpdatedListener, will notify your application of that Purchase with the data explained in the Purchase class.
This information is the base for the rest of the requests you can do to the Aptoide services to obtain more data about the Purchase.


In-App Purchase Validation (Server-to-Server)

Once received the Purchase in the PurchasesUpdatedListener, follow the Server to Server - Server flow to receive additional information. In here you will use the sku/productId of the Purchase and purchaseToken.


In-App Purchase details (Server-to-Server ProductV2 API)

This API is used to obtain the UID , which can be viewed in the Aptoide Connect information page of a transaction made by a User. This UID is used to do further requests which will give more information about the Purchase.

To use this API. use the following endpoint (same endpoint is use for both INAPPs and Subscriptions):https://api.catappult.io/productv2/8.20241201/inapp/purchases/{purchaseToken}

The data received from this endpoint is the following:

{
  "uid": String,
  "sku": String,
  "domain": String,
  "type": String,
  "status": String,
  "state": String,
  "payload": String,
  "created": String,
  "buyer": {
    "type": String,
    "reference": String
  },
  "order": {
    "uid": String,
    "gateway": String,
    "reference": String,
    "status": String,
    "created": String
  }
}

The parameters in this payload are described as the following:

NameTypeDescription
uidStringPurchase ID defined as token in the Purchase class.
skuStringSKU of the Product purchased.
domainStringPackage name of the application that originated this Purchase.
typeStringType of the Product purchased.
statusStringStatus of the transaction.
stateStringState of the transaction.
payloadStringString based payload specified by the Developer when initiating this Purchase.
createdStringString based timestamp of the creation date. Eg: 2025-01-14T11:06:31.231117Z
buyerObjectObject with information of the Buyer source.
buyer.typeStringBuyer type. Example: WALLET
buyer.referenceStringBuyer reference.
orderObjectObject with the information of the Order made in the Payment.
order.uidStringUID of the Order. Defined as orderId in the Purchase class.
order.gatewayStringGateway of the order. Possible value is broker.
order.referenceStringReference ID of the Order. Defined as UID in Aptoide Connect channels.
order.statusStringStatus of the Order made.
order.createdStringString based timestamp of the creation date. Eg: 2025-01-14T11:06:31.231117Z

type

ValueDescription
CONSUMABLEProduct type is a Consumabled.
SUBSCRIPTIONProduct type is a Subscription.

status

ValueDescription
PENDINGThe purchase is pending one or more actions to be completed. Example: Consumption
COMPLETEDThe purchase is successfully completed.
VOIDEDThe purchase is voided.

state

ValueDescription
PENDINGThe purchase is pending acknowledgement or consumption.
CONSUMEDThe purchase has been consumed.
AKCNOWLEDGEDThe purchase has been acknowledged.

order.status

ValueDescription
PENDINGThe order is pending one or more actions to be completed.
COMPLETEDThe order is successfully completed.
FAILEDThe order failed to be completed due to an error.
CANCELEDThe order is canceled and may no longer be completed.
REFUNDEDThe order was refunded.
CHARGEDBACKThe order was chargedback.

Broker Purchase Details (Server-to-Server Broker API)

This API is used to obtain more detailed information about the Purchase. In here you are able to obtain information about the price of the Purchase, the TxID , which can be viewed in the Aptoide Connect information page of a transaction made by a User and also in our Wallet Application further used to assists users in resolution of potential issues during the Payments or items attribution.

To use this API. use the following endpoint (same endpoint is use for both INAPPs and Subscriptions):https://api.catappult.io/broker/8.20240901/transactions/{UID}

The data received from this endpoint is the following:

{
  "uid": String,
  "domain": String,
  "product": String,
  "wallet_from": String,
  "type": String,
  "method": String,
  "country": String,
  "reference": String,
  "hash": String,
  "status": String,
  "added": String,
  "modified": String,
  "gateway": {
    "name": String
  },
  "metadata": {
    "purchase_uid": String,
    "developer_payload": String
  },
  "price": {
    "currency": String,
    "value": String,
    "appc": String,
    "usd": String,
    "vat": {
      "percentage": String,
      "value": String,
      "usd": String
    },
    "discount": {
      "percentage": String,
      "value": String,
      "usd": String
    }
  },
  "channel": String,
  "platform": String,
  "market": String
}

The parameters in this payload are described as the following:

NameTypeDescription
uidStringUID of the Order. Defined as UID in Aptoide Connect channels.
domainStringPackage name of the application that originated this Purchase.
productStringSKU of the Product purchased.
wallet_fromStringString based value of the Wallet Address used in the Purchase.
typeStringType of the Product purchased.
methodStringMethod used in the Purchase. Example: credit_card
countryStringString value following the ISO-3166-1-A2 guidelines. Example: US
referenceStringThe transaction reference. Defined as orderReference in the BillingFlowParams.
hashStringHash of the transaction. Defined as TxID in the Aptoide Connect and Wallet App.
statusStringStatus of the transaction.
addedStringString based timestamp of the addition date. Example: 2025-01-14T11:06:31.231117Z
modifiedStringString based timestamp of the modification date. Example: 2025-01-14T11:06:31.231117Z
gatewayObjectObject with information of the Gateway used.
gateway.nameStringGateway name. Example: adyen_v2
metadataObjectObject with information about the Purchases metadata.
metadata.purchase_uidStringPurchase ID defined as token in the Purchase class.
metadata.developer_payloadStringString based payload specified by the Developer when initiating this Purchase.
priceObjectObject with information of the Price of the Purchase.
price.currencyStringThe currency used in the Payment, as an ISO 4217 alphabetic code. Example: USD
price.valueStringThe price value of the Payment. Example: 1.12
price.appcStringThe price value in APPC currency. Example: 1120000
price.usdStringThe price value in USD currency. Example: 1.10
price.vatObjectObject with information about the VAT.
price.vat.percentageStringPercentage of the VAT. Example: 20.5
price.vat.valueStringValue of the VAT. Example: 4.45
price.vat.usdStringValue of the VAT in USD. Example: 1.12
price.discountObjectObject with information about the Discount applied in the Purchase.
price.discount.percentageStringPercentage of the discount. Example: 20.5
price.discount.valueStringValue of the discount. Example: 4.45
price.discount.usdStringValue of the discount in USD. Example: 1.12
channelStringChannel used for the Purchase.
platformStringPlatform used for the Purchase.
marketStringMarket from which the Purchase was made.

type

ValueDescription
INAPPProduct of type inapp was purchased via Android Billing SDK.
INAPP_SUBSCRIPTIONProduct of type subscription was purchased via Android Billing SDK.
INAPP_UNMANAGEDProduct of type inapp was purchased via OSP.

status

ValueDescription
PENDING_SERVICE_AUTHORIZATIONTransaction wating for service authorization.
PENDING_USER_PAYMENTTransaction waiting for user payment.
PROCESSINGTransaction beeing processed.
SETTLEDTransaction settled.
COMPLETEDTransaction completed.
CANCELEDTransaction canceled.
DUPLICATEDTransaction duplicated.
FAILEDTransaction failed.
CHARGEBACKTransaction chargeback.
REFUNDEDTransaction refunded.

channel

ValueDescription
ANDROIDAndroid channel type used.
IOSIOS channel type used.

platform

ValueDescription
ANDROIDAndroid channel type used.
IOSIOS channel type used.

market

ValueDescription
NATIVENative market was used. Android or iOS.
WEBWeb market was used.

Broker Transaction Details (Server-to-Server Broker API)

This API is used to obtain information about the transaction using the TxID. This is used to understand the details of the transaction which the User will report in case there are any issues.

To use this API. use the following endpoint (same endpoint is use for both INAPPs and Subscriptions):https://api.catappult.io/broker/8.20241201/transactions?hash={TxID}

The data received from this endpoint is:

{
  "next": null,
  "items": [
    TransactionObject,
  ]
}

The TransactionObject is defined in here.