Overview
Update existing customer profiles in the Cyrexa IPG system to maintain accurate customer information and payment preferences. This endpoint is essential for maintaining accurate customer data and ensuring optimal payment processing experiences.Customer updates should be performed whenever customer information changes, such as address updates, contact information changes, or preference modifications.
API Endpoint
- Method:
PUT
- Path:
/customers/{id}
- id (required): The unique identifier of the customer to update
- Type:
integer (int64)
- Example:
12345
- Type:
Path Parameters
- id (required): The unique identifier of the customer to update
- Type:
integer (int64)
- Example:
12345
- Type:
Request Body
The request body should contain aClient
object with the updated customer information. You only need to include the fields you want to update.
Updatable Fields
-
Personal Information
- Name
- Email address
- Phone number
- Date of birth
-
Address Information
- Billing address
- Shipping address
- Country and region
-
Account Preferences
- Default currency
- Language preference
- Notification settings
- Communication preferences
-
Account Status
- Active/inactive status
- Account verification status
- Subscription preferences
Integration Examples
Basic Customer Update
Partial Customer Update
Update with Validation
Response Codes
Success Response
- 200 OK: Customer updated successfully
Error Responses
- 400 Bad Request: Invalid request data or validation errors
- 401 Unauthorized: Invalid or missing authentication credentials
- 404 Not Found: Customer with specified ID does not exist
Error Handling
Common Error Scenarios
-
Customer Not Found
- Status:
404 Not Found
- Cause: Invalid customer ID or customer has been deleted
- Solution: Verify the customer ID exists before attempting update
- Status:
-
Validation Errors
- Status:
400 Bad Request
- Cause: Invalid data format, missing required fields, or constraint violations
- Solution: Validate data before sending the request
- Status:
-
Authentication Errors
- Status:
401 Unauthorized
- Cause: Invalid, expired, or missing authentication token
- Solution: Refresh authentication token and retry
- Status:
Error Response Format
Best Practices
Data Validation
- Client-Side Validation: Validate data before sending to reduce server errors
- Format Checking: Ensure email, phone, and address formats are correct
- Required Fields: Check that all required fields are provided
- Data Sanitization: Clean and sanitize user input before processing
Update Strategy
- Partial Updates: Only send fields that have changed to minimize data transfer
- Optimistic Updates: Update UI immediately, then sync with server
- Conflict Resolution: Handle cases where data has been modified by another process
- Audit Trail: Log all customer updates for compliance and debugging
Security Considerations
- Authorization: Ensure users can only update their own profiles or have proper permissions
- Data Validation: Validate all input data to prevent injection attacks
- Rate Limiting: Implement rate limiting to prevent abuse
- Sensitive Data: Handle sensitive information with extra care
Use Cases
Profile Management
- Contact Updates: When customers change email or phone numbers
- Address Changes: When customers move or update billing/shipping addresses
- Preference Updates: When customers modify notification or payment preferences
Account Management
- Status Changes: Activating, deactivating, or suspending customer accounts
- Verification Updates: Updating verification status after identity checks
- Subscription Changes: Modifying subscription levels or preferences
Compliance Updates
- GDPR Compliance: Updating consent preferences and data processing agreements
- KYC Updates: Refreshing Know Your Customer information as required
- Tax Information: Updating tax-related customer information
Integration Considerations
Before Updating
- Fetch Current Data: Get current customer information to avoid overwriting unchanged fields
- User Permissions: Verify the requesting user has permission to update the customer
- Data Backup: Consider backing up current data before major updates
After Updating
- Confirmation: Send confirmation to customer about profile changes
- Audit Logging: Log the update for compliance and troubleshooting
- Cache Invalidation: Clear any cached customer data to ensure consistency
- Downstream Systems: Notify other systems that depend on customer data
Next Steps
Create Customer
Learn how to create new customer profiles
User Payment Methods
Manage customer’s saved payment methods
Customer Authentication
Implement secure customer authentication
Path Parameters
Body
Maximum length:
100
Maximum length:
100
Maximum length:
255
Maximum length:
20
Maximum length:
50
Response
OK