In Payload of Step 1 what is inventoryItem.id and where can I get it?
I have created two Bin Locations - Store and Sold - under my location and after moving the product from Default location to Store location I tried to get inventoryItem.id from
GET /openboxes/api/products/2c96808386c648e70186c69efed0000b/availableItems
Response
{
"data": [
{
"inventoryItem.id": "2c96808386c648e70186c6adf57c000c",
"product.name": "test product 1",
"product": {
"id": "2c96808386c648e70186c69efed0000b",
"productCode": "tp1",
"name": "test product 1",
"description": null,
"category": "test category",
"unitOfMeasure": null,
"pricePerUnit": 1,
"dateCreated": "2023-03-09T13:45:54Z",
"lastUpdated": "Mar 10, 2023",
"updatedBy": "Miss Administrator",
"color": null,
"handlingIcons": [],
"lotAndExpiryControl": false,
"active": true
},
"productCode": "tp1",
"lotNumber": null,
"expirationDate": null,
"binLocation": {
"id": "2c96808386da37c80186dc7cb9f90017",
"name": "Store",
"description": null,
"locationNumber": null,
"locationGroup": null,
"parentLocation": {
"id": "2c96808386da37c80186dc7c32520015",
"name": "test merchant",
"description": null,
"locationNumber": null,
"locationGroup": null,
"parentLocation": null,
"locationType": {
"id": "2c96808386c648e70186c87661f1002d",
"name": "super",
"description": null,
"locationTypeCode": "DISTRIBUTOR"
},
"sortOrder": null,
"hasBinLocationSupport": true,
"hasPackingSupport": true,
"hasPartialReceivingSupport": true,
"hasCentralPurchasingEnabled": true,
"organizationName": "tst",
"organizationCode": "TST",
"backgroundColor": "FFFFFF",
"zoneName": null,
"zoneId": null,
"active": true,
"organization": {
"id": "2c96808386c648e70186c67a9c6b0004",
"name": "tst",
"description": null,
"code": "TST",
"dateCreated": "2023-03-09T13:06:10Z",
"lastUpdated": "2023-03-09T13:06:10Z",
"defaultLocation": null,
"partyType": {
"id": "1",
"name": "Organization",
"code": "ORG",
"partyTypeCode": "ORGANIZATION"
},
"roles": [
{
"id": "2c96808386c648e70186c67c40fa0006",
"roleType": "ROLE_ORGANIZATION",
"startDate": null,
"endDate": null
}
],
"sequences": {}
},
"manager": {
"id": "1",
"name": "Miss Administrator",
"firstName": "Miss",
"lastName": "Administrator",
"email": "admin@openboxes.com",
"username": "admin"
},
"address": null,
"supportedActivities": [
"PARTIAL_RECEIVING",
"DYNAMIC_CREATION",
"EXTERNAL",
"PLACE_ORDER",
"ENABLE_NOTIFICATIONS",
"ADJUST_INVENTORY",
"HOLD_STOCK",
"SUBMIT_REQUEST",
"REQUIRE_ACCOUNTING",
"MANAGE_INVENTORY",
"APPROVE_ORDER",
"PICK_STOCK",
"FULFILL_REQUEST",
"PLACE_REQUEST",
"PUTAWAY_STOCK",
"SEND_STOCK",
"CROSS_DOCKING",
"ENABLE_CENTRAL_PURCHASING",
"CONSUME_STOCK",
"PACK_SHIPMENT",
"FULFILL_ORDER",
"RECEIVE_STOCK",
"APPROVE_REQUEST"
]
},
"locationType": {
"id": "cab2b4f35ba2d867015ba2e17e390001",
"name": "Bin Location",
"description": "Default bin location type",
"locationTypeCode": "BIN_LOCATION"
},
"sortOrder": null,
"hasBinLocationSupport": true,
"hasPackingSupport": false,
"hasPartialReceivingSupport": false,
"hasCentralPurchasingEnabled": false,
"organizationName": "tst",
"organizationCode": "TST",
"backgroundColor": "FFFFFF",
"zoneName": null,
"zoneId": null,
"active": true,
"organization": {
"id": "2c96808386c648e70186c67a9c6b0004",
"name": "tst",
"description": null,
"code": "TST",
"dateCreated": "2023-03-09T13:06:10Z",
"lastUpdated": "2023-03-09T13:06:10Z",
"defaultLocation": null,
"partyType": {
"id": "1",
"name": "Organization",
"code": "ORG",
"partyTypeCode": "ORGANIZATION"
},
"roles": [
{
"id": "2c96808386c648e70186c67c40fa0006",
"roleType": "ROLE_ORGANIZATION",
"startDate": null,
"endDate": null
}
],
"sequences": {}
},
"manager": null,
"address": null,
"supportedActivities": [
"PICK_STOCK",
"PUTAWAY_STOCK"
]
},
"zone": null,
"quantityAvailable": 10,
"quantityOnHand": null,
"status": "AVAILABLE",
"pickedRequisitionNumbers": "",
"binLocation.id": "2c96808386da37c80186dc7cb9f90017",
"binLocation.name": "Store"
}
]
}
and use it in payload for
POST /openboxes/api/stockTransfers
Payload
{
"stockTransferItems": [
{
"product.id": "2c96808386c648e70186c69efed0000b",
"product.productCode": "tp1",
"inventoryItem.id": "2c96808386c648e70186c6adf57c000c",
"location.id": "2c96808386da37c80186dc7c32520015",
"lotNumber": "Default",
"originBinLocation.id": "2c96808386da37c80186dc7cb9f90017",
"destinationBinLocation.id": "2c96808386da37c80186dc7ccfd70019",
"quantity": 1
}
]
}
It seems that it correctly creates stock transfer in PENDING status and I can see it in UI
Response
{
"data": {
"id": "2c96808386da37c80186dc84235a0022",
"description": null,
"stockTransferNumber": "827MHK",
"status": "PENDING",
"dateCreated": "March 13, 2023",
"origin.id": "2c96808386da37c80186dc7c32520015",
"origin.name": "test merchant",
"destination.id": "2c96808386da37c80186dc7c32520015",
"destination.name": "test merchant",
"stockTransferItems": [
{
"id": "2c96808386da37c80186dc84235a0023",
"productAvailabilityId": "2c96808386da37c80186dc84235a0023",
"product.id": "2c96808386c648e70186c69efed0000b",
"product.productCode": "tp1",
"product.name": "test product 1",
"product.handlingIcons": [],
"inventoryItem.id": "2c96808386da37c80186dc73fb6c000e",
"lotNumber": "Default",
"expirationDate": null,
"recalled": false,
"originBinLocation.id": "2c96808386da37c80186dc7cb9f90017",
"originBinLocation.name": "Store",
"originZone": null,
"onHold": false,
"destinationBinLocation.id": "2c96808386da37c80186dc7ccfd70019",
"destinationBinLocation.name": "Sold",
"destinationZone.id": null,
"destinationZone.name": null,
"quantity": 1,
"quantityOnHand": 0,
"quantityNotPicked": 0,
"status": "PENDING",
"recipient": null,
"splitItems": [],
"picklistItems": [],
"sortOrder": 0
}
],
"orderedBy": "Miss Administrator",
"type": "TRANSFER_ORDER",
"dateShipped": "",
"expectedDeliveryDate": "",
"shipmentType": "",
"trackingNumber": "",
"driverName": "",
"comments": "",
"documents": ""
}
}
but when I try to update this transfer with ID I get from the previous step
POST /openboxes/api/stockTransfers/2c96808386da37c80186dc84235a0022
Payload
{
"status": "COMPLETED"
}
I always get a response with an empty stockTransferItems array
Response
{
"data": {
"id": "2c96808386da37c80186dc8454940024",
"description": null,
"stockTransferNumber": "355YBV",
"status": "COMPLETED",
"dateCreated": "March 13, 2023",
"origin.id": "2c96808386da37c80186dc7c32520015",
"origin.name": "test merchant",
"destination.id": "2c96808386da37c80186dc7c32520015",
"destination.name": "test merchant",
"stockTransferItems": [],
"orderedBy": "Miss Administrator",
"type": "TRANSFER_ORDER",
"dateShipped": "",
"expectedDeliveryDate": "",
"shipmentType": "",
"trackingNumber": "",
"driverName": "",
"comments": "",
"documents": ""
}
}
And in UI I see a new completed transfer with 0 items in it.