cancel
Showing results for 
Search instead for 
Did you mean: 

PHP API - Setting Billing Phone & Company in a Subscription

I can't seem to find the right API methods to allow me to set a customer's billing company and billing phone number. When I used the CustomerAddressType and called setPhoneNumber(), I received an error about it not being a valid child of that namespace.

 

When subscriptions are created via the API, I see the "phone" and "company" are blank - how can I set them into an ARB subscription via the API? 

 

The email field is also blank and I would like to populate that progamatically with the newly created subscription.

nox7
Member
3 REPLIES 3

This is the exact error

 

The element 'billTo' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element 'phoneNumber' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.

 

From this code;

 

...

$customerAddress->setCountry($countryCode);
$customerAddress->setPhoneNumber($phoneNumber);

 

$subscription->setBillTo($customerAddress);

 

nox7
Member
@nox7

The phone number goes in as a property of a customerDataType object, if I remember correctly. You are putting in the company correctly.
It would help if I looked at your code. You are passing country. For company you use that same class as you are using.