CEND / Developers / Website widgets
One script · no server neededWebsite widgets.
Paste one script and a few tags, and your page gets a CEND price calculator, a tracking box, a delivery price on product pages and a floating button.
Start in two minutes
Add one script to your page, then put a tag where you want each widget. Prices and tracking are asked of the CEND API straight from the visitor’s browser, so nothing passes through your server.
- 1.Ask for API access on the Developers page, then create a publishable key (it starts with pk_). Start with a test key.
- 2.On that key, list the websites it may be used from. It refuses every other website, so a copied key is useless to anyone else.
- 3.Paste the script and the tags below into your page.
<script src="https://cend.ng/embed/cend.js" async></script>
<!-- Price calculator -->
<div data-cend-widget="calculator" data-key="pk_live_..."></div>
<!-- Track a parcel -->
<div data-cend-widget="track"></div>
<!-- Delivery price on a product page, from your pickup address -->
<div data-cend-widget="estimate" data-key="pk_live_..." data-weight-kg="1"
data-origin-address="12 Allen Ave, Ikeja" data-origin-state="Lagos"
data-origin-lat="6.6018" data-origin-lng="3.3515"></div>
<!-- A button in the corner of every page that opens the calculator and tracking -->
<div data-cend-widget="floating" data-key="pk_live_..." data-position="right" data-label="Delivery"
data-origin-address="12 Allen Ave, Ikeja" data-origin-state="Lagos"
data-origin-lat="6.6018" data-origin-lng="3.3515"></div>
<!-- Button -->
<a data-cend-widget="send-button" data-accent="#0a0b1f">Send with CEND</a>The widgets
- Price calculator calculator. Visitors pick where from and where to from suggested addresses, enter a weight and see the price.
- Track a parcel track. A small box that shows progress for any CEND tracking number. No key needed.
- Delivery price on product pages estimate. The shopper types their address and sees the delivery price from your pickup address.
- Floating Delivery button floating. A button in the corner of every page that opens the calculator and the tracking box. Put it once, in your footer. Escape closes it.
- Send with CEND button send-button. A button that opens CEND booking.
Options
Set these on the tag as attributes.
- data-key Your publishable key (pk_...). Needed by the calculator, the delivery price and the floating button. Tracking needs none.
- data-country Two-letter country for address search. Default NG.
- data-accent A colour for the buttons, like #0a0b1f.
- data-origin-address, -state, -lat, -lng Your pickup address, for the delivery price and the floating button. With these set, the shopper only types where it goes.
- data-weight-kg The parcel weight to price, for the delivery price on a product page. Default 1.
- data-position, data-label For the floating button: left or right, and the words on the button.
- data-href For the button: where it opens. Default is the CEND booking page.
- data-api Another API address, for testing.
Good to know
- A publishable key can price, but it cannot book. Booking needs a secret key on your server.
- Prices carry the same rate limits as the API. A busy page is fine; a script hammering it is slowed down.
- The widgets show a small “Delivery by CEND” line. Please leave it in.
- The delivery price shows the price. It does not show a delivery date yet.
Stuck, or want something changed?
Tell us what you are building and we will reply within one working day.