0

Hello Everyone,

I was trying to add customer information alongwith creating an order on sandbox account using API but cannot do so. I can create order successfully but customer info. doesn't went along with it. Below is the json I was using within json format of order creation:

"customers": [ { "customerSince": "", "firstName": "Just", "lastName": "Happen", "addresses": [ { "zip": "123456", "country": "India", "address3": "street 3", "address2": "street 2", "city": "city", "address1": "#123", "id": "", "state": "Haryana" } ], "emailAddresses": [ { "emailAddress": "rohitpandey@gmail.com", "id": "", "verifiedTime": "" } ], "cards": [ { "last4": "1234", "firstName": "", "lastName": "", "cardType": "", "id": "", "first6": "987654", "expirationDate": "", "token": "" } ], "id": "", "phoneNumbers": [ { "phoneNumber": "7696070761", "id": "" } ] } ],

Please suggest what I may be doing wrong?

Thanks!

asked 2016-04-21 06:50:49 -0500

rohitpandey gravatar image

1 answer

Sort by  
0

As per the documentation: https://www.clover.com/api_docs#!/ord...

Only supports basic order creation. Valid fields are limited to taxRemoved, note, title, and orderType. Adding line items must be done in separate calls.

You will need to add customers with an additional API call.

answered 2016-04-21 16:17:30 -0500

mike gravatar image
Comments

Thanks mike for the response. Then how will I relate that customer to a particular order?

rohitpandey gravatar image
rohitpandey 2016-04-22 00:03:16 -0500

Also, how can I get customer information related to a particular order as fetching a single order does not include customer information within the json response?

rohitpandey gravatar image
rohitpandey 2016-04-22 01:24:12 -0500

Relating customers to an order will need to use the Update Order API

For getting customer data in an order. Please check out our API expansions, specifically expand=customers.

mike gravatar image
mike 2016-04-25 15:50:01 -0500

You are right. Thanks :)

rohitpandey gravatar image
rohitpandey 2016-04-26 00:26:17 -0500