> 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 # ConnectAccount # Package: paymentServiceProviderServicePlugin # Namespace: ProviderAccountsService # Method link: https://dev.wix.com/docs/api-reference/business-management/payments/payment-service-provider-service-plugin/accounts/connect-account.md ## Introduction This endpoint is used to connect a merchant's Payment Service Provider (PSP) account to a Wix site. Wix calls this endpoint when a merchant chooses to connect a PSP in the Wix dashboard. The PSP must verify the merchant's credentials and ensure that the merchant has an operational PSP account. Learn more about [implementing this endpoint](https://dev.wix.com/docs/rest/api-reference/payment-provider-spi/connecting-accounts.md). --- ## REST API ### Schema ``` Method: connectAccount Description: This endpoint is used to connect a merchant's Payment Service Provider (PSP) account to a Wix site. Wix calls this endpoint when a merchant chooses to connect a PSP in the Wix dashboard. The PSP must verify the merchant's credentials and ensure that the merchant has an operational PSP account. Learn more about [implementing this endpoint](https://dev.wix.com/docs/rest/api-reference/payment-provider-spi/connecting-accounts.md). URL: null Method: POST # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: credentials, wixMerchantId Method parameters: param name: country | type: country | description: Country where the merchant provides their services, in [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. param name: credentials | type: credentials | description: Merchant credentials for a PSP account. The PSP specifies the keys for this object in the [app dashboard](https://dev.wix.com/apps). The merchant is prompted to enter these credentials when they connect their PSP account to their Wix site. | required: true - name: key | type: string | description: none - name: value | type: string | description: none param name: currency | type: currency | description: Code for the merchant's preferred [currency](https://en.wikipedia.org/wiki/ISO_4217). param name: mode | type: Mode - enum: undefined - Undefined mode. live - Request is live. sandbox - Request is for testing purposes. param name: siteId | type: siteId | description: Wix site GUID. param name: wixMerchantId | type: wixMerchantId | description: Wix merchant GUID. | required: true Return type: ConnectAccountResponse - name: credentials | type: object | description: Merchant credentials that Wix will use when sending the merchant's payment and refund requests. - name: accountId | type: string | description: Merchant account GUID. The PSP must not change this value over the lifetime of the merchant's account. - name: accountName | type: string | description: Merchant account name. - name: reasonCode | type: integer | description: Wix [reason code](https://dev.wix.com/docs/rest/api-reference/payment-provider-spi/reason-codes.md#account-connection-failure) indicating a type of failed request. - name: errorCode | type: string | description: PSP-specific error code. - name: errorMessage | type: string | description: PSP-specific error message. ``` ### Examples ### Connecting an account ```curl curl -X POST https://psp.example.com/connect \ -H 'Content-Type: application/json' \ -H 'Digest: JWT=ai0zIQqt71bmnkgEJ1CRJchjKJup' \ -d '{ "credentials": { "client_id": "MerchantClientId", "client_secret": "MerchantClientSecret" }, "country": "US", "currency": "USD", "mode": "live", "wixMerchantId": "000000-0000-0000-0000-000000000000" }' ``` ### Responding to a failed connection attempt ```curl curl -X POST https://psp.example.com/connect \ -H 'Content-Type: application/json' \ -H 'Digest: JWT=ai0zIQqt71bmnkgEJ1CRJchjKJup' \ -d '{ "credentials": { "client_id": "MerchantClientId", "client_secret": "MerchantClientSecret" }, "country": "US", "currency": "USD", "mode": "live", "wixMerchantId": "000000-0000-0000-0000-000000000000" }' ``` ### Adding credentials to the response ```curl curl -X POST https://psp.example.com/connect \ -H 'Content-Type: application/json' \ -H 'Digest: JWT=ai0zIQqt71bmnkgEJ1CRJchjKJup' \ -d '{ "credentials": { "client_id": "MerchantClientId", "client_secret": "MerchantClientSecret" }, "country": "US", "currency": "USD", "mode": "live", "wixMerchantId": "000000-0000-0000-0000-000000000000" }' ``` ### Using numeric and boolean credentials ```curl curl -X POST https://psp.example.com/connect \ -H 'Content-Type: application/json' \ -H 'Digest: JWT=ai0zIQqt71bmnkgEJ1CRJchjKJup' \ -d '{ "credentials": { "client_id": "MerchantClientId", "client_secret": "MerchantClientSecret", "price_includes_tax": "true", "tax_percentage": "20" }, "country": "US", "currency": "USD", "mode": "live", "wixMerchantId": "000000-0000-0000-0000-000000000000" }' ``` ---