Replace an order's lines
Replaces every line on the order with the lines you send. The totals are recomputed from the new lines.
Replaces every line on the order with the lines you send. The totals are recomputed from the new lines.
Authorization
x-api-key Company API key, created under Settings > API Keys.
In: header
Path Parameters
The order id.
Header Parameters
Optional with an API key or OAuth token: leave it out and the company the key or token belongs to is used. If sent, it must be that same company, otherwise the request is refused with 403 API_KEY_WRONG_COMPANY or OAUTH_WRONG_COMPANY.
^[0-9a-fA-F]{24}$Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X PUT "https://example.com/orders/string/lines" \ -H "Content-Type: application/json" \ -d '{ "lines": [ { "description": "string", "discountPct": 0, "qty": 1, "source": "string", "unit": "string", "unitPriceOre": 0, "vatRate": 0 } ] }'{ "acceptedOfferVersionId": "string", "activeCompletion": { "at": "2019-08-24T14:15:22Z", "byName": "string", "byUserId": "string", "note": "string", "photoAttachmentIds": [ "string" ], "reversedAt": "2019-08-24T14:15:22Z" }, "assignedCompanyId": "string", "assignedCompanyName": "string", "assigneeId": "string", "assigneeName": "string", "calendarState": "in_calendar", "cancellation": { "at": "2019-08-24T14:15:22Z", "byName": "string", "byUserId": "string", "reason": "string" }, "category": "CANCELLED", "chainInvoice": { "fileName": "string", "grossOre": 0, "id": "string", "invoiceDate": "2019-08-24T14:15:22Z", "laborNetOre": 0, "materialNetOre": 0, "netOre": 0, "number": "string", "paidAt": "2019-08-24T14:15:22Z", "parseError": "MULTIPLE_INVOICES", "parseState": "ERROR", "source": "UPLOADED", "status": "draft", "uploadedByUserId": "string" }, "completions": [ { "at": "2019-08-24T14:15:22Z", "byName": "string", "byUserId": "string", "note": "string", "photoAttachmentIds": [ "string" ], "reversedAt": "2019-08-24T14:15:22Z" } ], "contactId": "string", "contactName": "string", "createdAt": "2019-08-24T14:15:22Z", "dealId": "string", "id": "string", "invoice": { "fileName": "string", "grossOre": 0, "id": "string", "invoiceDate": "2019-08-24T14:15:22Z", "laborNetOre": 0, "materialNetOre": 0, "netOre": 0, "number": "string", "paidAt": "2019-08-24T14:15:22Z", "parseError": "MULTIPLE_INVOICES", "parseState": "ERROR", "source": "UPLOADED", "status": "draft", "uploadedByUserId": "string" }, "isChainOrder": true, "lines": [ { "articleRef": "string", "catalogItemId": "string", "description": "string", "discountPct": 0, "kind": "string", "qty": 0, "source": "string", "unit": "string", "unitPriceOre": 0, "vatRate": 0 } ], "money": { "incVatOre": 0, "netOre": 0, "vatOre": 0 }, "needsDecision": true, "number": "string", "plannedDate": "2019-08-24T14:15:22Z", "plannedTimeSet": true, "rank": "string", "source": "MANUAL", "stageColor": "string", "stageId": "string", "stageName": "string", "title": "string", "updatedAt": "2019-08-24T14:15:22Z"}Move an order to a stage POST
Moves the order to another stage, or to a new position in its stage. Refusals, all 400: - `ORDER_CANCELLED`: the order is cancelled. - `COMPLETION_REQUIRED`: the target is a `DONE` stage and the order is not completed. Call complete first. - `INVOICE_EXISTS`: the order is completed and invoiced, so it cannot leave its `DONE` stage. Moving a completed order out of a `DONE` stage reverses its completion.
Update an order PATCH
Changes the title, planned date, assignee or contact. Only the fields you send change; send null to clear a nullable field. Setting a new planned date emails the customer.