Search…
User.addBillingProfile()
Sets a new or existing address in user's billing profiles.
1
// Create a form object containing all the expected fields.
2
let profileForm = {
3
'first_name': 'Jim',
4
'last_name': 'Kirk',
5
'email': '[email protected]',
6
'address1': '1701 Utopia Way',
7
'address2': 'Apt. 10', // This property is optional
8
'city': 'Riverside',
9
'state': 'Iowa'
10
'zip': '12345'
11
'areacode': '431'
12
'phone': '985-1701'
13
}
14
15
// If we want to update an existing profile, we need to include a valid shipping id.
16
profileForm['billing_id'] = 1;
17
profileForm['billing_name'] = "Starfleet billing address";
18
19
// Add/update shipping profile.
20
User.addBillingProfile( profileForm )
21
.then(resolve => {
22
// Shipping profile added/updated.
23
});
Copied!
Param
Type
Details
profileForm
object
Form data containing information for address profile.
If a valid billing_idproperty is provided, this method will update the profile corresponding to that ID. Otherwise, it will create a new profile.
Last modified 8mo ago
Copy link