Create customer
golabekp
Member Posts: 14
I am following the example in the Wave api documentation for creating a customer and I am receiving the following error.
"Argument \"input\" of required type \"CustomerCreateInput!\" was provided the variable \"$input\" which was not provided a runtime value."
$data=' mutation ($input: CustomerCreateInput!) { customerCreate(input: $input) { didSucceed inputErrors { code message path } customer { id name firstName lastName email address { addressLine1 addressLine2 city province { code name } country { code name } postalCode } currency { code } } } }'; $variables='{"input": { "businessId":'.$businessId.', "name": "Santa", "firstName": "Saint", "lastName": "Nicholas", "email": "santa@example.com", "address": { "city": "North Pole", "postalCode": "H0H 0H0", "provinceCode": "CA-NU", "countryCode": "CA" }, "currency": "CAD" } }'; $apiBody=json_encode(array( 'query'=>$data, 'variables'=>$variables));
0
Comments
Hi @golabekp,
I tried putting your query in the GraphQL Playground, and I suspect the problem is missing
"
around the.$businessId.
variable.To help debug the issue, check what the resulting
$variables
content is (that it is valid JSON). For your example, I would expect something like:Hope that helps,
Rob
Hi @RobVG,
Thanks the issue was that the variables were structured as a string and not an array I fixed it by
adding the following:
$variables=array('input'=>$var);
Is there a full list of operation variables available for the create customer mutation, beyond
"name", "firstName", "lastName", "email", "address", and "currency"?
Such as Phone, Account number, Fax, Mobile, Toll-free, Website, and Internal notes?
Thank you!
Hi @ServiceNode,
You can check out our API Reference for the full list of input parameters