Skip to content

Update merchant default inventory batch settings

Request

Updates or creates the merchant's default inventory batch settings.

Security
BearerAuth
Bodyapplication/json
batch_prioritystring
Enum:"first_expired_first_out""first_produced_first_out"
b2c_shelf_life_in_weeksinteger or null
b2b_shelf_life_in_weeksinteger or null
ito_shelf_life_in_weeksinteger or null
kit_shelf_life_in_weeksinteger or null
action_weeks_before_expiryinteger or null, >= 0

Weeks before expiry at which the batch is taken out of circulation. Null clears the value.

expiry_follow_up_actionstring

What happens to a batch once it has expired. The merchant default always carries an action, so this cannot be null; omit it to keep the stored value.

Enum:"block_only""block_and_dispose""block_and_sendback"
curl -i -X PATCH \
  https://developers.hive.app/_mock/merchant-api-v2/mapi_v2_oas31/inventory_batch_settings/default \
  -H 'Authorization: Bearer <YOUR_token_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "batch_priority": "first_expired_first_out",
    "b2c_shelf_life_in_weeks": 0,
    "b2b_shelf_life_in_weeks": 0,
    "ito_shelf_life_in_weeks": 0,
    "kit_shelf_life_in_weeks": 0,
    "action_weeks_before_expiry": 0,
    "expiry_follow_up_action": "block_only"
  }'

Responses

Updated inventory batch settings

Bodyapplication/json
idinteger, (int64)required

Unique identifier

batch_prioritystringrequired

Priority strategy for batch selection

Enum:"first_expired_first_out""first_produced_first_out"
b2c_shelf_life_in_weeksinteger or nullrequired

Minimum remaining shelf life in weeks for B2C orders

b2b_shelf_life_in_weeksinteger or nullrequired

Minimum remaining shelf life in weeks for B2B orders

ito_shelf_life_in_weeksinteger or nullrequired

Minimum remaining shelf life in weeks for inventory transfer orders

kit_shelf_life_in_weeksinteger or nullrequired

Minimum remaining shelf life in weeks for kitting

is_merchant_defaultbooleanrequired

Whether this is the merchant's default settings (true) or SKU-specific (false)

sku_idinteger or null, (int64)required

SKU ID if this is a SKU-specific setting, null for merchant default

action_weeks_before_expiryinteger or null, >= 0required

How many weeks before a batch's expiry date its stock is taken out of circulation, as stored on this settings record. Hive resolves the window it actually applies one field at a time: the SKU's own value, else the merchant default's value, else Hive's own default. So a null here means only that this record sets no value — on a SKU-specific record (is_merchant_default: false) the merchant default may still supply one, and only on the merchant default record does null mean Hive's own default applies. Always null until the batch expiry handling feature is rolled out to the account.

expiry_follow_up_actionstring or nullrequired

What happens to a batch once it has expired: block it only, dispose of it, or send it back to the merchant. The value as stored on this settings record, not resolved through the merchant default. On a SKU-specific record (is_merchant_default: false) null means the SKU inherits the merchant default's action; the merchant default record always carries one. Also null until the batch expiry handling feature is rolled out to the account.

Enum:"block_only""block_and_dispose""block_and_sendback"null
Response
{ "id": 0, "batch_priority": "first_expired_first_out", "b2c_shelf_life_in_weeks": 0, "b2b_shelf_life_in_weeks": 0, "ito_shelf_life_in_weeks": 0, "kit_shelf_life_in_weeks": 0, "is_merchant_default": true, "sku_id": 0, "action_weeks_before_expiry": 0, "expiry_follow_up_action": "block_only" }