> For the complete documentation index, see [llms.txt](https://docs.parcellab.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.parcellab.com/docs/developers/v2/returns/rma-actions-api/cancel-pickup-order-api.md).

# Cancel Pickup Order API

Production endpoint URL:

```
https://returns-api.parcellab.com/prod/cancelPickUpOrder
```

For details on access, view the overview here:

{% content-ref url="/pages/ECzngWMawj0hRD9NBSDr" %}
[RMA Actions API](/docs/developers/v2/returns/rma-actions-api.md)
{% endcontent-ref %}

### What This Endpoint Achieves

When successful, the API cancels pickup with the courier and rolls the return back to a pre-submission state.

Main effects:

* Cancels scheduled pickup(s)
* Resets return status to `created`
* Sets `submitted` to `false`
* Clears `submittedAt`
* Clears `returnLabel`
* Resets article return flags for re-submission flow

### Request

#### Headers

<table><thead><tr><th width="135">Header</th><th width="129">Required</th><th>Type</th></tr></thead><tbody><tr><td><code>user</code></td><td>yes</td><td>string</td></tr></tbody></table>

#### Query Parameters

<table><thead><tr><th width="129">Parameter</th><th width="112">Required</th><th width="112">Type</th><th>Notes</th></tr></thead><tbody><tr><td><code>returnId</code></td><td>yes</td><td>string</td><td>24-character return ID.</td></tr><tr><td><code>lang</code></td><td>yes</td><td>string</td><td>Language context.</td></tr><tr><td><code>country</code></td><td>yes</td><td>string</td><td>Country/market context.</td></tr><tr><td><code>draft</code></td><td>no</td><td>string</td><td>Set to <code>true</code> for draft config.</td></tr></tbody></table>

#### Body

No request body is required.

### Example Request

```bash
curl \
  -X POST "https://returns-api.parcellab.com/prod/cancelPickUpOrder?returnId=af0000000000000000000001&lang=en&country=us" \
  -H "user: 1612198"
```

### Success Response (`200 OK`)

```json
{
  "returnId": "af0000000000000000000001",
  "status": true
}
```

<table><thead><tr><th width="127.5">Field</th><th width="139">Type</th><th>Meaning</th></tr></thead><tbody><tr><td><code>returnId</code></td><td>string</td><td>Return ID affected.</td></tr><tr><td><code>status</code></td><td>boolean</td><td><code>true</code> when cancellation + state reset succeeded.</td></tr></tbody></table>

### Notes

* If pickup was never scheduled (or no cancellable change can be applied), the request may fail with a business error.
* Depending on merchant configuration, an external RMA cancellation export may also be triggered.

### Error Responses

<table><thead><tr><th width="108.5">Status</th><th>Error value</th><th>Meaning</th></tr></thead><tbody><tr><td><code>400</code></td><td><code>Payload schema validation failed.</code></td><td>Missing/invalid request input.</td></tr><tr><td><code>400</code></td><td><code>RMA cancel failed.</code></td><td>External RMA cancellation export failed.</td></tr><tr><td><code>400</code></td><td><code>Pickup order could not be cancelled.</code></td><td>Courier pickup cancellation failed.</td></tr><tr><td><code>400</code></td><td><code>No modifiers to update is set</code></td><td>No state change could be applied.</td></tr><tr><td><code>400</code></td><td><code>Update return failed.</code></td><td>Return update persistence failed.</td></tr><tr><td><code>403</code></td><td><code>FORBIDDEN</code></td><td><code>returnId</code> is not accessible in caller context.</td></tr><tr><td><code>404</code></td><td><code>User not found.</code></td><td>Merchant context not found.</td></tr><tr><td><code>404</code></td><td><code>Order does not exist.</code></td><td><code>returnId</code> not found.</td></tr><tr><td><code>500</code></td><td>implementation-defined</td><td>Unexpected server error.</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.parcellab.com/docs/developers/v2/returns/rma-actions-api/cancel-pickup-order-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
