question

rohitpandey avatar image
rohitpandey asked rohitpandey commented

Not able to create customer for a order while creating an order on sandbox account using API

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!

OrdersCustomers
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

Mike M avatar image
Mike M answered rohitpandey commented

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.

4 comments
10 |2000

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

rohitpandey avatar image rohitpandey commented ·

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

0 Likes 0 ·
rohitpandey avatar image rohitpandey commented ·

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?

0 Likes 0 ·
Mike M avatar image Mike M commented ·

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.

0 Likes 0 ·
rohitpandey avatar image rohitpandey commented ·

You are right. Thanks :)

0 Likes 0 ·

Welcome to the
Clover Developer Community