- Inbound Shipments/ASN
- Delete Inbound Shipments
Inbound Shipments/ASN
Delete Inbound Shipments
Soft delete inbound shipments by customer identifier
curl --request DELETE \
--url https://sandbox.masonhub.co/dragonfly-cosmetics-demo/api/v1/inbound_shipments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"customer_identifier": "<string>"
}'Soft delete inbound shipments that are no longer needed. This endpoint performs a logical deletion, maintaining records for audit purposes.
Only shipments with open status can be deleted. Shipments that are already on dock or being received cannot be removed.
This is a soft delete operation. Shipments are marked as deleted but remain in the system for historical tracking and reconciliation.
​Request Body Schema
Send an array of objects containing the customer identifiers of shipments to delete.
Unique shipment identifier that matches the existing shipment you want to delete.
curl -X DELETE "https://app.masonhub.co/{account}/api/v1/inbound_shipments" \
-H "Authorization: Bearer your_jwt_token" \
-H "Content-Type: application/json" \
-d '[
{
"customer_identifier": "shipment234523"
},
{
"customer_identifier": "shipment234524"
}
]'
{
"success": true,
"data": [
{
"customer_identifier": "shipment234523",
"status": "deleted",
"deleted_at": "2018-12-02T14:30:00Z"
},
{
"customer_identifier": "shipment234524",
"status": "deleted",
"deleted_at": "2018-12-02T14:30:00Z"
}
]
}
​Delete Behavior
When you delete an inbound shipment:
Status Validation
System checks that the shipment is in open status
Soft Delete
Shipment is marked as deleted but remains in the system
Inventory Adjustment
Expected inventory is reduced for all line item SKUs
Callback Triggered
skuInventoryChange callbacks are sent for affected SKUs
​When to Delete Shipments
​Batch Operations
You can delete multiple shipments in a single request. The system processes each deletion independently:
- Full Success: All shipments deleted successfully (HTTP 200)
- Partial Success: Some deletions succeeded, others failed (HTTP 207)
- Full Failure: All deletions failed (HTTP 400)
When batch deleting, check the response carefully. The API returns detailed information about which shipments were successfully deleted and which failed, including specific error reasons.
​Best Practices
Check Status First
Verify the shipment is still in open status before attempting to delete.
Handle Partial Success
In batch operations, handle the scenario where some deletions succeed and others fail.
Monitor Inventory
Use callbacks to track expected inventory changes after deletion.
Consider Updates
If shipment details changed, consider updating instead of deleting and recreating.
​Status Restrictions
Shipments can only be deleted when in open status. Once a shipment moves to:
- onDock: Shipment has arrived - contact MasonHub support
- receivingStarted: Processing has begun - deletion not allowed
- receivingComplete: Processing complete - shipment is closed
​Inventory Impact
Deleting an inbound shipment immediately affects expected inventory:
- Expected quantities are reduced for all line items
- Available and allocated inventory remain unchanged
- skuInventoryChange callbacks notify you of the changes
- The system maintains accurate inventory projections
If you accidentally delete a shipment, you can recreate it using the same customer_identifier as long as no new shipment with that identifier has been created.
curl -X DELETE "https://app.masonhub.co/{account}/api/v1/inbound_shipments" \
-H "Authorization: Bearer your_jwt_token" \
-H "Content-Type: application/json" \
-d '[
{
"customer_identifier": "shipment234523"
},
{
"customer_identifier": "shipment234524"
}
]'
curl --request DELETE \
--url https://sandbox.masonhub.co/dragonfly-cosmetics-demo/api/v1/inbound_shipments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"customer_identifier": "<string>"
}'{
"success": true,
"data": [
{
"customer_identifier": "shipment234523",
"status": "deleted",
"deleted_at": "2018-12-02T14:30:00Z"
},
{
"customer_identifier": "shipment234524",
"status": "deleted",
"deleted_at": "2018-12-02T14:30:00Z"
}
]
}