> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> 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`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# GetUrl

# Package: appBilling

# Namespace: Checkout

# Method link: https://dev.wix.com/docs/api-reference/app-management/app-billing/billing/get-url.md

## Permission Scopes:
Manage Your App: SCOPE.DC.MANAGE-YOUR-APP

## Introduction

Retrieves the URL for a Wix checkout page for the specified paid plan of your app.

Call this method when initiating the purchase flow from your pricing page.
The returned checkout URL redirects to Wix to complete payment.

This call succeeds only if you have previously
[set up an external pricing page in your app's dashboard](https://dev.wix.com/docs/build-apps/build-your-app/pricing-plans/set-up-an-external-pricing-page.md).

The returned checkout URL is valid for 48 hours.

This API allows your app to manage your pricing page outside of Wix while
still using the standard Wix checkout flow.

---

## REST API

### Schema

```
 Method: getUrl
 Description: Retrieves the URL for a Wix checkout page for the specified paid plan of your app.  Call this method when initiating the purchase flow from your pricing page. The returned checkout URL redirects to Wix to complete payment.  This call succeeds only if you have previously [set up an external pricing page in your app's dashboard](https://dev.wix.com/docs/build-apps/build-your-app/pricing-plans/set-up-an-external-pricing-page.md).  The returned checkout URL is valid for 48 hours.  This API allows your app to manage your pricing page outside of Wix while still using the standard Wix checkout flow.
 URL: https://www.wixapis.com/apps/v1/checkout
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  productId
 Method parameters: 
   param name: billingCycle | type: PaymentCycle    
      - enum:
           NO_CYCLE - 
           MONTHLY - 
           YEARLY - 
           ONE_TIME - 
           TWO_YEARS - 
           THREE_YEARS - 
           FOUR_YEARS - 
           FIVE_YEARS - 
   param name: countryCode | type: countryCode | description: 2-letter country code in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format.  Default: `"US"`  
   param name: couponCode | type: couponCode | description: Coupon code for the paid plan. Available only in case there is a discount.  
   param name: languageCode | type: languageCode | description: 2-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format.  Default: `"EN"`  
   param name: productId | type: productId | description: GUID of your app's paid plan to retrieve the Wix checkout URL for. Check your app's dashboard for a list of your app's supported product GUIDs. | required: true 
   param name: successUrl | type: successUrl | description: URL for the Wix checkout page. Redirect Wix users to this URL after they've successfully purchased a paid plan for your app.  | validation: format WEB_URL
   param name: testCheckout | type: testCheckout | description: Whether the checkout is for testing purposes only. Testing is mainly relevant for in-app purchase flows. When `true`, Wix charges the site owners an amount of `0.00`.  Not supported for usage-based plans.  
 Return type: GetUrlResponse
  - name: checkoutUrl | type: string | description: URL for the Wix checkout page.  | validation: format WEB_URL
  - name: token | type: string | description: Token for the Wix checkout page. The token holds all data about the order you're creating a checkout for. It's [signed](https://dev.wix.com/docs/api-reference/articles.md), so you can verify that it comes from Wix.  


```

### Examples

### GetUrl
```curl
~~~cURL
curl -X POST \
  https://www.wixapis.com/apps/v1/checkout \
  -H 'Authorization: <AUTH>' \
  -H 'Content-Type: application/json' \
  -d '{
        "productId": "e8f429d4-0a6a-468f-8044-87f519a53202",
        "billingCycle": "MONTHLY"
    }'
~~~
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.appManagement.billing.getUrl(productId, options)
 Description: Retrieves the URL for a Wix checkout page for the specified paid plan of your app.  Call this method when initiating the purchase flow from your pricing page. The returned checkout URL redirects to Wix to complete payment.  This call succeeds only if you have previously [set up an external pricing page in your app's dashboard](https://dev.wix.com/docs/build-apps/build-your-app/pricing-plans/set-up-an-external-pricing-page.md).  The returned checkout URL is valid for 48 hours.  This API allows your app to manage your pricing page outside of Wix while still using the standard Wix checkout flow.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  productId
 Method parameters: 
   param name: productId | type: string | description: GUID of your app's paid plan to retrieve the Wix checkout URL for. Check your app's dashboard for a list of your app's supported product GUIDs. | required: true 
   param name: options | type: GetUrlOptions  none  
        - name: successUrl | type: string | description: URL for the Wix checkout page. Redirect Wix users to this URL after they've successfully purchased a paid plan for your app.  | validation: format WEB_URL
        - name: testCheckout | type: boolean | description: Whether the checkout is for testing purposes only. Testing is mainly relevant for in-app purchase flows. When `true`, Wix charges the site owners an amount of `0.00`.  Not supported for usage-based plans.  
        - name: billingCycle | type: PaymentCycle | description: Information about the paid plan's billing cycle.  Set to `MONTHLY` for usage-based plans.  
             - enum: NO_CYCLE, MONTHLY, YEARLY, ONE_TIME, TWO_YEARS, THREE_YEARS, FOUR_YEARS, FIVE_YEARS
        - name: countryCode | type: string | description: 2-letter country code in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format.  Default: `"US"`  
        - name: languageCode | type: string | description: 2-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format.  Default: `"EN"`  
        - name: couponCode | type: string | description: Coupon code for the paid plan. Available only in case there is a discount.  
 Return type: PROMISE<GetUrlResponse>
  - name: checkoutUrl | type: string | description: URL for the Wix checkout page.  | validation: format WEB_URL
  - name: token | type: string | description: Token for the Wix checkout page. The token holds all data about the order you're creating a checkout for. It's [signed](https://dev.wix.com/docs/api-reference/articles.md), so you can verify that it comes from Wix.  


```

### Examples

### getUrl
```javascript
import { billing } from '@wix/app-management';

async function getUrl(productId,options) {
  const response = await billing.getUrl(productId,options);
};
```

### getUrl (with elevated permissions)
```javascript
import { billing } from '@wix/app-management';
import { auth } from '@wix/essentials';

async function myGetUrlMethod(productId,options) {
  const elevatedGetUrl = auth.elevate(billing.getUrl);
  const response = await elevatedGetUrl(productId,options);
}
```

### getUrl (self-managed)
Self-managed 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 getUrl(productId,options) {
  const response = await myWixClient.billing.getUrl(productId,options);
};
```

---