Start a new topic

Api - updating billing info for customer.

Hello. We have one problem in using an api.


We use python api for update customer billing feature. When i try to update only one field for customer - it clears all fields that was before.


Here is how i use it for update billing email for our customer  and it updates all of the data of customer - so company, address and other fields become empty.


chargebee.Customer.update_billing_info(company.chargebee_id, {
'email': request.POST['email']
})

1 person likes this idea

Hello there,


I'm sorry to say that currently, when you use the API for update customer billing feature, it is not possible to update a single field by passing a single value. When you try to update the billing fields, all the fields get updated and since you passed a single field value, the remaining fields became empty. 


So, this is only possible by passing all the field values for now. In this case, all the fields get updated with the passed values.


We have this restriction because the fields in billing information all dependent on one another. 


Hope this solves your query.

Hi, Pranathi!


I work with Pavel.


When we discussed this issue with Pavel, with thought it was a bit odd that you guys have this behaviour when any field can be updated via Chargebee dashboard. 


You said you have this restriction because "fields in billing information all dependent on one another". Can you please explain why. How are they dependant on one another?


Also, somewhat unrelated question. Can we pass 2+ emails (separated by commas)? Occasionally our customer request us to send invoices to main contact and CC billing department, which can include 2+ people.


Thank you!

Hey Constantine,


What I meant by " fields in billing information are dependent o one another " is since it is an address field, each field depends on which state it is or which country it is. For eg- the Street number for a house in New York will be different from that of the one in Los Angeles. This is also done to avoid any issues that might occur when you do not update the address on the whole.


Hence it is not possible to update just a single field using the APIs.


Regarding your second question, you can CC an email to more than one email address by making use of the Add CC/BCC option which appears when you click on EDIT MESSAGE option on any email template. Once you Publish this, then that email notification will be sent to the CCed people as well.



Hope this solves your question.












Pranathi, 


I know that we can manually add CC/BCC in email templates. I was wondering how can we do it via API. So, when we add multiple billing contacts for customer in our dashboard we can push this data (emails) to Chargebee via API.

Hey Constantin,


It is possible to send emails to the billing contacts through Chargebee interface. To do that, you are required to add the billing contact using the Add contacts (Additional contacts section) option in the Customer details page.



Once you do this, navigate to Settings>>Configure Chargebee>>Email Notifications. Under this page, open any email template of your choice and click on EDIT MESSAGE option. Then enable the option, Send to billing contacts and Publish it.


This will automatically send your emails to the billing contact. So, it is not required to configure via the API. Besides, it is not possible to change the billing contact to CC/BCC using the API.


Hope this solves your question.


 



Login or Signup to post a comment