Skip to main content
POST
Create customer
The customer and all sub-records are written in a single transaction: if any record is invalid, nothing is saved and all errors are returned in one Message.

Field rules

Required fields, risk, e-invoice and note rules.

Sub-records

Address, telephone, bank, group and parameter rules.
Send "Next" as CustomerCode to generate the code from the company’s customer number series. See Customer code generation.
Send an empty array ([]) for sub-record lists you do not need. A successful response returns 201 Created and the Location header points to the new customer.

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

Body

CustomerCode
null | string

Required. Unique within the company. Send "Next" on create to generate the code from the company's customer number series.

Example:

"0000382026"

Name
null | string

Required. Customer name.

Example:

"Örnek Ticaret A.Ş."

TaxNumber
null | string

Required. Digits only: 10 digits for a tax number (VKN) or 11 digits for a national ID number (TCKN).

Example:

"1234567890"

TaxOffice
null | string

Tax office name.

Example:

"Kadıköy"

InvoiceTitle
null | string

Title used on invoices. If empty, Name is used.

Example:

"Örnek Ticaret Anonim Şirketi"

Note
null | string

Free text note. Required when any ShowNoteOn* field is true.

Example:

"Deliveries on weekdays only."

DueDays
integer<int32>

Payment term in days. Cannot be less than 0.

Example:

30

DiscountRate
number<double>

Default discount rate (%) between 0 and 100.

Example:

5

Blacklisted
boolean

Marks the customer as blacklisted.

Example:

false

MovementType
integer<int32>

1: Supplier, 2: Buyer, 3: Supplier and buyer. 0 is saved as 1.

Example:

2

RiskLimit
number<double>

Risk limit amount. Cannot be less than 0. 0 means no risk limit.

Example:

250000

RiskControl
integer<int32>

How the risk limit is checked. 1: Current balance, 2: Sales amount. Must be 1 or 2 when RiskLimit is greater than 0.

Example:

1

RiskAction
integer<int32>

What happens when the risk limit is exceeded. 0: Continue, 1: Warn the user, 2: Stop the operation.

Example:

1

EInvoiceUser
boolean

Whether the customer is a registered e-invoice user.

Example:

true

EInvoiceScenario
integer<int32>

E-invoice scenario. Must be 1-9 when EInvoiceUser is true, 0 otherwise. 1: Commercial, 2: Basic, 3: Export, 4: Public, 5: HKS, 6: Energy, 7: Pharmaceutical/Medical device, 8: Investment incentive, 9: IDIS.

Example:

1

ShipmentDefinitionId
null | string<uuid>

ID of a shipment definition from GET /api/v1/definitions/shipment-definitions.

SharingCodeId
null | string<uuid>

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

ShowNoteOnQuote
boolean

Show the note on quotes.

Example:

false

ShowNoteOnOrder
boolean

Show the note on orders.

Example:

false

ShowNoteOnWaybill
boolean

Show the note on waybills.

Example:

true

ShowNoteOnInvoice
boolean

Show the note on invoices.

Example:

false

IdentitySchemes
object[]

Additional identifiers (e.g. MERSISNO). Each SchemeID can be sent only once.

Addresses
object[]

Addresses. If more than one is sent, exactly one must be the invoice address. A single address is always the invoice address.

Telephones
object[]

Telephone numbers.

E-mail addresses, websites and social media links.

Representatives
object[]

Contact persons.

BankAccounts
object[]

Bank accounts.

GroupMembers
object[]

Group memberships. At least one detail must be sent from every mandatory group.

Parameters
object[]

Custom parameter values.

QueryEInvoiceLabels
boolean

If true, e-invoice labels are queried from the e-invoice integrator after the customer is saved. If the query fails, the customer is still created.

Example:

true

Response

Created

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.