List customer custom attributes
Lists the custom attributes associated with a customer profile.
You can use the with_definitions
query parameter to also retrieve custom attribute definitions
in the same call.
When all response pages are retrieved, the results include all custom attributes that are
visible to the requesting application, including those that are owned by other applications
and set to VISIBILITY_READ_ONLY
or VISIBILITY_READ_WRITE_VALUES
.
Name | Description |
---|---|
customer_
Required
|
The ID of the target customer profile. |
Name | Description |
---|---|
limit
|
The maximum number of results to return in a single paged response. This limit is advisory. The response might contain more or fewer results. The minimum value is 1 and the maximum value is 100. The default value is 20. For more information, see Pagination. |
cursor
|
The cursor returned in the paged response from the previous call to this endpoint. Provide this cursor to retrieve the next page of results for your original request. For more information, see Pagination. |
with_
|
Indicates whether to return the custom attribute definition in the |
Response Fields
Name | Description |
---|---|
custom_
|
The retrieved custom attributes. If If no custom attributes are found, Square returns an empty object ( |
cursor
|
The cursor to use in your next call to this endpoint to retrieve the next page of results for your original request. This field is present only if the request succeeded and additional results are available. For more information, see Pagination. |
errors
|
Any errors that occurred during the request. |
Examples
- cURL
- Ruby
- Python
- C#
- Java
- PHP
- Node.js
curl https://connect.squareup.com/v2/customers/Z57QXKM2FGXEQDV42W8RBZY7BR/custom-attributes \
-H 'Square-Version: 2023-01-19' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-H 'Content-Type: application/json'
{
"custom_attributes": [
{
"key": "favoritemovie",
"version": 1,
"updated_at": "2022-04-26T15:50:27Z",
"value": "Dune",
"created_at": "2022-04-26T15:50:27Z",
"visibility": "VISIBILITY_READ_ONLY"
},
{
"key": "ownsmovie",
"version": 1,
"updated_at": "2022-04-26T15:51:53Z",
"value": false,
"created_at": "2022-04-26T15:51:53Z",
"visibility": "VISIBILITY_HIDDEN"
}
]
}