Custom eCommerce integration guide

Add Brisqq to delivery options on your custom-made eCommerce website with minimal effort and changes to existing code

Get started


Setup

Include our library in your code along with the provided API keys

Step 1

At checkout page, once the user's postcode is known, call our API to verify availability and price

Step 2

Tell our library where to fit the Brisqq box that enables user to select desired date / timeslot

Step 3

Once checkout is complete, call our API to confirm user's reserved delivery timeslot

SETUP


All that's needed is to load our stylesheet and library (and include your API key - contact us if you haven't got one). The Brisqq JS library depends on jQuery and moment.js, but it loads them automatically if they are not already included. Make sure to switch to the production version of the library once you're done with integration / testing.


      <link rel="stylesheet" href="https://s3-eu-west-1.amazonaws.com/brisqq-assets/eapi/custom/brisqq-integration.css" />
      
      /* staging version for testing */
      <script  data-brisqq-apikey="[API_KEY]" src="https://s3-eu-west-1.amazonaws.com/brisqq-assets/eapi/custom/brisqq-integration-staging.js"></script>
      
      /* production version */
      <script  data-brisqq-apikey="[API_KEY]" src="https://s3-eu-west-1.amazonaws.com/brisqq-assets/eapi/custom/brisqq-integration.js"></script>

For testing, feel free to use 559280e2fed0ed03000900be.

 

Step 1


Brisqq's availability depends on the distance between the fulfillment location and the customer's address, which is determined based on their postcode. Once the customer's postcode is known, you can call a library method that will communicate with the Brisqq API, and confirm service availability for the entered postcode, along with delivery price. Availability and price are determined based on agreed distance / price tiers.

Brisqq.checkAvailability

Inputs
postcode
Destination postcode
callback
Function to execute on completion
Output / Callback parameters
isAvailable
Boolean - whether the distance from fulfillment store to customer postcode is covered based on agreement with Brisqq
price
Number - delivery price, depending on distance tiers set up for partner
error
null (in case of success), or object: {"error": "<description of the encountered problem>"}

      Brisqq.checkAvailability('WC1B 3JA', function (isAvailable, price, error) {
      	console.log(isAvailable, price);
      });

Output
//true 10

 

Step 2


Based on the availability result, you will want to add Brisqq to a list of available delivery options or use any other way to offer Brisqq to your customers as a value-added service. We leave it up to you to choose your preferred approach, and simply display our user interface when needed. Since the customer can reserve their delivery from here, we just need you to forward the contact details to help us schedule it properly.

Brisqq.displayBox

Inputs
customerData
Object containing basic customer data relevant for delivery: name, address, mobile, email
targetContainer
Selector pointing to a target container (e.g. "div"), where the Brisqq box should be shown - dimensions are 590px by 250px
Output / Callback parameters
None

      var customerData = {
      	contactName: 'Johnattan Smith',
      	contactPhone: '+44771234567',
      	contactEmail: 'johnsmith@test.com',
      	address: '14 Bedford Square'
      }
      Brisqq.displayBox(customerData, '#shipping_method_2_info');
<div id="#shipping_method_2_info"></div>
Output

Step 3


Once the customer has completed the checkout process with Brisqq selected and reserved the delivery using our box, you will want to confirm the delivery. This will prevent it from timing out, and trigger Brisqq confirmation notifications containing delivery information, to both the partner and the customer. Deliveries that are not confirmed will time out, and won't be made or charged.

Brisqq.confirmDelivery

Inputs
callback
function to execute on completion
Output / Callback parameters
isConfirmed
Boolean - whether the confirmation was successful
error
null (in case of success), or object: {"error": "<description of the encountered problem>"}

      Brisqq.confirmDelivery(function (isConfirmed, error) {
      	console.log(isConfirmed, error);
      });

Output