|
| 1 | +## Catalog Custom Attribute Definition |
| 2 | + |
| 3 | +Contains information defining a custom attribute. Custom attributes are |
| 4 | +intended to store additional information about a catalog object or to associate a |
| 5 | +catalog object with an entity in another system. Do not use custom attributes |
| 6 | +to store any sensitive information (personally identifiable information, card details, etc.). |
| 7 | +[Read more about custom attributes](https://developer.squareup.com/docs/catalog-api/add-custom-attributes) |
| 8 | + |
| 9 | +### Structure |
| 10 | + |
| 11 | +`CatalogCustomAttributeDefinition` |
| 12 | + |
| 13 | +### Fields |
| 14 | + |
| 15 | +| Name | Type | Tags | Description | |
| 16 | +| --- | --- | --- | --- | |
| 17 | +| `Type` | [`String`](/doc/models/catalog-custom-attribute-definition-type.md) | | Defines the possible types for a custom attribute. | |
| 18 | +| `Name` | `String` | | The name of this definition for API and seller-facing UI purposes.<br>The name must be unique within the (merchant, application_id) pair. Required.<br>May not be empty and may not exceed 255 characters. Can be modified after creation. | |
| 19 | +| `Description` | `String` | Optional | Seller-oriented description of the meaning of this Custom Attribute,<br>any constraints that the seller should observe, etc. May be displayed as a tooltip in Square UIs. | |
| 20 | +| `SourceApplication` | [`SourceApplication`](/doc/models/source-application.md) | Optional | Provides information about the application used to generate an inventory<br>change. | |
| 21 | +| `AllowedObjectTypes` | [`List<String>`](/doc/models/catalog-object-type.md) | Optional | The set of Catalog Object Types that this Custom Attribute may be applied to.<br>Currently, only `ITEM` and `ITEM_VARIATION` are allowed.<br>See [CatalogObjectType](#type-catalogobjecttype) for possible values | |
| 22 | +| `SellerVisibility` | [`String`](/doc/models/catalog-custom-attribute-definition-seller-visibility.md) | Optional | Defines the visibility of a custom attribute to sellers in Square<br>client applications, Square APIs or in Square UIs (including Square Point<br>of Sale applications and Square Dashboard). | |
| 23 | +| `AppVisibility` | [`String`](/doc/models/catalog-custom-attribute-definition-app-visibility.md) | Optional | Defines the visibility of a custom attribute to applications other than their<br>creating application. | |
| 24 | +| `StringConfig` | [`CatalogCustomAttributeDefinitionStringConfig`](/doc/models/catalog-custom-attribute-definition-string-config.md) | Optional | Configuration associated with Custom Attribute Definitions of type `STRING`. | |
| 25 | +| `SelectionConfig` | [`CatalogCustomAttributeDefinitionSelectionConfig`](/doc/models/catalog-custom-attribute-definition-selection-config.md) | Optional | Configuration associated with `SELECTION`-type custom attribute definitions. | |
| 26 | +| `CustomAttributeUsageCount` | `Integer` | Optional | __Read-only.__ The number of custom attributes that reference this<br>custom attribute definition. Set by the server in response to a ListCatalog<br>request with `include_counts` set to `true`. If the actual count is greater<br>than 100, `custom_attribute_usage_count` will be set to `100`. | |
| 27 | +| `Key` | `String` | Optional | The name of the desired custom attribute key that can be used to access<br>the custom attribute value on catalog objects. Cannot be modified after the<br>custom attribute definition has been created. | |
| 28 | + |
| 29 | +### Example (as JSON) |
| 30 | + |
| 31 | +```json |
| 32 | +{ |
| 33 | + "type": "NUMBER", |
| 34 | + "name": "name0", |
| 35 | + "description": null, |
| 36 | + "source_application": null, |
| 37 | + "allowed_object_types": null, |
| 38 | + "seller_visibility": null, |
| 39 | + "app_visibility": null, |
| 40 | + "string_config": null, |
| 41 | + "selection_config": null, |
| 42 | + "custom_attribute_usage_count": null, |
| 43 | + "key": null |
| 44 | +} |
| 45 | +``` |
| 46 | + |
0 commit comments