/admin/invoices/:id/packing_lines
Path: /admin/invoices/:id/packing_lines
Namespace: admin
Parent Resource: invoices
Overview
Packing lines represent packing list items for an invoice. Each packing line item contains product information, quantities packed, and shipping details.
Available Operations
List Packing Lines (GET)
Endpoint: GET /admin/invoices/:id/packing_lines.json
Description: Retrieve all packing lines for a specific invoice.
Request Example:
GET /admin/invoices/123/packing_lines.jsonResponse (200 OK):
{
"packing_lines": [
{
"id": 1,
"invoice_id": 123,
"item_id": 45,
"quantity": 2,
"packed_quantity": 2,
"description": "Product description"
}
]
}Show Packing Line (GET /:id)
Endpoint: GET /admin/invoices/:id/packing_lines/:id.json
Description: Retrieve a specific packing line.
Request Example:
GET /admin/invoices/123/packing_lines/1.jsonResponse (200 OK):
{
"packing_line": {
"id": 1,
"invoice_id": 123,
"item_id": 45,
"quantity": 2,
"packed_quantity": 2
}
}Create Packing Line (POST)
Endpoint: POST /admin/invoices/:id/packing_lines.json
Description: Create a new packing line for an invoice.
Request Example:
POST /admin/invoices/123/packing_lines.json
Content-Type: application/json
{
"packing_line": {
"item_id": 45,
"quantity": 2,
"packed_quantity": 2,
"description": "Product description"
}
}Response (201 Created):
{
"packing_line": {
"id": 1,
"invoice_id": 123,
"item_id": 45,
"quantity": 2
}
}Update Packing Line (PATCH /:id)
Endpoint: PATCH /admin/invoices/:id/packing_lines/:id.json
Description: Update an existing packing line.
Request Example:
PATCH /admin/invoices/123/packing_lines/1.json
Content-Type: application/json
{
"packing_line": {
"packed_quantity": 3
}
}Response (200 OK):
{
"packing_line": {
"id": 1,
"packed_quantity": 3
}
}Delete Packing Line (DELETE /:id)
Endpoint: DELETE /admin/invoices/:id/packing_lines/:id.json
Description: Delete a packing line.
Request Example:
DELETE /admin/invoices/123/packing_lines/1.jsonResponse (204 No Content)
Batch Actions (POST /batch_action)
Endpoint: POST /admin/invoices/:id/packing_lines/batch_action.json
Description: Perform batch operations on selected packing lines.
Request Example:
POST /admin/invoices/123/packing_lines/batch_action.json
Content-Type: application/json
{
"batch_action": "update",
"collection_selection": [1, 2, 3],
"batch_action_inputs": {
"packed_quantity": 0
}
}Response (200 OK):
{
"message": "Batch action completed",
"affected_count": 3
}Related Documentation
- Invoice Resource - Parent invoice resource
- Item Resource - Items that can be packed