Draft improvements from assistant conversations: webhook payload + stop tracking clarifications - #291
Merged
Merged
Conversation
…level stop tracking
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| Tracking is stopped at the **shipment level**, not on the tracking request or on an individual container. Use [Stop tracking a shipment](/api-docs/api-reference/shipments/stop-tracking-shipment) (`PATCH /shipments/{id}/stop_tracking`). | ||
|
|
||
| - A tracking request initiates tracking and can create a shipment. Once the shipment exists, the shipment is the resource you manage. | ||
| - There is no `DELETE` or "stop" endpoint on the `tracking_requests` resource. The tracking request `status` reflects the request outcome (`pending`, `created`, `failed`, `tracking_stopped`); the shipment is where active tracking is stopped or resumed. |
There was a problem hiding this comment.
Incomplete status list omits
awaiting_manifest
The parenthetical list of tracking request status values — pending, created, failed, tracking_stopped — is missing awaiting_manifest, which is documented earlier in this same file as a real status value ("The status changes to awaiting_manifest and Terminal49 keeps checking your request daily"). Developers reading the new subsection may treat the list as exhaustive and be surprised when their request transitions to a state they haven't handled.
Prompt To Fix With AI
This is a comment left during a code review.
Path: docs/api-docs/in-depth-guides/tracking-request-lifecycle.mdx
Line: 81
Comment:
**Incomplete status list omits `awaiting_manifest`**
The parenthetical list of tracking request `status` values — `pending`, `created`, `failed`, `tracking_stopped` — is missing `awaiting_manifest`, which is documented earlier in this same file as a real `status` value ("The `status` changes to `awaiting_manifest` and Terminal49 keeps checking your request daily"). Developers reading the new subsection may treat the list as exhaustive and be surprised when their request transitions to a state they haven't handled.
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Close recurring documentation gaps surfaced by recent assistant conversations around webhook payload semantics and where tracking is stopped in the API.
Changes
includedarray (container.transport.available,not_available, the threeestimated.*events, andcontainer.pickup_appointment.changed) and how to resolve container/BOL details via a follow-up API call.timestamp, container number, BOL, voyage number, and location fromincludedrecords.Context
Multiple recent assistant conversations repeatedly asked (a) whether one webhook covers multiple containers on the same vessel, (b) where to find the container number and BOL in
available/not_available/estimated.*/pickup_appointment.changedpayloads, and (c) how to stop tracking at the tracking-request level. The docs implied these answers but did not state them directly.Greptile Summary
This PR adds documentation clarifications in two areas surfaced by recurring assistant conversations: webhook payload semantics and programmatic tracking control. The changes are documentation-only with no code impact.
payloads.mdx): Adds a "One notification per container" section with idempotency guidance, a list of events that ship with a minimalincludedarray (notablycontainer.transport.available,not_available, and the threeestimated.*events), and a quick-reference table for extractingtimestamp, container number, BOL, voyage number, and location fromincludedrecords.tracking-request-lifecycle.mdx): Adds a "Stopping tracking programmatically" subsection clarifying that stop/resume is a shipment-level operation with no per-container or per-tracking-request equivalent, and that stopping a shipment halts tracking for all its containers regardless of how tracking was initiated.Confidence Score: 4/5
Documentation-only change; no runtime impact. The new content is directionally accurate but two clarity issues should be addressed before publishing.
The tracking-request-lifecycle subsection lists tracking request status values as pending, created, failed, tracking_stopped — omitting awaiting_manifest, which is an actual reachable status documented just above. Integrators reading this list as exhaustive would miss a state their code needs to handle.
Both changed files need a second look: tracking-request-lifecycle.mdx for the incomplete status list, and payloads.mdx for the unresolved tension between the reference-object-types table and the new minimal-included section.
Important Files Changed
awaiting_manifeststate documented earlier in the same file, making the list appear exhaustive when it isn't.Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Container-scoped event fires] --> B{Event type} B -->|container.transport.available\ncontainer.transport.not_available\ncontainer.transport.estimated.*\ncontainer.pickup_appointment.changed| C[Minimal included array\nNo shipment/container embedded] B -->|All other container.transport.*\ncontainer.updated, container.created\ntracking_request.*, etc.| D[Full included array\nShipment + container + transport_event] C --> E[Follow reference_object relationship\nGET /containers/:id or GET /shipments/:id] D --> F[Extract fields from included\ntimestamp, number, BOL, voyage, locode] E --> G[Route to correct record\nusing container id or number] F --> G G --> H[Use data.id as idempotency key\nfor deduplication]%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% flowchart TD A[Container-scoped event fires] --> B{Event type} B -->|container.transport.available\ncontainer.transport.not_available\ncontainer.transport.estimated.*\ncontainer.pickup_appointment.changed| C[Minimal included array\nNo shipment/container embedded] B -->|All other container.transport.*\ncontainer.updated, container.created\ntracking_request.*, etc.| D[Full included array\nShipment + container + transport_event] C --> E[Follow reference_object relationship\nGET /containers/:id or GET /shipments/:id] D --> F[Extract fields from included\ntimestamp, number, BOL, voyage, locode] E --> G[Route to correct record\nusing container id or number] F --> G G --> H[Use data.id as idempotency key\nfor deduplication]Comments Outside Diff (1)
docs/api-docs/webhooks/payloads.mdx, line 70-73 (link)The "Reference object types" table states that
container.transport.*events "Includes the transport event, container, shipment, and location records that are available." The new "Events with a minimalincludedarray" subsection listscontainer.transport.availableandcontainer.transport.not_availableas events where container/shipment records are not embedded. The trailing "that are available" qualifier softens the contradiction, but a reader who sees the table first will expect those records to be present and may not reach the caveat. Consider adding a forward-reference note to the table row (e.g., "see exceptions below") or explicitly carving out those two events in the table.Prompt To Fix With AI
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "docs: clarify per-container webhooks, mi..." | Re-trigger Greptile