- Data Factory
- Create Available Inventory
Data Factory
Create Available Inventory
Simulate adding inventory in available status (Sandbox only)
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.
MasonHub SKU UUID to add inventory for.
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:
Add Inventory
The specified quantity is added to the SKU’s available inventory
Update Totals
Total available-to-sell quantities are updated
Trigger Callbacks
skuInventoryChange callbacks are sent to registered endpoints
Testing Workflows
Order Fulfillment Tests
Add inventory before creating test orders to ensure sufficient stock.
Callback Validation
Verify your system receives and processes inventory change callbacks.
Integration Tests
Build end-to-end test scenarios with predictable inventory levels.
Load Testing
Create large inventory quantities for performance testing.
Best Practices
Use consistent, predictable SKU IDs in your test data for easier debugging and test maintenance.
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
}
]'
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
}'{
"success": true,
"data": [
{
"sku_id": "e5d00ff6-b34a-496e-9559-eb90e99463af",
"quantity_added": 100,
"new_available_quantity": 100
}
]
}