Customers

Customer Segment Members

A CustomerSegmentMember is the association between a Customer and a CustomerSegment. It tracks whether the customer is currently subscribed to receive communications for that segment.

The CustomerSegmentMember object

Attributes

  • iduuidrequired

    The unique identifier of the segment membership record.

  • segment_iduuidrequired

    The ID of the segment this membership belongs to.

  • unsubscribed_atdate-timerequirednullable

    The datetime at which the customer unsubscribed from this segment's communications, or null if they are currently subscribed.

  • customerobjectrequired

    A summary of the Customer this order belongs to.

{
  "id": "00000000-0000-0000-0000-000000000000",
  "segment_id": "00000000-0000-0000-0000-000000000000",
  "unsubscribed_at": "2026-01-15T09:30:00+00:00",
  "customer": {
    "id": "00000000-0000-0000-0000-000000000000",
    "email": "guest@example.com",
    "first_name": "Alex",
    "full_name": "Alex Morgan",
    "labels": [
      {
        "id": "00000000-0000-0000-0000-000000000000",
        "color": "#FF0066",
        "name": "Alex Morgan"
      }
    ],
    "last_name": "Morgan",
    "phone": "+447700900000"
  }
}
get/shop/customers/customer-segments/{customerSegmentId}/members

List CustomerSegmentMembers

listCustomerSegmentMembers

Returns a paginated list of members belonging to the given CustomerSegment.

Path parameters

Query parameters

  • querystringoptional

    Filters members whose customer name or email contains the given value.

  • subscribedbooleanoptional

    When true, only subscribed members are returned. When false, only unsubscribed members are returned.

  • pageintegeroptional

    The page to retrieve results from

  • per_pageintegeroptional

    The number of results to return per page

Responses

  • 200

    The segment members were successfully retrieved.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

post/shop/customers/customer-segments/{customerSegmentId}/members

Add CustomerSegmentMember

createCustomerSegmentMember

Adds a customer to the given CustomerSegment.

Path parameters

Request body

  • customer_iduuidrequired

    The ID of the customer to add to the segment.

Responses

  • 201

    The segment member was successfully retrieved.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

  • 422

    The request didn't pass validation

get/shop/customers/customer-segments/{customerSegmentId}/members/{memberId}

Get CustomerSegmentMember

getCustomerSegmentMember

Returns the CustomerSegmentMember with the given ID.

Path parameters

  • customerSegmentIduuidrequired

    The unique identifier of the customer segment.

  • memberIduuidrequired

    The unique identifier of the segment membership record.

Responses

  • 200

    The segment member was successfully retrieved.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

put/shop/customers/customer-segments/{customerSegmentId}/members/{memberId}

Update CustomerSegmentMember

updateCustomerSegmentMember

Updates the subscription state of the given segment member.

Path parameters

  • customerSegmentIduuidrequired

    The unique identifier of the customer segment.

  • memberIduuidrequired

    The unique identifier of the segment membership record.

Request body

  • subscribedbooleanoptional

    Set to true to re-subscribe the customer to this segment's communications, or false to unsubscribe them.

Responses

  • 200

    The segment member was successfully retrieved.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

  • 422

    The request didn't pass validation

delete/shop/customers/customer-segments/{customerSegmentId}/members/{memberId}

Remove CustomerSegmentMember

deleteCustomerSegmentMember

Removes a customer from the given CustomerSegment.

Path parameters

  • customerSegmentIduuidrequired

    The unique identifier of the customer segment.

  • memberIduuidrequired

    The unique identifier of the segment membership record.

Responses

  • 204

    The customer was successfully removed from the segment.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found