Contains information defining a custom attribute. Custom attributes are intended to store additional information about a catalog object or to associate a catalog object with an entity in another system. Do not use custom attributes to store any sensitive information (personally identifiable information, card details, etc.). Read more about custom attributes
Catalog Custom Attribute Definition
Name | Type | Tags | Description |
---|---|---|---|
type |
str (Catalog Custom Attribute Definition Type) |
Required | Defines the possible types for a custom attribute. |
name |
string |
Required | The name of this definition for API and seller-facing UI purposes. The name must be unique within the (merchant, application) pair. Required. May not be empty and may not exceed 255 characters. Can be modified after creation. Constraints: Minimum Length: 1 , Maximum Length: 255 |
description |
string |
Optional | Seller-oriented description of the meaning of this Custom Attribute, any constraints that the seller should observe, etc. May be displayed as a tooltip in Square UIs. Constraints: Maximum Length: 255 |
source_application |
Source Application |
Optional | Provides information about the application used to generate a change. |
allowed_object_types |
List of str (Catalog Object Type) |
Required | The set of Catalog Object Types that this Custom Attribute may be applied to. Currently, only ITEM and ITEM_VARIATION are allowed. At least one type must be included.See CatalogObjectType for possible values |
seller_visibility |
str (Catalog Custom Attribute Definition Seller Visibility) |
Optional | Defines the visibility of a custom attribute to sellers in Square client applications, Square APIs or in Square UIs (including Square Point of Sale applications and Square Dashboard). |
app_visibility |
str (Catalog Custom Attribute Definition App Visibility) |
Optional | Defines the visibility of a custom attribute to applications other than their creating application. |
string_config |
Catalog Custom Attribute Definition String Config |
Optional | Configuration associated with Custom Attribute Definitions of type STRING . |
number_config |
Catalog Custom Attribute Definition Number Config |
Optional | - |
selection_config |
Catalog Custom Attribute Definition Selection Config |
Optional | Configuration associated with SELECTION -type custom attribute definitions. |
custom_attribute_usage_count |
int |
Optional | Read-only. The number of custom attributes that reference this custom attribute definition. Set by the server in response to a ListCatalog request with include_counts set to true . If the actual count is greaterthan 100, custom_attribute_usage_count will be set to 100 . |
key |
string |
Optional | The name of the desired custom attribute key that can be used to access the custom attribute value on catalog objects. Cannot be modified after the custom attribute definition has been created. Must be between 1 and 60 characters, and may only contain the characters [a-zA-Z0-9_-] .Constraints: Minimum Length: 1 , Maximum Length: 60 , Pattern: ^[a-zA-Z0-9_-]*$ |
{
"type": "NUMBER",
"name": "name0",
"description": "description0",
"source_application": {
"product": "BILLING",
"application_id": "application_id8",
"name": "name2"
},
"allowed_object_types": [
"PRICING_RULE",
"PRODUCT_SET",
"TIME_PERIOD"
],
"seller_visibility": "SELLER_VISIBILITY_HIDDEN",
"app_visibility": "APP_VISIBILITY_HIDDEN",
"string_config": {
"enforce_uniqueness": false
}
}