MVMNT uses soft deletes for all resources. A DELETE doesn’t remove a record from the database—it sets deletedAt (and updates updatedAt). Most list endpoints hide soft-deleted records by default, so your integration should treat de letedAt as the source of truth.
A soft delete marks a record as deleted without physically deleting it. The record still exists and can be returned by the API, but it’s excluded from list results unless you explicitly request deleted records.
Every entity in the MVMNT API includes a deletedAt field:
| Field | Type | Description |
|---|---|---|
deletedAt | ISO 8601 datetime | null | Timestamp when entity was soft-deleted, or null if active |
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"friendlyId": "ORD-12345",
"key": "ERP-ORDER-789",
"status": "delivered",
"deletedAt": null,
"createdAt": "2025-01-15T10:00:00Z",
"updatedAt": "2025-01-20T14:00:00Z"
}{
"id": "550e8400-e29b-41d4-a716-446655440000",
"friendlyId": "ORD-12345",
"key": "ERP-ORDER-789",
"status": "delivered",
"deletedAt": "2025-01-20T15:30:00Z",
"createdAt": "2025-01-15T10:00:00Z",
"updatedAt": "2025-01-20T15:30:00Z"
}Use the standard DELETE request:
curl -X DELETE https://api.mvmnt.io/v1/orders/ORD-12345 \
-H "Authorization: Bearer $TOKEN"Response: 200 OK
What happens:
deletedAtis set to the current timestampupdatedAtis also updated to the current timestamp- Entity remains in database
- Entity is filtered out from list queries by default
Default behavior - soft-deleted entities are excluded:
curl https://api.mvmnt.io/v1/orders \
-H "Authorization: Bearer $TOKEN"Response:
{
"data": [
{
"id": "...",
"friendlyId": "ORD-12346",
"deletedAt": null
},
{
"id": "...",
"friendlyId": "ORD-12347",
"deletedAt": null
}
]
}ORD-12345 is not included because it’s soft-deleted.
Include deleted entities - use ?includeDeleted=true:
curl "https://api.mvmnt.io/v1/orders?includeDeleted=true" \
-H "Authorization: Bearer $TOKEN"Response:
{
"data": [
{
"id": "...",
"friendlyId": "ORD-12345",
"deletedAt": "2025-01-20T15:30:00Z"
},
{
"id": "...",
"friendlyId": "ORD-12346",
"deletedAt": null
},
{
"id": "...",
"friendlyId": "ORD-12347",
"deletedAt": null
}
]
}Soft-deleted entities are still accessible via GET by ID:
curl https://api.mvmnt.io/v1/orders/ORD-12345 \
-H "Authorization: Bearer $TOKEN"Response: 200 OK
{
"id": "550e8400-...",
"friendlyId": "ORD-12345",
"deletedAt": "2025-01-20T15:30:00Z",
...
}Your code must check deletedAt to determine if entity is deleted.
Deleted entities are also filtered out by default when querying by key:
curl "https://api.mvmnt.io/v1/orders?key=ERP-ORDER-789" \
-H "Authorization: Bearer $TOKEN"If the entity is deleted, this returns empty results unless you add ?includeDeleted=true.
When an entity is deleted, a webhook event is triggered:
{
"event": "order.deleted",
"timestamp": "2025-01-20T15:30:00Z",
"data": {
"id": "550e8400-...",
"friendlyId": "ORD-12345",
"key": "ERP-ORDER-789",
"deletedAt": "2025-01-20T15:30:00Z",
"status": "delivered"
}
}Note: The data object includes deletedAt - your webhook handler must handle this field.
Some webhook events may reference deleted entities (e.g., if a shipment references a deleted carrier). Always check deletedAt on related entities.
- Recovery: Records can be restored if something is deleted by mistake
- Auditability: Historical data remains available for reporting and troubleshooting
- Referential Integrity: Related records don’t break when they reference a deleted entity
- Retention: Some workflows require keeping deleted records for compliance and reporting
- Undo-Friendly UX: Products can support restore/undo without rebuilding data
- Check
deletedAt: TreatdeletedAt != nullas deleted, even if the API returns the record - Webhook Handling: Deletion shows up as events, and other events can reference deleted entities
- Storage: Deleted records still consume database space
- Queries: Use
?includeDeleted=truewhen you need deleted records in list results