> 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

# ConnectWixPaymentsAccount

# Package: wixPaymentsProvider

# Namespace: WixPaymentsAccountService

# Method link: https://dev.wix.com/docs/api-reference/business-management/payments/wix-payments-provider/wix-payments-account/connect-wix-payments-account.md

## Permission Scopes:
Connect Wix Payments Account: SCOPE.PAYMENTS.CONNECT-WIX-PAYMENTS-ACCOUNT

## Introduction

Connects a Wix Payments account to the site.

The call fails if:
- A Wix Payments account is already connected to the site.
- You don't specify `{"tosAccepted": true}`.
- You specify an `account.country` that isn't currently supported. Supported
countries: `US`, `CA`, `GB`, `ES`, `AT`, `BE`, `FI`, `DE`, `IT`, `NL`, `PT`,
`CH`, `LT`. If you don't specify a country, it defaults to `US`.

The connected Wix Payments account has the following limitations, which site
owners can manage in their dashboard:

- By default, customers can only pay via credit card, Apple Pay, or Google Pay.
- To receive payments, site owners must complete onboarding to their Wix
Payments account in the site's dashboard.

---

## REST API

### Schema

```
 Method: connectWixPaymentsAccount
 Description: Connects a Wix Payments account to the site.  The call fails if: - A Wix Payments account is already connected to the site. - You don't specify `{"tosAccepted": true}`. - You specify an `account.country` that isn't currently supported. Supported countries: `US`, `CA`, `GB`, `ES`, `AT`, `BE`, `FI`, `DE`, `IT`, `NL`, `PT`, `CH`, `LT`. If you don't specify a country, it defaults to `US`.  The connected Wix Payments account has the following limitations, which site owners can manage in their dashboard:  - By default, customers can only pay via credit card, Apple Pay, or Google Pay. - To receive payments, site owners must complete onboarding to their Wix Payments account in the site's dashboard.
 URL: https://www.wixapis.com/payments/v1/wix-payments-account/connect
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  account, account.firstName, account.lastName, account.tosAccepted
 Method parameters: 
   param name: account | type: WixPaymentsAccount | description: An account that enables a Wix site to process customer payments. | required: true 
        - name: firstName | type: string | description: First name of the Wix Payments account owner. | required: true | validation: maxLength 500
        - name: lastName | type: string | description: Last name of the Wix Payments account owner. | required: true | validation: maxLength 500
        - name: termsOfServiceAcceptance | type: TermsOfServiceAcceptance | description:   
           - name: ip | type: string | description:   | validation: maxLength 45
        - name: email | type: string | description: email of the Wix Payments account owner.  | validation: format EMAIL
        - name: productDescription | type: string | description: Brief summary of the types of products and services offered for sale through the Wix Payments account. For example, "Sportswear and sport accessories".  | validation: maxLength 500
        - name: country | type: string | description: Country code.  | validation: format COUNTRY
        - name: softDescriptor | type: string | description:   | validation: maxLength 50
        - name: businessUrl | type: string | description:   | validation: format WEB_URL
 Return type: ConnectWixPaymentsAccountResponse
  - name: account | type: WixPaymentsAccount | description: Connected Wix Payments account.  
     - name: id | type: string | description: GUID of the Wix Payments account.  | read-only: true | validation: format GUID
     - name: firstName | type: string | description: First name of the Wix Payments account owner.  | validation: maxLength 500
     - name: lastName | type: string | description: Last name of the Wix Payments account owner.  | validation: maxLength 500
     - name: termsOfServiceAcceptance | type: TermsOfServiceAcceptance | description:   
        - name: ip | type: string | description:   | validation: maxLength 45
     - name: email | type: string | description: email of the Wix Payments account owner.  | validation: format EMAIL
     - name: productDescription | type: string | description: Brief summary of the types of products and services offered for sale through the Wix Payments account. For example, "Sportswear and sport accessories".  | validation: maxLength 500
     - name: country | type: string | description: Country code.  | validation: format COUNTRY
     - name: softDescriptor | type: string | description:   | validation: maxLength 50
     - name: businessUrl | type: string | description:   | validation: format WEB_URL


```

### Examples

### Connect a Wix Payments account to the site.
```curl
curl -X POST \
'https://www.wixapis.com/payments/v1/wix-payments-account/connect' \
-H 'Content-Type: application/json' \
-H 'Authorization: <AUTH>' \
-d '{
  "account": {
    "firstName": "Hiwet",
    "lastName": "Neftalem",
    "tosAccepted": true,
    "productDescription": "Sportswear and sport accessories",
    "country": "GB"
  }
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.payments.wixPaymentsAccount.connectWixPaymentsAccount(account)
 Description: Connects a Wix Payments account to the site.  The call fails if: - A Wix Payments account is already connected to the site. - You don't specify `{"tosAccepted": true}`. - You specify an `account.country` that isn't currently supported. Supported countries: `US`, `CA`, `GB`, `ES`, `AT`, `BE`, `FI`, `DE`, `IT`, `NL`, `PT`, `CH`, `LT`. If you don't specify a country, it defaults to `US`.  The connected Wix Payments account has the following limitations, which site owners can manage in their dashboard:  - By default, customers can only pay via credit card, Apple Pay, or Google Pay. - To receive payments, site owners must complete onboarding to their Wix Payments account in the site's dashboard.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  account, account.firstName, account.lastName, account.tosAccepted
 Method parameters: 
   param name: account | type: WixPaymentsAccount | description: An account that enables a Wix site to process customer payments. | required: true 
        - name: firstName | type: string | description: First name of the Wix Payments account owner. | required: true | validation: maxLength 500
        - name: lastName | type: string | description: Last name of the Wix Payments account owner. | required: true | validation: maxLength 500
        - name: termsOfServiceAcceptance | type: TermsOfServiceAcceptance | description:   
           - name: ip | type: string | description:   | validation: maxLength 45
        - name: email | type: string | description: email of the Wix Payments account owner.  | validation: format EMAIL
        - name: productDescription | type: string | description: Brief summary of the types of products and services offered for sale through the Wix Payments account. For example, "Sportswear and sport accessories".  | validation: maxLength 500
        - name: country | type: string | description: Country code.  | validation: format COUNTRY
        - name: softDescriptor | type: string | description:   | validation: maxLength 50
        - name: businessUrl | type: string | description:   | validation: format WEB_URL
 Return type: PROMISE<ConnectWixPaymentsAccountResponse>
  - name: account | type: WixPaymentsAccount | description: Connected Wix Payments account.  
     - name: _id | type: string | description: GUID of the Wix Payments account.  | read-only: true | validation: format GUID
     - name: firstName | type: string | description: First name of the Wix Payments account owner.  | validation: maxLength 500
     - name: lastName | type: string | description: Last name of the Wix Payments account owner.  | validation: maxLength 500
     - name: termsOfServiceAcceptance | type: TermsOfServiceAcceptance | description:   
        - name: ip | type: string | description:   | validation: maxLength 45
     - name: email | type: string | description: email of the Wix Payments account owner.  | validation: format EMAIL
     - name: productDescription | type: string | description: Brief summary of the types of products and services offered for sale through the Wix Payments account. For example, "Sportswear and sport accessories".  | validation: maxLength 500
     - name: country | type: string | description: Country code.  | validation: format COUNTRY
     - name: softDescriptor | type: string | description:   | validation: maxLength 50
     - name: businessUrl | type: string | description:   | validation: format WEB_URL


```

### Examples

### Connect a Wix Payments account to the site
Connects a Wix Payments account to the site.

```javascript
import { wixPaymentsAccount } from "@wix/payments";

async function connectWixPaymentsAccount() {
  const response = await wixPaymentsAccount.connectWixPaymentsAccount({
    account: {
      firstName: "Hiwet",
      lastName: "Neftalem",
      tosAccepted: true,
      productDescription: "Sportswear and sport accessories",
      country: "GB",
    },
  });
}

/* Promise resolves to:
 * {
 *   "account": {
 *     "id": "b3ae19a6-6589-4b40-97ab-a41b16b5b434",
 *     "firstName": "Hiwet",
 *     "lastName": "Neftalem",
 *     "tosAccepted": true,
 *     "productDescription": "Sportswear and sport accessories",
 *     "country": "GB"
 *   }
 * }
 */

```

### connectWixPaymentsAccount (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 { wixPaymentsAccount } from '@wix/payments';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { wixPaymentsAccount },
  // Include the auth strategy and host as relevant
});


async function connectWixPaymentsAccount(account) {
  const response = await myWixClient.wixPaymentsAccount.connectWixPaymentsAccount(account);
};
```

---