Finance & ERP
Send order to ERP
Sends the CRM order to the main order connection as a sales order: the customer's PO number (customer_po), ERP account code, item code, quantity, price, currency, due date. If the company is missing in the ERP and Create new account is on, the account is created first. The response is the send state (status: sent, open…; queued on a Solk ERP API connection — the middleware picks it up) and the ERP document number (ext_no). An order is not sent twice; a failed one is retried.
Authorization
AuthorizationheaderrequiredBearer token: API key (sk_…), OAuth access token (mcp_…) or mobile session (xk_…).
Scope:
crm.writePath parameters
idintegerrequiredOrder id.
Errors
| HTTP | error | Meaning |
|---|---|---|
400 | erp | The ERP operation failed (`message`: no order connection, account not matched, item has no ERP code…). |
403 | forbidden | You may not see / edit this record. |
404 | not_found | Record not found. |
Request
curl -X POST https://ornek.solk.app/api/v1/orders/17/erp \
-H "Authorization: Bearer $SOLK_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'const res = await fetch("https://ornek.solk.app/api/v1/orders/17/erp", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SOLK_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({}),
});
const data = await res.json();import os, requests
r = requests.post(
"https://ornek.solk.app/api/v1/orders/17/erp",
headers={"Authorization": f"Bearer {os.environ['SOLK_API_KEY']}"},
json={},
)
print(r.json())Response
{
"ext_id": null,
"ext_no": null,
"label": "Sırada",
"ok": true,
"status": "queued"
}Example responses were captured from a v54 installation running sample data; lists are shortened to two items.