---
title: "Delete purchase order (not currently operational)"
method: DELETE
path: "/v1/erp/payouts/purchase_orders/{id}"
tags: ["Purchase Order"]
deprecated: true
---

# Delete purchase order (not currently operational)

`DELETE /v1/erp/payouts/purchase_orders/{id}`

## Request

- Base URL: `https://api.cardda.com`
- URL: `https://api.cardda.com/v1/erp/payouts/purchase_orders/{id}`
- Auth: HTTP bearer

> **Deprecated.**

**Not currently operational.** Once the caller is authorized, this endpoint attempts
a soft-delete that the application cannot perform: the purchase order does not support
discarding (there is no `discarded_at` column and no discard behaviour on the model),
so the delete raises server-side and returns **500 Internal Server Error**. There is
no soft-delete or restore capability for purchase orders. Do not rely on this endpoint
until it is fixed.

## Authorization
- Authorization is checked first (Pundit); an unauthorized caller gets a 401 with an
  empty body before the 500 path is reached.

## Path parameters

- `id` string, uuid, required

## Parameters

- `#/paths/~1v1~1erp~1payouts~1rules/get/parameters/0` (unresolved $ref)

## Other responses

- `401`: Unauthorized — invalid/missing authentication token, or the caller is not authorized to delete this purchase order (Pundit policy). **The response body is empty** (Pundit renders nothing); branch on the status code, not the body.
- `404`: Purchase order not found (also returned when the `company-id` header points to a company the caller cannot access, or the id is not scoped to it).
- `500`: Internal Server Error — the delete path is broken (see summary). An authorized delete request reaches this state today because purchase orders cannot be discarded.

---

[API](https://skmtc.dev/cardda/apis/erp-api.md) - [All operations](https://skmtc.dev/cardda/apis/erp-api/llms.txt) - [OpenAPI document](https://skmtc.dev/cardda/apis/erp-api/revisions/0730ed26bc3c?raw)
