Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

This page is under construction.

Option 1 - simple link

Option 2 is applicable whenever adding code-level logic is not possible, for example when vendor is using an ecom platform (like Shopify) that gives you limited control over the contents of your email

  1. There needs to be a mapping stored between particular store and our ‘queue ID’ on ecom side in order to be able to create correct link.  Queue id (in form of string) will be provided by us for each location you want to enable the pickup functionality at.

  2. Create schedule pickup link:

    1. URL schema: https://queue.{env}.ombori.com/{organization}/queues/{queueId}/book/curbside-pickup?orderId={orderId}&pickupDuration={numberOfDays}&note={note}

    2. Query string parameters:

      1. orderId – string containing order identifier (required)

      2. pickupDuration - how many days in the future can pickup be booked at, used for getting maximum pickup date (maximum pickup date = today + pickupDuration)

      3. note

Option 2 - complex link

Option 1 is applicable whenever using code-level logic to generate link is possible, for example vendor’s own backend is sending out an order confirmation email and is capable of generating this link. Gives most control.

...

  1. options – JSON stringified configuration object, encoded Base64, that contains following fields:

    1. orderId – string containing order identifier (required)

    2. minDate – earliest pickup date in form of UTC timestamp (seconds, required)

    3. maxDate – latest pickup date in form of UTC timestamp (seconds, required)

    4. phoneNumber – customer’s phone number in E.164 format (optional)

    5. note – extra information such as order summary (for example, comma separated list of purchased items) to be displayed to the staff and customer in UI for improved UX (required, maximum 500 characters)

Link generating example

Example how to generate complex link: JavaScript code example: https://codesandbox.io/s/boring-rubin-briq0?file=/src/index.js

Option 2 - simple link

Option 2 is applicable whenever adding code-level logic is not possible, for example when vendor is using an ecom platform (like Shopify) that gives you limited control over the contents of your email

...

There needs to be a mapping stored between particular store and our ‘queue ID’ on ecom side in order to be able to create correct link.  Queue id (in form of string) will be provided by us for each location you want to enable the pickup functionality at.

Create schedule pickup link:

...

Code Block
// Creating curbside link link
const data = {
  earliestPickup: "2021-07-14T08:40:24.806Z", // earliest pickup date, as ISO string for example purposes
  latestPickup: "2022-07-14T08:40:24.806Z", // latest pickup date, as ISO string for example purposes
  orderId: `XYZ${Math.floor(Math.random() * 100)}`, // internal order identifier
  phoneNumber: "+46000000", // customer phone number
  note: "hello" // optional note to be presented for the staff
};
const curbsideServiceUrlBase = "https://queue.eu.ombori.com"; // base url for link generation, found in Console or provided by Ombori team, depends on data residency
const queueId = "7a37b7e8-4689-4982-8216-262c5e1f1989"; // queue id, found in console
const organization = "aneards"; // organization id, found in console

const { earliestPickup, latestPickup, orderId, phoneNumber, note } = data;

const minDate = Math.floor(new Date(earliestPickup).getTime() / 1000); // utc timestamp in seconds
const maxDate = Math.floor(new Date(latestPickup).getTime() / 1000); // utc timestamp in seconds

const linkOptions = { minDate, maxDate, orderId, phoneNumber, note };
const urlBase = `${curbsideServiceUrlBase}/${organization}/queues/${queueId}/book/curbside-

...

Query string parameters:

...

orderId – string containing order identifier (required)

...

pickupDuration - how many days in the future can pickup be booked at, used for getting maximum pickup date (maximum pickup date = today + pickupDuration)

...

pickup`;
const linkUrl = `${urlBase}?options=${btoa(JSON.stringify(linkOptions))}`;

const a = document.createElement("a");
const link = document.createTextNode(`Book your pickup: ${linkUrl}`);
a.appendChild(link);
a.href = linkUrl;
document.body.appendChild(a);

console.log(linkUrl);

General notes:

  1. order id can be used as uniq identifier to retrieve an existing ticket (so we avoid double bookings)