Managing Contacts
Contacts represent individuals in your system who can have wallets, credit balances, and redemption codes. Each contact can be linked to external systems like Shopify, Klaviyo, or Lightspeed through identity mappings.
Prerequisites
Before managing contacts, ensure you have authenticated with a valid API token.
Querying Contacts
Contacts are accessed via the account query. The Account type provides a contacts field with filtering and pagination options.
List All Contacts
query GetContacts($limit: Int, $offset: Int) {
account {
contacts(limit: $limit, offset: $offset) {
uuid
name
email
phone
identities {
shopify
klaviyo
lightspeed
}
wallet {
uuid
globalCreditBalance
localCreditBalance
}
}
}
}
Filter Contacts
The contacts field supports filtering by:
uuid- Get a specific contactemail- Find by email addressshopifyId- Find by Shopify Customer ID
query GetContactByEmail($email: String) {
account {
contacts(email: $email) {
uuid
name
wallet {
uuid
}
}
}
}
Related types:
Contact- Contact object fieldsIdentity- External system identifiersWallet- Associated wallet with credit balances
Creating Contacts
Use the createContact mutation to create a new contact:
mutation CreateContact($contact: ContactInput!) {
createContact(contact: $contact) {
success
contact {
uuid
wallet {
uuid
}
}
errors
}
}
Variables:
{
"contact": {
"email": "customer@example.com",
"name": "John Doe",
"phone": "+1234567890",
"identities": {
"shopifyId": "gid://shopify/Customer/123456789"
},
"connectedServices": ["SHOPIFY"]
}
}
When SHOPIFY is included in connectedServices, the contact will automatically be created as a customer in your connected Shopify store.
Related types:
ContactInput- Input fields for creating a contactIdentityInput- External system identifiersCreateContactResponse- Response type
Related types:
ConnectedServiceType- Available service typesContactOperationResponse- Response type
Deleting Contacts
Use the deleteContact mutation to delete a contact by UUID:
mutation DeleteContact($uuid: String!) {
deleteContact(uuid: $uuid) {
success
errors
}
}
Deleting a contact will also remove their associated wallet and all credit entries. This action cannot be undone.
Next Steps
- Managing Credit - Add and view credit entries for contacts
- Creating a Redemption - Generate redemption codes for contacts