Sales Order
A customer's order taken before the goods are handed over: a web, phone or call-centre order, a click and collect, a special order.
Area: Sales and returns · Why it is here: recipe call_centre_orders; recipe click_and_collect; sample S16; sample S33; sample S35; sample S39; retail core · Fields: 104 · Submitted (booked) records: send docstatus: 1 to book it as you create it, or submit a draft with submit.
Read and write it
Every call runs as your app's own user, with its key in one header, at the retailer's own address. The user reads and writes only what its role allows: your app's user, and the rights the retailer gives it.
Read a list (only name unless you ask for fields):
curl -s "https://⟨site⟩/api/resource/Sales%20Order?fields=%5B%22*%22%5D&limit_page_length=20" \
-H "Authorization: token ⟨api key⟩:⟨api secret⟩"
Read one, with its tables:
curl -s "https://⟨site⟩/api/resource/Sales%20Order/⟨name⟩" -H "Authorization: token ⟨api key⟩:⟨api secret⟩"
Create one (the required fields first), if your app's role may:
curl -s -X POST "https://⟨site⟩/api/resource/Sales%20Order" -H "Authorization: token ⟨api key⟩:⟨api secret⟩" \
-H "Content-Type: application/json" -d '{"naming_series": …, "customer": …, "order_type": …, "transaction_date": …, "company": …, "currency": …}'
Change one with PUT /api/resource/Sales%20Order/⟨name⟩ and the fields you change; a table sent there replaces its rows, so send its existing rows too. All the record calls and their answers: the API reference.
Samples that use it
s16_pick_route · s33_click_and_collect · s35_call_centre_orders · s39_pharmacy_counter
Fields
Read from the product at POS 2.1.0.667 (till app 60147699c): its own fields, the fields iVendNext adds to it, and iVendNext's changes to any of them. Read-only fields are set by iVendNext; a hidden one is not on the form but can be read. Every record also has name (its id, in the address), owner, creation, modified, modified_by and docstatus (0 a draft, 1 submitted, 2 cancelled), all read-only.
| Field | Field name | Type | Required | Read-only | Hidden | Links to |
|---|---|---|---|---|---|---|
| Title | title |
Data | yes | |||
| Series | naming_series |
Select | yes | one of: SAL-ORD-.YYYY.- | ||
| Customer | customer |
Link | yes | Customer | ||
| Customer Name | customer_name |
Data | yes | |||
| Tax Id | tax_id |
Data | yes | |||
| Order Type | order_type |
Select | yes | one of: Sales, Maintenance, Shopping Cart | ||
| Date | transaction_date |
Date | yes | |||
| Delivery Date | delivery_date |
Date | ||||
| Customer's Purchase Order | po_no |
Data | ||||
| Customer's Purchase Order Date | po_date |
Date | ||||
| Company | company |
Link | yes | Company | ||
| Skip Delivery Note | skip_delivery_note |
Check | yes | |||
| Amended From | amended_from |
Link | yes | yes | Sales Order | |
| Cost Center | cost_center |
Link | Cost Center | |||
| Project | project |
Link | Project | |||
| Currency | currency |
Link | yes | Currency | ||
| Exchange Rate | conversion_rate |
Float | yes | |||
| Price List | selling_price_list |
Link | yes | Price List | ||
| Price List Currency | price_list_currency |
Link | yes | yes | Currency | |
| Price List Exchange Rate | plc_conversion_rate |
Float | yes | |||
| Ignore Pricing Rule | ignore_pricing_rule |
Check | ||||
| Scan Barcode | scan_barcode |
Data | ||||
| Set Source Warehouse | set_warehouse |
Link | Warehouse | |||
| Reserve Stock | reserve_stock |
Check | ||||
| Items | items |
Table | yes | Sales Order Item | ||
| Total Quantity | total_qty |
Float | yes | |||
| Total Net Weight | total_net_weight |
Float | yes | |||
| Total (Company Currency) | base_total |
Currency | yes | |||
| Net Total (Company Currency) | base_net_total |
Currency | yes | |||
| Total | total |
Currency | yes | |||
| Net Total | net_total |
Currency | yes | |||
| Tax Category | tax_category |
Link | Tax Category | |||
| Sales Taxes and Charges Template | taxes_and_charges |
Link | Sales Taxes and Charges Template | |||
| Shipping Rule | shipping_rule |
Link | Shipping Rule | |||
| Incoterm | incoterm |
Link | Incoterm | |||
| Named Place | named_place |
Data | ||||
| Sales Taxes and Charges | taxes |
Table | Sales Taxes and Charges | |||
| Total Taxes and Charges (Company Currency) | base_total_taxes_and_charges |
Currency | yes | |||
| Total Taxes and Charges | total_taxes_and_charges |
Currency | yes | |||
| Grand Total (Company Currency) | base_grand_total |
Currency | yes | |||
| Rounding Adjustment (Company Currency) | base_rounding_adjustment |
Currency | yes | |||
| Rounded Total (Company Currency) | base_rounded_total |
Currency | yes | |||
| In Words (Company Currency) | base_in_words |
Data | yes | |||
| Grand Total | grand_total |
Currency | yes | |||
| Rounding Adjustment | rounding_adjustment |
Currency | yes | |||
| Rounded Total | rounded_total |
Currency | yes | |||
| In Words | in_words |
Data | yes | |||
| Advance Paid | advance_paid |
Currency | yes | |||
| Disable Rounded Total | disable_rounded_total |
Check | ||||
| Apply Additional Discount On | apply_discount_on |
Select | one of: Grand Total, Net Total | |||
| Additional Discount Amount (Company Currency) | base_discount_amount |
Currency | yes | |||
| Coupon Code | coupon_code |
Link | Coupon Code | |||
| Additional Discount Percentage | additional_discount_percentage |
Float | ||||
| Additional Discount Amount | discount_amount |
Currency | ||||
| Promotions (added by iVendNext) | custom_promotions |
Table | yes | Transaction Promotion Bonus Buys Detail | ||
| Taxes and Charges Calculation | other_charges_calculation |
Text Editor | yes | |||
| Packed Items | packed_items |
Table | Packed Item | |||
| Pricing Rule Detail | pricing_rules |
Table | yes | Pricing Rule Detail | ||
| Customer Address | customer_address |
Link | Address | |||
| Address | address_display |
Small Text | yes | |||
| Customer Group | customer_group |
Link | yes | Customer Group | ||
| Territory | territory |
Link | Territory | |||
| Contact Person | contact_person |
Link | Contact | |||
| Contact | contact_display |
Small Text | yes | |||
| Phone | contact_phone |
Data | yes | |||
| Mobile No | contact_mobile |
Small Text | yes | |||
| Contact Email | contact_email |
Data | yes | yes | ||
| Shipping Address Name | shipping_address_name |
Link | Address | |||
| Shipping Address | shipping_address |
Small Text | yes | |||
| Dispatch Address Name | dispatch_address_name |
Link | Address | |||
| Dispatch Address | dispatch_address |
Small Text | yes | |||
| Company Address Name | company_address |
Link | Address | |||
| Company Address | company_address_display |
Small Text | yes | |||
| Company Contact Person | company_contact_person |
Link | Contact | |||
| Payment Terms Template | payment_terms_template |
Link | Payment Terms Template | |||
| Payment Schedule | payment_schedule |
Table | Payment Schedule | |||
| Terms | tc_name |
Link | Terms and Conditions | |||
| Terms and Conditions Details | terms |
Text Editor | ||||
| Status | status |
Select | yes | yes | one of: Draft, On Hold, To Deliver and Bill, To Bill, To Deliver, Completed, Cancelled, Closed | |
| Delivery Status | delivery_status |
Select | yes | one of: Not Delivered, Fully Delivered, Partly Delivered, Closed, Not Applicable | ||
| % Delivered | per_delivered |
Percent | yes | |||
| % Amount Billed | per_billed |
Percent | yes | |||
| % Picked | per_picked |
Percent | yes | |||
| Billing Status | billing_status |
Select | yes | one of: Not Billed, Fully Billed, Partly Billed, Closed | ||
| Sales Partner | sales_partner |
Link | Sales Partner | |||
| Amount Eligible for Commission | amount_eligible_for_commission |
Currency | yes | |||
| Commission Rate | commission_rate |
Float | ||||
| Total Commission | total_commission |
Currency | ||||
| Sales Team | sales_team |
Table | Sales Team | |||
| Loyalty Points | loyalty_points |
Int | yes | yes | ||
| Loyalty Amount | loyalty_amount |
Currency | yes | yes | ||
| From Date | from_date |
Date | ||||
| To Date | to_date |
Date | ||||
| Auto Repeat | auto_repeat |
Link | Auto Repeat | |||
| Letter Head | letter_head |
Link | Letter Head | |||
| Group same items | group_same_items |
Check | ||||
| Print Heading | select_print_heading |
Link | Print Heading | |||
| Print Language | language |
Data | yes | |||
| Is Internal Customer | is_internal_customer |
Check | yes | |||
| Represents Company | represents_company |
Link | yes | Company | ||
| Source | source |
Link | Lead Source | |||
| Inter Company Order Reference | inter_company_order_reference |
Link | yes | Purchase Order | ||
| Campaign | campaign |
Link | Campaign | |||
| Party Account Currency | party_account_currency |
Link | yes | yes | Currency |
Table: Packed Item
The rows of packed_items. Each row also has idx (its place), parent, parentfield and parenttype.
| Field | Field name | Type | Required | Read-only | Hidden | Links to |
|---|---|---|---|---|---|---|
| Parent Item | parent_item |
Link | yes | Item | ||
| Item Code | item_code |
Link | yes | Item | ||
| Item Name | item_name |
Data | yes | |||
| Description | description |
Text Editor | ||||
| From Warehouse | warehouse |
Link | Warehouse | |||
| To Warehouse (Optional) | target_warehouse |
Link | Warehouse | |||
| Conversion Factor | conversion_factor |
Float | ||||
| Qty | qty |
Float | yes | |||
| Rate | rate |
Currency | yes | |||
| UOM | uom |
Link | yes | UOM | ||
| Use Serial No / Batch Fields | use_serial_batch_fields |
Check | ||||
| Serial and Batch Bundle | serial_and_batch_bundle |
Link | Serial and Batch Bundle | |||
| Serial No | serial_no |
Text | ||||
| Batch No | batch_no |
Link | Batch | |||
| Actual Batch Quantity | actual_batch_qty |
Float | yes | |||
| Actual Qty | actual_qty |
Float | yes | |||
| Projected Qty | projected_qty |
Float | yes | |||
| Ordered Qty | ordered_qty |
Float | yes | |||
| Packed Qty | packed_qty |
Float | yes | |||
| Incoming Rate | incoming_rate |
Currency | yes | |||
| Picked Qty | picked_qty |
Float | yes | |||
| Page Break | page_break |
Check | yes | |||
| Prevdoc DocType | prevdoc_doctype |
Data | yes | yes | ||
| Parent Detail docname | parent_detail_docname |
Data | yes | yes |
Table: Payment Schedule
The rows of payment_schedule. Each row also has idx (its place), parent, parentfield and parenttype.
| Field | Field name | Type | Required | Read-only | Hidden | Links to |
|---|---|---|---|---|---|---|
| Payment Term | payment_term |
Link | Payment Term | |||
| Description | description |
Small Text | ||||
| Due Date | due_date |
Date | yes | |||
| Mode of Payment | mode_of_payment |
Link | Mode of Payment | |||
| Invoice Portion | invoice_portion |
Percent | ||||
| Discount Type | discount_type |
Select | one of: Percentage, Amount | |||
| Discount Date | discount_date |
Date | ||||
| Discount | discount |
Float | ||||
| Payment Amount | payment_amount |
Currency | yes | |||
| Outstanding | outstanding |
Currency | yes | |||
| Paid Amount | paid_amount |
Currency | ||||
| Discounted Amount | discounted_amount |
Currency | yes | |||
| Payment Amount (Company Currency) | base_payment_amount |
Currency |
Table: Pricing Rule Detail
The rows of pricing_rules. Each row also has idx (its place), parent, parentfield and parenttype.
| Field | Field name | Type | Required | Read-only | Hidden | Links to |
|---|---|---|---|---|---|---|
| Pricing Rule | pricing_rule |
Link | yes | Pricing Rule | ||
| Item Code | item_code |
Data | yes | |||
| Margin Type | margin_type |
Data | yes | yes | ||
| Rate or Discount | rate_or_discount |
Data | yes | yes | ||
| Child Docname | child_docname |
Data | yes | yes | ||
| Rule Applied | rule_applied |
Check | yes |
Table: Sales Order Item
The rows of items. Each row also has idx (its place), parent, parentfield and parenttype.
| Field | Field name | Type | Required | Read-only | Hidden | Links to |
|---|---|---|---|---|---|---|
| Item Code | item_code |
Link | yes | Item | ||
| Customer's Item Code | customer_item_code |
Data | yes | yes | ||
| Ensure Delivery Based on Produced Serial No | ensure_delivery_based_on_produced_serial_no |
Check | ||||
| Is Stock Item | is_stock_item |
Check | yes | |||
| Reserve Stock | reserve_stock |
Check | ||||
| Delivery Date | delivery_date |
Date | ||||
| Item Name | item_name |
Data | yes | |||
| Description | description |
Text Editor | ||||
| Item Group | item_group |
Link | yes | yes | Item Group | |
| Brand Name | brand |
Link | yes | yes | Brand | |
| Image | image |
Attach | yes | |||
| Quantity | qty |
Float | yes | |||
| Stock UOM | stock_uom |
Link | yes | UOM | ||
| UOM | uom |
Link | yes | UOM | ||
| UOM Conversion Factor | conversion_factor |
Float | yes | yes | ||
| Qty as per Stock UOM | stock_qty |
Float | yes | |||
| Stock Reserved Qty (in Stock UOM) | stock_reserved_qty |
Float | yes | |||
| Price List Rate | price_list_rate |
Currency | yes | |||
| Price List Rate (Company Currency) | base_price_list_rate |
Currency | yes | |||
| Margin Type | margin_type |
Select | one of: Percentage, Amount | |||
| Margin Rate or Amount | margin_rate_or_amount |
Float | ||||
| Rate With Margin | rate_with_margin |
Currency | yes | |||
| Discount (%) on Price List Rate with Margin | discount_percentage |
Percent | ||||
| Discount Amount | discount_amount |
Currency | ||||
| Rate With Margin (Company Currency) | base_rate_with_margin |
Currency | yes | |||
| Rate | rate |
Currency | ||||
| Amount | amount |
Currency | yes | |||
| Item Tax Template | item_tax_template |
Link | Item Tax Template | |||
| Total Tax (added by iVendNext) | custom_total_tax |
Float | yes | |||
| Tax Total Breakup (added by iVendNext) | custom_tax_breakup |
Text | yes | |||
| Basic Rate (Company Currency) | base_rate |
Currency | yes | |||
| Amount (Company Currency) | base_amount |
Currency | yes | |||
| Pricing Rules | pricing_rules |
Small Text | yes | yes | ||
| Rate of Stock UOM | stock_uom_rate |
Currency | yes | |||
| Is Free Item | is_free_item |
Check | yes | |||
| Grant Commission | grant_commission |
Check | yes | |||
| Net Rate | net_rate |
Currency | yes | |||
| Net Amount | net_amount |
Currency | yes | |||
| Net Rate (Company Currency) | base_net_rate |
Currency | yes | |||
| Net Amount (Company Currency) | base_net_amount |
Currency | yes | |||
| Billed Amt | billed_amt |
Currency | yes | |||
| Valuation Rate | valuation_rate |
Currency | yes | |||
| Gross Profit | gross_profit |
Currency | yes | |||
| Supplier delivers to Customer | delivered_by_supplier |
Check | ||||
| Supplier | supplier |
Link | Supplier | |||
| Weight Per Unit | weight_per_unit |
Float | ||||
| Total Weight | total_weight |
Float | yes | |||
| Weight UOM | weight_uom |
Link | UOM | |||
| Delivery Warehouse | warehouse |
Link | Warehouse | |||
| Customer Warehouse (Optional) | target_warehouse |
Link | yes | Warehouse | ||
| Quotation | prevdoc_docname |
Link | yes | Quotation | ||
| quotation_item | quotation_item |
Data | yes | yes | ||
| Against Blanket Order | against_blanket_order |
Check | ||||
| Blanket Order | blanket_order |
Link | Blanket Order | |||
| Blanket Order Rate | blanket_order_rate |
Currency | yes | |||
| Qty (Warehouse) | actual_qty |
Float | yes | |||
| Qty (Company) | company_total_stock |
Float | yes | |||
| BOM No | bom_no |
Link | BOM | |||
| Projected Qty | projected_qty |
Float | yes | |||
| Ordered Qty | ordered_qty |
Float | yes | |||
| Planned Quantity | planned_qty |
Float | yes | yes | ||
| Production Plan Qty | production_plan_qty |
Float | yes | |||
| Work Order Qty | work_order_qty |
Float | yes | |||
| Delivered Qty | delivered_qty |
Float | yes | |||
| Produced Quantity | produced_qty |
Float | yes | yes | ||
| Returned Qty | returned_qty |
Float | yes | |||
| Picked Qty (in Stock UOM) | picked_qty |
Float | yes | |||
| Additional Notes | additional_notes |
Text | ||||
| Page Break | page_break |
Check | ||||
| Item Tax Rate | item_tax_rate |
Code | yes | yes | ||
| Sales Order Date | transaction_date |
Date | yes | yes | ||
| Material Request | material_request |
Link | Material Request | |||
| Purchase Order | purchase_order |
Link | yes | Purchase Order | ||
| Material Request Item | material_request_item |
Data | ||||
| Purchase Order Item | purchase_order_item |
Data | yes |
Table: Sales Taxes and Charges
The rows of taxes. Each row also has idx (its place), parent, parentfield and parenttype.
| Field | Field name | Type | Required | Read-only | Hidden | Links to |
|---|---|---|---|---|---|---|
| Type | charge_type |
Select | yes | one of: Actual, On Net Total, On Previous Row Amount, On Previous Row Total, On Item Quantity | ||
| Reference Row # | row_id |
Data | ||||
| Account Head | account_head |
Link | yes | Account | ||
| Item (added by iVendNext) | custom_item |
Link | Item | |||
| On Item Row (added by iVendNext) | custom_on_item_row |
Int | ||||
| Surcharge (added by iVendNext) | custom_surcharge |
Link | Surcharge | |||
| Surcharge Amount (added by iVendNext) | custom_surcharge_amount |
Float | ||||
| Final Amount (added by iVendNext) | custom_final_amount |
Float | ||||
| Description | description |
Small Text | yes | |||
| Is this Tax included in Basic Rate? | included_in_print_rate |
Check | ||||
| Considered In Paid Amount | included_in_paid_amount |
Check | ||||
| Discount Type (added by iVendNext) | custom_discount_type |
Select | one of: Flat Amount, Percentage | |||
| Discount Amount (added by iVendNext) | custom_discount_amount |
Float | ||||
| Tax Template (added by iVendNext) | custom_tax_template |
Link | Item Tax Template | |||
| Applied Tax Amount (added by iVendNext) | custom_applied_tax_amount |
Float | ||||
| Discountable (added by iVendNext) | custom_discountable |
Check | ||||
| Taxable (added by iVendNext) | custom_taxable |
Check | ||||
| Refundable (added by iVendNext) | custom_refundable |
Check | ||||
| Load on Item Cost (added by iVendNext) | custom_load_on_item_cost |
Check | ||||
| Is return (added by iVendNext) | custom_is_return |
Check | yes | |||
| Tax Rate (added by iVendNext) | custom_tax_rate |
Percent | ||||
| Tax Per Item (added by iVendNext) | custom_tax_per_item |
Float | ||||
| Cost Center | cost_center |
Link | Cost Center | |||
| Tax Rate | rate |
Float | ||||
| Account Currency | account_currency |
Link | yes | Currency | ||
| Amount | tax_amount |
Currency | ||||
| Total | total |
Currency | yes | |||
| Tax Amount After Discount Amount | tax_amount_after_discount_amount |
Currency | yes | |||
| Amount (Company Currency) | base_tax_amount |
Currency | yes | |||
| Total (Company Currency) | base_total |
Currency | yes | |||
| Tax Amount After Discount Amount (Company Currency) | base_tax_amount_after_discount_amount |
Currency | yes | |||
| Item Wise Tax Detail | item_wise_tax_detail |
Code | yes | yes | ||
| Dont Recompute tax | dont_recompute_tax |
Check | yes | yes |
Table: Sales Team
The rows of sales_team. Each row also has idx (its place), parent, parentfield and parenttype.
| Field | Field name | Type | Required | Read-only | Hidden | Links to |
|---|---|---|---|---|---|---|
| Sales Person | sales_person |
Link | yes | Sales Person | ||
| Contact No. | contact_no |
Data | yes | |||
| Contribution (%) | allocated_percentage |
Float | ||||
| Contribution to Net Total | allocated_amount |
Currency | yes | |||
| Commission Rate | commission_rate |
Data | yes | |||
| Incentives | incentives |
Currency |
Table: Transaction Promotion Bonus Buys Detail
The rows of custom_promotions. Each row also has idx (its place), parent, parentfield and parenttype.
| Field | Field name | Type | Required | Read-only | Hidden | Links to |
|---|---|---|---|---|---|---|
| Item Row Reference | item_row_reference |
Int | yes | |||
| Item Code | item_code |
Data | yes | |||
| Promotion Name | promotion_name |
Data | yes | |||
| Discount Amount | discount_amount |
Data | yes | |||
| Quantity | quantity |
Data | yes | yes | ||
| Store | store |
Link | Warehouse | |||
| Customer | customer |
Link | Customer |