Skip to main content

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 contact
  • email - Find by email address
  • shopifyId - Find by Shopify Customer ID
query GetContactByEmail($email: String) {
account {
contacts(email: $email) {
uuid
name
wallet {
uuid
}
}
}
}

Related types:

  • Contact - Contact object fields
  • Identity - External system identifiers
  • Wallet - 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:

Related types:

Deleting Contacts

Use the deleteContact mutation to delete a contact by UUID:

mutation DeleteContact($uuid: String!) {
deleteContact(uuid: $uuid) {
success
errors
}
}
warning

Deleting a contact will also remove their associated wallet and all credit entries. This action cannot be undone.

Next Steps