Send pictures to Maersk AEMS (API)
AEMS (Automated Estimate Management System) is Maersk’s maintenance-order platform. In ConPDS Checker, an EDI destination whose protocol is API sends case pictures into AEMS by:
- Finding the right maintenance order for the container (equipment).
- Uploading image files to Maersk’s blob service.
- Updating the maintenance order JSON so those files appear as attached images (same rules as the legacy DepotMaster integration).
This page is the user-facing workflow. For implementation references (source files, tests), see the companion file in the main repository: docs/workflows/aems-api-picture-send.md.
What you configure (administrator)
Administrators define an EDI destination with:
| Field | Used for AEMS as |
|---|---|
| Protocol | API |
| Sender | Maersk shop code (sent as maintenanceShopCodes) |
| Username | OAuth client id |
| Password | OAuth client secret |
| Params | See below (PARAMS text, one KEY=value per line) |
Params (PARAMS)
| Key | Meaning |
|---|---|
TEST_MODE=1 | Use Maersk stage hosts (api-stage.maersk.com). Omit or 0 for production. |
MAERSK_MODE | Repair mode filter sent to AEMS as maintenanceRepairModes (see repair mode codes). Use (all) to not filter by mode (ConPDS omits the parameter). |
ORDER_STATUS | Numeric maintenance order status type sent as maintenanceOrderStatusTypes when listing orders. Default in software is 200 if omitted. This controls which orders are returned for the container (for example open / pending work — exact meaning is defined by Maersk for your shop). |
DRY_RUN=1 | Preview only: real sign-in and order lookup, but no picture upload and no order update. Useful for validating credentials and filters. |
SEND_DELAY | Minutes to wait before the worker runs (same as other EDI destinations). |
Each request sends one MAERSK_MODE value. If you routinely send box vs reefer with different codes, configure separate destinations (e.g. “AEMS Box”, “AEMS Reefer”) with the appropriate MAERSK_MODE on each.
MAERSK_MODE repair mode codes
These codes are passed through to Maersk as the maintenance repair mode filter (MAERSK_MODE in PARAMS). Use the value that matches how the estimate is registered in AEMS for your operation.
Dry container (“box”) — common codes
MAERSK_MODE | Equipment / context |
|---|---|
02 | Box (dry) |
03 | Box (dry) |
04 | Box (dry) |
05 | Box (dry) |
Reefer unit — common codes
MAERSK_MODE | Equipment / context |
|---|---|
26 | Reefer unit |
41 | Reefer unit |
43 | Reefer unit |
45 | Reefer unit |
Set exactly one of these per destination (unless you use (all) to disable the filter).
ORDER_STATUS and several open orders
With the default ORDER_STATUS=200 (or whatever your admin configured), AEMS may return more than one maintenance order for the same container — for example multiple pending estimates that all match the query.
ConPDS does not guess which order to use. The app loads the list and asks you to choose a maintenanceOrderNumber before pictures are uploaded (see Choosing an estimate when several match).
Choosing an estimate when several match
What you do in the Send modal
- Open Send for the case (all pictures or a selection).
- Choose your AEMS / API destination.
- Click Send (or complete any extra fields that destination requires).
The app calls the backend without a pre-selected order id. The backend runs an AEMS preflight job: OAuth token + list maintenance orders for this container, shop, status (ORDER_STATUS), and optional repair mode (MAERSK_MODE).
If exactly one order matches, the client continues automatically with that order.
If more than one order matches, the Send modal shows an extra control:
- Section label: AEMS estimate (uppercase styling in the UI).
- A dropdown (SelectPicker) listing each
maintenanceOrderNumber. - Helper text: “Multiple estimates found for this container. Select which estimate to upload pictures to.”
You pick the right estimate, then press Send again. The second request includes the selected aems_order_id, so uploads go to that maintenance order only.
Wireframe (layout)
+--------------------------------------------------+
| Send To [x] |
| Terminal / Container / Case date … |
| |
| DESTINATION |
| [ AEMS_MY_SHOP v ] |
| |
| AEMS ESTIMATE |
| [ MO-2025-004412 v ] |
| Multiple estimates found for this container. |
| Select which estimate to upload pictures to. |
| |
| [ Send ] [ Cancel ] |
+--------------------------------------------------+
API workflow — how pictures are attached (live send)
After an order is chosen, the worker (Celery) runs the real integration:
Important behavior:
- Capacity: AEMS stores up to 5 images on the order-level
attachedImages, then up to 5 per line onmaintenanceOrderLines[].attachedImages. ConPDS only fills empty slots; it does not replace existing photos. - Video:
.MP4files are skipped for AEMS in the current handler. - Dry run (
DRY_RUN=1): the sequence stops after OAuth + listing orders (and preview data for the modal). NoGETfull order by id for attach planning, no upload, noPUT, noEDI_SENTupdates — see the technical doc for details.
Dry run vs live send (summary)
Dry run (DRY_RUN=1 or env EDI_DRY_RUN=1) | Live send | |
|---|---|---|
| OAuth | Yes | Yes |
| List / resolve orders | Yes | Yes |
| Upload blobs | No | Yes |
| Update maintenance order | No | Yes |
| Mark pictures sent in DB | No | Yes |
| Send log row | Preview path does not enqueue like a normal job; see technical doc | Normal queued / scheduled send + log entry |
Related help topics
- Send workflow — opening the Send modal and destinations
- Send log — outcomes and retries
- EDI destinations — protocols overview
Glossary
| Term | Meaning |
|---|---|
| maintenanceOrderNumber | The AEMS estimate / maintenance order id you select in the UI. |
| Preflight | Background step that lists matching orders when you have not yet chosen an order. |
| Hot / live send | Normal send: upload + order update. |