Purchase

Handle Purchase

Process an in-app purchase from Google Play Store or Apple App Store.

Validates the purchase token/receipt and processes the purchase for the authenticated user.

Args: request: Purchase request with OS, product ID, and token/receipt auth: Authenticated user context service: App-specific purchase service (injected)

Returns: PurchaseResponse with success status and subscription details

post/api/v1/purchase

Request

  • Base URL: https://foto.damdafa.com/dreamhome
  • URL: https://foto.damdafa.com/dreamhome/api/v1/purchase
  • Auth: HTTP bearer

Headers

ProviderId'firebase' | 'google' | 'apple'
X-Provider-Id'firebase' | 'google' | 'apple'
X-Device-Idstring nullable

Request body

osstring required

Operating system: 'ios' or 'android'

productIdstring required

Product/subscription ID

purchaseTokenstring nullable

Google Play purchase token

transactionIdstring nullable

Transaction ID

originalTransactionIdstring nullable

Original transaction ID

promoCodestring nullable

Optional promo code for bonuses

Response

Successful Response

successboolean required
messagestring required
subscription_activeboolean nullable
expiry_datestring nullable

Changes

No recorded changes to this operation across all 1 revision of this API.