Skip to content

Powered by Grav CMS + Helios Theme

Shipping carriers (add-on)

The carrier aggregator, its connection check and tracking webhook, and the carrier accounts behind it.

Provided by the KahunaCart Shipping plugin. Setup takes kahunacart.shipping.manage. No key or secret is ever returned: a read says whether one has been pasted. See Carriers and services.

List the carrier aggregators

GET /api/v1/kahunacart/shipping/aggregators Permission kahunacart.shipping.manage

The carrier aggregator this store is configured for, with its capability matrix, whether a key has been pasted, and when the carrier list was last refreshed.

Check the aggregator connection

POST /api/v1/kahunacart/shipping/aggregators/{code}/check Permission kahunacart.shipping.manage

Make a real call to the aggregator with the configured key and report whether it works, which account it reached and how many carrier accounts that account holds. A live key in the test field is refused before any call is made.

Parameters

Name Type Description
code required string The aggregator's code, one of `shippo`, `easypost`, `shipengine`, `sendcloud` or `demo`.

Read the tracking webhook setup

GET /api/v1/kahunacart/shipping/aggregators/webhook Permission kahunacart.shipping.manage

The inbound tracking webhook as this store has it: whether a secret is set, the public address it makes with the secret masked to its last four characters, whether the configured driver can register that address itself, and the last few deliveries the endpoint received.

Generate a tracking webhook secret

POST /api/v1/kahunacart/shipping/aggregators/webhook/secret Permission kahunacart.shipping.manage

Generate the tracking webhook's secret and save it. The secret is the random part of the inbound address, so generating a new one changes the address and the old one stops working straight away — register the webhook again afterwards.

Register the tracking webhook

POST /api/v1/kahunacart/shipping/aggregators/webhook/register Permission kahunacart.shipping.manage

Register this store's inbound tracking address with the aggregator. An existing webhook pointing at this store is adopted rather than joined by a second one. Needs a webhook secret and a publicly reachable https address.

Parameters

Name Type Description
reset optional boolean Replace what is registered rather than adopting it, for a store that has moved or rotated its secret.

List carrier accounts

GET /api/v1/kahunacart/shipping/accounts Permission kahunacart.shipping.manage

The carrier accounts this store holds at its aggregator — USPS, UPS, FedEx, Royal Mail, DPD and so on — with the services each one offers and whether this store offers it.

Refresh the carrier accounts

POST /api/v1/kahunacart/shipping/accounts Permission kahunacart.shipping.manage

Read the carrier list from the aggregator again and store it, so a carrier switched on at the aggregator this morning is bindable here this afternoon. The store's own on/off switches are kept.

Switch a carrier on or off

PATCH /api/v1/kahunacart/shipping/accounts/{id} Permission kahunacart.shipping.manage

Switch a carrier on or off for this store. Nothing else on a carrier account can be changed here — the account itself belongs to the aggregator.

Parameters

Name Type Description
id required integer The carrier account's id.
enabled required boolean Whether this store offers this carrier.