Skip to main content
DELETE
/
api
/
v1
/
shipments
/
{id}
curl --request DELETE \
  --url https://anivahealth.com/api/v1/shipments/P2604154821 \
  --header 'x-api-key: YOUR_API_KEY'
{
  "id": "P2604154821",
  "status": "cancelled",
  "logistics_provider": "go",
  "tracking_number": "GO1234567890",
  "origin": {
    "location_id": "8f3a1b2c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
    "name": "Aniva Berlin Mitte",
    "street": "Unter den Linden",
    "house_number": "42",
    "postal_code": "10117",
    "city": "Berlin",
    "country": "DE",
    "phone": "+4930987654321",
    "email": "berlin-mitte@anivahealth.com"
  },
  "destination": {
    "location_id": null,
    "name": "LabClinic GmbH",
    "street": "Laborstraße",
    "house_number": "10",
    "postal_code": "80331",
    "city": "München",
    "country": "DE",
    "phone": null,
    "email": null
  },
  "pickup": {
    "from": "2026-04-15T09:00:00+02:00",
    "till": "2026-04-15T12:00:00+02:00",
    "timezone": "Europe/Berlin"
  },
  "notes": null,
  "status_updates": [],
  "appointments": [],
  "created_at": "2026-04-03T14:30:00Z",
  "updated_at": "2026-04-03T16:45:00Z"
}
Cancel a shipment order. This calls the logistics provider API to cancel the order and updates the shipment status to cancelled.
Shipments cannot be cancelled after pickup. Attempting to cancel a shipment that has already been picked up, delivered, or previously cancelled returns 409 Conflict.

Request

Path parameters

id
string
required
Shipment reference ID (e.g., P2604154821).

Response

On success, the API returns 200 OK with the cancelled shipment object.
id
string
required
Shipment reference identifier.
status
string
required
Shipment lifecycle status. Will be cancelled after a successful cancellation.
logistics_provider
string
required
Logistics provider. One of go, dhl, or tof.
tracking_number
string
External tracking number from the logistics provider. May be null.
origin
object
Pickup address. May be null.
destination
object
Delivery address. Same structure as origin. May be null.
pickup
object
Scheduled pickup window. May be null.
notes
string
Optional notes. May be null.
status_updates
object[]
required
Chronological lifecycle events from the logistics provider (oldest first). Each entry has a status (free-form provider-sourced label) and time (ISO 8601). Empty array if no events observed yet.
appointments
ShipmentAppointmentLink[]
required
Appointments that were linked to this shipment before cancellation. Each entry is { id, added_at }; cross-reference each id against Get Appointment.
created_at
string
required
Creation timestamp (ISO 8601).
updated_at
string
Last update timestamp (ISO 8601). May be null.

Error responses

StatusDescription
403Forbidden — your API key does not have access to this operation or the shipment is outside your access context.
404Shipment not found.
409Shipment cannot be cancelled (already picked up, delivered, or cancelled).
500Internal server error.
502Logistics provider rejected the request (e.g., cancellation deadline exceeded). Includes the provider’s error message.
curl --request DELETE \
  --url https://anivahealth.com/api/v1/shipments/P2604154821 \
  --header 'x-api-key: YOUR_API_KEY'
{
  "id": "P2604154821",
  "status": "cancelled",
  "logistics_provider": "go",
  "tracking_number": "GO1234567890",
  "origin": {
    "location_id": "8f3a1b2c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
    "name": "Aniva Berlin Mitte",
    "street": "Unter den Linden",
    "house_number": "42",
    "postal_code": "10117",
    "city": "Berlin",
    "country": "DE",
    "phone": "+4930987654321",
    "email": "berlin-mitte@anivahealth.com"
  },
  "destination": {
    "location_id": null,
    "name": "LabClinic GmbH",
    "street": "Laborstraße",
    "house_number": "10",
    "postal_code": "80331",
    "city": "München",
    "country": "DE",
    "phone": null,
    "email": null
  },
  "pickup": {
    "from": "2026-04-15T09:00:00+02:00",
    "till": "2026-04-15T12:00:00+02:00",
    "timezone": "Europe/Berlin"
  },
  "notes": null,
  "status_updates": [],
  "appointments": [],
  "created_at": "2026-04-03T14:30:00Z",
  "updated_at": "2026-04-03T16:45:00Z"
}