Skip to main content
PATCH
Partially update sales return invoice
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 invoice’s lines, with the same line-identity rule as a full update; when it is not sent the lines stay as they are.
  • The API does not recalculate totals: if you change lines or amounts, send the related totals too.

Error codes

Codes this endpoint can return. The general errors that apply to every endpoint (authentication, permissions, request headers, daily limit) 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 for customer endpoints; if sent, it is written to created records.

Required range: x >= 1

Path Parameters

invoiceId
string<uuid>
required

Invoice ID.

Body

InvoiceNumber
null | string

Required. Invoice number, unique within the company for this invoice type. Send "Next" on create to generate it automatically from the relevant number series or, when applicable, from the e-Invoice numbering. At most 20 characters.

Example:

"9446A4D834"

DocumentNumber
null | string

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

Date
null | string<date-time>

Required. Invoice date. The date part is stored as the invoice date; if a time is sent it is stored as the invoice 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 invoice's address, title and tax fields are copied from the customer at the moment it is saved and are not accepted in the request.

Example:

"C-0001"

CurrencyCode
null | string

Required. Currency code from GET /api/v1/definitions/currencies.

Example:

"TRY"

DueDays
integer<int32>

Payment term in days. Cannot be less than 0.

SharingCode
null | string

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

ShipmentDefinitionCode
null | string

Shipment definition code from GET /api/v1/definitions/shipment-definitions.

DiscountTotal
number<double>

Total discount amount. Sent by the integrator, not calculated by the API.

SubTotal
number<double>

Subtotal (sum of the line amounts excluding taxes). Sent by the integrator, not calculated by the API.

VatTotal
number<double>

Total VAT amount. Sent by the integrator, not calculated by the API.

GrandTotal
number<double>

Grand total. Sent by the integrator, not calculated by the API.

Consolidated
boolean

Whether the invoice consolidates several despatches/orders. Free-form flag, not validated by the API.

PrintDescription
boolean

Whether the description should be printed on the invoice document.

Cancelled
boolean

Whether the invoice has been cancelled.

AverageExchangeRate
number<double>

Weighted average exchange rate of the lines. Sent by the integrator, not calculated by the API. Use 1 when everything is in the company's default currency.

Example:

1

ApplyWithholding
boolean

Whether withholding (tevkifat) applies to this invoice.

WithholdingCode
null | string

Withholding (tevkifat) code. At most 10 characters.

WithholdingNumerator
integer<int32>

Numerator of the withholding share (e.g. 9 in 9/10).

WithholdingDenominator
integer<int32>

Denominator of the withholding share (e.g. 10 in 9/10).

WithholdingTotal
number<double>

Total withheld VAT amount. Calculated by the API as the sum of the lines' withheld VAT.

AdditionalTaxTotal
number<double>

Total additional tax amount. Sent by the integrator, not calculated by the API.

EInvoiceType
integer<int32>

e-Invoice classification of this specific invoice record: 0 not an e-document, 1 e-Invoice, 2 e-Archive, 3 e-Archive (internet), 4 incoming e-Invoice, 5 e-Producer-receipt. Provided by the integrator; the API only range-checks it and, for a sales/purchase-return invoice, uses it to pick the e-Invoice numbering series when InvoiceNumber is "Next".

Example:

1

ProfileId
null | string

UBL profile ID of the e-document (e.g. "TEMELFATURA", "TICARIFATURA"). Stored as sent; not validated or acted on.

InvoiceTypeCode
null | string

UBL invoice type code of the e-document (e.g. "SATIS", "IADE"). Stored as sent; not validated or acted on.

WithholdingTaxRate
number<double>

Withholding tax rate (stopaj), used for self-employment/producer-receipt style invoices. Stored as sent.

SocialSecurityRate
number<double>

Social security (Bağ-Kur) rate, used for self-employment/producer-receipt style invoices. Stored as sent.

MarketRate
number<double>

Market (borsa) rate, used for producer-receipt style invoices. Stored as sent.

ReturnedInvoiceNumber
null | string

Number of the invoice this one returns goods against (Alış/Satış İade). Free text, not validated against an existing invoice.

ReturnedInvoiceDate
null | string<date-time>

Date of the invoice this one returns goods against.

OrderReferenceNumber
null | string

Reference order number (free text, informational only).

OrderReferenceDate
null | string<date-time>

Date of the reference order.

BranchNumber
null | string

Branch number (informational).

BranchTitle
null | string

Branch title (informational).

BranchAddress
null | string

Branch address (informational).

InvestmentIncentiveDocumentNumber
null | string

Investment incentive certificate number.

InvestmentIncentiveDocumentDate
null | string<date-time>

Investment incentive certificate date.

EnergyPeriodStart
null | string<date-time>

Energy period start date/time, for energy sector invoices.

EnergyPeriodEnd
null | string<date-time>

Energy period end date/time, for energy sector invoices.

DeliveryInfo
object[]

Export delivery information. Stored and returned as sent, not validated.

PaymentMeans
object[]

Payment methods. Stored and returned as sent, not validated.

ReferencedDespatches
object[]

Referenced despatches. Stored and returned as sent, not validated.

CustomerIdentitySchemes
object[]

Customer identity schemes. Stored and returned as sent, not validated.

PublicSectorSpendingUnit
null | object

Public sector (Kamu) payer spending unit. Stored and returned as sent, not validated.

SgkInfo
null | object

SGK (social security) invoice information. Stored and returned as sent, not validated.

Lines
object[]

Required, at least one line. On update, the order in which lines are sent determines their identity, the same way as for despatches: the line at the same position as an existing line is treated as that line (its generated warehouse movement, Lot/serial number and linked-order/despatch records move with it).

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.