I’m using the Python SDK to create a customer profile from information retrieved from a Google Form. Using gspread, I’m retrieving info with this code segment:
firstName = worksheet.acell(‘B2’).value
lastName = worksheet.acell(‘C2’).value
email = worksheet.acell(‘D2’).value
phoneNum = worksheet.acell(‘E2’).value
address = worksheet.acell(‘F2’).value
I’m then turning those into a customer body using:
customerBody = {
“given_name”: firstName,
“family_name”: lastName,
“email_address”: email,
“phone_number”: phoneNum,
‘address’: address
}
Then I use the command:
custCreate = customers_api.create_customer(customerBody)
And I get this error line:
[{‘code’: ‘BAD_REQUEST’, ‘detail’: ‘Expected “{” (line 1, character 126)’, ‘category’: ‘INVALID_REQUEST_ERROR’}]
Any help is appreciated.
4 posts - 2 participants