Delete Payment Method
Deletes an existing payment method permanently.
HTTP Request
DELETE/api/payment/methods/:id
Authorization
Authorization
- Required: Yes
- Permission: Admin or Staff
- Authentication: Token-based (Authorization: Token <your_api_key>)
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | Integer | Yes | Unique ID of the payment method to delete |
Example Requests
- 🐍 Python
- 🌐 Curl
1import requests
2
3response = requests.delete('http://www.example.com/api/payment/methods/123',
4 headers={'Authorization': 'Token <your_api_key>'}
5)
6print(response.status_code) # Should be 204 for successful deletion1curl -X DELETE "http://www.example.com/api/payment/methods/123" \
2-H "Authorization: Token <your_api_key>"Status Codes
| Code | Description |
|---|---|
| 204 | Payment method deleted successfully |
| 401 | Unauthorized — authentication required |
| 403 | Forbidden — insufficient permissions |
| 404 | Not found — payment method does not exist |
| 500 | Internal server error |
Response Fields
| Field | Type | Description |
|---|---|---|
| None | None | No response body returned for successful deletion |
- This operation permanently deletes the payment method and cannot be undone
- A successful deletion returns HTTP status code 204 with no response body
- Make sure the payment method is not being used in any active transactions before deletion
- Consider deactivating the payment method instead of deleting it if you want to preserve historical data