Delete Payment Method
Remove a saved payment method.
Endpoint
INFO
DELETE /api/v1/client/payment-methods/{paymentMethod}
Headers
| Header | Value | Required |
|---|---|---|
Accept | application/json | Yes |
Authorization | Bearer {token} | Yes |
X-Agency-Signature | {signature} | Yes |
Path Parameters
| Parameter | Type | Description |
|---|---|---|
paymentMethod | integer | Payment method ID |
Example Request
bash
curl -X DELETE https://api.daakey.com/api/v1/client/payment-methods/2 \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-H "X-Agency-Signature: {signature}"Response
Success (200)
json
{
"success": true,
"message": "Payment method removed",
"data": null,
"meta": {
"agency_id": 123,
"agency_code": "AGENCY123"
},
"request_id": "uuid",
"timestamp": "2024-01-01T00:00:00.000Z"
}Error (400) - Cannot Remove Default
json
{
"success": false,
"message": "Cannot remove default payment method",
"data": {
"reason": "Set another payment method as default first"
},
"request_id": "uuid",
"timestamp": "2024-01-01T00:00:00.000Z"
}Error (400) - Active Booking
json
{
"success": false,
"message": "Cannot remove payment method",
"data": {
"reason": "Payment method is associated with active bookings"
},
"request_id": "uuid",
"timestamp": "2024-01-01T00:00:00.000Z"
}Error (404)
json
{
"success": false,
"message": "Payment method not found",
"data": null,
"request_id": "uuid",
"timestamp": "2024-01-01T00:00:00.000Z"
}Notes
- Cannot remove the default payment method
- Cannot remove a payment method with active bookings
- At least one payment method is required for bookings