Search…
User.addShippingProfile()
Sets a new or existing address in user's shipping profiles.
1
// Create a form object containing all the expected fields.
2
let profileForm = {
3
'first_name': 'Luke',
4
'last_name': 'Skywalker',
5
'email': '[email protected]',
6
'address1': '123 Blue Milk Way',
7
'address2': 'Apt. 3', // This property is optional
8
'city': 'Mos Eisley',
9
'state': 'Tatooine'
10
'zip': '11380'
11
'areacode': '431'
12
'phone': '987-1138'
13
}
14
15
// If we want to update an existing profile, we need to include a valid shipping id.
16
profileForm['shipping_id'] = 1;
17
profileForm['shipping_name'] = "Luke's house";
18
19
// Add/update shipping profile.
20
User.addShippingProfile()
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 shipping_idproperty is provided, this method will update the profile corresponding to that ID. Otherwise, it will create a new profile.
Last modified 11mo ago
Copy link