Retrieve customer custom attribute definition
Retrieves a customer-related custom attribute definition from a Square seller account.
To retrieve a custom attribute definition created 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 |
---|---|
key
Required
|
The key of the custom attribute definition to retrieve. If the requesting application is not the definition owner, you must use the qualified key. |
Name | Description |
---|---|
version
|
The current version of the custom attribute definition, 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 definition. |
errors
|
Any errors that occurred during the request. |
Examples
- cURL
- Ruby
- Python
- C#
- Java
- PHP
- Node.js
curl https://connect.squareup.com/v2/customers/custom-attribute-definitions/favoritemovie \
-H 'Square-Version: 2023-01-19' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-H 'Content-Type: application/json'
{
"custom_attribute_definition": {
"key": "favoritemovie",
"name": "Favorite Movie",
"description": "The favorite movie of the customer.",
"version": 1,
"updated_at": "2022-04-26T15:27:30Z",
"schema": {
"$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String"
},
"created_at": "2022-04-26T15:27:30Z",
"visibility": "VISIBILITY_READ_WRITE_VALUES"
}
}