Create a batch number
Note: This mutation can be used only for companies who can create batch numbers.
mutation {
CreateBatchNumber(
input: {
label: "my batch",
barcode: "123456789",
expiry_date: "2024-04-24",
variant: {
id: 100359
}
}
) {
id
}
}
{
"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 |
---|
Id of the batch number |
mutation UpdateBatchNumber($id: ID!, $input: BatchNumberInput!) {
UpdateBatchNumber(id: $id, input: $input) {
id
label
}
}
{
"id": 100047,
"input": {
"label": "batch1233"
}
}
{
"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 |
---|
Id of the batch number |
mutation DeleteBatchNumber($id: ID!) {
DeleteBatchNumber(id: $id)
}
{
"data": {
"DeleteBatchNumber": true
}
}
Allocate batch numbers to stock not allocated
mutation AllocateBatchNumber($input: [BatchNumberStockLevelInput]!) {
AllocateBatchNumber(input: $input) {
id
on_hand
location {
id
label
}
variant {
id
label
}
batch_number {
id
label
barcode
expiry_date
}
}
}
{
"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
}
}
}
]
}
{
"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 - Int |
---|
Unique identifier of the batch number |
label - String |
---|
Name of the batch |
barcode - String |
---|
Barcode of the variant |
expiry_date - String |
---|
expiry date of the batch |
variant - VariantInput |
---|
Variant data ( variant { id: 1020012 } ) |