IPaymentsService
A service that processes in-app purchases on the Hive Axyl server. It provides product list retrieval, saving of payment attempts and payment results, payment confirmation, purchase restoration, saving of consumable product delivery results, and subscription payment processing. Tasks that call the store SDK directly, such as displaying the store payment screen, are handled by the payment Add-on. For how the roles are divided, see Relationship with payment Add-ons.
This service does not perform receipt verification; the app server handles it. For details, see Receipt verification.
- Interface:
IPaymentsService - Namespace:
Hive.Axyl.Payments - Package:
com.com2usplatform.hiveaxyl.payments
Registration and retrieval
using Hive.Axyl.Core;
using Hive.Axyl.Core.Unity; // HiveBootstrap
using Hive.Axyl.Payments;
var config = CoreConfig.CreateBuilder("{appId}").Build();
HiveBootstrap.Initialize(config, builder =>
{
builder.AddPayments(sandbox: true); // Development and test environments. For production builds, use AddPayments()
});
IPaymentsService payments = HiveCore.Resolve<IPaymentsService>();
Method summary
For the meaning of the 'Authentication' column, see Authentication requirement notation.
Get products
| Method | Authentication | Description |
|---|---|---|
| ListStoreProductIdsAsync | Session required | Gets the list of product IDs registered for the app, by store. |
| FetchAppleProductsAsync | Session required | Sends StoreKit product information and gets the Apple App Store product list. |
| FetchGoogleProductsAsync | Session required | Sends Google Play Billing product information and gets the Google Play product list. |
| FetchSteamProductsAsync | Session required | Gets the Steam product list matched to the Steam user's currency. |
| FetchPgProductsAsync | Session required | Gets the Payment Gateway (PG) product list matched to the requested currency. |
Consumable product payment
| Method | Authentication | Description |
|---|---|---|
| InitiatePurchaseAsync | Session required | Creates a Steam payment order and opens the payment. |
| CreatePaymentUrlAsync | Session required | Creates a PG payment page URL. |
| CreatePrePurchaseAsync | Session required | Saves payment attempt information right before the store payment window opens. |
| RecordStorePurchaseAsync | Session required | Saves the receipt and payment result right after the store payment completes. |
| RequestPurchaseAsync | Session required | Confirms the payment and finishes the transaction. |
| FinalizePurchaseAsync | Session required | Finalizes a Steam or PG payment. |
| RestorePurchasesAsync | Session required | Gets Steam or PG purchases whose products were not delivered. |
| ItemResultAsync | Session required | Saves the delivery result of a consumable product and confirms the transaction. |
Subscription
Subscription payments are supported only on Apple App Store and Google Play.
| Method | Authentication | Description |
|---|---|---|
| PrepareSubscriptionAsync | Session required | Saves product information and IapPayload before a subscription payment. |
| PurchaseSubscriptionAsync | Session required | Gets subscription purchase information with the subscription receipt and saves it. |
| PostSubscriptionAsync | Session required | Confirms the subscription payment and finishes the transaction. |
Receipt verification
Receipt verification is not performed with IPaymentsService methods; instead, the app server requests it by calling the Hive Axyl Server API. After a payment, the app client passes the receipt information to the app server, and the app server calls Verify consumable product receipts for consumable products or Verify subscription product receipts for subscription products.
For the implementation procedure for each payment provider, see the following.
- Consumable products: Verify Apple consumable product receipts, Verify Google Play consumable product receipts, Verify Steam consumable product receipts, Verify PG consumable product receipts
- Subscription products: Verify Apple subscription product receipts, Verify Google Play subscription product receipts
Common parameters
The last parameter of every method is ApiCallContext? context = null. If you omit it, the default values apply. For details, see Call context.
Every method takes the request body as the request parameter, and request is Required. The method descriptions below show only the request type and omit the parameter table. Check the fields of each request type in Data types.
Exceptions
ArgumentNullException: Whenrequestisnull
Common Failure codes
The server responds with the following codes, but because they are not feature-level results, they branch to Failure, not Outcome. The cause code is contained in Failure.Problem.ExternalCode. For result branches and how to branch on them, see Core result model.
bad_request: Bad requestinvalid_parameter: Invalid request parameter formatmissing_field: A required field or a required header itself, such asX-App-Id, is missingmissing_app_id: TheX-App-Idheader was sent, but its value is emptyunauthorized: The authentication token is missing or invalidtoken_expired: The authentication token has expiredforbidden: No permission for the requestresource_not_found: The requested resource does not existmethod_not_allowed: The request method is not allowedresource_conflict: The request conflicts with the resource stateunprocessable_content: The request content cannot be processedrate_limit_exceeded: The request rate exceeds the allowed limitinternal_error: Internal server errorservice_unavailable: Service temporarily unavailable
Methods
ListStoreProductIdsAsync
Gets the list of product IDs of the in-app products that the app sells. For each store, it returns the App ID, the list of consumable product IDs, and the list of subscription product IDs.
- Request: StoreRequest
- Response: StoreResponseData
- Authentication: Session required
Result cases — PaymentsListStoreProductIdsResult
| Result case | Wire code | Description |
|---|---|---|
Success | — | The retrieval succeeded. |
PaymentBadRequest | payment_bad_request | The payment request cannot be processed. |
PaymentInvalidParameter | payment_invalid_parameter | The payment request parameters are invalid. |
UnknownOutcome | UNKNOWN | A new result that this SDK version does not recognize. |
Failure | FAILURE | The call could not be completed. Common Failure codes also branch to this case. |
For the implementation procedure, see Get the Apple product ID list and Get the Google Play product ID list.
FetchAppleProductsAsync
Gets the Apple App Store in-app product list. When you also send product information retrieved with StoreKit, such as the local price, currency, display price, title, and description, the server compares it with the registered product information, merges them, and returns the final product list to display in the in-app store.
- Request: ProductApple
- Response: ProductResponseData
- Authentication: Session required
Result cases — PaymentsFetchAppleProductsResult
| Result case | Wire code | Description |
|---|---|---|
Success | — | The retrieval succeeded. |
PaymentBadRequest | payment_bad_request | The payment request cannot be processed. |
PaymentInvalidParameter | payment_invalid_parameter | The payment request parameters are invalid. |
UnknownOutcome | UNKNOWN | A new result that this SDK version does not recognize. |
Failure | FAILURE | The call could not be completed. Common Failure codes also branch to this case. |
For the implementation procedure, see Get Apple product details.
FetchGoogleProductsAsync
Gets the Google Play in-app product list. When you also send product information retrieved with Google Play Billing, such as the local price, currency, display price, title, and description, the server compares it with the registered product information, merges them, and returns the final product list to display in the in-app store.
- Request: ProductGoogle
- Response: ProductResponseData
- Authentication: Session required
Result cases — PaymentsFetchGoogleProductsResult
| Result case | Wire code | Description |
|---|---|---|
Success | — | The retrieval succeeded. |
PaymentBadRequest | payment_bad_request | The payment request cannot be processed. |
PaymentInvalidParameter | payment_invalid_parameter | The payment request parameters are invalid. |
PaymentResourceNotFound | payment_resource_not_found | The payment information cannot be found. |
UnknownOutcome | UNKNOWN | A new result that this SDK version does not recognize. |
Failure | FAILURE | The call could not be completed. Common Failure codes also branch to this case. |
For the implementation procedure, see Get Google Play product details.
FetchSteamProductsAsync
Gets the Steam product list. The request does not take the currency or country. The server calls Steam GetUserInfo with StorePlayerId to determine the user's currency and country, and then combines the registered products with prices that match the price tier for that currency and returns the list to display in the store. In this call, the server also verifies the Steam account linking and checks for blocks.
- Request: ProductSteam
- Response: ProductResponseData
- Authentication: Session required
Result cases — PaymentsFetchSteamProductsResult
| Result case | Wire code | Description |
|---|---|---|
Success | — | The retrieval succeeded. |
PaymentBadRequest | payment_bad_request | The payment request cannot be processed. |
PaymentInvalidParameter | payment_invalid_parameter | The payment request parameters are invalid. |
UnknownOutcome | UNKNOWN | A new result that this SDK version does not recognize. |
Failure | FAILURE | The call could not be completed. Common Failure codes also branch to this case. |
For the implementation procedure, see Get Steam product details.
FetchPgProductsAsync
Gets the product list for web payment PGs. This covers PG providers such as PortOne, MyCard, and Xsolla. Based on the requested currency, it combines the registered products with prices that match the per-currency price tier and returns the list to display in the store.
- Request: ProductPg
- Response: ProductResponseData
- Authentication: Session required
Result cases — PaymentsFetchPgProductsResult
| Result case | Wire code | Description |
|---|---|---|
Success | — | The retrieval succeeded. |
PaymentBadRequest | payment_bad_request | The payment request cannot be processed. |
PaymentInvalidParameter | payment_invalid_parameter | The payment request parameters are invalid. |
UnknownOutcome | UNKNOWN | A new result that this SDK version does not recognize. |
Failure | FAILURE | The call could not be completed. Common Failure codes also branch to this case. |
For the implementation procedure, see Get PG product information.
InitiatePurchaseAsync
A method only for Steam payments. Call it after you get the product list with FetchSteamProductsAsync. It creates an order and opens the payment with Steam InitTxn, and you receive the Hive Axyl order number and the Steam transaction ID in the response. When the call completes, the user approves the payment in the Steam overlay. Use RestorePurchasesAsync to restore orders that were approved but not closed.
A Steam payment proceeds in the following order.
- Get the product list matched to the user's currency with FetchSteamProductsAsync.
- Start receiving callbacks with StartCallbackListenerAsync(), and then create an order with
InitiatePurchaseAsync. - When the user approves the payment in the Steam overlay, you receive the approval result through the MicroTxnAuthorizationResponse event of the Steam Microtransactions payment Add-on.
- Save the payment result with RecordStorePurchaseAsync. The server checks the approval with Steam
QueryTxn. - The app client passes the receipt information to the app server, and the app server calls Verify consumable product receipts to verify the receipt. In this step, the actual charge occurs through Steam
FinalizeTxn. - The app server checks the verification result and delivers the product.
- Close the order with FinalizePurchaseAsync.
- Confirm the product delivery result with ItemResultAsync.
- Request: PurchaseInitRequest
- Response: PurchaseInitResponseData
- Authentication: Session required
Result cases — PaymentsInitiatePurchaseResult
| Result case | Wire code | Description |
|---|---|---|
Success | — | The order was created. |
PaymentBadRequest | payment_bad_request | The payment request cannot be processed. |
PaymentInvalidParameter | payment_invalid_parameter | The payment request parameters are invalid. |
UnknownOutcome | UNKNOWN | A new result that this SDK version does not recognize. |
Failure | FAILURE | The call could not be completed. Common Failure codes also branch to this case. |
For the implementation procedure, see Initialize the Steam payment session.
CreatePaymentUrlAsync
Based on the order information, creates and returns the PG payment page URL where the user makes the payment. When the app opens this URL in a WebView or browser, the user makes the payment on the PG payment page. The issued URL is valid only until the order expiration time.
- Request: OrderRequest
- Response: OrderPayUrlResponseData
- Authentication: Session required
Result cases — PaymentsCreatePaymentUrlResult
| Result case | Wire code | Description |
|---|---|---|
Success | — | The payment page URL was created. |
PaymentBadRequest | payment_bad_request | The payment request cannot be processed. |
PaymentInvalidParameter | payment_invalid_parameter | The payment request parameters are invalid. |
UnknownOutcome | UNKNOWN | A new result that this SDK version does not recognize. |
Failure | FAILURE | The call could not be completed. Common Failure codes also branch to this case. |
For the implementation procedure, see Create the PG payment page URL.
CreatePrePurchaseAsync
Call this method after the user chooses a product and selects the payment button, right before the store payment window opens. It saves payment attempt information, such as the product ID, payment amount, currency, app server, country and language, and IapPayload, as a pre-purchase record. The saved record is used to find the payment attempt and its saved IapPayload when purchase restoration is processed.
- Request: PrePurchase
- Response: SuccessResponseData
- Authentication: Session required
Result cases — PaymentsCreatePrePurchaseResult
| Result case | Wire code | Description |
|---|---|---|
Success | — | The payment attempt information was saved. |
PaymentBadRequest | payment_bad_request | The payment request cannot be processed. |
PaymentInvalidParameter | payment_invalid_parameter | The payment request parameters are invalid. |
UnknownOutcome | UNKNOWN | A new result that this SDK version does not recognize. |
Failure | FAILURE | The call could not be completed. Common Failure codes also branch to this case. |
For the implementation procedure, see Save purchase attempt information before payment.
RecordStorePurchaseAsync
Call this method right after the payment completes in the store to save the payment result, such as the receipt and the store transaction ID, on the server. Because the fact of the payment is recorded before the app server verifies the receipt, this record serves as the basis for receipt verification, product delivery, customer support, and settlement even if later steps are interrupted by a network failure or other problems.
For Steam payments, the server checks the user's payment approval with Steam QueryTxn in this step.
- Request: PurchaseRequest
- Response: PurchaseResponseData
- Authentication: Session required
Result cases — PaymentsRecordStorePurchaseResult
| Result case | Wire code | Description |
|---|---|---|
Success | — | The payment result was saved. |
PaymentBadRequest | payment_bad_request | The payment request cannot be processed. |
PaymentInvalidParameter | payment_invalid_parameter | The payment request parameters are invalid. |
PaymentResourceNotFound | payment_resource_not_found | The payment information cannot be found. |
PaymentUnauthorized | payment_unauthorized | No permission for the payment request. |
VerifyError | verify_error | An error occurred during payment verification. |
UnknownOutcome | UNKNOWN | A new result that this SDK version does not recognize. |
Failure | FAILURE | The call could not be completed. Common Failure codes also branch to this case. |
For the implementation procedure, see Save store payment results.
RequestPurchaseAsync
Confirms the payment status and changes the transaction to the finished state so that the same transaction is not delivered twice or processed again. Call it after the app server completes receipt verification.
- Request: PurchasePostRequest
- Response: PurchasePostResponseData
- Authentication: Session required
Result cases — PaymentsRequestPurchaseResult
| Result case | Wire code | Description |
|---|---|---|
Success | — | The payment was confirmed. |
PaymentBadRequest | payment_bad_request | The payment request cannot be processed. |
PaymentInvalidParameter | payment_invalid_parameter | The payment request parameters are invalid. |
PaymentResourceNotFound | payment_resource_not_found | The payment information cannot be found. |
PaymentUnauthorized | payment_unauthorized | No permission for the payment request. |
VerifyDuplicated | verify_duplicated | The receipt has already been verified. |
VerifyError | verify_error | An error occurred during payment verification. |
UnknownOutcome | UNKNOWN | A new result that this SDK version does not recognize. |
Failure | FAILURE | The call could not be completed. Common Failure codes also branch to this case. |
For the implementation procedure, see Confirm the payment after receipt verification.
FinalizePurchaseAsync
Finalizes a Steam or PG payment. For Steam payments, it closes the order. Because the actual charge was already completed in the app server's receipt verification step, no additional charge occurs. For PG payments, it completes the transaction in this step.
- Request: PurchaseFinalizeRequest
- Response: PurchaseFinalizeResponseData
- Authentication: Session required
Result cases — PaymentsFinalizePurchaseResult
| Result case | Wire code | Description |
|---|---|---|
Success | — | The payment was finalized. |
PaymentBadRequest | payment_bad_request | The payment request cannot be processed. |
PaymentInvalidParameter | payment_invalid_parameter | The payment request parameters are invalid. |
PaymentResourceNotFound | payment_resource_not_found | The payment information cannot be found. |
UnknownOutcome | UNKNOWN | A new result that this SDK version does not recognize. |
Failure | FAILURE | The call could not be completed. Common Failure codes also branch to this case. |
For the implementation procedure, see Finalize the Steam purchase and Finalize the PG purchase.
RestorePurchasesAsync
Gets previous Steam or PG purchases whose products were not delivered. Use it to deliver again products that could not be delivered because of a network error or other problems. For Steam payments, it uses Steam QueryTxn to recheck orders that were approved but not closed, and restores orders whose payment succeeded or was approved.
- Request: PurchaseRestoreRequest
- Response: PurchaseRestoreResponseData
- Authentication: Session required
Result cases — PaymentsRestorePurchasesResult
| Result case | Wire code | Description |
|---|---|---|
Success | — | The retrieval succeeded. Purchases to restore are contained in Data.Restores. |
PaymentBadRequest | payment_bad_request | The payment request cannot be processed. |
PaymentInvalidParameter | payment_invalid_parameter | The payment request parameters are invalid. |
PaymentResourceNotFound | payment_resource_not_found | The payment information cannot be found. |
UnknownOutcome | UNKNOWN | A new result that this SDK version does not recognize. |
Failure | FAILURE | The call could not be completed. Common Failure codes also branch to this case. |
For the implementation procedure, see Restore unfinished Steam transactions and Get PG orders with undelivered products.
ItemResultAsync
When the app server finishes delivering a consumable product, use this method to record the delivery result, such as success or cancellation, and the quantity on the Hive Axyl server and to confirm the transaction. The server checks whether the delivery actually succeeded in the app to keep payments and deliveries consistent, and the record serves as the basis for deciding refunds and redelivery for failed or canceled deliveries.
- Request: ItemResultBody
- Response: SuccessResponseData
- Authentication: Session required
Result cases — PaymentsItemResultResult
| Result case | Wire code | Description |
|---|---|---|
Success | — | The delivery result was saved. |
InvalidQuantity | invalid_quantity | The delivery quantity is invalid. |
InvalidStatus | invalid_status | The delivery result status value is invalid. |
PaymentBadRequest | payment_bad_request | The payment request cannot be processed. |
PaymentInvalidParameter | payment_invalid_parameter | The payment request parameters are invalid. |
PaymentResourceNotFound | payment_resource_not_found | The payment information cannot be found. |
UnknownOutcome | UNKNOWN | A new result that this SDK version does not recognize. |
Failure | FAILURE | The call could not be completed. Common Failure codes also branch to this case. |
For the implementation procedure, see Save Apple product delivery results, Save Google Play product delivery results, Save Steam product delivery results, and Save PG product delivery results.
PrepareSubscriptionAsync
Saves product information and IapPayload in advance before a subscription payment starts, and returns the ID of the saved pre-purchase record.
- Request: SubscriptionPrePurchaseRequest
- Response: SubscriptionPrePurchaseResponseData
- Authentication: Session required
Result cases — PaymentsPrepareSubscriptionResult
| Result case | Wire code | Description |
|---|---|---|
Success | — | The pre-purchase information was saved. |
PaymentBadRequest | payment_bad_request | The payment request cannot be processed. |
PaymentInvalidParameter | payment_invalid_parameter | The payment request parameters are invalid. |
PaymentResourceNotFound | payment_resource_not_found | The payment information cannot be found. |
UnknownOutcome | UNKNOWN | A new result that this SDK version does not recognize. |
Failure | FAILURE | The call could not be completed. Common Failure codes also branch to this case. |
PurchaseSubscriptionAsync
Gets the store's subscription purchase information with the subscription receipt and saves it as a subscription record. Call it after the subscription payment completes and before the app server requests receipt verification.
The response contains the transaction ID and the lookup key of the saved subscription record, and in the PostSubscriptionAsync step, the server uses this lookup key to find the same subscription record. In AxylReceipt of the PostSubscriptionAsync request, put the same value that you sent to this method.
- Request: SubscriptionPurchaseRequest
- Response: SubscriptionPurchaseResponseData
- Authentication: Session required
Result cases — PaymentsPurchaseSubscriptionResult
| Result case | Wire code | Description |
|---|---|---|
Success | — | The subscription purchase information was saved. |
PaymentBadRequest | payment_bad_request | The payment request cannot be processed. |
PaymentInvalidParameter | payment_invalid_parameter | The payment request parameters are invalid. |
PaymentResourceConflict | payment_resource_conflict | The state of the payment information conflicts with the request. |
PaymentResourceNotFound | payment_resource_not_found | The payment information cannot be found. |
PaymentUnauthorized | payment_unauthorized | No permission for the payment request. |
VerifyError | verify_error | An error occurred during payment verification. |
UnknownOutcome | UNKNOWN | A new result that this SDK version does not recognize. |
Failure | FAILURE | The call could not be completed. Common Failure codes also branch to this case. |
For the implementation procedure, see Save Apple subscription purchase information and Save Google Play subscription purchase information.
PostSubscriptionAsync
Confirms the subscription payment and finishes the transaction. Call it after the app server completes receipt verification. Because Success can be returned even when there is no subscription record to confirm, check whether HiveAxylTransactionId in the response is null to determine whether the subscription was actually confirmed.
- Request: SubscriptionPurchasePostRequest
- Response: SubscriptionPurchasePostResponseData
- Authentication: Session required
Result cases — PaymentsPostSubscriptionResult
| Result case | Wire code | Description |
|---|---|---|
Success | — | The request was processed. Check Data.HiveAxylTransactionId to see whether the subscription was actually confirmed. |
PaymentBadRequest | payment_bad_request | The payment request cannot be processed. |
PaymentInvalidParameter | payment_invalid_parameter | The payment request parameters are invalid. |
PaymentResourceNotFound | payment_resource_not_found | The payment information cannot be found. |
PaymentUnauthorized | payment_unauthorized | No permission for the payment request. |
VerifyDuplicated | verify_duplicated | The receipt has already been verified. |
VerifyError | verify_error | An error occurred during payment verification. |
UnknownOutcome | UNKNOWN | A new result that this SDK version does not recognize. |
Failure | FAILURE | The call could not be completed. Common Failure codes also branch to this case. |
For the implementation procedure, see Complete the Apple subscription and Complete the Google Play subscription.
Data types
Fields shared by multiple types have the same meaning.
AppVersion: App versionCountry: Two-letter ISO 3166-1 country code. Example:KRCurrency: Three-letter ISO 4217 currency code. Example:KRWLanguage: Two-letter ISO 639-1 language code. Example:koServerId: App server IDAccountUuid: Account UUID used to check whether the user who paid and the user who made the request are the same. For how to create it and what it is used for, see AccountUuid rules.AxylReceipt: Payment receipt. For the value to put in for each payment provider, see AxylReceipt rules.Meta: Additional information that the server sends along. It contains the raw, unprocessed JSON string.
The following request fields are of type string? but contain JSON text. Because the SDK puts the value into the request body as is without processing it, put in a valid JSON object. For example, put a value such as {"serverId":"server01","eventId":"summer_sale"} in ItemResultBody.ProjectPayloadInfo.
ItemResultBody.ProjectPayloadInfoProductGoogleOfferDetails.PreorderDetailsProductGoogleOfferDetails.RentalDetails
AccountUuid rules
AccountUuid is an account UUID used to check whether the user who paid and the user who made the request are the same. The server does not create or return this value, so the app creates it from the Player ID and puts it in the request. Because it is a one-way value that does not contain the Player ID, the Player ID cannot be derived from the UUID alone.
AccountUuid is an optional field in every request that accepts it. If you do not set a value, the field is left out of the request body, so set a value in requests where the server needs to compare store account identifiers or find a pre-purchase record.
How to generate
Generate AccountUuid as a name-based UUIDv5 as defined in RFC 4122, section 4.3. This method hashes a namespace UUID and a name with SHA-1, and the result is an RFC 4122 UUID string. You cannot use MD5-based UUIDv3, random UUIDv4, or time-based UUIDv7.
For the name, use the Player ID as a decimal string as is. For example, the name for Player ID 1234567890 is "1234567890"; if you pad it with leading zeros or convert it to hexadecimal or binary, you get a different UUID. The app decides the namespace, and a different namespace produces a different UUID even for the same Player ID. Because the same Player ID must produce the same UUID no matter when, on which device, or on which platform it is generated, use the same namespace on all platforms of an app and do not change it once you set it.
How the server uses the value
The server uses this value for the following purposes.
- Store account identifier comparison: The value compared with Apple
appAccountTokenand GoogleobfuscatedExternalAccountId. The comparison result is contained inhiveAxylAccountUuidCompareof the Verify consumable product receipts and Verify subscription product receipts responses that the app server receives. - Pre-purchase record lookup: The key used to find the record saved before payment during auto-renewal and purchase restoration. If the value changes with each call, the record cannot be found, so
IapPayloadcannot be restored.
hiveAxylAccountUuidCompare is one of 1 (match), 2 (mismatch), or 9 (cannot compare). If either value is missing or is not in UUID format, the result is 9, not 2; 2 occurs only when both values are in UUID format and differ from each other. For the comparison result to be 1, when making the payment you must put the same AccountUuid in PurchaseOptions.AppAccountToken for Apple payments or in LaunchBillingFlowRequest.ObfuscatedAccountId for Google Play payments.
Send AccountUuid in subscription pre-purchase requests as well
The request succeeds even if you omit AccountUuid in SubscriptionPrePurchaseRequest. However, without the value, the account identifier in the store receipt cannot be compared, so verification passes even when another account verifies a different user's subscription. Because auto-renewal notifications do not contain the Player ID, this value is also used as the key to find the delivery target.
AxylReceipt rules
The value you put in AxylReceipt differs by payment provider. For Apple and Google, put the value issued by the store; for Steam and PG, put the value issued by the Hive Axyl server. Put the same value in axylReceipt of the receipt verification request that the app server sends. If you modify the value, receipt verification fails. For Steam and PG payments, the server compares the receipt with the saved order information.
- Apple: The original text of AppleTransaction.JwsRepresentation, the JSON Web Signature (JWS) of the StoreKit 2 transaction. It consists of three parts:
header.payload.signature. - Google: The GooglePurchase.PurchaseToken string, which is the purchase token. Because the purchase token does not contain the product ID, requests that have a
ProductIdfield must also specifyProductId; otherwise, the request is rejected. - Steam: The original
AxylReceiptreceived in the InitiatePurchaseAsync or RestorePurchasesAsync response - PG: The original
AxylReceiptreceived in the RestorePurchasesAsync response
Google also accepts a JSON string that contains purchase_data and signature instead of the purchase token. In this format, put GooglePurchase.OriginalJson in purchase_data and GooglePurchase.Signature in signature. You must put in OriginalJson exactly as the original text that Google Play returned; if you serialize it again, signature verification fails.
ItemResultAsset
Information about a delivered product.
| Field | Type | Required | Description |
|---|---|---|---|
AssetId | string? | Optional | Product ID that is unique within the app. |
AssetName | string? | Optional | Product name used within the app. |
Quantity | int? | Optional | Delivered quantity. Must be 1 or more. |
ItemResultBody
Request that saves the delivery result of a consumable product.
| Field | Type | Required | Description |
|---|---|---|---|
Assets | IReadOnlyList<ItemResultAsset>? | Optional | List of products actually delivered. The server skips items with no fields specified, so if there are no items to send, omit this field. |
AxylTransactionId | string | Required | Hive Axyl payment transaction ID. Put the hiveAxylTransactionId that the app server received in the Verify consumable product receipts response and passed to the app client. The prefix identifies the payment provider. |
ProjectPayloadInfo | string? | Optional | JSON text that contains app-specific free-form data. |
Status | int | Required | Delivery result. 1 confirms success, 2 is a cancellation without reclaiming the product, and 3 is a cancellation with reclaiming the product. If you send any other value, the request is rejected. |
OrderPayUrlResponseData
Response to creating a PG payment page URL.
| Field | Type | Required | Description |
|---|---|---|---|
CreatedAt | DateTimeOffset? | Optional | Time when the payment page URL was created. |
PayUrl | string? | Optional | Payment page URL. Valid only until the order expiration time. |
Meta | string? | Optional | Additional information that the server sends along. |
OrderRequest
Request to create a PG payment page URL.
| Field | Type | Required | Description |
|---|---|---|---|
AppVersion | string? | Optional | App version. |
Country | string | Required | Country code. |
CustomPrice | string? | Optional | Custom payment amount used when paying with an amount that the app server specifies instead of the amount set for the product. Must be used together with FixedCurrency and GameServerPriceVerifyKey. |
FixedCurrency | string? | Optional | Currency code to display on the payment method. Needed when you use CustomPrice. |
GameServerPriceVerifyKey | string? | Optional | Amount verification key issued by the app server to prevent tampering with the custom amount. Needed when you use CustomPrice. |
IapPayload | string? | Optional | JSON string metadata that the developer defines and passes to the app server. It is passed as is to the app server callback after the payment completes. |
Language | string | Required | Language code. Used to display payment method names in multiple languages. |
Os | OrderRequestOs | Required | OS of the app client. |
ProductId | string | Required | In-app product ID registered in the store. |
ProviderId | OrderRequestProviderId | Required | Payment provider. Specify Pg. |
Quantity | int | Required | Purchase quantity, in the range of 1 to 999. |
ServerId | string? | Optional | App server ID. |
PrePurchase
Request that saves payment attempt information right before the store payment window opens.
| Field | Type | Required | Description |
|---|---|---|---|
AccountUuid | string? | Optional | Account UUID. Follows the AccountUuid rules. |
Country | string | Required | Country code. |
Currency | string | Required | Payment currency code. |
IapPayload | string? | Optional | JSON string payload that the developer attaches to a store payment. It is passed as is to the app server callback after the payment completes. |
Language | string | Required | Language code. |
Price | decimal | Required | Amount to pay in the local currency. The number of decimal places depends on the currency: 0 for KRW and JPY, and 2 for USD and EUR. Example: KRW 1200, USD 4.99 |
ProductId | string | Required | In-app product ID registered in the store. |
ProviderId | PrePurchaseProviderId | Required | Payment provider. |
RequestDate | DateTimeOffset? | Optional | Request time, in UTC. |
ServerId | string? | Optional | App server ID. |
ProductApple
Request to get the Apple App Store product list.
| Field | Type | Required | Description |
|---|---|---|---|
AppVersion | string? | Optional | App version. |
Country | string | Required | Country code. |
Currency | string | Required | Currency code. |
Language | string | Required | Language code. |
ProductType | string | Required | Product type to get: subscription for subscriptions and consumable for consumable products. |
Products | IReadOnlyList<ProductAppleProducts> | Required | Product list retrieved with StoreKit 2. |
ProviderId | ProductAppleProviderId | Required | Payment provider. Specify Apple. |
ProductAppleProducts
Information about one product retrieved with StoreKit 2. Except for ProductType, put in the values exactly as StoreKit 2 returned them without converting them.
| Field | Type | Required | Description |
|---|---|---|---|
Description | string? | Optional | Detailed product description. |
DisplayName | string? | Optional | Product name. |
DisplayPrice | string? | Optional | Display price including the currency symbol. |
Id | string | Required | Product ID, which is also the key that the server uses to match registered products. If it is empty, the request is rejected. |
Price | decimal? | Optional | Product price. Put in the value as is, even for currencies with decimal places, such as USD and EUR. |
PriceLocale | string? | Optional | Price locale. The server extracts the currency and country from this value, so put in the original text as is. Example: ko_KR@currency=KRW |
ProductType | int? | Optional | Numeric product type code. 0 is unspecified, 1 is consumable, 2 is non-consumable, 3 is an auto-renewable subscription, and 4 is a non-renewing subscription. Values not in this list are not rejected but are treated as 0. This is separate from ProductApple.ProductType at the top level of the request. |
ProductDetails
Information about one product retrieved with Google Play Billing. Put in the values that Google Play Billing returned, including the nested offer information, and put in ProductType as a numeric code.
| Field | Type | Required | Description |
|---|---|---|---|
Description | string? | Optional | Product description. |
OneTimePurchaseOfferDetails | ProductGoogleOfferDetails? | Optional | ProductDetails.oneTimePurchaseOfferDetails of Google Play Billing. |
OneTimePurchaseOfferDetailsList | IReadOnlyList<ProductGoogleOfferDetails>? | Optional | List of one-time product offers that contains both discount offers and the base offer. If it has a value, it takes precedence over OneTimePurchaseOfferDetails. |
ProductId | string | Required | Product ID, which is also the key that the server uses to match registered products. If it is empty, the request is rejected. |
ProductType | int? | Optional | Numeric product type code. 1 is consumable and 2 is subscription. Values not in this list are not rejected but are treated as 0, the unspecified value. This is separate from ProductGoogle.ProductType at the top level of the request. |
SubscriptionOfferDetails | IReadOnlyList<ProductGoogleSubscriptionOffer>? | Optional | List of subscription offers. If the list is not empty, the product is treated as a subscription product, and the prices are in PricingPhases of each offer. |
Title | string? | Optional | Product title. |
ProductGoogle
Request to get the Google Play product list.
| Field | Type | Required | Description |
|---|---|---|---|
AppVersion | string? | Optional | App version. |
Country | string | Required | Country code. |
Currency | string | Required | Currency code. |
Language | string | Required | Language code. |
ProductType | string | Required | Product type to get: subscription for subscriptions and consumable for consumable products. |
Products | IReadOnlyList<ProductDetails> | Required | Product list retrieved with Google Play Billing. |
ProviderId | ProductGoogleProviderId | Required | Payment provider. Specify Google. |
ProductGoogleOfferDetails
One-time product offer information from Google Play Billing.
| Field | Type | Required | Description |
|---|---|---|---|
FormattedPrice | string? | Optional | Price formatted for display by Google Play. |
OfferId | string? | Optional | Offer ID. If it is null, the offer is the base offer sold at the regular price. |
OfferToken | string? | Optional | Offer token. Google Play issues a new one for each retrieval, so do not cache or reuse it. |
PreorderDetails | string? | Optional | JSON text that indicates a pre-order offer. If it has a value, the offer is excluded from the display price candidates. The server does not read the content; it only checks whether a value exists. |
PriceAmount | decimal? | Optional | Amount in currency units. If PriceAmountMicros is also present, PriceAmountMicros is used as the basis. |
PriceAmountMicros | long? | Optional | Amount in micro-units. If it has a value, this value is used as the basis. |
PriceCurrencyCode | string? | Optional | Currency code. |
RentalDetails | string? | Optional | JSON text that indicates a rental offer. If it has a value, the offer is excluded from the display price candidates. The server does not read the content; it only checks whether a value exists. |
ProductGooglePricingPhase
Subscription pricing phase from Google Play Billing.
| Field | Type | Required | Description |
|---|---|---|---|
BillingCycleCount | int? | Optional | Number of billing cycles. It is 0 for an infinitely recurring phase. |
BillingPeriod | string? | Optional | Billing period in ISO 8601 duration format. Example: P1M |
FormattedPrice | string? | Optional | Price formatted for display by Google Play. |
PriceAmount | decimal? | Optional | Amount in currency units. If PriceAmountMicros is also present, PriceAmountMicros is used as the basis. |
PriceAmountMicros | long? | Optional | Amount in micro-units. If it has a value, this value is used as the basis. |
PriceCurrencyCode | string? | Optional | Currency code. |
RecurrenceMode | int? | Optional | Recurrence mode. 1 is infinite recurrence, 2 is recurrence for a fixed number of cycles, and 3 is one time. The display price is taken from the phase whose value is 1. |
ProductGoogleSubscriptionOffer
Subscription offer from Google Play Billing. The prices are in PricingPhases.
| Field | Type | Required | Description |
|---|---|---|---|
BasePlanId | string? | Optional | Base plan ID. |
OfferId | string? | Optional | Offer ID. If it is null, the offer is the base offer. |
OfferTags | IReadOnlyList<string>? | Optional | List of offer tags. |
OfferToken | string? | Optional | Offer token. Google Play issues a new one for each retrieval, so do not cache it. |
PricingPhases | IReadOnlyList<ProductGooglePricingPhase>? | Optional | List of pricing phases. |
ProductOffer
One-time offer or subscription offer contained in the product retrieval response. Offers are distinguished by OfferToken.
| Field | Type | Required | Description |
|---|---|---|---|
BasePlanId | string? | Optional | Base plan ID of the subscription. It is null for one-time offers. |
Currency | string? | Optional | Currency code. |
DisplayPrice | string? | Optional | Display price. |
OfferToken | string? | Optional | Offer token. Google Play issues a new one for each retrieval, so do not cache it. |
Price | decimal? | Optional | Price adjusted to the number of decimal places of the currency. |
ProductPg
Request to get the PG product list.
| Field | Type | Required | Description |
|---|---|---|---|
AppVersion | string? | Optional | App version. |
Country | string | Required | Country code. |
Currency | string | Required | Currency code. |
Language | string | Required | Language code. |
ProductType | string? | Optional | Product type. |
ProviderId | ProductPgProviderId | Required | Payment provider. Specify Pg. |
ServerId | string? | Optional | App server ID. Not used for product retrieval. |
ProductProducts
Information about one product contained in the product retrieval response.
| Field | Type | Required | Description |
|---|---|---|---|
Currency | string? | Optional | Currency code. |
Description | string? | Optional | Product description. |
DisplayOriginalPrice | string? | Optional | Original price for display. |
DisplayPrice | string? | Optional | Display price. |
Offers | IReadOnlyList<ProductOffer>? | Optional | List of one-time offers and subscription offers. It is null if there are no offers. |
OriginalPrice | decimal? | Optional | Original price adjusted to the number of decimal places of the currency. Example: KRW 1100, USD 11.00 |
Price | decimal? | Optional | Price adjusted to the number of decimal places of the currency. Example: KRW 9900, USD 9.99 |
ProductId | string? | Optional | Product ID. |
ProductType | string? | Optional | Product type: subscription for subscriptions and consumable for consumable products. |
Title | string? | Optional | Product title. |
ProductResponseData
Response that the product list retrieval methods return in common. It has the same form for Apple, Google, Steam, and PG.
| Field | Type | Required | Description |
|---|---|---|---|
AppVersion | string? | Optional | App version. |
Country | string? | Optional | Country code. |
Currency | string? | Optional | Currency code. |
Language | string | Required | Language code. |
Products | IReadOnlyList<ProductProducts>? | Optional | Product list. |
ProviderId | ProductProviderId | Required | Payment provider. |
Meta | string? | Optional | Additional information that the server sends along. |
ProductSteam
Request to get the Steam product list. Do not put the currency and country in the request; the server determines them from StorePlayerId.
| Field | Type | Required | Description |
|---|---|---|---|
AppVersion | string? | Optional | App version. |
Language | string | Required | Language code. |
ProductType | string? | Optional | Product type. |
ProviderId | ProductSteamProviderId | Required | Payment provider. Specify Steam. |
ServerId | string? | Optional | App server ID. Not used for product retrieval. |
StorePlayerId | long | Required | Steam 64-bit SteamID. The server calls Steam GetUserInfo with this value to determine the currency and country. Must be 1 or more. |
PurchaseFinalizeRequest
Request that finalizes a Steam or PG payment. Because the server reads the order number from AxylReceipt, the request has no order number field.
| Field | Type | Required | Description |
|---|---|---|---|
AxylReceipt | string | Required | Payment receipt. Follows the AxylReceipt rules. |
ProviderId | PurchaseFinalizeRequestProviderId | Required | Payment provider. Specify Steam or Pg. |
PurchaseFinalizeResponseData
Response to finalizing a Steam or PG payment.
| Field | Type | Required | Description |
|---|---|---|---|
OrderId | string? | Optional | Order ID of the Steam payment. It is null for PG payments, which use StoreTransactionId instead. |
StoreTransactionId | string? | Optional | Store transaction ID of the PG payment. It is null for Steam payments, which use OrderId instead. |
Meta | string? | Optional | Additional information that the server sends along. |
PurchaseInitRequest
Request to initialize a Steam payment.
| Field | Type | Required | Description |
|---|---|---|---|
AppVersion | string? | Optional | App version. |
Country | string | Required | Country code. |
Currency | string | Required | Currency code. |
IapPayload | string? | Optional | Developer-defined payload. Example: {"serverId":"server01"} |
Language | string | Required | Language code. |
ProductId | string | Required | ID of the product to purchase. |
ProviderId | PurchaseInitRequestProviderId | Required | Payment provider. Specify Steam. |
ServerId | string? | Optional | App server ID. |
StorePlayerId | long | Required | Steam 64-bit SteamID, which is the store user ID. Must be 1 or more. |
PurchaseInitResponseData
Response to initializing a Steam payment. It contains the information needed to display the Steam payment window.
| Field | Type | Required | Description |
|---|---|---|---|
AxylReceipt | string? | Optional | Receipt issued by the server. It bundles the order number, amount, currency, product, and App ID and is used to check for tampering. Keep it, and put it as is in AxylReceipt of the RecordStorePurchaseAsync and FinalizePurchaseAsync requests and in axylReceipt of the Verify consumable product receipts request that the app server sends. |
OrderId | string | Required | Hive Axyl internal order number. Put it as is in OrderId of the RecordStorePurchaseAsync request. If you put it in orderId of the Verify consumable product receipts request that the app server sends, you can specify the order; if you omit it, the server finds the order by storeTransactionId or axylReceipt. |
ProductId | string | Required | In-app product ID registered in the store. |
StoreTransactionId | string | Required | Steam transaction ID, which is transid in the Steam Web API. Used to display the Steam payment window. |
Meta | string? | Optional | Additional information that the server sends along. |
PurchasePostRequest
Payment confirmation request. ProviderId and AxylReceipt are common to all payment providers, and the other fields are needed depending on the payment provider.
| Field | Type | Required | Description |
|---|---|---|---|
AxylReceipt | string | Required | Payment receipt. Follows the AxylReceipt rules. |
FinalizationMsg | string? | Optional | Payment completion message. Saved only for Apple and Google payments. |
ProductId | string? | Optional | In-app product ID registered in the store. Used only for Google payments. It is required if AxylReceipt is a purchase token; if AxylReceipt is a JSON string that contains purchase_data and signature, omit it because the value is read from the receipt. |
ProviderId | PurchasePostRequestProviderId | Required | Payment provider. |
StoreTransactionId | string? | Optional | Store transaction ID. Used only for Apple payments; because it is the StoreKit 2 reverification key, it is required for Apple payments. |
PurchasePostResponseData
Payment confirmation response.
| Field | Type | Required | Description |
|---|---|---|---|
Meta | string? | Optional | Additional information that the server sends along. |
PurchaseRequest
Request that saves the receipt and payment information after the store payment completes.
| Field | Type | Required | Description |
|---|---|---|---|
AccountUuid | string? | Optional | Account UUID. Follows the AccountUuid rules. |
AxylReceipt | string | Required | Payment receipt. Follows the AxylReceipt rules. |
Country | string | Required | Country code. |
Currency | string? | Optional | Payment currency code. It is used only for comparison with the server record together with Price, and the server value is saved in the payment record. If you send only Price without Currency, the currency comparison is skipped and only the amount is compared. |
IapPayload | string? | Optional | JSON string payload that the developer attached to the store payment. It is passed as is to app server verification and to the payment completion callback. |
Language | string | Required | Language code. |
OrderId | string? | Optional | Hive Axyl internal order number, which is the order key for Steam and PG payments. For Steam payments, put the OrderId from the InitiatePurchaseAsync response as is. |
Price | decimal? | Optional | Payment amount in the local currency. The server value, not this value, is saved in the payment record. If you send a value, the server compares it. If the values differ, Apple, Steam, and PG payments reject the request by default, while Google payments do not reject the request. If you omit it, no comparison is made. |
ProductId | string | Required | In-app product ID registered in the store. For Steam and PG payments, this value is not used because the order information saved on the server is used instead. |
ProjectInfo | string? | Optional | JSON string that contains app-specific free-form additional data. It is only saved and not passed to the app server, so use IapPayload for values to pass to the app server. |
ProviderId | PurchaseRequestProviderId | Required | Payment provider. |
Quantity | int? | Optional | Purchase quantity. |
RequestDate | DateTimeOffset? | Optional | Request time of the app client. If omitted, the server's current time is used. |
RequestType | int? | Optional | Request type. 1 is a new purchase and 2 is purchase restoration. |
ServerId | string? | Optional | App server ID. |
StoreTransactionId | string? | Optional | Store transaction ID, which is the store-side order number. |
PurchaseResponseData
Response to saving the payment result.
| Field | Type | Required | Description |
|---|---|---|---|
Meta | string? | Optional | Additional information that the server sends along. |
PurchaseRestoreRequest
Request to restore Steam or PG purchases.
| Field | Type | Required | Description |
|---|---|---|---|
AppVersion | string? | Optional | App version. |
Country | string | Required | Country code. |
Language | string | Required | Language code. |
ProviderId | PurchaseRestoreRequestProviderId | Required | Payment provider. Specify Steam or Pg. |
ServerId | string? | Optional | App server ID. If specified, only the orders for that server are returned; if omitted, all orders are returned. |
PurchaseRestoreResponseData
Purchase restoration response.
| Field | Type | Required | Description |
|---|---|---|---|
Restores | IReadOnlyList<RestorePurchase>? | Optional | List of purchases that can be restored. |
Meta | string? | Optional | Additional information that the server sends along. |
RestorePurchase
Information about one purchase that can be restored. ProviderId identifies the payment provider.
| Field | Type | Required | Description |
|---|---|---|---|
AxylReceipt | string? | Optional | Receipt for tamper checking issued by the server. It is always returned for PG and Steam payments; put it as is in AxylReceipt of the FinalizePurchaseAsync request and in axylReceipt of the Verify consumable product receipts request that the app server sends. It is null for Apple and Google payments because they are verified with the actual receipt issued by the store. |
Currency | string? | Optional | Currency code. |
GameServerPriceVerifyKey | string? | Optional | App server amount verification key. |
IapPayload | string? | Optional | Additional payload to pass to the app server. |
OrderId | string? | Optional | Order ID. |
PaidDateTime | string? | Optional | Payment completion time, in yyyy-MM-dd HH:mm:ss format. |
PaidDateTimeMs | long? | Optional | Payment completion time, in Unix epoch milliseconds. |
Price | decimal? | Optional | Payment amount. |
ProductId | string? | Optional | Product ID. |
ProviderId | RestorePurchaseProviderId | Required | Payment provider. |
PurchaseDateTime | long? | Optional | Purchase time, in Unix epoch milliseconds. It is null for PG payments, which use StartedDateTime and PaidDateTime instead. |
Quantity | int? | Optional | Purchase quantity. |
StartedDateTime | string? | Optional | Payment start time, in yyyy-MM-dd HH:mm:ss format. |
StartedDateTimeMs | long? | Optional | Payment start time, in Unix epoch milliseconds. |
StoreTransactionId | string? | Optional | Store transaction ID. For Steam, it is transid, the Steam transaction ID; for PG, it is the store transaction ID and can differ from OrderId. |
StoreProduct
Product ID lists for one store.
| Field | Type | Required | Description |
|---|---|---|---|
AppId | string? | Optional | App ID. |
ProductSubscriptions | IReadOnlyList<string>? | Optional | List of subscription product IDs. |
Products | IReadOnlyList<string>? | Optional | List of consumable product IDs. |
ProviderId | StoreProductProviderId | Required | Payment provider. |
StoreRequest
Request to get the product ID list.
| Field | Type | Required | Description |
|---|---|---|---|
AppVersion | string? | Optional | App version. |
Country | string | Required | Country code. |
Language | string | Required | Language code. |
ProviderId | StoreRequestProviderId | Required | Payment provider. |
StoreResponseData
Response to getting the product ID list.
| Field | Type | Required | Description |
|---|---|---|---|
Stores | IReadOnlyList<StoreProduct> | Required | Product ID lists by store. |
Meta | string? | Optional | Additional information that the server sends along. |
SubscriptionPrePurchaseRequest
Request that saves product information and IapPayload in advance before a subscription payment.
| Field | Type | Required | Description |
|---|---|---|---|
AccountUuid | string? | Optional | Account UUID. Follows the AccountUuid rules. The request succeeds even if you do not send it, but store account identifier comparison and pre-purchase record lookup during auto-renewal and purchase restoration do not work, so send a value. |
AppVersion | string? | Optional | App version. |
Country | string | Required | Country code. |
Currency | string | Required | Currency code. |
IapPayload | string? | Optional | Developer-defined payload. |
Language | string | Required | Language code. |
Price | decimal | Required | Price. |
ProductId | string | Required | Product ID. |
ProviderId | SubscriptionPrePurchaseRequestProviderId | Required | Payment provider. |
RequestTimeMs | long? | Optional | Request time, in Unix epoch milliseconds. |
ServerId | string? | Optional | App server ID. |
SubscriptionPrePurchaseResponseData
Response to saving subscription pre-purchase information.
| Field | Type | Required | Description |
|---|---|---|---|
HiveAxylPrePurchaseId | string | Required | ID of the saved pre-purchase record. It is in UUIDv7 format and is used to track the record. |
HiveAxylProductId | string | Required | ID of the subscription product for which the pre-purchase was recorded. |
Meta | string? | Optional | Additional information that the server sends along. |
SubscriptionPurchasePostRequest
Request that confirms a subscription payment and finishes the transaction.
| Field | Type | Required | Description |
|---|---|---|---|
AppVersion | string? | Optional | App version. |
AxylReceipt | string | Required | Payment receipt. Follows the AxylReceipt rules. Put the same value that you sent in the PurchaseSubscriptionAsync request. |
Country | string | Required | Country code. |
Currency | string | Required | Currency code. |
Language | string | Required | Language code. |
ProductId | string | Required | Subscription product ID. |
ProviderId | SubscriptionPurchasePostRequestProviderId | Required | Payment provider. |
RequestTimeMs | long? | Optional | Request time, in Unix epoch milliseconds. |
RequestType | int? | Optional | Request type. 1 is a new purchase and 2 is purchase restoration. |
ServerId | string? | Optional | App server ID. |
SubscriptionPurchasePostResponseData
Subscription payment confirmation response.
| Field | Type | Required | Description |
|---|---|---|---|
HiveAxylProductId | string | Required | ID of the confirmed subscription product. If there was no record to confirm, the request value is returned as is. |
HiveAxylStoreTransactionId | string? | Optional | Lookup key of the subscription record. |
HiveAxylTransactionId | string? | Optional | Transaction ID of the confirmed subscription record, in UUIDv7 format. It is null if there was no record to confirm, so even if the result is Success, use this value to determine whether the subscription was actually confirmed. |
Meta | string? | Optional | Additional information that the server sends along. |
SubscriptionPurchaseRequest
Request to save subscription purchase information.
| Field | Type | Required | Description |
|---|---|---|---|
AppVersion | string? | Optional | App version. |
AxylReceipt | string | Required | Payment receipt. Follows the AxylReceipt rules. |
Country | string | Required | Country code. |
Currency | string | Required | Currency code. |
Language | string | Required | Language code. |
OriginalPrice | decimal? | Optional | Original price before discount. |
Price | decimal | Required | Price. |
ProviderId | SubscriptionPurchaseRequestProviderId | Required | Payment provider. |
RequestTimeMs | long? | Optional | Request time, in Unix epoch milliseconds. |
ServerId | string? | Optional | App server ID. |
StoreTransactionId | string? | Optional | Store transaction ID. For Apple, you can omit it because the lookup key originalTransactionId is in the transaction JWS; even if you send a value, the server uses the value from the JWS that passed signature verification. For Google, you do not need to send it; the server creates the lookup key from orderId in the receipt and uses the purchase token hash if there is no orderId. |
SubscriptionPurchaseResponseData
Response to saving subscription purchase information.
| Field | Type | Required | Description |
|---|---|---|---|
HiveAxylProductId | string? | Optional | Saved subscription product ID. The value is taken from the store verification result. |
HiveAxylStoreTransactionId | string? | Optional | Lookup key of the subscription record. When the subscription is confirmed with PostSubscriptionAsync, the server uses this key to find the same record. |
HiveAxylTransactionId | string | Required | Transaction ID of the saved subscription record. It is in UUIDv7 format and is used for subscription confirmation and settlement. |
Meta | string? | Optional | Additional information that the server sends along. |
SuccessResponseData
Response of methods that have no data to return.
| Field | Type | Required | Description |
|---|---|---|---|
Meta | string? | Optional | Additional information that the server sends along. |
Enums
Enter the C# member names in your app code. Wire values are the strings exchanged with the server.
Payment provider enums
Each request and response type has its own payment provider enum. All payment provider enums have the same members; only the wire value of Unspecified differs by enum.
| C# member | Wire value | Description |
|---|---|---|
Unspecified | Differs by enum. | Default value when no value is specified. Do not use it in requests. |
Apple | APPLE | Apple App Store. |
Google | GOOGLE | Google Play. |
Pg | PG | Web payment PGs such as PortOne, MyCard, and Xsolla. |
Steam | STEAM | Steam. |
In the table below, 'Value to specify' is the payment provider that you specify in the request type. Response types contain the payment provider that the server processed.
| Enum | Where used | Value to specify | Unspecified wire value |
|---|---|---|---|
StoreRequestProviderId | StoreRequest.ProviderId | All payment providers | STORE_REQUEST_PROVIDER_ID_UNSPECIFIED |
StoreProductProviderId | StoreProduct.ProviderId | Response | STORE_PRODUCT_PROVIDER_ID_UNSPECIFIED |
ProductAppleProviderId | ProductApple.ProviderId | Apple | PRODUCT_APPLE_PROVIDER_ID_UNSPECIFIED |
ProductGoogleProviderId | ProductGoogle.ProviderId | Google | PRODUCT_GOOGLE_PROVIDER_ID_UNSPECIFIED |
ProductSteamProviderId | ProductSteam.ProviderId | Steam | PRODUCT_STEAM_PROVIDER_ID_UNSPECIFIED |
ProductPgProviderId | ProductPg.ProviderId | Pg | PRODUCT_PG_PROVIDER_ID_UNSPECIFIED |
ProductProviderId | ProductResponseData.ProviderId | Response | PRODUCT_PROVIDER_ID_UNSPECIFIED |
PurchaseInitRequestProviderId | PurchaseInitRequest.ProviderId | Steam | PURCHASE_INIT_REQUEST_PROVIDER_ID_UNSPECIFIED |
OrderRequestProviderId | OrderRequest.ProviderId | Pg | ORDER_REQUEST_PROVIDER_ID_UNSPECIFIED |
PrePurchaseProviderId | PrePurchase.ProviderId | All payment providers | PRE_PURCHASE_PROVIDER_ID_UNSPECIFIED |
PurchaseRequestProviderId | PurchaseRequest.ProviderId | All payment providers | PURCHASE_REQUEST_PROVIDER_ID_UNSPECIFIED |
PurchasePostRequestProviderId | PurchasePostRequest.ProviderId | All payment providers | PURCHASE_POST_REQUEST_PROVIDER_ID_UNSPECIFIED |
PurchaseFinalizeRequestProviderId | PurchaseFinalizeRequest.ProviderId | Steam, Pg | PURCHASE_FINALIZE_REQUEST_PROVIDER_ID_UNSPECIFIED |
PurchaseRestoreRequestProviderId | PurchaseRestoreRequest.ProviderId | Steam, Pg | PURCHASE_RESTORE_REQUEST_PROVIDER_ID_UNSPECIFIED |
RestorePurchaseProviderId | RestorePurchase.ProviderId | Response | RESTORE_PURCHASE_PROVIDER_ID_UNSPECIFIED |
SubscriptionPrePurchaseRequestProviderId | SubscriptionPrePurchaseRequest.ProviderId | Apple, Google | SUBSCRIPTION_PRE_PURCHASE_REQUEST_PROVIDER_ID_UNSPECIFIED |
SubscriptionPurchaseRequestProviderId | SubscriptionPurchaseRequest.ProviderId | Apple, Google | SUBSCRIPTION_PURCHASE_REQUEST_PROVIDER_ID_UNSPECIFIED |
SubscriptionPurchasePostRequestProviderId | SubscriptionPurchasePostRequest.ProviderId | Apple, Google | SUBSCRIPTION_PURCHASE_POST_REQUEST_PROVIDER_ID_UNSPECIFIED |
OrderRequestOs
OS of the app client. Specify it in OrderRequest.Os.
| C# member | Wire value | Description |
|---|---|---|
Unspecified | ORDER_REQUEST_OS_UNSPECIFIED | Default value when no value is specified. Do not use it in requests. |
Windows | WINDOWS | Windows. |
Macos | MACOS | macOS. |
Android | ANDROID | Android. |
Ios | IOS | iOS. |