Get a Customer

get
Get by ID

https://api.moltin.com/v2/customers/:id
Request
Response
Path Parameters
id
required
string
The ID for the requested Customer.
Headers
X-Moltin-Customer-Token
optional
string
A customer token used to access a 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.
200: OK
{
"data": {
"type": "customer",
"id": "a23cc59d-a6c2-4c14-89c7-80fd7e4fc6c0",
"name": "Ron Swanson",
"email": "ronwanson@example.com",
"password": true
}
}
cURL
JavaScript SDK
Swift SDK
curl -X GET https://api.moltin.com/v2/customers/:id \
-H "Authorization: Bearer XXXX" \
const MoltinGateway = require('@moltin/sdk').gateway
const Moltin = MoltinGateway({
client_id: 'X',
client_secret: 'X'
})
const id = 'XXXX'
Moltin.Customers.Get(id).then(customer => {
// Do something
})
let moltin = Moltin(withClientID: "<your client ID>")
let id = "XXXX"
moltin.customer.get(forID: id) { result in
switch result {
case .success(let response):
print(response)
case .failure(let error):
print(error)
}
}

With customer token

cURL
JavaScript SDK
curl -X GET https://api.moltin.com/v2/customers/:id \
-H "X-Moltin-Customer-Token: XXXX"
-H "Authorization: Bearer XXXX"
const MoltinGateway = require('@moltin/sdk').gateway
const Moltin = MoltinGateway({
client_id: 'X'
})
const customerId = 'XXXX'
const addressId = 'XXXX'
const customerToken = 'XXXX'
Moltin.Addresses.All({
customer: customerId,
addresss: addressId,
token: customerToken
}).then(address => {
// Do something
})

Without customer token

cURL
curl -X GET https://api.moltin.com/v2/customers/:id \
-H "Authorization: Bearer XXXX"