Shipping

NimbusPost shipping for GoCommerce

A Go package that books a parcel through NimbusPost, which hands it to a courier — Delhivery, XpressBees, Blue Dart and the rest — and returns that courier’s waybill and a label. An account login and a registered warehouse are what it needs.

What it does

Registering the module adds “nimbuspost” as a fulfillment provider. An operator ships the usual way — the admin’s ship dialog, or POST /api/admin/create-fulfillment with "provider": "nimbuspost" — and the module books the parcel, returning the waybill as the tracking number along with NimbusPost’s label URL. The engine stores the shipment and moves the order on; the module only talks to NimbusPost.

NimbusPost is an aggregator, not a carrier, and the package doc is careful about what follows. The shipment comes back naming whichever courier took it, so the carrier on the GoCommerce shipment is read from the response rather than assumed, and the tracking number belongs to that courier, not to NimbusPost.

In the admin it describes itself as “NimbusPost’s courier aggregation, India: one login books across the couriers it holds.”

Configuration

Three settings are required: the account’s email and password, and the warehouse name. Set them in Config from your own main(), or leave Config empty and fill them in under Settings › Shipping providers.

NimbusPost module settings — 9 settings, 3 required
SettingEnvironment variableRequiredWhat it does
Email
Account email
NIMBUSPOST_EMAIL Yes The NimbusPost login. The API has no long-lived key, only a login that mints a token.
Password
Account password
NIMBUSPOST_PASSWORD Yes Exchanged for a token, which the module reuses for a day.
WarehouseName
Warehouse name
— Yes The pickup warehouse registered with NimbusPost, matched exactly. The package’s example uses “Primary”.
PickupName, PickupAddress, PickupCity, PickupState, PickupPincode, PickupPhone
Pickup: name, address, city, state, pincode, phone
— No The pickup address sent with each shipment. NimbusPost finds the warehouse by name; these are what gets printed, and left empty they lean on what the dashboard holds.
AutoPickup
Raise the pickup request while booking
— No Has NimbusPost raise the pickup with the courier as part of booking. Off by default — in the code’s words, scheduling a van is a decision about somebody’s afternoon.
DefaultWeightGrams
Default weight (grams)
— No Per unit, for a parcel the engine could not weigh. 500 g when unset.
DefaultLengthCM, DefaultBreadthCM, DefaultHeightCM — No The box used for any parcel of more than one unit, where the engine has no single size. 15 × 15 × 10 cm when unset. Go only.
BaseURL
API base URL
— No Overrides https://api.nimbuspost.com/v1, for tests. Empty for production.
Client — No Replaces the HTTP client, which otherwise times out after 30 seconds. Go only; not in the panel.

The module reads its Config struct, not the environment. The variable names are the ones the package’s own example or the reference binary uses; in your own main() you choose where each value comes from. Where a setting has a panel label, the admin’s settings drawer can hold it too, and a value typed there wins over Config.

Setting it up

  1. Register the warehouseIn NimbusPost, register the pickup warehouse and note its name exactly, along with the account login the module will use.
  2. Install the moduleImport it and pass nimbuspost.New to gocommerce.New, as below — or run the reference binary with -carriers, which installs every carrier module idle.
  3. Configure itEmail, password and warehouse name, in Config or under Settings › Shipping providers. Decide whether booking should also raise the pickup.
  4. Ship an orderChoose NimbusPost in the admin’s ship dialog, or POST /api/admin/create-fulfillment with "provider": "nimbuspost". The courier’s waybill becomes the tracking number.

main.go

import (
	"os"

	"github.com/itswadesh/gocommerce/core"
	nimbuspost "github.com/itswadesh/gocommerce/ext/fulfill-nimbuspost"
)

app, err := gocommerce.New(cfg,
	nimbuspost.New(nimbuspost.Config{
		Email:         os.Getenv("NIMBUSPOST_EMAIL"),
		Password:      os.Getenv("NIMBUSPOST_PASSWORD"),
		WarehouseName: "Primary",
	}),
)

The package doc’s own example, with its imports; cfg is your gocommerce.Config. With an empty nimbuspost.Config the module installs idle and waits for the panel. Import path github.com/itswadesh/gocommerce/ext/fulfill-nimbuspost.

How it works

What it does not do

Read these before an order depends on it. No store is known to run GoCommerce in production yet, so these come from the code, not from anyone’s experience.

FAQ

Questions about the NimbusPost module

Which courier carries the parcel?

Whichever NimbusPost assigns, unless a courier_id in the request’s meta asks for one. The module reads the courier’s name from the response and records it as the carrier, so the tracking number is that courier’s.

Does it book the pickup too?

Only if you ask. AutoPickup, off by default, has NimbusPost raise the pickup request with the courier as part of booking.

Does it return a label?

When NimbusPost sends one. The label URL in the booking response is stored on the shipment, next to the waybill.

Does the order update when the parcel is delivered?

No. The module books and returns; it has no webhook and polls nothing. Mark the order delivered from the admin or with POST /api/admin/orders/{id}/deliver.

Is NimbusPost a partner?

No. The module calls NimbusPost’s API with a login you supply. NimbusPost does not endorse GoCommerce, and no store is known to run this module in production yet.

Source

Everything on this page is read from ext/fulfill-nimbuspost in the GoCommerce repository, MIT licensed. When this page and the code disagree, the code is right and this page is out of date.NimbusPost is a trademark of its owner; this module talks to its public API and implies no endorsement. See trademarks.

Try it against a store of your own

The one-command stack gives you GoCommerce’s API and admin on your own machine in minutes. Add this module to it and try it on test orders before a real one depends on it.

Chat on WhatsApp