Skip to main content

Endpoint

PUT /api/customers/update Updates an existing customer’s information in Stripe. The userId field is required to identify the customer. Email, name, and phone are optional and only fields provided will be updated.

Request Body

userId
string
required
The Stripe customer ID to update (format: cus_...)
email
string
Updated email address for the customer
name
string
Updated name for the customer
phone
string
Updated phone number for the customer

Response

status
boolean
Indicates if the request was successful
message
string
Response message describing the result
data
object
Updated customer object

Examples

curl -X PUT https://your-domain.com/api/customers/update \
  -H "Content-Type: application/json" \
  -d '{
    "userId": "cus_1234567890abcdef",
    "email": "[email protected]",
    "name": "John Updated Doe",
    "phone": "+1234567899"
  }'

Response Examples

Success (200)

{
  "status": true,
  "message": "Cliente actualizado correctamente",
  "data": {
    "id": "cus_1234567890abcdef",
    "email": "[email protected]",
    "name": "John Updated Doe",
    "phone": "+1234567899"
  }
}

Error (400)

{
  "status": false,
  "message": "userId es requerido",
  "code": null
}

Error (500)

{
  "status": false,
  "message": "Error interno del servidor",
  "code": null
}

Build docs developers (and LLMs) love