1

//parmeter

var params = {
"auth":auth,
"kind": "reseller#customer",
"customerId": "customerId",
"customerDomain": "customer domain",
"postalAddress": {
  "kind": "customers#address",
  "contactName": "John Doe",
  "organizationName": "Example Inc",
  "postalCode": "94043",
  "countryCode": "US",

},
"alternateEmail": "email address  "

} //using api

var service = google.reseller('v1');
service.customers.insert(params,function(err,data){
   console.log(err);
   console.log(data); 
})

Iam getting this error:

{ [Error: Invalid Value]
  code: 400,
  errors: [ { domain: 'global', reason: 'invalid', message: 'Invalid Value' } ] }
Jagat Dave
  • 1,643
  • 3
  • 23
  • 30
sandeep rajbhandari
  • 1,268
  • 1
  • 12
  • 12

2 Answers2

0

You can use request module to perform this action in easy way.

here is an example to insert a customer execute it

POST https://www.googleapis.com/apps/reseller/v1/customers

    Body parameter

  {
  "kind": "reseller#customer",
  "customerId": "custId-1234",
  "customerDomain": "example.com",
  "postalAddress": {
    "kind": "customers#address",
    "contactName": "John Doe",
    "organizationName": "Example Inc",
    "postalCode": "94043",
    "countryCode": "US",
  },
  "alternateEmail": "alternateEmail@google.com"
}

For more reference

abdulbarik
  • 6,101
  • 5
  • 38
  • 59
0

The problem is stated in your error logs already.

reason: message: 'Invalid Value'

"auth":auth is not included in the Customers resource.

These are the valid values:

{
  "kind": "reseller#customer",
  "customerId": string,
  "customerDomain": string,
  "postalAddress": {
    "kind": "customers#address",
    "contactName": string,
    "organizationName": string,
    "locality": string,
    "region": string,
    "postalCode": string,
    "countryCode": string,
    "addressLine1": string,
    "addressLine2": string,
    "addressLine3": string
  },
  "phoneNumber": string,
  "alternateEmail": string,
  "resourceUiUrl": string,
  "customerDomainVerified": boolean
}
ReyAnthonyRenacia
  • 17,219
  • 5
  • 37
  • 56