Finance & ERP

Customer PO number

Writes the order's customer purchase-order number (customer_po), or clears it when empty; whitespace is collapsed, at most 60 characters. On an order already sent to the ERP (sent, open, shipped, invoiced, closed) the answer is 409 — change the number in the ERP. The response is the updated order row (order) and whether it changed (changed). Order rows (orders on company / opportunity records) carry customer_po, product_id (for live stock), status, due_date, amount and the ERP send state (erp: status, label, tone, ext_no, error; null when not sent).

POST/api/v1/orders/{id}/po

Authorization

Authorizationheaderrequired
Bearer token: API key (sk_…), OAuth access token (mcp_…) or mobile session (xk_…).
Scope: crm.write

Path parameters

idintegerrequired
Order id.

Body application/json

customer_postringoptional
The customer's PO number; empty = clear.

Errors

HTTPerrorMeaning
409erpThe ERP operation failed (`message`: no order connection, account not matched, item has no ERP code…).
403forbiddenYou may not see / edit this record.
404not_foundRecord not found.
Request
curl -X POST https://ornek.solk.app/api/v1/orders/16/po \
  -H "Authorization: Bearer $SOLK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "customer_po": "PO-7790"
}'
Response
{
  "changed": true,
  "ok": true,
  "order": {
    "amount": 24720.0,
    "currency": "EUR",
    "customer_id": 9,
    "customer_po": "PO-7790",
    "date": "2026-09-23",
    "due_date": null,
    "erp": null,
    "id": 16,
    "kg": 4000.0,
    "kind": "Yeni Sipariş",
    "note": "",
    "opp_id": 52,
    "payment_days": 90,
    "price": 6.18,
    "product": "HS 30 Isıl Yapışma Laki",
    "product_id": 5,
    "pu": "€/kg",
    "status": "Kapandı",
    "unit": "kg"
  }
}

Example responses were captured from a v58 installation running sample data; lists are shortened to two items.