Invoice
INFO
Har bir javob umumiy konvertda qaytadi — code, message, messages, status_code, time — foydali yuk esa data ichida. Quyidagi jadvallar faqat data ichini tavsiflaydi.
POST /invoice/create
This method allows adding invoice into the account.
So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
user_type | string | Ha | Mumkin qiymatlar: supplier, employee, customer, person, other |
payment_type_id | string | Ha | |
organization_id | string | Ha | |
customer_id | string | Ha | |
customer_assistant_id | string | Yo‘q | |
supplier_id | string | Ha | |
supplier_assistant_id | string | Yo‘q | |
employee_id | string | Ha | |
employee_assistant_id | string | Yo‘q | |
person_id | string | Ha | |
person_assistant_id | string | Yo‘q | |
currency_id | string | Ha | |
to_be_paid | number | Ha | |
payment_date | string (date-time) | Ha | |
description | string | Yo‘q | |
exchange_balance | boolean | Ha |
{
"user_type": "customer",
"payment_type_id": "64b7f4d9e2b3b6a0b7c5d7ff",
"organization_id": "64b7f4d9e2b3b6a0b7c5d800",
"customer_id": "64b7f4d9e2b3b6a0b7c5d801",
"customer_assistant_id": "64b7f4d9e2b3b6a0b7c5d802",
"supplier_id": "64b7f4d9e2b3b6a0b7c5d803",
"supplier_assistant_id": "64b7f4d9e2b3b6a0b7c5d804",
"employee_id": "64b7f4d9e2b3b6a0b7c5d805",
"employee_assistant_id": "64b7f4d9e2b3b6a0b7c5d806",
"person_id": "64b7f4d9e2b3b6a0b7c5d807",
"person_assistant_id": "64b7f4d9e2b3b6a0b7c5d808",
"currency_id": "64b7f4d9e2b3b6a0b7c5d809",
"to_be_paid": 100,
"payment_date": "2024-07-20T10:30:00Z",
"description": "Invoice description",
"exchange_balance": false
}Javob
| Maydon | Tur | Tavsif |
|---|---|---|
_id | string | |
number | string | |
type | string | |
state | string | |
can_be_canceled | boolean | |
balance_changes | object[] | |
balance_changes[]._id | string | |
balance_changes[].currency_id | string | |
balance_changes[].amount | number | |
balance_changes[].value | number | |
balance_changes[].user_type | string | |
organization | object | |
organization._id | string | |
organization.name | string | |
payment_type | object | |
payment_type._id | string | |
payment_type.name | string | |
user_type | string | |
is_refund | boolean | |
date | string (date-time) | |
customer | object | |
customer._id | string | |
customer.name | string | |
supplier | object | |
supplier._id | string | |
supplier.name | string | |
employee | object | |
employee._id | string | |
employee.full_name | string | |
person | object | |
person._id | string | |
person.name | string | |
person.full_name | string | |
write_off | object | |
write_off._id | string | |
write_off.number | string | |
income | object | |
income._id | string | |
income.number | string | |
purchase | object | |
purchase._id | string | |
purchase.number | string | |
revision | object | |
revision._id | string | |
revision.type | string | |
revision.balance_type | string | |
revision.number | string | |
purchase_return | object | |
purchase_return._id | string | |
purchase_return.number | string | |
trade | object | |
trade._id | string | |
trade.number | string | |
trade.is_refund | boolean | |
to_be_paid | number | |
paid | number | |
paid_by_balance | number | |
paid_by_cashback | number | |
to_be_refunded | number | |
refunded | number | |
currency_id | string | |
payment_date | integer | |
created_by | object | |
created_by._id | string | |
created_by.full_name | string | |
created_at | string (date-time) | |
extra_cost | object | |
extra_cost._id | string | |
extra_cost.name | string | |
extra_cost.amount | number | |
attachments | string[] | |
description | string | |
transactions | string[] | |
responsible_id | string | |
responsible | object | |
responsible._id | string | |
responsible.full_name | string | |
customer_assistant | object | |
customer_assistant._id | string | |
customer_assistant.name | string | |
customer_assistant.type | string | |
supplier_assistant | object | |
supplier_assistant._id | string | |
supplier_assistant.name | string | |
supplier_assistant.type | string | |
employee_assistant | object | |
employee_assistant._id | string | |
employee_assistant.name | string | |
employee_assistant.type | string | |
person_assistant | object | |
person_assistant._id | string | |
person_assistant.name | string | |
person_assistant.type | string | |
supplier_assistant_hierarchy | string | |
customer_assistant_hierarchy | string | |
employee_assistant_hierarchy | string | |
person_assistant_hierarchy | string |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"_id": "string",
"number": "string",
"type": "string",
"state": "string",
"can_be_canceled": false,
"balance_changes": [
{
"_id": "string",
"currency_id": "string",
"amount": 0,
"value": 0,
"user_type": "string"
}
],
"organization": {
"_id": "string",
"name": "string"
},
"payment_type": {
"_id": "string",
"name": "string"
},
"user_type": "string",
"is_refund": false,
"date": "2025-05-01T12:00:00Z",
"customer": {
"_id": "string",
"name": "string"
},
"supplier": {
"_id": "string",
"name": "string"
},
"employee": {
"_id": "string",
"full_name": "string"
},
"person": {
"_id": "string",
"name": "string",
"full_name": "string"
},
"write_off": {
"_id": "string",
"number": "string"
},
"income": {
"_id": "string",
"number": "string"
},
"purchase": {
"_id": "string",
"number": "string"
},
"revision": {
"_id": "string",
"type": "string",
"balance_type": "string",
"number": "string"
},
"purchase_return": {
"_id": "string",
"number": "string"
},
"trade": {
"_id": "string",
"number": "string",
"is_refund": false
},
"to_be_paid": 0,
"paid": 0,
"paid_by_balance": 0,
"paid_by_cashback": 0,
"to_be_refunded": 0,
"refunded": 0,
"currency_id": "string",
"payment_date": 0,
"created_by": {
"_id": "string",
"full_name": "string"
},
"created_at": "2025-05-01T12:00:00Z",
"extra_cost": {
"_id": "string",
"name": "string",
"amount": 0
},
"attachments": [
"string"
],
"description": "string",
"transactions": [
"string"
],
"responsible_id": "string",
"responsible": {
"_id": "string",
"full_name": "string"
},
"customer_assistant": {
"_id": "string",
"name": "string",
"type": "string"
},
"supplier_assistant": {
"_id": "string",
"name": "string",
"type": "string"
},
"employee_assistant": {
"_id": "string",
"name": "string",
"type": "string"
},
"person_assistant": {
"_id": "string",
"name": "string",
"type": "string"
},
"supplier_assistant_hierarchy": "string",
"customer_assistant_hierarchy": "string",
"employee_assistant_hierarchy": "string",
"person_assistant_hierarchy": "string"
},
"time": "2025-05-01T12:00:00Z"
}GET /invoice/get-by-id/{id}
Get invoice using its _id
Yo‘l parametrlari
| Parametr | Tur | Majburiy | Tavsif |
|---|---|---|---|
id | string | Ha |
So‘rov tanasi
So‘rov tanasi talab qilinmaydi.
Javob
Javob tuzilishi quyidagi bilan bir xil: POST /invoice/create.
PUT /invoice/set-state
setState invoice
So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
_id | string | Ha | |
state | string | Ha | Mumkin qiymatlar: canceled, pending, done, rejected |
with_transactions | boolean | Yo‘q |
{
"_id": "64b7f4d9e2b3b6a0b7c5d80a",
"state": "canceled",
"with_transactions": true
}Javob
Javob tuzilishi quyidagi bilan bir xil: POST /invoice/create.
POST /invoice/get-paging
Get invoice by paging
So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
page | number | Ha | Standart: 1 |
limit | number | Ha | Standart: 20 |
is_fully_paid | boolean | Yo‘q | |
type | string | Yo‘q | Mumkin qiymatlar: income, expense, transfer, exchange, exchange_method, nothing |
trade_id | string | Yo‘q | |
customer_id | string | Yo‘q | |
supplier_id | string | Yo‘q | |
employee_id | string | Yo‘q | |
person_id | string | Yo‘q | |
date_from | string (date-time) | Yo‘q | |
date_to | string (date-time) | Yo‘q | |
search | string | Yo‘q | |
organization_id | string | Yo‘q | |
payment_type_id | string | Yo‘q | |
payment_type_ids | string[] | Yo‘q | |
is_main | boolean | Yo‘q | |
is_installment_plan | boolean | Yo‘q | |
states | string[] | Yo‘q | |
paid_states | string[] | Yo‘q |
{
"page": 1,
"limit": 20,
"is_fully_paid": true,
"type": "income",
"trade_id": "64b7f4d9e2b3b6a0b7c5d80a",
"customer_id": "64b7f4d9e2b3b6a0b7c5d80b",
"supplier_id": "64b7f4d9e2b3b6a0b7c5d80c",
"employee_id": "64b7f4d9e2b3b6a0b7c5d80d",
"person_id": "64b7f4d9e2b3b6a0b7c5d80e",
"date_from": "2024-07-20T10:30:00Z",
"date_to": "2024-07-21T10:30:00Z",
"search": "search",
"organization_id": "64b7f4d9e2b3b6a0b7c5d80f",
"payment_type_id": "64b7f4d9e2b3b6a0b7c5d810",
"payment_type_ids": [
"64b7f4d9e2b3b6a0b7c5d811",
"64b7f4d9e2b3b6a0b7c5d812"
],
"is_main": true,
"is_installment_plan": false,
"states": [
"canceled",
"pending"
],
"paid_states": [
"string"
]
}Javob
data.total — jami yozuvlar soni, data.data[] — joriy sahifadagi yozuvlar. Quyidagi jadval bitta yozuvni tavsiflaydi.
| Maydon | Tur | Tavsif |
|---|---|---|
_id | string | |
number | string | |
type | string | |
state | string | |
can_be_canceled | boolean | |
balance_changes | object[] | |
balance_changes[]._id | string | |
balance_changes[].currency_id | string | |
balance_changes[].amount | number | |
balance_changes[].value | number | |
balance_changes[].user_type | string | |
organization | object | |
organization._id | string | |
organization.name | string | |
payment_type | object | |
payment_type._id | string | |
payment_type.name | string | |
payment_type_id | string | |
user_type | string | |
is_refund | boolean | |
date | string (date-time) | |
parent_id | string | |
customer_id | string | |
customer | object | |
customer._id | string | |
customer.name | string | |
supplier_id | string | |
supplier | object | |
supplier._id | string | |
supplier.name | string | |
employee_id | string | |
employee | object | |
employee._id | string | |
employee.full_name | string | |
person_id | string | |
person | object | |
person._id | string | |
person.name | string | |
person.full_name | string | |
write_off_id | string | |
write_off | object | |
write_off._id | string | |
write_off.number | string | |
income_id | string | |
income | object | |
income._id | string | |
income.number | string | |
revision_id | string | |
revision | object | |
revision._id | string | |
revision.type | string | |
revision.balance_type | string | |
revision.number | string | |
to_be_paid | number | |
paid | number | |
paid_by_balance | number | |
paid_by_cashback | number | |
to_be_refunded | number | |
refunded | number | |
currency_id | string | |
currency | object | |
currency.uuid | number | |
currency.name | string | |
currency.code | string | |
currency.value | number | |
currency.round_type | string | Mumkin qiymatlar: floor, ceil, round |
currency.precision | number | |
currency.is_main | boolean | |
currency.country_id | string | |
currency.symbol | string | |
currency.side | string | Mumkin qiymatlar: start, end |
purchase_id | string | |
purchase_return_id | string | |
trade_id | string | |
payment_date | integer | |
created_by | object | |
created_by._id | string | |
created_by.full_name | string | |
created_at | string (date-time) | |
extra_cost | object | |
extra_cost._id | string | |
extra_cost.name | string | |
extra_cost.amount | number | |
attachments | string[] | |
description | string | |
plan_items | object[] | |
customer_assistant | object | |
customer_assistant._id | string | |
customer_assistant.name | string | |
customer_assistant.type | string | |
supplier_assistant | object | |
supplier_assistant._id | string | |
supplier_assistant.name | string | |
supplier_assistant.type | string | |
employee_assistant | object | |
employee_assistant._id | string | |
employee_assistant.name | string | |
employee_assistant.type | string | |
person_assistant | object | |
person_assistant._id | string | |
person_assistant.name | string | |
person_assistant.type | string | |
supplier_assistant_hierarchy | string | |
customer_assistant_hierarchy | string | |
employee_assistant_hierarchy | string | |
person_assistant_hierarchy | string |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"total": 0,
"data": [
{
"_id": "string",
"number": "string",
"type": "string",
"state": "string",
"can_be_canceled": false,
"balance_changes": [
{
"_id": "string",
"currency_id": "string",
"amount": 0,
"value": 0,
"user_type": "string"
}
],
"organization": {
"_id": "string",
"name": "string"
},
"payment_type": {
"_id": "string",
"name": "string"
},
"payment_type_id": "string",
"user_type": "string",
"is_refund": false,
"date": "2025-05-01T12:00:00Z",
"parent_id": "string",
"customer_id": "string",
"customer": {
"_id": "string",
"name": "string"
},
"supplier_id": "string",
"supplier": {
"_id": "string",
"name": "string"
},
"employee_id": "string",
"employee": {
"_id": "string",
"full_name": "string"
},
"person_id": "string",
"person": {
"_id": "string",
"name": "string",
"full_name": "string"
},
"write_off_id": "string",
"write_off": {
"_id": "string",
"number": "string"
},
"income_id": "string",
"income": {
"_id": "string",
"number": "string"
},
"revision_id": "string",
"revision": {
"_id": "string",
"type": "string",
"balance_type": "string",
"number": "string"
},
"to_be_paid": 0,
"paid": 0,
"paid_by_balance": 0,
"paid_by_cashback": 0,
"to_be_refunded": 0,
"refunded": 0,
"currency_id": "string",
"currency": {
"uuid": 0,
"name": "string",
"code": "string",
"value": 0,
"round_type": "floor",
"precision": 0,
"is_main": false,
"country_id": "string",
"symbol": "string",
"side": "start"
},
"purchase_id": "string",
"purchase_return_id": "string",
"trade_id": "string",
"payment_date": 0,
"created_by": {
"_id": "string",
"full_name": "string"
},
"created_at": "2025-05-01T12:00:00Z",
"extra_cost": {
"_id": "string",
"name": "string",
"amount": 0
},
"attachments": [
"string"
],
"description": "string",
"plan_items": [
{}
],
"customer_assistant": {
"_id": "string",
"name": "string",
"type": "string"
},
"supplier_assistant": {
"_id": "string",
"name": "string",
"type": "string"
},
"employee_assistant": {
"_id": "string",
"name": "string",
"type": "string"
},
"person_assistant": {
"_id": "string",
"name": "string",
"type": "string"
},
"supplier_assistant_hierarchy": "string",
"customer_assistant_hierarchy": "string",
"employee_assistant_hierarchy": "string",
"person_assistant_hierarchy": "string"
}
]
},
"time": "2025-05-01T12:00:00Z"
}GET /invoice/get-initial-payment/by-trade-id
Get the initial payment for a trade. Returns the prepayment / down-payment invoice tied to a trade.
So‘rov parametrlari
| Parametr | Tur | Majburiy | Tavsif |
|---|---|---|---|
trade_id | string | Ha |
So‘rov tanasi
So‘rov tanasi talab qilinmaydi.
Javob
Javob tuzilishi quyidagi bilan bir xil: POST /invoice/create.
Bu sahifa OpenAPI spetsifikatsiyasidan yaratilgan.