Skip to main content

Get customer by id

Below is an example of fetching the customer with ID 1:

note

Ensure that the authorization token with the correct admin privileges are included in the header

Request:

query getCustomerById{
customerConnection(filter:{ids:[1]}){
edges{
node{
id
firstName
lastName
email
userName
standardAddress{
streetAddress
city
postalCode
}
internalComment
priceList{
id
name{
value
}
}
status{
id
name{
value
}
}
category{
id
name{
value
}
}
}
}
}
}

Response:

{
"data": {
"customerConnection": {
"edges": [
{
"node": {
"id": 1,
"firstName": "Justin",
"lastName": "Case",
"email": "[email protected]",
"userName": "juscas",
"standardAddress": {
"streetAddress": "Järnvägsgatan 11",
"city": "Säffle",
"postalCode": "66132"
},
"internalComment": "Tends to pay late but always settles. Consider loyalty discount",
"priceList": {
"id": 2,
"name": "Prislista 2"
},
"status": {
"id": 0,
"name": ""
},
"category": null
}
}
]
}
}
}