Create a Customer
POST
Create a customer
https://api.moltin.com/v2/customers
Headers:
Name | Required | Type | Description |
---|---|---|---|
Authorization | Required | string | The Bearer token to grant access to the API. |
Body:
Name | Required | Type | Description |
---|---|---|---|
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. |
201 Created
{
"data": {
"type": "customer",
"id": "fc4679bf-f8a8-4029-bc67-945f74b756a0",
"name": "Ron Swanson+6",
"email": "ron+6@swanson.com",
"password": true
}
}
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"
}
}'
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
})