Skip to content

Set Default Payment Method

Set a payment method as the default for future transactions.

Endpoint

INFO

POST /api/v1/client/payment-methods/{paymentMethod}/default

Headers

HeaderValueRequired
Acceptapplication/jsonYes
AuthorizationBearer {token}Yes
X-Agency-Signature{signature}Yes

Path Parameters

ParameterTypeDescription
paymentMethodintegerPayment method ID

Example Request

bash
curl -X POST https://api.daakey.com/api/v1/client/payment-methods/2/default \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {token}" \
  -H "X-Agency-Signature: {signature}"

Response

Success (200)

json
{
  "success": true,
  "message": "Default payment method updated",
  "data": {
    "id": 2,
    "type": "card",
    "brand": "mastercard",
    "last_four": "5555",
    "exp_month": 6,
    "exp_year": 2026,
    "is_default": true
  },
  "meta": {
    "agency_id": 123,
    "agency_code": "AGENCY123"
  },
  "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

  • The default payment method is used for all new bookings
  • Only one payment method can be default at a time
  • Previously default method is automatically unset

Daakey Car Sharing Platform