See the Queries page for a presentation of this resource.
Create a batch number
Note: This mutation can be used only for companies who can create batch numbers.
input Data of the batch number
GraphQL
mutation {
CreateBatchNumber(
input: {
label: "my batch",
barcode: "123456789",
expiry_date: "2024-04-24",
variant: {
id: 100359
}
}
) {
id
}
}
JSON
{
"data": {
"CreateBatchNumber": {
"id": 100367,
}
}
}
Same as CreateBatchNumber, but you can create multiple batch numbers by passing an array of batch data
Update a Batch number
id Id of the batch number
input Data of the batch number
GraphQL
mutation UpdateBatchNumber($id: ID!, $input: BatchNumberInput!) {
UpdateBatchNumber(id: $id, input: $input) {
id
label
}
}
Variables (JSON)
{
"id": 100047,
"input": {
"label": "batch1233"
}
}
JSON
{
"data": {
"UpdateBatchNumber": {
"id": 100047,
"label": "batch1233"
}
}
}
Same as UpdateBatchNumber, but you can update multiple batch numbers by passing an array of batch data
Delete a batch number
id Id of the batch number
GraphQL
mutation DeleteBatchNumber($id: ID!) {
DeleteBatchNumber(id: $id)
}
JSON
{
"data": {
"DeleteBatchNumber": true
}
}
Allocate batch numbers to stock not allocated
input Data of the batch number
GraphQL
mutation AllocateBatchNumber($input: [BatchNumberStockLevelInput]!) {
AllocateBatchNumber(input: $input) {
id
on_hand
location {
id
label
}
variant {
id
label
}
batch_number {
id
label
barcode
expiry_date
}
}
}
Variables (JSON)
{
"input": [
{
"quantity": 12,
"location": {
"id": 100000,
"label": "Default location"
},
"variant": {
"id": 100359
},
"batch_number": {
"id": -1,
"label": "batchasicssneak1",
"barcode": "234567",
"expiry_date": "2024-04-26",
"variant": {
"id": 100359
}
}
}
]
}
JSON
{
"data": {
"AllocateBatchNumber": [
{
"id": 100041,
"on_hand": 12,
"location": {
"id": 100000,
"label": "Default location"
},
"variant": {
"id": 100359,
"label": "Amazing Asics Sneakers"
},
"batch_number": {
"id": 100048,
"label": "batchasicssneak1",
"barcode": "234567",
"expiry_date": "2024-04-26"
}
}
]
}
}
id Unique identifier of the batch number
barcode Barcode of the variant
expiry_date expiry date of the batch
variant Variant data ( variant { id: 1020012 } )
id Unique identifier of the batch number line item
quantity Quantity of the variant allocated to this batch number for the line item
batch_number Batch number allocated to the line item ( batch_number { id: 189000 } )
id Unique identifier of the batch number stock level
quantity Quantity of stock to allocate to this batch number for this variant at this location
variant Variant to allocate the batch number to
location Location to allocate the batch number to
batch_number Batch number to allocate to the stock