Delete Payment With Invoice Update
Delete a payment and automatically update the related invoice's payment status.
This endpoint provides intelligent payment deletion that:
- Validates payment ownership and permissions
- Automatically recalculates and updates the invoice payment status
- Creates an audit trail in invoice events
- Maintains data consistency across the system
Business Rules:
- Payment status is recalculated based on remaining payments
- Invoice events are created for audit purposes
- Only payments belonging to the authenticated organization can be deleted
- Note: Deleting Stripe payments removes the record but does not refund through Stripe
Args: payment_id: UUID of the payment to delete user_id: ID of the authenticated user (from auth middleware) org_id: ID of the user's organization (from auth middleware)
Returns: dict: Success response with updated invoice information
Raises: HTTPException: 401 if unauthorized, 404 if not found, 400 if Stripe payment, 500 if server error
delete/payments/{payment_id}
Request
- Base URL: https://api.every.ai (the document declares no server; this is the origin it was published from)
- URL: https://api.every.ai/payments/{payment_id}
- Auth: none declared
Path parameters
payment_idstring required
The ID of the payment to delete
Query parameters
bulk_operationboolean
user_idstring
org_idstring
Response
Successful Response
unknown required
Changes
No recorded changes to this operation across all 54 revisions of this API.