> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Send a purchase-order change acknowledgment (865)

> Build and dispatch an X12 865 change acknowledgment. Save a partner-approved payload with at least one line as po-change-ack.json…

Build and dispatch an X12 865 change acknowledgment. Save a partner-approved payload with at least one line as po-change-ack.json. The successful response is wire-ready X12, not JSON; inspect delivery and partner acknowledgments separately.

### Path parameters

**partner\_id** `string` *required*

Partner ID

### Headers

**Idempotency-Key** `string,null`

Stable unique request key (1–128 ASCII letters/digits or -\_.:). Requires Postgres. Retries return the original EDI bytes; changed JSON payload returns 409.

### Request body

`Ack865`

**ack\_date** `string (date)` *required*

**ack\_type** `string`

BCA02 acknowledgment type: AC accept, AD accept with detail, AK acknowledge no detail, RJ reject.

**lines** `ChangeAckLine[]` *required*

**ChangeAckLine**

**change\_type** `string`

POC02 change/response type: CA changes, QD quantity decrease, QI quantity increase, DI delete item, AI add item, NC no change.

**ids** `ProductId[]`

**ProductId**

**qualifier** `string` *required*

**value** `string` *required*

**line\_number** `string` *required*

**quantity** `string` *required*

POC03 — quantity ordered after the change.

**status** `string`

ACK01 line status: IA accepted, IB backordered, IQ quantity changed, IR rejected.

**status\_quantity** `string,null`

ACK02 — quantity the status applies to; defaults to the line quantity.

**unit\_price** `string,null`

**uom** `string`

**po\_date** `string,null (date)`

BCA06 — original PO date.

**po\_number** `string` *required*

BCA03 — the changed PO being acknowledged.

### Response

Returns `application/edi-x12` — Wire-ready X12 865 interchange.

### Status codes

| Code | Meaning |
| - | - |
| `200` | Wire-ready X12 865 interchange |
| `403` | Not this credential's partner |
| `409` | Idempotency-Key reused with a different payload |
| `422` | Invalid payload or delimiter collision |

### Using this contract

Read the [source OpenAPI document](https://docs.stateset.com/spec/edi.json) for declared schemas and alternatives.
This page also includes documented corrections from the [spec overlays](https://github.com/stateset/docs/tree/main/spec/overlays).
Example IDs and values are illustrative; replace them with records from your workspace.

```bash cURL theme={null}
curl --silent --show-error --fail-with-body --request POST \
  --url 'https://api.edi.stateset.com/v1/edi/outbound/865/{partner_id}' \
  --header "Authorization: Bearer $EDI_API_TOKEN" \
  --header "Idempotency-Key: ${IDEMPOTENCY_KEY:?Set a unique key for this operation; preserve it on retries}" \
  --header 'Content-Type: application/json' \
  --data @po-change-ack.json
```

```json 200 theme={null}
"string"
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.