Retrieve customer custom attribute
Retrieves a custom attribute associated with a customer profile.
You can use the with_definition
query parameter to also retrieve the custom attribute definition
in the same call.
To retrieve a custom attribute owned by another application, the visibility
setting must be
VISIBILITY_READ_ONLY
or VISIBILITY_READ_WRITE_VALUES
. Note that seller-defined custom attributes
(also known as custom fields) are always set to VISIBILITY_READ_WRITE_VALUES
.
Name | Description |
---|---|
customer_
Required
|
The ID of the target customer profile. |
key
Required
|
The key of the custom attribute to retrieve. This key must match the |
Name | Description |
---|---|
with_
|
Indicates whether to return the custom attribute definition in the |
version
|
The current version of the custom attribute, which is used for strongly consistent reads to
guarantee that you receive the most up-to-date data. When included in the request, Square
returns the specified version or a higher version if one exists. If the specified version is
higher than the current version, Square returns a |
Response Fields
Name | Description |
---|---|
custom_
|
The retrieved custom attribute. If |
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/favoritemovie \
-H 'Square-Version: 2023-01-19' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-H 'Content-Type: application/json'
{
"custom_attribute": {
"key": "favoritemovie",
"version": 1,
"updated_at": "2022-04-26T15:50:27Z",
"value": "Dune",
"created_at": "2022-04-26T15:50:27Z",
"visibility": "VISIBILITY_READ_ONLY"
}
}