> For the complete documentation index, see [llms.txt](https://doc.wearepatchworks.com/product-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.wearepatchworks.com/product-documentation/connectors-and-instances/patchworks-connectors/brightpearl-prebuilt-connector.md).

# Brightpearl (prebuilt connector)

## Description

**Brightpearl** is a Retail Operating System (ROS) for retailers and wholesalers.

## API documentation

API documentation for Brightpearl (used to build this connector) can be found via the link below:

{% embed url="<https://api-docs.brightpearl.com/>" %}

## Authentication

When adding connector instances for Brightpearl, the following authentication methods are supported:

* [OAuth 2 (authorisation code)](#oauth-2-authorisation-code)

### OAuth 2 (authorisation code)

When a user chooses to [add a connector instance](/product-documentation/connectors-and-instances/working-with-instances/adding-an-instance.md) using **OAuth 2 (authorisation code)** authentication, the credentials below are prompted:

<table><thead><tr><th>Credential</th><th data-type="checkbox">Required?</th><th>Notes</th></tr></thead><tbody><tr><td><code>Data center</code></td><td>true</td><td>The data centre associated with your Brightpearl account. Typically this forms the first element of the URL that you use to access your Brightpearl account - for example: <a href="https://euw1.brightpearlapp.com/admin_login.php">https://euw1.brightpearlapp.com/admin_login.php</a><br><br>Here, <code>euw1</code> is the <code>data center</code> value.</td></tr><tr><td><code>Account</code></td><td>true</td><td>The Brightpearl account that Patchworks needs to access.</td></tr><tr><td><code>State length</code></td><td>true</td><td>If you have been given a state length, enter it here. This is a numeric value which determines the length of a random string generated (behind the scenes) during the OAuth process, for verification purposes.</td></tr><tr><td><code>Scope</code></td><td>true</td><td>Enter the required scope to define what access permissions should be given to Patchworks.</td></tr><tr><td><code>Client ID</code></td><td>true</td><td>The reference given when the Patchworks app was created in Brightpearl.</td></tr><tr><td><code>Secret</code></td><td>true</td><td>The client secret which was issued when the Patchworks app was created in Brightpearl.</td></tr><tr><td><code>Response authentication token key</code></td><td>true</td><td>Set to <code>access_token.</code></td></tr><tr><td><code>Grant type</code></td><td>true</td><td>Set to <code>authorization_code</code>.</td></tr><tr><td><code>Response type key</code></td><td>false</td><td>Set to <code>code</code>.</td></tr><tr><td><code>Dashboard OAuth callback URL</code></td><td>false</td><td><p>For our <strong>production</strong> environment set to:<br><a href="https://stage.app.wearepatchworks.com/oauth/authenticate">https://app.wearepatchworks.com/oauth/authenticate</a></p><p>For our <strong>staging</strong> environment set to:<br><a href="https://stage.app.wearepatchworks.com/oauth/authenticate">https://stage.app.wearepatchworks.com/oauth/authenticate</a></p></td></tr><tr><td><code>Client type</code></td><td>false</td><td>Set to <code>confidential</code></td></tr><tr><td><code>OAuth authorised code (advanced)</code></td><td>false</td><td>This is an advanced setting that's used internally - under normal circumstances it should not need to be updated.</td></tr></tbody></table>
