Trade
INFO
Every response arrives in the shared envelope — code, message, messages, status_code, time — with the payload in data. The tables below describe what is inside data.
POST /trade/create
This method allows adding trade into the account.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
code | string | No | |
organization_id | string | Yes | |
order_id | string | No | |
open_ticket_id | string | No | |
open_ticket_uuid | string | No | |
state | string | Yes | One of: new, canceled, done, draft, is_progress |
customer_id | string | No | |
customer_assistant_id | string | No | |
state_id | string | No | |
responsible_id | string | Yes | |
courier_id | string | No | |
currency | object | Yes | |
currency._id | string | Yes | |
currency.name | string | Yes | |
currency.value | number | Yes | |
currency.side | string | No | One of: start, end |
currency.symbol | string | No | |
price_id | string | No | |
by_balance | object[] | Yes | |
by_balance[].amount | number | Yes | |
by_balance[].currency | object | Yes | |
by_balance[].currency._id | string | Yes | |
by_balance[].currency.name | string | Yes | |
by_balance[].currency.value | number | Yes | |
by_balance[].currency.side | string | No | One of: start, end |
by_balance[].currency.symbol | string | No | |
by_balance[].paid | number | No | |
payments | object[] | Yes | |
payments[].external_transaction_id | string | No | |
payments[].amount | number | Yes | |
payments[].payment_method | object | Yes | |
payments[].payment_method._id | string | Yes | |
payments[].payment_method.name | string | Yes | |
payments[].payment_method.type | string | No | Copy of the payment method's type at the time of sale; send the value payment-method/get-by-id returns (cash or cashless). The older values are still accepted so previously built payloads keep working. gift is no longer accepted.. One of: cash, cashless, system, card, debt, transfer, terminal, by_balance, by_cashback, trade_in, integration |
payments[].currency | object | Yes | |
payments[].currency._id | string | Yes | |
payments[].currency.name | string | Yes | |
payments[].currency.value | number | Yes | |
payments[].currency.side | string | No | One of: start, end |
payments[].currency.symbol | string | No | |
payments[].paid | number | No | |
applied_cashbacks | object[] | Yes | |
applied_cashbacks[].amount | number | Yes | |
applied_cashbacks[].currency | object | No | |
applied_cashbacks[].currency._id | string | Yes | |
applied_cashbacks[].currency.name | string | Yes | |
applied_cashbacks[].currency.value | number | Yes | |
applied_cashbacks[].currency.side | string | No | One of: start, end |
applied_cashbacks[].currency.symbol | string | No | |
applied_cashbacks[].paid | number | Yes | |
changes | object[] | Yes | |
changes[].external_transaction_id | string | No | |
changes[].amount | number | Yes | |
changes[].payment_method | object | Yes | |
changes[].payment_method._id | string | Yes | |
changes[].payment_method.name | string | Yes | |
changes[].payment_method.type | string | No | Copy of the payment method's type at the time of sale; send the value payment-method/get-by-id returns (cash or cashless). The older values are still accepted so previously built payloads keep working. gift is no longer accepted.. One of: cash, cashless, system, card, debt, transfer, terminal, by_balance, by_cashback, trade_in, integration |
changes[].currency | object | Yes | |
changes[].currency._id | string | Yes | |
changes[].currency.name | string | Yes | |
changes[].currency.value | number | Yes | |
changes[].currency.side | string | No | One of: start, end |
changes[].currency.symbol | string | No | |
changes[].paid | number | No | |
note | string | No | |
products | object[] | Yes | |
products[].product_id | string | Yes | |
products[].order_item_id | string | No | |
products[].amount | number | Yes | |
products[].box_count | number | No | |
products[].box_item | number | No | |
products[].price | number | Yes | |
products[].total_to_pay | number | No | |
products[].discounts | object[] | Yes | |
products[].discounts[]._id | string | Yes | |
products[].discounts[].is_custom | boolean | Yes | |
products[].discounts[].value | number | Yes | |
products[].discounts[].name | string | Yes | |
products[].discounts[].apply_type | string | Yes | One of: percent, cash |
products[].marks | string[] | Yes | |
products[].cost | number | No | |
products[].tax_ids | string[] | No | |
products[].note | string | No | |
products[].extra_costs | object[] | Yes | |
products[].extra_costs[].cost_id | string | Yes | |
products[].extra_costs[].amount | number | Yes | |
products[].warehouse_id | string | Yes | |
products[].price_id | string | No | |
date | string (date-time) | Yes | |
paying_date | string (date-time) | No | |
delivery_date | string (date-time) | No | |
delivery_address | object | No | |
delivery_address.human_address | object | No | |
delivery_address.human_address.address | string | No | |
delivery_address.human_address.city | string | No | |
delivery_address.human_address.state | string | No | |
delivery_address.human_address.zip | string | No | |
delivery_address.lat | number | No | |
delivery_address.long | number | No | |
warehouse_id | string | No | |
discounts | object[] | Yes | |
discounts[]._id | string | Yes | |
discounts[].is_custom | boolean | Yes | |
discounts[].value | number | Yes | |
discounts[].name | string | Yes | |
discounts[].apply_type | string | Yes | One of: percent, cash |
cover_by_balance | boolean | No | |
calc_tax_after_discount | boolean | No | |
installment_plan_interval | string | Yes | One of: year, month |
installment_plan | object[] | No | |
installment_plan[].date | string (date-time) | Yes | |
installment_plan[].amount | number | Yes | |
additional_costs | object[] | Yes | |
additional_costs[].cost_id | string | Yes | |
additional_costs[].amount | number | Yes | |
additional_costs[].customer_id | string | No | |
additional_costs[].employee_id | string | No | |
additional_costs[].supplier_id | string | No | |
additional_costs[].person_id | string | No | |
currency_values | object[] | Yes | |
currency_values[].to_currency_id | string | Yes | |
currency_values[].denominator | string | Yes | |
currency_values[].numerator | number | Yes | |
to_send_customer | boolean | No | |
contract_id | string | No |
{
"code": "TRADE-123",
"organization_id": "64e24f4199a9a3c944444445",
"order_id": "64e24f4199a9a3c944444446",
"open_ticket_id": "64e24f4199a9a3c944444447",
"open_ticket_uuid": "UUID-123",
"state": "new",
"customer_id": "64e24f4199a9a3c944444448",
"customer_assistant_id": "64e24f4199a9a3c944444449",
"state_id": "64e24f4199a9a3c944444450",
"responsible_id": "64e24f4199a9a3c944444451",
"courier_id": "64e24f4199a9a3c944444452",
"currency": {
"_id": "64e24f4199a9a3c944444453",
"name": "USD",
"value": 1,
"side": "start",
"symbol": "$"
},
"price_id": "64e24f4199a9a3c944444453",
"by_balance": [
{
"amount": 100,
"currency": {
"_id": null,
"name": null,
"value": null,
"side": null,
"symbol": null
},
"paid": 50
}
],
"payments": [
{
"external_transaction_id": "64e24f4199a9a3c944444453",
"amount": 100,
"payment_method": {
"_id": null,
"name": null,
"type": null
},
"currency": {
"_id": null,
"name": null,
"value": null,
"side": null,
"symbol": null
},
"paid": 50
}
],
"applied_cashbacks": [
{
"amount": 100,
"currency": {
"_id": null,
"name": null,
"value": null,
"side": null,
"symbol": null
},
"paid": 50
}
],
"changes": [
{
"external_transaction_id": "64e24f4199a9a3c944444453",
"amount": 100,
"payment_method": {
"_id": null,
"name": null,
"type": null
},
"currency": {
"_id": null,
"name": null,
"value": null,
"side": null,
"symbol": null
},
"paid": 50
}
],
"note": "This is a note.",
"products": [
{
"product_id": "64e24f4199a9a3c944444453",
"order_item_id": "64e24f4199a9a3c944444454",
"amount": 2,
"box_count": 1,
"box_item": 1,
"price": 50,
"total_to_pay": 100,
"discounts": [],
"marks": [],
"cost": 40,
"tax_ids": [],
"note": "This is a product note.",
"extra_costs": [],
"warehouse_id": "64e24f4199a9a3c944444458",
"price_id": "64e24f4199a9a3c944444459"
}
],
"date": "2023-10-01T12:00:00Z",
"paying_date": "2023-10-01T12:00:00Z",
"delivery_date": "2023-10-01T12:00:00Z",
"delivery_address": {
"human_address": {
"address": "123 Main St, New York, NY 10001",
"city": "New York",
"state": "NY",
"zip": "10001"
},
"lat": 40.7128,
"long": -74.006
},
"warehouse_id": "64e24f4199a9a3c944444460",
"discounts": [
{
"_id": "64e24f4199a9a3c944444455",
"is_custom": false,
"value": 10,
"name": "Discount 1",
"apply_type": "percent"
}
],
"cover_by_balance": false,
"calc_tax_after_discount": true,
"installment_plan_interval": "month",
"installment_plan": [
{
"date": "2023-10-01T12:00:00Z",
"amount": 100
}
],
"additional_costs": [
{
"cost_id": "64e24f4199a9a3c944444457",
"amount": 5,
"customer_id": "64e24f4199a9a3c944444457",
"employee_id": "64e24f4199a9a3c944444457",
"supplier_id": "64e24f4199a9a3c944444457",
"person_id": "64e24f4199a9a3c944444457"
}
],
"currency_values": [
{
"to_currency_id": "64e24f4199a9a3c944444453",
"denominator": "USD",
"numerator": 1
}
],
"to_send_customer": false,
"contract_id": "64e24f4199a9a3c944444461"
}Response
| Field | Type | Description |
|---|---|---|
created_at | string | |
updated_at | string | |
code | string | |
uuid | string | |
open_ticket_uuid | string | |
organization_id | string | |
organization | object | |
organization._id | string | |
organization.name | string | |
warehouse_id | string | |
warehouse | object | |
warehouse._id | string | |
warehouse.name | string | |
customer_id | string | |
customer | object | |
customer._id | string | |
customer.name | string | |
customer.type | string | |
customer.phone_number | string | |
customer.inn | string | |
customer.address | string | |
customer.description | string | |
customer.delivery_address | object | |
customer.delivery_address.lat | number | |
customer.delivery_address.long | number | |
customer.delivery_address.human_address | object | |
customer_assistant | object | |
customer_assistant._id | string | |
customer_assistant.name | string | |
customer_assistant.type | string | |
customer_assistant_hierarchy | string | |
responsible_id | string | |
note | string | |
responsible | object | |
responsible._id | string | |
responsible.full_name | string | |
responsible.phone_number | string | |
created_by | object | |
created_by._id | string | |
created_by.full_name | string | |
state | string | |
dynamic_state | string | |
is_refund | boolean | |
is_trash | boolean | |
refund_id | string | |
number | string | |
device | object | |
device._id | string | |
device.name | string | |
device.device_id | string | |
currency | object | |
currency_id | string | |
additional_costs | object[] | |
additional_costs[].cost_id | string | |
additional_costs[].payment_type_id | string | |
additional_costs[].payment_type | object | |
additional_costs[].amount | number | |
additional_costs[].employee | object | |
additional_costs[].supplier | object | |
additional_costs[].customer | object | |
additional_costs[].person | object | |
additional_costs[].cost | object | |
additional_costs[].price_id | string | |
additional_costs[].employee_assistant_id | string | |
additional_costs[].employee_assistant_hierarchy | object[] | |
additional_costs[].supplier_assistant_id | string | |
additional_costs[].supplier_assistant_hierarchy | object[] | |
additional_costs[].customer_assistant_id | string | |
additional_costs[].customer_assistant_hierarchy | object[] | |
additional_costs[].person_assistant_id | string | |
additional_costs[].person_assistant_hierarchy | object[] | |
additional_costs[].is_method_summary_zero | boolean | |
additional_costs[].item_count | number | |
total_extra_cost | number | |
total_effected_extra_cost | number | |
currency_values | object | |
currency_values.to_currency_id | string | |
currency_values.numerator | number | |
currency_values.denominator | number | |
price_id | number | |
price | object | |
price._id | string | |
price.name | string | |
price.short_name | string | |
price.code | string | |
invoice | object | |
invoice._id | string | |
invoice.to_be_paid | number | |
invoice.paid | number | |
invoice.paid_by_balance | number | |
invoice.paid_by_cashback | number | |
invoice.to_be_refunded | number | |
invoice.refunded | number | |
invoice.number | string | |
invoice.paid_state | string | |
invoice.installment_plan_interval | string | |
invoice.period | number | |
invoice.trade_id | string | |
invoice.items | object | |
invoice.items._id | string | |
invoice.items.to_be_paid | number | |
invoice.items.paid | number | |
invoice.items.paid_by_balance | number | |
invoice.items.paid_by_cashback | number | |
invoice.items.to_be_refunded | number | |
invoice.items.refunded | number | |
invoice.items.is_initial_payment | boolean | |
invoice.items.number | string | |
invoice.items.paid_state | string | |
invoice.items.date | string | |
invoice.currency_id | string | |
invoice.payment_type_id | string | |
invoice.is_refund | boolean | |
invoice.type | string | |
invoice.payment_type | object | |
invoice.payment_type._id | string | |
invoice.payment_type.name | string | |
payments | object | |
payments.payment_method | object | |
payments.payment_method._id | string | |
payments.payment_method.type | string | |
payments.payment_method.name | string | |
payments.amount | number | |
payments.paid | number | |
payments.currency | object | |
payments.currency._id | string | |
payments.currency.uuid | number | |
payments.currency.name | string | |
payments.currency.value | number | |
payments.currency.symbol | string | |
payments.currency.side | string | |
payments.base_currency | object | |
payments.base_currency.numerator | number | |
payments.base_currency.denominator | number | |
payments.base_currency_value | number | |
applied_cashbacks | object[] | |
applied_cashbacks[]._id | string | |
applied_cashbacks[].amount | number | |
applied_cashbacks[].currency | object | |
applied_cashbacks[].currency._id | string | |
applied_cashbacks[].currency.to_currency_id | string | |
applied_cashbacks[].currency.uuid | number | |
applied_cashbacks[].currency.name | string | |
applied_cashbacks[].currency.value | number | |
applied_cashbacks[].currency.symbol | string | |
applied_cashbacks[].currency.side | string | |
applied_cashbacks[].currency.numerator | number | |
applied_cashbacks[].currency.denominator | number | |
applied_cashbacks[].currency.round_type | string | |
applied_cashbacks[].currency.precision | number | |
applied_cashbacks[].paid | number | |
applied_cashbacks[].base_currency | object | |
applied_cashbacks[].base_currency.numerator | number | |
applied_cashbacks[].base_currency.denominator | number | |
applied_cashbacks[].installment_plan_changes | object[] | |
applied_cashbacks[].installment_plan_changes[].invoice_id | string | |
applied_cashbacks[].installment_plan_changes[].amount | number | |
earned_cashback | object | |
earned_cashback._id | string | |
earned_cashback.amount | number | |
earned_cashback.currency | object | |
earned_cashback.currency._id | string | |
earned_cashback.currency.to_currency_id | string | |
earned_cashback.currency.uuid | number | |
earned_cashback.currency.name | string | |
earned_cashback.currency.value | number | |
earned_cashback.currency.symbol | string | |
earned_cashback.currency.side | string | |
earned_cashback.currency.numerator | number | |
earned_cashback.currency.denominator | number | |
earned_cashback.currency.round_type | string | |
earned_cashback.currency.precision | number | |
earned_cashback.base_currency | object | |
earned_cashback.base_currency.numerator | number | |
earned_cashback.base_currency.denominator | number | |
changes | object[] | |
changes[].payment_method | object | |
changes[].payment_method._id | string | |
changes[].payment_method.type | string | |
changes[].payment_method.name | string | |
changes[].amount | number | |
changes[].paid | number | |
changes[].currency | object | |
changes[].currency._id | string | |
changes[].currency.to_currency_id | string | |
changes[].currency.uuid | number | |
changes[].currency.name | string | |
changes[].currency.value | number | |
changes[].currency.symbol | string | |
changes[].currency.side | string | |
changes[].currency.numerator | number | |
changes[].currency.denominator | number | |
changes[].currency.round_type | string | |
changes[].currency.precision | number | |
changes[].base_currency | object | |
changes[].base_currency.numerator | number | |
changes[].base_currency.denominator | number | |
changes[].base_currency_value | number | |
total_amount | number | |
total_refunded_amount | number | |
total_to_pay | number | |
total_to_refund | number | |
debt | number | |
total_price | number | |
total_added_tax | number | |
total_included_tax | number | |
discount | number | |
total_discount | number | |
discounts | object[] | |
discounts[].is_custom | boolean | Default: false |
discounts[]._id | string | |
discounts[].name | string | |
discounts[].value | number | |
discounts[].apply_type | string | One of: percent, cash |
discounts[].currency_id | string | |
discounts[].value_in_percent | number | Default: 0 |
change | number | |
delivery_date | string | |
sold_at | string | |
is_report_saved | boolean | |
products | object | |
installment_plan | object | |
installment_plan.date | string | |
installment_plan.amount | number | |
is_installment_plan | boolean | |
reason | object | |
reason._id | string | |
reason.name | string | |
reason.description | string | |
contract_id | string | |
by_balance | object[] | |
by_balance[]._id | string | |
by_balance[].amount | number | |
by_balance[].paid | number | |
by_balance[].currency | object | |
by_balance[].currency._id | string | |
by_balance[].currency.to_currency_id | string | |
by_balance[].currency.uuid | number | |
by_balance[].currency.name | string | |
by_balance[].currency.value | number | |
by_balance[].currency.symbol | string | |
by_balance[].currency.side | string | |
by_balance[].currency.numerator | number | |
by_balance[].currency.denominator | number | |
by_balance[].currency.round_type | string | |
by_balance[].currency.precision | number | |
by_balance[].base_currency | object | |
by_balance[].base_currency.numerator | number | |
by_balance[].base_currency.denominator | number | |
by_balance[].installment_plan_changes | object[] | |
by_balance[].installment_plan_changes[].invoice_id | string | |
by_balance[].installment_plan_changes[].amount | number | |
calc_tax_after_discount | boolean | |
calc_sale_discount_after_product | boolean | |
contract | object | |
contract._id | string | |
contract.created_at | string | |
contract.code | string | |
contract.name | string | |
contract.number | string | |
contract.currency_id | string | |
contract.organization_id | string | |
contract.amount | number | |
contract.date | string | |
contract.expire_date | string | |
contract.person_id | string | |
contract.note | string | |
contract.is_active | boolean | |
contract.contract_number | number | |
customer_before_balance | object[] | |
customer_before_balance[]._id | string | |
customer_before_balance[].currency_id | string | |
customer_before_balance[].amount | number | |
customer_before_balance[].organization_id | string | |
customer_before_balance[].payment_method_id | string | |
cashback_before_balance | object[] | |
cashback_before_balance[]._id | string | |
cashback_before_balance[].customer_id | string | |
cashback_before_balance[].person_id | string | |
cashback_before_balance[].currency_id | string | |
cashback_before_balance[].amount | number | |
customer_after_balance | object[] | |
customer_after_balance[]._id | string | |
customer_after_balance[].currency_id | string | |
customer_after_balance[].amount | number | |
customer_after_balance[].organization_id | string | |
customer_after_balance[].payment_method_id | string | |
cashback_after_balance | object[] | |
cashback_after_balance[]._id | string | |
cashback_after_balance[].customer_id | string | |
cashback_after_balance[].person_id | string | |
cashback_after_balance[].currency_id | string | |
cashback_after_balance[].amount | number | |
delivery_address | object | |
delivery_address.lat | number | |
delivery_address.long | number | |
delivery_address.human_address | object | |
delivery_address.human_address.address | string | |
delivery_address.human_address.city | string | |
delivery_address.human_address.state | string | |
delivery_address.human_address.zip | string | |
order_id | string | |
order | object | |
order._id | string | |
order.number | string | |
order.code | string | |
delivery_order | object | |
delivery_order._id | string | |
delivery_order.number | string | |
delivery_order.code | string | |
delivery_order.state | string | |
refund | object | |
refund.created_at | string | |
refund.updated_at | string | |
refund.code | string | |
refund.uuid | string | |
refund.open_ticket_uuid | string | |
refund.organization_id | string | |
refund.organization | object | |
refund.organization._id | string | |
refund.organization.name | string | |
refund.warehouse_id | string | |
refund.warehouse | object | |
refund.warehouse._id | string | |
refund.warehouse.name | string | |
refund.customer_id | string | |
refund.customer | object | |
refund.customer._id | string | |
refund.customer.name | string | |
refund.customer.type | string | |
refund.customer.phone_number | string | |
refund.customer.inn | string | |
refund.customer.address | string | |
refund.customer.description | string | |
refund.customer.delivery_address | object | |
refund.customer_assistant | object | |
refund.customer_assistant._id | string | |
refund.customer_assistant.name | string | |
refund.customer_assistant.type | string | |
refund.customer_assistant_hierarchy | string | |
refund.responsible_id | string | |
refund.note | string | |
refund.responsible | object | |
refund.responsible._id | string | |
refund.responsible.full_name | string | |
refund.responsible.phone_number | string | |
refund.created_by | object | |
refund.created_by._id | string | |
refund.created_by.full_name | string | |
refund.state | string | |
refund.dynamic_state | string | |
refund.is_refund | boolean | |
refund.is_trash | boolean | |
refund.refund_id | string | |
refund.number | string | |
refund.device | object | |
refund.device._id | string | |
refund.device.name | string | |
refund.device.device_id | string | |
refund.currency | object | |
refund.currency_id | string | |
refund.additional_costs | object[] | |
refund.additional_costs[].cost_id | string | |
refund.additional_costs[].payment_type_id | string | |
refund.additional_costs[].payment_type | object | |
refund.additional_costs[].amount | number | |
refund.additional_costs[].employee | object | |
refund.additional_costs[].supplier | object | |
refund.additional_costs[].customer | object | |
refund.additional_costs[].person | object | |
refund.additional_costs[].cost | object | |
refund.additional_costs[].price_id | string | |
refund.additional_costs[].employee_assistant_id | string | |
refund.additional_costs[].employee_assistant_hierarchy | object[] | |
refund.additional_costs[].supplier_assistant_id | string | |
refund.additional_costs[].supplier_assistant_hierarchy | object[] | |
refund.additional_costs[].customer_assistant_id | string | |
refund.additional_costs[].customer_assistant_hierarchy | object[] | |
refund.additional_costs[].person_assistant_id | string | |
refund.additional_costs[].person_assistant_hierarchy | object[] | |
refund.additional_costs[].is_method_summary_zero | boolean | |
refund.additional_costs[].item_count | number | |
refund.total_extra_cost | number | |
refund.total_effected_extra_cost | number | |
refund.currency_values | object | |
refund.currency_values.to_currency_id | string | |
refund.currency_values.numerator | number | |
refund.currency_values.denominator | number | |
refund.price_id | number | |
refund.price | object | |
refund.price._id | string | |
refund.price.name | string | |
refund.price.short_name | string | |
refund.price.code | string | |
refund.invoice | object | |
refund.invoice._id | string | |
refund.invoice.to_be_paid | number | |
refund.invoice.paid | number | |
refund.invoice.paid_by_balance | number | |
refund.invoice.paid_by_cashback | number | |
refund.invoice.to_be_refunded | number | |
refund.invoice.refunded | number | |
refund.invoice.number | string | |
refund.invoice.paid_state | string | |
refund.invoice.installment_plan_interval | string | |
refund.invoice.period | number | |
refund.invoice.trade_id | string | |
refund.invoice.items | object | |
refund.invoice.currency_id | string | |
refund.invoice.payment_type_id | string | |
refund.invoice.is_refund | boolean | |
refund.invoice.type | string | |
refund.invoice.payment_type | object | |
refund.payments | object | |
refund.payments.payment_method | object | |
refund.payments.amount | number | |
refund.payments.paid | number | |
refund.payments.currency | object | |
refund.payments.base_currency | object | |
refund.payments.base_currency_value | number | |
refund.applied_cashbacks | object[] | |
refund.applied_cashbacks[]._id | string | |
refund.applied_cashbacks[].amount | number | |
refund.applied_cashbacks[].currency | object | |
refund.applied_cashbacks[].paid | number | |
refund.applied_cashbacks[].base_currency | object | |
refund.applied_cashbacks[].installment_plan_changes | object[] | |
refund.earned_cashback | object | |
refund.earned_cashback._id | string | |
refund.earned_cashback.amount | number | |
refund.earned_cashback.currency | object | |
refund.earned_cashback.base_currency | object | |
refund.changes | object[] | |
refund.changes[].payment_method | object | |
refund.changes[].amount | number | |
refund.changes[].paid | number | |
refund.changes[].currency | object | |
refund.changes[].base_currency | object | |
refund.changes[].base_currency_value | number | |
refund.total_amount | number | |
refund.total_refunded_amount | number | |
refund.total_to_pay | number | |
refund.total_to_refund | number | |
refund.debt | number | |
refund.total_price | number | |
refund.total_added_tax | number | |
refund.total_included_tax | number | |
refund.discount | number | |
refund.total_discount | number | |
refund.discounts | object[] | |
refund.discounts[].is_custom | boolean | Default: false |
refund.discounts[]._id | string | |
refund.discounts[].name | string | |
refund.discounts[].value | number | |
refund.discounts[].apply_type | string | One of: percent, cash |
refund.discounts[].currency_id | string | |
refund.discounts[].value_in_percent | number | Default: 0 |
refund.change | number | |
refund.delivery_date | string | |
refund.sold_at | string | |
refund.is_report_saved | boolean | |
refund.products | object | |
refund.installment_plan | object | |
refund.installment_plan.date | string | |
refund.installment_plan.amount | number | |
refund.is_installment_plan | boolean | |
refund.reason | object | |
refund.reason._id | string | |
refund.reason.name | string | |
refund.reason.description | string | |
refund.contract_id | string | |
refund.by_balance | object[] | |
refund.by_balance[]._id | string | |
refund.by_balance[].amount | number | |
refund.by_balance[].paid | number | |
refund.by_balance[].currency | object | |
refund.by_balance[].base_currency | object | |
refund.by_balance[].installment_plan_changes | object[] | |
refund.calc_tax_after_discount | boolean | |
refund.calc_sale_discount_after_product | boolean | |
refund.contract | object | |
refund.contract._id | string | |
refund.contract.created_at | string | |
refund.contract.code | string | |
refund.contract.name | string | |
refund.contract.number | string | |
refund.contract.currency_id | string | |
refund.contract.organization_id | string | |
refund.contract.amount | number | |
refund.contract.date | string | |
refund.contract.expire_date | string | |
refund.contract.person_id | string | |
refund.contract.note | string | |
refund.contract.is_active | boolean | |
refund.contract.contract_number | number | |
refund.customer_before_balance | object[] | |
refund.customer_before_balance[]._id | string | |
refund.customer_before_balance[].currency_id | string | |
refund.customer_before_balance[].amount | number | |
refund.customer_before_balance[].organization_id | string | |
refund.customer_before_balance[].payment_method_id | string | |
refund.cashback_before_balance | object[] | |
refund.cashback_before_balance[]._id | string | |
refund.cashback_before_balance[].customer_id | string | |
refund.cashback_before_balance[].person_id | string | |
refund.cashback_before_balance[].currency_id | string | |
refund.cashback_before_balance[].amount | number | |
refund.customer_after_balance | object[] | |
refund.customer_after_balance[]._id | string | |
refund.customer_after_balance[].currency_id | string | |
refund.customer_after_balance[].amount | number | |
refund.customer_after_balance[].organization_id | string | |
refund.customer_after_balance[].payment_method_id | string | |
refund.cashback_after_balance | object[] | |
refund.cashback_after_balance[]._id | string | |
refund.cashback_after_balance[].customer_id | string | |
refund.cashback_after_balance[].person_id | string | |
refund.cashback_after_balance[].currency_id | string | |
refund.cashback_after_balance[].amount | number | |
refund.delivery_address | object | |
refund.delivery_address.lat | number | |
refund.delivery_address.long | number | |
refund.delivery_address.human_address | object | |
refund.order_id | string | |
refund.order | object | |
refund.order._id | string | |
refund.order.number | string | |
refund.order.code | string | |
refund.delivery_order | object | |
refund.delivery_order._id | string | |
refund.delivery_order.number | string | |
refund.delivery_order.code | string | |
refund.delivery_order.state | string | |
refunds | object[] | |
refunds[].created_at | string | |
refunds[].updated_at | string | |
refunds[].code | string | |
refunds[].uuid | string | |
refunds[].open_ticket_uuid | string | |
refunds[].organization_id | string | |
refunds[].organization | object | |
refunds[].organization._id | string | |
refunds[].organization.name | string | |
refunds[].warehouse_id | string | |
refunds[].warehouse | object | |
refunds[].warehouse._id | string | |
refunds[].warehouse.name | string | |
refunds[].customer_id | string | |
refunds[].customer | object | |
refunds[].customer._id | string | |
refunds[].customer.name | string | |
refunds[].customer.type | string | |
refunds[].customer.phone_number | string | |
refunds[].customer.inn | string | |
refunds[].customer.address | string | |
refunds[].customer.description | string | |
refunds[].customer.delivery_address | object | |
refunds[].customer_assistant | object | |
refunds[].customer_assistant._id | string | |
refunds[].customer_assistant.name | string | |
refunds[].customer_assistant.type | string | |
refunds[].customer_assistant_hierarchy | string | |
refunds[].responsible_id | string | |
refunds[].note | string | |
refunds[].responsible | object | |
refunds[].responsible._id | string | |
refunds[].responsible.full_name | string | |
refunds[].responsible.phone_number | string | |
refunds[].created_by | object | |
refunds[].created_by._id | string | |
refunds[].created_by.full_name | string | |
refunds[].state | string | |
refunds[].dynamic_state | string | |
refunds[].is_refund | boolean | |
refunds[].is_trash | boolean | |
refunds[].refund_id | string | |
refunds[].number | string | |
refunds[].device | object | |
refunds[].device._id | string | |
refunds[].device.name | string | |
refunds[].device.device_id | string | |
refunds[].currency | object | |
refunds[].currency_id | string | |
refunds[].additional_costs | object[] | |
refunds[].additional_costs[].cost_id | string | |
refunds[].additional_costs[].payment_type_id | string | |
refunds[].additional_costs[].payment_type | object | |
refunds[].additional_costs[].amount | number | |
refunds[].additional_costs[].employee | object | |
refunds[].additional_costs[].supplier | object | |
refunds[].additional_costs[].customer | object | |
refunds[].additional_costs[].person | object | |
refunds[].additional_costs[].cost | object | |
refunds[].additional_costs[].price_id | string | |
refunds[].additional_costs[].employee_assistant_id | string | |
refunds[].additional_costs[].employee_assistant_hierarchy | object[] | |
refunds[].additional_costs[].supplier_assistant_id | string | |
refunds[].additional_costs[].supplier_assistant_hierarchy | object[] | |
refunds[].additional_costs[].customer_assistant_id | string | |
refunds[].additional_costs[].customer_assistant_hierarchy | object[] | |
refunds[].additional_costs[].person_assistant_id | string | |
refunds[].additional_costs[].person_assistant_hierarchy | object[] | |
refunds[].additional_costs[].is_method_summary_zero | boolean | |
refunds[].additional_costs[].item_count | number | |
refunds[].total_extra_cost | number | |
refunds[].total_effected_extra_cost | number | |
refunds[].currency_values | object | |
refunds[].currency_values.to_currency_id | string | |
refunds[].currency_values.numerator | number | |
refunds[].currency_values.denominator | number | |
refunds[].price_id | number | |
refunds[].price | object | |
refunds[].price._id | string | |
refunds[].price.name | string | |
refunds[].price.short_name | string | |
refunds[].price.code | string | |
refunds[].invoice | object | |
refunds[].invoice._id | string | |
refunds[].invoice.to_be_paid | number | |
refunds[].invoice.paid | number | |
refunds[].invoice.paid_by_balance | number | |
refunds[].invoice.paid_by_cashback | number | |
refunds[].invoice.to_be_refunded | number | |
refunds[].invoice.refunded | number | |
refunds[].invoice.number | string | |
refunds[].invoice.paid_state | string | |
refunds[].invoice.installment_plan_interval | string | |
refunds[].invoice.period | number | |
refunds[].invoice.trade_id | string | |
refunds[].invoice.items | object | |
refunds[].invoice.currency_id | string | |
refunds[].invoice.payment_type_id | string | |
refunds[].invoice.is_refund | boolean | |
refunds[].invoice.type | string | |
refunds[].invoice.payment_type | object | |
refunds[].payments | object | |
refunds[].payments.payment_method | object | |
refunds[].payments.amount | number | |
refunds[].payments.paid | number | |
refunds[].payments.currency | object | |
refunds[].payments.base_currency | object | |
refunds[].payments.base_currency_value | number | |
refunds[].applied_cashbacks | object[] | |
refunds[].applied_cashbacks[]._id | string | |
refunds[].applied_cashbacks[].amount | number | |
refunds[].applied_cashbacks[].currency | object | |
refunds[].applied_cashbacks[].paid | number | |
refunds[].applied_cashbacks[].base_currency | object | |
refunds[].applied_cashbacks[].installment_plan_changes | object[] | |
refunds[].earned_cashback | object | |
refunds[].earned_cashback._id | string | |
refunds[].earned_cashback.amount | number | |
refunds[].earned_cashback.currency | object | |
refunds[].earned_cashback.base_currency | object | |
refunds[].changes | object[] | |
refunds[].changes[].payment_method | object | |
refunds[].changes[].amount | number | |
refunds[].changes[].paid | number | |
refunds[].changes[].currency | object | |
refunds[].changes[].base_currency | object | |
refunds[].changes[].base_currency_value | number | |
refunds[].total_amount | number | |
refunds[].total_refunded_amount | number | |
refunds[].total_to_pay | number | |
refunds[].total_to_refund | number | |
refunds[].debt | number | |
refunds[].total_price | number | |
refunds[].total_added_tax | number | |
refunds[].total_included_tax | number | |
refunds[].discount | number | |
refunds[].total_discount | number | |
refunds[].discounts | object[] | |
refunds[].discounts[].is_custom | boolean | Default: false |
refunds[].discounts[]._id | string | |
refunds[].discounts[].name | string | |
refunds[].discounts[].value | number | |
refunds[].discounts[].apply_type | string | One of: percent, cash |
refunds[].discounts[].currency_id | string | |
refunds[].discounts[].value_in_percent | number | Default: 0 |
refunds[].change | number | |
refunds[].delivery_date | string | |
refunds[].sold_at | string | |
refunds[].is_report_saved | boolean | |
refunds[].products | object | |
refunds[].installment_plan | object | |
refunds[].installment_plan.date | string | |
refunds[].installment_plan.amount | number | |
refunds[].is_installment_plan | boolean | |
refunds[].reason | object | |
refunds[].reason._id | string | |
refunds[].reason.name | string | |
refunds[].reason.description | string | |
refunds[].contract_id | string | |
refunds[].by_balance | object[] | |
refunds[].by_balance[]._id | string | |
refunds[].by_balance[].amount | number | |
refunds[].by_balance[].paid | number | |
refunds[].by_balance[].currency | object | |
refunds[].by_balance[].base_currency | object | |
refunds[].by_balance[].installment_plan_changes | object[] | |
refunds[].calc_tax_after_discount | boolean | |
refunds[].calc_sale_discount_after_product | boolean | |
refunds[].contract | object | |
refunds[].contract._id | string | |
refunds[].contract.created_at | string | |
refunds[].contract.code | string | |
refunds[].contract.name | string | |
refunds[].contract.number | string | |
refunds[].contract.currency_id | string | |
refunds[].contract.organization_id | string | |
refunds[].contract.amount | number | |
refunds[].contract.date | string | |
refunds[].contract.expire_date | string | |
refunds[].contract.person_id | string | |
refunds[].contract.note | string | |
refunds[].contract.is_active | boolean | |
refunds[].contract.contract_number | number | |
refunds[].customer_before_balance | object[] | |
refunds[].customer_before_balance[]._id | string | |
refunds[].customer_before_balance[].currency_id | string | |
refunds[].customer_before_balance[].amount | number | |
refunds[].customer_before_balance[].organization_id | string | |
refunds[].customer_before_balance[].payment_method_id | string | |
refunds[].cashback_before_balance | object[] | |
refunds[].cashback_before_balance[]._id | string | |
refunds[].cashback_before_balance[].customer_id | string | |
refunds[].cashback_before_balance[].person_id | string | |
refunds[].cashback_before_balance[].currency_id | string | |
refunds[].cashback_before_balance[].amount | number | |
refunds[].customer_after_balance | object[] | |
refunds[].customer_after_balance[]._id | string | |
refunds[].customer_after_balance[].currency_id | string | |
refunds[].customer_after_balance[].amount | number | |
refunds[].customer_after_balance[].organization_id | string | |
refunds[].customer_after_balance[].payment_method_id | string | |
refunds[].cashback_after_balance | object[] | |
refunds[].cashback_after_balance[]._id | string | |
refunds[].cashback_after_balance[].customer_id | string | |
refunds[].cashback_after_balance[].person_id | string | |
refunds[].cashback_after_balance[].currency_id | string | |
refunds[].cashback_after_balance[].amount | number | |
refunds[].delivery_address | object | |
refunds[].delivery_address.lat | number | |
refunds[].delivery_address.long | number | |
refunds[].delivery_address.human_address | object | |
refunds[].order_id | string | |
refunds[].order | object | |
refunds[].order._id | string | |
refunds[].order.number | string | |
refunds[].order.code | string | |
refunds[].delivery_order | object | |
refunds[].delivery_order._id | string | |
refunds[].delivery_order.number | string | |
refunds[].delivery_order.code | string | |
refunds[].delivery_order.state | string |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"created_at": "string",
"updated_at": "string",
"code": "string",
"uuid": "string",
"open_ticket_uuid": "string",
"organization_id": "string",
"organization": {
"_id": "string",
"name": "string"
},
"warehouse_id": "string",
"warehouse": {
"_id": "string",
"name": "string"
},
"customer_id": "string",
"customer": {
"_id": "string",
"name": "string",
"type": "string",
"phone_number": "string",
"inn": "string",
"address": "string",
"description": "string",
"delivery_address": {
"lat": 0,
"long": 0,
"human_address": {
"address": null,
"city": null,
"state": null,
"zip": null
}
}
},
"customer_assistant": {
"_id": "string",
"name": "string",
"type": "string"
},
"customer_assistant_hierarchy": "string",
"responsible_id": "string",
"note": "string",
"responsible": {
"_id": "string",
"full_name": "string",
"phone_number": "string"
},
"created_by": {
"_id": "string",
"full_name": "string"
},
"state": "string",
"dynamic_state": "string",
"is_refund": false,
"is_trash": false,
"refund_id": "string",
"number": "string",
"device": {
"_id": "string",
"name": "string",
"device_id": "string"
},
"currency": {},
"currency_id": "string",
"additional_costs": [
{
"cost_id": "string",
"payment_type_id": "string",
"payment_type": {},
"amount": 0,
"employee": {},
"supplier": {},
"customer": {},
"person": {},
"cost": {},
"price_id": "string",
"employee_assistant_id": "string",
"employee_assistant_hierarchy": [],
"supplier_assistant_id": "string",
"supplier_assistant_hierarchy": [],
"customer_assistant_id": "string",
"customer_assistant_hierarchy": [],
"person_assistant_id": "string",
"person_assistant_hierarchy": [],
"is_method_summary_zero": false,
"item_count": 0
}
],
"total_extra_cost": 0,
"total_effected_extra_cost": 0,
"currency_values": {
"to_currency_id": "string",
"numerator": 0,
"denominator": 0
},
"price_id": 0,
"price": {
"_id": "string",
"name": "string",
"short_name": "string",
"code": "string"
},
"invoice": {
"_id": "string",
"to_be_paid": 0,
"paid": 0,
"paid_by_balance": 0,
"paid_by_cashback": 0,
"to_be_refunded": 0,
"refunded": 0,
"number": "string",
"paid_state": "string",
"installment_plan_interval": "string",
"period": 0,
"trade_id": "string",
"items": {
"_id": "string",
"to_be_paid": 0,
"paid": 0,
"paid_by_balance": 0,
"paid_by_cashback": 0,
"to_be_refunded": 0,
"refunded": 0,
"is_initial_payment": false,
"number": "string",
"paid_state": "string",
"date": "string"
},
"currency_id": "string",
"payment_type_id": "string",
"is_refund": false,
"type": "string",
"payment_type": {
"_id": "string",
"name": "string"
}
},
"payments": {
"payment_method": {
"_id": "string",
"type": "string",
"name": "string"
},
"amount": 0,
"paid": 0,
"currency": {
"_id": "string",
"uuid": 0,
"name": "string",
"value": 0,
"symbol": "string",
"side": "string"
},
"base_currency": {
"numerator": 0,
"denominator": 0
},
"base_currency_value": 0
},
"applied_cashbacks": [
{
"_id": "string",
"amount": 0,
"currency": {
"_id": null,
"to_currency_id": null,
"uuid": null,
"name": null,
"value": null,
"symbol": null,
"side": null,
"numerator": null,
"denominator": null,
"round_type": null,
"precision": null
},
"paid": 0,
"base_currency": {
"numerator": null,
"denominator": null
},
"installment_plan_changes": []
}
],
"earned_cashback": {
"_id": "string",
"amount": 0,
"currency": {
"_id": "string",
"to_currency_id": "string",
"uuid": 0,
"name": "string",
"value": 0,
"symbol": "string",
"side": "string",
"numerator": 0,
"denominator": 0,
"round_type": "string",
"precision": 0
},
"base_currency": {
"numerator": 0,
"denominator": 0
}
},
"changes": [
{
"payment_method": {
"_id": null,
"type": null,
"name": null
},
"amount": 0,
"paid": 0,
"currency": {
"_id": null,
"to_currency_id": null,
"uuid": null,
"name": null,
"value": null,
"symbol": null,
"side": null,
"numerator": null,
"denominator": null,
"round_type": null,
"precision": null
},
"base_currency": {
"numerator": null,
"denominator": null
},
"base_currency_value": 0
}
],
"total_amount": 0,
"total_refunded_amount": 0,
"total_to_pay": 0,
"total_to_refund": 0,
"debt": 0,
"total_price": 0,
"total_added_tax": 0,
"total_included_tax": 0,
"discount": 0,
"total_discount": 0,
"discounts": [
{
"is_custom": false,
"_id": "string",
"name": "string",
"value": 0,
"apply_type": "percent",
"currency_id": "string",
"value_in_percent": 0
}
],
"change": 0,
"delivery_date": "string",
"sold_at": "string",
"is_report_saved": false,
"products": {},
"installment_plan": {
"date": "string",
"amount": 0
},
"is_installment_plan": false,
"reason": {
"_id": "string",
"name": "string",
"description": "string"
},
"contract_id": "string",
"by_balance": [
{
"_id": "string",
"amount": 0,
"paid": 0,
"currency": {
"_id": null,
"to_currency_id": null,
"uuid": null,
"name": null,
"value": null,
"symbol": null,
"side": null,
"numerator": null,
"denominator": null,
"round_type": null,
"precision": null
},
"base_currency": {
"numerator": null,
"denominator": null
},
"installment_plan_changes": []
}
],
"calc_tax_after_discount": false,
"calc_sale_discount_after_product": false,
"contract": {
"_id": "string",
"created_at": "string",
"code": "string",
"name": "string",
"number": "string",
"currency_id": "string",
"organization_id": "string",
"amount": 0,
"date": "string",
"expire_date": "string",
"person_id": "string",
"note": "string",
"is_active": false,
"contract_number": 0
},
"customer_before_balance": [
{
"_id": "string",
"currency_id": "string",
"amount": 0,
"organization_id": "string",
"payment_method_id": "string"
}
],
"cashback_before_balance": [
{
"_id": "string",
"customer_id": "string",
"person_id": "string",
"currency_id": "string",
"amount": 0
}
],
"customer_after_balance": [
{
"_id": "string",
"currency_id": "string",
"amount": 0,
"organization_id": "string",
"payment_method_id": "string"
}
],
"cashback_after_balance": [
{
"_id": "string",
"customer_id": "string",
"person_id": "string",
"currency_id": "string",
"amount": 0
}
],
"delivery_address": {
"lat": 0,
"long": 0,
"human_address": {
"address": "string",
"city": "string",
"state": "string",
"zip": "string"
}
},
"order_id": "string",
"order": {
"_id": "string",
"number": "string",
"code": "string"
},
"delivery_order": {
"_id": "string",
"number": "string",
"code": "string",
"state": "string"
},
"refund": {
"created_at": "string",
"updated_at": "string",
"code": "string",
"uuid": "string",
"open_ticket_uuid": "string",
"organization_id": "string",
"organization": {
"_id": "string",
"name": "string"
},
"warehouse_id": "string",
"warehouse": {
"_id": "string",
"name": "string"
},
"customer_id": "string",
"customer": {
"_id": "string",
"name": "string",
"type": "string",
"phone_number": "string",
"inn": "string",
"address": "string",
"description": "string",
"delivery_address": {
"lat": null,
"long": null,
"human_address": null
}
},
"customer_assistant": {
"_id": "string",
"name": "string",
"type": "string"
},
"customer_assistant_hierarchy": "string",
"responsible_id": "string",
"note": "string",
"responsible": {
"_id": "string",
"full_name": "string",
"phone_number": "string"
},
"created_by": {
"_id": "string",
"full_name": "string"
},
"state": "string",
"dynamic_state": "string",
"is_refund": false,
"is_trash": false,
"refund_id": "string",
"number": "string",
"device": {
"_id": "string",
"name": "string",
"device_id": "string"
},
"currency": {},
"currency_id": "string",
"additional_costs": [
{
"cost_id": null,
"payment_type_id": null,
"payment_type": null,
"amount": null,
"employee": null,
"supplier": null,
"customer": null,
"person": null,
"cost": null,
"price_id": null,
"employee_assistant_id": null,
"employee_assistant_hierarchy": null,
"supplier_assistant_id": null,
"supplier_assistant_hierarchy": null,
"customer_assistant_id": null,
"customer_assistant_hierarchy": null,
"person_assistant_id": null,
"person_assistant_hierarchy": null,
"is_method_summary_zero": null,
"item_count": null
}
],
"total_extra_cost": 0,
"total_effected_extra_cost": 0,
"currency_values": {
"to_currency_id": "string",
"numerator": 0,
"denominator": 0
},
"price_id": 0,
"price": {
"_id": "string",
"name": "string",
"short_name": "string",
"code": "string"
},
"invoice": {
"_id": "string",
"to_be_paid": 0,
"paid": 0,
"paid_by_balance": 0,
"paid_by_cashback": 0,
"to_be_refunded": 0,
"refunded": 0,
"number": "string",
"paid_state": "string",
"installment_plan_interval": "string",
"period": 0,
"trade_id": "string",
"items": {
"_id": null,
"to_be_paid": null,
"paid": null,
"paid_by_balance": null,
"paid_by_cashback": null,
"to_be_refunded": null,
"refunded": null,
"is_initial_payment": null,
"number": null,
"paid_state": null,
"date": null
},
"currency_id": "string",
"payment_type_id": "string",
"is_refund": false,
"type": "string",
"payment_type": {
"_id": null,
"name": null
}
},
"payments": {
"payment_method": {
"_id": null,
"type": null,
"name": null
},
"amount": 0,
"paid": 0,
"currency": {
"_id": null,
"uuid": null,
"name": null,
"value": null,
"symbol": null,
"side": null
},
"base_currency": {
"numerator": null,
"denominator": null
},
"base_currency_value": 0
},
"applied_cashbacks": [
{
"_id": null,
"amount": null,
"currency": null,
"paid": null,
"base_currency": null,
"installment_plan_changes": null
}
],
"earned_cashback": {
"_id": "string",
"amount": 0,
"currency": {
"_id": null,
"to_currency_id": null,
"uuid": null,
"name": null,
"value": null,
"symbol": null,
"side": null,
"numerator": null,
"denominator": null,
"round_type": null,
"precision": null
},
"base_currency": {
"numerator": null,
"denominator": null
}
},
"changes": [
{
"payment_method": null,
"amount": null,
"paid": null,
"currency": null,
"base_currency": null,
"base_currency_value": null
}
],
"total_amount": 0,
"total_refunded_amount": 0,
"total_to_pay": 0,
"total_to_refund": 0,
"debt": 0,
"total_price": 0,
"total_added_tax": 0,
"total_included_tax": 0,
"discount": 0,
"total_discount": 0,
"discounts": [
{
"is_custom": null,
"_id": null,
"name": null,
"value": null,
"apply_type": null,
"currency_id": null,
"value_in_percent": null
}
],
"change": 0,
"delivery_date": "string",
"sold_at": "string",
"is_report_saved": false,
"products": {},
"installment_plan": {
"date": "string",
"amount": 0
},
"is_installment_plan": false,
"reason": {
"_id": "string",
"name": "string",
"description": "string"
},
"contract_id": "string",
"by_balance": [
{
"_id": null,
"amount": null,
"paid": null,
"currency": null,
"base_currency": null,
"installment_plan_changes": null
}
],
"calc_tax_after_discount": false,
"calc_sale_discount_after_product": false,
"contract": {
"_id": "string",
"created_at": "string",
"code": "string",
"name": "string",
"number": "string",
"currency_id": "string",
"organization_id": "string",
"amount": 0,
"date": "string",
"expire_date": "string",
"person_id": "string",
"note": "string",
"is_active": false,
"contract_number": 0
},
"customer_before_balance": [
{
"_id": null,
"currency_id": null,
"amount": null,
"organization_id": null,
"payment_method_id": null
}
],
"cashback_before_balance": [
{
"_id": null,
"customer_id": null,
"person_id": null,
"currency_id": null,
"amount": null
}
],
"customer_after_balance": [
{
"_id": null,
"currency_id": null,
"amount": null,
"organization_id": null,
"payment_method_id": null
}
],
"cashback_after_balance": [
{
"_id": null,
"customer_id": null,
"person_id": null,
"currency_id": null,
"amount": null
}
],
"delivery_address": {
"lat": 0,
"long": 0,
"human_address": {
"address": null,
"city": null,
"state": null,
"zip": null
}
},
"order_id": "string",
"order": {
"_id": "string",
"number": "string",
"code": "string"
},
"delivery_order": {
"_id": "string",
"number": "string",
"code": "string",
"state": "string"
}
},
"refunds": [
{
"created_at": "string",
"updated_at": "string",
"code": "string",
"uuid": "string",
"open_ticket_uuid": "string",
"organization_id": "string",
"organization": {
"_id": null,
"name": null
},
"warehouse_id": "string",
"warehouse": {
"_id": null,
"name": null
},
"customer_id": "string",
"customer": {
"_id": null,
"name": null,
"type": null,
"phone_number": null,
"inn": null,
"address": null,
"description": null,
"delivery_address": null
},
"customer_assistant": {
"_id": null,
"name": null,
"type": null
},
"customer_assistant_hierarchy": "string",
"responsible_id": "string",
"note": "string",
"responsible": {
"_id": null,
"full_name": null,
"phone_number": null
},
"created_by": {
"_id": null,
"full_name": null
},
"state": "string",
"dynamic_state": "string",
"is_refund": false,
"is_trash": false,
"refund_id": "string",
"number": "string",
"device": {
"_id": null,
"name": null,
"device_id": null
},
"currency": {},
"currency_id": "string",
"additional_costs": [],
"total_extra_cost": 0,
"total_effected_extra_cost": 0,
"currency_values": {
"to_currency_id": null,
"numerator": null,
"denominator": null
},
"price_id": 0,
"price": {
"_id": null,
"name": null,
"short_name": null,
"code": null
},
"invoice": {
"_id": null,
"to_be_paid": null,
"paid": null,
"paid_by_balance": null,
"paid_by_cashback": null,
"to_be_refunded": null,
"refunded": null,
"number": null,
"paid_state": null,
"installment_plan_interval": null,
"period": null,
"trade_id": null,
"items": null,
"currency_id": null,
"payment_type_id": null,
"is_refund": null,
"type": null,
"payment_type": null
},
"payments": {
"payment_method": null,
"amount": null,
"paid": null,
"currency": null,
"base_currency": null,
"base_currency_value": null
},
"applied_cashbacks": [],
"earned_cashback": {
"_id": null,
"amount": null,
"currency": null,
"base_currency": null
},
"changes": [],
"total_amount": 0,
"total_refunded_amount": 0,
"total_to_pay": 0,
"total_to_refund": 0,
"debt": 0,
"total_price": 0,
"total_added_tax": 0,
"total_included_tax": 0,
"discount": 0,
"total_discount": 0,
"discounts": [],
"change": 0,
"delivery_date": "string",
"sold_at": "string",
"is_report_saved": false,
"products": {},
"installment_plan": {
"date": null,
"amount": null
},
"is_installment_plan": false,
"reason": {
"_id": null,
"name": null,
"description": null
},
"contract_id": "string",
"by_balance": [],
"calc_tax_after_discount": false,
"calc_sale_discount_after_product": false,
"contract": {
"_id": null,
"created_at": null,
"code": null,
"name": null,
"number": null,
"currency_id": null,
"organization_id": null,
"amount": null,
"date": null,
"expire_date": null,
"person_id": null,
"note": null,
"is_active": null,
"contract_number": null
},
"customer_before_balance": [],
"cashback_before_balance": [],
"customer_after_balance": [],
"cashback_after_balance": [],
"delivery_address": {
"lat": null,
"long": null,
"human_address": null
},
"order_id": "string",
"order": {
"_id": null,
"number": null,
"code": null
},
"delivery_order": {
"_id": null,
"number": null,
"code": null,
"state": null
}
}
]
},
"time": "2025-05-01T12:00:00Z"
}GET /trade/get-by-id/{id}
Get trade using its _id
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes |
Request body
No request body.
Response
Same response shape as POST /trade/create.
POST /trade/get-paging
Get trades by paging
Request body
| Field | Type | Required | Description |
|---|---|---|---|
page | number | Yes | Default: 1 |
limit | number | Yes | Default: 20 |
product_id | string | No | |
total_from | number | No | |
total_to | number | No | |
customer_id | string | No | |
currency_id | string | No | |
is_fully_refunded | boolean | No | |
responsible_id | string | No | |
states | string[] | No | |
state_id | string | No | |
is_refund | boolean | No | |
organization_id | string | No | |
search | string | No | |
type | string | No | One of: b2b, b2c |
contract_id | string | No | |
updated_at | string (date-time) | No | |
created_by | string | No |
{
"page": 1,
"limit": 20,
"product_id": "64e24f4199a9a3c944444453",
"total_from": 100,
"total_to": 200,
"customer_id": "64e24f4199a9a3c944444458",
"currency_id": "64e24f4199a9a3c944444453",
"is_fully_refunded": false,
"responsible_id": "64e24f4199a9a3c944444451",
"states": [
"new"
],
"state_id": "64e24f4199a9a3c944444450",
"is_refund": false,
"organization_id": "64e24f4199a9a3c944444445",
"search": "search string",
"type": "trade",
"contract_id": "64e24f4199a9a3c944444461",
"updated_at": "2023-10-01T12:00:00Z",
"created_by": "64e24f4199a9a3c944444451"
}Response
data.total is the total number of records and data.data[] holds the current page. The table below describes one record.
| Field | Type | Description |
|---|---|---|
created_at | string | |
updated_at | string | |
code | string | |
uuid | string | |
organization | object | |
organization._id | string | |
organization.name | string | |
customer | object | |
customer._id | string | |
customer.name | string | |
note | string | |
responsible | object | |
responsible._id | string | |
responsible.full_name | string | |
created_by | object | |
created_by._id | string | |
created_by.full_name | string | |
state | string | |
state_id | string | |
number | string | |
currency_id | string | |
earned_cashback | object | |
earned_cashback._id | string | |
earned_cashback.amount | number | |
earned_cashback.currency | object | |
earned_cashback.currency._id | string | |
earned_cashback.currency.to_currency_id | string | |
earned_cashback.currency.uuid | number | |
earned_cashback.currency.name | string | |
earned_cashback.currency.value | number | |
earned_cashback.currency.symbol | string | |
earned_cashback.currency.side | string | |
earned_cashback.currency.numerator | number | |
earned_cashback.currency.denominator | number | |
earned_cashback.currency.round_type | string | |
earned_cashback.currency.precision | number | |
earned_cashback.base_currency | object | |
earned_cashback.base_currency.numerator | number | |
earned_cashback.base_currency.denominator | number | |
total_amount | number | |
total_refunded_amount | number | |
total_to_pay | number | |
total_discount | number | |
debt | number | |
total_price | number | |
total_added_tax | number | |
contract | object | |
contract._id | string | |
contract.code | string | |
contract.name | string | |
contract.number | string | |
contract.currency_id | string | |
contract.organization_id | string | |
contract.amount | number | |
contract.date | string | |
contract.expire_date | string | |
contract.person_id | string | |
contract.note | string | |
contract.is_active | boolean | |
contract.contract_number | number | |
position | number | |
order_id | string | |
date | string | |
sold_at | string |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"total": 0,
"data": [
{
"created_at": "string",
"updated_at": "string",
"code": "string",
"uuid": "string",
"organization": {
"_id": "string",
"name": "string"
},
"customer": {
"_id": "string",
"name": "string"
},
"note": "string",
"responsible": {
"_id": "string",
"full_name": "string"
},
"created_by": {
"_id": "string",
"full_name": "string"
},
"state": "string",
"state_id": "string",
"number": "string",
"currency_id": "string",
"earned_cashback": {
"_id": "string",
"amount": 0,
"currency": {
"_id": "string",
"to_currency_id": "string",
"uuid": 0,
"name": "string",
"value": 0,
"symbol": "string",
"side": "string",
"numerator": 0,
"denominator": 0,
"round_type": "string",
"precision": 0
},
"base_currency": {
"numerator": 0,
"denominator": 0
}
},
"total_amount": 0,
"total_refunded_amount": 0,
"total_to_pay": 0,
"total_discount": 0,
"debt": 0,
"total_price": 0,
"total_added_tax": 0,
"contract": {
"_id": "string",
"code": "string",
"name": "string",
"number": "string",
"currency_id": "string",
"organization_id": "string",
"amount": 0,
"date": "string",
"expire_date": "string",
"person_id": "string",
"note": "string",
"is_active": false,
"contract_number": 0
},
"position": 0,
"order_id": "string",
"date": "string",
"sold_at": "string"
}
]
},
"time": "2025-05-01T12:00:00Z"
}PUT /trade/set-state
setState trade
Request body
| Field | Type | Required | Description |
|---|---|---|---|
_id | string | Yes | |
state | string | Yes | One of: canceled, new, done, in_progress, draft |
canceled_reason_id | string | No | |
with_transactions | boolean | No | Default: false |
with_cashbacks | boolean | No | Default: false |
{
"_id": "64b7f4d9e2b3b6a0b7c5d80a",
"state": "new",
"canceled_reason_id": "64b7f4d9e2b3b6a0b7c5d80a",
"with_transactions": false,
"with_cashbacks": false
}Response
Same response shape as POST /trade/create.
PUT /trade/set-state-id
setState trade by id
Request body
| Field | Type | Required | Description |
|---|---|---|---|
_id | string | Yes | |
state_id | string | Yes | |
with_transactions | boolean | No | Default: false |
with_cashbacks | boolean | No | Default: false |
{
"_id": "64b7f4d9e2b3b6a0b7c5d80a",
"state_id": "string",
"with_transactions": false,
"with_cashbacks": false
}Response
Same response shape as POST /trade/create.
POST /trade/refund
Refund a trade (full or partial).
Request body
| Field | Type | Required | Description |
|---|---|---|---|
trade_id | string | Yes | |
items | object[] | Yes | |
items[].product_id | string | Yes | |
items[].amount | number | Yes | |
items[].cost | number | No | |
note | string | No | |
with_transactions | boolean | No | Default: false |
{
"trade_id": "64b7f4d9e2b3b6a0b7c5d80a",
"items": [
{
"product_id": "string",
"amount": 0,
"cost": 0
}
],
"note": "string",
"with_transactions": false
}Response
Same response shape as POST /trade/create.
GET /trade/get-by-id/for-bot/{id}
Get a trade by _id, formatted for bot/external consumption.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes |
Request body
No request body.
Response
Same response shape as POST /trade/create.
GET /trade/get-items/{id}
Get the line items of a trade.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes |
Request body
No request body.
Response
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": [
{
"_id": "string",
"product_id": "string",
"amount": 0,
"cost": 0,
"price": 0
}
],
"time": "2025-05-01T12:00:00Z"
}POST /trade/export-by-xls-template
Export filtered trades using a configured XLS template. Returns a download path.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
template_id | string | Yes | ID of the configured XLS template. |
date_from | string (date-time) | No | |
date_to | string (date-time) | No | |
organization_ids | string[] | No | |
customer_ids | string[] | No | |
states | string[] | No |
{
"template_id": "string",
"date_from": "2025-05-01T12:00:00Z",
"date_to": "2025-05-01T12:00:00Z",
"organization_ids": [
"string"
],
"customer_ids": [
"string"
],
"states": [
"string"
]
}Response
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": "string",
"time": "2025-05-01T12:00:00Z"
}POST /trade/custom-fields/set
Set / update the _custom_fields map on a trade.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
_id | string | Yes | |
_custom_fields | object | Yes | Map of custom-field codes to their values. |
{
"_id": "64b7f4d9e2b3b6a0b7c5d80a",
"_custom_fields": {}
}Response
Same response shape as POST /trade/create.
POST /trade/get-by-id
Fetch a single trade by ObjectId, passing the id in the request body instead of the path. Returns the same compact payload as GET /trade/get-by-id/for-bot/{id}, NOT the fuller shape of GET /trade/get-by-id/{id} — use the GET form when you need the full trade.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
_id | string | Yes | Trade ObjectId (required). |
{
"_id": "64b7f4d9e2b3b6a0b7c5d80a"
}Response
Same response shape as POST /trade/create.
This page is generated from the OpenAPI spec.