Shipments
Cancel Shipment
Cancel a shipment order
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",
"contents": "Medizinisch freigestellte Probe",
"booked_by": "aniva",
"paired_with": null,
"origin": {
"name": "Aniva Berlin Mitte",
"company_name": null,
"street": "Unter den Linden",
"house_number": "42",
"address_line_2": null,
"postal_code": "10117",
"city": "Berlin",
"state": null,
"country_code": "DE",
"phone": "+4930987654321",
"email": "berlin-mitte@anivahealth.com"
},
"destination": {
"name": "LabClinic GmbH",
"company_name": null,
"street": "Laborstraße",
"house_number": "10",
"address_line_2": null,
"postal_code": "80331",
"city": "München",
"state": null,
"country_code": "DE",
"phone": null,
"email": null
},
"pickup": {
"from": "2026-04-15T07:00:00Z",
"till": "2026-04-15T10:00:00Z",
"timezone": "Europe/Berlin"
},
"notes": null,
"status_updates": [],
"appointments": [],
"home_kit_orders": [],
"synced_at": "2026-04-03T15:00:00Z",
"created_at": "2026-04-03T14:30:00Z",
"updated_at": "2026-04-03T16:45:00Z"
}
{
"error": "Shipment cannot be cancelled after pickup"
}
{
"error": "Shipment K260904P3XD is the return label of K2609041FQ7. DHL cannot cancel a return label on its own. Cancel the outbound parcel while it is pending. After the outbound parcel ships, the label stays valid and Aniva closes this shipment manually."
}
{
"error": "Access denied: only Aniva can change this parcel."
}
{
"error": "Shipment not found"
}
{
"error": "Logistics provider error: The cancellation notice period has already been exceeded. Cancellation is no longer possible via the web service. Please contact the GO! station.",
"logistics_error_code": 4006
}
Cancel a shipment order. This calls the logistics provider API to cancel the order and updates the shipment status to
A DHL return label cannot be cancelled on its own; that also returns
cancelled.
Cancelling a shipment that is already cancelled returns 200 with that shipment, and the provider is called only once. The response carries Idempotent-Replayed: true so you can tell a repeat from the call that did the work. See Idempotency.
Shipments cannot be cancelled after pickup — that returns
409 Conflict.409 Conflict. Cancel the
outbound parcel instead. Cancelling an outbound DHL parcel also cancels its pending return-leg
rows. Each one becomes cancelled with a RETURN_LEG_CANCELLED entry in status_updates. See
Return labels.
In a box with several kits, each kit has its own outbound row and its own return label, even
when the box travels on one kit’s label. Cancelling a kit’s outbound row also cancels that kit’s
return label.
To cancel a home-kit parcel, every linked home-kit order must be in your access context.
Otherwise the call returns 403. See Access.
Request
Path parameters
string
required
Shipment reference ID (e.g.,
P2604154821).Response
On success, the API returns200 OK with the cancelled shipment object.
string
required
Shipment reference identifier.
string
required
Shipment lifecycle status. Will be
cancelled after a successful cancellation.string
required
Logistics provider. One of
go, dhl_parcel, dhl_warenpost, tof, rotrunner, rapido or
ups. A home-kit parcel is dhl_parcel, or dhl_warenpost when it goes abroad as Warenpost
International.string
External tracking number from the logistics provider. May be
null.string
Free-text description of what is in the parcel, as given at creation. May be
null.string
required
Who printed the label:
aniva or external. Only aniva shipments accept this call.string
Reference of the other parcel of a two-parcel consignment.
null for a one-way parcel.object
Pickup address. May be
null.Show address object
Show address object
string
required
Recipient, company, or location name.
string
Company / c/o line. May be
null.string
required
Street name, without the house number.
string
House number. May be
null.string
Building, entrance, or floor. May be
null.string
required
City.
string
State or province. May be
null.string
required
Postal/ZIP code.
string
required
ISO 3166-1 alpha-2 country code.
string
Contact phone number. May be
null.string
Contact email. May be
null.object
Delivery address. Same structure as
origin. May be null.object
string
Optional notes. May be
null.object[]
required
Chronological lifecycle events from the logistics provider (oldest first). Each entry has
state, code, detail_code, status, description, location and time. See Get
Shipment for each field. Empty array if no events observed yet.ShipmentAppointmentLink[]
required
Appointments that were linked to this shipment before cancellation. Each entry is
{ id, added_at }; cross-reference each id against
Get Appointment.
Only the appointments in your access context are listed.ShipmentHomeKitOrderLink[]
required
Home-kit orders linked to this shipment, oldest-link first, in the same
{ id, added_at } shape.
Only the orders in your access context are listed. Empty array for practice parcels.string
When the shipment was last reconciled with its carrier, as a UTC instant.
null until the first
sync.string
required
Creation timestamp (ISO 8601).
string
Last update timestamp (ISO 8601). May be
null.Error responses
| Status | Description |
|---|---|
400 | Invalid ID format. |
403 | Forbidden — your API key does not have access to this operation, the shipment is outside your access context, or a linked home-kit order is outside your access context. |
404 | Shipment not found. |
409 | Shipment cannot be cancelled — it has already been picked up or delivered, or it is a DHL return label (cancel the outbound parcel instead). |
501 | The shipment is external — it was not booked through Aniva and cannot be cancelled here. |
500 | Internal server error. |
502 | Logistics 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",
"contents": "Medizinisch freigestellte Probe",
"booked_by": "aniva",
"paired_with": null,
"origin": {
"name": "Aniva Berlin Mitte",
"company_name": null,
"street": "Unter den Linden",
"house_number": "42",
"address_line_2": null,
"postal_code": "10117",
"city": "Berlin",
"state": null,
"country_code": "DE",
"phone": "+4930987654321",
"email": "berlin-mitte@anivahealth.com"
},
"destination": {
"name": "LabClinic GmbH",
"company_name": null,
"street": "Laborstraße",
"house_number": "10",
"address_line_2": null,
"postal_code": "80331",
"city": "München",
"state": null,
"country_code": "DE",
"phone": null,
"email": null
},
"pickup": {
"from": "2026-04-15T07:00:00Z",
"till": "2026-04-15T10:00:00Z",
"timezone": "Europe/Berlin"
},
"notes": null,
"status_updates": [],
"appointments": [],
"home_kit_orders": [],
"synced_at": "2026-04-03T15:00:00Z",
"created_at": "2026-04-03T14:30:00Z",
"updated_at": "2026-04-03T16:45:00Z"
}
{
"error": "Shipment cannot be cancelled after pickup"
}
{
"error": "Shipment K260904P3XD is the return label of K2609041FQ7. DHL cannot cancel a return label on its own. Cancel the outbound parcel while it is pending. After the outbound parcel ships, the label stays valid and Aniva closes this shipment manually."
}
{
"error": "Access denied: only Aniva can change this parcel."
}
{
"error": "Shipment not found"
}
{
"error": "Logistics provider error: The cancellation notice period has already been exceeded. Cancellation is no longer possible via the web service. Please contact the GO! station.",
"logistics_error_code": 4006
}
⌘I
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",
"contents": "Medizinisch freigestellte Probe",
"booked_by": "aniva",
"paired_with": null,
"origin": {
"name": "Aniva Berlin Mitte",
"company_name": null,
"street": "Unter den Linden",
"house_number": "42",
"address_line_2": null,
"postal_code": "10117",
"city": "Berlin",
"state": null,
"country_code": "DE",
"phone": "+4930987654321",
"email": "berlin-mitte@anivahealth.com"
},
"destination": {
"name": "LabClinic GmbH",
"company_name": null,
"street": "Laborstraße",
"house_number": "10",
"address_line_2": null,
"postal_code": "80331",
"city": "München",
"state": null,
"country_code": "DE",
"phone": null,
"email": null
},
"pickup": {
"from": "2026-04-15T07:00:00Z",
"till": "2026-04-15T10:00:00Z",
"timezone": "Europe/Berlin"
},
"notes": null,
"status_updates": [],
"appointments": [],
"home_kit_orders": [],
"synced_at": "2026-04-03T15:00:00Z",
"created_at": "2026-04-03T14:30:00Z",
"updated_at": "2026-04-03T16:45:00Z"
}
{
"error": "Shipment cannot be cancelled after pickup"
}
{
"error": "Shipment K260904P3XD is the return label of K2609041FQ7. DHL cannot cancel a return label on its own. Cancel the outbound parcel while it is pending. After the outbound parcel ships, the label stays valid and Aniva closes this shipment manually."
}
{
"error": "Access denied: only Aniva can change this parcel."
}
{
"error": "Shipment not found"
}
{
"error": "Logistics provider error: The cancellation notice period has already been exceeded. Cancellation is no longer possible via the web service. Please contact the GO! station.",
"logistics_error_code": 4006
}