This function updates a payment-method after it already exists whether it was created through Stax.js or direct-post.
Update details of an existing payment method. This is useful for updating expiration dates, metadata, or reactivating a soft-deleted payment method.
Key Features
- Modify metadata or properties of a stored payment method.
- Reactivate a soft-deleted payment method by setting deleted_at to null.
- Supports both card and bank account payment methods.
Usage Notes
Partial Updates: You can update one or multiple fields without affecting others.
Reactivating Payment Methods: To reactivate a payment method, set deleted_at
to null
.
Validation: Ensure provided values are valid and in the correct format.
Response Structure
Code | Response | Reason |
---|---|---|
200 | Success | Returns the updated payment method object with new details. |
400 | Bad Request | Invalid input or unmodifiable fields provided. |
401 | Unauthorized | Authentication failed. |
404 | Unprocessable Entity | Payment method with the specified ID does not exist. |
Important Considerations
Data Integrity: Avoid making changes that could invalidate the payment method.
Customer Notification: Consider notifying customers if their payment method details have changed.
Security: Do not include sensitive information (e.g., full card number) in the update.