Update a Customer

put
Update by ID

https://api.moltin.com/v2/customers/:customerId
Request
Response
Path Parameters
customerId
required
string
The ID for the customer requested
Headers
X-Moltin-Customer-Token
optional
string
A customer token used to access customer implicitly.
Authorization
required
string
The Bearer token to grant access to the API. If there is no customer token the grant type must be client_credentials.
Body Parameters
type
required
string
The type of object being returned.
name
optional
string
The full name of the customer.
email
optional
string
The customer email
password
optional
string
The customer password
200: OK
{
"data": {
"type": "customer",
"id": "b57022cf-c80e-4b85-9fd1-5af3156d8adf",
"name": "George example",
"email": "ron@swanson.com",
"password": true
}
}
cURL
JavaScript SDK
curl -X PUT https://api.moltin.com/v2/customers/:customerId \
-H "Authorization: Bearer XXXX" \
-H "Content-Type: application/json" \
-d $'{
"data": {
"type": "customer",
"email": "ron@swanson.com"
}
}'
const MoltinGateway = require('@moltin/sdk').gateway
const Moltin = MoltinGateway({
client_id: 'X'
})
var customerId = 'XXXX'
var customer = {
email: "ron@swanson.com"
}
Moltin.Customers.Update(customerId, customer).then((response) => {
// Do something
});

With customer token

cURL
curl -X GET https://api.moltin.com/v2/customers/:id \
-H "X-Moltin-Customer-Token: XXXX"
-H "Authorization: Bearer XXXX"
-d $'{
"data": {
"type": "customer",
"email": "ron@swanson.com"
}
}'

Without customer token

cURL
curl -X GET https://api.moltin.com/v2/customers/:id \
-H "Authorization: Bearer XXXX"
-d $'{
"data": {
"type": "customer",
"email": "ron@swanson.com"
}
}'