Serial and Batch Bundle
The serial numbers or lots on one line of a stock document or a sale.
Area: Batches and serial numbers · Why it is here: openapi.yaml; api/README.md; recipe stock_alerts; the MCP server; the request collection; retail core · Fields: 21 · 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/Serial%20and%20Batch%20Bundle?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/Serial%20and%20Batch%20Bundle/⟨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/Serial%20and%20Batch%20Bundle" -H "Authorization: token ⟨api key⟩:⟨api secret⟩" \
-H "Content-Type: application/json" -d '{"company": …, "item_code": …, "type_of_transaction": …, "entries": …, "voucher_type": …}'
Change one with PUT /api/resource/Serial%20and%20Batch%20Bundle/⟨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
s1_warranty · s22_customer_loyalty · s27_stock_alerts · s30_units_as_serials · s40_expiry_recall
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 |
|---|---|---|---|---|---|---|
| Company | company |
Link | yes | Company | ||
| Item Name | item_name |
Data | yes | |||
| Has Serial No | has_serial_no |
Check | yes | |||
| Has Batch No | has_batch_no |
Check | yes | |||
| Item Code | item_code |
Link | yes | Item | ||
| Warehouse | warehouse |
Link | Warehouse | |||
| Type of Transaction | type_of_transaction |
Select | yes | one of: Inward, Outward, Maintenance, Asset Repair | ||
| entries | entries |
Table | yes | Serial and Batch Entry | ||
| Total Qty | total_qty |
Float | yes | |||
| Item Group | item_group |
Link | yes | Item Group | ||
| Avg Rate | avg_rate |
Float | yes | |||
| Total Amount | total_amount |
Float | yes | |||
| Voucher Type | voucher_type |
Link | yes | DocType | ||
| Voucher No | voucher_no |
Dynamic Link | ||||
| Voucher Detail No | voucher_detail_no |
Data | yes | |||
| Posting Date | posting_date |
Date | ||||
| Posting Time | posting_time |
Time | ||||
| Returned Against | returned_against |
Data | yes | |||
| Is Cancelled | is_cancelled |
Check | yes | |||
| Is Rejected | is_rejected |
Check | yes | |||
| Amended From | amended_from |
Link | yes | Serial and Batch Bundle |
Table: Serial and Batch Entry
The rows of entries. Each row also has idx (its place), parent, parentfield and parenttype.
| Field | Field name | Type | Required | Read-only | Hidden | Links to |
|---|---|---|---|---|---|---|
| Serial No | serial_no |
Link | Serial No | |||
| Batch No | batch_no |
Link | Batch | |||
| Qty | qty |
Float | ||||
| Warehouse | warehouse |
Link | Warehouse | |||
| Delivered Qty | delivered_qty |
Float | yes | |||
| Valuation Rate | incoming_rate |
Float | yes | |||
| Outgoing Rate | outgoing_rate |
Float | yes | yes | ||
| Change in Stock Value | stock_value_difference |
Float | yes | |||
| Is Outward | is_outward |
Check | yes | yes | ||
| FIFO Stock Queue (qty, rate) | stock_queue |
Small Text | yes |