> For the complete documentation index, see [llms.txt](https://api-reference.arta.io/llms.txt)

# Cancel a Self-Ship Shipment

> PATCH /shipments/{shipment_id}/cancel
> 
> **Availability: Public Preview**
> 
> _This endpoint is currently in public preview and available only to approved accounts._ _Please contact Arta to request access for your organization._
> 
> Cancel a self-ship shipment. The shipment's `status` becomes `cancelled` immediately and the updated shipment is returned. Cancelling cannot be undone; to ship the items later, book a new shipment.
> 
> Only shipments with a `quote_type` of `self_ship` and a `status` of `pending` or `confirmed` can be cancelled. Any other shipment returns a `422`.
> 
> **What cancelling means for the shipment:**
> 
> * **Labels:** the shipment's shipping labels are no longer valid. Do not use them. A package shipped on a cancelled label is billed to your account.
> * **Shipping protection:** coverage for the shipment ends when it is cancelled.
> * **Refunds:** if the shipment was paid for, the payment is refunded to the original payment method, minus the payment processing fee. If a buyer paid through a hosted session, the refund goes to the buyer's payment method.
> 
> While a payment for the shipment is still processing, the shipment cannot be cancelled and the request returns a `422`. Retry once the payment clears.
> 
> A successful cancel sends a `shipment.status.updated` webhook to your configured endpoints, like any other status change.



## Servers
- https://api.arta.io: https://api.arta.io



## Parameters
### Headers

- **Authorization** (string)
  Authorize your API calls with an Arta API token


### Path parameters

- **shipment_id** (string)
  shipment_id parameter




## Responses
### 200
The cancelled shipment
#### Headers

- **content-type** (string)

- **x-arta-request-id** (string)
  A unique identifier for the Arta API call


#### Body: application/json (object)
- **schedule** (object)
  The schedule for the shipment

- **insurance_policy** (object | null)

- **customs_end_use** (string | null)
  The intended end use of the items being shipped for customs purposes

- **origin** (object)

- **in_transit_at** (string(date-time) | null)
  A NaiveDatetime-formatted timestamp describing when the shipment transitioned to the in_transit status with microsecond precision. Returns null if the shipment has not entered transit

- **eei_form_url** (string | null)
  The URL for an associated electronic export information form required for customs clearance. Returns null if the shipment does not have an associated EEI Form

- **quote_type** (string)
  The ID of the quote type associated with this shipment

- **eei_form_status** (string | null)
  The status of an associated electronic export information document required for customs clearance. Returns null if the shipment does not have an associated EEI Form

- **payment_process** (string)
  The primary method by which payment to Arta will be handled for any shipment booked through this hosted session

- **internal_reference** (string | null)
  This field can be used to pass through any character data that you may want returned unaltered for your own later usage

- **packages** (array[object])

- **status** (string)
  The status for this shipment

- **updated_at** (string(date-time))
  A NaiveDatetime-formatted timestamp describing when the resource was last updated with microsecond precision

- **customs_process** (string | null)
  The customs process for the shipment. "ddu" (Delivery Duties Unpaid) means the receiver is responsible for paying duties and taxes. "ddp" (Delivery Duties Paid) means the sender prepays duties and taxes. "ddp_optional" means the receiver will decide whether to pay estimated duties, fees, and taxes prior to fulfillment

- **id** (string(uuid))
  The id of the shipment in UUID format

- **destination** (object)

- **log_request_id** (string | null)
  A string identifying the API request that created the shipment. This `log_request_id` may be used to find the Log associated with the source API request

- **tracking** (array[object])
  A list of tracking details for the packages in a shipment

- **total_currency** (string)
  ISO 4217 three-letter alphabetic currency code. Options are defined in the Currencies metadata endpoint

- **shipping_notes** (string | null)
  Any additional unstructured notes to Arta about the shipment

- **collected_at** (string(date-time) | null)
  A NaiveDatetime-formatted timestamp describing when the shipment transitioned to the collected status with microsecond precision. Returns null if the shipment has not been collected

- **emissions_unit** (string | null)
  The unit of measurement for emissions for this shipment. Typically measured in "kg_co2e" or "kilograms of carbon dioxide equivalent"

- **object_count** (integer(int64))
  The count of objects included in the shipment

- **tags** (array[object])
  A list of tags associated with the shipment

- **url** (string)
  The track URL for this shipment on the Arta web platform

- **exceptions** (array[object])
  Shipment exceptions provide context about holds, delays, and other circumstances that may interrupt a shipment's fulfillment

- **confirmed_at** (string(date-time) | null)
  A NaiveDatetime-formatted timestamp describing when the shipment transitioned to the confirmed status with microsecond precision. Returns null if the shipment has not been confirmed

- **emissions** (string | null)
  The estimated CO2 emissions for the shipment

- **package_count** (integer(int64))
  The count of packages included in the shipment

- **cancelled_at** (string(date-time) | null)
  A NaiveDatetime-formatted timestamp describing when the shipment transitioned to the cancelled status with microsecond precision. Returns null if the shipment has not been cancelled

- **completed_at** (string(date-time) | null)
  A NaiveDatetime-formatted timestamp describing when the shipment transitioned to the completed status with microsecond precision. Returns null if the shipment has not been completed

- **total** (string)

- **services** (array[object])
  A list of services included in the shipment

- **shortcode** (string)
  A brief identifier for this shipment

- **public_reference** (string | null)
  A client defined name for the resource. The value provided for the public_reference field may appear in notification emails and public web pages

- **hosted_session_id** (integer | null)
  The ID of the HostedSession through which this shipment was created

- **created_at** (string(date-time))
  A NaiveDatetime-formatted timestamp describing when the resource was created with microsecond precision


### 403
Forbidden

### 404
Not Found
#### Headers

- **content-type** (string)

- **x-arta-request-id** (string)
  A unique identifier for the Arta API call


#### Body: application/json (object)
- **errors** (object)


### 422
The shipment cannot be cancelled. The reason is returned under `#`.
#### Headers

- **content-type** (string)

- **x-arta-request-id** (string)
  A unique identifier for the Arta API call


#### Body: application/json (object)
- **errors** (object)
  Human-readable messages keyed by `#`, the root of the request. One of: `Only self-ship shipments in pending or confirmed status can be cancelled.` or `A payment for this shipment is still processing. The shipment can be cancelled once it clears.`



[Powered by Bump.sh](https://bump.sh)
