---
title: "Cancel a shipment by order number"
method: PUT
path: "/v1/shipper/shipment/{orderNumber}/cancel"
tags: ["Shipper API"]
---

# Cancel a shipment by order number

`PUT /v1/shipper/shipment/{orderNumber}/cancel`

## Request

- Base URL: `https://api.oway.io`
- URL: `https://api.oway.io/v1/shipper/shipment/{orderNumber}/cancel`
- Auth: HTTP bearer and API key in header `x-oway-api-key`

Cancels an existing shipment using its order number (PRO number). Shipments can only be cancelled when they are in a cancellable state (e.g., before pickup).

## Path parameters

- `orderNumber` string, required

## Response `200`

Shipment cancelled successfully

- Shipment: Shipment/Order details
  - `id` string: Unique identifier for the order
  - `companyId` string: Company ID that owns this order
  - `userId` string: User ID who created this order
  - `orderNumber` string: Human-readable PRO number for the shipment (5-character alphanumeric)
  - `orderStatus` 'INITIALIZED' | 'CONFIRMED' | 'ACCEPTED' | 'ASSIGNED' | 'PICKED_UP' | 'IN_TRANSIT' | 'DELIVERED' | 'CANCELLED' | 'REJECTED': Current status of the order
  - `totalPriceInCents` integer: Total price of the order in cents (USD)
  - `createdAt` string, date-time: Time when the order was created (ISO 8601 format)
  - `updatedAt` string, date-time: Time when the order was last updated (ISO 8601 format)

## Other responses

- `400`: Invalid request: orderNumber is required, or order cannot be cancelled in its current state
- `401`: Unauthorized: missing or invalid Bearer token (authentication failed)
- `403`: Forbidden: missing/invalid API key, or shipment does not belong to your company
- `404`: Shipment not found
- `500`: Internal server error

---

[API](https://skmtc.dev/shipoway/apis/oway-shipper-api.md) - [All operations](https://skmtc.dev/shipoway/apis/oway-shipper-api/llms.txt) - [OpenAPI document](https://skmtc.dev/shipoway/apis/oway-shipper-api/revisions/35141ac5fb57?raw)
