Home

Awesome

node-bolt

An API Wrapper for Bolt

Do you need a paid license ? https://jzarca01.github.io/contact

Installation

yarn add node-bolt

Usage

const Bolt = require("node-bolt");
const bolt = new Bolt({
  licenseFilePath: "./license_files/file.lic", // relative path to the root of the project
  user: "", // user's phone number
  deviceUUID: "" // user's device UUID
});

Methods

Login

bolt.login();

Verify code

bolt.verify(code);

Find promos available

bolt.findPromosAvailable({ lat, lng });

Add promo code

bolt.addPromoCode(promoCode);

Find coordinates by address

bolt.findCoordinatesByAddress(address);

Find address by coordinates

bolt.findAddressByCoordinates({ lat, lng });

Find address

bolt.findAddress({ lat, lng }, searchTerm);

Find address by placeId

bolt.findAddressByPlaceId(placeId);

Get suggested dropoffs

bolt.getSuggestedDropoffs({ lat, lng });

Get payment methods by template

bolt.getPaymentMethodsByTemplate({ lat, lng, country_code });

Get prices

bolt.getPrices(startLocation, endLocation, campaignCode = null);

Get nearby vehicles

bolt.getNearbyVehicles({ lat, lng });

Update user profile

const updatedProfile = {
  first_name: "Bob",
  email: "bob@bob.com",
  last_name: "Bob",
  language: "fr",
  birthday: "1986-01-01",
  allow_sendind_news: false
};
bolt.updateProfile(updatedProfile);

Get order history

bolt.getOrders();

Get order details

bolt.getOrderDetails(orderId);

Get payment methods per template

bolt.getPaymentMethodsPerTemplate({ lat, lng, country_code });

Create order

bolt.createOrder(
  startLocation,
  endLocation,
  priceLockId,
  searchToken,
  searchCategoryId,
  payment = { type: "default", id: "cash" }
);

Get current active order

bolt.getCurrentActiveOrder();

Cancel order

bolt.cancelOrder(orderId);

Add cancellation reason

bolt.addCancellationReason(orderId, reason = "Accidental request");

Get order state

bolt.pollingClient(orderId);

Set default payment method

bolt.setDefaultPaymentMethod({ id, type });

Delete payment method

bolt.deletePaymentMethod({ id, type });