customerSignUp
Overview
Create a customer profile using CustomerSignupInput. Provide identifier (email/phone), name, country, and type to align with your market’s requirements. The response returns token for authenticated calls.
- Type: GraphQL Mutation
- Endpoint: https://subdomain.com
- Authentication: Typically public (no token) since this is signup
Mutation
mutation CustomerSignup($input: CustomerSignupInput!) {
customerSignup(input: $input) {
success
message
token
}
}
Variables
{
"input": {
"fullname": "John Doe",
"identifier": "user@example.com",
"type": "email",
"country": "SA"
}
}
Examples
- cURL
- JavaScript (fetch)
curl -X POST \
https://subdomain.com\
-H "Content-Type": "application/json" \
--data-binary @- << 'EOF'
{
"query": "mutation CustomerSignup($input: CustomerSignupInput!) { customerSignup(input: $input) { success message token } }",
"variables": {
"input": {
"fullname": "John Doe",
"identifier": "user@example.com",
"type": "email",
"country": "SA"
}
}
}
EOF
const res = await fetch('https://subdomain.com', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
query: `
mutation CustomerSignup($input: CustomerSignupInput!) {
customerSignup(input: $input) {
success
message
token
}
}
`,
variables: {
input: {
fullname: 'John Doe',
identifier: 'user@example.com',
type: 'email',
country: 'SA',
},
},
}),
});
const json = await res.json();
Notes
- Some stores require additional fields (password, OTP, marketing consent). Extend
CustomerSignupInputto match your backend. - Store the returned
tokensecurely (e.g., HTTP-only cookie) for subsequent authenticated GraphQL calls. - Combine with
customerLoginif your flow first creates an account then logs in automatically.