Manage individual serialized product instances in RepairShopr
I manage individual serialized product instances. For products marked as serialized: true, each physical unit has a unique serial number. These serials track the lifecycle of each unit: from stock, to assignment to a line item (invoice/estimate/ticket), to being sold/used, returned, etc.
Use this when:
Required API base URL:
VITE_REPAIRSHOPR_SUBDOMAINVITE_REPAIRSHOPR_API_KEYPermissions: "Products - List/Search" for reading. "Products - Edit" for create/update/attach operations.
List Product Serials (GET /products/{product_id}/product_serials)
product_id (integer, required)
Optional:status (string) - Filter by status: "reserved", "sold", "returned", "in_transfer", "breakage", "used_in_refurb", "in_stock"page (integer) - Page number (100 per page)Create Serial (POST /products/{product_id}/product_serials)
product_id (integer, required)
Body:serial_number (string) - The unique serialcondition (string, optional) - Condition assessmentprice_cost_cents (integer, optional) - Cost in centsprice_retail_cents (integer, optional) - Retail price in centsUpdate Serial (PUT /products/{product_id}/product_serials/{id})
product_id (integer)id (integer) - Serial ID
Body: serial_number, condition, price_cost_cents, price_retail_cents, notes (optional)Attach Serial to Line Item (POST /products/{product_id}/product_serials/attach_to_line_item)
product_id (integer, required)
Body:record_type (string) - Typically "LineItem" for invoices/estimatesline_item_id (integer) - The line item to attach toproduct_serial_ids (array of integers) - IDs of serials to attachGet Serial (not separately documented but GET by ID may exist via list; main endpoint is product_serials)
Example call:
// List serials for a product (e.g., to find in-stock ones)
const serials = await skill({ name: "repairshopr-product-serial" }, {
product_id: 123,
status: "in_stock"
})
// Add a new serialized unit to inventory
const newSerial = await skill({ name: "repairshopr-product-serial" }, {
serial_number: "C02XYZ123456",
condition: "New",
price_cost_cents: 20000, // $200.00
price_retail_cents: 39999 // $399.99
}, { product_id: 123, method: 'POST' })
// Attach a serial to a repair ticket's line item (when servicing that exact unit)
await skill({ name: "repairshopr-product-serial" }, {
record_type: "LineItem",
line_item_id: 456,
product_serial_ids: [newSerial.product_serial.id]
}, { product_id: 123, method: 'POST', endpoint: '/attach_to_line_item' })
Response includes:
product_serials array, each with id, serial_number, status, condition, instance_price_cost, instance_price_retail, location_idproduct_serial objectserialized: true should have serials; but API may still accept them otherwisestatus indicates where the serial is in its lifecycle; common status: "In Stock"attach_to_line_item can fail with errors if serial already attached elsewhererepairshopr-product - To ensure product is serialized and get product inforepairshopr-ticket-line-item - For attaching serials to ticket line itemsrepairshopr-estimate / repairshopr-invoice - For line items in those contexts