---
title: "Customers"
description: "Add customers, segment them, and record their activity."
url: "https://docs.goomzo.africa/docs/developers/go-sdk/customers"
docs_index: /llms.txt
lastUpdated: 2026-11-12
section: "Guides"
related:
  - /docs/developers/go-sdk/messages
  - /docs/developers/go-sdk/templates
  - /docs/developers/go-sdk/webhooks
---

> For an index of all documentation, see [/llms.txt](https://docs.goomzo.africa/llms.txt). Any page is also available as Markdown by adding .md to its URL.

# Customers

> Add customers, segment them, and record their activity.

`client.Customers`, `client.Segments` and `client.Activity` keep Goomzo in step with your own system. See
[Customers](https://docs.goomzo.africa/docs/developers/customers?utm_source=llms&utm_medium=ai).

## Add or update customers

```go
saved, err := client.Customers.Create(ctx, goomzo.CustomerCreateParams{
	IfExists: "update",
	Customers: []goomzo.NewCustomer{{
		Name:       "Amina Juma",
		Phone:      "+255712345678",
		Attributes: map[string]any{"plan": "gold"},
		Segments:   []goomzo.SegmentRef{{Name: "Shoppers"}},
		Activities: []goomzo.ActivityInput{{Key: "purchased", Value: "Shoes"}},
	}},
})

saved[0].Result // "created", "updated" or "unchanged"
```

## Record customer activity

```go
_, err := client.Activity.Record(ctx, goomzo.ActivityRecordParams{
	Phone:      "+255712345678",
	Activities: []goomzo.ActivityInput{{Key: "purchased", Value: "Shoes"}, {Key: "spent", Value: 45000}},
})
```

## Segments

```go
for customer, err := range client.Segments.Customers.List(ctx, "seg_4hq2v9n1c8x0t6pk") {
	if err != nil {
		return err
	}
	fmt.Println(customer.Name)
}

_, err := client.Segments.Customers.Add(ctx, "seg_4hq2v9n1c8x0t6pk", []string{"cus_4hq2v9n1c8x0t6pk"})
```

## Other methods

| Method                                    | Does                                 |
| ----------------------------------------- | ------------------------------------ |
| `Customers.List(ctx, params)`             | Lists customers, a page at a time.   |
| `Customers.Get(ctx, id)`                  | Gets one.                            |
| `Customers.Update(ctx, id, changes)`      | Changes one.                         |
| `Customers.Delete(ctx, id)`               | Deletes one.                         |
| `Customers.Segments.Set(ctx, id, names)`  | Sets the segments a customer is in.  |
| `Customers.Activity.List(ctx, id)`        | Lists a customer's activity.         |
| `Segments.Create(ctx, segment)`           | Adds a segment, by hand or by rules. |
| `Segments.Customers.Remove(ctx, id, ids)` | Takes customers out of a segment.    |

## Next steps

- [Lists](https://docs.goomzo.africa/docs/developers/go-sdk/lists?utm_source=llms&utm_medium=ai)
- [Send messages](https://docs.goomzo.africa/docs/developers/go-sdk/messages?utm_source=llms&utm_medium=ai)

---

For an index of all available documentation, see [/llms.txt](https://docs.goomzo.africa/llms.txt)
