# Brightpearl

> Find products, stock, contacts and orders, create sales orders, and track order status and shipping.

App · 20 actions. Web page: https://docs.lodol.com/docs/integrations/brightpearl

## Actions

### Add contact note

Add a note to a contact's timeline.

**Inputs**

- Contact (`contact_id`, number, required): The contact's ID.
- Note (`text`, text, required): The note.
- Public (`is_public`, true/false): Whether the customer sees it on the customer portal.

**Outputs**

- `data` (object): The response from Brightpearl.

**Example output**

```json
{
  "data": {
    "response": 1
  }
}
```

### Add order note

Add a note to an order.

**Inputs**

- Order (`order_id`, number, required): The order's ID.
- Note (`text`, text, required): The note.
- Public (`is_public`, true/false): Whether the customer sees it on the customer portal.

**Outputs**

- `data` (object): The response from Brightpearl.

**Example output**

```json
{
  "data": {
    "response": 1
  }
}
```

### Create contact

Add a customer or supplier with their address.

**Inputs**

- Salutation (`salutation`, text): Mr., Ms. or another salutation.
- First name (`first_name`, text): The contact's first name.
- Last name (`last_name`, text, required): The contact's last name.
- Email (`email`, text): The contact's primary email.
- Phone (`telephone`, text): The contact's primary phone number.
- Company (`company_name`, text): The company the contact works for.
- Job title (`job_title`, text): The contact's job title.
- Supplier (`is_supplier`, true/false): Whether the contact is a supplier rather than a customer.
- Street address (`address_line1`, text, required): The street address.
- Address line 2 (`address_line2`, text): The second line, such as the suburb.
- City (`city`, text): The city.
- State (`state`, text): The state or county.
- Postal code (`postal_code`, text): The ZIP or postal code.
- Country code (`country_iso_code`, text): The country's three-letter ISO code, such as USA or GBR.

**Outputs**

- `data` (object): The response from Brightpearl.

**Example output**

```json
{
  "data": {
    "response": 1
  }
}
```

### Create product

Add a product to the Brightpearl sales channel.

**Inputs**

- Brand (`brand_id`, number, required): The product's brand.
- Name (`product_name`, text, required): The product's name, up to 128 characters.
- Category code (`category_code`, text, required): The code of the Brightpearl category the product is in.
- Description (`description`, text): The product's description.
- SKU (`sku`, text): The product's SKU, up to 32 characters.
- Barcode (`barcode`, text): The product's barcode, up to 32 characters.
- EAN (`ean`, text): The product's EAN, up to 14 characters.
- UPC (`upc`, text): The product's UPC, up to 14 characters.
- Stock tracked (`stock_tracked`, true/false): Whether Brightpearl tracks the product's stock.
- Taxable (`taxable`, true/false): Whether the product is taxable, for an account using sales tax.
- Tax code (`tax_code`, text): The product's tax code, for an account using VAT.

**Outputs**

- `data` (object): The response from Brightpearl.

**Example output**

```json
{
  "data": {
    "response": 1
  }
}
```

### Create sales order

Create a sales order for a customer, with one product row.

**Inputs**

- Customer ID (`customer_id`, number, required): The customer's contact ID.
- Product ID (`product_id`, number, required): The product sold.
- Quantity (`quantity`, number, required): How many. At least 0.
- Tax code (`tax_code`, text, required): The row's tax code, such as T20 or a sales tax code.
- Net value (`net`, number): The row's net value. The price list's when empty. At least 0.
- Tax value (`tax`, number): The row's tax value, given with a net value. At least 0.
- Reference (`reference`, text): The customer's reference, up to 64 characters.
- External reference (`external_ref`, text): Your own reference for the order, up to 100 characters.
- Placed on (`placed_on`, date and time): When the order was placed. Now, when left empty.
- Status (`status_id`, number): The order's status. The default status when empty.
- Warehouse (`warehouse_id`, number): The warehouse it's fulfilled from.
- Price list (`price_list_id`, number): The price list to use. The customer's when empty.
- Currency (`currency_code`, text): The three-letter currency code. The customer's when empty.

**Outputs**

- `data` (object): The response from Brightpearl.

**Example output**

```json
{
  "data": {
    "response": 1
  }
}
```

### Get contact

Get one or more contacts with their addresses, emails, phones and financial details.

**Inputs**

- Contact (`contact_ids`, text, required): The contact's ID, or several: 1000-1010 or 1,4,9.

**Outputs**

- `data` (object): The response from Brightpearl.

**Example output**

```json
{
  "data": {
    "response": [
      {
        "assignment": {},
        "communication": {},
        "companyId": 1,
        "contactId": 1,
        "contactStatus": {},
        "contactTags": "example",
        "createdOn": "example",
        "customFields": {},
        "financialDetails": {},
        "firstName": "example",
        "isPrimaryContact": true,
        "lastContactedOn": "example",
        "lastName": "example",
        "marketingDetails": {},
        "organisation": {
          "jobTitle": "example",
          "name": "example",
          "organisationId": 1
        },
        "postAddressIds": {},
        "postalAddresses": {},
        "relationshipToAccount": {
          "isStaff": true,
          "isSupplier": true
        },
        "salutation": "example",
        "tradeStatus": "example",
        "updatedOn": "example"
      }
    ]
  }
}
```

### Get goods-out notes

Get an order's goods-out notes with their rows, shipping and status.

**Inputs**

- Order (`order_ids`, text, required): The order's ID, or several: 1000-1010 or 1,4,9.

**Outputs**

- `data` (object): The response from Brightpearl.

**Example output**

```json
{
  "data": {
    "response": {}
  }
}
```

### Get order

Get one or more orders with their status, rows, parties and totals.

**Inputs**

- Order (`order_ids`, text, required): The order's ID, or several: 1000-1010 or 1,4,9.

**Outputs**

- `data` (object): The response from Brightpearl.

**Example output**

```json
{
  "data": {
    "response": [
      {
        "allocationStatusCode": "example",
        "assignment": {},
        "closedOn": "example",
        "createdById": 1,
        "createdOn": "example",
        "currency": {},
        "delivery": {},
        "id": 1,
        "invoices": [
          {}
        ],
        "isDropship": true,
        "orderPaymentStatus": "example",
        "orderRows": {},
        "orderStatus": {
          "name": "example",
          "orderStatusId": 1
        },
        "orderTypeCode": "example",
        "parentOrderId": 1,
        "parties": {},
        "placedOn": "example",
        "priceListId": 1,
        "priceModeCode": "example",
        "reference": "example",
        "shippingStatusCode": "example",
        "stockStatusCode": "example",
        "totalValue": {
          "net": 1,
          "taxAmount": 1,
          "total": 1
        },
        "updatedOn": "example",
        "version": 1,
        "warehouseId": 1
      }
    ]
  }
}
```

### Get product

Get one or more products with their identity codes, stock settings and names.

**Inputs**

- Product (`product_ids`, text, required): The product's ID, or several: 1000-1010 or 1,4,9.

**Outputs**

- `data` (object): The response from Brightpearl.

**Example output**

```json
{
  "data": {
    "response": [
      {
        "brandId": 1,
        "composition": {},
        "createdOn": "example",
        "financialDetails": {},
        "id": 1,
        "identity": {
          "barcode": "example",
          "ean": "example",
          "isbn": "example",
          "mpn": "example",
          "sku": "example",
          "upc": "example"
        },
        "primarySupplierId": 1,
        "productGroupId": 1,
        "productTypeId": 1,
        "salesChannels": [
          {
            "categories": [
              {}
            ],
            "description": {},
            "productCondition": "example",
            "productName": "example",
            "salesChannelName": "example",
            "shortDescription": {}
          }
        ],
        "status": "example",
        "stock": {},
        "updatedOn": "example",
        "variations": [
          {}
        ],
        "version": 1
      }
    ]
  }
}
```

### Get product availability

Get how many of one or more products are in stock, allocated and on hand, in total and by warehouse.

**Inputs**

- Product (`product_ids`, text, required): The product's ID, or several: 1000-1010 or 1,4,9.

**Outputs**

- `data` (object): The response from Brightpearl.

**Example output**

```json
{
  "data": {
    "response": {}
  }
}
```

### List brands

List the account's product brands.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Brightpearl.

**Example output**

```json
{
  "data": {
    "response": [
      {
        "createdOn": "example",
        "description": "example",
        "id": 1,
        "name": "example",
        "updatedOn": "example"
      }
    ]
  }
}
```

### List order notes

List the notes on an order.

**Inputs**

- Order (`order_id`, number, required): The order's ID.

**Outputs**

- `data` (object): The response from Brightpearl.

**Example output**

```json
{
  "data": {
    "response": [
      {
        "addedBy": 1,
        "addedOn": "example",
        "contactId": 1,
        "fileId": 1,
        "isPublic": true,
        "noteId": 1,
        "orderStatusId": 1,
        "text": "example"
      }
    ]
  }
}
```

### List order statuses

List the statuses orders can have, for each order type.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Brightpearl.

**Example output**

```json
{
  "data": {
    "response": [
      {
        "color": "example",
        "disabled": true,
        "name": "example",
        "orderTypeCode": "example",
        "sortOrder": 1,
        "state": "example",
        "statusId": 1,
        "visible": true
      }
    ]
  }
}
```

### List price lists

List the account's selling and buying price lists.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Brightpearl.

**Example output**

```json
{
  "data": {
    "response": [
      {
        "code": "example",
        "currencyCode": "example",
        "currencyId": 1,
        "currencySymbol": "example",
        "gross": true,
        "id": 1,
        "name": {
          "format": "example",
          "languageCode": "example",
          "text": "example"
        },
        "priceListTypeCode": "example"
      }
    ]
  }
}
```

### List warehouses

List the account's warehouses.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Brightpearl.

**Example output**

```json
{
  "data": {
    "response": [
      {
        "address": {},
        "clickAndCollectEnabled": true,
        "id": 1,
        "name": "example",
        "typeCode": "example",
        "typeDescription": "example"
      }
    ]
  }
}
```

### Search contacts

Find customers and suppliers by email, name, company or when they changed.

**Inputs**

- Email contains (`email`, text): Only contacts with this text in any email.
- Last name contains (`last_name`, text): Only contacts whose last name contains this.
- Company contains (`company_name`, text): Only contacts whose company name contains this.
- Supplier (`is_supplier`, true/false): Only suppliers, or only those who aren't.
- Customer (`is_customer`, true/false): Only customers, or only those who aren't.
- Created after (`created_after`, date and time): Only records created at or after this time.
- Updated after (`updated_after`, date and time): Only records changed at or after this time.
- Order (`sort`, text): The order to return records in. One of: `createdOn.DESC` (Newest first), `createdOn.ASC` (Oldest first), `updatedOn.DESC` (Recently updated first).
- Limit (`page_size`, number): How many records to return, up to 500. Brightpearl returns 500 when empty. From 1 to 500.
- Start at (`first_result`, number): The position of the first record to return, from 1. For the second page of 500, enter 501. At least 1.

**Outputs**

- `data` (object): The response from Brightpearl.

**Example output**

```json
{
  "data": {
    "metaData": {
      "firstResult": 1,
      "lastResult": 1,
      "resultsAvailable": 1,
      "resultsReturned": 1
    },
    "results": [
      {
        "companyName": "example",
        "contactId": 1,
        "createdOn": "example",
        "firstName": "example",
        "isCustomer": true,
        "isPrimary": true,
        "isStaff": true,
        "isSupplier": true,
        "lastContactedOn": "example",
        "lastName": "example",
        "lastOrderedOn": "example",
        "mob": "example",
        "nominalCode": 1,
        "pri": "example",
        "primaryEmail": "example",
        "sec": "example",
        "secondaryEmail": "example",
        "tertiaryEmail": "example",
        "title": "example",
        "updatedOn": "example"
      }
    ]
  }
}
```

### Search goods-out notes

Find goods-out notes (what's shipping) by order, warehouse, whether shipped, or when they were made.

**Inputs**

- Order ID (`order_id`, number): Only notes for this order.
- Warehouse (`warehouse_id`, number): Only notes from this warehouse.
- Shipped (`shipped`, true/false): Only shipped notes, or only those not shipped yet.
- Created after (`created_after`, date and time): Only notes created at or after this time.
- Shipped after (`shipped_after`, date and time): Only notes shipped at or after this time.
- Order (`sort`, text): The order to return records in. One of: `createdOn.DESC` (Newest first), `createdOn.ASC` (Oldest first).
- Limit (`page_size`, number): How many records to return, up to 500. Brightpearl returns 500 when empty. From 1 to 500.
- Start at (`first_result`, number): The position of the first record to return, from 1. For the second page of 500, enter 501. At least 1.

**Outputs**

- `data` (object): The response from Brightpearl.

**Example output**

```json
{
  "data": {
    "metaData": {
      "firstResult": 1,
      "lastResult": 1,
      "resultsAvailable": 1,
      "resultsReturned": 1
    },
    "results": [
      {
        "channelId": 1,
        "createdBy": 1,
        "createdOn": "example",
        "goodsOutNoteId": 1,
        "labelUri": "example",
        "orderId": 1,
        "packed": true,
        "picked": true,
        "printed": true,
        "priority": true,
        "releaseDate": "example",
        "shipped": true,
        "shippedOn": "example",
        "shippingMethodId": 1,
        "transfer": true,
        "warehouseId": 1
      }
    ]
  }
}
```

### Search orders

Find sales and purchase orders by type, status, contact, reference or when they changed.

**Inputs**

- Order type (`order_type_id`, number): Only orders of this type: 1 sales order, 2 purchase order, 3 sales credit, 4 purchase credit. From 1 to 4.
- Status (`order_status_id`, number): Only orders with this status.
- Contact ID (`contact_id`, number): Only orders for this customer or supplier.
- Customer reference (`customer_ref`, text): Only orders with this customer reference.
- External reference (`external_ref`, text): Only orders with this external reference.
- Warehouse (`warehouse_id`, number): Only orders from this warehouse.
- Invoiced (`is_closed`, true/false): Only invoiced orders, or only those that aren't.
- Created after (`created_after`, date and time): Only records created at or after this time.
- Updated after (`updated_after`, date and time): Only records changed at or after this time.
- Order (`sort`, text): The order to return records in. One of: `createdOn.DESC` (Newest first), `createdOn.ASC` (Oldest first), `updatedOn.DESC` (Recently updated first).
- Limit (`page_size`, number): How many records to return, up to 500. Brightpearl returns 500 when empty. From 1 to 500.
- Start at (`first_result`, number): The position of the first record to return, from 1. For the second page of 500, enter 501. At least 1.

**Outputs**

- `data` (object): The response from Brightpearl.

**Example output**

```json
{
  "data": {
    "metaData": {
      "firstResult": 1,
      "lastResult": 1,
      "resultsAvailable": 1,
      "resultsReturned": 1
    },
    "results": [
      {
        "contactId": 1,
        "createdById": 1,
        "createdOn": "example",
        "customerRef": "example",
        "deliveryDate": "example",
        "departmentId": 1,
        "externalRef": "example",
        "orderId": 1,
        "orderPaymentStatusId": 1,
        "orderShippingStatusId": 1,
        "orderStatusId": 1,
        "orderStockStatusId": 1,
        "orderTypeId": 1,
        "parentOrderId": 1,
        "staffOwnerContactId": 1,
        "taxDate": "example",
        "updatedOn": "example",
        "warehouseId": 1
      }
    ]
  }
}
```

### Search products

Find products by name, SKU, barcode, brand or when they changed.

**Inputs**

- Name contains (`product_name`, text): Only products whose name contains this.
- SKU (`sku`, text): Only the product with this SKU.
- Barcode (`barcode`, text): Only the product with this barcode.
- Brand (`brand_id`, number): Only products of this brand.
- Stock tracked (`stock_tracked`, true/false): Only products whose stock is tracked, or only those that aren't.
- Created after (`created_after`, date and time): Only records created at or after this time.
- Updated after (`updated_after`, date and time): Only records changed at or after this time.
- Order (`sort`, text): The order to return records in. One of: `createdOn.DESC` (Newest first), `createdOn.ASC` (Oldest first), `updatedOn.DESC` (Recently updated first).
- Limit (`page_size`, number): How many records to return, up to 500. Brightpearl returns 500 when empty. From 1 to 500.
- Start at (`first_result`, number): The position of the first record to return, from 1. For the second page of 500, enter 501. At least 1.

**Outputs**

- `data` (object): The response from Brightpearl.

**Example output**

```json
{
  "data": {
    "metaData": {
      "firstResult": 1,
      "lastResult": 1,
      "resultsAvailable": 1,
      "resultsReturned": 1
    },
    "results": [
      {
        "EAN": "example",
        "ISBN": "example",
        "MPN": "example",
        "SKU": "example",
        "UPC": "example",
        "barcode": "example",
        "brandId": 1,
        "brightpearlCategoryCode": "example",
        "createdOn": "example",
        "primarySupplierId": 1,
        "productGroupId": 1,
        "productId": 1,
        "productName": "example",
        "productStatus": "example",
        "productTypeId": 1,
        "salesChannelName": "example",
        "stockTracked": true,
        "updatedOn": "example"
      }
    ]
  }
}
```

### Update order status

Move an order to another status, with a note on the order.

**Inputs**

- Order (`order_id`, number, required): The order's ID.
- Status (`order_status_id`, number, required): The new status.
- Note (`note`, text): The note added to the order. Brightpearl writes one when empty.
- Public note (`is_public`, true/false): Whether the customer sees the note on the customer portal.

**Outputs**

- `data` (object): The response from Brightpearl.

**Example output**

```json
{
  "data": {}
}
```
