Bulk Transfer: Create and Fill (JavaScript)
This example uses the V3 API. POST /api/v3/container:transfer is
stable, but creating the plate, listing its wells, and looking up the unit are beta, so those
requests send the EARLY-ACCESS: true header. See the
V3 Stability Guidelines.
Introduction to Transfers covers the transfer endpoint in more
depth.
There is no V3 JavaScript SDK, so this example calls the API directly with fetch, which is built
into Node.js 18 and later. Replace tenant, apiKey, and the loc_/src_/pltsch_/bfi_ IDs
with values from your own tenant.
Config
Set the tenant URL, API key, and task wait limit.
headerscarries a basic-auth header built from your API key;betaHeadersaddsEARLY-ACCESS: truefor the beta operations.Helper functions
Three helpers.
sleepwrapssetTimeoutin a promise,requestsends a JSON request to/api/v3and throws on any non-2xx response, andwaitForTransferTaskpollsGET /api/v3/tasks/container/transfer/{task_id}at a given interval until the task isCOMPLETED, throwing if it isFAILEDand giving up aftermaxTaskWaitattempts.Create the plate
Call
POST /api/v3/well-platewith the plate schema, the storage location, and the project. This is the V3 replacement for V2POST /platesfor fixed (well) plates; matrix plates usePOST /api/v3/matrix-plateinstead. Don’t use the general/api/v3/plateendpoint, which is being deprecated.List the wells and the unit
The created plate doesn’t embed its wells, so list them with
GET /api/v3/well-plate/{well_plate_id}/positions/items; each well’sidis the container ID to transfer into. V3 measurements take a unit ID, so look up milliliters withGET /api/v3/unit/items.Fill the plate wells
Build one transfer object per well, with the entity as an unlimited source. A single call to
POST /api/v3/container:transferperforms all of them.Await task completion
Transfers are asynchronous, so the response carries a
taskIdrather than the finished result. Poll it with the helper and log the final status; if any step fails, thecatchlogs the error.