Skip to content

Latest commit

 

History

History
45 lines (35 loc) · 1.46 KB

retrieve-customer-segment-response.md

File metadata and controls

45 lines (35 loc) · 1.46 KB

Retrieve Customer Segment Response

Defines the fields that are included in the response body for requests to the RetrieveCustomerSegment endpoint.

Either errors or segment is present in a given response (never both).

Structure

RetrieveCustomerSegmentResponse

Fields

Name Type Tags Description Getter Setter
errors ?(Error[]) Optional Any errors that occurred during the request. getErrors(): ?array setErrors(?array errors): void
segment ?CustomerSegment Optional Represents a group of customer profiles that match one or more predefined filter criteria.

Segments (also known as Smart Groups) are defined and created within the Customer Directory in the
Square Seller Dashboard or Point of Sale.
getSegment(): ?CustomerSegment setSegment(?CustomerSegment segment): void

Example (as JSON)

{
  "segment": {
    "created_at": "2020-01-09T19:33:24.469Z",
    "id": "GMNXRZVEXNQDF.CHURN_RISK",
    "name": "Lapsed",
    "updated_at": "2020-04-13T23:01:13Z"
  },
  "errors": [
    {
      "category": "MERCHANT_SUBSCRIPTION_ERROR",
      "code": "MAP_KEY_LENGTH_TOO_LONG",
      "detail": "detail6",
      "field": "field4"
    },
    {
      "category": "MERCHANT_SUBSCRIPTION_ERROR",
      "code": "MAP_KEY_LENGTH_TOO_LONG",
      "detail": "detail6",
      "field": "field4"
    }
  ]
}