1. Data Factory
  2. Create Available Inventory
POST
/data_factory/createAvailable
curl --request POST \
     --url https://sandbox.masonhub.co/dragonfly-cosmetics-demo/api/v1/data_factory/createAvailable \
     --header 'Authorization: Bearer <token>' \
     --header 'Content-Type: application/json' \
     --data '{
  "sku_id": "<string>",
  "quantity": 123
}'

Simulate adding inventory in ‘available’ status for testing integration workflows in the sandbox environment.

DataFactory is only available in the sandbox environment. These endpoints are for testing purposes only.

This operation triggers skuInventoryChange callbacks just like real inventory receipts.

​
Request Body

Send an array of inventory objects to add.

sku_id
required
string

MasonHub SKU UUID to add inventory for.

quantity
required
integer

Quantity of units to add to available inventory.

curl -X POST "https://app.masonhub.co/{account}/api/v1/data_factory/createAvailable" \
  -H "Authorization: Bearer your_jwt_token" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "sku_id": "e5d00ff6-b34a-496e-9559-eb90e99463af",
      "quantity": 100
    }
  ]'
{
  "success": true,
  "data": [
    {
      "sku_id": "e5d00ff6-b34a-496e-9559-eb90e99463af",
      "quantity_added": 100,
      "new_available_quantity": 100
    }
  ]
}

​
What This Does

When you create available inventory:

1

Add Inventory

The specified quantity is added to the SKU’s available inventory

2

Update Totals

Total available-to-sell quantities are updated

3

Trigger Callbacks

skuInventoryChange callbacks are sent to registered endpoints

​
Testing Workflows

​
Best Practices

Use consistent, predictable SKU IDs in your test data for easier debugging and test maintenance.