Update Out of Stock Status
Beside using the Sync Menu flow, you can also utilise a specific API to mark items or variants as out of stock. The out of stock status will be reflected immediately on your outlet once you made a successful request.
Out of Stock Update Flow
Before updating items or variants out of stock status, you will need to get the catalog of your outlet first by calling the GET catalog endpoint to retrieve the item or variant IDs (UUID format). The IDs need to be sent as request body when calling Items OOS endpoint & Variants OOS endpoint in order to proceed the request.
Get Catalog
Endpoint = GET /integrations/gofood/outlets/{outlet_id}/v2/catalog
Sample Request
curl -X GET https://api.partner-sandbox.gobiz.co.id/integrations/gofood/outlets/{outlet_id}/v2/catalog \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {access-token}'
Sample Response (200)
{
"success": true,
"data": {
"variant_categories": [
{
"variants": [
{
"price": 1000,
"name": "Garlic",
"in_stock": true,
"external_id": "V-XID",
"id": "be18dc03-e941-4238-8bba-bcd9b5e554fc"
}
],
"rules": {
"selection": {
"min_quantity": 1,
"max_quantity": 2
}
},
"name": "Topping",
"internal_name": "Topping (promo)",
"id": "bb447057-4572-46f6-a97c-2e6478d98ac2"
},
{
"variants": [],
"rules": {
"selection": {
"min_quantity": 1,
"max_quantity": 2
}
},
"name": "Topping",
"internal_name": "Topping (non-promo)",
"id": "3234fd3a-151e-46bb-9a88-b2a682932393"
}
],
"menus": [
{
"name": "test food",
"menu_items": [
{
"variant_category_ids": ["bb447057-4572-46f6-a97c-2e6478d98ac2"],
"price": 12000,
"operational_hours": {
"wednesday": [
{
"start": "00:00",
"end": "23:59"
}
],
"tuesday": [
{
"start": "00:00",
"end": "23:59"
}
],
"thursday": [
{
"start": "00:00",
"end": "23:59"
}
],
"sunday": [
{
"start": "00:00",
"end": "23:59"
}
],
"saturday": [
{
"start": "00:00",
"end": "23:59"
}
],
"monday": [
{
"start": "00:00",
"end": "23:59"
}
],
"friday": [
{
"start": "00:00",
"end": "23:59"
}
]
},
"name": "girish test release",
"in_stock": true,
"image": "https://i-integration.gojekapi.com/darkroom/gofood-indonesia/v2/images/uploads/0c957da0-373a-4353-be73-a3cc702d9aa1_e649465b-369d-4271-84e2-12674e005ef3_Go-Resto_20180703_065512.jpg",
"id": "cc3d0c9f-47ff-4871-8443-348591437e92",
"external_id": "XID",
"description": "testing"
}
]
}
]
}
}
Mark Items as Out of Stock
Endpoint = PATCH /integrations/gofood/outlets/{outlet_id}/v2/menu_item_stocks
Sample Request
curl -X PATCH https://api.partner-sandbox.gobiz.co.id/integrations/gofood/outlets/{outlet_id}/v2/menu_item_stocks
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {access-token}' \
-d $'
[
{
"external_id": "XID",
"in_stock": true
}
]
'
Sample Response (200)
{
"success": true,
"data": {}
}
Mark Variants as Out of Stock
Endpoint = PATCH /integrations/gofood/outlets/{outlet_id}/v2/variant_stocks
Sample Request
curl -X PATCH https://api.partner-sandbox.gobiz.co.id/integrations/gofood/outlets/{outlet_id}/v2/variant_stocks
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {access-token}' \
-d $'
[
{
"external_id": "V-XID",
"in_stock": true
}
]
'
Sample Response (200)
{
"success": true,
"data": {}
}
To see how menu is reflected on consumer app - you can utilise your outlet testing web page (see sample here). Make sure menu, category, variants are in desired order.