Skip to main content
PATCH
Partially update order
In the body you send only the fields you want to change; fields that are not sent keep their current values. Rules and examples: partial update.
  • A field that is not sent does not change; a field sent as null is cleared.
  • Validation runs on the whole merged record; if you set a required field to null the request is rejected.
  • Lists are not merged: when Lines is sent it replaces all the order’s lines, when it is not sent the lines stay as they are.
  • The totals and AverageExchangeRate are always filled from the lines; you do not send them. When you send Lines, their amounts must add up (6120).
  • The customer movement follows CreateCustomerMovement exactly as in a full update; a partial update that changes the amount or the currency updates the movement too.

Error codes

Codes this endpoint can return. The general errors that apply to every endpoint (authentication, permissions, request headers, request limits) are not repeated here.

Authorizations

Authorization
string
header
required

Access token obtained from the Noyax auth service with your API key.

Headers

X-UserID
integer<int32>
required

ID of the Noyax user the request is made on behalf of. Written to the audit fields of created, updated and deleted records.

Required range: x >= 1
X-CompanyID
integer<int32>
required

ID of the company. The user must be assigned to this company. All reads and writes are limited to this company.

Required range: x >= 1
X-PeriodID
integer<int32>

ID of the accounting period. Optional; if sent, it is written to created records.

Required range: x >= 1

Path Parameters

orderId
string<uuid>
required

Order ID.

Body

OrderType
integer<int32>

Required. 1: Purchase order (placed with a supplier), 2: Sales order (received from a customer). Cannot be changed after the order is created.

Example:

2

OrderNumber
null | string

Required. Order number, unique within the company for the same OrderType. Send "Next" on create to generate it from the company's order number series for the type. At most 10 characters.

Example:

"SIP0000125"

DocumentNumber
null | string

Document number (free text). At most 20 characters.

Example:

"2026-15"

Date
null | string<date-time>

Required. Order date. The date part is stored as the order date; if a time is sent it is stored as the order time, otherwise the current time is used.

Example:

"2026-09-21T10:30:00"

Description
null | string

Description. At most 1000 characters.

CustomerCode
null | string

Required. Customer code (the customer's CustomerCode from GET /api/v1/customers). The order is written with the customer's address: the invoice address when the customer has one, otherwise the first address.

Example:

"C-0001"

DueDays
integer<int32>

Payment term in days. Cannot be less than 0. When CreateCustomerMovement is true, the customer movement is due Date + DueDays (no due date when 0).

Example:

30

DeliveryDate
null | string<date>

Delivery date. Date only (yyyy-MM-dd), no time part.

Example:

"2026-10-15"

SharingCode
null | string

Sharing code that limits who can see the order. Empty means visible to everyone; otherwise it must be one of the user's sharing codes.

DiscountTotal
number<double>

Total discount: the sum of the lines' DiscountAmount. Filled from the lines; a value sent in the request is ignored.

Example:

100

SubTotal
number<double>

Subtotal: the sum of the lines' AmountExcludingTax. Filled from the lines; a value sent in the request is ignored.

Example:

900

VatTotal
number<double>

Total VAT after withholding: the sum of the lines' VatAmount minus WithholdingTotal. Filled from the lines; a value sent in the request is ignored.

Example:

225

AdditionalTaxTotal
number<double>

Total additional tax: the sum of the lines' additional tax amounts. Filled from the lines; a value sent in the request is ignored.

Example:

225

WithholdingTotal
number<double>

Total withheld VAT: the sum of the lines' WithheldVatAmount. Filled from the lines; a value sent in the request is ignored.

Example:

0

GrandTotal
number<double>

Grand total: the sum of the lines' AmountIncludingTax minus WithholdingTotal. Filled from the lines; a value sent in the request is ignored. When CreateCustomerMovement is true, it is the amount of the customer movement.

Example:

1350

CreateCustomerMovement
boolean

Whether the order has a customer movement. When true, a purchase order creates a credit (alacak) and a sales order creates a debit (borç) movement on the customer for GrandTotal, kept in sync on every update. When false the order has no customer movement; on update, false removes an existing movement. Movements that were already closed by a collection or payment cannot be changed or removed.

Example:

true

AverageExchangeRate
number<double>

Weighted average exchange rate: when every line has the same currency, Σ(AmountExcludingTax × ExchangeRate) / Σ AmountExcludingTax; when the lines have different currencies, 1, and the totals are converted to the default currency with each line's ExchangeRate. Filled from the lines; a value sent in the request is ignored.

Example:

1

Lines
object[]

Required, at least one line. On update the lines are replaced: the order's existing lines are removed and these are saved instead.

Response

OK

Success
boolean
required

Whether the operation succeeded.

Example:

true

ResultCode
string
required

"0000" on success. On failure, the code of the first error; all errors are listed in Errors.

Example:

"0000"

Data
object
required

Response data. Null when Success is false.

Message
null | string

Error message when Success is false. Messages of all errors are joined into a single text.