balanced / balanced-api

Balanced API specification.
220 stars 72 forks source link

Duplicate Customers #672

Closed fedesoria closed 9 years ago

fedesoria commented 9 years ago

When creating a new Customer there should be a response from Balanced saying that the Customer already exists with the customer_uri, instead of creating multiple copies of the same Customer.

mjallday commented 9 years ago

What would be the duplicate key for detecting these customers?

There are no unique constraints for Balanced customer objects, this is something that should be handled by the application logic of your system.

I recommend using a find or create approach e.g.

  1. look up customer by whatever unique constraint you want in your application (e.g. email address)
  2. if not exists then create customer
  3. ...
  4. profit

feel free to reopen this if the issue does not address your requirements.