> For the complete documentation index, see [llms.txt](https://docs.pyck.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pyck.cloud/graphql-api/mutations/deletepickingorder.md).

# Delete Picking Order

deletePickingOrder Mutation

Deletes an existing picking order from the system. This operation also removes all associated order items and may trigger cleanup workflows.

## Arguments

| Name | Type  | Description                                |
| ---- | ----- | ------------------------------------------ |
| `id` | `ID!` | Required ID of the picking order to delete |

## Return Type

`PickingOrderDeletePayload!` - Contains information about the deletion operation and associated workflows.

## Response Fields

`PickingOrderDeletePayload`:

| Field       | Type                 | Description                             |
| ----------- | -------------------- | --------------------------------------- |
| `deletedID` | `ID`                 | ID of the deleted picking order         |
| `workflows` | `[TemporalWorkflow]` | Any workflows triggered by the deletion |

## Usage Example

```graphql
mutation {
  deletePickingOrder(id: "550e8400-e29b-41d4-a716-446655440000") {
    deletedID
    workflows {
      id
      type
      id
      runID
      status
    }
  }
}
```

## JavaScript Example

```javascript
const deletePickingOrderMutation = `
  mutation DeletePickingOrder($id: ID!) {
    deletePickingOrder(id: $id) {
      deletedID
      workflows {
        id
        type
        id
        runID
        status
      }
    }
  }
`;

const variables = {
  id: "550e8400-e29b-41d4-a716-446655440000"
};

// Using fetch or your preferred GraphQL client
const response = await fetch('/graphql', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_TOKEN'
  },
  body: JSON.stringify({
    query: deletePickingOrderMutation,
    variables: variables
  })
});

const result = await response.json();
console.log('Deleted picking order:', result.data.deletePickingOrder);
```

## Bulk Deletion Example

You can also delete multiple picking orders by calling the mutation multiple times:

```javascript
const pickingOrderIds = [
  "550e8400-e29b-41d4-a716-446655440000",
  "123e4567-e89b-12d3-a456-426614174000",
  "987fcdeb-51d2-12d3-a456-426614174000"
];

const deleteResults = await Promise.all(
  pickingOrderIds.map(async (id) => {
    const response = await fetch('/graphql', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'Authorization': 'Bearer YOUR_TOKEN'
      },
      body: JSON.stringify({
        query: deletePickingOrderMutation,
        variables: { id }
      })
    });
    
    const result = await response.json();
    return result.data.deletePickingOrder;
  })
);

console.log('Bulk deletion results:', deleteResults);
```

## Notes

* The picking order must exist and be accessible to the current user
* This operation is **irreversible** - deleted picking orders cannot be recovered
* All associated picking order items will be automatically deleted
* Active workflows may be cancelled or trigger cleanup processes
* The deletion may fail if the picking order is in a protected state (e.g., currently being processed)
* Consider the impact on related inventory movements and reservations
* Audit logs will record the deletion for compliance purposes
* Users must have appropriate permissions to delete picking orders


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.pyck.cloud/graphql-api/mutations/deletepickingorder.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
