Purchase Invoice
A supplier's bill, booked in the retailer's accounts.
Area: Purchase and transfer documents · Why it is here: retail core · Fields: 130 · 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/Purchase%20Invoice?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/Purchase%20Invoice/⟨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/Purchase%20Invoice" -H "Authorization: token ⟨api key⟩:⟨api secret⟩" \
-H "Content-Type: application/json" -d '{"naming_series": …, "supplier": …, "posting_date": …, "items": …, "credit_to": …}'
Change one with PUT /api/resource/Purchase%20Invoice/⟨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
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: ACC-PINV-.YYYY.-, ACC-PINV-RET-.YYYY.- | ||
| Supplier | supplier |
Link | yes | Supplier | ||
| Supplier Name | supplier_name |
Data | yes | |||
| Tax Id | tax_id |
Read Only | yes | |||
| Company | company |
Link | Company | |||
| Date | posting_date |
Date | yes | |||
| Posting Time | posting_time |
Time | ||||
| Edit Posting Date and Time | set_posting_time |
Check | ||||
| Due Date | due_date |
Date | ||||
| Is Paid | is_paid |
Check | ||||
| Is Return (Debit Note) | is_return |
Check | ||||
| Return Against Purchase Invoice | return_against |
Link | yes | Purchase Invoice | ||
| Update Outstanding for Self | update_outstanding_for_self |
Check | ||||
| Update Billed Amount in Purchase Order | update_billed_amount_in_purchase_order |
Check | ||||
| Update Billed Amount in Purchase Receipt | update_billed_amount_in_purchase_receipt |
Check | ||||
| Apply Tax Withholding Amount | apply_tds |
Check | ||||
| Tax Withholding Category | tax_withholding_category |
Link | yes | Tax Withholding Category | ||
| Amended From | amended_from |
Link | yes | Purchase Invoice | ||
| Supplier Invoice No | bill_no |
Data | ||||
| Supplier Invoice Date | bill_date |
Date | ||||
| Cost Center | cost_center |
Link | Cost Center | |||
| Project | project |
Link | Project | |||
| Currency | currency |
Link | Currency | |||
| Exchange Rate | conversion_rate |
Float | ||||
| Use Transaction Date Exchange Rate | use_transaction_date_exchange_rate |
Check | yes | |||
| Price List | buying_price_list |
Link | Price List | |||
| Price List Currency | price_list_currency |
Link | yes | Currency | ||
| Price List Exchange Rate | plc_conversion_rate |
Float | ||||
| Ignore Pricing Rule | ignore_pricing_rule |
Check | ||||
| Scan Barcode | scan_barcode |
Data | ||||
| Update Stock | update_stock |
Check | ||||
| Set Accepted Warehouse | set_warehouse |
Link | Warehouse | |||
| Set From Warehouse | set_from_warehouse |
Link | Warehouse | |||
| Is Subcontracted | is_subcontracted |
Check | yes | |||
| Rejected Warehouse | rejected_warehouse |
Link | Warehouse | |||
| Supplier Warehouse | supplier_warehouse |
Link | Warehouse | |||
| Items | items |
Table | yes | Purchase Invoice 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 Withholding Net Total | tax_withholding_net_total |
Currency | yes | yes | ||
| Base Tax Withholding Net Total | base_tax_withholding_net_total |
Currency | yes | yes | ||
| Tax Category | tax_category |
Link | Tax Category | |||
| Purchase Taxes and Charges Template | taxes_and_charges |
Link | Purchase Taxes and Charges Template | |||
| Shipping Rule | shipping_rule |
Link | Shipping Rule | |||
| Incoterm | incoterm |
Link | Incoterm | |||
| Named Place | named_place |
Data | ||||
| Purchase Taxes and Charges | taxes |
Table | Purchase Taxes and Charges | |||
| Taxes and Charges Added (Company Currency) | base_taxes_and_charges_added |
Currency | yes | |||
| Taxes and Charges Deducted (Company Currency) | base_taxes_and_charges_deducted |
Currency | yes | |||
| Total Taxes and Charges (Company Currency) | base_total_taxes_and_charges |
Currency | yes | |||
| Taxes and Charges Added | taxes_and_charges_added |
Currency | yes | |||
| Taxes and Charges Deducted | taxes_and_charges_deducted |
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 | |||
| Use Company Default Round Off Cost Center | use_company_roundoff_cost_center |
Check | ||||
| Rounded Total | rounded_total |
Currency | yes | |||
| In Words | in_words |
Data | yes | |||
| Total Advance | total_advance |
Currency | yes | |||
| Outstanding Amount | outstanding_amount |
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 | |||
| Additional Discount Percentage | additional_discount_percentage |
Float | ||||
| Additional Discount Amount | discount_amount |
Currency | ||||
| Tax Withheld Vouchers | tax_withheld_vouchers |
Table | yes | Tax Withheld Vouchers | ||
| Taxes and Charges Calculation | other_charges_calculation |
Text Editor | yes | |||
| Pricing Rule Detail | pricing_rules |
Table | yes | Pricing Rule Detail | ||
| Supplied Items | supplied_items |
Table | Purchase Receipt Item Supplied | |||
| Mode of Payment | mode_of_payment |
Link | Mode of Payment | |||
| Paid Amount (Company Currency) | base_paid_amount |
Currency | yes | |||
| Clearance Date | clearance_date |
Date | yes | |||
| Cash/Bank Account | cash_bank_account |
Link | Account | |||
| Paid Amount | paid_amount |
Currency | ||||
| Set Advances and Allocate (FIFO) | allocate_advances_automatically |
Check | ||||
| Only Include Allocated Payments | only_include_allocated_payments |
Check | ||||
| Advances | advances |
Table | Purchase Invoice Advance | |||
| Advance Tax | advance_tax |
Table | yes | yes | Advance Tax | |
| Write Off Amount | write_off_amount |
Currency | ||||
| Write Off Amount (Company Currency) | base_write_off_amount |
Currency | yes | |||
| Write Off Account | write_off_account |
Link | Account | |||
| Write Off Cost Center | write_off_cost_center |
Link | Cost Center | |||
| Select Supplier Address | supplier_address |
Link | Address | |||
| Address | address_display |
Small Text | yes | |||
| Contact Person | contact_person |
Link | Contact | |||
| Contact | contact_display |
Small Text | yes | |||
| Mobile No | contact_mobile |
Small Text | yes | |||
| Contact Email | contact_email |
Small Text | yes | |||
| Select Shipping Address | shipping_address |
Link | Address | |||
| Shipping Address | shipping_address_display |
Small Text | yes | |||
| Select Billing Address | billing_address |
Link | Address | |||
| Billing Address | billing_address_display |
Small Text | yes | |||
| Payment Terms Template | payment_terms_template |
Link | Payment Terms Template | |||
| Ignore Default Payment Terms Template | ignore_default_payment_terms_template |
Check | yes | yes | ||
| Payment Schedule | payment_schedule |
Table | Payment Schedule | |||
| Terms | tc_name |
Link | Terms and Conditions | |||
| Terms and Conditions | terms |
Text Editor | ||||
| Status | status |
Select | one of: Draft, Return, Debit Note Issued, Submitted, Paid, Partly Paid, Unpaid, Overdue, Cancelled, Internal Transfer | |||
| Per Received | per_received |
Percent | yes | yes | ||
| Credit To | credit_to |
Link | yes | Account | ||
| Party Account Currency | party_account_currency |
Link | yes | yes | Currency | |
| Is Opening Entry | is_opening |
Select | one of: No, Yes | |||
| Against Expense Account | against_expense_account |
Small Text | yes | |||
| Unrealized Profit / Loss Account | unrealized_profit_loss_account |
Link | Account | |||
| Subscription | subscription |
Link | Subscription | |||
| Auto Repeat | auto_repeat |
Link | yes | Auto Repeat | ||
| From Date | from_date |
Date | ||||
| To Date | to_date |
Date | ||||
| 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 | |||
| Hold Invoice | on_hold |
Check | ||||
| Release Date | release_date |
Date | ||||
| Reason For Putting On Hold | hold_comment |
Small Text | ||||
| Is Internal Supplier | is_internal_supplier |
Check | yes | |||
| Represents Company | represents_company |
Link | Company | |||
| Supplier Group | supplier_group |
Link | Supplier Group | |||
| Inter Company Invoice Reference | inter_company_invoice_reference |
Link | yes | Sales Invoice | ||
| Is Old Subcontracting Flow | is_old_subcontracting_flow |
Check | yes | yes | ||
| Remarks | remarks |
Small Text |
Table: Advance Tax
The rows of advance_tax. Each row also has idx (its place), parent, parentfield and parenttype.
| Field | Field name | Type | Required | Read-only | Hidden | Links to |
|---|---|---|---|---|---|---|
| Reference Type | reference_type |
Link | DocType | |||
| Reference Name | reference_name |
Dynamic Link | ||||
| Reference Detail | reference_detail |
Data | ||||
| Account Head | account_head |
Link | Account | |||
| Allocated Amount | allocated_amount |
Currency |
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: Purchase Invoice Advance
The rows of advances. Each row also has idx (its place), parent, parentfield and parenttype.
| Field | Field name | Type | Required | Read-only | Hidden | Links to |
|---|---|---|---|---|---|---|
| Reference Type | reference_type |
Link | yes | DocType | ||
| Reference Name | reference_name |
Dynamic Link | yes | |||
| Remarks | remarks |
Text | yes | |||
| Reference Row | reference_row |
Data | yes | yes | ||
| Advance Amount | advance_amount |
Currency | yes | |||
| Allocated Amount | allocated_amount |
Currency | ||||
| Exchange Gain/Loss | exchange_gain_loss |
Currency | yes | |||
| Reference Exchange Rate | ref_exchange_rate |
Float | yes | |||
| Difference Posting Date | difference_posting_date |
Date |
Table: Purchase Invoice 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 | item_code |
Link | Item | |||
| Product Bundle | product_bundle |
Link | yes | Product Bundle | ||
| Item Name | item_name |
Data | yes | |||
| Description | description |
Text Editor | ||||
| Brand | brand |
Link | yes | Brand | ||
| Item Group | item_group |
Link | yes | Item Group | ||
| Image | image |
Attach | yes | |||
| Received Qty | received_qty |
Float | yes | |||
| Accepted Qty | qty |
Float | yes | |||
| Rejected Qty | rejected_qty |
Float | ||||
| UOM | uom |
Link | yes | UOM | ||
| UOM Conversion Factor | conversion_factor |
Float | yes | yes | ||
| Stock UOM | stock_uom |
Link | yes | UOM | ||
| Accepted Qty in Stock UOM | stock_qty |
Float | yes | yes | ||
| Price List Rate | price_list_rate |
Currency | ||||
| 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 (%) | discount_percentage |
Percent | ||||
| Discount Amount | discount_amount |
Currency | ||||
| Rate With Margin (Company Currency) | base_rate_with_margin |
Currency | yes | |||
| Rate | rate |
Currency | yes | |||
| Amount | amount |
Currency | yes | yes | ||
| Item Tax Template | item_tax_template |
Link | Item Tax Template | |||
| Rate (Company Currency) | base_rate |
Currency | yes | yes | ||
| Amount (Company Currency) | base_amount |
Currency | yes | 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 | |||
| Apply TDS | apply_tds |
Check | ||||
| 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 | |||
| Valuation Rate | valuation_rate |
Currency | yes | yes | ||
| Sales Incoming Rate | sales_incoming_rate |
Currency | yes | |||
| Item Tax Amount Included in Value | item_tax_amount |
Currency | yes | yes | ||
| Landed Cost Voucher Amount | landed_cost_voucher_amount |
Currency | yes | |||
| Raw Materials Supplied Cost | rm_supp_cost |
Currency | yes | yes | ||
| Accepted Warehouse | warehouse |
Link | Warehouse | |||
| Serial and Batch Bundle | serial_and_batch_bundle |
Link | Serial and Batch Bundle | |||
| Use Serial No / Batch Fields | use_serial_batch_fields |
Check | ||||
| From Warehouse | from_warehouse |
Link | Warehouse | |||
| Quality Inspection | quality_inspection |
Link | Quality Inspection | |||
| Rejected Warehouse | rejected_warehouse |
Link | Warehouse | |||
| Rejected Serial and Batch Bundle | rejected_serial_and_batch_bundle |
Link | Serial and Batch Bundle | |||
| Serial No | serial_no |
Text | ||||
| Rejected Serial No | rejected_serial_no |
Text | ||||
| Batch No | batch_no |
Link | Batch | |||
| Manufacturer | manufacturer |
Link | Manufacturer | |||
| Manufacturer Part Number | manufacturer_part_no |
Data | ||||
| Expense Head | expense_account |
Link | Account | |||
| WIP Composite Asset | wip_composite_asset |
Link | Asset | |||
| Is Fixed Asset | is_fixed_asset |
Check | yes | yes | ||
| Asset Location | asset_location |
Link | Location | |||
| Asset Category | asset_category |
Link | yes | Asset Category | ||
| Deferred Expense Account | deferred_expense_account |
Link | Account | |||
| Service Stop Date | service_stop_date |
Date | ||||
| Enable Deferred Expense | enable_deferred_expense |
Check | ||||
| Service Start Date | service_start_date |
Date | ||||
| Service End Date | service_end_date |
Date | ||||
| Allow Zero Valuation Rate | allow_zero_valuation_rate |
Check | ||||
| Item Tax Rate | item_tax_rate |
Code | yes | yes | ||
| BOM | bom |
Link | yes | BOM | ||
| Include Exploded Items | include_exploded_items |
Check | yes | |||
| Purchase Invoice Item | purchase_invoice_item |
Data | yes | |||
| Purchase Order | purchase_order |
Link | yes | Purchase Order | ||
| Purchase Order Item | po_detail |
Data | yes | yes | ||
| Purchase Receipt | purchase_receipt |
Link | yes | Purchase Receipt | ||
| Purchase Receipt Detail | pr_detail |
Data | yes | yes | ||
| Sales Invoice Item | sales_invoice_item |
Data | yes | |||
| Material Request | material_request |
Link | yes | Material Request | ||
| Material Request Item | material_request_item |
Data | yes | yes | ||
| Weight Per Unit | weight_per_unit |
Float | ||||
| Total Weight | total_weight |
Float | yes | |||
| Weight UOM | weight_uom |
Link | UOM | |||
| Project | project |
Link | Project | |||
| Cost Center | cost_center |
Link | Cost Center | |||
| Page Break | page_break |
Check |
Table: Purchase Receipt Item Supplied
The rows of supplied_items. Each row also has idx (its place), parent, parentfield and parenttype.
| Field | Field name | Type | Required | Read-only | Hidden | Links to |
|---|---|---|---|---|---|---|
| Item Code | main_item_code |
Link | yes | Item | ||
| Raw Material Item Code | rm_item_code |
Link | yes | Item | ||
| Item Name | item_name |
Data | yes | |||
| BOM Detail No | bom_detail_no |
Data | yes | yes | ||
| Description | description |
Text Editor | yes | |||
| Stock Uom | stock_uom |
Link | yes | UOM | ||
| Conversion Factor | conversion_factor |
Float | yes | yes | ||
| Reference Name | reference_name |
Data | yes | yes | ||
| Rate | rate |
Currency | yes | |||
| Amount | amount |
Currency | yes | |||
| Available Qty For Consumption | required_qty |
Float | yes | |||
| Qty to Be Consumed | consumed_qty |
Float | yes | |||
| Current Stock | current_stock |
Float | yes | |||
| Batch No | batch_no |
Link | Batch | |||
| Serial No | serial_no |
Text | ||||
| Purchase Order | purchase_order |
Link | yes | yes | Purchase Order |
Table: Purchase 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 |
|---|---|---|---|---|---|---|
| Consider Tax or Charge for | category |
Select | yes | one of: Valuation and Total, Valuation, Total | ||
| Add or Deduct | add_deduct_tax |
Select | yes | one of: Add, Deduct | ||
| 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 | ||||
| Is this Tax included in Basic Rate? | included_in_print_rate |
Check | ||||
| Considered In Paid Amount | included_in_paid_amount |
Check | ||||
| Account Head | account_head |
Link | yes | Account | ||
| Description | description |
Small Text | yes | |||
| Is Tax Withholding Account | is_tax_withholding_account |
Check | yes | |||
| Tax Rate | rate |
Float | ||||
| Cost Center | cost_center |
Link | Cost Center | |||
| Account Currency | account_currency |
Link | yes | Currency | ||
| Amount | tax_amount |
Currency | ||||
| Tax Amount After Discount Amount | tax_amount_after_discount_amount |
Currency | yes | |||
| Total | total |
Currency | yes | |||
| Amount (Company Currency) | base_tax_amount |
Currency | yes | |||
| Total (Company Currency) | base_total |
Currency | yes | |||
| Tax Amount After Discount Amount | base_tax_amount_after_discount_amount |
Currency | yes | |||
| Item Wise Tax Detail | item_wise_tax_detail |
Code | yes | yes |
Table: Tax Withheld Vouchers
The rows of tax_withheld_vouchers. Each row also has idx (its place), parent, parentfield and parenttype.
| Field | Field name | Type | Required | Read-only | Hidden | Links to |
|---|---|---|---|---|---|---|
| Voucher Type | voucher_type |
Link | DocType | |||
| Voucher Name | voucher_name |
Dynamic Link | ||||
| Taxable Amount | taxable_amount |
Currency |