commercetools-api-reference
commercetools-api-reference copied to clipboard
Format of InventoryEntryCreated message doesn't match the spec
According the the spec and docs the inventoryEntry
field of the InventoryEntryCreated
message should contain an InventoryEntry.
The messages API instead returns the following structure (didn't check the format in subscriptions yet):
{
"id": "00000000-0000-0000-0000-000000000000",
"version": 1,
"versionModifiedAt": "2022-11-17T13:59:00.080Z",
"sequenceNumber": 1,
"resource": {
"typeId": "inventory-entry",
"id": "11111111-1111-1111-1111-111111111111"
},
"resourceVersion": 1,
"resourceUserProvidedIdentifiers": {
"sku": "my-sku"
},
"type": "InventoryEntryCreated",
"inventoryEntry": {
"type": "InventoryEntryCreated",
"inventoryEntryId": "11111111-1111-1111-1111-111111111111",
"sku": "my-sku",
"supplyChannel": {
"typeId": "channel",
"id": "22222222-2222-2222-2222-222222222222"
},
"quantityOnStock": 123,
"restockableInDays": 2,
"messageId": {
"id": "00000000-0000-0000-0000-000000000000",
"sequenceNumber": 1
}
},
"createdAt": "2022-11-17T13:59:00.080Z",
"lastModifiedAt": "2022-11-17T13:59:00.080Z",
"lastModifiedBy": {
"isPlatformClient": false,
"clientId": "client-id"
},
"createdBy": {
"isPlatformClient": false,
"clientId": "client-id"
}
}