Lifehack: connecting your own delivery service

Published 21.01.2025 16:30 in Cases

Is your delivery service not on the AlterCPA Moe list? Connect it yourself: the built-in service can send orders, track parcels and print documents through three links to your own handler. There is no need to touch the code of the CRM itself.

What’s the point?

The “Generic” delivery service type was conceived as a stub for couriers you serve manually. But its settings have three fields for links. If your own handler lives behind those links, the stub works as a real integration: orders go to the service, statuses come back, documents get printed. There are no delivery hacks in the free AlterCPA Moe, but three links are quite enough.

Handlers can be written in any language and placed on your own hosting. True, you will have to set them up yourself: you need someone who can accept a request and reply in JSON format.

Three links

Open the delivery settings in the company management and add a service with the “Generic” type. It has three fields:

Macros work in the links: {track} or {code} inserts the tracking code, {order} — the order ID in the CRM, {track:xxx} — the tracking parameter xxx received on sending. For example, a tracking link may look like this: https://your-logistics.example/track?code={track}.

What to enable

The CRM polls parcel statuses by itself, twice a day, and an operator can refresh the history manually from the order page; the order is sent to the service by a button from there as well. Documents are printed for a single order or in bulk. Parcels stuck in one status can be put on the call list with the “Automatic calls planning” block, and the time in it is set in hours.

Important!

The full reply schema and PHP handler examples are in the article “Creating simple logistics service”. Three links on a third-party hosting, and the humble stub suddenly becomes full-fledged logistics.