The Batch object

Attributes

id string

Unique identifier for the object.

created_at string

ISO 8601 timestamp of when the object was created.

updated_at string

ISO 8601 timestamp of when the object was last updated.

disabled boolean

Default: false

batch_id string required
item string required
image string
parent_batch string
manufacturing_date string
expiry_date string
supplier string
reference_doctype string
reference_name string
description string
item_name string
batch_qty number
stock_uom string
qty_to_produce number
produced_qty number
use_batchwise_valuation boolean

Default: false

The Batch object
{
  "id": "batch_abc123",
  "created_at": "2024-01-15T09: 30: 00Z",
  "updated_at": "2024-01-15T09: 30: 00Z",
  "disabled": false,
  "batch_id": "batch_id_example",
  "item": "item_example",
  "image": "image_example",
  "parent_batch": "parent_batch_example",
  "manufacturing_date": "2024-01-15",
  "expiry_date": "2024-01-15",
  "supplier": "supplier_example",
  "reference_doctype": "reference_doctype_example",
  "reference_name": "reference_name_example",
  "description": "description_example",
  "item_name": "item_name_example",
  "batch_qty": 0,
  "stock_uom": "stock_uom_example",
  "qty_to_produce": 0,
  "produced_qty": 0,
  "use_batchwise_valuation": false
}
GET /api/stock/batch/{id}

Retrieve a batch

Retrieves the details of an existing batch. Supply the unique batch ID that was returned from a previous request.

Path parameters

id string required

The identifier of the batch to retrieve.

Returns

Returns the batch object if a valid identifier was provided.

GET /api/stock/batch/{id}
curl https://api.overplane.dev/api/stock/batch/batch_abc123 \
  -H "Authorization: Bearer sk_test_..."
Response
{
  "id": "batch_abc123",
  "created_at": "2024-01-15T09: 30: 00Z",
  "updated_at": "2024-01-15T09: 30: 00Z",
  "disabled": false,
  "batch_id": "batch_id_example",
  "item": "item_example",
  "image": "image_example",
  "parent_batch": "parent_batch_example",
  "manufacturing_date": "2024-01-15",
  "expiry_date": "2024-01-15",
  "supplier": "supplier_example",
  "reference_doctype": "reference_doctype_example",
  "reference_name": "reference_name_example",
  "description": "description_example",
  "item_name": "item_name_example",
  "batch_qty": 0,
  "stock_uom": "stock_uom_example",
  "qty_to_produce": 0,
  "produced_qty": 0,
  "use_batchwise_valuation": false
}
GET /api/stock/batch

List all batchs

Returns a list of batchs. The results are sorted by creation date, with the most recently created appearing first.

Query parameters

limit integer

Maximum number of objects to return. Default: 20.

offset integer

Number of objects to skip for pagination. Default: 0.

Returns

A paginated list of batch objects.

GET /api/stock/batch
curl https://api.overplane.dev/api/stock/batch \
  -H "Authorization: Bearer sk_test_..."
Response
{
  "data": [
    {
      "id": "batch_abc123",
      "created_at": "2024-01-15T09: 30: 00Z",
      "updated_at": "2024-01-15T09: 30: 00Z",
      "disabled": false,
      "batch_id": "batch_id_example",
      "item": "item_example",
      "image": "image_example",
      "parent_batch": "parent_batch_example",
      "manufacturing_date": "2024-01-15",
      "expiry_date": "2024-01-15",
      "supplier": "supplier_example",
      "reference_doctype": "reference_doctype_example",
      "reference_name": "reference_name_example",
      "description": "description_example",
      "item_name": "item_name_example",
      "batch_qty": 0,
      "stock_uom": "stock_uom_example",
      "qty_to_produce": 0,
      "produced_qty": 0,
      "use_batchwise_valuation": false
    }
  ],
  "has_more": false,
  "total": 1
}
POST /api/stock/batch

Create a batch

Creates a new batch object.

Body parameters

disabled boolean

Default: false

batch_id string required
item string required
image string
parent_batch string
manufacturing_date string
expiry_date string
supplier string
reference_doctype string
reference_name string
description string
item_name string
batch_qty number
stock_uom string
qty_to_produce number
produced_qty number
use_batchwise_valuation boolean

Default: false

Returns

Returns the newly created batch object if the call succeeded.

POST /api/stock/batch
curl https://api.overplane.dev/api/stock/batch \
  -H "Authorization: Bearer sk_test_..." \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"batch_id":"batch_id_example","item":"item_example"}'
Response
{
  "id": "batch_abc123",
  "created_at": "2024-01-15T09: 30: 00Z",
  "updated_at": "2024-01-15T09: 30: 00Z",
  "disabled": false,
  "batch_id": "batch_id_example",
  "item": "item_example",
  "image": "image_example",
  "parent_batch": "parent_batch_example",
  "manufacturing_date": "2024-01-15",
  "expiry_date": "2024-01-15",
  "supplier": "supplier_example",
  "reference_doctype": "reference_doctype_example",
  "reference_name": "reference_name_example",
  "description": "description_example",
  "item_name": "item_name_example",
  "batch_qty": 0,
  "stock_uom": "stock_uom_example",
  "qty_to_produce": 0,
  "produced_qty": 0,
  "use_batchwise_valuation": false
}
PATCH /api/stock/batch/{id}

Update a batch

Updates the specified batch by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Path parameters

id string required

The identifier of the batch to update.

Body parameters

disabled boolean

Default: false

batch_id string
item string
image string
parent_batch string
manufacturing_date string
expiry_date string
supplier string
reference_doctype string
reference_name string
description string
item_name string
batch_qty number
stock_uom string
qty_to_produce number
produced_qty number
use_batchwise_valuation boolean

Default: false

Returns

Returns the updated batch object.

PATCH /api/stock/batch/{id}
curl https://api.overplane.dev/api/stock/batch/batch_abc123 \
  -H "Authorization: Bearer sk_test_..." \
  -X PATCH \
  -H "Content-Type: application/json" \
  -d '{"disabled":false,"batch_id":"batch_id_example"}'
Response
{
  "id": "batch_abc123",
  "created_at": "2024-01-15T09: 30: 00Z",
  "updated_at": "2024-01-15T09: 30: 00Z",
  "disabled": false,
  "batch_id": "batch_id_example",
  "item": "item_example",
  "image": "image_example",
  "parent_batch": "parent_batch_example",
  "manufacturing_date": "2024-01-15",
  "expiry_date": "2024-01-15",
  "supplier": "supplier_example",
  "reference_doctype": "reference_doctype_example",
  "reference_name": "reference_name_example",
  "description": "description_example",
  "item_name": "item_name_example",
  "batch_qty": 0,
  "stock_uom": "stock_uom_example",
  "qty_to_produce": 0,
  "produced_qty": 0,
  "use_batchwise_valuation": false
}
DELETE /api/stock/batch/{id}

Delete a batch

Permanently deletes a batch. This cannot be undone.

Path parameters

id string required

The identifier of the batch to delete.

Returns

Returns a confirmation that the batch has been deleted.

DELETE /api/stock/batch/{id}
curl https://api.overplane.dev/api/stock/batch/batch_abc123 \
  -H "Authorization: Bearer sk_test_..." \
  -X DELETE
Response
{
  "id": "batch_abc123",
  "deleted": true
}