Skip to content

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

FieldTypeRequiredDescription
codestringNo
organization_idstringYes
order_idstringNo
open_ticket_idstringNo
open_ticket_uuidstringNo
statestringYesOne of: new, canceled, done, draft, is_progress
customer_idstringNo
customer_assistant_idstringNo
state_idstringNo
responsible_idstringYes
courier_idstringNo
currencyobjectYes
currency._idstringYes
currency.namestringYes
currency.valuenumberYes
currency.sidestringNoOne of: start, end
currency.symbolstringNo
price_idstringNo
by_balanceobject[]Yes
by_balance[].amountnumberYes
by_balance[].currencyobjectYes
by_balance[].currency._idstringYes
by_balance[].currency.namestringYes
by_balance[].currency.valuenumberYes
by_balance[].currency.sidestringNoOne of: start, end
by_balance[].currency.symbolstringNo
by_balance[].paidnumberNo
paymentsobject[]Yes
payments[].external_transaction_idstringNo
payments[].amountnumberYes
payments[].payment_methodobjectYes
payments[].payment_method._idstringYes
payments[].payment_method.namestringYes
payments[].payment_method.typestringNoCopy 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[].currencyobjectYes
payments[].currency._idstringYes
payments[].currency.namestringYes
payments[].currency.valuenumberYes
payments[].currency.sidestringNoOne of: start, end
payments[].currency.symbolstringNo
payments[].paidnumberNo
applied_cashbacksobject[]Yes
applied_cashbacks[].amountnumberYes
applied_cashbacks[].currencyobjectNo
applied_cashbacks[].currency._idstringYes
applied_cashbacks[].currency.namestringYes
applied_cashbacks[].currency.valuenumberYes
applied_cashbacks[].currency.sidestringNoOne of: start, end
applied_cashbacks[].currency.symbolstringNo
applied_cashbacks[].paidnumberYes
changesobject[]Yes
changes[].external_transaction_idstringNo
changes[].amountnumberYes
changes[].payment_methodobjectYes
changes[].payment_method._idstringYes
changes[].payment_method.namestringYes
changes[].payment_method.typestringNoCopy 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[].currencyobjectYes
changes[].currency._idstringYes
changes[].currency.namestringYes
changes[].currency.valuenumberYes
changes[].currency.sidestringNoOne of: start, end
changes[].currency.symbolstringNo
changes[].paidnumberNo
notestringNo
productsobject[]Yes
products[].product_idstringYes
products[].order_item_idstringNo
products[].amountnumberYes
products[].box_countnumberNo
products[].box_itemnumberNo
products[].pricenumberYes
products[].total_to_paynumberNo
products[].discountsobject[]Yes
products[].discounts[]._idstringYes
products[].discounts[].is_custombooleanYes
products[].discounts[].valuenumberYes
products[].discounts[].namestringYes
products[].discounts[].apply_typestringYesOne of: percent, cash
products[].marksstring[]Yes
products[].costnumberNo
products[].tax_idsstring[]No
products[].notestringNo
products[].extra_costsobject[]Yes
products[].extra_costs[].cost_idstringYes
products[].extra_costs[].amountnumberYes
products[].warehouse_idstringYes
products[].price_idstringNo
datestring (date-time)Yes
paying_datestring (date-time)No
delivery_datestring (date-time)No
delivery_addressobjectNo
delivery_address.human_addressobjectNo
delivery_address.human_address.addressstringNo
delivery_address.human_address.citystringNo
delivery_address.human_address.statestringNo
delivery_address.human_address.zipstringNo
delivery_address.latnumberNo
delivery_address.longnumberNo
warehouse_idstringNo
discountsobject[]Yes
discounts[]._idstringYes
discounts[].is_custombooleanYes
discounts[].valuenumberYes
discounts[].namestringYes
discounts[].apply_typestringYesOne of: percent, cash
cover_by_balancebooleanNo
calc_tax_after_discountbooleanNo
installment_plan_intervalstringYesOne of: year, month
installment_planobject[]No
installment_plan[].datestring (date-time)Yes
installment_plan[].amountnumberYes
additional_costsobject[]Yes
additional_costs[].cost_idstringYes
additional_costs[].amountnumberYes
additional_costs[].customer_idstringNo
additional_costs[].employee_idstringNo
additional_costs[].supplier_idstringNo
additional_costs[].person_idstringNo
currency_valuesobject[]Yes
currency_values[].to_currency_idstringYes
currency_values[].denominatorstringYes
currency_values[].numeratornumberYes
to_send_customerbooleanNo
contract_idstringNo
json
{
  "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

FieldTypeDescription
created_atstring
updated_atstring
codestring
uuidstring
open_ticket_uuidstring
organization_idstring
organizationobject
organization._idstring
organization.namestring
warehouse_idstring
warehouseobject
warehouse._idstring
warehouse.namestring
customer_idstring
customerobject
customer._idstring
customer.namestring
customer.typestring
customer.phone_numberstring
customer.innstring
customer.addressstring
customer.descriptionstring
customer.delivery_addressobject
customer.delivery_address.latnumber
customer.delivery_address.longnumber
customer.delivery_address.human_addressobject
customer_assistantobject
customer_assistant._idstring
customer_assistant.namestring
customer_assistant.typestring
customer_assistant_hierarchystring
responsible_idstring
notestring
responsibleobject
responsible._idstring
responsible.full_namestring
responsible.phone_numberstring
created_byobject
created_by._idstring
created_by.full_namestring
statestring
dynamic_statestring
is_refundboolean
is_trashboolean
refund_idstring
numberstring
deviceobject
device._idstring
device.namestring
device.device_idstring
currencyobject
currency_idstring
additional_costsobject[]
additional_costs[].cost_idstring
additional_costs[].payment_type_idstring
additional_costs[].payment_typeobject
additional_costs[].amountnumber
additional_costs[].employeeobject
additional_costs[].supplierobject
additional_costs[].customerobject
additional_costs[].personobject
additional_costs[].costobject
additional_costs[].price_idstring
additional_costs[].employee_assistant_idstring
additional_costs[].employee_assistant_hierarchyobject[]
additional_costs[].supplier_assistant_idstring
additional_costs[].supplier_assistant_hierarchyobject[]
additional_costs[].customer_assistant_idstring
additional_costs[].customer_assistant_hierarchyobject[]
additional_costs[].person_assistant_idstring
additional_costs[].person_assistant_hierarchyobject[]
additional_costs[].is_method_summary_zeroboolean
additional_costs[].item_countnumber
total_extra_costnumber
total_effected_extra_costnumber
currency_valuesobject
currency_values.to_currency_idstring
currency_values.numeratornumber
currency_values.denominatornumber
price_idnumber
priceobject
price._idstring
price.namestring
price.short_namestring
price.codestring
invoiceobject
invoice._idstring
invoice.to_be_paidnumber
invoice.paidnumber
invoice.paid_by_balancenumber
invoice.paid_by_cashbacknumber
invoice.to_be_refundednumber
invoice.refundednumber
invoice.numberstring
invoice.paid_statestring
invoice.installment_plan_intervalstring
invoice.periodnumber
invoice.trade_idstring
invoice.itemsobject
invoice.items._idstring
invoice.items.to_be_paidnumber
invoice.items.paidnumber
invoice.items.paid_by_balancenumber
invoice.items.paid_by_cashbacknumber
invoice.items.to_be_refundednumber
invoice.items.refundednumber
invoice.items.is_initial_paymentboolean
invoice.items.numberstring
invoice.items.paid_statestring
invoice.items.datestring
invoice.currency_idstring
invoice.payment_type_idstring
invoice.is_refundboolean
invoice.typestring
invoice.payment_typeobject
invoice.payment_type._idstring
invoice.payment_type.namestring
paymentsobject
payments.payment_methodobject
payments.payment_method._idstring
payments.payment_method.typestring
payments.payment_method.namestring
payments.amountnumber
payments.paidnumber
payments.currencyobject
payments.currency._idstring
payments.currency.uuidnumber
payments.currency.namestring
payments.currency.valuenumber
payments.currency.symbolstring
payments.currency.sidestring
payments.base_currencyobject
payments.base_currency.numeratornumber
payments.base_currency.denominatornumber
payments.base_currency_valuenumber
applied_cashbacksobject[]
applied_cashbacks[]._idstring
applied_cashbacks[].amountnumber
applied_cashbacks[].currencyobject
applied_cashbacks[].currency._idstring
applied_cashbacks[].currency.to_currency_idstring
applied_cashbacks[].currency.uuidnumber
applied_cashbacks[].currency.namestring
applied_cashbacks[].currency.valuenumber
applied_cashbacks[].currency.symbolstring
applied_cashbacks[].currency.sidestring
applied_cashbacks[].currency.numeratornumber
applied_cashbacks[].currency.denominatornumber
applied_cashbacks[].currency.round_typestring
applied_cashbacks[].currency.precisionnumber
applied_cashbacks[].paidnumber
applied_cashbacks[].base_currencyobject
applied_cashbacks[].base_currency.numeratornumber
applied_cashbacks[].base_currency.denominatornumber
applied_cashbacks[].installment_plan_changesobject[]
applied_cashbacks[].installment_plan_changes[].invoice_idstring
applied_cashbacks[].installment_plan_changes[].amountnumber
earned_cashbackobject
earned_cashback._idstring
earned_cashback.amountnumber
earned_cashback.currencyobject
earned_cashback.currency._idstring
earned_cashback.currency.to_currency_idstring
earned_cashback.currency.uuidnumber
earned_cashback.currency.namestring
earned_cashback.currency.valuenumber
earned_cashback.currency.symbolstring
earned_cashback.currency.sidestring
earned_cashback.currency.numeratornumber
earned_cashback.currency.denominatornumber
earned_cashback.currency.round_typestring
earned_cashback.currency.precisionnumber
earned_cashback.base_currencyobject
earned_cashback.base_currency.numeratornumber
earned_cashback.base_currency.denominatornumber
changesobject[]
changes[].payment_methodobject
changes[].payment_method._idstring
changes[].payment_method.typestring
changes[].payment_method.namestring
changes[].amountnumber
changes[].paidnumber
changes[].currencyobject
changes[].currency._idstring
changes[].currency.to_currency_idstring
changes[].currency.uuidnumber
changes[].currency.namestring
changes[].currency.valuenumber
changes[].currency.symbolstring
changes[].currency.sidestring
changes[].currency.numeratornumber
changes[].currency.denominatornumber
changes[].currency.round_typestring
changes[].currency.precisionnumber
changes[].base_currencyobject
changes[].base_currency.numeratornumber
changes[].base_currency.denominatornumber
changes[].base_currency_valuenumber
total_amountnumber
total_refunded_amountnumber
total_to_paynumber
total_to_refundnumber
debtnumber
total_pricenumber
total_added_taxnumber
total_included_taxnumber
discountnumber
total_discountnumber
discountsobject[]
discounts[].is_custombooleanDefault: false
discounts[]._idstring
discounts[].namestring
discounts[].valuenumber
discounts[].apply_typestringOne of: percent, cash
discounts[].currency_idstring
discounts[].value_in_percentnumberDefault: 0
changenumber
delivery_datestring
sold_atstring
is_report_savedboolean
productsobject
installment_planobject
installment_plan.datestring
installment_plan.amountnumber
is_installment_planboolean
reasonobject
reason._idstring
reason.namestring
reason.descriptionstring
contract_idstring
by_balanceobject[]
by_balance[]._idstring
by_balance[].amountnumber
by_balance[].paidnumber
by_balance[].currencyobject
by_balance[].currency._idstring
by_balance[].currency.to_currency_idstring
by_balance[].currency.uuidnumber
by_balance[].currency.namestring
by_balance[].currency.valuenumber
by_balance[].currency.symbolstring
by_balance[].currency.sidestring
by_balance[].currency.numeratornumber
by_balance[].currency.denominatornumber
by_balance[].currency.round_typestring
by_balance[].currency.precisionnumber
by_balance[].base_currencyobject
by_balance[].base_currency.numeratornumber
by_balance[].base_currency.denominatornumber
by_balance[].installment_plan_changesobject[]
by_balance[].installment_plan_changes[].invoice_idstring
by_balance[].installment_plan_changes[].amountnumber
calc_tax_after_discountboolean
calc_sale_discount_after_productboolean
contractobject
contract._idstring
contract.created_atstring
contract.codestring
contract.namestring
contract.numberstring
contract.currency_idstring
contract.organization_idstring
contract.amountnumber
contract.datestring
contract.expire_datestring
contract.person_idstring
contract.notestring
contract.is_activeboolean
contract.contract_numbernumber
customer_before_balanceobject[]
customer_before_balance[]._idstring
customer_before_balance[].currency_idstring
customer_before_balance[].amountnumber
customer_before_balance[].organization_idstring
customer_before_balance[].payment_method_idstring
cashback_before_balanceobject[]
cashback_before_balance[]._idstring
cashback_before_balance[].customer_idstring
cashback_before_balance[].person_idstring
cashback_before_balance[].currency_idstring
cashback_before_balance[].amountnumber
customer_after_balanceobject[]
customer_after_balance[]._idstring
customer_after_balance[].currency_idstring
customer_after_balance[].amountnumber
customer_after_balance[].organization_idstring
customer_after_balance[].payment_method_idstring
cashback_after_balanceobject[]
cashback_after_balance[]._idstring
cashback_after_balance[].customer_idstring
cashback_after_balance[].person_idstring
cashback_after_balance[].currency_idstring
cashback_after_balance[].amountnumber
delivery_addressobject
delivery_address.latnumber
delivery_address.longnumber
delivery_address.human_addressobject
delivery_address.human_address.addressstring
delivery_address.human_address.citystring
delivery_address.human_address.statestring
delivery_address.human_address.zipstring
order_idstring
orderobject
order._idstring
order.numberstring
order.codestring
delivery_orderobject
delivery_order._idstring
delivery_order.numberstring
delivery_order.codestring
delivery_order.statestring
refundobject
refund.created_atstring
refund.updated_atstring
refund.codestring
refund.uuidstring
refund.open_ticket_uuidstring
refund.organization_idstring
refund.organizationobject
refund.organization._idstring
refund.organization.namestring
refund.warehouse_idstring
refund.warehouseobject
refund.warehouse._idstring
refund.warehouse.namestring
refund.customer_idstring
refund.customerobject
refund.customer._idstring
refund.customer.namestring
refund.customer.typestring
refund.customer.phone_numberstring
refund.customer.innstring
refund.customer.addressstring
refund.customer.descriptionstring
refund.customer.delivery_addressobject
refund.customer_assistantobject
refund.customer_assistant._idstring
refund.customer_assistant.namestring
refund.customer_assistant.typestring
refund.customer_assistant_hierarchystring
refund.responsible_idstring
refund.notestring
refund.responsibleobject
refund.responsible._idstring
refund.responsible.full_namestring
refund.responsible.phone_numberstring
refund.created_byobject
refund.created_by._idstring
refund.created_by.full_namestring
refund.statestring
refund.dynamic_statestring
refund.is_refundboolean
refund.is_trashboolean
refund.refund_idstring
refund.numberstring
refund.deviceobject
refund.device._idstring
refund.device.namestring
refund.device.device_idstring
refund.currencyobject
refund.currency_idstring
refund.additional_costsobject[]
refund.additional_costs[].cost_idstring
refund.additional_costs[].payment_type_idstring
refund.additional_costs[].payment_typeobject
refund.additional_costs[].amountnumber
refund.additional_costs[].employeeobject
refund.additional_costs[].supplierobject
refund.additional_costs[].customerobject
refund.additional_costs[].personobject
refund.additional_costs[].costobject
refund.additional_costs[].price_idstring
refund.additional_costs[].employee_assistant_idstring
refund.additional_costs[].employee_assistant_hierarchyobject[]
refund.additional_costs[].supplier_assistant_idstring
refund.additional_costs[].supplier_assistant_hierarchyobject[]
refund.additional_costs[].customer_assistant_idstring
refund.additional_costs[].customer_assistant_hierarchyobject[]
refund.additional_costs[].person_assistant_idstring
refund.additional_costs[].person_assistant_hierarchyobject[]
refund.additional_costs[].is_method_summary_zeroboolean
refund.additional_costs[].item_countnumber
refund.total_extra_costnumber
refund.total_effected_extra_costnumber
refund.currency_valuesobject
refund.currency_values.to_currency_idstring
refund.currency_values.numeratornumber
refund.currency_values.denominatornumber
refund.price_idnumber
refund.priceobject
refund.price._idstring
refund.price.namestring
refund.price.short_namestring
refund.price.codestring
refund.invoiceobject
refund.invoice._idstring
refund.invoice.to_be_paidnumber
refund.invoice.paidnumber
refund.invoice.paid_by_balancenumber
refund.invoice.paid_by_cashbacknumber
refund.invoice.to_be_refundednumber
refund.invoice.refundednumber
refund.invoice.numberstring
refund.invoice.paid_statestring
refund.invoice.installment_plan_intervalstring
refund.invoice.periodnumber
refund.invoice.trade_idstring
refund.invoice.itemsobject
refund.invoice.currency_idstring
refund.invoice.payment_type_idstring
refund.invoice.is_refundboolean
refund.invoice.typestring
refund.invoice.payment_typeobject
refund.paymentsobject
refund.payments.payment_methodobject
refund.payments.amountnumber
refund.payments.paidnumber
refund.payments.currencyobject
refund.payments.base_currencyobject
refund.payments.base_currency_valuenumber
refund.applied_cashbacksobject[]
refund.applied_cashbacks[]._idstring
refund.applied_cashbacks[].amountnumber
refund.applied_cashbacks[].currencyobject
refund.applied_cashbacks[].paidnumber
refund.applied_cashbacks[].base_currencyobject
refund.applied_cashbacks[].installment_plan_changesobject[]
refund.earned_cashbackobject
refund.earned_cashback._idstring
refund.earned_cashback.amountnumber
refund.earned_cashback.currencyobject
refund.earned_cashback.base_currencyobject
refund.changesobject[]
refund.changes[].payment_methodobject
refund.changes[].amountnumber
refund.changes[].paidnumber
refund.changes[].currencyobject
refund.changes[].base_currencyobject
refund.changes[].base_currency_valuenumber
refund.total_amountnumber
refund.total_refunded_amountnumber
refund.total_to_paynumber
refund.total_to_refundnumber
refund.debtnumber
refund.total_pricenumber
refund.total_added_taxnumber
refund.total_included_taxnumber
refund.discountnumber
refund.total_discountnumber
refund.discountsobject[]
refund.discounts[].is_custombooleanDefault: false
refund.discounts[]._idstring
refund.discounts[].namestring
refund.discounts[].valuenumber
refund.discounts[].apply_typestringOne of: percent, cash
refund.discounts[].currency_idstring
refund.discounts[].value_in_percentnumberDefault: 0
refund.changenumber
refund.delivery_datestring
refund.sold_atstring
refund.is_report_savedboolean
refund.productsobject
refund.installment_planobject
refund.installment_plan.datestring
refund.installment_plan.amountnumber
refund.is_installment_planboolean
refund.reasonobject
refund.reason._idstring
refund.reason.namestring
refund.reason.descriptionstring
refund.contract_idstring
refund.by_balanceobject[]
refund.by_balance[]._idstring
refund.by_balance[].amountnumber
refund.by_balance[].paidnumber
refund.by_balance[].currencyobject
refund.by_balance[].base_currencyobject
refund.by_balance[].installment_plan_changesobject[]
refund.calc_tax_after_discountboolean
refund.calc_sale_discount_after_productboolean
refund.contractobject
refund.contract._idstring
refund.contract.created_atstring
refund.contract.codestring
refund.contract.namestring
refund.contract.numberstring
refund.contract.currency_idstring
refund.contract.organization_idstring
refund.contract.amountnumber
refund.contract.datestring
refund.contract.expire_datestring
refund.contract.person_idstring
refund.contract.notestring
refund.contract.is_activeboolean
refund.contract.contract_numbernumber
refund.customer_before_balanceobject[]
refund.customer_before_balance[]._idstring
refund.customer_before_balance[].currency_idstring
refund.customer_before_balance[].amountnumber
refund.customer_before_balance[].organization_idstring
refund.customer_before_balance[].payment_method_idstring
refund.cashback_before_balanceobject[]
refund.cashback_before_balance[]._idstring
refund.cashback_before_balance[].customer_idstring
refund.cashback_before_balance[].person_idstring
refund.cashback_before_balance[].currency_idstring
refund.cashback_before_balance[].amountnumber
refund.customer_after_balanceobject[]
refund.customer_after_balance[]._idstring
refund.customer_after_balance[].currency_idstring
refund.customer_after_balance[].amountnumber
refund.customer_after_balance[].organization_idstring
refund.customer_after_balance[].payment_method_idstring
refund.cashback_after_balanceobject[]
refund.cashback_after_balance[]._idstring
refund.cashback_after_balance[].customer_idstring
refund.cashback_after_balance[].person_idstring
refund.cashback_after_balance[].currency_idstring
refund.cashback_after_balance[].amountnumber
refund.delivery_addressobject
refund.delivery_address.latnumber
refund.delivery_address.longnumber
refund.delivery_address.human_addressobject
refund.order_idstring
refund.orderobject
refund.order._idstring
refund.order.numberstring
refund.order.codestring
refund.delivery_orderobject
refund.delivery_order._idstring
refund.delivery_order.numberstring
refund.delivery_order.codestring
refund.delivery_order.statestring
refundsobject[]
refunds[].created_atstring
refunds[].updated_atstring
refunds[].codestring
refunds[].uuidstring
refunds[].open_ticket_uuidstring
refunds[].organization_idstring
refunds[].organizationobject
refunds[].organization._idstring
refunds[].organization.namestring
refunds[].warehouse_idstring
refunds[].warehouseobject
refunds[].warehouse._idstring
refunds[].warehouse.namestring
refunds[].customer_idstring
refunds[].customerobject
refunds[].customer._idstring
refunds[].customer.namestring
refunds[].customer.typestring
refunds[].customer.phone_numberstring
refunds[].customer.innstring
refunds[].customer.addressstring
refunds[].customer.descriptionstring
refunds[].customer.delivery_addressobject
refunds[].customer_assistantobject
refunds[].customer_assistant._idstring
refunds[].customer_assistant.namestring
refunds[].customer_assistant.typestring
refunds[].customer_assistant_hierarchystring
refunds[].responsible_idstring
refunds[].notestring
refunds[].responsibleobject
refunds[].responsible._idstring
refunds[].responsible.full_namestring
refunds[].responsible.phone_numberstring
refunds[].created_byobject
refunds[].created_by._idstring
refunds[].created_by.full_namestring
refunds[].statestring
refunds[].dynamic_statestring
refunds[].is_refundboolean
refunds[].is_trashboolean
refunds[].refund_idstring
refunds[].numberstring
refunds[].deviceobject
refunds[].device._idstring
refunds[].device.namestring
refunds[].device.device_idstring
refunds[].currencyobject
refunds[].currency_idstring
refunds[].additional_costsobject[]
refunds[].additional_costs[].cost_idstring
refunds[].additional_costs[].payment_type_idstring
refunds[].additional_costs[].payment_typeobject
refunds[].additional_costs[].amountnumber
refunds[].additional_costs[].employeeobject
refunds[].additional_costs[].supplierobject
refunds[].additional_costs[].customerobject
refunds[].additional_costs[].personobject
refunds[].additional_costs[].costobject
refunds[].additional_costs[].price_idstring
refunds[].additional_costs[].employee_assistant_idstring
refunds[].additional_costs[].employee_assistant_hierarchyobject[]
refunds[].additional_costs[].supplier_assistant_idstring
refunds[].additional_costs[].supplier_assistant_hierarchyobject[]
refunds[].additional_costs[].customer_assistant_idstring
refunds[].additional_costs[].customer_assistant_hierarchyobject[]
refunds[].additional_costs[].person_assistant_idstring
refunds[].additional_costs[].person_assistant_hierarchyobject[]
refunds[].additional_costs[].is_method_summary_zeroboolean
refunds[].additional_costs[].item_countnumber
refunds[].total_extra_costnumber
refunds[].total_effected_extra_costnumber
refunds[].currency_valuesobject
refunds[].currency_values.to_currency_idstring
refunds[].currency_values.numeratornumber
refunds[].currency_values.denominatornumber
refunds[].price_idnumber
refunds[].priceobject
refunds[].price._idstring
refunds[].price.namestring
refunds[].price.short_namestring
refunds[].price.codestring
refunds[].invoiceobject
refunds[].invoice._idstring
refunds[].invoice.to_be_paidnumber
refunds[].invoice.paidnumber
refunds[].invoice.paid_by_balancenumber
refunds[].invoice.paid_by_cashbacknumber
refunds[].invoice.to_be_refundednumber
refunds[].invoice.refundednumber
refunds[].invoice.numberstring
refunds[].invoice.paid_statestring
refunds[].invoice.installment_plan_intervalstring
refunds[].invoice.periodnumber
refunds[].invoice.trade_idstring
refunds[].invoice.itemsobject
refunds[].invoice.currency_idstring
refunds[].invoice.payment_type_idstring
refunds[].invoice.is_refundboolean
refunds[].invoice.typestring
refunds[].invoice.payment_typeobject
refunds[].paymentsobject
refunds[].payments.payment_methodobject
refunds[].payments.amountnumber
refunds[].payments.paidnumber
refunds[].payments.currencyobject
refunds[].payments.base_currencyobject
refunds[].payments.base_currency_valuenumber
refunds[].applied_cashbacksobject[]
refunds[].applied_cashbacks[]._idstring
refunds[].applied_cashbacks[].amountnumber
refunds[].applied_cashbacks[].currencyobject
refunds[].applied_cashbacks[].paidnumber
refunds[].applied_cashbacks[].base_currencyobject
refunds[].applied_cashbacks[].installment_plan_changesobject[]
refunds[].earned_cashbackobject
refunds[].earned_cashback._idstring
refunds[].earned_cashback.amountnumber
refunds[].earned_cashback.currencyobject
refunds[].earned_cashback.base_currencyobject
refunds[].changesobject[]
refunds[].changes[].payment_methodobject
refunds[].changes[].amountnumber
refunds[].changes[].paidnumber
refunds[].changes[].currencyobject
refunds[].changes[].base_currencyobject
refunds[].changes[].base_currency_valuenumber
refunds[].total_amountnumber
refunds[].total_refunded_amountnumber
refunds[].total_to_paynumber
refunds[].total_to_refundnumber
refunds[].debtnumber
refunds[].total_pricenumber
refunds[].total_added_taxnumber
refunds[].total_included_taxnumber
refunds[].discountnumber
refunds[].total_discountnumber
refunds[].discountsobject[]
refunds[].discounts[].is_custombooleanDefault: false
refunds[].discounts[]._idstring
refunds[].discounts[].namestring
refunds[].discounts[].valuenumber
refunds[].discounts[].apply_typestringOne of: percent, cash
refunds[].discounts[].currency_idstring
refunds[].discounts[].value_in_percentnumberDefault: 0
refunds[].changenumber
refunds[].delivery_datestring
refunds[].sold_atstring
refunds[].is_report_savedboolean
refunds[].productsobject
refunds[].installment_planobject
refunds[].installment_plan.datestring
refunds[].installment_plan.amountnumber
refunds[].is_installment_planboolean
refunds[].reasonobject
refunds[].reason._idstring
refunds[].reason.namestring
refunds[].reason.descriptionstring
refunds[].contract_idstring
refunds[].by_balanceobject[]
refunds[].by_balance[]._idstring
refunds[].by_balance[].amountnumber
refunds[].by_balance[].paidnumber
refunds[].by_balance[].currencyobject
refunds[].by_balance[].base_currencyobject
refunds[].by_balance[].installment_plan_changesobject[]
refunds[].calc_tax_after_discountboolean
refunds[].calc_sale_discount_after_productboolean
refunds[].contractobject
refunds[].contract._idstring
refunds[].contract.created_atstring
refunds[].contract.codestring
refunds[].contract.namestring
refunds[].contract.numberstring
refunds[].contract.currency_idstring
refunds[].contract.organization_idstring
refunds[].contract.amountnumber
refunds[].contract.datestring
refunds[].contract.expire_datestring
refunds[].contract.person_idstring
refunds[].contract.notestring
refunds[].contract.is_activeboolean
refunds[].contract.contract_numbernumber
refunds[].customer_before_balanceobject[]
refunds[].customer_before_balance[]._idstring
refunds[].customer_before_balance[].currency_idstring
refunds[].customer_before_balance[].amountnumber
refunds[].customer_before_balance[].organization_idstring
refunds[].customer_before_balance[].payment_method_idstring
refunds[].cashback_before_balanceobject[]
refunds[].cashback_before_balance[]._idstring
refunds[].cashback_before_balance[].customer_idstring
refunds[].cashback_before_balance[].person_idstring
refunds[].cashback_before_balance[].currency_idstring
refunds[].cashback_before_balance[].amountnumber
refunds[].customer_after_balanceobject[]
refunds[].customer_after_balance[]._idstring
refunds[].customer_after_balance[].currency_idstring
refunds[].customer_after_balance[].amountnumber
refunds[].customer_after_balance[].organization_idstring
refunds[].customer_after_balance[].payment_method_idstring
refunds[].cashback_after_balanceobject[]
refunds[].cashback_after_balance[]._idstring
refunds[].cashback_after_balance[].customer_idstring
refunds[].cashback_after_balance[].person_idstring
refunds[].cashback_after_balance[].currency_idstring
refunds[].cashback_after_balance[].amountnumber
refunds[].delivery_addressobject
refunds[].delivery_address.latnumber
refunds[].delivery_address.longnumber
refunds[].delivery_address.human_addressobject
refunds[].order_idstring
refunds[].orderobject
refunds[].order._idstring
refunds[].order.numberstring
refunds[].order.codestring
refunds[].delivery_orderobject
refunds[].delivery_order._idstring
refunds[].delivery_order.numberstring
refunds[].delivery_order.codestring
refunds[].delivery_order.statestring
json
{
  "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

ParameterTypeRequiredDescription
idstringYes

Request body

No request body.

Response

Same response shape as POST /trade/create.

POST /trade/get-paging ​

Get trades by paging

Request body

FieldTypeRequiredDescription
pagenumberYesDefault: 1
limitnumberYesDefault: 20
product_idstringNo
total_fromnumberNo
total_tonumberNo
customer_idstringNo
currency_idstringNo
is_fully_refundedbooleanNo
responsible_idstringNo
statesstring[]No
state_idstringNo
is_refundbooleanNo
organization_idstringNo
searchstringNo
typestringNoOne of: b2b, b2c
contract_idstringNo
updated_atstring (date-time)No
created_bystringNo
json
{
  "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.

FieldTypeDescription
created_atstring
updated_atstring
codestring
uuidstring
organizationobject
organization._idstring
organization.namestring
customerobject
customer._idstring
customer.namestring
notestring
responsibleobject
responsible._idstring
responsible.full_namestring
created_byobject
created_by._idstring
created_by.full_namestring
statestring
state_idstring
numberstring
currency_idstring
earned_cashbackobject
earned_cashback._idstring
earned_cashback.amountnumber
earned_cashback.currencyobject
earned_cashback.currency._idstring
earned_cashback.currency.to_currency_idstring
earned_cashback.currency.uuidnumber
earned_cashback.currency.namestring
earned_cashback.currency.valuenumber
earned_cashback.currency.symbolstring
earned_cashback.currency.sidestring
earned_cashback.currency.numeratornumber
earned_cashback.currency.denominatornumber
earned_cashback.currency.round_typestring
earned_cashback.currency.precisionnumber
earned_cashback.base_currencyobject
earned_cashback.base_currency.numeratornumber
earned_cashback.base_currency.denominatornumber
total_amountnumber
total_refunded_amountnumber
total_to_paynumber
total_discountnumber
debtnumber
total_pricenumber
total_added_taxnumber
contractobject
contract._idstring
contract.codestring
contract.namestring
contract.numberstring
contract.currency_idstring
contract.organization_idstring
contract.amountnumber
contract.datestring
contract.expire_datestring
contract.person_idstring
contract.notestring
contract.is_activeboolean
contract.contract_numbernumber
positionnumber
order_idstring
datestring
sold_atstring
json
{
  "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

FieldTypeRequiredDescription
_idstringYes
statestringYesOne of: canceled, new, done, in_progress, draft
canceled_reason_idstringNo
with_transactionsbooleanNoDefault: false
with_cashbacksbooleanNoDefault: false
json
{
  "_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

FieldTypeRequiredDescription
_idstringYes
state_idstringYes
with_transactionsbooleanNoDefault: false
with_cashbacksbooleanNoDefault: false
json
{
  "_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

FieldTypeRequiredDescription
trade_idstringYes
itemsobject[]Yes
items[].product_idstringYes
items[].amountnumberYes
items[].costnumberNo
notestringNo
with_transactionsbooleanNoDefault: false
json
{
  "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

ParameterTypeRequiredDescription
idstringYes

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

ParameterTypeRequiredDescription
idstringYes

Request body

No request body.

Response

json
{
  "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

FieldTypeRequiredDescription
template_idstringYesID of the configured XLS template.
date_fromstring (date-time)No
date_tostring (date-time)No
organization_idsstring[]No
customer_idsstring[]No
statesstring[]No
json
{
  "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

json
{
  "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

FieldTypeRequiredDescription
_idstringYes
_custom_fieldsobjectYesMap of custom-field codes to their values.
json
{
  "_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

FieldTypeRequiredDescription
_idstringYesTrade ObjectId (required).
json
{
  "_id": "64b7f4d9e2b3b6a0b7c5d80a"
}

Response

Same response shape as POST /trade/create.


This page is generated from the OpenAPI spec.

Bito 2.0 Integration API