Overview

The customer update endpoint allows you to modify existing customer information. You can perform both partial and full updates to customer records.

Base URL

PATCH /customers/{id}

Authentication

All requests must include your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Request Parameters

Path Parameters

id
string
required

The unique identifier of the customer to update

Body Parameters

first_name
string

Customer’s first name

last_name
string

Customer’s last name

email
string

Customer’s email address. Must be a valid email format.

phone_number
string

Customer’s phone number in E.164 format (e.g., +2348012345678)

billing_address
object

Customer’s billing address information

Examples

curl -X PATCH "https://api.spendjuice.com/customers/6f7e1e7f-93d1-4fcc-b7a4-738f869615c8" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "phone_number": "+2348012345678",
    "billing_address": {
      "line1": "123 Test lane",
      "city": "Anon"
    }
  }'

Response

Success Response (200 OK)

{
    "data": {
        "id": "6f7e1e7f-93d1-4fcc-b7a4-738f869615c8",
        "first_name": "Test",
        "last_name": "Customer",
        "email": "test@custom.er",
        "phone_number": "+2348012345678",
        "billing_address": {
            "line1": "123 Test lane",
            "line2": "3456 Mike Drive",
            "city": "Anon",
            "state": "Acme",
            "zip_code": "12345",
            "country": "US"
        }
    }
}

Error Responses

Update Rules

Important Update Considerations

  • Only provide fields that need to be updated
  • Nested objects (like billing_address) must be updated as a complete object
  • Empty strings ("") will clear the field value
  • Null values are ignored
  • Phone numbers must be in E.164 format
  • Email addresses must be valid format

Rate Limits

Customer update requests are limited to:

  • 10 requests per minute per API key
  • 1000 requests per day per API key

Versioning

The current version of this API is v1. We recommend including a version accept header:

Accept: application/json;version=1

Best Practices

  1. Partial Updates

    • Only send fields that need to be changed
    • Use PATCH for partial updates
    • Validate data before sending
  2. Error Handling

    • Implement proper error handling
    • Validate response status codes
    • Log failed update attempts
  3. Idempotency

    • Use idempotency keys for critical updates
    • Retry failed requests with the same idempotency key
  4. Validation

    • Validate all input fields client-side
    • Handle validation errors appropriately
    • Check response data matches expected format

Need Help?

For additional support: