> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # GetPurchaseHistory # Package: appBilling # Namespace: Checkout # Method link: https://dev.wix.com/docs/api-reference/app-management/app-billing/billing/get-purchase-history.md ## Permission Scopes: Manage Your App: SCOPE.DC.MANAGE-YOUR-APP ## Introduction Retrieves a list of past purchases for your app on this site. You don't have to explicitly pass an identifier for the Wix site as part of the request, since this information is taken automatically from the context. The response doesn't include any details about cancellations. --- ## REST API ### Schema ``` Method: getPurchaseHistory Description: Retrieves a list of past purchases for your app on this site. You don't have to explicitly pass an identifier for the Wix site as part of the request, since this information is taken automatically from the context. The response doesn't include any details about cancellations. URL: https://www.wixapis.com/v1/checkout/history Method: GET Return type: GetPurchaseHistoryResponse - name: purchases | type: array | description: Retrieved purchases the Wix user has completed for you app. - name: productId | type: string | description: GUID of your app's paid plan. - name: price | type: string | description: Price of your app's paid plan. For example, `9.95`. - name: currency | type: string | description: 3-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. - name: billingCycle | type: PaymentCycle | description: Information about the billing cycle for your app's paid plan. - enum: NO_CYCLE, MONTHLY, YEARLY, ONE_TIME, TWO_YEARS, THREE_YEARS, FOUR_YEARS, FIVE_YEARS - name: dateCreated | type: string | description: Date and time the site purchased your app's paid plan in `YYYY-MM-DDThh:mm:ss.sssZ` format. ``` ### Examples ### GetPurchaseHistory ```curl ~~~cURL curl -X GET \ https://www.wixapis.com/apps/v1/checkout/history\ -H 'Authorization: ' \ ~~~ ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.appBilling.Checkout.getPurchaseHistory() Description: Retrieves a list of past purchases for your app on this site. You don't have to explicitly pass an identifier for the Wix site as part of the request, since this information is taken automatically from the context. The response doesn't include any details about cancellations. Return type: PROMISE - name: purchases | type: array | description: Retrieved purchases the Wix user has completed for you app. - name: productId | type: string | description: GUID of your app's paid plan. - name: price | type: string | description: Price of your app's paid plan. For example, `9.95`. - name: currency | type: string | description: 3-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. - name: billingCycle | type: PaymentCycle | description: Information about the billing cycle for your app's paid plan. - enum: NO_CYCLE, MONTHLY, YEARLY, ONE_TIME, TWO_YEARS, THREE_YEARS, FOUR_YEARS, FIVE_YEARS - name: dateCreated | type: Date | description: Date and time the site purchased your app's paid plan in `YYYY-MM-DDThh:mm:ss.sssZ` format. ``` ### Examples ### getPurchaseHistory ```javascript import { billing } from '@wix/app-management'; async function getPurchaseHistory() { const response = await billing.getPurchaseHistory(); }; ``` ### getPurchaseHistory (with elevated permissions) ```javascript import { billing } from '@wix/app-management'; import { auth } from '@wix/essentials'; async function myGetPurchaseHistoryMethod() { const elevatedGetPurchaseHistory = auth.elevate(billing.getPurchaseHistory); const response = await elevatedGetPurchaseHistory(); } ``` ### getPurchaseHistory (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { billing } from '@wix/app-management'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { billing }, // Include the auth strategy and host as relevant }); async function getPurchaseHistory() { const response = await myWixClient.billing.getPurchaseHistory(); }; ``` ---