Delete a Customer

To soft delete a customer

The Delete a Customer endpoint allows merchants to soft delete a customer from their records. A soft delete means the customer record is not permanently removed from the database but is hidden from general queries and marked as deleted by setting a deleted_at timestamp.


Key Features

  • Soft Deletion: Hides the customer record from standard queries while preserving it in the database.
  • Retrievable: Deleted customers can still be retrieved using their unique customer_id.
  • Auditability: The deleted_at field indicates when the deletion occurred for tracking purposes.

Usage Notes

One Record Per Call: This endpoint processes one customer record at a time. Batch deletions are not supported.

Retrieving Deleted Records: Use the Get a Customer's Information endpoint with the specific customer_id to view deleted records.

Impact on Transactions: Deleting a customer does not affect their historical transactions or associated payment methods.


Response Structure

CodeResponseDescription
200SuccessThe customer was successfully deleted.
400Bad RequestInvalid or missing fields in the request.
401UnauthorizedAPI key invalid or missing.
404Not FoundNo customer found with the provided customer_id.
500Internal Server ErrorAn unexpected error occurred on the server.

Important Considerations

Deleted Status: A deleted customer record will have a non-null deleted_at field.

Permanence: Soft deletions can only be reversed by contacting Stax support.

Associated Data: Deleting a customer does not delete their payment methods or transactions, ensuring financial records remain intact.

Access Control: Only merchants with the appropriate API key for the customer's account can perform deletions.


Best Practices

  • Use this endpoint when a customer is no longer active but their records need to remain intact for compliance or audit purposes.
  • Keep track of deleted customer records to avoid accidental re-creation or data duplication.
  • Log deletion requests for audit and recovery purposes.
Language
Credentials
OAuth2
Click Try It! to start a request and see the response here!