Website API

Simple REST API to retrieve and manage contacts, form messages, store products, orders or webhooks.

Authentication

The MadeWithBree Website API uses Bearer Token Authorization

  1. You can view your API key in your website > Website Settings > Applications > API Key.

  2. You can use your API key to access protected resources in your website only by passing the Authorization header:

    Authorization: Bearer <API KEY>

  3. All API requests must be made over HTTPS

Errors

The API uses conventional HTTP response codes to indicate the success or failure of an API request.

In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a resource was missing, etc.). Codes in the 5xx range indicate a serer error or an unprocessable entry.

Every error include a human-readable message:

{
    success: false,
    message: "Error message..."
}

Pagination

Most API endpoints returning multiple objects (lists) support pagination. These lists share a common structure and can take at least these two parameters:

Parameter Description
limit a limit on the number of objects to be returned. Between 1 and 50. Optional, default: 30
skip a.k.a. offset - the number of items to skip. Optional, default: 0 (i.e. return the first page of results)

List response format:

{
    items: [
        { ... },
        { ... },
        { ... }
    ],
    totalCount: 10,
    limit: 25,
    skip: 0
}
Attribute Description
items an array containing the actual response elements, paginated by any request parameters.
totalCount the total size of the result set, i.e. all available elements in the list request without any pagination
limit the currently used limit
skip current offset in the list

Contacts

Contacts are all visitors identified by their email in your website


Contact attributes:

Attribute Type Description
id number Unique identifier
name string Contact Name
email string Email address of the contact
phone string Concat phone
note string Private note
address string
city string
state string
zip string
country string
companyName string
createdOn number Timestamp in Unix seconds since epoch.
properties array Array of custom properties, as defined in the CRM section in your website: {name: "lead_status", type: "string", value: "pending"}
tags array List of tags assigned to the contact
memberId number Member id if assigned to contact

List and create

GET https://your-subdomain.madewithbree.io/api/site/contacts?limit=25?skip=25?created_at_min=1573251649?created_at_max=1573251649
Responses200
Headers
Content-Type: application/json
Body
{
  "items": [
    {
      "id": 123,
      "name": "John Doe",
      "email": "john@doe.com",
      "phone": "+123456789",
      "note": "Contact Note",
      "address": "address",
      "city": "city",
      "state": "state",
      "zip": "zip",
      "country": "country",
      "companyName": "Company Name",
      "createdOn": 1573240303,
      "properties": [
        {
          "name": "lead_status",
          "value": "contacted"
        },
        {
          "name": "custom_property",
          "value": "property value"
        }
      ],
      "tags": [
        "tag1",
        "tag2"
      ],
      "memberId": 487
    },
    {
      "id": 99,
      "name": "Another Contact Name",
      "email": "contact2@email.com",
      "phone": "+123456789",
      "note": "Contact Note",
      "address": "address",
      "city": "city",
      "state": "state",
      "zip": "zip",
      "country": "country",
      "companyName": "Company Name",
      "createdOn": 1573240303,
      "properties": [
        {
          "name": "lead_status",
          "value": "pending"
        }
      ],
      "tags": [
        "tag1",
        "tag2"
      ]
    }
  ],
  "totalCount": 2,
  "limit": 25,
  "skip": 0
}

List All Contacts
GET/contacts{?limit}{?skip}{?created_at_min}{?created_at_max}

Get a paginated list of all contacts created in your website. Optionally filter by created date.

URI Parameters
HideShow
created_at_min
Unix Timestamp (optional) Example: 1573251649

List only contacts created after the specified timestamp (inclusive, in seconds since the Unix epoch)

created_at_max
Unix Timestamp (optional) Example: 1573251649

List only contacts created before the specified timestamp (inclusive, in seconds since the Unix epoch)

limit
number (optional) Example: 25

The maximum number of contacts to return

skip
number (optional) Example: 25

Number of records to skip


POST https://your-subdomain.madewithbree.io/api/site/contacts
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "name": "John Doe",
  "email": "john@doe.com",
  "phone": "+123456789",
  "properties": [
    {
      "name": "lead_status",
      "value": "pending"
    }
  ],
  "tags": [
    "tag1",
    "tag2"
  ]
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 123,
  "name": "John Doe",
  "email": "john@doe.com",
  "phone": "+123456789",
  "properties": [
    {
      "name": "lead_status",
      "value": "pending"
    }
  ],
  "tags": [
    "tag1",
    "tag2"
  ]
}

Create New Contact
POST/contacts

Create a contact. If a contact with the supplied email already exists, it will be updated. Only supplied parameters are set.


Search Contacts

GET https://your-subdomain.madewithbree.io/api/site/contacts/search-by-email?email=john@doe.com
Responses200404
Headers
Content-Type: application/json
Body
{
  "id": 123,
  "name": "John Doe",
  "email": "john@doe.com",
  "phone": "+123456789",
  "note": "Contact Note",
  "address": "address",
  "city": "city",
  "state": "state",
  "zip": "zip",
  "country": "country",
  "companyName": "Company Name",
  "createdOn": 1573240303,
  "properties": [
    {
      "name": "lead_status",
      "value": "contacted"
    },
    {
      "name": "custom_property",
      "value": "property value"
    }
  ],
  "tags": [
    "tag1",
    "tag2"
  ],
  "memberId": 487
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "message": "Contact not found"
}

Search by email
GET/contacts/search-by-email{?email}

Look for a contact by email

URI Parameters
HideShow
email
string (required) Example: john@doe.com

The email address to look for.


Single Contact

GET https://your-subdomain.madewithbree.io/api/site/contacts/123
Responses200404
Headers
Content-Type: application/json
Body
{
  "id": 123,
  "name": "John Doe",
  "email": "john@doe.com",
  "phone": "+123456789",
  "note": "Contact Note",
  "address": "address",
  "city": "city",
  "state": "state",
  "zip": "zip",
  "country": "country",
  "companyName": "Company Name",
  "createdOn": 1573240303,
  "properties": [
    {
      "name": "lead_status",
      "value": "contacted"
    },
    {
      "name": "custom_property",
      "value": "property value"
    }
  ],
  "tags": [
    "tag1",
    "tag2"
  ],
  "memberId": 478
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "message": "Contact not found"
}

Retrieve Contact
GET/contacts/{id}

Retrieve a single contact.

URI Parameters
HideShow
id
number (required) Example: 123

The id of the contact


PUT https://your-subdomain.madewithbree.io/api/site/contacts/123
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "name": "John Doe",
  "email": "john@doe.com",
  "phone": "+123456789",
  "properties": [
    {
      "name": "lead_status",
      "value": "pending"
    }
  ],
  "tags": [
    "tag1",
    "tag2"
  ]
}
Responses200404
Headers
Content-Type: application/json
Body
{
  "id": 123,
  "name": "Contact Name",
  "email": "contact@email.com",
  "phone": "+123456789",
  "note": "Contact Note",
  "address": "address",
  "city": "city",
  "state": "state",
  "zip": "zip",
  "country": "country",
  "companyName": "Company Name",
  "createdOn": 1573240303,
  "properties": [
    {
      "name": "lead_status",
      "value": "contacted"
    },
    {
      "name": "custom_property",
      "value": "property value"
    }
  ],
  "tags": [
    "tag1",
    "tag2"
  ]
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "message": "Contact not found"
}

Update Contact
PUT/contacts/{id}

Update a single contact. Only non-empty fields are set.

URI Parameters
HideShow
id
number (required) Example: 123

The id of the contact


DELETE https://your-subdomain.madewithbree.io/api/site/contacts/123
Responses200
Headers
Content-Type: application/json
Body
{
  "success": true,
  "message": ""
}

Delete Contact
DELETE/contacts/{id}

Deletes the contact and all data associated with it.

URI Parameters
HideShow
id
number (required) Example: 123

The id of the contact


Members

Members are registered users in your website.


Member attributes:

Attribute Type Description
id number Unique identifier
name string Member name
email string Email of the member
groups array Member group id(s) to which the member belong
registeredOn number Timestamp in Unix seconds since epoch
approved boolean Member approval status
contactId number Contact ID of the member
billingAddress address Address object containing the billing information
shippingAddress address Address object containing the shipping information

Member address is described as:

Address attributes:

Attribute Type Description
phone string Phone
companyName string Company Name
companyId string Company Identification Number
country string Country, 2-letter ISO 3166 code
state string State
city string City
zipCode string Zip / Post Code
address string Street address
address2 string Street address, line 2

List and create

GET https://your-subdomain.madewithbree.io/api/site/members?limit=25?skip=25?group_id=12
Responses200
Headers
Content-Type: application/json
Body
{
  "items": [
    {
      "id": 123,
      "name": "John Doe",
      "email": "john@doe.com",
      "registeredOn": 1587489771,
      "groups": [
        59,
        98
      ],
      "approved": true,
      "contactId": 147,
      "billingAddress": {
        "companyName": "",
        "companyId": "",
        "country": "US",
        "state": "VA",
        "city": "Williamsburg",
        "zipCode": "23185",
        "address": "10 Capitol Landing Rd",
        "address2": ""
      },
      "shippingAddress": {
        "companyName": "",
        "companyId": "",
        "country": "US",
        "state": "VA",
        "city": "Williamsburg",
        "zipCode": "23185",
        "address": "10 Capitol Landing Rd",
        "address2": ""
      }
    }
  ],
  "totalCount": 1,
  "limit": 30,
  "skip": 0
}

List All Members
GET/members{?limit}{?skip}{?group_id}

Get a paginated list of all members in your website. Optionally filter by group id.

URI Parameters
HideShow
group_id
number (optional) Example: 12

List only members in the specified group

limit
number (optional) Example: 25

The maximum number of members to return

skip
number (optional) Example: 25

Number of records to skip


POST https://your-subdomain.madewithbree.io/api/site/members
Requestsexample 1
Headers
Content-Type: application/json
Body
{
        "name": "John Doe",
        "email": "john@doe.com",
        "password": "my-password"
        "groups": [
            14
        ],
        "approved": true,
        "billingAddress": {
            "companyName": "",
            "companyId": "",
            "country": "US",
            "state": "VA",
            "city": "Williamsburg",
            "zipCode": "23185",
            "address": "10 Capitol Landing Rd",
            "address2": ""
        },
        "shippingAddress": {
            "companyName": "",
            "companyId": "",
            "country": "US",
            "state": "VA",
            "city": "Williamsburg",
            "zipCode": "23185",
            "address": "10 Capitol Landing Rd",
            "address2": ""
        }
    }
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 157,
  "name": "John Doe",
  "email": "john@doe.com",
  "groups": [
    14
  ],
  "contactId": 48,
  "approved": true,
  "registeredOn": 1587489771,
  "billingAddress": {
    "companyName": "",
    "companyId": "",
    "country": "US",
    "state": "VA",
    "city": "Williamsburg",
    "zipCode": "23185",
    "address": "10 Capitol Landing Rd",
    "address2": ""
  },
  "shippingAddress": {
    "companyName": "",
    "companyId": "",
    "country": "US",
    "state": "VA",
    "city": "Williamsburg",
    "zipCode": "23185",
    "address": "10 Capitol Landing Rd",
    "address2": ""
  }
}

Create New Member
POST/members

Create new member.

If password is provided, the member will be created with the provided password. Otherwise the member will be created with a random password and a password-reset email will be sent to the member.


Single Member

GET https://your-subdomain.madewithbree.io/api/site/members/111
Responses200404
Headers
Content-Type: application/json
Body
{
  "id": 123,
  "name": "John Doe",
  "email": "john@doe.com",
  "registeredOn": 1587489771000,
  "groups": [
    59,
    98
  ],
  "approved": false,
  "contactId": 147,
  "billingAddress": {
    "companyName": "",
    "companyId": "",
    "country": "US",
    "state": "VA",
    "city": "Williamsburg",
    "zipCode": "23185",
    "address": "10 Capitol Landing Rd",
    "address2": ""
  },
  "shippingAddress": {
    "companyName": "",
    "companyId": "",
    "country": "US",
    "state": "VA",
    "city": "Williamsburg",
    "zipCode": "23185",
    "address": "10 Capitol Landing Rd",
    "address2": ""
  }
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "message": "Member not found"
}

Retrieve Member
GET/members/{id}

Retrieve a single member.

URI Parameters
HideShow
id
number (required) Example: 111

The id of the member


PUT https://your-subdomain.madewithbree.io/api/site/members/111
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "groups": [
    66,
    99
  ],
  "approved": true,
  "shippingAddress": {
    "companyName": "",
    "companyId": "",
    "country": "US",
    "state": "VA",
    "city": "Williamsburg",
    "zipCode": "23185",
    "address": "22 Capitol Landing Rd",
    "address2": ""
  }
}
Responses200404
Headers
Content-Type: application/json
Body
{
  "id": 111,
  "name": "John Doe",
  "email": "john@doe.com",
  "registeredOn": 1587489771,
  "groups": [
    66,
    99
  ],
  "approved": true,
  "contactId": 147,
  "billingAddress": {
    "companyName": "",
    "companyId": "",
    "country": "US",
    "state": "VA",
    "city": "Williamsburg",
    "zipCode": "23185",
    "address": "10 Capitol Landing Rd",
    "address2": ""
  },
  "shippingAddress": {
    "name": "John Doe",
    "phone": "",
    "companyName": "",
    "companyId": "",
    "country": "US",
    "state": "VA",
    "city": "Williamsburg",
    "zipCode": "23185",
    "address": "22 Capitol Landing Rd",
    "address2": ""
  }
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "message": "Member not found"
}

Update Member
PUT/members/{id}

Update a single member. Only non-empty fields are set. The member password will NOT be updated.

URI Parameters
HideShow
id
number (required) Example: 111

The id of the member


DELETE https://your-subdomain.madewithbree.io/api/site/members/111
Responses200
Headers
Content-Type: application/json
Body
{
  "success": true,
  "message": ""
}

Delete Member
DELETE/members/{id}

Delete the member.

URI Parameters
HideShow
id
number (required) Example: 111

The id of the member


Single Sign On

POST https://your-subdomain.madewithbree.io/api/site/members/start-session
Requestsexample 1
Headers
Content-Type: application/json
Body
{
    "email": "john@doe.com",
    "path": "/protected-member-only-page",
}
Responses200
Headers
Content-Type: application/json
Body
{
  "token": "xxxxx.xxxxx.xxxxx",
  "accessUrl": "https://your-domain/api/site/members/session/xxxxx.xxxxx.xxxxx",
  "createdAt": 1605283421,
  "expiresAt": 1605284321
}

Start Session
POST/members/start-session

If you already have your own authentication mechanism in your app / website, Single-Sign-On allows your authenticated members to directly access the member area without logging in again.

To initiate a session, call the Start Session endpoint from your backend and redirect the members to the accessUrl from the response. Optionally, pass the path attribute in the request to direct members to a specific page.

The accessUrl is valid for 15 minutes.


Member groups

Member groups are groups which the members belongs to. Access to resources can be restricted to specific member groups only.


Member groups attributes:

Attribute Type Description
id number Unique identifier
name string Name of the member group
link string Member group link - optional, the default page where members are redirected to after a successful login.

List and create

GET https://your-subdomain.madewithbree.io/api/site/member-groups
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "id": 1,
    "name": "Basic Members",
    "link": ""
  },
  {
    "id": 2,
    "name": "Group 1",
    "link": ""
  }
]

List All Member Groups
GET/member-groups

Get a list of all member groups in your website.


POST https://your-subdomain.madewithbree.io/api/site/member-groups
Requests200
Headers
Content-Type: application/json
Body
{
  "name": "New group",
  "link": ""
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 223,
  "name": "New group",
  "link": ""
}

Create New Member Group
POST/member-groups

Creates new member group


Single Member Group

GET https://your-subdomain.madewithbree.io/api/site/member-groups/111
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 111,
  "name": "My new group",
  "link": ""
}

Retrieve Member Group
GET/member-groups/{id}

Retrieve a single member group

URI Parameters
HideShow
id
number (required) Example: 111

The id of the member group


PUT https://your-subdomain.madewithbree.io/api/site/member-groups/111
Requests200
Headers
Content-Type: application/json
Body
{
  "name": "My new group",
  "link": ""
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 111,
  "name": "My new group",
  "link": ""
}

Update Member Group
PUT/member-groups/{id}

Create new member group

URI Parameters
HideShow
id
number (required) Example: 111

The id of the member group


DELETE https://your-subdomain.madewithbree.io/api/site/member-groups/111
Responses200
Headers
Content-Type: application/json
Body
{
  "success": true,
  "message": ""
}

Delete Member Group
DELETE/member-groups/{id}

Delete a member group

URI Parameters
HideShow
id
number (required) Example: 111

The id of the member group


Products

Products are individual items, services or memberships for sale in your store.


Product attributes:

Attribute Type Description
id number Unique identifier
type string The type of the product - physical, digital, service or membership
title string The name of the product
description string A description of the product. Supports light HTML formatting.
url string The product URL (handle) in your store
hidden boolean Whether or not the product is visible in your store front.
images array List of image URLs
categories array List of categories this product belongs to.
options string List with available options for this product (if any).
variants string List with the product variants, determining price, quantity, weight or SKU
subscription Subscription Subscription details (if this is a subscription product)
file string Digital products only - URL of the digital file that’s being sold

Store Category attributes:

Attribute Type Description
id number Unique identifier
name string The name of the category
url string The category URL (handle) in your store
parentCategory number Parent category ID. 0 if this is the root category.

Each product can have multiple options, ex: Color, Size, Material, etc with each option having multiple values, ex: Size - Small, Medium, Large.

Product options are described as:

Product Option attributes:

Attribute Type Description
name string The name of the option (ex: Color, Size, Material)
values string List with all possible values for this option (ex. for Size: Small, Medium, Large, etc)
advanced boolean Whether or not different variations of the options have different price, quantity, sku or weight tracked (see below).

If multiple versions of a product (different variants) have different price, quantity, SKU or weight, each product option can be marked as advanced. Setting product option as advanced will enable custom price / quantity / SKU or weight for each of the option variants.

All products have at least one variant, described as:

Product Variant attributes:

Attribute Type Description
options array List of strings, identifying this product variant. Example: ["wood", "large"] for products with 2 advanced options (Material and Size)
price number The price of this variant.
onSale boolean Whether or not this variant is on sale.
regularPrice number The regular price of this variant, if on sale.
quantity number Available quantity for this variant (empty if quantity is not tracked).
sku string Variant SKU (if any).
weight number Weight, if tracked.

Store products can have a mix of advanced and non-advanced options.

For example, the price can be determined by Material and Size but not by the color of the product with the following options:

{
  "name": "Material",
  "values": ["Metal", "Wood"],
  "advanced": true
},
{
  "name": "Size",
  "values": ["Small", "Large"],
  "advanced": true
},
{
  "name": "Color",
  "values": ["Green", "Blue"],
  "advanced": false
}

When setting up the product variant, include the value of the advanced options only.

Example for the product variants from above:

{
    "options": ["Metal", "Small"],
    "price": 10
},
{
    "options": ["Metal", "Large"],
    "price": 10
},
{
    "options": ["Wood", "Small"],
    "price": 10
},
{
    "options": ["Wood", "Large"],
    "price": 10
},

Use empty array ([]) for options when there are no advanced variants, setting the price / quantity / sku for the whole product.

Subscription attributes:

Attribute Type Description
cycles number The number of payment cycles. 0 for ongoing payments, positive integer (1, 2, 3,…) for a fixed number of payments
period number Number showing the subscription period. (i.e. every 1 month, 2 months, 1 week, etc)
periodUnit string The period unit - either “WEEKLY” or “MONTHLY”

If multiple versions of a product (different variants) have different price, quantity, SKU or weight, each product option can be marked as advanced. Setting product option as advanced will enable custom price / quantity / SKU or weight for each of the option variants.

All products have at least one variant, described as:

List All Products

GET https://your-subdomain.madewithbree.io/api/site/products?limit=25?skip=25?category_id=12?title=shirt
Responses200
Headers
Content-Type: application/json
Body
{
  "items": [
    {
      "id": 123,
      "type": "physical",
      "title": "Running Shoes",
      "description": "Great Running Shoes!",
      "url": "running-shoes",
      "hidden": false,
      "options": [],
      "categories": [
        {
          "id": 1,
          "name": "Shoes",
          "url": "shoes",
          "parentCategory": 0
        }
      ],
      "images": [
        "https://path-to-image.jpg",
        "https://path-to-another-image.jpg"
      ],
      "variants": [
        {
          "options": [],
          "sku": "SH-123",
          "quantity": 10,
          "price": 69.99,
          "regularPrice": null,
          "onSale": false
        }
      ]
    }
  ],
  "totalCount": 1,
  "limit": 25,
  "skip": 0
}

List All Products
GET/products{?limit}{?skip}{?category_id}{?title}

Get a paginated list of all products in your website. Optionally filter by category or product name.

URI Parameters
HideShow
category_id
number (optional) Example: 12

List only products in the specified category (includes all products in the subcategories, if any).

title
string (optional) Example: shirt

List only products containing the specified string in their title.

limit
number (optional) Example: 25

The maximum number of products to return

skip
number (optional) Example: 25

Number of records to skip


Create Products

POST https://your-subdomain.madewithbree.io/api/site/products?update_existing_product_by_url=true
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "type": "physical",
  "title": "Interior Door",
  "description": "Beautiful Interior Door",
  "url": "interior-door",
  "hidden": false,
  "options": [
    {
      "name": "Material",
      "values": [
        "Wood",
        "Glass"
      ],
      "advanced": true
    },
    {
      "name": "Size",
      "values": [
        "Single",
        "Double"
      ],
      "advanced": true
    },
    {
      "name": "Finish",
      "values": [
        "Matte",
        "Glossy"
      ],
      "advanced": false
    }
  ],
  "categories": [
    {
      "id": 1,
      "name": "Shoes",
      "url": "shoes",
      "parentCategory": 0
    }
  ],
  "images": [
    "https://path-to-image.jpg",
    "https://path-to-another-image.jpg"
  ],
  "variants": [
    {
      "options": [
        "Wood",
        "Single"
      ],
      "sku": "D-001",
      "price": 199
    },
    {
      "options": [
        "Wood",
        "Double"
      ],
      "sku": "D-002",
      "price": 345
    },
    {
      "options": [
        "Glass",
        "Single"
      ],
      "sku": "D-003",
      "price": 145
    },
    {
      "options": [
        "Glass",
        "Double"
      ],
      "sku": "D-004",
      "price": 249
    }
  ]
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 111,
  "type": "physical",
  "title": "Interior Door",
  "description": "Beautiful Interior Door",
  "url": "interior-door",
  "hidden": false,
  "options": [
    {
      "name": "Material",
      "values": [
        "Wood",
        "Glass"
      ],
      "advanced": true
    },
    {
      "name": "Size",
      "values": [
        "Single",
        "Double"
      ],
      "advanced": true
    },
    {
      "name": "Finish",
      "values": [
        "Matte",
        "Glossy"
      ],
      "advanced": false
    }
  ],
  "categories": [
    {
      "id": 1,
      "name": "Shoes",
      "url": "shoes",
      "parentCategory": 0
    }
  ],
  "images": [
    "https://path-to-image.jpg",
    "https://path-to-another-image.jpg"
  ],
  "variants": [
    {
      "options": [
        "Wood",
        "Single"
      ],
      "sku": "D-001",
      "price": 199,
      "salePrice": null,
      "onSale": false,
      "quantity": null,
      "weight": null
    },
    {
      "options": [
        "Wood",
        "Double"
      ],
      "sku": "D-002",
      "price": 345,
      "salePrice": null,
      "onSale": false,
      "quantity": null,
      "weight": null
    },
    {
      "options": [
        "Glass",
        "Single"
      ],
      "sku": "D-003",
      "price": 145,
      "salePrice": null,
      "onSale": false,
      "quantity": null,
      "weight": null
    },
    {
      "options": [
        "Glass",
        "Double"
      ],
      "sku": "D-004",
      "price": 249,
      "salePrice": null,
      "onSale": false,
      "quantity": null,
      "weight": null
    }
  ]
}

Create New Product
POST/products{?update_existing_product_by_url}

Create a product. (This example creates a product with 3 options - 2 of them advanced). Set update_existing_product_by_url to true to find existing products with the same URL and update them instead

URI Parameters
HideShow
update_existing_product_by_url
Boolean (optional) Example: true

If set to true and a product with the same URL exists, the existing product will be updated instead


Single Product

GET https://your-subdomain.madewithbree.io/api/site/products/111
Responses200404
Headers
Content-Type: application/json
Body
{
  "id": 111,
  "type": "physical",
  "title": "Interior Door",
  "description": "Beautiful Interior Door",
  "url": "interior-door",
  "hidden": false,
  "options": [
    {
      "name": "Material",
      "values": [
        "Wood",
        "Glass"
      ],
      "advanced": true
    },
    {
      "name": "Size",
      "values": [
        "Single",
        "Double"
      ],
      "advanced": true
    },
    {
      "name": "Finish",
      "values": [
        "Matte",
        "Glossy"
      ],
      "advanced": false
    }
  ],
  "categories": [
    {
      "id": 1,
      "name": "Shoes",
      "url": "shoes",
      "parentCategory": 0
    }
  ],
  "images": [
    "https://path-to-image.jpg",
    "https://path-to-another-image.jpg"
  ],
  "variants": [
    {
      "options": [
        "Wood",
        "Single"
      ],
      "sku": "D-001",
      "price": 199,
      "salePrice": null,
      "onSale": false,
      "quantity": null,
      "weight": null
    },
    {
      "options": [
        "Wood",
        "Double"
      ],
      "sku": "D-002",
      "price": 345,
      "salePrice": null,
      "onSale": false,
      "quantity": null,
      "weight": null
    },
    {
      "options": [
        "Glass",
        "Single"
      ],
      "sku": "D-003",
      "price": 145,
      "salePrice": null,
      "onSale": false,
      "quantity": null,
      "weight": null
    },
    {
      "options": [
        "Glass",
        "Double"
      ],
      "sku": "D-004",
      "price": 249,
      "salePrice": null,
      "onSale": false,
      "quantity": null,
      "weight": null
    }
  ]
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "message": "Product not found"
}

Retrieve Product
GET/products/{id}

Retrieve a single product.

URI Parameters
HideShow
id
number (required) Example: 111

The id of the product


PUT https://your-subdomain.madewithbree.io/api/site/products/111
Requestsexample 1
Headers
Content-Type: application/json
Body
{
    "title": "New Interior Door",
    "variants": [
        {
            "options": ["Wood", "Single"],
            "price": 179
            "quantity": 5
    ]
}
Responses200404
Headers
Content-Type: application/json
Body
{
  "id": 111,
  "type": "physical",
  "title": "New Interior Door",
  "description": "Beautiful Interior Door",
  "url": "interior-door",
  "hidden": false,
  "options": [
    {
      "name": "Material",
      "values": [
        "Wood",
        "Glass"
      ],
      "advanced": true
    },
    {
      "name": "Size",
      "values": [
        "Single",
        "Double"
      ],
      "advanced": true
    },
    {
      "name": "Finish",
      "values": [
        "Matte",
        "Glossy"
      ],
      "advanced": false
    }
  ],
  "categories": [
    {
      "id": 1,
      "name": "Shoes",
      "url": "shoes",
      "parentCategory": 0
    }
  ],
  "images": [
    "https://path-to-image.jpg",
    "https://path-to-another-image.jpg"
  ],
  "variants": [
    {
      "options": [
        "Wood",
        "Single"
      ],
      "sku": "D-001",
      "price": 179,
      "salePrice": null,
      "onSale": false,
      "quantity": 5,
      "weight": null
    },
    {
      "options": [
        "Wood",
        "Double"
      ],
      "sku": "D-002",
      "price": 345,
      "salePrice": null,
      "onSale": false,
      "quantity": null,
      "weight": null
    },
    {
      "options": [
        "Glass",
        "Single"
      ],
      "sku": "D-003",
      "price": 145,
      "salePrice": null,
      "onSale": false,
      "quantity": null,
      "weight": null
    },
    {
      "options": [
        "Glass",
        "Double"
      ],
      "sku": "D-004",
      "price": 249,
      "salePrice": null,
      "onSale": false,
      "quantity": null,
      "weight": null
    }
  ]
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "message": "Product not found"
}

Update Product
PUT/products/{id}

Update a single product. Only non-empty fields or provided variants are set.

URI Parameters
HideShow
id
number (required) Example: 111

The id of the product


DELETE https://your-subdomain.madewithbree.io/api/site/products/111
Responses200
Headers
Content-Type: application/json
Body
{
  "success": true,
  "message": ""
}

Delete Product
DELETE/products/{id}

Deletes the product.

URI Parameters
HideShow
id
number (required) Example: 111

The id of the product


Categories

GET https://your-subdomain.madewithbree.io/api/site/products/categories?parent=12
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "id": 1,
    "name": "Doors",
    "url": "doors",
    "parentCategory": null
  },
  {
    "id": 2,
    "name": "Interior Doors",
    "url": "interior-doors",
    "parentCategory": 1
  }
]

List all categories
GET/products/categories{?parent}

Get a list of all categories in the store

URI Parameters
HideShow
parent
number (optional) Example: 12

List only direct sub-categories of the provided parent


Orders

Access orders placed in your website.


Order attributes:

Attribute Type Description
id number Unique identifier.
invoiceNo number Invoice number assigned to the order.
created number Timestamp in Unix seconds since epoch. The time the order was placed.
customerName string The name of the customer
customerEmail string The email of the customer
shippingAddress address The shipping address of the order (if set, see below)
billingAddress address The billing address of the order (if set, see below)
shippingRequired boolean Whether or not the order contains physical products requiring shipping
weight number total weight of the order
weightUnit string Weight unit (kg, lb)
subTotal number
total number
discountCode string Used discount code
discountType string Type of discount used: fixed_discount, percent_discount or free_shipping
discountAmount number Discount amount
shippingName string Shipping method used (if any)
shippingAmount number Cost of shipping
paid boolean Whether or not the order is paid
paymentMethod string Payment method used to place the order
transactionId string If paid, the payment transaction id
status string Order status. One of: pending, shipped, completed, canceled
taxes array List of all taxes applied to the order. List of: {"name": "Sales Tax", "total": 20, "applyToShipping": false}
items array List of all order items (see below)
tags array List of tags assigned to the order.
additionalFields array List of field-value pairs of all additional fields collected with with the order. List of: {"field": "My Field", "value": "Some Value"}

Each Order consists of one or more order items. Described as:

Order Item attributes:

Attribute Type Description
id number Unique identifier.
name string Name of the product.
url string URL of the product.
productId number ID of the product.
type string Product type. One of: physical, digital, service, membership
sku string SKU of the selected variant
quantity number Purchased quantity
total number Item total
weight number Item weight
shippingRequired boolean Whether or not this item is a physical product and requires shipping
images string List of product images
variation array Array, containing a name-value pairs describing the selected variant. Example: [{"name": "Material", "value": "Wood"}, {"name": "Size", "value": "Large"}]
additions array Array, containing a name-value pairs of any extra information asked for this item.

Customer Addresses are described as:

Address attributes:

Attribute Type Description
name string Name of customer
phone string Phone
companyName string Company Name
companyId string Company Identification Number
country string Country, 2-letter ISO 3166 code
state string State
city string City
zipCode string Zip / Post Code
address string Street address
address2 string Street address, line 2

List and create

GET https://your-subdomain.madewithbree.io/api/site/orders?limit=25?skip=25?created_at_min=1573251649?created_at_max=1573251649
Responses200
Headers
Content-Type: application/json
Body
{
  "items": [
    {
      "id": 1234,
      "invoiceNo": 15,
      "created": 1573397217,
      "customerName": "John Doe",
      "customerEmail": "john@email.com",
      "billingAddress": {
        "name": "John Doe",
        "phone": "",
        "companyName": "",
        "companyId": "",
        "country": "US",
        "state": "VA",
        "city": "Williamsburg",
        "zipCode": "23185",
        "address": "10 Capitol Landing Rd",
        "address2": ""
      },
      "shippingAddress": {
        "name": "John Doe",
        "phone": "",
        "companyName": "",
        "companyId": "",
        "country": "US",
        "state": "VA",
        "city": "Williamsburg",
        "zipCode": "23185",
        "address": "10 Capitol Landing Rd",
        "address2": ""
      },
      "shippingRequired": true,
      "weight": 0,
      "weightUnit": "kg",
      "subTotal": 49,
      "total": 49,
      "discountCode": null,
      "discountType": null,
      "shippingAmount": 0,
      "shippingName": "",
      "paid": true,
      "paymentMethod": "stripe",
      "status": "completed",
      "discountAmount": 0,
      "taxes": [],
      "items": [
        {
          "id": 123,
          "name": "Running Shoes",
          "url": "running-shoes",
          "productId": 24,
          "sku": null,
          "quantity": 1,
          "weight": 0,
          "total": 49,
          "type": "physical",
          "shippingRequired": true,
          "images": [
            "https://path-to-image.jpg"
          ],
          "variation": [
            {
              "name": "Color",
              "value": "Blue"
            }
          ],
          "additions": []
        }
      ]
    }
  ],
  "totalCount": 1,
  "limit": 25,
  "skip": 0
}

List All Orders
GET/orders{?limit}{?skip}{?created_at_min}{?created_at_max}

Get a paginated list of all contacts created in your website. Optionally filter by created date.

URI Parameters
HideShow
created_at_min
Unix Timestamp (optional) Example: 1573251649

List only orders created after the specified timestamp (inclusive, in seconds since the Unix epoch)

created_at_max
Unix Timestamp (optional) Example: 1573251649

List only orders created before the specified timestamp (inclusive, in seconds since the Unix epoch)

limit
number (optional) Example: 25

The maximum number of orders to return

skip
number (optional) Example: 25

Number of records to skip


Single Order

GET https://your-subdomain.madewithbree.io/api/site/orders/1234
Responses200404
Headers
Content-Type: application/json
Body
{
  "id": 1234,
  "invoiceNo": 15,
  "created": 1573397217,
  "customerName": "John Doe",
  "customerEmail": "john@email.com",
  "billingAddress": {
    "name": "John Doe",
    "phone": "",
    "companyName": "",
    "companyId": "",
    "country": "US",
    "state": "VA",
    "city": "Williamsburg",
    "zipCode": "23185",
    "address": "10 Capitol Landing Rd",
    "address2": ""
  },
  "shippingAddress": {
    "name": "John Doe",
    "phone": "",
    "companyName": "",
    "companyId": "",
    "country": "US",
    "state": "VA",
    "city": "Williamsburg",
    "zipCode": "23185",
    "address": "10 Capitol Landing Rd",
    "address2": ""
  },
  "shippingRequired": true,
  "weight": 0,
  "weightUnit": "kg",
  "subTotal": 49,
  "total": 49,
  "discountCode": null,
  "discountType": null,
  "shippingAmount": 0,
  "shippingName": "",
  "paid": true,
  "paymentMethod": "stripe",
  "status": "completed",
  "discountAmount": 0,
  "taxes": [],
  "items": [
    {
      "id": 123,
      "name": "Running Shoes",
      "url": "running-shoes",
      "productId": 24,
      "sku": null,
      "quantity": 1,
      "weight": 0,
      "total": 49,
      "type": "physical",
      "shippingRequired": true,
      "images": [
        "https://path-to-image.jpg"
      ],
      "variation": [
        {
          "name": "Color",
          "value": "Blue"
        }
      ],
      "additions": []
    }
  ]
}
Headers
Content-Type: application/json
Body
{
  "success": false,
  "message": "Order not found"
}

Retrieve Order
GET/orders/{id}

Retrieve a single order.

URI Parameters
HideShow
id
number (required) Example: 1234

The id of the order


Forms

Access all form submissions in the website. Each form submission is described as:


Form submission attributes:

Attribute Type Description
name string The name of the submitted form
received number Timestamp in Unix seconds since epoch. The time the form was submitted.
fields array List of name-value pairs of all submitted fields. Example: [{"name": "Name", "value": "John"},{"name": "Email","value": "john@doe.com"}]

List

GET https://your-subdomain.madewithbree.io/api/site/form-submissions?from=1573251649?to=1573251649?limit=50?skip=50
Responses200
Headers
Content-Type: application/json
Body
{
  "items": [
    {
      "name": "Contact form",
      "received": 1573120479,
      "fields": [
        {
          "name": "Your Name",
          "value": "John Doe"
        },
        {
          "name": "Your Email",
          "value": "john@doe.com"
        }
      ]
    },
    {
      "name": "Contact form",
      "received": 1573120453,
      "fields": [
        {
          "name": "Your Name",
          "value": "Bill"
        },
        {
          "name": "Email",
          "value": "bill@site.com"
        }
      ]
    }
  ],
  "totalCount": 2,
  "limit": 50,
  "skip": 0
}

Get All Form Submissions
GET/form-submissions{?from}{?to}{?limit}{?skip}

Get a paginated list of all form submissions in the website

URI Parameters
HideShow
from
Unix Timestamp (optional) Example: 1573251649

List only form submissions created after the specified timestamp (inclusive, in seconds since the Unix epoch)

to
Unix Timestamp (optional) Example: 1573251649

List only form submissions created before the specified timestamp (inclusive, in seconds since the Unix epoch)

limit
number (optional) Example: 50

The maximum number of items to return

skip
number (optional) Example: 50

Number of records to skip


Bookings

Access the details of all scheduled events via the booking features of each website or funnel.


Booking attributes:

Attribute Type Description
id number Unique booking (session) id
eventId number Unique event id
contactId number Unique Contact id
name string Contact name
email string Contact email
start number Timestamp in Unix seconds since epoch. The time the booking starts.
end number Timestamp in Unix seconds since epoch. The time the booking ends.
eventData EventDetails Details about the event
operator Operator Details about the operator
service Service Details about the service
formAnswers array List of name-value pairs of all form questions answered by the atended. Example: [{"name": "Name", "value": "John"},{"name": "Email","value": "john@doe.com"}]

EventDetails attributes:

Attribute Type Description
name string Event name
location string Event location

Operator attributes:

Attribute Type Description
id number Unique operator id
name string Operator name
email string Operator email

Service attributes:

Attribute Type Description
id number Unique service id
name string Service name

List

GET https://your-subdomain.madewithbree.io/api/site/bookings?from=1573251649?to=1573251649?eventId=123?limit=50?skip=50
Responses200
Headers
Content-Type: application/json
Body
{
  "items": [
    {
      "id": 206,
      "eventId": 98146,
      "contactId": 41,
      "name": "Jane Doe",
      "email": "jane@doe.com",
      "start": 1587936600,
      "end": 1587938400,
      "eventData": {
        "name": "My event",
        "location": "Skype"
      },
      "operator": {
        "id": 51215,
        "name": "John Doe",
        "email": "john@doe.com"
      },
      "fromAnswers": [
        {
          "field": "Name",
          "value": "Jane Doe"
        },
        {
          "field": "Email",
          "value": "jane@doe.com"
        }
      ]
    }
  ],
  "totalCount": 1,
  "limit": 50,
  "skip": 0
}

Get All Bookings
GET/bookings{?from}{?to}{?eventId}{?limit}{?skip}

Get a paginated list of booked sessions in the website / funnel.

URI Parameters
HideShow
from
Unix Timestamp (optional) Example: 1573251649

List only bookings starting after the specified timestamp (inclusive, in seconds since the Unix epoch)

to
Unix Timestamp (optional) Example: 1573251649

List only bookings starting before the specified timestamp (inclusive, in seconds since the Unix epoch)

eventId
number (optional) Example: 123

List only bookings with the selected id

limit
number (optional) Example: 50

The maximum number of items to return

skip
number (optional) Example: 50

Number of records to skip


Webhooks

Webhooks are a system of automated notifications indicating that an event has occurred in your website. Rather than requiring you to pull information via the API, webhooks push information to your destination when important events occur.

You can create webhooks for:

  • New Order (order_created) - fired when a new order is placed on the website

  • Updated Order (order_updated) - fired when an order is updated

  • New Product (product_created) - fired when a new product is created

  • Updated Product (product_updated) - fired when a product is updated

  • New Form Submission (form_submitted) - fired when a form is submitted

  • New Contact Activity (contact_updated) - fired when a new contact is created or existing contact is updated

  • New Booking Created (booking_created) - fired when a new booking is created

When one of the selected events is triggered, we’ll send a HTTP POST payload to the webhook’s target URL. The payload is a single JSON object and depends on the event:

Event POST Payload
New Order Order
Updated Order Order
New Product Product
Updated Product Product
New Contact Activity Contact
New Form Submission Form Details
New Booking Created Booking Details

Each POST call to your destination URL will include the following headers:

Header Description
X-Webhook-Id The id of the fired webhook.
X-Webhook-Topic The event that was fired. One of: order_created, order_updated, product_created, product_updated, form_submitted, contact_updated, booking_created.
X-Webhook-Source The URL of the website firing the event.
X-Webhook-Signature The HMAC hex digest of the response body. The HMAC hex digest is generated using the SHA-512 hash function and the secret as the HMAC key.

If a POST request fail, we’ll send an email to the owner of the website to notify them for the failed webhook.

Each request to your destination URL is signed using the webhook secret. The signature is passed in the X-Webhook-Signature header and can be used to verify that the events were sent by us and not by a third party. To verify the signature, generate the HMAC hex digest using the SHA-512 hash function and the webhook secret as the HMAC key. Then compare it with the X-Webhook-Signature from the request.

The POST Payload for New Form Submission is as follows:

{
    "website": 
    {
        "id": 123,
        "subdomain": "some-subdomain",
        "systemDomain": "your-system.subdomain.com"
        "domain": "your-primary-domain.com"
    },
    "contact": { ... },
    "formName": "Contact Form",
    "formValues": [
        {"field": "Name", "value": "John"},
        {"field": "Email","value": "john@doe.com"}
    ]
}

Where each attribute is:

Attribute Type Description
website object Information about the website where the form was submitted
contact object Contact - the visitor who submitted the form
formName string The name of the submitted form.
formValues array List of field-value pairs of all submitted fields.

Managing Webhooks via the API

Webhooks can be created and deleted via this API.

Each webhook is described as:


Webhook attributes:

Attribute Type Description
id string Unique identifier
target string Your destination URL to push notifications to
secret string Webhook secret - use the secret to verify that the events posted to your URL were indeed sent by the website.
events string List of events to notify on. One of: order_created, order_updated, product_created, product_updated, form_submitted, contact_updated, booking_created

List and create

GET https://your-subdomain.madewithbree.io/api/site/webhooks
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "id": "rh_24488493954",
    "target": "https://your-target.com/some-path",
    "secret": "41pweL23Yuy8NB11",
    "events": [
      "order_created",
      "order_updated"
    ]
  },
  {
    "id": "rh_244adc93954",
    "target": "https://your-target.com/another-path",
    "secret": "1234eL23zac8NB11",
    "events": [
      "contact_updated"
    ]
  }
]

List All Webhooks
GET/webhooks

Get a list of all webhooks in your website.


POST https://your-subdomain.madewithbree.io/api/site/webhooks
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "target": "https://your-target.com/some-path",
  "secret": "your-secret",
  "events": [
    "order_created",
    "order_updated"
  ]
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": "rh_4ac124dde21",
  "target": "https://your-target.com/some-path",
  "secret": "your-secret",
  "events": [
    "order_created",
    "order_updated"
  ]
}

Create New Webhook
POST/webhooks

Create a webhook.


Single Webhook

DELETE https://your-subdomain.madewithbree.io/api/site/webhooks/rh_4ac124dde21
Responses200
Headers
Content-Type: application/json
Body
{
  "success": true,
  "message": ""
}

Delete Webhook
DELETE/webhooks/{id}

Deletes the webhook

URI Parameters
HideShow
id
string (required) Example: rh_4ac124dde21

The id of the webhook


Generated by aglio on 11 May 2021