Shipping
Veeqo shipment sync for GoCommerce
A Go package that tells Veeqo a parcel went out. It finds the matching Veeqo order and its allocation and records a shipment with your tracking number. It buys no label — on purpose.
- Shipping module
- 6 settings
- 7 tests
- ext/fulfill-veeqo
What it does
The module registers “veeqo” as a fulfillment provider. An operator ships through the engine’s own POST /api/admin/create-fulfillment with the provider veeqo and the tracking number of a parcel that has already gone out.
Veeqo is a warehouse and inventory system, not a carrier, and the package describes the direction the data flows: a store that uses Veeqo already has its orders there, and what Veeqo lacks is the fact that a parcel went out — so this module pushes that fact back. GoCommerce stays the system of record; Veeqo learns what happened, it does not decide it.
It deliberately does not buy the label. Doing so through Veeqo needs a rate quote first, fields copied out of a chosen quote and a carrier fixed to Amazon’s shipping, and the purchase answers with a label URL and a tracking URL but no tracking number — the one thing the engine needs. A store that wants Veeqo to buy labels does it in Veeqo and lets this module record the result.
Configuration
Only the API key is required. Set it in Config from your own main(), or leave Config empty and type it under Settings › Shipping providers.
| Setting | Environment variable | Required | What it does |
|---|---|---|---|
APIKeyAPI key | VEEQO_API_KEY | Yes | A Veeqo API key, sent as the x-api-key header. |
CarrierIDCarrier ID | — | No | Veeqo’s numeric id for the carrier that took the parcel. 3, Veeqo’s “Other”, by default; meta carrier_id overrides it for one parcel. |
NotifyCustomerLet Veeqo email the customer | — | No | Off by default: the engine already notifies on order.shipped, and two emails about one parcel, as the code puts it, is how a shop looks disorganised. |
UpdateRemoteOrderPush the shipment to the sales channel | — | No | Off by default, because this store is that channel — and a round trip back into the engine is the loop nobody wants. |
BaseURLAPI base URL | — | No | Overrides https://api.veeqo.com, 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
- Have the order in VeeqoThe module expects the order to exist in Veeqo already, under the same order number and allocated to a warehouse. How it gets there is outside this module.
- Install the moduleImport it and pass veeqo.New to gocommerce.New, as below — or run the reference binary with -carriers, which installs every carrier module idle.
- Give it the keyIn Config, or under Settings › Shipping providers, with a carrier id if the store always ships with one carrier. A value typed into the panel counts on the next shipment.
- Record the parcelPOST /api/admin/create-fulfillment with the provider veeqo and the tracking number. For an order with several allocations, pass meta allocation_id and order_id together.
main.go
import (
"os"
"github.com/itswadesh/gocommerce/core"
veeqo "github.com/itswadesh/gocommerce/ext/fulfill-veeqo"
)
app, err := gocommerce.New(cfg,
veeqo.New(veeqo.Config{APIKey: os.Getenv("VEEQO_API_KEY")}),
) The package doc’s own example, with its imports; cfg is your gocommerce.Config. With an empty veeqo.Config the module installs idle and waits for the panel. Import path github.com/itswadesh/gocommerce/ext/fulfill-veeqo.
How it works
-
A tracking number is required
The module records a parcel that has gone out, so a ship request without a tracking number is refused rather than sent to Veeqo empty.
-
Found by exact number
Without meta, it searches Veeqo for the order number. Veeqo’s search is fuzzy — GC-100 also finds GC-1001 — so only an exact match counts.
-
Refuses rather than guesses
No match, several matches, no allocation, or several allocations each give a specific error saying what to pass. A parcel is never recorded against a warehouse the module picked by chance.
-
The operator’s number wins
The tracking number stored is the one the operator gave, not Veeqo’s echo of it: if the two ever differ, what actually went out is the truth.
-
Carrier from Veeqo’s name
The carrier code is read from what Veeqo calls the carrier, then from the ship request’s own carrier, so a store that set a real carrier id gets a tracking link.
-
No double emails, no loop
Veeqo’s own customer email and its push to the sales channel are both off unless switched on, so one parcel means one message and no round trip.
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.
- Does not create Veeqo ordersNothing here sends a GoCommerce order to Veeqo. If the order is not already in Veeqo under the same number, the shipment is refused.
- Buys no labelThe label is bought somewhere else — in Veeqo, or with another carrier module — and this module records the result.
- Pass both ids, or neitherMeta allocation_id is used directly only when order_id comes with it. Passed alone, the module still searches, and an order with several allocations is then refused.
- Nothing flows backStock levels, cancellations and delivery events stay in Veeqo; the module writes to Veeqo and reads nothing into GoCommerce but the carrier’s name.
- One page of search resultsThe search reads 25 results. An order number that fuzzily matches more orders than that may be missed — pass the ids instead.
FAQ
Questions about the Veeqo module
Does Veeqo get the order from GoCommerce?
Not through this module. It assumes Veeqo already holds the order under the same number, as it would for a sales channel Veeqo pulls from, and only tells Veeqo that the parcel went out.
What if the order has several allocations?
The module refuses to guess which warehouse sent the parcel. Pass meta allocation_id and order_id together on the ship request, and it records the shipment against exactly those.
Can I use it without writing Go?
Yes. The reference binary’s -carriers flag installs every carrier module with an empty Config. Switch Veeqo on under Settings › Shipping providers and paste the API key there.
Is this a Veeqo partnership?
No. The module calls Veeqo’s public API with a key you supply. Veeqo 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-veeqo in the GoCommerce repository, MIT licensed. When this page and the code disagree, the code is right and this page is out of date.Veeqo 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.