API Reference

Authentication

Your project has a secret API key that you can use to authenticate your requests. You can find your project’s API key, here.

Add your API key to the Authorization header of each request. For example:

"Authorization": "Bearer <API_KEY>"

Endpoints

Customers

POST Create or update a customer

POST https://api.melo.ca/beacon/customers

Creates a new customer or updates an existing one.

Body

NameTypeDescription
first_name*stringThe customer's first name.
last_namestringThe customer's last name.
emailstringThe customer's email address.
phonestringThe customer's phone number.
companystringThe customer's company name.
signed_up_atdateThe date the customer signed up to your service.
has_subscriptionbooleanWhether or not the customer is subscribed to your service.
location_slugstringThe slug of a location.
notesstringNotes for internal use only.
tagsarrayAn array of customer tag slugs to apply to the customer.
address1stringThe customer's address line 1.
address2stringThe customer's address line 2.
citystringThe customer's city or town.
statestringThe customer's state or region.
postal_codestringThe customer's postal code.

POST Create a customer charge

POST https://api.melo.ca/beacon/charges

Records a charge for the customer. You must first create the customer before adding charges.

Body

NameTypeDescription
emailstring, required without phone.The customer's email address.
phonestring, required without email.The customer's phone number.
amountintegerAmount of charge in lowest currency denomination.
currencystringThe 3-letter currency code.
location_slugstringThe slug of a location. If provided, the default location for the customer will be changed to this one.
charged_atdateThe date the customer was charged.

GET Get customers

GET https://api.melo.ca/beacon/customers

Gets all customers for a project.

GET Get customer reviews

GET https://api.melo.ca/beacon/customers/:id/reviews

Gets all reviews the customer submitted.

GET Get customer messages

GET https://api.melo.ca/beacon/customers/:id/messages

Gets all messages sent to a customer.

Reviews

POST Create a review request

POST https://api.melo.ca/beacon/asks

Schedules a review request for the customer.

Body

Name Type Description
email string, required without phone. The customer's email address
phone string, required without email. The customer's phone number
channels array Include "email", "sms", or both channels.
reminders_count integer 0 - 3 reminders.
asked_at date The date to schedule the request. If null, it will send immediately.

GET Get reviews

GET https://api.melo.ca/beacon/reviews/

Gets all reviews for a project.

Locations

POST Create a location

POST https://api.melo.ca/beacon/locations

Creates a location for a project.

Body

Name Type Description
name* string The name of the location.
display_name string The customer-facing name for the location. Falls back to name.
slug string The slug for the location. Generated if left out.
code string An optional store code.
address1 string Address line 1.
address2 string Address line 2.
city string The city or town.
state string The state or region.
postal_code string The postal code.

PUT Update a location

PUT https://api.melo.ca/beacon/locations/:id

Updates a location.

Body

Name Type Description
name string The name of the location.
display_name string The customer-facing name for the location. Falls back to name.
slug string The slug for the location. Generated if left out.
code string An optional store code.
address1 string Address line 1.
address2 string Address line 2.
city string The city or town.
state string The state or region.
postal_code string The postal code.

Pagination

For requests that require pagination, a pagination key is added to the response. This key might look something like the following:

"pagination": {
  "current_page": 2,
  "path": "https://api.melo.ca/beacon/customers",
  "first_page_url": "https://api.melo.ca/beacon/customers?page=1",
  "last_page_url": "https://api.melo.ca/beacon/customers?page=3",
  "prev_page_url": "https://api.melo.ca/beacon/customers?page=1",
  "next_page_url": "https://api.melo.ca/beacon/customers?page=3",
  "from": 51,
  "to": 100,
  "total": 110,
  "per_page": 50,
  "last_page": 3
}