Skip to main content
POST
Create a sale

Yetkilendirmeler

Authorization
string
header
gerekli

The access token received from the authorization server in the OAuth 2.0 flow.

Başlıklar

X-Tenant
number
gerekli

Tenant identifier. Send the Tenant ID in the X-Tenant header to scope API requests to a specific tenant.

Gövde

application/json
customer_id
integer
gerekli

Customer ID.

currency_id
integer
gerekli

Currency ID.

exchange_rate
number
gerekli

Exchange rate (e.g. 1 or 34.5).

Gerekli aralık: x >= 0
status
enum<string>
gerekli

Sale status: draft, completed, cancelled, invoiced, pending.

Mevcut seçenekler:
draft,
completed,
cancelled,
invoiced,
pending
items
object[]
gerekli

Sale line items. At least one item required.

Minimum array length: 1
appointment_id
integer | null

Related appointment ID (optional). Must belong to current tenant and the provided customer.

sale_date
string<date-time> | null

When the sale happened. Defaults to now when omitted. A naive value is read in the tenant timezone.

user_id
integer | null

User ID (optional, defaults to authenticated user).

notes
string | null

Notes (optional).

Maximum string length: 65535
is_installment_sale
boolean | null

Whether this sale is paid in installments.

installments
object[] | null

Installment plan rows. Required when is_installment_sale is true.

Minimum array length: 1

Yanıt

success
string
gerekli
data
SaleResource · object
gerekli