Create a Customer

post
Create a customer

https://api.moltin.com/v2/customers
Request
Response
Request
Headers
Authorization
required
string
The Bearer token to grant access to the API.
Body Parameters
type
required
string
Represents the type of object being returned.
name
required
string
The full name of the customer.
email
required
string
The customer email.
password
optional
string
The customer password.
Response
201: Created
{
"data": {
"type": "customer",
"id": "fc4679bf-f8a8-4029-bc67-945f74b756a0",
"name": "Ron Swanson+6",
"email": "ron+6@swanson.com",
"password": true
}
}
cURL
JavaScript SDK
cURL
curl -X POST https://api.moltin.com/v2/customers \
-H "Authorization: Bearer XXXX" \
-H "Content-Type: application/json" \
-d $'{
"data": {
"type": "customer",
"name": "Ron Swanson",
"email": "ron@swanson.com",
"password": "mysecretpassword"
}
}'
JavaScript SDK
const MoltinGateway = require('@moltin/sdk').gateway
const Moltin = MoltinGateway({
client_id: 'X'
})
const customer = {
name: "Ron Swanson",
email: "ron@swanson.com",
password: "mysecretpassword",
}
Moltin.Customers.Create(customer).then(customer => {
// Do something
})