/customer/{customerId}/location/{locationId}/update v1.0.0
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
Base URLs:
Customers
postCustomerIdLocationUpdate
Code samples
const inputBody = '{
"type": "object",
"properties": {
"params": {
"type": "object",
"properties": {
"description": {
"type": "string",
"nullable": true
},
"address1": {
"type": "string",
"nullable": true
},
"address2": {
"type": "string",
"nullable": true
},
"city": {
"type": "string",
"nullable": true
},
"region": {
"type": "string",
"nullable": true
},
"postalCode": {
"type": "string",
"nullable": true
},
"country": {
"type": "string",
"nullable": true
},
"phoneNumber": {
"type": "string",
"nullable": true
},
"erpId": {
"type": "string",
"nullable": true
}
}
}
}
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://goldleaf.app/api/v1/customer/{customerId}/location/{locationId}/update',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
POST /customer/{customerId}/location/{locationId}/update
Update or create a customer location
Updates an existing customer location or creates a new one if locationId is "new". Accessible to users with admin or regular roles. Access is blocked for users with the customer role.
Body parameter
{
"type": "object",
"properties": {
"params": {
"type": "object",
"properties": {
"description": {
"type": "string",
"nullable": true
},
"address1": {
"type": "string",
"nullable": true
},
"address2": {
"type": "string",
"nullable": true
},
"city": {
"type": "string",
"nullable": true
},
"region": {
"type": "string",
"nullable": true
},
"postalCode": {
"type": "string",
"nullable": true
},
"country": {
"type": "string",
"nullable": true
},
"phoneNumber": {
"type": "string",
"nullable": true
},
"erpId": {
"type": "string",
"nullable": true
}
}
}
}
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| customerId | path | string | true | The MongoDB ObjectId of the customer |
| locationId | path | string | true | none |
| body | body | object | true | none |
| » params | body | object | false | none |
| »» description | body | string¦null | false | none |
| »» address1 | body | string¦null | false | none |
| »» address2 | body | string¦null | false | none |
| »» city | body | string¦null | false | none |
| »» region | body | string¦null | false | none |
| »» postalCode | body | string¦null | false | none |
| »» country | body | string¦null | false | none |
| »» phoneNumber | body | string¦null | false | none |
| »» erpId | body | string¦null | false | none |
Example responses
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Customer location updated or created successfully | None |
