question

jdwade avatar image
jdwade asked bryanvargas answered

How create customer and assign it to order (REST API)?

How we know, Clover doesn't allow create/assign customer for the one atomic order request.
So, I need to create customer (first request), then create order (second request), then update order for associate it with customer (third request), right?

In this case - how we know that customer with this data doesn't exists? Can I check that customer with this data already exists and just get id for this one by any other field?

REST APICustomers
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
bryanvargas avatar image
bryanvargas answered

Yes that is the correct process. You can always use the GET customer endpoint to read customer data to see what customer data you have. Or you can create a if/else statement to map the customer data when updating the order:

"If customer data matches x(show results)>add to order, if not create new customer endpoint>add customer to that order"

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community